mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
import{e as $,_ as K}from"./index.6fbe019e.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as G,r as Q,c as X,b0 as q,C as s,D as b,aI as l,aH as o,aM as m,u as W,aN as C,aK as I,aJ as V,aE as g,a6 as Y,aX as Z,bb as tt,bC as et,bF as at,b6 as ot,bG as nt,bH as ut,aU as rt,aV as lt,b9 as dt,bI as st,bJ as it,bE as pt}from"./arco.a5a5eeda.js";import{u as mt}from"./loading.32afe0d0.js";import{e as k,a as h,u as P,b as ft,h as N,s as ct,f as v,g as xt}from"./serial.3518333f.js";import"./chart.afd45e2e.js";import"./vue.bbd9d311.js";const wt={class:"container"},St={name:"SearchTable"},_t=G({...St,setup(bt){const x=$(),{loading:R,setLoading:U}=mt(!1),u=Q({pageSize:15,nowPage:1,bandwidthOption:{0:"25KHz",1:"12.5KHz"},modeOption:{0:"FM",1:"AM",2:"USB"},powerOption:{0:"\u4F4E",1:"\u4E2D",2:"\u9AD8"},toneOption:{1:"\u4E9A\u97F3\u9891",2:"\u6570\u5B57\u4E9A\u97F3",3:"\u53CD\u5411\u6570\u5B57\u4E9A\u97F3"},CTCSSOption:[67,69.3,71.9,74.4,77,79.7,82.5,85.4,88.5,91.5,94.8,97.4,100,103.5,107.2,110.9,114.8,118.8,123,127.3,131.8,136.5,141.3,146.2,151.4,156.7,159.8,162.2,165.5,167.9,171.3,173.8,177.3,179.9,183.5,186.2,189.9,192.8,196.6,199.5,203.5,206.5,210.7,218.1,225.7,229.1,233.6,241.8,250.3,254.1],DCSOption:[23,25,26,31,32,36,43,47,51,53,54,65,71,72,73,74,114,115,116,122,125,131,132,134,143,145,152,155,156,162,165,172,174,205,212,223,225,226,243,244,245,246,251,252,255,261,263,265,266,271,274,306,311,315,325,331,332,343,346,351,356,364,365,371,411,412,413,423,431,432,445,446,452,454,455,462,464,465,466,503,506,516,523,526,532,546,565,606,612,624,627,631,632,654,662,664,703,712,723,731,732,734,743,754],stepOption:[2.5,5,6.25,10,12.5,25,8.33,.01,.05,.1,.25,.5,1,1.25,9,15,20,30,50,100,125,200,250,500],scrambOption:["1","2","3","4","5","6","7","8","9","10"],pttidOption:["\u4E0A\u7EBF\u7801","\u4E0B\u7EBF\u7801","\u4E0A\u7EBF+\u4E0B\u7EBF\u7801","Quindar\u7801"],renderData:[]});(()=>{const f=[];Array.from({length:200}).map(w=>{f.push({})}),u.renderData=f})();const z=X(()=>[{title:"#",dataIndex:"index",slotName:"index",width:70},{title:"\u4FE1\u9053\u540D\u79F0",dataIndex:"name",slotName:"name",width:200},{title:"\u5E26\u5BBD",dataIndex:"bandwidth",slotName:"bandwidth",width:150},{title:"\u63A5\u6536\u9891\u7387",dataIndex:"rx",slotName:"rx",width:150},{title:"\u53D1\u9001\u9891\u7387",dataIndex:"tx",slotName:"tx",width:150},{title:"\u53D1\u9001\u529F\u7387",dataIndex:"power",slotName:"power",width:150},{title:"\u63A5\u6536\u4E9A\u97F3\u7C7B\u578B",dataIndex:"rxTone",slotName:"rxTone",width:150},{title:"\u63A5\u6536\u4E9A\u97F3\u9891\uFF08Hz\uFF09",dataIndex:"rxCTCSS",slotName:"rxCTCSS",width:150},{title:"\u63A5\u6536\u4E9A\u97F3\u6570\u7801",dataIndex:"rxDCS",slotName:"rxDCS",width:150},{title:"\u53D1\u9001\u4E9A\u97F3\u7C7B\u578B",dataIndex:"txTone",slotName:"txTone",width:150},{title:"\u53D1\u9001\u4E9A\u97F3\u9891\uFF08Hz\uFF09",dataIndex:"txCTCSS",slotName:"txCTCSS",width:150},{title:"\u53D1\u9001\u4E9A\u97F3\u6570\u7801",dataIndex:"txDCS",slotName:"txDCS",width:150},{title:"\u9891\u7387\u6B65\u8FDB",dataIndex:"step",slotName:"step",width:150},{title:"\u5012\u9891",dataIndex:"reverse",slotName:"reverse",width:150},{title:"\u52A0\u5BC6",dataIndex:"scramb",slotName:"scramb",width:150},{title:"\u7E41\u5FD9\u7981\u53D1",dataIndex:"busy",slotName:"busy",width:150},{title:"\u4FE1\u4EE4\u7801",dataIndex:"pttid",slotName:"pttid",width:150},{title:"\u4FE1\u9053\u6A21\u5F0F",dataIndex:"mode",slotName:"mode",width:150},{title:"DTMF\u89E3\u7801",dataIndex:"dtmf",slotName:"dtmf",width:150},{title:"\u626B\u63CF\u5217\u8868",dataIndex:"scanlist",slotName:"scanlist",width:150},{title:"\u64CD\u4F5C",dataIndex:"operate",slotName:"operate",width:150}]),M=async()=>{var O,F,n,D;if(x.connectState!=!0){alert("\u8BF7\u5148\u8FDE\u63A5\u624B\u53F0\uFF01");return}await k(x.connectPort),U(!0);let f=new Uint8Array(3200);for(let d=0;d<3200;d+=128){const r=await h(x.connectPort,d,128,(O=x.configuration)==null?void 0:O.uart);f.set(r,d)}let w=new Uint8Array(192);for(let d=3424;d<3616;d+=64){const r=await h(x.connectPort,d,64,(F=x.configuration)==null?void 0:F.uart);w.set(r,d-3424)}let _=new Uint8Array(3200);for(let d=3920;d<7120;d+=128){const r=await h(x.connectPort,d,128,(n=x.configuration)==null?void 0:n.uart);_.set(r,d-3920)}const c=[];for(let d=0;d<3200;d+=16){const r=P(f.subarray(d,d+16)),p=P(w.subarray(d/16,d/16+1)),e={};e.rx=r.substr(24,8)!="ffffffff"?parseInt(r.substr(24,8),16)/1e5:void 0,e.rx&&p!="ff"?(console.info(r),console.info(p),e.offset=r.substr(16,8)!="00000000"?parseInt(r.substr(16,8),16)/1e5:void 0,e.txcodeflag=r.substr(9,1),e.txcodeflag=="1"&&(e.tx=e.rx+e.offset),e.txcodeflag=="2"&&(e.tx=e.rx-e.offset),e.txTone=parseInt(r.substr(10,1),16)>0?parseInt(r.substr(10,1),16).toString():void 0,e.rxTone=parseInt(r.substr(11,1),16)>0?parseInt(r.substr(11,1),16).toString():void 0,e.txTone=="1"&&(e.txCTCSS=u.CTCSSOption[parseInt(r.substr(12,2),16)]),(e.txTone=="2"||e.txTone=="3")&&(e.txDCS=u.DCSOption[parseInt(r.substr(12,2),16)]),e.rxTone=="1"&&(e.rxCTCSS=u.CTCSSOption[parseInt(r.substr(14,2),16)]),(e.rxTone=="2"||e.rxTone=="3")&&(e.rxDCS=u.DCSOption[parseInt(r.substr(14,2),16)]),e.step=u.stepOption[parseInt(r.substr(2,2),16)],e.scramb=parseInt(r.substr(0,2),16)>0?parseInt(r.substr(0,2),16).toString():void 0,e.power_reverse_busy_width=parseInt(r.substr(6,2),16),e.reverse=!!(e.power_reverse_busy_width>>0&1),e.bandwidth=(e.power_reverse_busy_width>>1&1).toString(),e.power=(e.power_reverse_busy_width>>2&3).toString(),e.busy=!!(e.power_reverse_busy_width>>4&1),e.pttid_dtmf=parseInt(r.substr(4,2),16),e.pttid=u.pttidOption[(e.pttid_dtmf>>1)-1],e.dtmf=!!(e.pttid_dtmf>>0&1),e.mode=parseInt(r.substr(8,1),16).toString(),e.name=ft(_.subarray(d,d+16),(D=x.configuration)==null?void 0:D.charset),e.scanlist=[],parseInt(p.substr(0,1),16)&8&&e.scanlist.push("I"),parseInt(p.substr(0,1),16)&4&&e.scanlist.push("II")):e.rx=void 0,c.push(e)}u.renderData=c,U(!1)},j=async()=>{var O,F;if(x.connectState!=!0){alert("\u8BF7\u5148\u8FDE\u63A5\u624B\u53F0\uFF01");return}await k(x.connectPort),U(!0);let f=new Uint8Array(3200),w=new Uint8Array(200),_=new Uint8Array(3200),c=0;u.renderData.map(n=>{var D,d,r,p;if(n.rx){let e="";e+=parseInt(n.scramb)>0?parseInt(n.scramb).toString(16).padStart(2,"0"):"00",e+=u.stepOption.indexOf(n.step)>=0?u.stepOption.indexOf(n.step).toString(16).padStart(2,"0"):"00";let E=u.pttidOption.indexOf(n.pttid)+1<<1;E+=n.dtmf?1:0,e+=E.toString(16).padStart(2,"0");let y=n.busy?1<<4:0;switch(y+=n.power<<2,y+=n.bandwidth<<1,y+=n.reverse?1:0,e+=y.toString(16).padStart(2,"0"),e+=n.mode?n.mode.toString(16):"0",n.tx>0&&n.tx>n.rx?e+="1":n.tx>0&&n.tx<n.rx?e+="2":e+="0",e+=parseInt(n.txTone)>0?n.txTone.toString(16):"0",e+=parseInt(n.rxTone)>0?n.rxTone.toString(16):"0",n.txTone){case"1":e+=u.CTCSSOption.indexOf(n.txCTCSS).toString(16).padStart(2,"0");break;case"2":case"3":e+=u.DCSOption.indexOf(n.txDCS).toString(16).padStart(2,"0");break;default:e+="00"}switch(n.rxTone){case"1":e+=u.CTCSSOption.indexOf(n.rxCTCSS).toString(16).padStart(2,"0");break;case"2":case"3":e+=u.DCSOption.indexOf(n.rxDCS).toString(16).padStart(2,"0");break;default:e+="00"}const A=n.tx&&n.rx?Math.abs(parseInt((n.tx*1e5).toFixed(0))-parseInt((n.rx*1e5).toFixed(0))):NaN;e+=Number.isNaN(A)?"00000000":A.toString(16).padStart(8,"0"),e+=parseInt((n.rx*1e5).toFixed(0)).toString(16).padStart(8,"0"),console.log(e),f.set(N(e),c);let T=0;((D=n.scanlist)==null?void 0:D.indexOf("I"))>=0&&(T+=8),((d=n.scanlist)==null?void 0:d.indexOf("II"))>=0&&(T+=4),console.log((T<<4)+0),w.set([(T<<4)+0],c>>4);const B=new Uint8Array(16);B.set(ct((r=n.name)!=null?r:"",(p=x.configuration)==null?void 0:p.charset).subarray(0,16),0),_.set(B,c)}else f.set(N("ffffffffffffffffffffffffffffffff"),c),w.set([255],c>>4),_.set(N("ffffffffffffffffffffffffffffffff"),c);c+=16});for(let n=0;n<3200;n+=128)await v(x.connectPort,n,f.slice(n,n+128),128,(O=x.configuration)==null?void 0:O.uart);await v(x.connectPort,3424,w,200);for(let n=3920;n<7120;n+=128)await v(x.connectPort,n,_.slice(n-3920,n-3920+128),128,(F=x.configuration)==null?void 0:F.uart);await xt(x.connectPort),U(!1)},H=async f=>{u.renderData[f]={}},L=()=>{const f=JSON.stringify(u.renderData),w=new Blob([f],{type:"application/octet-stream"}),_=URL.createObjectURL(w),c=document.createElement("a");c.download="channel.json",c.href=_,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(_)},J=()=>{const f=document.createElement("input");f.type="file",f.onchange=async()=>{const _=await new Blob([f.files[0]],{type:"application/octet-stream"}).text();u.renderData=JSON.parse(_)},f.click()};return(f,w)=>{const _=q("Breadcrumb"),c=Y,O=Z,F=tt,n=et,D=at,d=ot,r=nt,p=ut,e=rt,E=lt,y=dt,A=st,T=it,B=pt;return s(),b("div",wt,[l(_,{items:["\u5199\u9891","\u4FE1\u9053\u7BA1\u7406"]}),l(B,{class:"general-card",title:"\u4FE1\u9053\u7BA1\u7406"},{default:o(()=>[l(D,{style:{"margin-bottom":"16px"}},{default:o(()=>[l(n,{span:12},{default:o(()=>[l(F,null,{default:o(()=>[l(O,{type:"primary",onClick:M},{icon:o(()=>[l(c)]),default:o(()=>[m(" \u4ECE\u8BBE\u5907\u8BFB\u53D6 ")]),_:1}),l(O,{onClick:j},{icon:o(()=>[l(c)]),default:o(()=>[m(" \u5199\u5165\u8BBE\u5907 ")]),_:1})]),_:1})]),_:1}),l(n,{span:12,style:{"text-align":"right"}},{default:o(()=>[l(F,null,{default:o(()=>[l(O,{type:"primary",onClick:L},{default:o(()=>[m(" \u4FDD\u5B58 ")]),_:1}),l(O,{onClick:J},{default:o(()=>[m(" \u52A0\u8F7D ")]),_:1})]),_:1})]),_:1})]),_:1}),l(T,{loading:W(R),columns:z.value,data:u.renderData,style:{"margin-top":"20px"},pagination:{pageSize:u.pageSize,current:u.nowPage,showPageSize:!0,pageSizeOptions:[15,30,50]},onPageChange:w[0]||(w[0]=a=>{u.nowPage=a}),onPageSizeChange:w[1]||(w[1]=a=>{u.pageSize=a})},{index:o(({record:a,rowIndex:i})=>[m(C((u.nowPage-1)*u.pageSize+i+1),1)]),name:o(({record:a,rowIndex:i})=>[l(d,{modelValue:a.name,"onUpdate:modelValue":t=>a.name=t},null,8,["modelValue","onUpdate:modelValue"])]),bandwidth:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.bandwidth,"onUpdate:modelValue":t=>a.bandwidth=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(Object.keys(u.bandwidthOption),t=>(s(),g(r,{value:t},{default:o(()=>{var S;return[m(C((S=u.bandwidthOption[t])!=null?S:t),1)]}),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),tx:o(({record:a,rowIndex:i})=>[l(e,{modelValue:a.tx,"onUpdate:modelValue":t=>a.tx=t,precision:5},null,8,["modelValue","onUpdate:modelValue"])]),rx:o(({record:a,rowIndex:i})=>[l(e,{modelValue:a.rx,"onUpdate:modelValue":t=>a.rx=t,precision:5},null,8,["modelValue","onUpdate:modelValue"])]),power:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.power,"onUpdate:modelValue":t=>a.power=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(Object.keys(u.powerOption),t=>(s(),g(r,{value:t},{default:o(()=>{var S;return[m(C((S=u.powerOption[t])!=null?S:t),1)]}),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),rxTone:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.rxTone,"onUpdate:modelValue":t=>a.rxTone=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(Object.keys(u.toneOption),t=>(s(),g(r,{value:t},{default:o(()=>{var S;return[m(C((S=u.toneOption[t])!=null?S:t),1)]}),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),rxCTCSS:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.rxCTCSS,"onUpdate:modelValue":t=>a.rxCTCSS=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(u.CTCSSOption,t=>(s(),g(r,{value:t},{default:o(()=>[m(C(t.toFixed(1)),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),rxDCS:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.rxDCS,"onUpdate:modelValue":t=>a.rxDCS=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(u.DCSOption,t=>(s(),g(r,{value:t},{default:o(()=>[m(C("0"+t),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),txTone:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.txTone,"onUpdate:modelValue":t=>a.txTone=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(Object.keys(u.toneOption),t=>(s(),g(r,{value:t},{default:o(()=>{var S;return[m(C((S=u.toneOption[t])!=null?S:t),1)]}),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),txCTCSS:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.txCTCSS,"onUpdate:modelValue":t=>a.txCTCSS=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(u.CTCSSOption,t=>(s(),g(r,{value:t},{default:o(()=>[m(C(t.toFixed(1)),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),txDCS:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.txDCS,"onUpdate:modelValue":t=>a.txDCS=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(u.DCSOption,t=>(s(),g(r,{value:t},{default:o(()=>[m(C("0"+t),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),step:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.step,"onUpdate:modelValue":t=>a.step=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(u.stepOption,t=>(s(),g(r,{value:t},{default:o(()=>[m(C(t.toFixed(1)),1)]),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),reverse:o(({record:a,rowIndex:i})=>[l(E,{modelValue:a.reverse,"onUpdate:modelValue":t=>a.reverse=t},null,8,["modelValue","onUpdate:modelValue"])]),scramb:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.scramb,"onUpdate:modelValue":t=>a.scramb=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(u.scrambOption,t=>(s(),g(r,null,{default:o(()=>[m(C(t),1)]),_:2},1024))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),busy:o(({record:a,rowIndex:i})=>[l(E,{modelValue:a.busy,"onUpdate:modelValue":t=>a.busy=t},null,8,["modelValue","onUpdate:modelValue"])]),pttid:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.pttid,"onUpdate:modelValue":t=>a.pttid=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(u.pttidOption,t=>(s(),g(r,null,{default:o(()=>[m(C(t),1)]),_:2},1024))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),mode:o(({record:a,rowIndex:i})=>[l(p,{modelValue:a.mode,"onUpdate:modelValue":t=>a.mode=t,"allow-clear":""},{default:o(()=>[(s(!0),b(I,null,V(Object.keys(u.modeOption),t=>(s(),g(r,{value:t},{default:o(()=>{var S;return[m(C((S=u.modeOption[t])!=null?S:t),1)]}),_:2},1032,["value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),dtmf:o(({record:a,rowIndex:i})=>[l(E,{modelValue:a.dtmf,"onUpdate:modelValue":t=>a.dtmf=t},null,8,["modelValue","onUpdate:modelValue"])]),scanlist:o(({record:a,rowIndex:i})=>[l(A,{modelValue:a.scanlist,"onUpdate:modelValue":t=>a.scanlist=t},{default:o(()=>[l(y,{value:"I"},{default:o(()=>[m("I")]),_:1}),l(y,{value:"II"},{default:o(()=>[m("II")]),_:1})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),operate:o(({record:a,rowIndex:i})=>[l(O,{onClick:t=>H((u.nowPage-1)*u.pageSize+i)},{default:o(()=>[m("\u6E05\u7A7A")]),_:2},1032,["onClick"])]),_:1},8,["loading","columns","data","pagination"])]),_:1})])}}});const kt=K(_t,[["__scopeId","data-v-43a38688"]]);export{kt as default};
|