2024-05-26 17:46:41 +00:00
|
|
|
import{y as P,J as L,A as te,B as ne,e as je,u as xe,s as S,as as Pe,_ as Ce}from"./index.a585e6b1.js";/* empty css *//* empty css *//* empty css */import{d as D,c as g,o as oe,b as ke,f as Se,t as Ae,p as De,r as B,aI as i,aU as ae,i as Ee,bH as Ne,C as h,D as A,aH as l,G as x,u as w,aK as $,aM as _,aN as j,aJ as M,aE as G,a_ as K,b9 as $e,bI as Fe,bL as Ie,be as Le,bf as Be}from"./arco.f43727df.js";import{f as Ue}from"./vue.cbdb927d.js";import{u as re,r as se,_ as ie}from"./dialog.85e1bd85.js";import{R as Re,L as Ve,a as ze,D as Te,T as Me,U as Ge}from"./index.b372cd7a.js";import{B as Ke}from"./index.9afeca78.js";import{c as y,i as C,y as H,u as le}from"./index.32ded5d6.js";import{b as F,I as He}from"./form-model.724991ed.js";import{C as Je}from"./index.479d50c4.js";import{P as qe,s as Xe}from"./dep-6deb4e3a.2144db04.js";import{L as We,F as Qe,a as Ye}from"./index.70c9fed2.js";import"./chart.3c227ebb.js";import"./index.46911dcd.js";function J(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function q(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?J(Object(o),!0).forEach(function(n){ie(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):J(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}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:"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"}}]},et=D({name:"CheckDoubleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:o}=e,n=g(()=>t.size),{className:a,style:c}=re(n),r=g(()=>["t-icon","t-icon-check-double",a.value]),s=g(()=>q(q({},c.value),o.style)),d=g(()=>({class:r.value,style:s.value,onClick:b=>{var p;return(p=t.onClick)===null||p===void 0?void 0:p.call(t,{e:b})}}));return()=>se(Ze,d.value)}});const tt=et;function X(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function W(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?X(Object(o),!0).forEach(function(n){ie(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):X(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}var nt={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"}}]},ot=D({name:"ThumbUpIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:o}=e,n=g(()=>t.size),{className:a,style:c}=re(n),r=g(()=>["t-icon","t-icon-thumb-up",a.value]),s=g(()=>W(W({},c.value),o.style)),d=g(()=>({class:r.value,style:s.value,onClick:b=>{var p;return(p=t.onClick)===null||p===void 0?void 0:p.call(t,{e:b})}}));return()=>se(nt,d.value)}});const at=ot;/**
|
2024-05-26 17:25:47 +00:00
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var rt={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 Q=function(e){var o="xs";return e<768?o="xs":e>=768&&e<992?o="sm":e>=992&&e<1200?o="md":e>=1200&&e<1400?o="lg":e>=1400&&e<1880?o="xl":o="xxl",o};/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function st(t,e){oe(function(){window.addEventListener(t,e)}),ke(function(){window.removeEventListener(t,e)})}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Y(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function I(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Y(Object(o),!0).forEach(function(n){y(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Y(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ce(){var t=Se(Q(H?0:window.innerWidth)),e=function(){t.value=Q(H?0:window.innerWidth)};return st("resize",e),t}function it(t,e){var o=e.justify,n=e.align;return[t,y(y({},"".concat(t,"--").concat(o),o),"".concat(t,"--align-").concat(n),n)]}function lt(t,e){var o={},n=function(s){return Object.assign(o,{marginLeft:"".concat(s/-2,"px"),marginRight:"".concat(s/-2,"px")})},a=function(s){return Object.assign(o,{rowGap:"".concat(s,"px")})},c={isNumber:function(s){C(s)&&n(s)},isArray:function(s){L(s)&&s.length&&(c.isNumber(s[0]),C(s[1])&&a(s[1]),P(s[0])&&!F(s[0][e])&&n(s[0][e]),P(s[1])&&!F(s[1][e])&&a(s[1][e]))},isObject:function(s){P(s)&&s[e]&&(L(s)&&s.length?(n(s[e][0]),a(s[e][1])):n(s[e]))}};return Object.keys(c).forEach(function(r){c[r](t)}),o}function ct(t){return C(t)?"".concat(t," ").concat(t," 0"):/^\d+(\.\d+)?(px|r?em|%)$/.test(t)?"0 0 ".concat(t):t}function ut(t,e){var o={},n=function(r){return Object.assign(o,{paddingLeft:"".concat(r/2,"px"),paddingRight:"".concat(r/2,"px")})},a={isNumber:function(r){C(r)&&n(r)},isArray:function(r){L(r)&&r.length&&(C(r[0])&&n(r[0]),P(r[0])&&r[0][e]&&n(r[0][e]))},isObject:function(r){P(r)&&r[e]&&n(r[e])}};return Object.keys(a).forEach(function(c){a[c](t)}),o}function pt(t,e){var o=e.span,n=e.order,a=e.offset,c=e.push,r=e.pull,s=["xs","sm","md","lg","xl","xxl"],d=s.reduce(function(b,p){var O=e[p],v={};return C(O)?v.span=O:P(O)&&(v=O||{}),I(I({},b),{},y(y(y(y(y({},"".concat(t,"-").concat(p,"-").concat(v.span),!F(v.span)),"".concat(t,"-").concat(p,"-order-").concat(v.order),parseInt(v.order,10)>=0),"".concat(t,"-").concat(p,"-offset-").concat(v.offset),parseInt(v.offset,10)>=0),"".concat(t,"-").concat(p,"-push-").concat(v.push),parseInt(v.push,10)>=0),"".concat(t,"-").concat(p,"-pull-").concat(v.pull),parseInt(v.pull,10)>=0))},{});return I(y(y(y(y(y(y({},"".concat(t),!0),"".concat(t,"-").concat(o),!F(o)),"".concat(t,"-order-").concat(n),n),"".concat(t,"-offset-").concat(a),a),"".concat(t,"-push-").concat(c),c),"".concat(t,"-pull-").concat(r),r),d)}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Z(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function ft(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Z(Object(o),!0).forEach(function(n){y(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Z(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function dt(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!ae(t)}var mt=D({name:"TRow",props:ft({},rt),setup:function(e){var o=Ae(e),n=o.gutter,a=te();De("rowContext",B({gutter:n}));var c=ce(),r=le("row"),s=g(function(){return it(r.value,e)}),d=g(function(){return lt(e.gutter,c.value)});return function(){var b,p=e.tag;return i(p,{class:s.value,style:d.value},dt(b=a("default"))?b:{default:function(){return[b]}})}}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var bt={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 ee(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function yt(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?ee(Object(o),!0).forEach(function(n){y(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ee(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function vt(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!ae(t)}var gt=D({name:"TCol",inject:["rowContext"],props:yt({},bt),setup:function(e){var o=le("col"),n=te(),a=Ee("rowContext",Object.create(null)),c=ce(),r=g(function(){return pt(o.value,e)}),s=g(function(){var d={},b=e.flex;if(b&&(d.flex=ct(b)),a){var p=a.gutter;Object.assign(d,ut(p,c.value))}return d});return function(){var d,b=e.tag;return i(b,{class:r.value,style:s.value},vt(d=n("default"))?d:{default:function(){return[d]}})}}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-05-26 17:46:41 +00:00
|
|
|
*/var _t=ne(mt),wt=ne(gt);const Ot=t=>(Le("data-v-6731e277"),t=t(),Be(),t),ht={class:"container"},jt={style:{"margin-right":"20px"}},xt=["title","src"],Pt={style:{display:"flex","align-items":"center","justify-content":"space-between"}},Ct={style:{display:"flex",width:"100%"}},kt={style:{width:"90%"}},St=Ot(()=>x("br",null,null,-1)),At={style:{width:"10%",margin:"auto","text-align":"center"}},Dt={name:"Backup"},Et=D({...Dt,setup(t){je();const e=xe(),o=Ue(),n=B({binaryFile:void 0,loading:!1,showPanel:!1,showUpload:!1,refLoading:!1,myList:[],total:0,page:1,nowpage:[]}),a=B({title:"",desc:"",firmware:[]});oe(async()=>{c({current:1})});const c=async m=>{n.page=m.current;const f=await S.get("https://k5.vicicode.com/wsapi/list?type=1&limit=24&page="+m.current+"&t="+Date.now());n.total=f.total,n.nowpage=f.data},r=async()=>{n.refLoading=!0,n.showPanel=!0;const m=await S.post("https://k5.vicicode.com/wsapi/my_list",{type:1,token:e.accountId});n.myList=m.data,n.refLoading=!1},s=()=>{a.title="",a.desc="",a.firmware=[],n.showUpload=!0},d=async()=>{if(a.title==""||a.firmware.length==0){K.error({content:"\u672A\u586B\u5199\u540D\u79F0\u53CA\u4E0A\u4F20\u6587\u4EF6",duration:5*1e3});return}await S.post("https://k5.vicicode.com/wsapi/upload",{type:1,token:e.accountId,title:a.title,desc:a.desc,data:a.firmware[0].url}),n.showUpload=!1,r()},b=async m=>{await S.post("https://k5.vicicode.com/wsapi/delete",{id:m,token:e.accountId}),r()},p=async m=>{await S.post("https://k5.vicicode.com/wsapi/star",{id:m}),K.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},O=()=>{r()},v=m=>{o.push({path:"/tool/image",query:{url:m}})};return(m,f)=>{const ue=Pe,E=$e,k=Ke,U=wt,pe=_t,fe=Je,R=Fe,V=Ie,de=qe,me=Ne,be=Xe,ye=We,ve=Ve,ge=ze,z=Te,_e=He,N=Qe,we=Me,Oe=Ge,he=Ye;return h(),A("div",ht,[i(ue,{items:[m.$t("menu.workshop"),m.$t("menu.image")]},null,8,["items"]),i(V,{gutter:20,align:"stretch"},{default:l(()=>[i(R,{span:24},{default:l(()=>[i(me,{class:"general-card",title:m.$t("menu.image")},{extra:l(()=>[x("div",jt,[w(e).name?(h(),A($,{key:0},[i(E,{onClick:r},{default:l(()=>[_("\xA0\xA0"+j(w(e).name)+"\xA0\xA0",1)]),_:1}),i(E,{onClick:f[0]||(f[0]=u=>w(e).logout())},{default:l(()=>[_("\xA0\xA0"+j(m.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(h(),A($,{key:1},[i(E,{onClick:f[1]||(f[1]=u=>w(e).setInfo({showLogin:!0}))},{default:l(()=>[_("\xA0\xA0"+j(m.$t("global.login"))+"\xA0\xA0",1)]),_:1}),i(E,{onClick:f[2]||(f[2]=u=>w(e).setInfo({showRegister:!0}))},{default:l(()=>[_("\xA0\xA0"+j(m.$t("global.register"))+"\xA0\xA0",1)]),_:1})],64))])]),default:l(()=>[i(V,{gutter:20},{default:l(()=>[(h(!0),A($,null,M(n.nowpage,u=>(h(),G(R,{span:4},{default:l(()=>[i(fe,{style:{width:"100%",marginBottom:"10px"}},{cover:l(()=>[x("img",{title:u.title,src:"https://k5.vicicode.com/wsapi/download?id="+u.id},null,8,xt)]),footer:l(()=>[i(pe,{align:"middle",justify:"center",style:{gap:"24px"}},{default:l(()=>[i(U,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:l(()=>[i(k,{variant:"text",shape:"square",onClick:T=>p(u.id)},{default:l(()=>[i(w(at))]),_:2},1032,["onClick"])]),_:2},1024),i(U,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:l(()=>[i(k,{variant:"text",shape:"square",onClick:T=>v("https://k5.vicicode.com/wsapi/download?id="+u.id)},{default:l(()=>[i(w(tt))]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),256))]),_:1}),i(de,{onChange:c,style:{margin:"10px"},total:n.total,current:n.page,pageSize:24,showPageNumber:"",showPageSize:!1},null,8,["total","current"])]),_:1},8,["title"])]),_:1})]),_:1}),i(z,{visible:n.showPanel,"onUpdate:visible":f[3]||(f[3]=u=>n.showPanel=u),size:"50%",header:"\u6211\u7684\u56FE\u7247",footer:!1},{default:l(()=>[x("div",Pt,[i(k,{style:{margin:"10px"},onClick:s},{default:l(()=>[_("\u4E0A\u4F20\u65B0\u56FE\u7247")]),_:1}),i(k,{loading:n.refLoading,shape:"circle",theme:"outline",onClick:O},{icon:l(()=>[i(w(Re))]),_:1},8,["loading"])]),i(ge,{split:!0},{default:l(()=>[(h(!0),A($,null,M(n.myList,u=>(h(),G(ve,null,{default:l(()=>[x("div",Ct,[x("div",kt,
|