import{e as F,q as h,_ as g}from"./index.55015db9.js";/* empty css *//* empty css *//* empty css *//* empty css */import{d as E,r as B,bB as v,bC as k,C,D,aI as c,aH as f,aM as w,G as A,aZ as y,b8 as x,bD as R,bM as M,n as T}from"./arco.beabb834.js";import{e as P,f as H,g as S}from"./serial.b70f48dc.js";import"./chart.83b8c11b.js";import"./vue.30c84055.js";const U={class:"container"},I=["innerHTML"],N={name:"Chi"},V=E({...N,setup($){const r=F(),_=B({status:"\u70B9\u51FB\u5199\u5165\u6309\u94AE\u5199\u5165\u5B57\u5E93\u5230\u8BBE\u5907

",eepromType:""}),p=async(e=0,t)=>{var d;await P(r.connectPort);for(let u=e;u",T(()=>{const a=document==null?void 0:document.getElementById("statusArea");a&&(a.scrollTop=a==null?void 0:a.scrollHeight)});_.status=_.status+"\u5199\u5165\u8FDB\u5EA6\uFF1A100.0%
",await S(r.connectPort)},b=async(e=1)=>{var d,u,a,m;if(r.connectState!=!0){alert("\u8BF7\u5148\u8FDE\u63A5\u624B\u53F0\uFF01");return}if(((d=r.configuration)==null?void 0:d.uart)=="official"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(e==1&&((u=r.configuration)==null?void 0:u.charset)!="losehu"||e==1&&((a=r.configuration)==null?void 0:a.K)!=!0){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(e==2&&((m=r.configuration)==null?void 0:m.charset)!="gb2312"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}_.status=_.status+"\u6B63\u5728\u4E0B\u8F7D\u5B57\u5E93...
";let t;if(e==1){t=await fetch("/old_font.bin");const s=t.body.getReader(),n=[];for(;;){const{done:o,value:l}=await s.read();if(o)break;n.push(...l)}const i=new Uint8Array(n);await p(8192,i);return}if(e==2){t=await fetch("/new_font_k.bin");const s=t.body.getReader(),n=[];for(;;){const{done:o,value:l}=await s.read();if(o)break;n.push(...l)}const i=new Uint8Array(n);await p(9344,i);return}if(e==3){t=await fetch("/new_font_h.bin");const s=t.body.getReader(),n=[];for(;;){const{done:o,value:l}=await s.read();if(o)break;n.push(...l)}const i=new Uint8Array(n);await p(9344,i);return}if(e==4){t=await fetch("/pinyin.bin");const s=t.body.getReader(),n=[];for(;;){const{done:o,value:l}=await s.read();if(o)break;n.push(...l)}const i=new Uint8Array(n);await p(131072,i);return}};return(e,t)=>{const d=h,u=y,a=x,m=v,s=k,n=R,i=M;return C(),D("div",U,[c(d,{items:["\u5C0F\u5DE5\u5177","\u5B57\u5E93\u5199\u5165"]}),c(i,{gutter:20,align:"stretch"},{default:f(()=>[c(n,{span:24},{default:f(()=>[c(s,{class:"general-card",title:"\u5B57\u5E93\u5199\u5165"},{default:f(()=>[c(a,null,{default:f(()=>[c(u,{onClick:t[0]||(t[0]=o=>b(1))},{default:f(()=>[w("\u5199\u5165 117 \u5B57\u5E93")]),_:1}),c(u,{onClick:t[1]||(t[1]=o=>b(2))},{default:f(()=>[w("\u5199\u5165 118+ \u5B57\u5E93")]),_:1}),c(u,{onClick:t[2]||(t[2]=o=>b(4))},{default:f(()=>[w("\u5199\u5165\u62FC\u97F3\u68C0\u7D22\u8868\uFF082Mbit EEPROM\u53EF\u7528\uFF09")]),_:1})]),_:1}),c(m),A("div",{id:"statusArea",style:{height:"20em","background-color":"azure",color:"silver",overflow:"auto",padding:"20px"},innerHTML:_.status},null,8,I)]),_:1})]),_:1})]),_:1})])}}});const Q=g(V,[["__scopeId","data-v-418874c6"]]);export{Q as default};