1
0
Fork 0
mirror of https://github.com/silenty4ng/k5web synced 2025-01-25 13:12:58 +00:00
k5web/assets/index.16f67093.js
2024-10-06 14:43:35 +08:00

33 lines
17 KiB
JavaScript

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