← Back
Editing: index-legacy162.js
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function n(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return r};var t,r={},a=Object.prototype,o=a.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var a=t&&t.prototype instanceof b?t:b,o=Object.create(a.prototype),l=new A(n||[]);return i(o,"_invoke",{value:C(e,r,l)}),o}function v(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var h="suspendedStart",d="suspendedYield",m="executing",y="completed",g={};function b(){}function w(){}function x(){}var k={};f(k,u,(function(){return this}));var _=Object.getPrototypeOf,L=_&&_(_(D([])));L&&L!==a&&o.call(L,u)&&(k=L);var E=x.prototype=b.prototype=Object.create(k);function S(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(t,r){function n(a,i,l,u){var c=v(t[a],t,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==e(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,l,u)}),(function(e){n("throw",e,l,u)})):r.resolve(f).then((function(e){s.value=e,l(s)}),(function(e){return n("throw",e,l,u)}))}u(c.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,a){n(e,t,r,a)}))}return a=a?a.then(o,o):o()}})}function C(e,r,n){var a=h;return function(o,i){if(a===m)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var l=n.delegate;if(l){var u=O(l,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var c=v(e,r,n);if("normal"===c.type){if(a=n.done?y:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=y,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=v(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function D(r){if(r||""===r){var n=r[u];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var a=-1,i=function e(){for(;++a<r.length;)if(o.call(r,a))return e.value=r[a],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(e(r)+" is not iterable")}return w.prototype=x,i(E,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,f(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},r.awrap=function(e){return{__await:e}},S(j.prototype),f(j.prototype,c,(function(){return this})),r.AsyncIterator=j,r.async=function(e,t,n,a,o){void 0===o&&(o=Promise);var i=new j(p(e,t,n,a),o);return r.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},S(E),f(E,s,"Generator"),f(E,u,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=D,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,a){return l.type="throw",l.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},r}function a(e,t,r,n,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,a)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function l(e){a(i,n,o,l,u,"next",e)}function u(e){a(i,n,o,l,u,"throw",e)}l(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER"],(function(e,r){"use strict";var a,i,l,u,c,s,f,p,v,h,d,m,y,g,b,w,x,k,_,L,E,S,j,C,O,I,P,A,D,F,T,G,N,R,V;return{setters:[function(e){a=e.g5,i=e.b,l=e.e,u=e.u,c=e.g6,s=e.R,f=e.g7,p=e._,v=e.k,h=e.J,d=e.l,m=e.H},function(e){y=e.c,g=e.r,b=e.G,w=e.q,x=e.v,k=e.y,_=e.H,L=e.e,E=e.x,S=e.P,j=e.O,C=e.A,O=e.B,I=e.J,P=e.S,A=e.D,D=e.U,F=e.g,T=e.a0,G=e.z,N=e.F,R=e.a_,V=e.C},null],execute:function(){var r={class:"create-file-view flex"},H={class:"flex-1 flex items-center"},U=y({__name:"create-file",props:{type:{default:"Dir"},path:{},filelist:{}},emits:["createStatus"],setup:function(e,t){var l=t.emit,u=i().error,c=l,s=e,f=g(""),p=g(),v=function(){var e=o(n().mark((function e(){var t,r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=p.value,f.value){e.next=4;break}return u("".concat("Dir"===s.type?"文件夹":"文件","名称不能为空")),e.abrupt("return");case 4:return e.next=6,a({type:s.type,path:s.path+"/"+f.value});case 6:(r=e.sent).status?h():(u(r.msg),t.$el.querySelector("input").focus());case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),h=function(){s.filelist.value.shift(),c("createStatus")},d=function(e){f.value=e,/(\\|\/|\<|\>|\"|\&|\;)/g.test(e)&&(u('名称不能含有 /\\<>"&;符号'),f.value=e.replace(/(\\|\/|\<|\>|\"|\&|\;)/g,""))};return function(e,t){var n=P,a=A,o=b("focus");return w(),x("div",r,[k("div",{class:I(["flex","".concat("Dir"===e.type?"bt-open-dir folder-open-icon":"bt-open-dir file-text-icon")])},[t[4]||(t[4]=k("i",{class:"icon"},null,-1)),k("div",H,[_(L(n,{class:"!w-[22rem] mr-[1.6rem]",clearable:"",modelValue:E(f),"onUpdate:modelValue":t[0]||(t[0]=function(e){return S(f)?f.value=e:f=e}),ref_key:"createfile",ref:p,onInput:d,onKeyup:t[1]||(t[1]=j((function(e){return e.target.blur()}),["enter","native"]))},null,8,["modelValue"]),[[o]]),L(a,{type:"primary",class:"!mr-[.8rem]",onClick:v},{default:C((function(){return t[2]||(t[2]=[O(" 创建 ")])})),_:1}),L(a,{type:"default",onClick:h},{default:C((function(){return t[3]||(t[3]=[O("取消")])})),_:1})])],2)])}}}),B=l(U,[["__scopeId","data-v-c17175a3"]]),q={class:"text-black text-1.4rem pl-[1.6rem] pt-[1.6rem]"},z={class:"p-[1.6rem] flex justify-between"},K={class:"file-selector-head"},M=["onClick"],$={class:"truncate max-w-[8rem]"},J={class:"ml-[0.4rem] flex items-align"},Y={class:"ml-[1.6rem] mb-[1.6rem]"},Q={class:"flex h-[48rem] file-selector-main"},W={class:"w-[16rem] h-full pt-[1.2rem] text-xl inline-block overflow-auto disk-list"},X={class:"flex items-center flex-col"},Z=["onClick"],ee=["title"],te={class:"h-full w-full inline-block flex w-[59rem]"},re={class:"flex justify-between bg-[#f6f8f8] p-[1.2rem] pr-[1.6rem] rounded-md"},ne={class:"ml-[9.6rem]"},ae={key:0,class:"flex align-middle items-center"},oe={class:"bg-white rounded-[.8rem] px-4 h-12 leading-[2.8rem] w-[30rem] inline-block border-light border-1 border-opacity-20 truncate"},ie={class:"flex"},le=y({__name:"index",props:{compData:{default:function(){return{type:"all",path:"/www/wwwroot",change:function(){},confirmText:"确认"}}}},emits:["close"],setup:function(e,r){var a=r.expose,l=r.emit,y=e.compData,I=y.type,P=y.path,H=y.change,U=i(),le=U.error,ue=U.request,ce=u().panel,se=g(),fe=g(),pe=g(0),ve=g(0),he=g(""),de=g(),me=g(I),ye=g(!1),ge=g(!0),be=g(!1),we=g(P||ce.value.sitePath),xe=g(P||ce.value.sitePath),ke=D([]),_e=D([]),Le=g([]),Ee=g(""),Se=g(),je=g(),Ce=F((function(){return"file"===me.value?"文件":"dir"===me.value?"文件夹":"文件/文件夹"}));T(fe,(function(e){var t=e[0].contentRect.width;pe.value=t})),T(se,(function(e){var t=e[0].contentRect.width;ve.value=t,ve.value>pe.value&&(_e.value=ke.value.slice(-4))}));var Oe=g([{label:"名称",prop:"name",showOverflowTooltip:!1,render:function(e){return e.create&&Ge?L(B,{type:e.type,path:we.value,filelist:je,onCreateStatus:function(){Re()}},null):L("span",{class:"bt-open-dir"},[L("i",{class:"svgtofont"+("dir"===e.type?"-icon-file_mode":"-file-text")},null),L("span",{onClick:function(t){"dir"===e.type&&qe(e,t)}},[e.name])])}},{label:"修改时间",width:160,prop:"mtime"},{label:"权限/所有者",width:125,prop:"accept"}]),Ie=function(e){var t=e.row,r=(e.column,e.rowIndex);e.columnIndex;if(0===r&&t.create&&Ge)return[1,3]},Pe=function(){1!==ke.value.length&&(we.value=ke.value[ke.value.length-2].path,Ve())},Ae=function(){ge.value=!1,xe.value=we.value},De=function(){ge.value=!0,setTimeout((function(){xe.value=we.value}),1500)},Fe=function(e){we.value=xe.value,Ve(),e.preventDefault(),e.target.blur()},Te=function(e){e||(e=""),Ee.value=e,Ve(!0)},Ge=g(!1),Ne=function(e){var t;if(Ge.value)return!1;Ge.value=!0,null===(t=je.value)||void 0===t||t.unshift({title:"",name:"",mtime:"",accept:"",type:e,path:"",create:!0})},Re=function(){Ge.value=!1,Ve()},Ve=function(){var e=o(n().mark((function e(r){var a,o,i,l,u,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ye.value=!0,e.prev=1,e.next=4,c({path:we.value,disk:!0,search:r?Ee.value:""});case 4:if(a=e.sent,Se.value&&(Se.value.path=we.value,Se.value.title=we.value.split("/")[we.value.split("/").length-1]),a.status){e.next=10;break}return Se.value=void 0,ue(a),e.abrupt("return",!1);case 10:o=a.data,i=o.DIR,l=o.FILES,u=o.DISK,s=o.PATH,He(s),Le.value=u,je.value=[].concat(t(Ue(i,"dir")),t(Ue(l))),ze(),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(1);case 20:return e.prev=20,ye.value=!1,e.finish(20);case 23:case"end":return e.stop()}}),e,null,[[1,17,20,23]])})));return function(t){return e.apply(this,arguments)}}(),He=function(e){var t="",r=e.replace(/\/*$/,"");if(we.value=r,xe.value=r,ke.value=[],""===r)return ke.value.push({title:"根目录",path:"/"}),void(_e.value=ke.value);r.split("/").forEach((function(e,r){t+="".concat(1===r?"":"/").concat(e),ke.value.push({title:""===e&&0==r?"根目录":e,path:t})})),_e.value=ke.value},Ue=function(e,t){var r=[];return e.forEach((function(e){var n=e.split(";"),a=n[0];a.length>30&&(a=a.slice(0,30)+"..."),/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(a)&&(a=a.slice(0,16)+"..."),r.push({title:n[0],name:a,mtime:s(1e3*Number(n[2]),"yyyy/MM/dd HH:mm:ss"),accept:"".concat(n[3]," / ").concat(n[4]),type:t||"file",path:we.value+"/"+n[0]})})),r},Be=function(e){if(e&&!e.create){if("all"==me.value)Se.value=e;else{if("dir"!==e.type&&"dir"===me.value)return void le("请选择文件夹,否则将无法选择");if("file"!==e.type&&"file"===me.value)return;if(me.value!==e.type)return Se.value=void 0,void f(de.value).setCurrentRow();null!==e&&(Se.value=e)}be.value=!0}},qe=function(e,t){"dir"!==e.type||e.create||("file"===me.value&&(be.value=!1),we.value=e.path,Ve(),t.stopPropagation&&t.stopPropagation())},ze=function(){"file"==de.value.type&&(Se.value=void 0,be.value=!1),Ge.value=!1},Ke=function(){var e=o(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ve();case 2:"file"!==me.value&&(Se.value=ke.value[ke.value.length-1],be.value=!0);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return a({onOpen:function(){return Ke()}}),function(e,t){var r,n=p,a=v,o=h,i=A,u=d,c=m,s=b("bt-loading");return w(),x("section",null,[k("div",q,"选择"+G(E(Ce)),1),k("div",z,[k("div",K,[k("i",{title:"返回上一层",class:"bt-open-icon inline-block !rounded-tl-[.8rem] !rounded-bl-[.8rem]",onClick:Pe},[L(n,{icon:"el-back",class:"leading-[2rem]"})]),k("div",{ref_key:"pathInputRef",ref:fe,class:"file-selector-input overflow-hidden"},[E(ge)?(w(),x("ul",{key:0,ref_key:"pathRef",ref:se,class:"absolute h-[30px] z-1 flex rounded-none bg-white"},[(w(!0),x(N,null,R(E(_e),(function(e,t){return w(),x("li",{key:t,class:"flex items-center px-[1rem] h-[30px]",onClick:function(t){return r=e.path,void(we.value!==r&&(we.value=r,xe.value=r,Ve()));var r}},[k("span",$,G(e.title),1),k("i",J,[L(n,{icon:"el-arrow-right"})])],8,M)})),128))],512)):V("",!0),L(a,{class:"!w-[400px]",onFocus:Ae,onBlur:De,onKeyup:j(Fe,["enter"]),modelValue:E(xe),"onUpdate:modelValue":t[0]||(t[0]=function(e){return S(xe)?xe.value=e:null})},null,8,["modelValue"])],512),k("i",{title:"刷新",class:"bt-open-icon inline-block !rounded-tr-[.8rem] !rounded-br-[.8rem]",onClick:t[1]||(t[1]=function(e){return Ve()})},[L(n,{icon:"el-refresh-right",class:"leading-[2rem]"})])]),L(o,{modelValue:E(Ee),"onUpdate:modelValue":t[2]||(t[2]=function(e){return S(Ee)?Ee.value=e:null}),placeholder:"搜索文件/目录",class:"!w-[220px]",onSearch:Te},null,8,["modelValue"])]),k("div",Y,[L(i,{type:"default",onClick:t[3]||(t[3]=function(e){return Ne("File")})},{default:C((function(){return t[7]||(t[7]=[O("新建文件")])})),_:1}),L(i,{type:"default",onClick:t[4]||(t[4]=function(e){return Ne("Dir")})},{default:C((function(){return t[8]||(t[8]=[O("新建文件夹")])})),_:1})]),k("div",Q,[k("div",W,[k("ul",X,[(w(!0),x(N,null,R(E(Le),(function(e,r){return w(),x("li",{class:"flex p-[0.8rem] pl-[1.6rem] items-center w-full",key:r,onClick:function(t){return r=e.path,we.value=r,void Ve();var r}},[t[9]||(t[9]=k("i",{class:"file-disk-icon mr-[0.8rem] text-[14px]"},null,-1)),k("span",{class:"w-full truncate",title:"/"===e.path?"根目录":e.path},G("/"===e.path?"根目录":e.path)+" ("+G(e.size[2])+") ",9,ee)],8,Z)})),128))])]),k("div",te,[_(L(u,{ref_key:"tableRef",ref:de,class:"file-selector-table",column:E(Oe),data:E(je),"span-method":Ie,"highlight-current-row":"",border:!1,onCurrentChange:Be,onRowDblclick:qe,"empty-text":"(空)","max-height":"480"},null,8,["column","data"]),[[s,E(ye)],[s,"正在加载文件列表,请稍后...","title"]])])]),k("div",re,[k("div",ne,[E(be)?(w(),x("div",ae,[k("span",null,"当前选中"+G(E(Ce))+":",1),k("span",oe,G(null===(r=E(Se))||void 0===r?void 0:r.title),1)])):V("",!0)]),k("span",ie,[L(c,{type:"default",class:"BtButton--cancel",onClick:t[5]||(t[5]=function(e){return l("close")})},{default:C((function(){return t[10]||(t[10]=[O(" 取消 ")])})),_:1}),L(c,{type:"primary",disabled:!E(be),onClick:t[6]||(t[6]=function(e){return H&&H(Se.value.path,Se.value.type),he.value=Se.value.path,void l("close")})},{default:C((function(){return[O(G(e.compData.confirmText||"确认"),1)]})),_:1},8,["disabled"])])])])}}});e("default",l(le,[["__scopeId","data-v-e7eca6d4"]]))}}}))}();
Save File
Cancel