Files
aaPanel/BTPanel/static/vite/js/app-modal-ui-legacy.js
T
2026-07-24 16:25:43 +08:00

2 lines
9.0 KiB
JavaScript

(function(){System.register([`./rolldown-runtime-legacy.js?v=1784873523001`,`./vendor-utils-legacy.js?v=1784873523001`,`./vendor-vue-legacy.js?v=1784873523001`,`./vendor-naive-legacy.js?v=1784873523001`,`./app-legacy.js?v=1784873523001`],function(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z;function B(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function V(e){if(Array.isArray(e))return B(e)}function H(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function U(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){H(a,r,i,o,s,`next`,e)}function s(e){H(a,r,i,o,s,`throw`,e)}o(void 0)})}}function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function K(){throw TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){W(e,t,n[t])})}return e}function J(e){return V(e)||G(e)||X(e)||K()}function Y(e,t){var n,r,i,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype),s=Object.defineProperty;return s(o,`next`,{value:c(0)}),s(o,`throw`,{value:c(1)}),s(o,`return`,{value:c(2)}),typeof Symbol==`function`&&s(o,Symbol.iterator,{value:function(){return this}}),o;function c(e){return function(t){return l([e,t])}}function l(s){if(n)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=s[0]&2?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if((i=a.trys,!(i=i.length>0&&i[i.length-1]))&&(s[0]===6||s[0]===2)){a=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(s[0]===6&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function X(e,t){if(e){if(typeof e==`string`)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(n);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B(e,t)}}return e({a:void 0,i:void 0,n:void 0,r:void 0,t:void 0}),{setters:[function(e){c=e.r},function(e){r=e.mn,_=e.yn,y=e.bn,b=e.Cn,x=e.En,S=e.Dn,C=e.kn,w=e.Ft,e.dr,e.Nn,e.Pr,E=e.nn,O=e.Rn,k=e.Wn,A=e.qn,N=e.yr,I=e.Zr,L=e.Er},function(e){i=e.s,R=e.l},function(e){n=e.G,a=e.k,o=e.xt,s=e.w,P=e.tn},function(e){h=e.Ff,D=e.Pf,z=e.jf}],execute:function(){E(),u={class:`w-400px p-20px`},f={class:`mb-12px text-14px`},M=C({__name:`progress`,props:{data:{}},emits:[`close`],setup:function(e,t){var n=t.emit,r=e.data,i=r.title,a=r.data,o=r.api,c=r.callback,l=n,d=N(0),p=N(0),m=_(function(){return a.length});return function(){return U(function(){var e,t,n;return Y(this,function(r){switch(r.label){case 0:e=0,r.label=1;case 1:if(!(e<a.length))return[3,7];r.label=2;case 2:return r.trys.push([2,5,,6]),o?[4,o(a[e])]:[3,4];case 3:t=r.sent(),a[e].batchStatus=`success`,a[e].reqMsg=w(t,`message.result`,`Success`),p.value+=1,p.value===m.value?d.value=100:d.value=Math.round(p.value/m.value*100),r.label=4;case 4:return[3,6];case 5:return n=r.sent(),a[e].batchStatus=`error`,a[e].reqMsg=w(n,`message.result`,``),[3,6];case 6:return e++,[3,1];case 7:return c==null||c(a),l(`close`),[2]}})})()}(),function(e,t){var n=s;return A(),b(`div`,u,[y(`div`,f,[y(`span`,null,I(e.$t(`Component.Batch.index_3`,L(i))),1),y(`span`,null,I(L(p))+`/`+I(L(m)),1)]),S(n,{type:`line`,status:`success`,percentage:L(d),height:24,"border-radius":4,"fill-border-radius":0,processing:!0,"show-indicator":!1,"indicator-placement":`inside`},null,8,[`percentage`])])}}}),e(`a`,j=M),E(),l={class:`p-24px`},d={class:`flex items-center mb-24px`},p={class:`flex-1 ml-12px text-14px leading-22px`},m={class:`flex-1 ml-12px text-14px leading-22px`},T=C({__name:`index`,props:{data:{}},emits:[`setConfirm`],setup:function(e,t){var i=t.expose,a=t.emit,o=e,s=o.data,c=s.title,u=s.desc,f=s.data,g=s.columns,_=s.api,v=s.done,x=s.onCustomApi,C=a,w=R().t,T=N([]),E=N(J(g).concat([{key:`batchStatus`,title:w(`Public.Table.Result`),align:`right`,width:200,render:function(e){return e.batchStatus===`success`?S(`span`,{class:`text-primary`},[e.reqMsg]):e.batchStatus===`error`?S(`span`,{class:`text-error`},[e.reqMsg]):S(`span`,{class:`text-warning`},[w(`Public.Status.Wait`)])}}])),D=function(){T.value=f.map(function(e){return q({batchStatus:`wait`},e)}),o.data.status===`done`&&M(f)},O=N(!1),k=N(``),M=function(e){var t=e.filter(function(e){return e.batchStatus===`success`}).length,n=e.length-t;k.value=w(`Component.Confirm.index_3`,[c,e.length,t,n]),O.value=!0,C(`setConfirm`,{text:`Done`,disabled:!1}),v==null||v(e)},P=function(e){if(C(`setConfirm`,{disabled:!0}),x){x(T.value),e();return}z({title:c,hideClose:!0,data:{title:c,api:_,data:T.value,callback:M},component:j})};return D(),i({onConfirm:function(e){var t=e.hide;return O.value?t():P(t),!1}}),function(e,t){var i=h,a=n;return A(),b(`div`,l,[y(`div`,d,[L(O)?(A(),b(r,{key:1},[S(i,{name:`base-success`,size:`40`,class:`text-primary`}),y(`div`,m,I(L(k)),1)],64)):(A(),b(r,{key:0},[S(i,{name:`base-warning`,size:`40`,class:`text-warning`}),y(`div`,p,I(L(u)),1)],64))]),S(a,{"max-height":182,data:L(T),columns:L(E)},null,8,[`data`,`columns`])])}}}),e(`i`,c({default:function(){return v}})),e(`r`,v=T),e(`n`,c({default:function(){return g}})),E(),g=C({name:`BtModal`,props:{data:{type:Object},content:{type:[String,Function],default:``}},emits:[`modalConfirm`,`close`],setup:function(e,t){var n=t.emit,r=R().t,i=N(0),a=N(0),o=N(null),s=N(null);return function(){s.value=null,i.value=Math.round(Math.random()*9+1),a.value=Math.round(Math.random()*9+1)}(),k(function(){O(function(){o.value&&o.value.focus()})}),{sum:s,addend1:i,addend2:a,inputRef:o,onEnter:function(){n(`modalConfirm`)},onConfirm:function(){return U(function(){var t,o;return Y(this,function(c){switch(c.label){case 0:return s.value===i.value+a.value?[4,(t=e.data)==null||(o=t.onConfirm)==null?void 0:o.call(t)]:[3,2];case 1:return c.sent(),n(`close`),[3,3];case 2:D.error(r(`Component.Confirm.index_5`)),c.label=3;case 3:return[2,!1]}})})()}}},render:function(){var e=this,t=R().t;return S(`div`,{class:`p-20px`},[S(`div`,{class:`flex items-center`},[S(`div`,{class:`flex-1 text-12px leading-20px`},[P(this.content)])]),S(`div`,{class:`confirm-calc-box flex items-center h-48px mt-12px px-12px`,style:{backgroundColor:`var(--confirm-calc-bg)`}},[S(`div`,null,[t(`Component.Confirm.index_4`)]),S(`div`,{class:`confirm-calc-num mx-10px`},[this.addend1,x(` + `),this.addend2]),S(`div`,{class:`mr-10px`},[x(`=`)]),S(`div`,{class:`w-90px`},[S(a,{ref:`inputRef`,size:`small`,placeholder:``,inputProps:{name:`sum`,onKeyup:function(t){t.key===`Enter`&&e.onEnter()}},value:this.sum,showButton:!1,onUpdateValue:function(t){e.sum=t}},null)])])])}}),e(`t`,c({default:function(){return F}})),E(),F=C({name:`BtModal`,props:{data:{type:Object}},emits:[`modalConfirm`],setup:function(e,t){var n=t.emit,r,i=R().t,a=N(null),o=N(``),s=(((r=e.data)==null?void 0:r.text)||``).trim().toLowerCase(),c=N(s.replace(RegExp(`^.`,`u`),function(e){return e.toUpperCase()}));return k(function(){O(function(){a.value&&a.value.focus()})}),{text:c,result:o,inputRef:a,onConfirm:function(t){return U(function(){var n,r;return Y(this,function(a){switch(a.label){case 0:return o.value.trim().toLowerCase()===s?[4,(n=e.data)==null||(r=n.onConfirm)==null?void 0:r.call(n,t)]:[3,2];case 1:return a.sent(),t.hide(),[3,3];case 2:D.error(i(`Component.Confirm.index_2`)),a.label=3;case 3:return[2,!1]}})})()},onKeydownEnter:function(e){e.key===`Enter`&&n(`modalConfirm`)}}},render:function(){var e=this,t;return S(`div`,{class:`p-20px`},[S(`div`,{class:`flex items-center`},[S(h,{name:`base-warning`,size:`30`,color:`#f0a020`},null),S(`div`,{class:`flex-1 ml-12px text-14px leading-20px`},[P((t=this.data)==null?void 0:t.content)])]),S(`div`,{class:`mt-16px p-12px bg-[var(--data-base-del-input-bg)] rounded-8px`},[S(i,{tag:`div`,keypath:`Component.Confirm.manualInputVerification`,scope:`global`},{text_:function(){return S(`span`,{class:`text-error`},[e.text])}}),S(o,{ref:`inputRef`,size:`small`,class:`mt-8px`,placeholder:``,inputProps:{name:`confirm_text`},value:this.result,onUpdateValue:function(t){e.result=t},onKeydown:this.onKeydownEnter},null)])])}})}}})})();