This commit is contained in:
Silent YANG 2024-06-08 00:42:10 +08:00
parent ec2a1999ee
commit 048da93d7d
80 changed files with 171 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

11
public/diy/genJson.py Normal file
View file

@ -0,0 +1,11 @@
import os
import json
list = []
for filename in os.listdir(r'.'):
if filename[-1] == 'n':
list.append(filename)
print(json.dumps(list))
with open("version.json","w") as file:
file.write(json.dumps(list))

1
public/diy/version.json Normal file
View file

@ -0,0 +1 @@
["LOSEHU0000000.bin", "LOSEHU0000001.bin", "LOSEHU0000010.bin", "LOSEHU0000011.bin", "LOSEHU0000400.bin", "LOSEHU0000401.bin", "LOSEHU0000F00.bin", "LOSEHU0000F01.bin", "LOSEHU0000F10.bin", "LOSEHU0000F11.bin", "LOSEHU0001000.bin", "LOSEHU0001001.bin", "LOSEHU0001010.bin", "LOSEHU0001011.bin", "LOSEHU0001F00.bin", "LOSEHU0001F01.bin", "LOSEHU0010000.bin", "LOSEHU0010001.bin", "LOSEHU0010010.bin", "LOSEHU0010011.bin", "LOSEHU0010F00.bin", "LOSEHU0010F01.bin", "LOSEHU0011000.bin", "LOSEHU0011001.bin", "LOSEHU0101000.bin", "LOSEHU0101001.bin", "LOSEHU0101010.bin", "LOSEHU0101011.bin", "LOSEHU4000000.bin", "LOSEHU4000001.bin", "LOSEHU4000010.bin", "LOSEHU4000011.bin", "LOSEHU4000400.bin", "LOSEHU4000401.bin", "LOSEHU4000410.bin", "LOSEHU4000411.bin", "LOSEHU4000F00.bin", "LOSEHU4000F01.bin", "LOSEHU4000F10.bin", "LOSEHU4000F11.bin", "LOSEHU4001000.bin", "LOSEHU4001001.bin", "LOSEHU4001010.bin", "LOSEHU4001011.bin", "LOSEHU4001400.bin", "LOSEHU4001401.bin", "LOSEHU4001F00.bin", "LOSEHU4001F01.bin", "LOSEHU4001F10.bin", "LOSEHU4001F11.bin", "LOSEHU4010000.bin", "LOSEHU4010001.bin", "LOSEHU4010010.bin", "LOSEHU4010011.bin", "LOSEHU4010400.bin", "LOSEHU4010401.bin", "LOSEHU4010F00.bin", "LOSEHU4010F01.bin", "LOSEHU4010F10.bin", "LOSEHU4010F11.bin", "LOSEHU4011000.bin", "LOSEHU4011001.bin", "LOSEHU4011010.bin", "LOSEHU4011011.bin", "LOSEHU4011F00.bin", "LOSEHU4011F01.bin", "LOSEHU4101000.bin", "LOSEHU4101001.bin", "LOSEHU4101010.bin", "LOSEHU4101011.bin", "LOSEHU4101F00.bin", "LOSEHU4101F01.bin", "LOSEHU4111000.bin", "LOSEHU4111001.bin", "LOSEHU4111010.bin", "LOSEHU4111011.bin"]

View file

@ -31,7 +31,17 @@ const IDEA: AppRouteRecordRaw = {
requiresAuth: true,
roles: ['*'],
},
}
},
{
path: 'losehu',
name: 'ideaLosehu',
component: () => import('@/views/idea/losehu/index.vue'),
meta: {
locale: '自定义萝卜固件',
requiresAuth: true,
roles: ['*'],
},
},
],
};

View file

