← Back
Editing: index-legacy87.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t)||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 n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(e,n,r){return(n=function(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,n||"default");if("object"!=t(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return n};var e,n={},r=Object.prototype,a=r.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(e){p=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var a=e&&e.prototype instanceof g?e:g,i=Object.create(a.prototype),u=new A(r||[]);return o(i,"_invoke",{value:C(t,n,u)}),i}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=f;var m="suspendedStart",h="suspendedYield",v="executing",y="completed",_={};function g(){}function b(){}function x(){}var w={};p(w,c,(function(){return this}));var k=Object.getPrototypeOf,O=k&&k(k(D([])));O&&O!==r&&a.call(O,c)&&(w=O);var j=x.prototype=g.prototype=Object.create(w);function L(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function E(e,n){function r(o,i,u,c){var l=d(e[o],e,i);if("throw"!==l.type){var s=l.arg,p=s.value;return p&&"object"==t(p)&&a.call(p,"__await")?n.resolve(p.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):n.resolve(p).then((function(t){s.value=t,u(s)}),(function(t){return r("throw",t,u,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(t,e){function a(){return new n((function(n,a){r(t,e,n,a)}))}return i=i?i.then(a,a):a()}})}function C(t,n,r){var a=m;return function(o,i){if(a===v)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:e,done:!0}}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var c=P(u,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===m)throw a=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=v;var l=d(t,n,r);if("normal"===l.type){if(a=r.done?y:h,l.arg===_)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(a=y,r.method="throw",r.arg=l.arg)}}}function P(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,_;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,_):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,_)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function D(n){if(n||""===n){var r=n[c];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,i=function t(){for(;++o<n.length;)if(a.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(t(n)+" is not iterable")}return b.prototype=x,o(j,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=p(x,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},n.awrap=function(t){return{__await:t}},L(E.prototype),p(E.prototype,l,(function(){return this})),n.AsyncIterator=E,n.async=function(t,e,r,a,o){void 0===o&&(o=Promise);var i=new E(f(t,e,r,a),o);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},L(j),p(j,s,"Generator"),p(j,c,(function(){return this})),p(j,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=D,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,a){return u.type="throw",u.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,_):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),_}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;S(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:D(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),_}},n}function u(t,e,n,r,a,o,i){try{var u=t[o](i),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,a)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(t){u(o,r,a,i,c,"next",t)}function c(t){u(o,r,a,i,c,"throw",t)}i(void 0)}))}}System.register(["./index-legacy103.js?v=VERSION_NUMBER","./utils-lib-legacy.js?v=VERSION_NUMBER","./we-com-legacy.js?v=VERSION_NUMBER","./version-compare.vue_vue_type_script_setup_true_lang-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy141.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang-legacy.js?v=VERSION_NUMBER","./index-legacy100.js?v=VERSION_NUMBER","./index-legacy398.js?v=VERSION_NUMBER","./form-item-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./index-legacy124.js?v=VERSION_NUMBER"],(function(t,n){"use strict";var r,o,u,l,s,p,f,d,m,h,v,y,_,g,b,x,w,k,O,j,L,E,C,P,T,S,A,D,q,B,V,N,Y,F,G,M,I,W,U,z,H,R,$,J,K,Q,X,Z,tt,et,nt,rt,at,ot,it,ut,ct,lt,st,pt,ft,dt;return{setters:[function(t){r=t._},function(t){o=t.u,u=t.fq,l=t.N,s=t.fr,p=t.w,f=t.fs,d=t.G,m=t.ft,h=t.ai,v=t.fu,y=t.fv,_=t.b,g=t.bU,b=t.$,x=t.bg,w=t.ag,k=t.fw,O=t.p,j=t.fx,L=t.a3,E=t.A,C=t.fy,P=t.fz,T=t.fA,S=t.n,A=t.fB,D=t.aM,q=t.cY,B=t.fk,V=t.fC,N=t.c},function(t){Y=t._},function(t){F=t._},function(t){G=t.s,M=t.j,I=t.r,W=t.k,U=t.g,z=t.c,H=t.bP,R=t.p,$=t.G,J=t.q,K=t.v,Q=t.e,X=t.A,Z=t.x,tt=t.M,et=t.C,nt=t.H,rt=t.y,at=t.z,ot=t.B,it=t.w},function(t){ut=t.u},function(t){ct=t.u},function(t){lt=t.e},null,function(t){st=t.B},function(t){pt=t.B},function(t){ft=t.b,dt=t.j},null,null,null],execute:function(){var n=M("VHOST-ACCOUNT-STORE",(function(){var t=o().payment,e=I(!1),n=W({number:0,limit:0}),r=I({accunt_id:0,username:"",password:"",email:"",expireType:0,package_id:0,mountpoint:"",expire_date:"",remark:""}),a=I({}),d=I(0),m=U((function(){switch(t.value.authType){case"pro":return n.limit=10,"当前为专业版,可创建子用户为 ".concat(n.number,"/").concat(n.limit);case"ltd":return n.limit=30,"当前为企业版,可创建子用户为 ".concat(n.number,"/").concat(n.limit)}})),h=I([]),v=I(!1),y=function(){var t=c(i().mark((function t(){var n,a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,v.value=!0,t.next=4,u();case 4:n=t.sent,a=n.data.list,l(a)&&(e.value?(o=a.find((function(t){return t.package_id===r.value.package_id})),O.value=o):(r.value.package_id=a[0].package_id,O.value=a[0]),h.value=a.map((function(t){return{label:t.package_name+(t.remark?"(".concat(t.remark,")"):""),value:t.package_id,data:t}}))),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0);case 12:return t.prev=12,v.value=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,9,12,15]])})));return function(){return t.apply(this,arguments)}}(),_=I([]),g=I(!1),b=function(){var t=c(i().mark((function t(){var n,a,o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,g.value=!0,t.next=4,s();case 4:n=t.sent,a=n.data,l(a)&&(e.value?(o=a.find((function(t){return t.mountpoint===r.value.mountpoint})),u=o.mountpoint,r.value.mountpoint=u):r.value.mountpoint=a[0].mountpoint,_.value=a.map((function(t){return{label:"".concat(t.mountpoint,"(").concat(p(t.used),"/").concat(p(t.total),") 配额:").concat(t.is_user_quota?"启用":"未启用"),value:t.mountpoint,data:t}}))),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0);case 12:return t.prev=12,g.value=!1,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,9,12,15]])})));return function(){return t.apply(this,arguments)}}(),x=I([]),w=I(!1),k=function(){var t=c(i().mark((function t(){var e,n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f();case 2:if(e=t.sent,n=e.data,!l(n)){t.next=7;break}return x.value=n.map((function(t){return{label:t.type_name,value:t.type_id}})),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),O=I({});return{isEdit:e,formData:r,editorForm:a,resetFormData:function(){r.value={username:"",password:"",email:"",expireType:0,package_id:0,mountpoint:"",expire_date:"",remark:""},e.value=!1},packageOptions:h,packageLoading:v,renderPackageOptions:y,accountTypeLoading:w,renderAccountTypeOptions:k,diskOptions:_,diskLoading:g,renderDiskOptions:b,selectPackageOptions:O,changePackageEvent:function(t){var e=h.value.find((function(e){return e.data.package_id===t}));O.value=e.data},refreshList:function(){d.value=(new Date).getTime()},refreshInfo:d,checkedAccountLimit:m,accountAuth:n}})),mt=function(){var t=n(),e=G(t);return a(a({},t),e)},ht={class:"p-[2rem]"},vt={class:"custom-table"},yt=["disabled"],_t=z({__name:"index",setup:function(t,e){var n,r=e.expose,o=mt(),u=o.isEdit,l=o.formData,s=o.packageOptions,f=o.packageLoading,k=o.renderPackageOptions,O=o.changePackageEvent,j=o.selectPackageOptions,L=o.diskOptions,E=o.diskLoading,C=o.renderDiskOptions,P=o.refreshList,T=o.resetFormData,S=_(),A=S.request,D=S.load,q=function(t){return t.getTime()<Date.now()-864e5},B=d({data:l.value,options:function(t){return U((function(){return[ft("用户名","username",{attrs:{class:"!w-[32rem]",clearable:!0,placeholder:"请输入用户名",disabled:u.value},rules:[{required:!0,message:"用户名不能为空!",trigger:"blur"},{min:3,max:20,message:"用户名长度在 3 到 20 个字符",trigger:"blur"}]}),dt("密码","password",{attrs:{class:"!w-[32rem]",placeholder:"请输入密码"},rules:u.value?[]:[{required:!0,clearable:!0,message:"密码不能为空!"},m({complex:{length:6}})]},(function(){return t.value.password=g(12)})),{type:"slots",key:"expire_time"},{type:"slots",key:"package_id"},!u.value&&{type:"slots",key:"mountpoint"},ft("备注","remark",{attrs:{class:"!w-[32rem]",clearable:!0,placeholder:"请输入备注内容,可为空"}})]}))},submit:(n=c(i().mark((function t(e,n,r){var o,c,l,s,p,f,d,m,_,g,b;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:return 0===(o=a(a({},e.value),{},{email:"vhost@bt.cn"})).expireType?o.expire_date="0000-00-00":o.expire_date=h(o.expire_date)?o.expire_date:H(o.expire_date,"YYYY-MM-DD"),delete o.expireType,c=j.value,l=c.max_site_limit,s=c.disk_space_quota,p=c.monthly_bandwidth_limit,f=c.max_email_account,d=c.max_database,m=c.php_start_children,_=c.php_max_children,o=a(a({},o),{},{disk_space_quota:s,monthly_bandwidth_limit:p,max_site_limit:l,max_email_account:f,max_database:d,php_start_children:m,php_max_children:_}),u.value?delete o.mountpoint:delete o.account_id,g=null,b=D("正在提交表单信息,请稍候..."),t.prev=10,t.next=13,u.value?v(o):y(o);case 13:if(g=t.sent,A(g),g.status){t.next=17;break}return t.abrupt("return",!1);case 17:T(),P(),t.next=24;break;case 21:t.prev=21,t.t0=t.catch(10);case 24:return t.prev=24,b.close(),t.finish(24);case 27:return t.abrupt("return",g);case 28:case"end":return t.stop()}}),t,null,[[10,21,24,27]])}))),function(t,e,r){return n.apply(this,arguments)})}),V=B.BtForm,N=B.submit;return R((function(){k(),C()})),r({onConfirm:N,onCancel:T}),function(t,e){var n=b,r=pt,a=x,o=w,i=st,c=$("bt-loading");return J(),K("div",ht,[Q(Z(V),null,{expire_time:X((function(){return[Q(a,{prop:"expire_date",label:"到期时间"},{default:X((function(){return[Q(n,{modelValue:Z(l).expireType,"onUpdate:modelValue":e[0]||(e[0]=function(t){return Z(l).expireType=t}),options:[{label:"永久",value:0},{label:"自定义",value:1}]},null,8,["modelValue"]),Z(l).expireType?(J(),tt(r,{key:0,"disabled-date":q,class:"!w-[15rem] ml-[3.5rem]",modelValue:Z(l).expire_date,"onUpdate:modelValue":e[1]||(e[1]=function(t){return Z(l).expire_date=t}),type:"date","date-format":"YYYY-MM-DD",placeholder:"选择到期日期"},null,8,["modelValue"])):et("",!0)]})),_:1})]})),package_id:X((function(){return[Q(a,{prop:"expire_date",label:"资源包"},{default:X((function(){return[nt((J(),K("div",null,[Q(o,{modelValue:Z(l).package_id,"onUpdate:modelValue":e[2]||(e[2]=function(t){return Z(l).package_id=t}),options:Z(s),placeholder:"请选择资源包",onChange:Z(O),clearable:"",class:"!w-[28rem]"},null,8,["modelValue","options","onChange"]),Q(i,{trigger:"hover",placement:"right","popper-style":"padding:0",width:"240px"},{reference:X((function(){return e[4]||(e[4]=[rt("span",{class:"bt-link text-[12px] ml-[15px]"},"详情",-1)])})),default:X((function(){return[rt("table",vt,[rt("tbody",null,[rt("tr",null,[e[5]||(e[5]=rt("td",null,"资源名称",-1)),rt("td",null,at(Z(j).package_name),1)]),rt("tr",null,[e[6]||(e[6]=rt("td",null,"备注",-1)),rt("td",null,at(Z(j).remark),1)]),rt("tr",null,[e[7]||(e[7]=rt("td",null,"磁盘配额(MB)",-1)),rt("td",null,at(Z(j).disk_space_quota?Z(p)(Z(j).disk_space_quota,!0,0):"无限制"),1)]),rt("tr",null,[e[8]||(e[8]=rt("td",null,"每月带宽限制(MB)",-1)),rt("td",null,at(Z(j).monthly_bandwidth_limit?Z(p)(Z(j).monthly_bandwidth_limit,!0,0):"无限制"),1)]),rt("tr",null,[e[9]||(e[9]=rt("td",null,"最大网站数",-1)),rt("td",null,at(Z(j).max_site_limit?Z(j).max_site_limit:"无限制"),1)]),rt("tr",null,[e[10]||(e[10]=rt("td",null,"数据库数量",-1)),rt("td",null,at(Z(j).max_database?Z(j).max_database:"无限制"),1)]),rt("tr",null,[e[11]||(e[11]=rt("td",null,"启动子进程数量",-1)),rt("td",null,at(Z(j).php_start_children),1)]),rt("tr",null,[e[12]||(e[12]=rt("td",null,"最大子进程数量",-1)),rt("td",null,at(Z(j).php_max_children),1)])])])]})),_:1})])),[[c,Z(f)],[c,"small","size"],[c,"horizontal","type"],[c,"获取列表中","title"]])]})),_:1})]})),mountpoint:X((function(){return[Q(a,{prop:"expire_date",label:"存储磁盘"},{default:X((function(){return[nt((J(),K("div",{disabled:Z(u)},[Q(o,{modelValue:Z(l).mountpoint,"onUpdate:modelValue":e[3]||(e[3]=function(t){return Z(l).mountpoint=t}),options:Z(L),placeholder:"请选择存储磁盘",clearable:"",class:"!w-[28rem]"},null,8,["modelValue","options"])],8,yt)),[[c,Z(E)],[c,"small","size"],[c,"horizontal","type"],[c,"获取列表中","title"]])]})),_:1})]})),_:1})])}}}),gt=_().request,bt=mt(),xt=bt.refreshList,wt=bt.accountAuth,kt=bt.isEdit,Ot=bt.formData,jt=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(L(t))kt.value=!0,Ot.value={account_id:t.account_id,username:t.username,password:"",email:t.email,package_id:t.package_id,expireType:"0000-00-00"!==t.expire_date?1:0,expire_date:"0000-00-00"!==t.expire_date?t.expire_date:"",mountpoint:t.mountpoint,remark:t.remark};else if(wt.value.number>=wt.value.limit)return void gt({type:"warning",content:"当前用户数量已达上限,如需更多用户管理,请联系客服。"});S({title:"".concat(t?"编辑":"添加","用户"),area:"500px",component:_t,showFooter:!0})},Lt=function(){var t=c(i().mark((function t(e){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k(e);case 2:if(!(n=t.sent).data.list){t.next=8;break}return wt.value.number=n.data.page.count,t.abrupt("return",{data:n.data.list,total:n.data.page.count});case 8:return t.abrupt("return",{data:[],total:0});case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Et=function(){var t=c(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:O({title:"".concat(1===e.status?"停用":"启用","用户").concat(e.username),content:"是否".concat(1===e.status?"停用":"启用","该用户").concat(e.username,",是否继续?"),onConfirm:function(){var t=c(i().mark((function t(){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v({account_id:e.account_id,status:1===e.status?0:1});case 2:n=t.sent,gt(n),xt();case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ct=function(t){var e;O({title:"删除用户".concat(t.username),content:"是否删除该用户".concat(t.username,",是否继续?"),onConfirm:(e=c(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A({account_id:t.account_id,is_del_resources:!0});case 2:n=e.sent,gt(n),xt();case 5:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},Pt=function(){var t=c(i().mark((function t(e){var n,r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,j({account_id:e.account_id});case 2:n=t.sent,r=n.data,L(r)&&window.open(r.login_url+"?token="+r.token,"_blank","noopener,noreferrer");case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Tt=function(){var t=c(i().mark((function t(){var n,r,a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=[],t.next=4,f();case 4:return r=t.sent,a=r.data,l(a)&&(n=[{label:"全部分类",value:"all"}].concat(e(a.map((function(t){return{label:t.name,value:Number(t.type_id)}}))))),t.abrupt("return",n||[]);case 10:return t.prev=10,t.t0=t.catch(0),t.abrupt("return",[]);case 14:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),St={class:"ml-[10px] flex items-center h-[30px] font-bold text-[#666]"};t("default",z({__name:"index",setup:function(t){var e=o().mainHeight,n=mt(),a=n.refreshInfo,i=n.checkedAccountLimit,u=D({options:[{type:"button",label:"添加用户",active:!0,onClick:function(){return jt()}}]}).BtOperation,c=q({request:function(t){var e={rows:t.limit,search_value:t.search,p:t.p,type_id:t.type_id};return Lt(e)},columns:[{label:"用户名",prop:"username",minWidth:100,render:function(t){return Q("span",{class:"text-primary cursor-pointer",onClick:function(){return Pt(t)}},[t.username])}},{label:"资源包",prop:"package_name",isCustom:!0,minWidth:100},{label:"磁盘配额",prop:"quota",minWidth:100,isCustom:!0,render:function(t){return Q("span",{class:0===t.disk_space_status?"text-error":""},[0===t.disk_space_used&&0===t.disk_space_quota?"-":p(t.disk_space_used,!0,0),ot(" / "),0===t.disk_space_quota?"无限制":p(t.disk_space_quota,!0,0)])}},{label:"带宽",prop:"name",minWidth:100,isCustom:!0,render:function(t){return Q("span",{class:0===t.monthly_bandwidth_status?"text-error":""},[p(t.monthly_bandwidth_used,!0,0),ot(" / "),0===t.monthly_bandwidth_limit?"无限制":p(t.monthly_bandwidth_limit,!0,0)])}},{label:"状态",prop:"status",minWidth:60,isCustom:!0,render:function(t){var e=new Map([[-1,"所有"],[0,"停用"],[1,"正常"],[2,"过期"]]);return Q("span",{onClick:function(){return Et(t)},class:"cursor-pointer ".concat(1===t.status||-1===t.status?"text-primary":"text-danger")},[e.get(t.status)])}},{label:"过期时间",prop:"expire_date",minWidth:80,isCustom:!0,render:function(t){return"0000-00-00"===t.expire_date?"永久":t.expire_date}},{label:"备注",prop:"remark",minWidth:200,isCustom:!0,render:function(t){return t.remark?t.remark:"--"}},{label:"登录信息",prop:"info",minWidth:65,isCustom:!0,render:function(t){return Q("span",{class:"text-primary cursor-pointer",onClick:function(){return function(t){var e=t.login_url,n=t.username,r=t.init_password;E({value:"账号: ".concat(e,"\n用户: ").concat(n,"\n初始密码: ").concat(r)})}(t)}},[ot("复制")])}},ut([{onClick:Pt,title:"登录虚拟主机",width:100},{onClick:function(t){return jt(t)},title:"编辑"},{onClick:Ct,title:"删除"}])],extension:[B(),V(),ct({key:"type_id",name:"",options:function(){return[{label:"全部分类",value:"all"}]},event:{get:Tt,add:C,update:P,delete:T}})]}),l=c.BtTable,s=c.BtSearch,f=c.BtRefresh,d=c.BtPage,m=c.BtColumn,h=(c.BtTableCategory,c.refresh);return it((function(){return a.value}),h),function(t,n){var a=N,o=r;return J(),K("div",null,[Q(F),Q(o,null,{"header-left":X((function(){return[Q(Z(u)),rt("div",St,[ot(at(Z(i))+",更多信息 ",1),Q(a,{href:"https://www.bt.cn/new/wechat_customer",class:"mx-[10px]"},{default:X((function(){return n[1]||(n[1]=[rt("img",{src:Y,class:"w-[14px] h-[14px]"},null,-1),ot("联系客服")])})),_:1})]),rt("div",{class:"flex items-center mr-[10px]",onClick:n[0]||(n[0]=function(t){return Z(lt)({name:"用户管理",type:35,id:62})})},n[2]||(n[2]=[rt("i",{class:"svgtofont-desired text-[1.6rem] mr-[4px]"},null,-1),rt("span",{class:"bt-link"},"需求反馈",-1)])),Q(a,{href:"https://www.bt.cn/bbs/thread-141273-1-1.html",class:"mr-[10px]"},{default:X((function(){return n[3]||(n[3]=[ot(">> 使用文档")])})),_:1})]})),"header-right":X((function(){return[Q(Z(s),{placeholder:"请输入用户名称",class:"!w-[270px] mr-[10px]"}),Q(Z(f),{class:"mr-[10px]"}),Q(Z(m))]})),content:X((function(){return[Q(Z(l),{"min-height":Z(e)},null,8,["min-height"])]})),"footer-right":X((function(){return[Q(Z(d))]})),_:1})])}}}))}}}))}();
Save File
Cancel