k5web/assets/index.fb915504.js
2024-10-09 22:53:21 +08:00

33 lines
17 KiB
JavaScript

import{P as re,Q as se,S as ie,f as g,l as A,Y as S,k as B,am as q,b as le,i as ce,w as ue,t as Se,u as Ae,N as P,ad as De,O as Fe,_ as Ee}from"./index.e566a7c9.js";/* empty css *//* empty css *//* empty css */import{d as $,c as w,o as pe,b as Ne,j as $e,t as Ie,p as Le,r as R,aI as o,aU as de,i as ze,bI as Ue,C as O,D as E,aH as i,G as j,aM as b,aN as _,u as h,aK as z,aJ as X,aE as N,b7 as W,bh as Ve,bK as Be,bO as Re,bm as Te,bn as Me}from"./arco.b087a425.js";import{g as Ke}from"./vue.23fb8a9a.js";import{S as Ge,R as He,L as Je,a as qe,D as Xe,T as We,U as Qe}from"./index.6903c0c0.js";import{i as U,I as Ye}from"./index.35293962.js";import{C as Ze}from"./index.f33e1f10.js";import{P as et,s as tt}from"./dep-71c4f289.e27baa68.js";import{L as nt}from"./index.d24f0048.js";import{F as at,a as ot}from"./index.c6d992bd.js";import"./chart.836a9fe2.js";import"./slot.50be8187.js";import"./index.351768f8.js";import"./form-model.7d3d4fdc.js";import"./index.82e088a6.js";function Q(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),a.push.apply(a,n)}return a}function Y(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Q(Object(a),!0).forEach(function(n){ie(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Q(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var rt={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"}}]},st=$({name:"CheckDoubleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=w(()=>t.size),{className:u,style:m}=re(n),s=w(()=>["t-icon","t-icon-check-double",u.value]),r=w(()=>Y(Y({},m.value),a.style)),c=w(()=>({class:s.value,style:r.value,onClick:v=>{var f;return(f=t.onClick)===null||f===void 0?void 0:f.call(t,{e:v})}}));return()=>se(rt,c.value)}});const it=st;function Z(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),a.push.apply(a,n)}return a}function ee(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Z(Object(a),!0).forEach(function(n){ie(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Z(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var lt={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"}}]},ct=$({name:"ThumbUpIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=w(()=>t.size),{className:u,style:m}=re(n),s=w(()=>["t-icon","t-icon-thumb-up",u.value]),r=w(()=>ee(ee({},m.value),a.style)),c=w(()=>({class:s.value,style:r.value,onClick:v=>{var f;return(f=t.onClick)===null||f===void 0?void 0:f.call(t,{e:v})}}));return()=>se(lt,c.value)}});const ut=ct;/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var pt={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.9
* (c) 2024 tdesign
* @license MIT
*/var te=function(e){var a="xs";return e<768?a="xs":e>=768&&e<992?a="sm":e>=992&&e<1200?a="md":e>=1200&&e<1400?a="lg":e>=1400&&e<1880?a="xl":a="xxl",a};/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/function dt(t,e){pe(function(){window.addEventListener(t,e)}),Ne(function(){window.removeEventListener(t,e)})}/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/function ne(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),a.push.apply(a,n)}return a}function V(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ne(Object(a),!0).forEach(function(n){g(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ne(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function fe(){var t=$e(te(q?0:window.innerWidth)),e=function(){t.value=te(q?0:window.innerWidth)};return dt("resize",e),t}function ft(t,e){var a=e.justify,n=e.align;return[t,g(g({},"".concat(t,"--").concat(a),a),"".concat(t,"--align-").concat(n),n)]}function mt(t,e){var a={},n=function(r){return Object.assign(a,{marginLeft:"".concat(r/-2,"px"),marginRight:"".concat(r/-2,"px")})},u=function(r){return Object.assign(a,{rowGap:"".concat(r,"px")})},m={isNumber:function(r){A(r)&&n(r)},isArray:function(r){B(r)&&r.length&&(m.isNumber(r[0]),A(r[1])&&u(r[1]),S(r[0])&&!U(r[0][e])&&n(r[0][e]),S(r[1])&&!U(r[1][e])&&u(r[1][e]))},isObject:function(r){S(r)&&r[e]&&(B(r)&&r.length?(n(r[e][0]),u(r[e][1])):n(r[e]))}};return Object.keys(m).forEach(function(s){m[s](t)}),a}function vt(t){return A(t)?"".concat(t," ").concat(t," 0"):/^\d+(\.\d+)?(px|r?em|%)$/.test(t)?"0 0 ".concat(t):t}function bt(t,e){var a={},n=function(s){return Object.assign(a,{paddingLeft:"".concat(s/2,"px"),paddingRight:"".concat(s/2,"px")})},u={isNumber:function(s){A(s)&&n(s)},isArray:function(s){B(s)&&s.length&&(A(s[0])&&n(s[0]),S(s[0])&&s[0][e]&&n(s[0][e]))},isObject:function(s){S(s)&&s[e]&&n(s[e])}};return Object.keys(u).forEach(function(m){u[m](t)}),a}function gt(t,e){var a=e.span,n=e.order,u=e.offset,m=e.push,s=e.pull,r=["xs","sm","md","lg","xl","xxl"],c=r.reduce(function(v,f){var x=e[f],y={};return A(x)?y.span=x:S(x)&&(y=x||{}),V(V({},v),{},g(g(g(g(g({},"".concat(t,"-").concat(f,"-").concat(y.span),!U(y.span)),"".concat(t,"-").concat(f,"-order-").concat(y.order),parseInt(y.order,10)>=0),"".concat(t,"-").concat(f,"-offset-").concat(y.offset),parseInt(y.offset,10)>=0),"".concat(t,"-").concat(f,"-push-").concat(y.push),parseInt(y.push,10)>=0),"".concat(t,"-").concat(f,"-pull-").concat(y.pull),parseInt(y.pull,10)>=0))},{});return V(g(g(g(g(g(g({},"".concat(t),!0),"".concat(t,"-").concat(a),!U(a)),"".concat(t,"-order-").concat(n),n),"".concat(t,"-offset-").concat(u),u),"".concat(t,"-push-").concat(m),m),"".concat(t,"-pull-").concat(s),s),c)}/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/function ae(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),a.push.apply(a,n)}return a}function yt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ae(Object(a),!0).forEach(function(n){g(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ae(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function _t(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!de(t)}var wt=$({name:"TRow",props:yt({},pt),setup:function(e){var a=Ie(e),n=a.gutter,u=ce();Le("rowContext",R({gutter:n}));var m=fe(),s=le("row"),r=w(function(){return ft(s.value,e)}),c=w(function(){return mt(e.gutter,m.value)});return function(){var v,f=e.tag;return o(f,{class:r.value,style:c.value},_t(v=u("default"))?v:{default:function(){return[v]}})}}});/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var Ot={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.9
* (c) 2024 tdesign
* @license MIT
*/function oe(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable})),a.push.apply(a,n)}return a}function ht(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?oe(Object(a),!0).forEach(function(n){g(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):oe(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function jt(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!de(t)}var xt=$({name:"TCol",inject:["rowContext"],props:ht({},Ot),setup:function(e){var a=le("col"),n=ce(),u=ze("rowContext",Object.create(null)),m=fe(),s=w(function(){return gt(a.value,e)}),r=w(function(){var c={},v=e.flex;if(v&&(c.flex=vt(v)),u){var f=u.gutter;Object.assign(c,bt(f,m.value))}return c});return function(){var c,v=e.tag;return o(v,{class:s.value,style:r.value},jt(c=n("default"))?c:{default:function(){return[c]}})}}});/**
* tdesign v1.9.9
* (c) 2024 tdesign
* @license MIT
*/var kt=ue(wt),Pt=ue(xt);const Ct=t=>(Te("data-v-bc51700c"),t=t(),Me(),t),St={class:"container"},At={style:{display:"flex",gap:"1rem","align-items":"flex-end"}},Dt={style:{"margin-right":"20px"}},Ft={style:{color:"#373737",margin:"10px"}},Et={style:{display:"block",position:"absolute","background-color":"rgba(0, 0, 0, 0.3)","min-width":"80px",color:"white","padding-left":"10px","padding-right":"10px","font-size":"0.9rem"}},Nt=["title","src"],$t={style:{display:"flex","align-items":"center","justify-content":"space-between"}},It={style:{display:"flex",width:"100%"}},Lt={style:{width:"90%"}},zt=Ct(()=>j("br",null,null,-1)),Ut={style:{width:"40%",margin:"auto","text-align":"center"}},Vt={name:"Backup"},Bt=$({...Vt,setup(t){Se();const e=Ae(),a=Ke(),n=R({binaryFile:void 0,loading:!1,showPanel:!1,showUpload:!1,refLoading:!1,myList:[],total:0,page:1,nowpage:[],dropzoneActive:!1,title:""}),u=p=>{p.preventDefault(),n.dropzoneActive=!0},m=p=>{p.preventDefault(),n.dropzoneActive=!1},s=p=>{p.preventDefault()},r=async p=>{p.preventDefault(),n.dropzoneActive=!1;const d=p.dataTransfer.files;for(let C=0;C<d.length;C++){const D=new FormData;D.append("file",d[C]);let k=await P.post("https://k5ws.vicicode.cn/api/ajax/upload?server=1",D,{headers:{"ba-user-token":e.accountId}});await P.post("https://k5ws.vicicode.cn/api/image/add?server=1",{title:d[C].name,desc:"",image:k.data.file.url},{headers:{"ba-user-token":e.accountId}}),f()}},c=R({title:"",desc:"",firmware:[]});pe(async()=>{v({current:1})});const v=async p=>{n.page=p.current;const d=await P.get("https://k5ws.vicicode.cn/api/image/index?server=1&limit=24&page="+p.current+"&title="+n.title+"&t="+Date.now());n.total=d.data.total,n.nowpage=d.data.list},f=async()=>{n.refLoading=!0,n.showPanel=!0;const p=await P.post("https://k5ws.vicicode.cn/api/image/my?server=1",{},{headers:{"ba-user-token":e.accountId}});n.myList=p.data,n.refLoading=!1},x=()=>{c.title="",c.desc="",c.firmware=[],n.showUpload=!0},y=async()=>{if(c.title==""||c.firmware.length==0){W.error({content:"\u672A\u586B\u5199\u540D\u79F0\u53CA\u4E0A\u4F20\u6587\u4EF6",duration:5*1e3});return}await P.post("https://k5ws.vicicode.cn/api/image/add?server=1",{title:c.title,desc:c.desc,data:c.firmware[0].response.data.file.url},{headers:{"ba-user-token":e.accountId}}),n.showUpload=!1,f()},me=async p=>{await P.post("https://k5ws.vicicode.cn/api/image/del?server=1",{id:p},{headers:{"ba-user-token":e.accountId}}),f()},ve=async p=>{n.nowpage.filter(d=>{d.id==p&&(d.star+=1)}),await P.post("https://k5ws.vicicode.cn/api/image/star?server=1",{id:p}),W.success({content:"\u70B9\u8D5E\u6210\u529F",duration:5*1e3})},be=()=>{f()},ge=p=>{a.push({path:"/tool/image",query:{url:p}})},T=()=>{v({current:1})};return(p,d)=>{const C=De,D=Ye,k=Ve,F=Fe,M=Pt,ye=kt,_e=Ze,K=Be,G=Re,we=et,Oe=Ue,I=tt,he=nt,je=Je,xe=qe,H=Xe,L=at,ke=We,Pe=Qe,Ce=ot;return O(),E("div",St,[o(C,{items:[p.$t("menu.workshop"),p.$t("menu.image")]},null,8,["items"]),o(G,{gutter:20,align:"stretch"},{default:i(()=>[o(K,{span:24},{default:i(()=>[o(Oe,{class:"general-card"},{title:i(()=>[j("div",At,[b(_(p.$t("menu.image"))+" ",1),o(D,{size:"small",style:{width:"200px"},modelValue:n.title,"onUpdate:modelValue":d[0]||(d[0]=l=>n.title=l),onEnter:T},{suffixIcon:i(()=>[o(h(Ge),{style:{cursor:"pointer"},onClick:T})]),_:1},8,["modelValue"])])]),extra:i(()=>[j("div",Dt,[h(e).name?(O(),E(z,{key:0},[o(k,{onClick:f},{default:i(()=>[b("\xA0\xA0"+_(h(e).name)+"\xA0\xA0",1)]),_:1}),o(k,{onClick:f},{default:i(()=>[b("\xA0\xA0"+_(p.$t("global.upload"))+"\xA0\xA0",1)]),_:1}),o(k,{onClick:d[1]||(d[1]=l=>h(e).logout())},{default:i(()=>[b("\xA0\xA0"+_(p.$t("global.logout"))+"\xA0\xA0",1)]),_:1})],64)):(O(),E(z,{key:1},[o(k,{onClick:d[2]||(d[2]=l=>h(e).setInfo({showLogin:!0}))},{default:i(()=>[b("\xA0\xA0"+_(p.$t("global.login"))+"\xA0\xA0",1)]),_:1}),o(k,{onClick:d[3]||(d[3]=l=>h(e).setInfo({showRegister:!0}))},{default:i(()=>[b("\xA0\xA0"+_(p.$t("global.register"))+"\xA0\xA0",1)]),_:1}),j("span",Ft,_(p.$t("global.loginUpload")),1)],64))])]),default:i(()=>[o(G,{gutter:20},{default:i(()=>[(O(!0),E(z,null,X(n.nowpage,l=>(O(),N(K,{span:4},{default:i(()=>[o(_e,{style:{width:"100%",marginBottom:"10px"}},{cover:i(()=>[j("div",Et," \u70B9\u8D5E\uFF1A"+_(l.star),1),j("img",{style:{height:"6.75vw"},title:l.title+" ["+l.user.nickname+"]",src:"https://k5ws.vicicode.cn"+l.image},null,8,Nt)]),footer:i(()=>[o(ye,{align:"middle",justify:"center",style:{gap:"24px"}},{default:i(()=>[o(M,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:i(()=>[o(F,{variant:"text",shape:"square",onClick:J=>ve(l.id)},{default:i(()=>[o(h(ut))]),_:2},1032,["onClick"])]),_:2},1024),o(M,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:i(()=>[o(F,{variant:"text",shape:"square",onClick:J=>ge("https://k5ws.vicicode.cn"+l.image)},{default:i(()=>[o(h(it))]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),256))]),_:1}),o(we,{onChange:v,style:{margin:"10px"},total:n.total,current:n.page,pageSize:24,showPageNumber:"",showPageSize:!1},null,8,["total","current"])]),_:1})]),_:1})]),_:1}),o(H,{visible:n.showPanel,"onUpdate:visible":d[4]||(d[4]=l=>n.showPanel=l),size:"50%",header:"\u6211\u7684\u56FE\u7247",footer:!1,onDragenter:u,onDragleave:m,onDragover:s,onDrop:r},{default:i(()=>[j("div",$t,[o(F,{style:{margin:"10px"},onClick:x},{default:i(()=>[b("\u4E0A\u4F20\u65B0\u56FE\u7247")]),_:1}),o(F,{loading:n.refLoading,shape:"circle",theme:"outline",onClick:be},{icon:i(()=>[o(h(He))]),_:1},8,["loading"])]),o(xe,{split:!0},{default:i(()=>[(O(!0),E(z,null,X(n.myList,l=>(O(),N(je,null,{default:i(()=>[j("div",It,[j("div",Lt,[l.status==0?(O(),N(I,{key:0,theme:"primary",variant:"outline"},{default:i(()=>[b("\u5BA1\u6838\u4E2D"+_(l.remark&&`\uFF08${l.remark}\uFF09`),1)]),_:2},1024)):l.status==1?(O(),N(I,{key:1,theme:"primary",variant:"outline"},{default:i(()=>[b("\u5DF2\u5BA1\u6838"+_(l.remark&&`\uFF08${l.remark}\uFF09`),1)]),_:2},1024)):(O(),N(I,{key:2,theme:"primary",variant:"outline"},{default:i(()=>[b("\u5DF2\u9A73\u56DE"+_(l.remark&&`\uFF08${l.remark}\uFF09`),1)]),_:2},1024)),b(" "+_(l.title)+" ",1),zt,b(" "+_(l.desc),1)]),j("div",Ut,[o(I,null,{default:i(()=>[b(_(l.create_time_text),1)]),_:2},1024),b("\xA0 "),o(he,{theme:"primary",hover:"color",onClick:J=>me(l.id)},{default:i(()=>[b("\u5220\u9664")]),_:2},1032,["onClick"])])])]),_:2},1024))),256))]),_:1})]),_:1},8,["visible"]),o(H,{visible:n.showUpload,"onUpdate:visible":d[8]||(d[8]=l=>n.showUpload=l),size:"25%",header:"\u4E0A\u4F20\u65B0\u56FE\u7247",footer:!1},{default:i(()=>[o(Ce,{data:c,"reset-type":"initial",colon:"",onSubmit:y},{default:i(()=>[o(L,{label:"\u56FE\u7247\u540D\u79F0",name:"title","label-align":"top"},{default:i(()=>[o(D,{modelValue:c.title,"onUpdate:modelValue":d[5]||(d[5]=l=>c.title=l)},null,8,["modelValue"])]),_:1}),o(L,{label:"\u56FE\u7247\u63CF\u8FF0",name:"desc","label-align":"top"},{default:i(()=>[o(ke,{autosize:{minRows:5,maxRows:10},modelValue:c.desc,"onUpdate:modelValue":d[6]||(d[6]=l=>c.desc=l),clearable:""},null,8,["modelValue"])]),_:1}),o(L,{label:"\u56FE\u7247\u6587\u4EF6",name:"firmware","label-align":"top"},{default:i(()=>[o(Pe,{modelValue:c.firmware,"onUpdate:modelValue":d[7]||(d[7]=l=>c.firmware=l),action:"https://k5ws.vicicode.cn/api/ajax/upload?server=1","abridge-name":[8,6],headers:{"ba-user-token":h(e).accountId},theme:"file-input",placeholder:"\u672A\u9009\u62E9\u6587\u4EF6"},null,8,["modelValue","headers"])]),_:1}),o(L,{"label-align":"top"},{default:i(()=>[o(F,{theme:"primary",type:"submit",block:""},{default:i(()=>[b("\u63D0\u4EA4\u5BA1\u6838")]),_:1})]),_:1})]),_:1},8,["data"])]),_:1},8,["visible"])])}}});const on=Ee(Bt,[["__scopeId","data-v-bc51700c"]]);export{on as default};