k5web/assets/index.2e5a0c96.js

34 lines
14 KiB
JavaScript
Raw Normal View History

2024-05-01 02:26:32 +00:00
import{q as Q,s as Y,t as Z,L as v,S,$ as M,G as R,z as ee,y as te,F as ne,e as ie,ag as se,_ as ue}from"./index.006cd607.js";/* empty css *//* empty css *//* empty css *//* empty css */import{d as k,c as P,o as le,b as pe,f as fe,t as de,p as ye,r as ae,aI as d,aU as re,i as be,bP as me,bH as ge,bN as ve,C as N,D as T,aH as m,aK as _e,aJ as Oe,aE as B,G as L,u as z,aM as K,bI as je,bM as he,bQ as we,b7 as Pe,bi as Ce,bm as xe,bn as Ee}from"./arco.93f0afda.js";import{e as De,b as Se,g as Fe}from"./serial.bad97c4e.js";import{B as Ne}from"./index.a34685aa.js";import{i as A,P as ke}from"./index.71384a43.js";import{i as F}from"./index.f5d63095.js";import{C as Ae}from"./index.d0865e71.js";import"./chart.c383733a.js";import"./vue.ded74ca2.js";function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,a)}return n}function H(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?U(Object(n),!0).forEach(function(a){Z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var Ie={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"}}]},Be=k({name:"CheckDoubleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:n}=e,a=P(()=>t.size),{className:s,style:f}=Q(a),c=P(()=>["t-icon","t-icon-check-double",s.value]),r=P(()=>H(H({},f.value),n.style)),i=P(()=>({class:c.value,style:r.value,onClick:l=>{var o;return(o=t.onClick)===null||o===void 0?void 0:o.call(t,{e:l})}}));return()=>Y(Ie,i.value)}});const $e=Be;function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,a)}return n}function G(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?V(Object(n),!0).forEach(function(a){Z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var Me={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"}}]},Le=k({name:"ThumbUpIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:n}=e,a=P(()=>t.size),{className:s,style:f}=Q(a),c=P(()=>["t-icon","t-icon-thumb-up",s.value]),r=P(()=>G(G({},f.value),n.style)),i=P(()=>({class:c.value,style:r.value,onClick:l=>{var o;return(o=t.onClick)===null||o===void 0?void 0:o.call(t,{e:l})}}));return()=>Y(Me,i.value)}});const Re=Le;/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Te={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 J=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 ze(t,e){le(function(){window.addEventListener(t,e)}),pe(function(){window.removeEventListener(t,e)})}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,a)}return n}function $(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?q(Object(n),!0).forEach(function(a){v(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function oe(){var t=fe(J(R?0:window.innerWidth)),e=function(){t.value=J(R?0:window.innerWidth)};return ze("resize",e),t}function Ke(t,e){var n=e.justify,a=e.align;return[t,v(v({},"".concat(t,"--").concat(n),n),"".concat(t,"--align-").concat(a),a)]}function Ue(t,e){var n={},a=function(r){return Object.assign(n,{marginLeft:"".concat(r/-2,"px"),marginRight:"".concat(r/-2,"px")})},s=function(r){return Object.assign(n,{rowGap:"".concat(r,"px")})},f={isNumber:function(r){F(r)&&a(r)},isArray:function(r){M(r)&&r.length&&(f.isNumber(r[0]),F(r[1])&&s(r[1]),S(r[0])&&!A(r[0][e])&&a(r[0][e]),S(r[1])&&!A(r[1][e])&&s(r[1][e]))},isObject:function(r){S(r)&&r[e]&&(M(r)&&r.length?(a(r[e][0]),s(r[e][1])):a(r[e]))}};return Object.keys(f).forEach(function(c){f[c](t)}),n}function He(t){return F(t)?"".concat(t," ").concat(t," 0"):/^\d+(\.\d+)?(px|r?em|%)$/.test(t)?"0 0 ".concat(t):t}function Ve(t,e){var n={},a=function(c){return Object.assign(n,{paddingLeft:"".concat(c/2,"px"),paddingRight:"".concat(c/2,"px")})},s={isNumber:function(c){F(c)&&a(c)},isArray:function(c){M(c)&&c.length&&(F(c[0])&&a(c[0]),S(c[0])&&c[0][e]&&a(c[0][e]))},isObject:function(c){S(c)&&c[e]&&a(c[e])}};return Object.keys(s).forEach(function(f){s[f](t)}),n}function Ge(t,e){var n=e.span,a=e.order,s=e.offset,f=e.push,c=e.pull,r=["xs","sm","md","lg","xl","xxl"],i=r.reduce(function(l,o){var y=e[o],u={};return F(y)?u.span=y:S(y)&&(u=y||{}),$($({},l),{},v(v(v(v(v({},"".concat(t,"-").concat(o,"-").concat(u.span),!A(u.span)),"".concat(t,"-").concat(o,"-order-").concat(u.order),parseInt(u.order,10)>=0),"".concat(t,"-").concat(o,"-offset-").concat(u.offset),parseInt(u.offset,10)>=0),"".concat(t,"-").concat(o,"-push-").concat(u.push),parseInt(u.push,10)>=0),"".concat(t,"-").concat(o,"-pull-").concat(u.pull),parseInt(u.pull,10)>=0))},{});return $(v(v(v(v(v(v({},"".concat(t),!0),"".concat(t,"-").concat(n),!A(n)),"".concat(t,"-order-").concat(a),a),"".concat(t,"-offset-").concat(s),s),"".concat(t,"-push-").concat(f),f),"".concat(t,"-pull-").concat(c),c),i)}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,a)}return n}function Je(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?X(Object(n),!0).forEach(function(a){v(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function qe(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!re(t)}var Xe=k({name:"TRow",props:Je({},Te),setup:function(e){var n=de(e),a=n.gutter,s=ee();ye("rowContext",ae({gutter:a}));var f=oe(),c=te("row"),r=P(function(){return Ke(c.value,e)}),i=P(function(){return Ue(e.gutter,f.value)});return function(){var l,o=e.tag;return d(o,{class:r.value,style:i.value},qe(l=s("default"))?l:{default:function(){return[l]}})}}});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var We={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 W(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,a)}return n}function Qe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?W(Object(n),!0).forEach(function(a){v(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Ye(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!re(t)}var Ze=k({name:"TCol",inject:["rowContext"],props:Qe({},We),setup:function(e){var n=te("col"),a=ee(),s=be("rowContext",Object.create(null)),f=oe(),c=P(function(){return Ge(n.value,e)}),r=P(function(){var i={},l=e.flex;if(l&&(i.flex=He(l)),s){var o=s.gutter;Object.assign(i,Ve(o,f.value))}return i});return function(){var i,l=e.tag;return d(l,{class:c.value,style:r.value},Ye(i=a("default"))?i:{default:function(){return[i]}})}}});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var et=ne(Xe),tt=ne(Ze);const ce=t=>(xe("data-v-59e331d7"),t=t(),Ee(),t),nt={class:"container"},at=["title","src"],rt=ce(()=>L("div",{id:"canvasDiv",style:{zoom:"250%"}},null,-1)),ot=ce(()=>L("br",null,null,-1)),ct={name:"Backup"},it=k({...ct,setup(t){const e=ie(),n=ae({activeKey:1,binaryFile:void 0,loading:!1}),a=r=>{alert("\u56FE\u7247\u5DE5\u574A\u5373\u5C06\u63A8\u51FA")},s=r=>{const i=document.createElement("canvas");i.width=128,i.height=64;const l=i.cloneNode(),o=document.getElementById("canvasDiv");o.innerHTML="",o==null||o.append(i,l);const y=new Image;y.src=r.url,y.onload=()=>{const u=i.getContext("2d");u==null||u.drawImage(y,0,0,128,64);const _=u==null?void 0:u.getImageData(0,0,i.width,i.height).data;function w(g,h){const p=(h*128+g)*4;return _[p]+_[p+1]+_[p+2]>128*3?0:1}const x=l.getContext("2d"),C=x.getImageData(0,0,l.width,l.height);for(let g=0;g<64;g++)for(let h=0;h<128;h++){const p=(g*128+h)*4,O=!w(h,g);C.data[p]=O*255,C.data[p+1]=O*255,C.data[p+2]=O*255,C.data[p+3]=255}x.putImageData(C,0,0);const D=new Uint8Array(1024);let E=0;for(let g=0;g<64;g+=8)for(let h=0;h<128;h++){let b=0;for(let p=0;p<8;p++)b|=w(h,g+p)<<p;D[E++]=b}n.binaryFile=D}},f=()=>{const r=document.createElement("input");r.type="file",r.onchange=async()=>{const i=new Blob([r.files[0]],{type:"application/octet-stream"}),l=URL.createObjectURL(i),o=document.createElement("canvas");o.width=128,o.height=64;const y=o.cloneNode(),u=document.getElementById("canvasDiv");u.innerHTML="",u==null||u.append(o,y);const _=new Image;_.src=l,_.onload=()=>{const w=o.getContext("2d");w==null||w.drawImage(_,0,0,128,64);const x=w==null?void 0:w.getImageData(0,0,o.width,o.height).data;function C(b,p){const j=(p*128+b)*4;return x[j]+x[j+1]+x[j+2]>128*3?0:1}const D=y.getContext("2d"),E=D.getImageData(0,0,y.width,y.height);for(let b=0;b<64;b++)for(let p=0;p<128;p++){const j=(b*128+p)*4,I=!C(p,b);E.data[j]=I*255,E.data[j+1]=I*255,E.data[j+2]=I*255,E.data[j+3]=255}D.putImageData(E,0,0);const g=new Uint8Array(1024);let h=0;for(let b=0;b<64;b+=8)for(let p=0;p<128;p++){let O=0;for(let j=0;j<8;j++)O|=C(p,b+j)<<j;g[h++]=O}n.binaryFile=g}},r.click()},c=async()=>{var l,o,y,u;if(e.connectState!=!0){alert("\u8BF7\u5148\u8FDE\u63A5\u624B\u53F0\uFF01");return}if(((l=e.configuration)==null?void 0:l.uart)=="official"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(n.activeKey==2&&((o=e.configuration)==null?void 0:o.charset)!="gb2312"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(n.activeKey==1&&((y=e.configuration)==null?void 0:y.charset)!="losehu"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}n.loading=!0;let r=123728;n.activeKey==2&&(r=8320),await De(e.connectPort);const i=n.binaryFile;for(let _=r;_<i.length+r;_+=128)await Se(e.connectPort,_,i.slice(_-r,_-r+128),128,(u=e.configuration)==null?void 0:u.uart);await Fe(e.connectPort),n.loading=!1};return(r,i)=>{const l=se,o=Ne,y=tt,u=et,_=Ae,w=je,x=he,C=ke,D=we,E=me,g=Pe,h=Ce,b=ge,p=ve;return N(),T("div",nt,[d(l,{items:["\u5C0F\u5DE5\u5177","\u5F00\u673A\u56FE\u7247"]}),d(x,{gutter:20,align:"stretch"},{default:m(()=>[d(w,{span:24},{default:m(()=>[d(p,{loading:n.loading,tip:"\u5199\u5165\u4E2D...",style:{width:"100%"}},{default:m(()=>[d(b,{class:"general-card",title:"\u5F00\u673A\u56FE\u7247\uFF08\u624B\u53F0\u5E94\u5728\u5F00\u673A\u72B6\u6001\u4E0B\uFF09"},{default:m(()=>[d(x,{gutter:20},{default:m(()=>[(N(!0),T(_e,null,Oe([{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"}],O=>(N(),B(w,{span:4},{default:m(()=>[d(_,{style:{width:"100%"}},{cover:m(()=>[L("img",{title:O.name,src:O.url},null,8,at)]),footer:m(()=>[d(u,{align:"middle",justify:"center",style:{gap:"24px"}},{default:m(()=>[d(y,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:m(()=>[d(o,{variant:"t