!function(){functiont(e){returnt="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},t(e)}functione(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionr(t,e){for(varr=0;r<e.length;r++){varn=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}functionn(t,e,n){returne&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}functiono(t,e,r){return(e=i(e))int?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}functioni(e){varr=function(e,r){if("object"!=t(e)||!e)returne;varn=e[Symbol.toPrimitive];if(void0!==n){varo=n.call(e,r||"default");if("object"!=t(o))returno;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}functiona(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){returnr};vare,r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeofSymbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";functionp(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(e){p=function(t,e,r){returnt[e]=r}}functionf(t,e,r,n){varo=e&&e.prototypeinstanceofb?e:b,a=Object.create(o.prototype),s=new_(n||[]);returni(a,"_invoke",{value:O(t,r,s)}),a}functiond(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;varh="suspendedStart",v="suspendedYield",m="executing",g="completed",y={};functionb(){}functionw(){}functionx(){}vark={};p(k,c,(function(){returnthis}));varL=Object.getPrototypeOf,P=L&&L(L(j([])));P&&P!==n&&o.call(P,c)&&(k=P);varS=x.prototype=b.prototype=Object.create(k);functionE(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionD(e,r){functionn(i,a,s,c){varu=d(e[i],e,a);if("throw"!==u.type){varl=u.arg,p=l.value;returnp&&"object"==t(p)&&o.call(p,"__await")?r.resolve(p.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):r.resolve(p).then((function(t){l.value=t,s(l)}),(function(t){returnn("throw",t,s,c)}))}c(u.arg)}vara;i(this,"_invoke",{value:function(t,e){functiono(){returnnewr((function(r,o){n(t,e,r,o)}))}returna=a?a.then(o,o):o()}})}functionO(t,r,n){varo=h;returnfunction(i,a){if(o===m)throwError("Generator is already running");if(o===g){if("throw"===i)throwa;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){vars=n.delegate;if(s){varc=T(s,n);if(c){if(c===y)continue;returnc}}if("next"===n.method)n.sent=n._sent=n.arg;elseif("throw"===n.method){if(o===h)throwo=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;varu=d(t,r,n);if("normal"===u.type){if(o=n.done?g:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=g,n.method="throw",n.arg=u.arg)}}}functionT(t,r){varn=r.method,o=t.iterator[n];if(o===e)returnr.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=newTypeError("The iterator does not provide a '"+n+"' method")),y;vari=d(o,t.iterator,r.arg);if("throw"===i.type)returnr.method="throw",r.arg=i.arg,r.delegate=null,y;vara=i.arg;returna?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=newTypeError("iterator result is not an object"),r.delegate=null,y)}functionI(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionC(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}function_(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}functionj(r){if(r||""===r){varn=r[c];if(n)returnn.call(r);if("function"==typeofr.next)returnr;if(!isNaN(r.length)){vari=-1,a=functiont(){for(;++i<r.length;)if(o.call(r,i))returnt.value=r[i],t.done=!1,t;returnt.value=e,t.done=!0,t};returna.next=a}}thrownewTypeError(t(r)+" is not iterable")}returnw.prototype=x,i(S,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=p(x,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},E(D.prototype),p(D.prototype,u,(function(){returnthis})),r.AsyncIterator=D,r.async=function(t,e,n,o,i){void0===i&&(i=Promise);vara=newD(f(t,e,n,o),i);returnr.isGeneratorFunction(e)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},E(S),p(S,l,"Generator"),p(S,c,(function(){returnthis})),p(S,"toString",(function(){return"[object Generator]"})),r.keys=function(t){vare=Object(t),r=[];for(varnine)r.push(n);returnr.reverse(),functiont(){for(;r.length;){varn=r.pop();if(nine)returnt.value=n,t.done=!1,t}returnt.done=!0,t}},r.values=j,_.prototype={constructor:_,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(C),!t)for(varrinthis)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;vart=this.tryEntries[0].completion;if("throw"===t.type)throwt.arg;returnthis.rval},dispatchException:function(t){if(this.done)throwt;varr=this;functionn(n,o){returns.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(vari=this.tryEntries.length-1;i>=0;--i){vara=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)returnn("end");if(a.tryLoc<=this.prev){varc=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)returnn(a.catchLoc,!0);if(this.prev<a.finallyLoc)returnn(a.finallyLoc)}elseif(c){if(this.prev<a.catchLoc)returnn(a.catchLoc,!0)}else{if(!u)throwError("try statement without catch or finally");if(this.prev<a.finallyLoc)returnn(a.finallyLoc)}}}},abrupt:function(t,e){for(varr=this.tryEntries.length-1;r>=0;--r){varn=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){vari=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);vara=i?i.completion:{};returna.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throwt.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),y},finish:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.finallyLoc===t)returnthis.complete(r.completion,r.afterLoc),C(r),y}},catch:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.tryLoc===t){varn=r.completion;if("throw"===n.type){varo=n.arg;C(r)}returno}}throwError("illegal catch attempt")},delegateYield:function(t,r,n){returnthis.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},r}functions(t,e,r,n,o,i,a){try{vars=t[i](a),c=s.value}catch(t){returnvoidr(t)}s.done?e(c):Promise.resolve(c).then(n,o)}functionc(t){returnfunction(){vare=this,r=arguments;returnnewPromise((function(n,o){vari=t.apply(e,r);functiona(t){s(i,n,o,a,c,"next",t)}functionc(t){s(i,n,o,a,c,"throw",t)}a(void0)}))}}System.register(["@ibiz-template/controller","@ibiz-template/model","@ibiz-template/vue-util","vue","@ibiz-template/runtime","@ibiz-template/service"],(function(t,r){"use strict";vari,s,u,l,p,f,d,h,v,m,g,y,b,w,x,k;return{setters:[function(t){i=t.ListPortletController,s=t.AppMenuPortletController},function(t){u=t.ListPortletModel,l=t.AppMenuPortletModel},function(t){p=t.useNamespace,f=t.useListController},function(t){d=t.defineComponent,h=t.ref,v=t.getCurrentInstance,m=t.onMounted,g=t.h,y=t.watch,b=t.onUnmounted},function(t){w=t.PluginStaticResource,x=t.AppFuncCommand},function(t){k=t.CounterService}],execute:function(){varL=neww(r.meta.url),P=d({name:"AppPortalListPortlet",props:{modelData:{type:u,required:!0},controller:{type:i,required:!0}},setup:function(t){vare=p("app-portal-list-portlet"),r=h([]),n=Array.from({length:4}).map((function(t,e){returnL.dir("/assets/img/app-portal-list-".concat(e,".svg"))})),o=v();if(o&&t.modelData.list){vari=f(o.proxy,t.modelData.list,t.controller.context);m((function(){i.nerve.self.evt.on("mounted",c(a().mark((functiont(){vare;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,i.load();case2:e=t.sent,r.value=e.slice(0,4);case4:case"end":returnt.stop()}}),t)}))))}))}return{ns:e,appPortalList:r,appPortalImgList:n,openPage:function(t){t&&window.open(t)}}},render:function(){vart=this;returng("div",{class:this.ns.b()},[this.appPortalList.map((function(e,r){returng("div",{class:[t.ns.b("item"),e.url?"":t.ns.bm("item","disabled")],key:e.srfkey,on:{click:function(){returnt.openPage(e.url)}}},[g("i-tooltip",{attrs:{content:e.tip,disabled:!e.tip}},[g("div",{class:t.ns.be("item","text")},[e.srfmajortext])]),g("div",{class:t.ns.be("item","icon")},[g("img",{attrs:{src:t.appPortalImgList[r]}})])])}))])}}),S=function(){returnn((functiont(){e(this,t),o(this,"component",P)}),[{key:"createController",value:(t=c(a().mark((functiont(e,r,n){varo;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returno=newi(e,r,n),t.next=3,o.init();case3:returnt.abrupt("return",o);case4:case"end":returnt.stop()}}),t)}))),function(e,r,n){returnt.apply(this,arguments)})}]);vart}(),E=d({name:"FuncDrawer",props:{isShowDrawer:{type:Boolean,required:!0,default:!1}},emits:{"on-close":function(){return!0}},setup:function(t,e){varr,n=e.emit,o=p("func-drawer"),i=L.dir("/assets/img/placeholder.svg"),a="未分类",s=h([]),c=h([]),u=h(!1),l=null===(r=v())||void0===r?void0:r.proxy,f=function(){ibiz.net.post("/appfuncs/fetchpersonfuncsetting",{page:0,size:1e3,sort:"showorder,asc"}).then((function(t){if(t.ok&&t.data&&t.data.length){vare={};c.value=t.data.filter((function(t){if(t.ispersonal||(t.ispersonal=0),t.pssystemappid){varr=t.pssystemappname;e[r]?e[r].push(t):e[r]=[t]}elsee[a]?e[a].push(t):e[a]=[t];returnt.ispersonal})),s.value=Object.keys(e).map((function(t){return{name:t,items:e[t]}}))}}))},d=function(){u.value&&(c.value.forEach((function(t,e){t.showorder=e})),ibiz.net.post("/appfuncs/setfuncsetting",{setting:JSON.stringify({list:c.value})}).then((function(t){t.ok&&(null==l||l.$Notice.success({title:"成功",desc:"保存成功"}),f())}))),u.value=!u.value};y((function(){returnt.isShowDrawer}),(function(t){t&&f()}));varm=function(t){t&&ibiz.net.get("/appfuncs/".concat(t,"/getfuncurl")).then((function(t){t.ok&&t.data&&t.data.url&&window.open(t.data.url)}))},b=function(t){t.preventDefault()},w=function(t,e,r,n){if(t.stopPropagation(),e.ispersonal=Number(!e.ispersonal),"remove"===n)c.value.splice(r,1);elseif("change"===n){varo=c.value.findIndex((function(t){returnt.pssysappfuncid===e.pssysappfuncid}));-1===o?c.value.push(e):c.value.splice(o,1)}};returnfunction(){returng("div",{class:[o.b(),t.isShowDrawer?o.m("show"):""]},[g("div",{class:o.b("content")},[g("div",{class:o.b("group")},[g("header",{class:o.b("group-header")},[g("div",{class:o.b("group-header-left")},["常用应用"]),g("div",{class:o.b("group-header-right")},[g("i-button",{on:{click:d}},[u.value?"保存":"配置"]),g("i-button",{on:{click:function(){returnn("on-close")}}},["返回"])])]),g("main",{class:o.b("group-content")},[c.value.map((function(t,e){returng("div",{class:[o.b("group-item"),t.pssysappfuncid?"":o.bm("group-item","disabled")],key:t.pssysappfuncid,on:{click:function(){returnm(t.pssysappfuncid)},dragstart:function(t){returnfunction(t,e){varr;u.value&&(null===(r=t.dataTransfer)||void0===r||r.setData("originIndex",e.toString()))}(t,e)},dragover:b,drop:function(t){returnfunction(t,e){if(t.preventDefault(),u.value&&t.dataTransfer){varr=Number(t.dataTransfer.getData("originIndex"));if(r!==e){varn=c.value[r],o=c.value[e];c.value.splice(r,1,o),c.value.splice(e,1,n)}}}(t,e)}},attrs:{draggable:u.value}},[g("div",{class:[o.be("group-item","checkbox"),o.bem("group-item","checkbox","remove"),u.value?o.bem("group-item","checkbox","show"):""],on:{click:function(r){returnw(r,t,e,"remove")}}},[g("i-icon",{attrs:{type:"md-remove",size:16}})]),g("div",{class:o.be("group-item","icon")},[g("img",{attrs:{src:t.icon?L.dir("/assets/img/".concat(t.icon)):i,draggable:!1}})]),g("i-tooltip",{attrs:{content:t.tip,disabled:!t.tip}},[g("div",{class:o.be("group-item","text")},[t.pssysappfuncname])])])}))])]),s.value.map((function(t,e){returng("div",{class:o.b("group"),key:e},[g("header",{class:o.b("group-header")},[t.name]),g("main",{class:o.b("group-content")},[t.items.map((function(t){returng("div",{class:[o.b("group-item"),t.pssysappfuncid?"":o.bm("group-item","disabled")],key:t.pssysappfuncid,on:{click:function(){returnm(t.pssysappfuncid)}}},[g("div",{class:[o.be("group-item","checkbox"),t.ispersonal?o.bem("group-item","checkbox","selected"):"",u.value?o.bem("group-item","checkbox","show"):""],on:{click:function(r){returnw(r,t,e,"change")}}},[t.ispersonal?g("i-icon",{attrs:{type:"md-checkmark",size:16}}):null]),g("div",{class:o.be("group-item","icon")},[g("img",{attrs:{src:t.icon?L.dir("/assets/img/".concat(t.icon)):i,draggable:!1}})]),g("i-tooltip",{attrs:{content:t.tip,disabled:!t.tip}},[g("div",{class:o.be("group-item","text")},[t.pssysappfuncname])])])}))])])}))])])}}}),D=d({name:"FuncPortalListPortlet",components:{FuncDrawer:E},props:{modelData:{type:u,required:!0},controller:{type:i,required:!0}},setup:function(t){vare=p("func-portal-list-portlet"),r=L.dir("/assets/img/quick-entry.svg"),n=L.dir("/assets/img/editor.svg"),o=L.dir("/assets/img/placeholder.svg"),i=h([]),s=v(),u=null;s&&t.modelData.list&&(u=f(s.proxy,t.modelData.list,t.controller.context),m((function(){vart;null===(t=u)||void0===t||t.nerve.self.evt.on("mounted",c(a().mark((functiont(){vare;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:if(!u){t.next=5;break}returnt.next=3,u.load();case3:e=t.sent,i.value=e;case5:case"end":returnt.stop()}}),t)}))))})));varl=h(!1),d=function(){vart=c(a().mark((functiont(){vare;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:if(l.value=!1,!u){t.next=6;break}returnt.next=4,u.load();case4:e=t.sent,i.value=e;case6:case"end":returnt.stop()}}),t)})));returnfunction(){returnt.apply(this,arguments)}}();return{ns:e,quickEntryImg:r,editorImg:n,placeholderImg:o,funcPortalList:i,openPage:function(t){t&&ibiz.net.get("/appfuncs/".concat(t,"/getfuncurl")).then((function(t){t.ok&&t.data&&t.data.url&&window.open(t.data.url)}))},isShowDrawer:l,isShowDrawerChange:d}},render:function(){vart=this;returng("div",{class:this.ns.b()},[g("header",{class:this.ns.b("header")},[g("div",{class:this.ns.b("header-left")},[g("div",{class:this.ns.be("header-left","icon")},[g("img",{attrs:{src:this.quickEntryImg}})]),g("div",{class:this.ns.be("header-left","text")},["快速入口"])]),g("div",{class:this.ns.b("header-right"),on:{click:function(){t.isShowDrawer=!0}}},[g("div",{class:this.ns.be("header-right","icon")},[g("img",{attrs:{src:this.editorImg}})]),g("div",{class:this.ns.be("header-right","text")},["更多"])])]),g("div",{class:this.ns.e("divider")}),g("main",{class:this.ns.b("content")},[this.funcPortalList.map((function(e){returng("div",{class:[t.ns.b("item"),e.pssysappfuncid?"":t.ns.bm("item","disabled")],key:e.pssysappfuncid,on:{click:function(){returnt.openPage(e.pssysappfuncid)}}},[g("div",{class:t.ns.be("item","icon")},[g("img",{attrs:{src:e.icon?L.dir("/assets/img/".concat(e.icon)):t.placeholderImg}})]),g("i-tooltip",{attrs:{content:e.tip,disabled:!e.tip}},[g("div",{class:t.ns.be("item","text")},[e.pssysappfuncname])])])}))]),g(E,{attrs:{isShowDrawer:this.isShowDrawer},on:{"on-close":this.isShowDrawerChange}})])}}),O=function(){returnn((functiont(){e(this,t),o(this,"component",D)}),[{key:"createController",value:(t=c(a().mark((functiont(e,r,n){varo;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returno=newi(e,r,n),t.next=3,o.init();case3:returnt.abrupt("return",o);case4:case"end":returnt.stop()}}),t)}))),function(e,r,n){returnt.apply(this,arguments)})}]);vart}(),T=d({name:"TodoAppMenuPortlet",props:{modelData:{type:l,required:!0},controller:{type:s,required:!0}},setup:function(t){vare=p("todo-app-menu-portlet"),r=Array.from({length:5}).map((function(t,e){returnL.dir("/assets/img/todo-app-menu-".concat(e,".svg"))})),n=null,o=h({});if(t.modelData.appMenu){vari=t.modelData.appMenu.source.getPSAppCounterRef();i&&(m(c(a().mark((functiont(){returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,k.getCounterByRef(i);case2:(n=t.sent).onChange((function(t){o.value=t}));case4:case"end":returnt.stop()}}),t)})))),b((function(){vart;null===(t=n)||void0===t||t.destroy()})))}vars=function(){vare=c(a().mark((functione(r){varn;returna().wrap((function(e){for(;;)switch(e.prev=e.next){case0:if(!(n=r.source.getPSAppFunc())){e.next=4;break}returne.next=4,ibiz.commands.execute(x.TAG,n,t.controller.context,t.controller.params);case4:case"end":returne.stop()}}),e)})));returnfunction(t){returne.apply(this,arguments)}}();return{ns:e,todoImgList:r,counter:n,counterData:o,onClickMenuItem:s}},render:function(){vart,e=this;returng("div",{class:this.ns.b()},[null===(t=this.modelData.appMenu)||void0===t?void0:t.items.map((function(t,r){returng("div",{class:[e.ns.b("item"),t.source.getPSAppFunc()?"":e.ns.bm("item","disabled")],key:t.id,on:{click:function(){returne.onClickMenuItem(t)}}},[g("div",{class:e.ns.b("item-left")},[g("div",{class:e.ns.be("item-left","icon")},[g("img",{attrs:{src:e.todoImgList[r]}})])]),g("div",{class:e.ns.b("item-right")},[g("div",{class:e.ns.be("item-right","count")},[g("span",{class:[(e.counterData[t.counterId]||0)>99?e.ns.be("item-right","add"):""]},[(e.counterData[t.counterId]||0)>99?99:e.counterData[t.counterId]||0]),g("span",["件"])]),g("i-tooltip",{attrs:{content:t.source.tooltip,disabled:!t.source.tooltip}},[g("div",{class:e.ns.be("item-right","text")},[t.label])])])])}))])}}),I=function(){returnn((functiont(){e(this,t),o(this,"component",T)}),[{key:"createController",value:(t=c(a().mark((functiont(e,r,n){varo;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returno=news(e,r,n),t.next=3,o.init();case3:returnt.abrupt("return",o);case4:case"end":returnt.stop()}}),t)}))),function(e,r,n){returnt.apply(this,arguments)})}]);vart}();t("default",{mateUrl:r.meta.url,install:function(t){L.loadStyle(["/style.css"]),ibiz.register.portletPart.register("PORTLET_CUSTOM_AppPortalList",newS),ibiz.register.portletPart.register("PORTLET_CUSTOM_FuncPortalList",newO),ibiz.register.portletPart.register("PORTLET_CUSTOM_TodoAppMenu",newI)}})}}}))}();
!function(){functiont(e){returnt="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},t(e)}functione(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionr(t,e){for(varr=0;r<e.length;r++){varn=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}functionn(t,e,n){returne&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}functiono(t,e,r){return(e=i(e))int?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}functioni(e){varr=function(e,r){if("object"!=t(e)||!e)returne;varn=e[Symbol.toPrimitive];if(void0!==n){varo=n.call(e,r||"default");if("object"!=t(o))returno;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}functiona(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){returnr};vare,r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeofSymbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";functionp(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(e){p=function(t,e,r){returnt[e]=r}}functionf(t,e,r,n){varo=e&&e.prototypeinstanceofb?e:b,a=Object.create(o.prototype),s=new_(n||[]);returni(a,"_invoke",{value:O(t,r,s)}),a}functiond(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;varh="suspendedStart",v="suspendedYield",m="executing",g="completed",y={};functionb(){}functionw(){}functionx(){}vark={};p(k,c,(function(){returnthis}));varL=Object.getPrototypeOf,P=L&&L(L(j([])));P&&P!==n&&o.call(P,c)&&(k=P);varS=x.prototype=b.prototype=Object.create(k);functionE(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionD(e,r){functionn(i,a,s,c){varu=d(e[i],e,a);if("throw"!==u.type){varl=u.arg,p=l.value;returnp&&"object"==t(p)&&o.call(p,"__await")?r.resolve(p.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):r.resolve(p).then((function(t){l.value=t,s(l)}),(function(t){returnn("throw",t,s,c)}))}c(u.arg)}vara;i(this,"_invoke",{value:function(t,e){functiono(){returnnewr((function(r,o){n(t,e,r,o)}))}returna=a?a.then(o,o):o()}})}functionO(t,r,n){varo=h;returnfunction(i,a){if(o===m)throwError("Generator is already running");if(o===g){if("throw"===i)throwa;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){vars=n.delegate;if(s){varc=T(s,n);if(c){if(c===y)continue;returnc}}if("next"===n.method)n.sent=n._sent=n.arg;elseif("throw"===n.method){if(o===h)throwo=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;varu=d(t,r,n);if("normal"===u.type){if(o=n.done?g:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=g,n.method="throw",n.arg=u.arg)}}}functionT(t,r){varn=r.method,o=t.iterator[n];if(o===e)returnr.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=newTypeError("The iterator does not provide a '"+n+"' method")),y;vari=d(o,t.iterator,r.arg);if("throw"===i.type)returnr.method="throw",r.arg=i.arg,r.delegate=null,y;vara=i.arg;returna?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=newTypeError("iterator result is not an object"),r.delegate=null,y)}functionI(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionC(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}function_(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}functionj(r){if(r||""===r){varn=r[c];if(n)returnn.call(r);if("function"==typeofr.next)returnr;if(!isNaN(r.length)){vari=-1,a=functiont(){for(;++i<r.length;)if(o.call(r,i))returnt.value=r[i],t.done=!1,t;returnt.value=e,t.done=!0,t};returna.next=a}}thrownewTypeError(t(r)+" is not iterable")}returnw.prototype=x,i(S,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=p(x,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},E(D.prototype),p(D.prototype,u,(function(){returnthis})),r.AsyncIterator=D,r.async=function(t,e,n,o,i){void0===i&&(i=Promise);vara=newD(f(t,e,n,o),i);returnr.isGeneratorFunction(e)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},E(S),p(S,l,"Generator"),p(S,c,(function(){returnthis})),p(S,"toString",(function(){return"[object Generator]"})),r.keys=function(t){vare=Object(t),r=[];for(varnine)r.push(n);returnr.reverse(),functiont(){for(;r.length;){varn=r.pop();if(nine)returnt.value=n,t.done=!1,t}returnt.done=!0,t}},r.values=j,_.prototype={constructor:_,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(C),!t)for(varrinthis)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;vart=this.tryEntries[0].completion;if("throw"===t.type)throwt.arg;returnthis.rval},dispatchException:function(t){if(this.done)throwt;varr=this;functionn(n,o){returns.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(vari=this.tryEntries.length-1;i>=0;--i){vara=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)returnn("end");if(a.tryLoc<=this.prev){varc=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)returnn(a.catchLoc,!0);if(this.prev<a.finallyLoc)returnn(a.finallyLoc)}elseif(c){if(this.prev<a.catchLoc)returnn(a.catchLoc,!0)}else{if(!u)throwError("try statement without catch or finally");if(this.prev<a.finallyLoc)returnn(a.finallyLoc)}}}},abrupt:function(t,e){for(varr=this.tryEntries.length-1;r>=0;--r){varn=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){vari=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);vara=i?i.completion:{};returna.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throwt.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),y},finish:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.finallyLoc===t)returnthis.complete(r.completion,r.afterLoc),C(r),y}},catch:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.tryLoc===t){varn=r.completion;if("throw"===n.type){varo=n.arg;C(r)}returno}}throwError("illegal catch attempt")},delegateYield:function(t,r,n){returnthis.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},r}functions(t,e,r,n,o,i,a){try{vars=t[i](a),c=s.value}catch(t){returnvoidr(t)}s.done?e(c):Promise.resolve(c).then(n,o)}functionc(t){returnfunction(){vare=this,r=arguments;returnnewPromise((function(n,o){vari=t.apply(e,r);functiona(t){s(i,n,o,a,c,"next",t)}functionc(t){s(i,n,o,a,c,"throw",t)}a(void0)}))}}System.register(["@ibiz-template/controller","@ibiz-template/model","@ibiz-template/vue-util","vue","@ibiz-template/runtime","@ibiz-template/service"],(function(t,r){"use strict";vari,s,u,l,p,f,d,h,v,m,g,y,b,w,x,k;return{setters:[function(t){i=t.ListPortletController,s=t.AppMenuPortletController},function(t){u=t.ListPortletModel,l=t.AppMenuPortletModel},function(t){p=t.useNamespace,f=t.useListController},function(t){d=t.defineComponent,h=t.ref,v=t.getCurrentInstance,m=t.onMounted,g=t.h,y=t.watch,b=t.onUnmounted},function(t){w=t.PluginStaticResource,x=t.AppFuncCommand},function(t){k=t.CounterService}],execute:function(){varL=neww(r.meta.url),P=d({name:"AppPortalListPortlet",props:{modelData:{type:u,required:!0},controller:{type:i,required:!0}},setup:function(t){vare=p("app-portal-list-portlet"),r=h([]),n=Array.from({length:4}).map((function(t,e){returnL.dir("/assets/img/app-portal-list-".concat(e,".svg"))})),o=v();if(o&&t.modelData.list){vari=f(o.proxy,t.modelData.list,t.controller.context);m((function(){i.nerve.self.evt.on("mounted",c(a().mark((functiont(){vare;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,i.load();case2:e=t.sent,r.value=e.slice(0,4);case4:case"end":returnt.stop()}}),t)}))))}))}return{ns:e,appPortalList:r,appPortalImgList:n,openPage:function(t){t&&window.open(t)}}},render:function(){vart=this;returng("div",{class:this.ns.b()},[this.appPortalList.map((function(e,r){returng("div",{class:[t.ns.b("item"),e.url?"":t.ns.bm("item","disabled")],key:e.srfkey,on:{click:function(){returnt.openPage(e.url)}}},[g("i-tooltip",{attrs:{content:e.tip,disabled:!e.tip}},[g("div",{class:t.ns.be("item","text")},[e.srfmajortext])]),g("div",{class:t.ns.be("item","icon")},[g("img",{attrs:{src:t.appPortalImgList[r]}})])])}))])}}),S=function(){returnn((functiont(){e(this,t),o(this,"component",P)}),[{key:"createController",value:(t=c(a().mark((functiont(e,r,n){varo;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returno=newi(e,r,n),t.next=3,o.init();case3:returnt.abrupt("return",o);case4:case"end":returnt.stop()}}),t)}))),function(e,r,n){returnt.apply(this,arguments)})}]);vart}(),E=d({name:"FuncDrawer",props:{isShowDrawer:{type:Boolean,required:!0,default:!1}},emits:{"on-close":function(){return!0}},setup:function(t,e){varr,n=e.emit,o=p("func-drawer"),i=L.dir("/assets/img/placeholder.svg"),a="未分类",s=h([]),c=h([]),u=h(!1),l=null===(r=v())||void0===r?void0:r.proxy,f=function(){ibiz.net.post("/appfuncs/fetchpersonfuncsetting",{page:0,size:1e3,sort:"showorder,asc"}).then((function(t){if(t.ok&&t.data&&t.data.length){vare={};c.value=t.data.filter((function(t){if(t.ispersonal||(t.ispersonal=0),t.pssystemappid){varr=t.pssystemappname;e[r]?e[r].push(t):e[r]=[t]}elsee[a]?e[a].push(t):e[a]=[t];returnt.ispersonal})),s.value=Object.keys(e).map((function(t){return{name:t,items:e[t]}}))}}))},d=function(){u.value&&(c.value.forEach((function(t,e){t.showorder=e})),ibiz.net.post("/appfuncs/setfuncsetting",{setting:JSON.stringify({list:c.value})}).then((function(t){t.ok&&(null==l||l.$Notice.success({title:"成功",desc:"保存成功"}),f())}))),u.value=!u.value};y((function(){returnt.isShowDrawer}),(function(t){t&&f()}));varm=function(t){t&&ibiz.net.get("/appfuncs/".concat(t,"/getfuncurl")).then((function(t){t.ok&&t.data&&t.data.url&&window.open(t.data.url)}))},b=function(t){t.preventDefault()},w=function(t,e,r,n){if(t.stopPropagation(),e.ispersonal=Number(!e.ispersonal),"remove"===n)c.value.splice(r,1);elseif("change"===n){varo=c.value.findIndex((function(t){returnt.pssysappfuncid===e.pssysappfuncid}));-1===o?c.value.push(e):c.value.splice(o,1)}};returnfunction(){returng("div",{class:[o.b(),t.isShowDrawer?o.m("show"):""],style:{marginTop:t.isShowDrawer?"0":"-100vh"}},[g("div",{class:o.b("content")},[g("div",{class:o.b("group")},[g("header",{class:o.b("group-header")},[g("div",{class:o.b("group-header-left")},["常用应用"]),g("div",{class:o.b("group-header-right")},[g("i-button",{on:{click:d}},[u.value?"保存":"配置"]),g("i-button",{on:{click:function(){returnn("on-close")}}},["返回"])])]),g("main",{class:o.b("group-content")},[c.value.map((function(t,e){returng("div",{class:[o.b("group-item"),t.pssysappfuncid?"":o.bm("group-item","disabled")],key:t.pssysappfuncid,on:{click:function(){returnm(t.pssysappfuncid)},dragstart:function(t){returnfunction(t,e){varr;u.value&&(null===(r=t.dataTransfer)||void0===r||r.setData("originIndex",e.toString()))}(t,e)},dragover:b,drop:function(t){returnfunction(t,e){if(t.preventDefault(),u.value&&t.dataTransfer){varr=Number(t.dataTransfer.getData("originIndex"));if(r!==e){varn=c.value[r],o=c.value[e];c.value.splice(r,1,o),c.value.splice(e,1,n)}}}(t,e)}},attrs:{draggable:u.value}},[g("div",{class:[o.be("group-item","checkbox"),o.bem("group-item","checkbox","remove"),u.value?o.bem("group-item","checkbox","show"):""],on:{click:function(r){returnw(r,t,e,"remove")}}},[g("i-icon",{attrs:{type:"md-remove",size:16}})]),g("div",{class:o.be("group-item","icon")},[g("img",{attrs:{src:t.icon?L.dir("/assets/img/".concat(t.icon)):i,draggable:!1}})]),g("i-tooltip",{attrs:{content:t.tip,disabled:!t.tip}},[g("div",{class:o.be("group-item","text")},[t.pssysappfuncname])])])}))])]),s.value.map((function(t,e){returng("div",{class:o.b("group"),key:e},[g("header",{class:o.b("group-header")},[t.name]),g("main",{class:o.b("group-content")},[t.items.map((function(t){returng("div",{class:[o.b("group-item"),t.pssysappfuncid?"":o.bm("group-item","disabled")],key:t.pssysappfuncid,on:{click:function(){returnm(t.pssysappfuncid)}}},[g("div",{class:[o.be("group-item","checkbox"),t.ispersonal?o.bem("group-item","checkbox","selected"):"",u.value?o.bem("group-item","checkbox","show"):""],on:{click:function(r){returnw(r,t,e,"change")}}},[t.ispersonal?g("i-icon",{attrs:{type:"md-checkmark",size:16}}):null]),g("div",{class:o.be("group-item","icon")},[g("img",{attrs:{src:t.icon?L.dir("/assets/img/".concat(t.icon)):i,draggable:!1}})]),g("i-tooltip",{attrs:{content:t.tip,disabled:!t.tip}},[g("div",{class:o.be("group-item","text")},[t.pssysappfuncname])])])}))])])}))])])}}}),D=d({name:"FuncPortalListPortlet",components:{FuncDrawer:E},props:{modelData:{type:u,required:!0},controller:{type:i,required:!0}},setup:function(t){vare=p("func-portal-list-portlet"),r=L.dir("/assets/img/quick-entry.svg"),n=L.dir("/assets/img/editor.svg"),o=L.dir("/assets/img/placeholder.svg"),i=h([]),s=v(),u=null;s&&t.modelData.list&&(u=f(s.proxy,t.modelData.list,t.controller.context),m((function(){vart;null===(t=u)||void0===t||t.nerve.self.evt.on("mounted",c(a().mark((functiont(){vare;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:if(!u){t.next=5;break}returnt.next=3,u.load();case3:e=t.sent,i.value=e;case5:case"end":returnt.stop()}}),t)}))))})));varl=h(!1),d=function(){vart=c(a().mark((functiont(){vare;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:if(l.value=!1,!u){t.next=6;break}returnt.next=4,u.load();case4:e=t.sent,i.value=e;case6:case"end":returnt.stop()}}),t)})));returnfunction(){returnt.apply(this,arguments)}}();return{ns:e,quickEntryImg:r,editorImg:n,placeholderImg:o,funcPortalList:i,openPage:function(t){t&&ibiz.net.get("/appfuncs/".concat(t,"/getfuncurl")).then((function(t){t.ok&&t.data&&t.data.url&&window.open(t.data.url)}))},isShowDrawer:l,isShowDrawerChange:d}},render:function(){vart=this;returng("div",{class:this.ns.b()},[g("header",{class:this.ns.b("header")},[g("div",{class:this.ns.b("header-left")},[g("div",{class:this.ns.be("header-left","icon")},[g("img",{attrs:{src:this.quickEntryImg}})]),g("div",{class:this.ns.be("header-left","text")},["快速入口"])]),g("div",{class:this.ns.b("header-right"),on:{click:function(){t.isShowDrawer=!0}}},[g("div",{class:this.ns.be("header-right","icon")},[g("img",{attrs:{src:this.editorImg}})]),g("div",{class:this.ns.be("header-right","text")},["更多"])])]),g("div",{class:this.ns.e("divider")}),g("main",{class:this.ns.b("content")},[this.funcPortalList.map((function(e){returng("div",{class:[t.ns.b("item"),e.pssysappfuncid?"":t.ns.bm("item","disabled")],key:e.pssysappfuncid,on:{click:function(){returnt.openPage(e.pssysappfuncid)}}},[g("div",{class:t.ns.be("item","icon")},[g("img",{attrs:{src:e.icon?L.dir("/assets/img/".concat(e.icon)):t.placeholderImg}})]),g("i-tooltip",{attrs:{content:e.tip,disabled:!e.tip}},[g("div",{class:t.ns.be("item","text")},[e.pssysappfuncname])])])}))]),g(E,{attrs:{isShowDrawer:this.isShowDrawer},on:{"on-close":this.isShowDrawerChange}})])}}),O=function(){returnn((functiont(){e(this,t),o(this,"component",D)}),[{key:"createController",value:(t=c(a().mark((functiont(e,r,n){varo;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returno=newi(e,r,n),t.next=3,o.init();case3:returnt.abrupt("return",o);case4:case"end":returnt.stop()}}),t)}))),function(e,r,n){returnt.apply(this,arguments)})}]);vart}(),T=d({name:"TodoAppMenuPortlet",props:{modelData:{type:l,required:!0},controller:{type:s,required:!0}},setup:function(t){vare=p("todo-app-menu-portlet"),r=Array.from({length:5}).map((function(t,e){returnL.dir("/assets/img/todo-app-menu-".concat(e,".svg"))})),n=null,o=h({});if(t.modelData.appMenu){vari=t.modelData.appMenu.source.getPSAppCounterRef();i&&(m(c(a().mark((functiont(){returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,k.getCounterByRef(i);case2:(n=t.sent).onChange((function(t){o.value=t}));case4:case"end":returnt.stop()}}),t)})))),b((function(){vart;null===(t=n)||void0===t||t.destroy()})))}vars=function(){vare=c(a().mark((functione(r){varn;returna().wrap((function(e){for(;;)switch(e.prev=e.next){case0:if(!(n=r.source.getPSAppFunc())){e.next=4;break}returne.next=4,ibiz.commands.execute(x.TAG,n,t.controller.context,t.controller.params);case4:case"end":returne.stop()}}),e)})));returnfunction(t){returne.apply(this,arguments)}}();return{ns:e,todoImgList:r,counter:n,counterData:o,onClickMenuItem:s}},render:function(){vart,e=this;returng("div",{class:this.ns.b()},[null===(t=this.modelData.appMenu)||void0===t?void0:t.items.map((function(t,r){returng("div",{class:[e.ns.b("item"),t.source.getPSAppFunc()?"":e.ns.bm("item","disabled")],key:t.id,on:{click:function(){returne.onClickMenuItem(t)}}},[g("div",{class:e.ns.b("item-left")},[g("div",{class:e.ns.be("item-left","icon")},[g("img",{attrs:{src:e.todoImgList[r]}})])]),g("div",{class:e.ns.b("item-right")},[g("div",{class:e.ns.be("item-right","count")},[g("span",{class:[(e.counterData[t.counterId]||0)>99?e.ns.be("item-right","add"):""]},[(e.counterData[t.counterId]||0)>99?99:e.counterData[t.counterId]||0]),g("span",["件"])]),g("i-tooltip",{attrs:{content:t.source.tooltip,disabled:!t.source.tooltip}},[g("div",{class:e.ns.be("item-right","text")},[t.label])])])])}))])}}),I=function(){returnn((functiont(){e(this,t),o(this,"component",T)}),[{key:"createController",value:(t=c(a().mark((functiont(e,r,n){varo;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returno=news(e,r,n),t.next=3,o.init();case3:returnt.abrupt("return",o);case4:case"end":returnt.stop()}}),t)}))),function(e,r,n){returnt.apply(this,arguments)})}]);vart}();t("default",{mateUrl:r.meta.url,install:function(t){L.loadStyle(["/style.css"]),ibiz.register.portletPart.register("PORTLET_CUSTOM_AppPortalList",newS),ibiz.register.portletPart.register("PORTLET_CUSTOM_FuncPortalList",newO),ibiz.register.portletPart.register("PORTLET_CUSTOM_TodoAppMenu",newI)}})}}}))}();