Compare commits

...

3 commits

Author SHA1 Message Date
c56e4e5608 update 2024-07-06 17:00:30 +08:00
53d42d6314 update 2024-07-06 15:51:52 +08:00
8eb67e1d62 update 2024-07-06 15:51:15 +08:00
5 changed files with 164 additions and 36 deletions

View file

@ -1,30 +1,135 @@
<!DOCTYPE html>
<html lang="zh-cmn">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>K5Web</title>
<style>
::-webkit-scrollbar {
width: 12px;
height: 4px;
}
::-webkit-scrollbar-thumb {
border: 4px solid transparent;
background-clip: padding-box;
border-radius: 7px;
background-color: var(--color-text-4);
}
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>K5Web</title>
<style>
::-webkit-scrollbar {
width: 12px;
height: 4px;
}
::-webkit-scrollbar-thumb:hover {
background-color: var(--color-text-3);
::-webkit-scrollbar-thumb {
border: 4px solid transparent;
background-clip: padding-box;
border-radius: 7px;
background-color: var(--color-text-4);
}
::-webkit-scrollbar-thumb:hover {
background-color: var(--color-text-3);
}
</style>
<style>
#loading-mask {
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
background: #fff;
user-select: none;
z-index: 9999;
overflow: hidden;
}
.loading-wrapper {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -100%);
}
.loading-dot {
animation: antRotate 1.2s infinite linear;
transform: rotate(45deg);
position: relative;
display: inline-block;
font-size: 64px;
width: 64px;
height: 64px;
box-sizing: border-box;
}
.loading-dot i {
width: 22px;
height: 22px;
position: absolute;
display: block;
background-color: #1890ff;
border-radius: 100%;
transform: scale(0.75);
transform-origin: 50% 50%;
opacity: 0.3;
animation: antSpinMove 1s infinite linear alternate;
}
.loading-dot i:nth-child(1) {
top: 0;
left: 0;
}
.loading-dot i:nth-child(2) {
top: 0;
right: 0;
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.loading-dot i:nth-child(3) {
right: 0;
bottom: 0;
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.loading-dot i:nth-child(4) {
bottom: 0;
left: 0;
-webkit-animation-delay: 1.2s;
animation-delay: 1.2s;
}
@keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
</style>
<script src="serial.js"></script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
}
@-webkit-keyframes antRotate {
to {
-webkit-transform: rotate(405deg);
transform: rotate(405deg);
}
}
@keyframes antSpinMove {
to {
opacity: 1;
}
}
@-webkit-keyframes antSpinMove {
to {
opacity: 1;
}
}
</style>
<script src="serial.js"></script>
</head>
<body>
<div id="app">
<div id="loading-mask">
<div class="loading-wrapper">
<span class="loading-dot loading-dot-spin"><i></i><i></i><i></i><i></i></span>
</div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

BIN
public/K5Channel_EN.xlsx Normal file

Binary file not shown.

View file

@ -29,6 +29,8 @@ import localeUserSetting from '@/views/user/setting/locale/en-US';
import localeSettings from './en-US/settings';
export default {
'On': 'On',
'Off': 'Off',
'menu.dashboard': 'CPS',
'menu.cps.channel': 'Channel',
'menu.cps.settings': 'Settings',

View file

@ -29,6 +29,8 @@ import localeUserSetting from '@/views/user/setting/locale/zh-CN';
import localeSettings from './zh-CN/settings';
export default {
'On': '开',
'Off': '关',
'menu.dashboard': '写频',
'menu.cps.channel': '信道管理',
'menu.cps.settings': '设置管理',

View file

@ -102,7 +102,7 @@
</template>
<script lang="ts" setup>
import { ref, computed, reactive, onMounted } from 'vue';
import { ref, computed, reactive, onMounted, onBeforeMount } from 'vue';
import { useRoute } from 'vue-router';
import { Input, Select } from 'tdesign-vue-next';
import useLoading from '@/hooks/loading';
@ -120,7 +120,9 @@
const state = {
bandwidthOption: {'0': '25KHz', '1': '12.5KHz'},
modeOption: {'0': 'FM', '1': 'AM', '2': 'USB'},
powerOptionEng: {'0': 'Low', '1': 'Med', '2': 'High'},
powerOption: {'0': '低', '1': '中', '2': '高'},
toneOptionEng: {'1':'Tone','2':'DTCS(N)','3':'DTCS(I)'},
toneOption: {'1':'亚音频','2':'数字亚音','3':'反向数字亚音'},
CTCSSOption: [67.0, 69.3, 71.9, 74.4, 77.0, 79.7, 82.5, 85.4,
88.5, 91.5, 94.8, 97.4, 100.0, 103.5, 107.2, 110.9,
@ -141,6 +143,7 @@
731, 732, 734, 743, 754],
stepOption: [2.50, 5.00, 6.25, 10.00, 12.50, 25.00, 8.33, 0.01, 0.05, 0.10, 0.25, 0.50, 1.00, 1.25, 9.00, 15.00, 20.00, 30.00, 50.00, 100.00, 125.00, 200.00, 250.00, 500.00],
scrambOption: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
pttidOptionEng: ['UP CODE', 'DOWW CODE', 'UP+DOWN Code', 'APOLLO QUINDAR'],
pttidOption: ['上线码', '下线码', '上线+下线码', 'Quindar码']
}
@ -164,6 +167,14 @@
const route = useRoute();
onBeforeMount(()=>{
if(t('menu.dashboard') == 'CPS'){
state.powerOption = state.powerOptionEng
state.toneOption = state.toneOptionEng
state.pttidOption = state.pttidOptionEng
}
})
onMounted(async ()=>{
if(route.query.url){
const packet = await fetch(route.query.url)
@ -218,13 +229,13 @@
renderData[i - 2]['step'] = parseFloat(workbook.Sheets.Sheet1['M' + i]?.w)
}
if(workbook.Sheets.Sheet1['N' + i]?.w){
renderData[i - 2]['reverse'] = workbook.Sheets.Sheet1['N' + i]?.w == '开' ? true : false
renderData[i - 2]['reverse'] = workbook.Sheets.Sheet1['N' + i]?.w == t('On') ? true : false
}
if(workbook.Sheets.Sheet1['O' + i]?.w){
renderData[i - 2]['scramb'] = parseFloat(workbook.Sheets.Sheet1['O' + i]?.w)
}
if(workbook.Sheets.Sheet1['P' + i]?.w){
renderData[i - 2]['busy'] = workbook.Sheets.Sheet1['P' + i]?.w == '开' ? true : false
renderData[i - 2]['busy'] = workbook.Sheets.Sheet1['P' + i]?.w == t('On') ? true : false
}
if(workbook.Sheets.Sheet1['Q' + i]?.w){
renderData[i - 2]['pttid'] = workbook.Sheets.Sheet1['Q' + i]?.w
@ -233,7 +244,7 @@
renderData[i - 2]['mode'] = Object.keys(state.modeOption).find(key=>state.modeOption[key]==workbook.Sheets.Sheet1['R' + i]?.w)
}
if(workbook.Sheets.Sheet1['S' + i]?.w){
renderData[i - 2]['dtmf'] = workbook.Sheets.Sheet1['S' + i]?.w == '开' ? true : false
renderData[i - 2]['dtmf'] = workbook.Sheets.Sheet1['S' + i]?.w == t('On') ? true : false
}
if(workbook.Sheets.Sheet1['T' + i]?.w){
if(workbook.Sheets.Sheet1['T' + i]?.w.split(',').indexOf('I') >= 0){
@ -777,13 +788,21 @@
const downloadExcelTemplate = () => {
const a = document.createElement('a');
a.href = '/K5Channel.xlsx';
if(t('menu.dashboard') == 'CPS'){
a.href = '/K5Channel_EN.xlsx';
}
a.download = 'K5Channel.xlsx';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
};
const saveExcelChannel = async () => {
const template = await fetch('/K5Channel.xlsx');
let template = undefined;
if(t('menu.dashboard') == 'CPS'){
template = await fetch('/K5Channel_EN.xlsx');
}else{
template = await fetch('/K5Channel.xlsx');
}
const workbook = xlsxRead(await template.arrayBuffer());
const worksheet = workbook.Sheets[workbook.SheetNames[0]];
for(let i = 2; i < 202; i++){
@ -837,7 +856,7 @@
}
if(cstate.renderData[i - 2]?.reverse){
worksheet['N' + i] = {}
worksheet['N' + i].v = cstate.renderData[i - 2]?.reverse == true ? '开' : '关'
worksheet['N' + i].v = cstate.renderData[i - 2]?.reverse == true ? t('On') : t('Off')
}
if(cstate.renderData[i - 2]?.scramb){
worksheet['O' + i] = {}
@ -845,7 +864,7 @@
}
if(cstate.renderData[i - 2]?.busy){
worksheet['P' + i] = {}
worksheet['P' + i].v = cstate.renderData[i - 2]?.busy == true ? '开' : '关'
worksheet['P' + i].v = cstate.renderData[i - 2]?.busy == true ? t('On') : t('Off')
}
if(cstate.renderData[i - 2]?.pttid){
worksheet['Q' + i] = {}
@ -857,7 +876,7 @@
}
if(cstate.renderData[i - 2]?.dtmf){
worksheet['S' + i] = {}
worksheet['S' + i].v = cstate.renderData[i - 2]?.dtmf == true ? '开' : '关'
worksheet['S' + i].v = cstate.renderData[i - 2]?.dtmf == true ? t('On') : t('Off')
}
if(cstate.renderData[i - 2]?.scanlist){
worksheet['T' + i] = {}
@ -921,13 +940,13 @@
renderData[i - 2]['step'] = parseFloat(workbook.Sheets.Sheet1['M' + i]?.w)
}
if(workbook.Sheets.Sheet1['N' + i]?.w){
renderData[i - 2]['reverse'] = workbook.Sheets.Sheet1['N' + i]?.w == '开' ? true : false
renderData[i - 2]['reverse'] = workbook.Sheets.Sheet1['N' + i]?.w == t('On') ? true : false
}
if(workbook.Sheets.Sheet1['O' + i]?.w){
renderData[i - 2]['scramb'] = parseFloat(workbook.Sheets.Sheet1['O' + i]?.w)
}
if(workbook.Sheets.Sheet1['P' + i]?.w){
renderData[i - 2]['busy'] = workbook.Sheets.Sheet1['P' + i]?.w == '开' ? true : false
renderData[i - 2]['busy'] = workbook.Sheets.Sheet1['P' + i]?.w == t('On') ? true : false
}
if(workbook.Sheets.Sheet1['Q' + i]?.w){
renderData[i - 2]['pttid'] = workbook.Sheets.Sheet1['Q' + i]?.w
@ -936,7 +955,7 @@
renderData[i - 2]['mode'] = Object.keys(state.modeOption).find(key=>state.modeOption[key]==workbook.Sheets.Sheet1['R' + i]?.w)
}
if(workbook.Sheets.Sheet1['S' + i]?.w){
renderData[i - 2]['dtmf'] = workbook.Sheets.Sheet1['S' + i]?.w == '开' ? true : false
renderData[i - 2]['dtmf'] = workbook.Sheets.Sheet1['S' + i]?.w == t('On') ? true : false
}
if(workbook.Sheets.Sheet1['T' + i]?.w){
if(workbook.Sheets.Sheet1['T' + i]?.w.split(',').indexOf('I') >= 0){