k5web/assets/index.3e6d6a21.js
2024-04-29 20:57:33 +08:00

45 lines
18 KiB
JavaScript

import{q as oe,s as ce,t as ie,L as j,S as A,$ as z,G as J,z as R,y as x,F as H,V as _e,W as he,e as Oe,ag as we,_ as je}from"./index.832d54dc.js";/* empty css *//* empty css *//* empty css *//* empty css */import{d as I,c as p,o as Ce,b as Se,f as Pe,t as xe,p as Ee,r as ue,aI as u,aU as K,i as Fe,bP as De,bH as Ne,bN as Ae,C as B,D as W,aH as w,aK as ke,aJ as Ie,aE as L,G as U,u as X,aM as q,bI as Be,bM as $e,bQ as Te,b7 as Le,bi as Me,bm as ze,bn as Re}from"./arco.93f0afda.js";import{e as He,b as Ke,g as Ue}from"./serial.bad97c4e.js";import{b as k,L as Ve,B as Ge}from"./index.f1bec257.js";import{i as T,P as Je}from"./index.57de0a28.js";import"./chart.c383733a.js";import"./vue.ded74ca2.js";function Z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function Q(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Z(Object(n),!0).forEach(function(a){ie(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var We={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M17.66 7.17l-5.3 5.3-1.42-1.41 5.3-5.3 1.42 1.41zm5.65 0l-10.6 10.6-6.37-6.36L7.76 10l4.95 4.95 9.19-9.2 1.41 1.42zM2.11 10l4.94 4.95.35-.35L8.82 16l-1.77 1.77L.69 11.4 2.1 10z"}}]},Xe=I({name:"CheckDoubleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:n}=e,a=p(()=>t.size),{className:o,style:d}=oe(a),i=p(()=>["t-icon","t-icon-check-double",o.value]),r=p(()=>Q(Q({},d.value),n.style)),s=p(()=>({class:i.value,style:r.value,onClick:f=>{var c;return(c=t.onClick)===null||c===void 0?void 0:c.call(t,{e:f})}}));return()=>ce(We,s.value)}});const qe=Xe;function Y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function ee(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Y(Object(n),!0).forEach(function(a){ie(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var Ze={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10.88 1.38l1.28.22a4 4 0 013.34 3.94V8h5.32a2 2 0 011.97 2.33l-1.66 10A2 2 0 0119.15 22H7V10.8l3.88-9.42zm1.23 2.26L9 11.2V20h10.15l1.67-10H13.5V5.54a2 2 0 00-1.39-1.9zM4 10v12H2V10h2z"}}]},Qe=I({name:"ThumbUpIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:n}=e,a=p(()=>t.size),{className:o,style:d}=oe(a),i=p(()=>["t-icon","t-icon-thumb-up",o.value]),r=p(()=>ee(ee({},d.value),n.style)),s=p(()=>({class:i.value,style:r.value,onClick:f=>{var c;return(c=t.onClick)===null||c===void 0?void 0:c.call(t,{e:f})}}));return()=>ce(Ze,s.value)}});const Ye=Qe;/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var et={align:{type:String,default:"top",validator:function(e){return e?["start","end","center","stretch","baseline","top","middle","bottom"].includes(e):!0}},gutter:{type:[Number,Object,Array],default:0},justify:{type:String,default:"start",validator:function(e){return e?["start","end","center","space-around","space-between"].includes(e):!0}},tag:{type:String,default:"div"}};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var te=function(e){var n="xs";return e<768?n="xs":e>=768&&e<992?n="sm":e>=992&&e<1200?n="md":e>=1200&&e<1400?n="lg":e>=1400&&e<1880?n="xl":n="xxl",n};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function tt(t,e){Ce(function(){window.addEventListener(t,e)}),Se(function(){window.removeEventListener(t,e)})}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function ne(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function M(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ne(Object(n),!0).forEach(function(a){j(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function se(){var t=Pe(te(J?0:window.innerWidth)),e=function(){t.value=te(J?0:window.innerWidth)};return tt("resize",e),t}function nt(t,e){var n=e.justify,a=e.align;return[t,j(j({},"".concat(t,"--").concat(n),n),"".concat(t,"--align-").concat(a),a)]}function at(t,e){var n={},a=function(r){return Object.assign(n,{marginLeft:"".concat(r/-2,"px"),marginRight:"".concat(r/-2,"px")})},o=function(r){return Object.assign(n,{rowGap:"".concat(r,"px")})},d={isNumber:function(r){k(r)&&a(r)},isArray:function(r){z(r)&&r.length&&(d.isNumber(r[0]),k(r[1])&&o(r[1]),A(r[0])&&!T(r[0][e])&&a(r[0][e]),A(r[1])&&!T(r[1][e])&&o(r[1][e]))},isObject:function(r){A(r)&&r[e]&&(z(r)&&r.length?(a(r[e][0]),o(r[e][1])):a(r[e]))}};return Object.keys(d).forEach(function(i){d[i](t)}),n}function rt(t){return k(t)?"".concat(t," ").concat(t," 0"):/^\d+(\.\d+)?(px|r?em|%)$/.test(t)?"0 0 ".concat(t):t}function ot(t,e){var n={},a=function(i){return Object.assign(n,{paddingLeft:"".concat(i/2,"px"),paddingRight:"".concat(i/2,"px")})},o={isNumber:function(i){k(i)&&a(i)},isArray:function(i){z(i)&&i.length&&(k(i[0])&&a(i[0]),A(i[0])&&i[0][e]&&a(i[0][e]))},isObject:function(i){A(i)&&i[e]&&a(i[e])}};return Object.keys(o).forEach(function(d){o[d](t)}),n}function ct(t,e){var n=e.span,a=e.order,o=e.offset,d=e.push,i=e.pull,r=["xs","sm","md","lg","xl","xxl"],s=r.reduce(function(f,c){var g=e[c],l={};return k(g)?l.span=g:A(g)&&(l=g||{}),M(M({},f),{},j(j(j(j(j({},"".concat(t,"-").concat(c,"-").concat(l.span),!T(l.span)),"".concat(t,"-").concat(c,"-order-").concat(l.order),parseInt(l.order,10)>=0),"".concat(t,"-").concat(c,"-offset-").concat(l.offset),parseInt(l.offset,10)>=0),"".concat(t,"-").concat(c,"-push-").concat(l.push),parseInt(l.push,10)>=0),"".concat(t,"-").concat(c,"-pull-").concat(l.pull),parseInt(l.pull,10)>=0))},{});return M(j(j(j(j(j(j({},"".concat(t),!0),"".concat(t,"-").concat(n),!T(n)),"".concat(t,"-order-").concat(a),a),"".concat(t,"-offset-").concat(o),o),"".concat(t,"-push-").concat(d),d),"".concat(t,"-pull-").concat(i),i),s)}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function ae(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function it(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ae(Object(n),!0).forEach(function(a){j(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ut(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!K(t)}var st=I({name:"TRow",props:it({},et),setup:function(e){var n=xe(e),a=n.gutter,o=R();Ee("rowContext",ue({gutter:a}));var d=se(),i=x("row"),r=p(function(){return nt(i.value,e)}),s=p(function(){return at(e.gutter,d.value)});return function(){var f,c=e.tag;return u(c,{class:r.value,style:s.value},ut(f=o("default"))?f:{default:function(){return[f]}})}}});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var lt={flex:{type:[String,Number]},lg:{type:[Number,Object]},md:{type:[Number,Object]},offset:{type:Number,default:0},order:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},sm:{type:[Number,Object]},span:{type:Number},tag:{type:String,default:"div"},xl:{type:[Number,Object]},xs:{type:[Number,Object]},xxl:{type:[Number,Object]}};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function re(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function dt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?re(Object(n),!0).forEach(function(a){j(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ft(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!K(t)}var vt=I({name:"TCol",inject:["rowContext"],props:dt({},lt),setup:function(e){var n=x("col"),a=R(),o=Fe("rowContext",Object.create(null)),d=se(),i=p(function(){return ct(n.value,e)}),r=p(function(){var s={},f=e.flex;if(f&&(s.flex=rt(f)),o){var c=o.gutter;Object.assign(s,ot(c,d.value))}return s});return function(){var s,f=e.tag;return u(f,{class:i.value,style:r.value},ft(s=a("default"))?s:{default:function(){return[s]}})}}});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var pt=H(st),gt=H(vt);/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var yt={actions:{type:[String,Function]},avatar:{type:[String,Function]},bordered:{type:Boolean,default:!0},content:{type:[String,Function]},cover:{type:[String,Function]},default:{type:[String,Function]},description:{type:[String,Function]},footer:{type:[String,Function]},header:{type:[String,Function]},headerBordered:Boolean,hoverShadow:Boolean,loading:{type:[Boolean,Function],default:!1},loadingProps:{type:Object},shadow:Boolean,size:{type:String,default:"medium",validator:function(e){return e?["medium","small"].includes(e):!0}},status:{type:String,default:""},subtitle:{type:[String,Function]},theme:{type:String,default:"normal",validator:function(e){return e?["normal","poster1","poster2"].includes(e):!0}},title:{type:[String,Function]}};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function bt(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!K(t)}var mt=I({name:"TCard",props:yt,setup:function(e,n){var a=n.slots,o=R(),d=x("card"),i=_e(),r=i.SIZE,s=p(function(){var S=[d.value];return e.size==="small"&&S.push("".concat(r.value[e.size])),e.bordered&&S.push("".concat(d.value,"--bordered")),e.shadow&&S.push("".concat(d.value,"--shadow")),e.hoverShadow&&S.push("".concat(d.value,"--shadow-hover")),S}),f=p(function(){var S=["".concat(d.value,"__header")];return e.headerBordered?S.concat("".concat(d.value,"__title--bordered")):["".concat(d.value,"__header")]}),c=x("card__header-wrapper"),g=x("card__avatar"),l=x("card__title"),O=x("card__subtitle"),C=x("card__description"),P=x("card__actions"),E=x("card__body"),D=x("card__cover"),F=x("card__footer"),m=x("card__footer-wrapper"),y=p(function(){return e.theme==="poster2"}),b=p(function(){return e.title||a.title}),v=p(function(){return e.header||a.header}),_=p(function(){return e.subtitle||a.subtitle}),h=p(function(){return e.avatar||a.avatar}),N=p(function(){return e.description||a.description}),V=p(function(){return e.status||a.status}),$=p(function(){return e.actions||a.actions}),de=p(function(){return e.footer||a.footer}),fe=p(function(){return e.cover||a.cover}),ve=p(function(){return e.loading||a.loading}),pe=p(function(){return e.content||a.content||e.default||a.default}),ge=p(function(){return v.value||b.value||_.value||N.value||h.value||V.value&&y.value||$.value&&!y.value}),ye=p(function(){return de.value||$.value&&y.value}),be=function(){return v.value?u("div",{class:f.value},[o("header")]):u("div",{class:f.value},[u("div",{class:c.value},[h.value&&u("div",{class:g.value},[o("avatar")]),u("div",null,[b.value&&u("div",{class:l.value},[o("title")]),_.value&&u("div",{class:O.value},[o("subtitle")]),N.value&&u("p",{class:C.value},[o("description")])])]),$.value&&!y.value&&u("div",{class:P.value},[o("actions")]),V.value&&u("div",{class:P.value},[o("status")])])},me=function(){var G=he(e.cover);return u("div",{class:D.value},[G?u("img",{src:e.cover},null):o("cover")])};return function(){var S=u("div",{class:s.value},[ge.value?be():null,fe.value?me():null,pe.value&&u("div",{class:E.value},[o("default")||o("content")]),ye.value&&u("div",{class:F.value},[u("div",{class:m.value},[o("footer")]),$.value&&y.value&&u("div",{class:P.value},[o("actions")])])]);return ve.value?o("loading")||u(Ve,e.loadingProps,bt(S)?S:{default:function(){return[S]}}):S}}});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var _t=H(mt);const le=t=>(ze("data-v-764a475c"),t=t(),Re(),t),ht={class:"container"},Ot=["title","src"],wt=le(()=>U("div",{id:"canvasDiv",style:{zoom:"250%"}},null,-1)),jt=le(()=>U("br",null,null,-1)),Ct={name:"Backup"},St=I({...Ct,setup(t){const e=Oe(),n=ue({activeKey:1,binaryFile:void 0,loading:!1}),a=r=>{alert("\u56FE\u7247\u5DE5\u574A\u5373\u5C06\u63A8\u51FA")},o=r=>{const s=document.createElement("canvas");s.width=128,s.height=64;const f=s.cloneNode(),c=document.getElementById("canvasDiv");c.innerHTML="",c==null||c.append(s,f);const g=new Image;g.src=r.url,g.onload=()=>{const l=s.getContext("2d");l==null||l.drawImage(g,0,0,128,64);const O=l==null?void 0:l.getImageData(0,0,s.width,s.height).data;function C(m,y){const v=(y*128+m)*4;return O[v]+O[v+1]+O[v+2]>128*3?0:1}const P=f.getContext("2d"),E=P.getImageData(0,0,f.width,f.height);for(let m=0;m<64;m++)for(let y=0;y<128;y++){const v=(m*128+y)*4,_=!C(y,m);E.data[v]=_*255,E.data[v+1]=_*255,E.data[v+2]=_*255,E.data[v+3]=255}P.putImageData(E,0,0);const D=new Uint8Array(1024);let F=0;for(let m=0;m<64;m+=8)for(let y=0;y<128;y++){let b=0;for(let v=0;v<8;v++)b|=C(y,m+v)<<v;D[F++]=b}n.binaryFile=D}},d=()=>{const r=document.createElement("input");r.type="file",r.onchange=async()=>{const s=new Blob([r.files[0]],{type:"application/octet-stream"}),f=URL.createObjectURL(s),c=document.createElement("canvas");c.width=128,c.height=64;const g=c.cloneNode(),l=document.getElementById("canvasDiv");l.innerHTML="",l==null||l.append(c,g);const O=new Image;O.src=f,O.onload=()=>{const C=c.getContext("2d");C==null||C.drawImage(O,0,0,128,64);const P=C==null?void 0:C.getImageData(0,0,c.width,c.height).data;function E(b,v){const h=(v*128+b)*4;return P[h]+P[h+1]+P[h+2]>128*3?0:1}const D=g.getContext("2d"),F=D.getImageData(0,0,g.width,g.height);for(let b=0;b<64;b++)for(let v=0;v<128;v++){const h=(b*128+v)*4,N=!E(v,b);F.data[h]=N*255,F.data[h+1]=N*255,F.data[h+2]=N*255,F.data[h+3]=255}D.putImageData(F,0,0);const m=new Uint8Array(1024);let y=0;for(let b=0;b<64;b+=8)for(let v=0;v<128;v++){let _=0;for(let h=0;h<8;h++)_|=E(v,b+h)<<h;m[y++]=_}n.binaryFile=m}},r.click()},i=async()=>{var f,c,g,l;if(e.connectState!=!0){alert("\u8BF7\u5148\u8FDE\u63A5\u624B\u53F0\uFF01");return}if(((f=e.configuration)==null?void 0:f.uart)=="official"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(n.activeKey==2&&((c=e.configuration)==null?void 0:c.charset)!="gb2312"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(n.activeKey==1&&((g=e.configuration)==null?void 0:g.charset)!="losehu"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}n.loading=!0;let r=123728;n.activeKey==2&&(r=8320),await He(e.connectPort);const s=n.binaryFile;for(let O=r;O<s.length+r;O+=128)await Ke(e.connectPort,O,s.slice(O-r,O-r+128),128,(l=e.configuration)==null?void 0:l.uart);await Ue(e.connectPort),n.loading=!1};return(r,s)=>{const f=we,c=Ge,g=gt,l=pt,O=_t,C=Be,P=$e,E=Je,D=Te,F=De,m=Le,y=Me,b=Ne,v=Ae;return B(),W("div",ht,[u(f,{items:["\u5C0F\u5DE5\u5177","\u5F00\u673A\u56FE\u7247"]}),u(P,{gutter:20,align:"stretch"},{default:w(()=>[u(C,{span:24},{default:w(()=>[u(v,{loading:n.loading,tip:"\u5199\u5165\u4E2D...",style:{width:"100%"}},{default:w(()=>[u(b,{class:"general-card",title:"\u5F00\u673A\u56FE\u7247"},{default:w(()=>[u(P,{gutter:20},{default:w(()=>[(B(!0),W(ke,null,Ie([{name:"\u7F57\u72EE\u864E",url:"/img1.png"},{name:"\u79BB\u7EBF\u5C0F\u6050\u9F99",url:"/img2.png"},{name:"\u4E0D\u5FD8\u521D\u5FC3\u7262\u8BB0\u4F7F\u547D",url:"/img3.png"},{name:"\u4E3A\u4EBA\u6C11\u670D\u52A1",url:"/img4.png"},{name:"\u4E25\u7981\u6536\u542C\u654C\u53F0\u5E7F\u64AD",url:"/img5.png"},{name:"\u7231\u56E0\u65AF\u5766",url:"/img6.png"}],_=>(B(),L(C,{span:4},{default:w(()=>[u(O,{style:{width:"100%"}},{cover:w(()=>[U("img",{title:_.name,src:_.url},null,8,Ot)]),footer:w(()=>[u(l,{align:"middle",justify:"center",style:{gap:"24px"}},{default:w(()=>[u(g,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:w(()=>[u(c,{variant:"text",shape:"square",onClick:h=>a(_)},{default:w(()=>[u(X(Ye))]),_:2},1032,["onClick"])]),_:2},1024),u(g,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:w(()=>[u(c,{variant:"text",shape:"square",onClick:h=>o(_)},{default:w(()=>[u(X(qe))]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),256))]),_:1}),u(E,{style:{margin:"10px"},total:6,showPageNumber:"",showPageSize:!1}),u(F,{"active-key":n.activeKey,onChange:s[0]||(s[0]=_=>{n.activeKey=_})},{default:w(()=>[(B(),L(D,{key:1,title:"LOSEHU 117"})),(B(),L(D,{key:2,title:"LOSEHU 118+"}))]),_:1},8,["active-key"]),wt,jt,u(y,null,{default:w(()=>[u(m,{onClick:d},{default:w(()=>[q("\u9009\u62E9\u56FE\u7247")]),_:1}),u(m,{type:"primary",disabled:!n.binaryFile,onClick:i},{default:w(()=>[q("\u5199\u5165")]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["loading"])]),_:1})]),_:1})])}}});const Tt=je(St,[["__scopeId","data-v-764a475c"]]);export{Tt as default};