@ -0,0 +1,148 @@
<template>
<div class="container">
<Breadcrumb :items="[$t('menu.workshop'), '自定义萝卜固件']" />
<a-row :gutter="20" align="stretch">
<a-col :span="24">
<a-card class="general-card" title="自定义萝卜固件">
<t-space direction="vertical">
<a-radio-group v-model="state.flag[0]" type="button">
<a-radio value="0" :disabled="state.disMatrix[0]['0']">英文信道</a-radio>
<a-radio value="4" :disabled="state.disMatrix[0]['4']">中文信道</a-radio>
</a-radio-group>
<a-radio-group v-model="state.flag[1]" type="button">
<a-radio value="0" :disabled="state.disMatrix[1]['0']">停用短信功能</a-radio>
<a-radio value="1" :disabled="state.disMatrix[1]['1']">开启短信功能</a-radio>
</a-radio-group>
<a-radio-group v-model="state.flag[2]" type="button">
<a-radio value="0" :disabled="state.disMatrix[2]['0']">停用多普勒</a-radio>
<a-radio value="1" :disabled="state.disMatrix[2]['1']">开启多普勒</a-radio>
</a-radio-group>
<a-radio-group v-model="state.flag[3]" type="button">
<a-radio value="0" :disabled="state.disMatrix[3]['0']">停用MDC信令</a-radio>
<a-radio value="1" :disabled="state.disMatrix[3]['1']">开启MDC信令</a-radio>
</a-radio-group>
<a-radio-group v-model="state.flag[4]" type="button">
<a-radio value="0" :disabled="state.disMatrix[4]['0']">停用收音机</a-radio>
<a-radio value="F" :disabled="state.disMatrix[4]['F']">默认收音机</a-radio>
<a-radio value="4" :disabled="state.disMatrix[4]['4']">SI4732收音机</a-radio>
</a-radio-group>
<a-radio-group v-model="state.flag[5]" type="button">
<a-radio value="0" :disabled="state.disMatrix[5]['0']">停用输入法</a-radio>
<a-radio value="1" :disabled="state.disMatrix[4]['1']">开启输入法</a-radio>
</a-radio-group>
<a-radio-group v-model="state.flag[6]" type="button">
<a-radio value="0" :disabled="state.disMatrix[6]['0']">停用频谱仪</a-radio>
<a-radio value="1" :disabled="state.disMatrix[6]['1']">开启频谱仪</a-radio>
</a-radio-group>
<a-button type="primary" @click="useFirmware">生成</a-button>
</t-space>
</a-card>
</a-col>
</a-row>
</div>
</template>
<script lang="ts" setup>
import { reactive, onMounted, watch } from 'vue';
import { useAppStore, useUserStore } from '@/store';
import { useRouter } from 'vue-router';
const router = useRouter()
const useFirmware = () => {
router.push({
path: '/tool/flash',
query: {
url: '/diy/LOSEHU' + state.flag.join('') + '.bin'
}
});
}
const state = reactive({
versions: [],
flag: ['0','0','0','0','0','0','0'],
disMatrix: [
{0: false, 4: false},
{0: false, 1: false},
{0: false, 1: false},
{0: false, 1: false},
{0: false, F: false, 4: false},
{0: false, 1: false},
{0: false, 1: false},
]
})
watch(state.flag, ()=>{
state.flag.map((e,i)=>{
Object.keys(state.disMatrix[i]).map((ex)=>{
if(state.versions.indexOf('LOSEHU' + state.flag.join('').substring(0, i) + ex + state.flag.join('').substring(i+1) + '.bin') == -1){
state.disMatrix[i][ex] = true
}else{
state.disMatrix[i][ex] = false
}
})
})
})
const updateMatrix = () => {
}
onMounted(async ()=>{
const versions = await (await fetch('/diy/version.json')).text()
state.versions = JSON.parse(versions)
})
</script>
<script lang="ts">
export default {
name: 'Backup',
};
</script>
<style scoped lang="less">
.container {
padding: 0 20px 20px 20px;
:deep(.arco-list-content) {
overflow-x: hidden;
}
:deep(.arco-card-meta-title) {
font-size: 14px;
}
}
:deep(.arco-list-col) {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
:deep(.arco-list-item) {
width: 33%;
}
:deep(.block-title) {
margin: 0 0 12px 0;
font-size: 14px;
}
:deep(.list-wrap) {
// min-height: 140px;
.list-row {
align-items: stretch;
.list-col {
margin-bottom: 16px;
}
}
:deep(.arco-space) {
width: 100%;
.arco-space-item {
&:last-child {
flex: 1;
}
}
}
}
</style>