k5web/assets/index.e03e0103.js
2024-06-15 00:52:12 +08:00

2 lines
5.4 KiB
JavaScript

import{k as K,ak as N,_ as T}from"./index.8e04e67d.js";/* empty css *//* empty css *//* empty css *//* empty css */import{d as H,r as L,aX as R,bP as E,bH as F,C as M,D as W,aI as a,aH as n,aM as $,aN as I,u as X,a6 as j,a$ as q,ba as z,bI as G,bK as J,b7 as O,bc as Q}from"./arco.949c921a.js";import{u as Y}from"./loading.68e8c78e.js";import{e as v,a as U,f as S,s as d,b as p,g as Z}from"./serial.c741fbda.js";import"./chart.b6f2f6d9.js";import"./vue.d12e9c08.js";const x={class:"container"},tt={name:"Chi"},ot=H({...tt,setup(at){const t=K(),{loading:k,setLoading:V}=Y(!1),o=L({logo_line1:"",logo_line2:"",mdc_audio_local:!0,dtmfid:""}),B=async()=>{var i,b,_,f,y,m,g,u,c,w,h,P,r;if(t.connectState!=!0){alert(sessionStorage.getItem("noticeConnectK5"));return}if(await v(t.connectPort),V(!0),((i=t.configuration)==null?void 0:i.charset)=="losehu"){let l=new Uint8Array(38);l.set(await U(t.connectPort,123680,38,(b=t.configuration)==null?void 0:b.uart),0),o.logo_line1=S(l.subarray(0,19),(_=t.configuration)==null?void 0:_.charset),o.logo_line2=S(l.subarray(19,38),(f=t.configuration)==null?void 0:f.charset)}else if(((y=t.configuration)==null?void 0:y.charset)=="gb2312"){let l=new Uint8Array(36);l.set(await U(t.connectPort,8192,36,(m=t.configuration)==null?void 0:m.uart),0),o.logo_line1=S(l.subarray(0,18),(g=t.configuration)==null?void 0:g.charset),o.logo_line2=S(l.subarray(18,36),(u=t.configuration)==null?void 0:u.charset)}else{let l=new Uint8Array(32);l.set(await U(t.connectPort,3760,32,(c=t.configuration)==null?void 0:c.uart),0),o.logo_line1=S(l.subarray(0,16),(w=t.configuration)==null?void 0:w.charset),o.logo_line2=S(l.subarray(16,32),(h=t.configuration)==null?void 0:h.charset)}const e=await U(t.connectPort,3808,3,(P=t.configuration)==null?void 0:P.uart);o.dtmfid=S(e),parseInt(await U(t.connectPort,8189,1,(r=t.configuration)==null?void 0:r.uart))==0?o.mdc_audio_local=!1:o.mdc_audio_local=!0,V(!1)},D=async()=>{var e,i,b,_,f,y,m,g,u,c,w,h,P,r,l,A,C;if(t.connectState!=!0){alert(sessionStorage.getItem("noticeConnectK5"));return}if(V(!0),await v(t.connectPort),((e=t.configuration)==null?void 0:e.charset)=="losehu"){let s=new Uint8Array(38);s.set(d(o.logo_line1,(i=t.configuration)==null?void 0:i.charset).subarray(0,19),0),s.set(d(o.logo_line2,(b=t.configuration)==null?void 0:b.charset).subarray(0,19),19),await p(t.connectPort,123678,[18,18],2,(_=t.configuration)==null?void 0:_.uart),await p(t.connectPort,123680,s,38,(f=t.configuration)==null?void 0:f.uart)}else if(((y=t.configuration)==null?void 0:y.charset)=="gb2312"){let s=new Uint8Array(36);s.set(d(o.logo_line1,(m=t.configuration)==null?void 0:m.charset).subarray(0,18),0),s.set(d(o.logo_line2,(g=t.configuration)==null?void 0:g.charset).subarray(0,18),18),await p(t.connectPort,8228,[18,18],2,(u=t.configuration)==null?void 0:u.uart),await p(t.connectPort,8192,s,36,(c=t.configuration)==null?void 0:c.uart)}else{let s=new Uint8Array(32);s.set(d(o.logo_line1,(w=t.configuration)==null?void 0:w.charset).subarray(0,16),0),s.set(d(o.logo_line2,(h=t.configuration)==null?void 0:h.charset).subarray(0,16),16),await p(t.connectPort,3760,s,32,(P=t.configuration)==null?void 0:P.uart)}o.dtmfid==""?await p(t.connectPort,3808,new Uint8Array([255,255,255]),3,(r=t.configuration)==null?void 0:r.uart):await p(t.connectPort,3808,new Uint8Array([d(o.dtmfid.padStart(3,"0").split("")[0]),d(o.dtmfid.padStart(3,"0").split("")[1]),d(o.dtmfid.padStart(3,"0").split("")[2])]),3,(l=t.configuration)==null?void 0:l.uart),(A=t.configuration)!=null&&A.localmdc&&await p(t.connectPort,8189,new Uint8Array([o.mdc_audio_local?1:0]),1,(C=t.configuration)==null?void 0:C.uart),await Z(t.connectPort),V(!1)};return(e,i)=>{const b=N,_=j,f=q,y=z,m=G,g=J,u=O,c=Q,w=R,h=E,P=F;return M(),W("div",x,[a(b,{items:[e.$t("menu.dashboard"),e.$t("menu.cps.settings")]},null,8,["items"]),a(g,{gutter:20,align:"stretch"},{default:n(()=>[a(m,{span:24},{default:n(()=>[a(P,{class:"general-card",title:e.$t("menu.cps.settings")+e.$t("global.onStart")},{default:n(()=>[a(g,{style:{"margin-bottom":"16px"}},{default:n(()=>[a(m,{span:12},{default:n(()=>[a(y,null,{default:n(()=>[a(f,{type:"primary",onClick:B},{icon:n(()=>[a(_)]),default:n(()=>[$(" "+I(e.$t("cps.onDeviceRead")),1)]),_:1}),a(f,{onClick:D},{icon:n(()=>[a(_)]),default:n(()=>[$(" "+I(e.$t("cps.onDeviceWrite")),1)]),_:1})]),_:1})]),_:1})]),_:1}),a(h,{loading:X(k),style:{width:"100%"}},{default:n(()=>[a(c,{"label-col-style":{width:"25%"},field:"logo_line1",label:e.$t("cps.line1")},{default:n(()=>[a(u,{modelValue:o.logo_line1,"onUpdate:modelValue":i[0]||(i[0]=r=>o.logo_line1=r)},null,8,["modelValue"])]),_:1},8,["label"]),a(c,{"label-col-style":{width:"25%"},field:"logo_line2",label:e.$t("cps.line2")},{default:n(()=>[a(u,{modelValue:o.logo_line2,"onUpdate:modelValue":i[1]||(i[1]=r=>o.logo_line2=r)},null,8,["modelValue"])]),_:1},8,["label"]),a(c,{"label-col-style":{width:"25%"},field:"dtmfid",label:e.$t("cps.dtmfid")},{default:n(()=>[a(u,{modelValue:o.dtmfid,"onUpdate:modelValue":i[2]||(i[2]=r=>o.dtmfid=r)},null,8,["modelValue"])]),_:1},8,["label"]),a(c,{"label-col-style":{width:"25%"},field:"mdclocplay",label:e.$t("cps.mdclocplay")},{default:n(()=>[a(w,{modelValue:o.mdc_audio_local,"onUpdate:modelValue":i[3]||(i[3]=r=>o.mdc_audio_local=r),type:"round"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["loading"])]),_:1},8,["title"])]),_:1})]),_:1})])}}});const ft=T(ot,[["__scopeId","data-v-6971e3a2"]]);export{ft as default};