mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 08:15:18 +00:00
Compare commits
3 commits
1cb7051a5e
...
c56e4e5608
Author | SHA1 | Date | |
---|---|---|---|
c56e4e5608 | |||
53d42d6314 | |||
8eb67e1d62 |
5 changed files with 164 additions and 36 deletions
155
index.html
155
index.html
|
@ -1,30 +1,135 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="zh-cmn">
|
<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 {
|
<head>
|
||||||
border: 4px solid transparent;
|
<meta charset="UTF-8" />
|
||||||
background-clip: padding-box;
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
border-radius: 7px;
|
<title>K5Web</title>
|
||||||
background-color: var(--color-text-4);
|
<style>
|
||||||
}
|
::-webkit-scrollbar {
|
||||||
|
width: 12px;
|
||||||
|
height: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
::-webkit-scrollbar-thumb {
|
||||||
background-color: var(--color-text-3);
|
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>
|
@-webkit-keyframes antRotate {
|
||||||
<body>
|
to {
|
||||||
<div id="app"></div>
|
-webkit-transform: rotate(405deg);
|
||||||
<script type="module" src="/src/main.ts"></script>
|
transform: rotate(405deg);
|
||||||
</body>
|
}
|
||||||
</html>
|
}
|
||||||
|
|
||||||
|
@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
BIN
public/K5Channel_EN.xlsx
Normal file
Binary file not shown.
|
@ -29,6 +29,8 @@ import localeUserSetting from '@/views/user/setting/locale/en-US';
|
||||||
import localeSettings from './en-US/settings';
|
import localeSettings from './en-US/settings';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
'On': 'On',
|
||||||
|
'Off': 'Off',
|
||||||
'menu.dashboard': 'CPS',
|
'menu.dashboard': 'CPS',
|
||||||
'menu.cps.channel': 'Channel',
|
'menu.cps.channel': 'Channel',
|
||||||
'menu.cps.settings': 'Settings',
|
'menu.cps.settings': 'Settings',
|
||||||
|
|
|
@ -29,6 +29,8 @@ import localeUserSetting from '@/views/user/setting/locale/zh-CN';
|
||||||
import localeSettings from './zh-CN/settings';
|
import localeSettings from './zh-CN/settings';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
'On': '开',
|
||||||
|
'Off': '关',
|
||||||
'menu.dashboard': '写频',
|
'menu.dashboard': '写频',
|
||||||
'menu.cps.channel': '信道管理',
|
'menu.cps.channel': '信道管理',
|
||||||
'menu.cps.settings': '设置管理',
|
'menu.cps.settings': '设置管理',
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<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 { useRoute } from 'vue-router';
|
||||||
import { Input, Select } from 'tdesign-vue-next';
|
import { Input, Select } from 'tdesign-vue-next';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
@ -120,7 +120,9 @@
|
||||||
const state = {
|
const state = {
|
||||||
bandwidthOption: {'0': '25KHz', '1': '12.5KHz'},
|
bandwidthOption: {'0': '25KHz', '1': '12.5KHz'},
|
||||||
modeOption: {'0': 'FM', '1': 'AM', '2': 'USB'},
|
modeOption: {'0': 'FM', '1': 'AM', '2': 'USB'},
|
||||||
|
powerOptionEng: {'0': 'Low', '1': 'Med', '2': 'High'},
|
||||||
powerOption: {'0': '低', '1': '中', '2': '高'},
|
powerOption: {'0': '低', '1': '中', '2': '高'},
|
||||||
|
toneOptionEng: {'1':'Tone','2':'DTCS(N)','3':'DTCS(I)'},
|
||||||
toneOption: {'1':'亚音频','2':'数字亚音','3':'反向数字亚音'},
|
toneOption: {'1':'亚音频','2':'数字亚音','3':'反向数字亚音'},
|
||||||
CTCSSOption: [67.0, 69.3, 71.9, 74.4, 77.0, 79.7, 82.5, 85.4,
|
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,
|
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],
|
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],
|
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"],
|
scrambOption: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
|
||||||
|
pttidOptionEng: ['UP CODE', 'DOWW CODE', 'UP+DOWN Code', 'APOLLO QUINDAR'],
|
||||||
pttidOption: ['上线码', '下线码', '上线+下线码', 'Quindar码']
|
pttidOption: ['上线码', '下线码', '上线+下线码', 'Quindar码']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,6 +167,14 @@
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
onBeforeMount(()=>{
|
||||||
|
if(t('menu.dashboard') == 'CPS'){
|
||||||
|
state.powerOption = state.powerOptionEng
|
||||||
|
state.toneOption = state.toneOptionEng
|
||||||
|
state.pttidOption = state.pttidOptionEng
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(async ()=>{
|
onMounted(async ()=>{
|
||||||
if(route.query.url){
|
if(route.query.url){
|
||||||
const packet = await fetch(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)
|
renderData[i - 2]['step'] = parseFloat(workbook.Sheets.Sheet1['M' + i]?.w)
|
||||||
}
|
}
|
||||||
if(workbook.Sheets.Sheet1['N' + 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){
|
if(workbook.Sheets.Sheet1['O' + i]?.w){
|
||||||
renderData[i - 2]['scramb'] = parseFloat(workbook.Sheets.Sheet1['O' + i]?.w)
|
renderData[i - 2]['scramb'] = parseFloat(workbook.Sheets.Sheet1['O' + i]?.w)
|
||||||
}
|
}
|
||||||
if(workbook.Sheets.Sheet1['P' + 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){
|
if(workbook.Sheets.Sheet1['Q' + i]?.w){
|
||||||
renderData[i - 2]['pttid'] = 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)
|
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){
|
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){
|
||||||
if(workbook.Sheets.Sheet1['T' + i]?.w.split(',').indexOf('I') >= 0){
|
if(workbook.Sheets.Sheet1['T' + i]?.w.split(',').indexOf('I') >= 0){
|
||||||
|
@ -777,13 +788,21 @@
|
||||||
const downloadExcelTemplate = () => {
|
const downloadExcelTemplate = () => {
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = '/K5Channel.xlsx';
|
a.href = '/K5Channel.xlsx';
|
||||||
|
if(t('menu.dashboard') == 'CPS'){
|
||||||
|
a.href = '/K5Channel_EN.xlsx';
|
||||||
|
}
|
||||||
a.download = 'K5Channel.xlsx';
|
a.download = 'K5Channel.xlsx';
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
};
|
};
|
||||||
const saveExcelChannel = async () => {
|
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 workbook = xlsxRead(await template.arrayBuffer());
|
||||||
const worksheet = workbook.Sheets[workbook.SheetNames[0]];
|
const worksheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||||
for(let i = 2; i < 202; i++){
|
for(let i = 2; i < 202; i++){
|
||||||
|
@ -837,7 +856,7 @@
|
||||||
}
|
}
|
||||||
if(cstate.renderData[i - 2]?.reverse){
|
if(cstate.renderData[i - 2]?.reverse){
|
||||||
worksheet['N' + i] = {}
|
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){
|
if(cstate.renderData[i - 2]?.scramb){
|
||||||
worksheet['O' + i] = {}
|
worksheet['O' + i] = {}
|
||||||
|
@ -845,7 +864,7 @@
|
||||||
}
|
}
|
||||||
if(cstate.renderData[i - 2]?.busy){
|
if(cstate.renderData[i - 2]?.busy){
|
||||||
worksheet['P' + i] = {}
|
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){
|
if(cstate.renderData[i - 2]?.pttid){
|
||||||
worksheet['Q' + i] = {}
|
worksheet['Q' + i] = {}
|
||||||
|
@ -857,7 +876,7 @@
|
||||||
}
|
}
|
||||||
if(cstate.renderData[i - 2]?.dtmf){
|
if(cstate.renderData[i - 2]?.dtmf){
|
||||||
worksheet['S' + i] = {}
|
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){
|
if(cstate.renderData[i - 2]?.scanlist){
|
||||||
worksheet['T' + i] = {}
|
worksheet['T' + i] = {}
|
||||||
|
@ -921,13 +940,13 @@
|
||||||
renderData[i - 2]['step'] = parseFloat(workbook.Sheets.Sheet1['M' + i]?.w)
|
renderData[i - 2]['step'] = parseFloat(workbook.Sheets.Sheet1['M' + i]?.w)
|
||||||
}
|
}
|
||||||
if(workbook.Sheets.Sheet1['N' + 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){
|
if(workbook.Sheets.Sheet1['O' + i]?.w){
|
||||||
renderData[i - 2]['scramb'] = parseFloat(workbook.Sheets.Sheet1['O' + i]?.w)
|
renderData[i - 2]['scramb'] = parseFloat(workbook.Sheets.Sheet1['O' + i]?.w)
|
||||||
}
|
}
|
||||||
if(workbook.Sheets.Sheet1['P' + 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){
|
if(workbook.Sheets.Sheet1['Q' + i]?.w){
|
||||||
renderData[i - 2]['pttid'] = 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)
|
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){
|
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){
|
||||||
if(workbook.Sheets.Sheet1['T' + i]?.w.split(',').indexOf('I') >= 0){
|
if(workbook.Sheets.Sheet1['T' + i]?.w.split(',').indexOf('I') >= 0){
|
||||||
|
|
Loading…
Reference in a new issue