2 lines
23 KiB
JavaScript
2 lines
23 KiB
JavaScript
var We=Object.defineProperty,Le=Object.defineProperties;var je=Object.getOwnPropertyDescriptors;var we=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable;var xe=(s,e,n)=>e in s?We(s,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[e]=n,K=(s,e)=>{for(var n in e||(e={}))Ke.call(e,n)&&xe(s,n,e[n]);if(we)for(var n of we(e))Ge.call(e,n)&&xe(s,n,e[n]);return s},le=(s,e)=>Le(s,je(e));var N=(s,e,n)=>new Promise((a,b)=>{var A=u=>{try{$(n.next(u))}catch(h){b(h)}},k=u=>{try{$(n.throw(u))}catch(h){b(h)}},$=u=>u.done?a(u.value):Promise.resolve(u.value).then(A,k);$((n=n.apply(s,e)).next())});import{b as He,ad as $e,d as Ye,ae as ye,af as ce,ag as he,c as pe,ah as ge,ai as Ee,e as j,aj as Ze,ak as Je,h as Qe,al as Xe,n as B,am as et,an as tt,r as Z,ao as at,w as me,ap as nt,p as ot,q as d,F as D,y as r,A as t,z as P,aq as st,t as x,x as _,L as ie,E as J,C as M,a4 as z,I as H,v as g,ar as ut,R as Se,B as Ie,_ as lt,as as De,o as it,at as Ae,au as ct,Y as rt,Z as ve,$ as re,a0 as ee,av as be,a9 as W,aa as v,aw as Pe,a1 as G,P as Ve,ax as Oe,ay as R,a5 as de,a6 as fe,a7 as te,az as dt,O as X,H as ft,a2 as Me,a3 as Ce,aA as ht,aB as pt}from"./index.js";import{u as ae,s as Te}from"./chunk.6424c2fc.js";import{c as Ne,d as mt,E as vt,a as _t,b as _e,e as Q,f as Fe,_ as Ft}from"./chunk.a0a5dece.js";import{i as yt,E as Y}from"./chunk.a6a47e72.js";const gt=He({modelValue:{type:[Boolean,String,Number],default:!1},value:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},width:{type:[String,Number],default:""},inlinePrompt:{type:Boolean,default:!1},activeIcon:{type:$e},inactiveIcon:{type:$e},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},borderColor:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},id:String,loading:{type:Boolean,default:!1},beforeChange:{type:Ye(Function)},size:{type:String,validator:yt},tabindex:{type:[String,Number]}}),Et={[ye]:s=>ce(s)||he(s)||pe(s),[ge]:s=>ce(s)||he(s)||pe(s),[Ee]:s=>ce(s)||he(s)||pe(s)},bt=["onClick"],Ct=["id","aria-checked","aria-disabled","name","true-value","false-value","disabled","tabindex","onKeydown"],Dt=["aria-hidden"],Bt=["aria-hidden"],kt=["aria-hidden"],wt=["aria-hidden"],xt={name:"ElSwitch"},$t=j(le(K({},xt),{props:gt,emits:Et,setup(s,{expose:e,emit:n}){const a=s,b="ElSwitch",A=De(),{formItem:k}=Ze(),$=Je(),u=Qe("switch");Xe({from:'"value"',replacement:'"model-value" or "v-model"',scope:b,version:"2.3.0",ref:"https://element-plus.org/en-US/component/switch.html#attributes",type:"Attribute"},B(()=>{var i;return!!((i=A.vnode.props)!=null&&i.value)}));const{inputId:h}=et(a,{formItemContext:k}),f=tt(B(()=>a.loading)),o=Z(a.modelValue!==!1),p=Z(),F=Z(),w=B(()=>[u.b(),u.m($.value),u.is("disabled",f.value),u.is("checked",E.value)]),C=B(()=>({width:at(a.width)}));me(()=>a.modelValue,()=>{o.value=!0}),me(()=>a.value,()=>{o.value=!1});const m=B(()=>o.value?a.modelValue:a.value),E=B(()=>m.value===a.activeValue);[a.activeValue,a.inactiveValue].includes(m.value)||(n(ye,a.inactiveValue),n(ge,a.inactiveValue),n(Ee,a.inactiveValue)),me(E,i=>{var T;p.value.checked=i,a.validateEvent&&((T=k==null?void 0:k.validate)==null||T.call(k,"change").catch(I=>nt()))});const V=()=>{const i=E.value?a.inactiveValue:a.activeValue;n(ye,i),n(ge,i),n(Ee,i),it(()=>{p.value.checked=E.value})},O=()=>{if(f.value)return;const{beforeChange:i}=a;if(!i){V();return}const T=i();[Ae(T),ce(T)].includes(!0)||ct(b,"beforeChange must return type `Promise<boolean>` or `boolean`"),Ae(T)?T.then(ne=>{ne&&V()}).catch(ne=>{}):T&&V()},q=B(()=>u.cssVarBlock(K(K(K({},a.activeColor?{"on-color":a.activeColor}:null),a.inactiveColor?{"off-color":a.inactiveColor}:null),a.borderColor?{"border-color":a.borderColor}:null))),L=()=>{var i,T;(T=(i=p.value)==null?void 0:i.focus)==null||T.call(i)};return ot(()=>{p.value.checked=E.value}),e({focus:L,checked:E}),(i,T)=>(d(),D("div",{class:P(t(w)),style:Se(t(q)),onClick:Ie(O,["prevent"])},[r("input",{id:t(h),ref_key:"input",ref:p,class:P(t(u).e("input")),type:"checkbox",role:"switch","aria-checked":t(E),"aria-disabled":t(f),name:i.name,"true-value":i.activeValue,"false-value":i.inactiveValue,disabled:t(f),tabindex:i.tabindex,onChange:V,onKeydown:st(O,["enter"])},null,42,Ct),!i.inlinePrompt&&(i.inactiveIcon||i.inactiveText)?(d(),D("span",{key:0,class:P([t(u).e("label"),t(u).em("label","left"),t(u).is("active",!t(E))])},[i.inactiveIcon?(d(),x(t(J),{key:0},{default:_(()=>[(d(),x(ie(i.inactiveIcon)))]),_:1})):M("v-if",!0),!i.inactiveIcon&&i.inactiveText?(d(),D("span",{key:1,"aria-hidden":t(E)},z(i.inactiveText),9,Dt)):M("v-if",!0)],2)):M("v-if",!0),r("span",{ref_key:"core",ref:F,class:P(t(u).e("core")),style:Se(t(C))},[i.inlinePrompt?(d(),D("div",{key:0,class:P(t(u).e("inner"))},[i.activeIcon||i.inactiveIcon?(d(),D(H,{key:0},[i.activeIcon?(d(),x(t(J),{key:0,class:P([t(u).is("icon"),t(E)?t(u).is("show"):t(u).is("hide")])},{default:_(()=>[(d(),x(ie(i.activeIcon)))]),_:1},8,["class"])):M("v-if",!0),i.inactiveIcon?(d(),x(t(J),{key:1,class:P([t(u).is("icon"),t(E)?t(u).is("hide"):t(u).is("show")])},{default:_(()=>[(d(),x(ie(i.inactiveIcon)))]),_:1},8,["class"])):M("v-if",!0)],64)):i.activeText||i.inactiveIcon?(d(),D(H,{key:1},[i.activeText?(d(),D("span",{key:0,class:P([t(u).is("text"),t(E)?t(u).is("show"):t(u).is("hide")]),"aria-hidden":!t(E)},z(i.activeText.substring(0,3)),11,Bt)):M("v-if",!0),i.inactiveText?(d(),D("span",{key:1,class:P([t(u).is("text"),t(E)?t(u).is("hide"):t(u).is("show")]),"aria-hidden":t(E)},z(i.inactiveText.substring(0,3)),11,kt)):M("v-if",!0)],64)):M("v-if",!0)],2)):M("v-if",!0),r("div",{class:P(t(u).e("action"))},[i.loading?(d(),x(t(J),{key:0,class:P(t(u).is("loading"))},{default:_(()=>[g(t(ut))]),_:1},8,["class"])):M("v-if",!0)],2)],6),!i.inlinePrompt&&(i.activeIcon||i.activeText)?(d(),D("span",{key:1,class:P([t(u).e("label"),t(u).em("label","right"),t(u).is("active",t(E))])},[i.activeIcon?(d(),x(t(J),{key:0},{default:_(()=>[(d(),x(ie(i.activeIcon)))]),_:1})):M("v-if",!0),!i.activeIcon&&i.activeText?(d(),D("span",{key:1,"aria-hidden":!t(E)},z(i.activeText),9,wt)):M("v-if",!0)],2)):M("v-if",!0)],14,bt))}}));var St=lt($t,[["__file","/home/runner/work/element-plus/element-plus/packages/components/switch/src/switch.vue"]]);const ze=rt(St),At={class:"file-checkbox"},Tt=["value"],It=["title"],Pt={class:"thumbnail"},Vt={class:"file-name"},Ot={class:"file-date"},Mt={class:"file-type"},Nt={class:"file-size"},zt=j({__name:"file",props:{file:{type:Object,required:!0},index:{type:Number,required:!0}},setup(s){const e=s,n=ve.ComputeSize,a=ae(),b=re(),A=ee(),k=B(()=>[{name:"\u6253\u5F00",f:O},{name:"\u7F16\u8F91",f:L},{name:"\u590D\u5236",f:E},{name:"\u526A\u5207",f:V},{name:"\u91CD\u547D\u540D",f:F},{name:"\u4E0B\u8F7D",disabled:e.file.fileType==="dir",f:q},{name:"\u5220\u9664",f:C}]),$=B(()=>a.checknoxEntries.indexOf(e.file.rootPath)!=-1),u=B(()=>a.copy.type=="move"&&a.copy.values.indexOf(e.file.rootPath)!=-1),h=be.getFileType,f=l=>{l.target},o=l=>{const c=e.index;if(l!=c&&e.file.fileType==="dir"){const y=[];let U="";if(a.entries[l]){const S=a.entries[l];y.push(`/local${S.rootPath}`)}a.entries[c]&&(U=`/local${a.entries[c].rootPath}`),p(y,U)}},p=(l,c)=>N(this,null,function*(){try{const y=yield W.File.Basic.Move.POST({paths:l,destination:c});if(y.data){const{success:U,error:S}=y.data;U===0&&(v.Success("\u79FB\u52A8\u6210\u529F"),a.reload()),S&&v.Warning(S)}}catch(y){v.Error(`${y}`)}}),F=()=>{const l=e.file;Y.prompt(`\u6B63\u5728\u4FEE\u6539 ${l.name} ,\u8BF7\u8F93\u5165\u65B0\u540D\u79F0`,"\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",inputValue:l.name,inputValidator(c){return c==""?"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A":!0}}).then(({value:c})=>{w(c)}).catch(()=>{})},w=l=>N(this,null,function*(){const c=e.file,y=[];let U="";if(c.rootPath){y.push("/local"+c.rootPath);const S=c.rootPath.split("/");U="/local"+S.splice(0,S.length-1).join("/")}try{const S=yield W.File.Basic.Move.POST({paths:y,destination:U,singleFileName:l});if(S.data){const{success:se,error:ue}=S.data;se===0&&(v.Success("\u91CD\u547D\u540D\u6587\u4EF6\u4FEE\u6539\u6210\u529F"),a.reload()),ue&&v.Warning(ue)}}catch(S){v.Error(`${S}`)}}),C=()=>{const l=e.file,c=Z(!1);Y({title:"\u63D0\u793A",confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",type:"warning",showCancelButton:!0,message:()=>R("div",null,[R("p",null,`\u662F\u5426\u5220\u9664 ${l.name} \u8BE5\u6587\u4EF6?`),R("label",{style:{display:"flex",alignItems:"center"}},[R("span",{style:{marginRight:"1rem"}},"\u4E0D\u7ECF\u8FC7\u56DE\u6536\u7AD9\u5F3A\u5236\u5220\u9664?"),R(ze,{modelValue:c.value,"onUpdate:modelValue":y=>{c.value=y==!0}})])])}).then(()=>N(this,null,function*(){m(l,c.value)})).catch(()=>{})},m=(l,c)=>N(this,null,function*(){const y=[];if(l.rootPath!=null&&y.push("/local"+l.rootPath),y.length==0)return;const U=Pe("\u5220\u9664\u4E2D");try{const S={paths:y};c&&(S.force=!0);const se=yield W.File.Basic.Remove.POST(S);if(se.data){const{success:ue,error:ke}=se.data;ke&&v.Warning(ke),ue===0&&(v.Success("\u5220\u9664\u6210\u529F"),a.reload())}}catch(S){}finally{U.Close()}}),E=()=>{const l=e.file,c=[];l.rootPath&&c.push(l.rootPath),a.setCopy({type:"copy",values:c}),v.Success("\u5DF2\u590D\u5236")},V=()=>{const l=e.file,c=[];l.rootPath&&c.push(l.rootPath),a.setCopy({type:"move",values:c}),v.Success("\u5DF2\u526A\u5207")},O=()=>{const l=e.file;if(l.fileType==="dir"){i(l);return}switch(l.iconType){case"image":T();break;case"doc":I(l);break;case"video":qe(l);break;case"music":Re(l);break}},q=()=>{const l=e.file;window.open(l.getDownloadUrl()+"?binary=true","_blank")},L=()=>{const l=e.file;ne(l)},i=l=>{let c="/";l.rootPath===void 0?c=`/${l.name}`:c=l.rootPath,b.push({query:le(K({},A.query),{path:c})})},T=()=>{a.previewImage.values=be.getEntriesImages(a.entries,e.index),a.previewImage.enable=!0},I=l=>{const c=l.getSuffixName();let y=null;switch(c){case"pdf":y=l.getDownloadUrl();break;case"txt":case"md":case"js":case"yaml":case"yam":case"css":case"ts":case"json":case"html":y=ve.getLocationPathname(`editor?path=${l.rootPath}&format=text`);break}oe(y)},ne=l=>{let c=l.fileType==="dir"?"dir":"text";const y=ve.getLocationPathname(`editor?path=${l.rootPath}&format=${c}`);oe(y)},oe=l=>{if(l==null)return;const c=window.open("about:blank");c&&(c.location.href=l)},qe=l=>{oe(l.getDownloadUrl())},Re=l=>{oe(l.getDownloadUrl())};return(l,c)=>{const y=G("thumbnail");return d(),x(mt,{class:"file",draggable:"true",checkbox:t($),move:t(u),index:s.index,onChange:o},{default:_(()=>[g(Ne,{class:"file-container",list:t(k)},{default:_(()=>[r("div",At,[Ve(r("input",{type:"checkbox",value:s.file.rootPath,"onUpdate:modelValue":c[0]||(c[0]=U=>t(a).checknoxEntries=U),onChange:f},null,40,Tt),[[Oe,t(a).checknoxEntries]])]),r("div",{class:"file-info",onClick:c[1]||(c[1]=Ie(U=>O(),["prevent"])),title:s.file.name},[r("div",Pt,[g(y,{file:s.file},null,8,["file"])]),r("div",Vt,z(s.file.name),1)],8,It),r("div",Ot,z(s.file.modifiedTime),1),r("div",Mt,z(t(h)(s.file.iconType)),1),r("div",Nt,z(t(n)(s.file.size)),1)]),_:1},8,["list"])]),_:1},8,["checkbox","move","index"])}}}),Ut=s=>(de("data-v-412809e3"),s=s(),fe(),s),qt={class:"notfound"},Rt=Ut(()=>r("p",null,"\u5F53\u524D\u76EE\u5F55\u6CA1\u6709\u6587\u4EF6\u54E6",-1)),Wt=j({__name:"notfound",setup(s){const e="/luci-static/linkeasefile/icons/notfound.png";return(n,a)=>(d(),D("div",qt,[r("img",{src:e,alt:""}),Rt]))}});const Lt=te(Wt,[["__scopeId","data-v-412809e3"]]),jt=j({__name:"files",setup(s){return N(this,null,function*(){let e,n;const a=ae(),b=ee();re();const{roots:A,path:k}=b.query,$=B(()=>a.config),u=()=>N(this,null,function*(){a.checknoxEntries=[];let h=[];try{const f={path:`/local${k||"/"}`,order:Te.order.get(),orderBy:Te.orderBy.get()};a.config.filter&&a.config.filter!="default"&&(f.filter=a.config.filter);const o=yield W.File.Basic.List.POST(f);if(o.data){const{success:p,result:F,error:w}=o.data;p==0&&(h=F.entries||[]),w&&v.Warning(w)}}catch(f){v.Error(`${f}`),console.log(f)}finally{a.entries=be.FileBasicEntryArray(h),h=[]}});return[e,n]=dt(()=>u()),yield e,n(),(h,f)=>t(a).entries.length>0?(d(),D("div",{key:0,class:P(["files",t($).model?"list":"model"])},[(d(!0),D(H,null,X(t(a).entries,(o,p)=>(d(),x(zt,{file:o,index:p},null,8,["file","index"]))),256))],2)):(d(),x(Lt,{key:1,entries:t(a).entries},null,8,["entries"]))})}});const Kt=te(jt,[["__scopeId","data-v-0147104b"]]),Ue=s=>(de("data-v-894e5982"),s=s(),fe(),s),Gt={class:"f"},Ht={key:0,class:"setting"},Yt=Ue(()=>r("em",null,null,-1)),Zt=Ue(()=>r("em",null,null,-1)),Jt=j({__name:"checkbox",setup(s){const e=Z(!1),n=ae(),a=B(()=>(e.value=n.checknoxEntries.length>0,n.checknoxEntries||[])),b=()=>{if(n.entries.length==0){e.value=!1;return}if(n.checknoxEntries.length>0)n.checknoxEntries=[];else{const h=[];let f=n.entries.length;for(let o=0;o<f;o++)h.push(n.entries[o].rootPath);n.checknoxEntries=h}e.value=n.checknoxEntries.length>0},A=()=>{const h=n.checknoxEntries;if(h.length==0)return;const f=Z(!1);Y({title:"\u63D0\u793A",confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",type:"warning",showCancelButton:!0,message:()=>R("div",null,[R("p",null,`\u662F\u5426\u5220\u9664\u9009\u4E2D\u7684 ${h.length} \u4E2A\u6587\u4EF6/\u6587\u4EF6\u5939?`),R("label",{style:{display:"flex",alignItems:"center"}},[R("span",{style:{marginRight:"1rem"}},"\u4E0D\u7ECF\u8FC7\u56DE\u6536\u7AD9\u5F3A\u5236\u5220\u9664?"),R(ze,{modelValue:f.value,"onUpdate:modelValue":o=>{f.value=o==!0}})])])}).then(()=>N(this,null,function*(){const o=[];h.forEach(p=>{p!==void 0&&o.push("/local"+p)}),k(o,f.value)})).catch(()=>{})},k=(h,f)=>N(this,null,function*(){if(h.length==0)return;const o=Pe("\u5220\u9664\u4E2D");try{const p={paths:h};f&&(p.force=!0);const F=yield W.File.Basic.Remove.POST(p);if(F.data){const{success:w,error:C}=F.data;C&&v.Warning(C),w===0&&(v.Success("\u5220\u9664\u6210\u529F"),n.reload())}}catch(p){}finally{o.Close()}}),$=()=>{n.setCopy({type:"copy",values:n.checknoxEntries}),v.Success("\u5DF2\u590D\u5236"),n.checknoxEntries=[]},u=()=>{n.setCopy({type:"move",values:n.checknoxEntries}),v.Success("\u5DF2\u526A\u5207"),n.checknoxEntries=[]};return(h,f)=>(d(),D("div",Gt,[r("label",null,[Ve(r("input",{type:"checkbox",value:!1,"onUpdate:modelValue":f[0]||(f[0]=o=>e.value=o),onChange:b},null,544),[[Oe,e.value]]),r("span",null,z(t(a).length>0?`\u5DF2\u9009\u4E2D${t(a).length}\u4E2A\u6587\u4EF6/\u6587\u4EF6\u5939`:"\u5168\u9009"),1)]),t(a).length>0?(d(),D("div",Ht,[r("button",{onClick:f[1]||(f[1]=o=>A())},"\u5220\u9664"),Yt,r("button",{onClick:f[2]||(f[2]=o=>$())},"\u590D\u5236"),Zt,r("button",{onClick:f[3]||(f[3]=o=>u())},"\u526A\u5207")])):M("",!0)]))}});const Qt=te(Jt,[["__scopeId","data-v-894e5982"]]),Xt=j({__name:"nav",setup(s){const e=ee(),n=re(),a=B(()=>e.query),b=B(()=>a.value.path||""),A=B(()=>(b.value||"").split("/")||[]),k=B(()=>{var u;return A.value&&A.value.length>0?(u=A.value)==null?void 0:u.splice(1):[]}),$=u=>{const h=k.value.slice(0,u+1);n.push({query:le(K({},e.query),{path:"/"+h.join("/")})})};return(u,h)=>(d(),x(t(Me),{class:"page-nav-container"},{default:_(()=>[g(t(vt),{"separator-icon":t(ft),class:"nav-breadcrumb"},{default:_(()=>[(d(!0),D(H,null,X(t(k),(f,o)=>(d(),x(t(_t),{onClick:p=>$(o),class:"nav-breadcrumb_item"},{default:_(()=>[Ce(z(o==0?"\u6839\u76EE\u5F55":f),1)]),_:2},1032,["onClick"]))),256))]),_:1},8,["separator-icon"])]),_:1}))}}),Be=s=>(de("data-v-3875e80d"),s=s(),fe(),s),ea={class:"tools"},ta={class:"tool-item"},aa={class:"tool-item"},na={class:"tool-item"},oa=Be(()=>r("em",null,null,-1)),sa=Be(()=>r("em",null,null,-1)),ua={class:"tool-item"},la=Be(()=>r("em",null,null,-1)),ia={class:"tool-item"},ca=j({__name:"tools",setup(s){const{proxy:e}=De(),n=ae(),a=ht(n.config),b=[{name:"\u540D\u79F0",label:"filename"},{name:"\u65F6\u95F4",label:"date"},{name:"\u5927\u5C0F",label:"size"},{name:"\u7C7B\u578B",label:"filetype"}],A=[{name:"\u9012\u589E",label:"asc"},{name:"\u9012\u51CF",label:"desc"}],k=[{name:"\u5168\u90E8",label:"default"},{name:"\u56FE\u7247",label:"image"},{name:"\u538B\u7F29\u6587\u4EF6",label:"archive"},{name:"\u89C6\u9891",label:"video"},{name:"\u97F3\u4E50",label:"music"},{name:"\u6587\u6863",label:"doc"},{name:"\u5176\u5B83",label:"other"}],$=ee(),u=B(()=>$.query.path),h=()=>{n.setConfigModel()},f=m=>{switch(m){case"addFile":o();break;case"addDir":p();break}},o=()=>{Y.prompt("\u8BF7\u8F93\u5165\u65B0\u5EFA\u6587\u4EF6\u540D\u79F0\uFF0C\u8BF7\u6CE8\u610F\u6587\u4EF6\u540D\u79F0\u907F\u514D\u8986\u76D6\u540C\u540D\u6587\u4EF6","\u521B\u5EFA\u6587\u4EF6",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",inputValidator(m){return m==""?"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A":!0}}).then(E=>N(this,[E],function*({value:m}){const V=new File([],m);try{const O=yield W.File.Basic.Upload.POST({destination:"/local"+u.value,files:[V]});if(O.data){const{success:q,error:L}=O.data;L&&v.Warning(L),q===0&&(v.Success("\u65B0\u5EFA\u6210\u529F"),n.reload())}}catch(O){v.Error(`${O}`)}})).catch(()=>{})},p=()=>{Y.prompt("\u8BF7\u8F93\u5165\u65B0\u5EFA\u6587\u4EF6\u5939\u540D\u79F0\uFF0C\u8BF7\u6CE8\u610F\u6587\u4EF6\u540D\u79F0\u907F\u514D\u8986\u76D6\u540C\u540D\u6587\u4EF6","\u521B\u5EFA\u6587\u4EF6\u5939",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",inputValidator(m){return m==""?"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A":!0}}).then(E=>N(this,[E],function*({value:m}){try{const V=yield W.File.Basic.createFolder.POST({path:"/local"+u.value+"/"+m});if(V.data){const{success:O,error:q}=V.data;q&&v.Warning(q),O===0&&(v.Success("\u65B0\u5EFA\u6210\u529F"),n.reload())}}catch(V){v.Error(`${V}`)}})).catch(()=>{})},F=m=>{switch(m){case"date":case"size":case"filetype":case"filename":n.setConfigOrder(m);break;case"desc":case"asc":n.setConfigOrderBy(m);break}n.reload()},w=m=>{n.setConfigFilter(m),n.reload()},C=()=>{e==null||e.$uploadFile({destination:u.value}).then(()=>{n.reload()}).catch(()=>{})};return(m,E)=>{const V=G("icon-add-file"),O=G("icon-upload-file"),q=G("icon-sort-file"),L=G("icon-category"),i=G("icon-model-file"),T=G("icon-list-file");return d(),D("div",ea,[r("div",ta,[g(t(Fe),{onCommand:f},{dropdown:_(()=>[g(t(_e),null,{default:_(()=>[g(t(Q),{command:"addFile"},{default:_(()=>[Ce("\u65B0\u5EFA\u6587\u4EF6")]),_:1}),g(t(Q),{command:"addDir"},{default:_(()=>[Ce("\u65B0\u5EFA\u6587\u4EF6\u5939")]),_:1})]),_:1})]),default:_(()=>[r("button",null,[g(V)])]),_:1})]),r("div",aa,[r("button",{onClick:C},[g(O)])]),r("div",na,[g(t(Fe),{onCommand:F},{dropdown:_(()=>[g(t(_e),null,{default:_(()=>[(d(),D(H,null,X(b,I=>g(t(Q),{class:P(["sort-item",{on:I.label==a.order}]),command:I.label},{default:_(()=>[oa,r("span",null,z(I.name),1)]),_:2},1032,["class","command"])),64)),(d(),D(H,null,X(A,I=>g(t(Q),{class:P(["sort-item",{on:I.label==a.orderBy}]),command:I.label},{default:_(()=>[sa,r("span",null,z(I.name),1)]),_:2},1032,["class","command"])),64))]),_:1})]),default:_(()=>[r("button",null,[g(q)])]),_:1})]),r("div",ua,[g(t(Fe),{onCommand:w},{dropdown:_(()=>[g(t(_e),null,{default:_(()=>[(d(),D(H,null,X(k,I=>g(t(Q),{class:P(["sort-item",{on:I.label==a.filter}]),command:I.label},{default:_(()=>[la,r("span",null,z(I.name),1)]),_:2},1032,["class","command"])),64))]),_:1})]),default:_(()=>[r("button",null,[g(L)])]),_:1})]),r("div",ia,[r("button",{onClick:E[0]||(E[0]=I=>h())},[a.model?(d(),x(i,{key:0})):(d(),x(T,{key:1}))])])])}}});const ra=te(ca,[["__scopeId","data-v-3875e80d"]]),da=s=>(de("data-v-92a18536"),s=s(),fe(),s),fa={class:"page-tool-container"},ha=da(()=>r("div",{class:"auto"},null,-1)),pa=j({__name:"index",setup(s){const e=ae(),n=ee();re();const{proxy:a}=De(),b=B(()=>n.query.path||""),A=B(()=>{const o=b.value;return e.isCopy&&o!=""&&o!="/"}),k=B(()=>{const o=e.config;return[{name:"\u67E5\u770B",children:[{name:"\u5217\u8868",active:o.model,f:e.setConfigModel},{name:"\u7565\u7F29\u56FE",active:!o.model,f:e.setConfigModel}]},{name:"\u6392\u5E8F\u65B9\u5F0F",children:[{name:"\u540D\u79F0",active:o.order=="filename",f:()=>{e.setConfigOrder("filename"),e.reload()}},{name:"\u65F6\u95F4",active:o.order=="date",f:()=>{e.setConfigOrder("date"),e.reload()}},{name:"\u5927\u5C0F",active:o.order=="size",f:()=>{e.setConfigOrder("size"),e.reload()}},{name:"\u7C7B\u578B",active:o.order=="filetype",f:()=>{e.setConfigOrder("filetype"),e.reload()}},{name:"\u9012\u589E",active:o.orderBy=="asc",f:()=>{e.setConfigOrderBy("asc"),e.reload()}},{name:"\u9012\u51CF",active:o.orderBy=="desc",f:()=>{e.setConfigOrderBy("desc"),e.reload()}}]},{name:"\u6587\u4EF6\u8FC7\u6EE4",children:[{name:"\u5168\u90E8",active:o.filter=="default",f:()=>{e.setConfigFilter("default"),e.reload()}},{name:"\u56FE\u7247",active:o.filter=="image",f:()=>{e.setConfigFilter("image"),e.reload()}},{name:"\u538B\u7F29\u6587\u4EF6",active:o.filter=="archive",f:()=>{e.setConfigFilter("archive"),e.reload()}},{name:"\u89C6\u9891",active:o.filter=="video",f:()=>{e.setConfigFilter("video"),e.reload()}},{name:"\u97F3\u4E50",active:o.filter=="music",f:()=>{e.setConfigFilter("music"),e.reload()}},{name:"\u6587\u6863",active:o.filter=="doc",f:()=>{e.setConfigFilter("doc"),e.reload()}},{name:"\u5176\u5B83",active:o.filter=="other",f:()=>{e.setConfigFilter("other"),e.reload()}}]},{name:"\u5237\u65B0",f:()=>{e.reload()}},{name:"\u7C98\u8D34",disabled:!A.value,f:$},{name:"\u91CD\u65B0\u52A0\u8F7D",f:()=>{location.reload()}}]}),$=()=>{const o=e.copy,p=o.values,F=p.length;if(F==0)return;const w=b.value;if(p.indexOf(w)!=-1){pt.Warning("\u4E0D\u652F\u6301\u5D4C\u5957\u64CD\u4F5C");return}switch(o.type){case"copy":Y.confirm(`\u662F\u5426\u590D\u5236\u9009\u4E2D\u7684 ${F} \u4E2A\u6587\u4EF6/\u6587\u4EF6\u5939\u5230\u5F53\u524D\u76EE\u5F55?`,"\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{const C=[];for(let m=0;m<F;m++)C.push("/local"+p[m]);u(C,"/local"+w)}).catch(()=>{});break;case"move":Y.confirm(`\u662F\u5426\u79FB\u52A8\u9009\u4E2D\u7684 ${F} \u4E2A\u6587\u4EF6/\u6587\u4EF6\u5939\u5230\u5F53\u524D\u76EE\u5F55?`,"\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{const C=[];for(let m=0;m<F;m++)C.push("/local"+p[m]);h(C,"/local"+w)}).catch(()=>{});break}e.setCopy({type:"copy",values:[]})},u=(o,p)=>N(this,null,function*(){try{const F=yield W.File.Basic.Copy.POST({paths:o,destination:p});if(F.data){const{success:w,error:C}=F.data;w===0&&(v.Success("\u590D\u5236\u6210\u529F"),e.reload()),C&&v.Warning(C)}}catch(F){v.Error(`${F}`)}}),h=(o,p)=>N(this,null,function*(){try{const F=yield W.File.Basic.Move.POST({paths:o,destination:p});if(F.data){const{success:w,error:C}=F.data;w===0&&(v.Success("\u79FB\u52A8\u6210\u529F"),e.reload()),C&&v.Warning(C)}}catch(F){v.Error(`${F}`)}}),f=o=>{a==null||a.$uploadFile({files:o,destination:b.value}).then(()=>{e.reload()}).catch(()=>{})};return(o,p)=>(d(),x(Ft,{id:"page",onChange:f},{default:_(()=>[g(Ne,{class:"page-container",list:t(k)},{default:_(()=>[g(Xt),r("div",fa,[g(Qt),ha,g(ra)]),g(t(Me),{class:"page-body-container"},{default:_(()=>[(d(),x(Kt,{key:`${t(b)}`}))]),_:1})]),_:1},8,["list"])]),_:1}))}});const ga=te(pa,[["__scopeId","data-v-92a18536"]]);export{ga as default};
|