!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)||null===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:String(r)}functiona(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){returne};vare={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeofSymbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";functionl(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(T){l=function(t,e,r){returnt[e]=r}}functionp(t,e,r,n){vari=e&&e.prototypeinstanceofh?e:h,a=Object.create(i.prototype),s=newD(n||[]);returno(a,"_invoke",{value:L(t,r,s)}),a}functionf(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(T){return{type:"throw",arg:T}}}e.wrap=p;vard={};functionh(){}functionv(){}functionm(){}varg={};l(g,s,(function(){returnthis}));vary=Object.getPrototypeOf,b=y&&y(y(O([])));b&&b!==r&&n.call(b,s)&&(g=b);varw=m.prototype=h.prototype=Object.create(g);functionx(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionk(e,r){functioni(o,a,s,c){varu=f(e[o],e,a);if("throw"!==u.type){varl=u.arg,p=l.value;returnp&&"object"==t(p)&&n.call(p,"__await")?r.resolve(p.__await).then((function(t){i("next",t,s,c)}),(function(t){i("throw",t,s,c)})):r.resolve(p).then((function(t){l.value=t,s(l)}),(function(t){returni("throw",t,s,c)}))}c(u.arg)}vara;o(this,"_invoke",{value:function(t,e){functionn(){returnnewr((function(r,n){i(t,e,r,n)}))}returna=a?a.then(n,n):n()}})}functionL(t,e,r){varn="suspendedStart";returnfunction(o,i){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===o)throwi;returnI()}for(r.method=o,r.arg=i;;){vara=r.delegate;if(a){vars=P(a,r);if(s){if(s===d)continue;returns}}if("next"===r.method)r.sent=r._sent=r.arg;elseif("throw"===r.method){if("suspendedStart"===n)thrown="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";varc=f(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}functionP(t,e){varr=e.method,n=t.iterator[r];if(void0===n)returne.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void0,P(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=newTypeError("The iterator does not provide a '"+r+"' method")),d;varo=f(n,t.iterator,e.arg);if("throw"===o.type)returne.method="throw",e.arg=o.arg,e.delegate=null,d;vari=o.arg;returni?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void0),e.delegate=null,d):i:(e.method="throw",e.arg=newTypeError("iterator result is not an object"),e.delegate=null,d)}functionS(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionE(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}functionD(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}functionO(t){if(t){vare=t[s];if(e)returne.call(t);if("function"==typeoft.next)returnt;if(!isNaN(t.length)){varr=-1,o=functione(){for(;++r<t.length;)if(n.call(t,r))returne.value=t[r],e.done=!1,e;returne.value=void0,e.done=!0,e};returno.next=o}}return{next:I}}functionI(){return{value:void0,done:!0}}returnv.prototype=m,o(w,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:v,configurable:!0}),v.displayName=l(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,l(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},x(k.prototype),l(k.prototype,c,(function(){returnthis})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void0===i&&(i=Promise);vara=newk(p(t,r,n,o),i);returne.isGeneratorFunction(r)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},x(w),l(w,u,"Generator"),l(w,s,(function(){returnthis})),l(w,"toString",(function(){return"[object Generator]"})),e.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}},e.values=O,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void0,this.done=!1,this.delegate=null,this.method="next",this.arg=void0,this.tryEntries.forEach(E),!t)for(vareinthis)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void0)},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;vare=this;functionr(r,n){returna.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void0),!!n}for(varo=this.tryEntries.length-1;o>=0;--o){vari=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)returnr("end");if(i.tryLoc<=this.prev){vars=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0);if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}elseif(s){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0)}else{if(!c)thrownewError("try statement without catch or finally");if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}}}},abrupt:function(t,e){for(varr=this.tryEntries.length-1;r>=0;--r){varo=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){vari=o;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,d):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),d},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),E(r),d}},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;E(r)}returno}}thrownewError("illegal catch attempt")},delegateYield:function(t,e,r){returnthis.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void0),d}},e}functions(t,e,r,n,o,i,a){try{vars=t[i](a),c=s.value}catch(u){returnvoidr(u)}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","view-design","@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,L,P,S;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.Tooltip,x=t.Button,k=t.Icon},function(t){L=t.PluginStaticResource,P=t.AppFuncCommand},function(t){S=t.CounterService}],execute:function(){varE=newL(r.meta.url),D=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:3}).map((function(t,e){returnE.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,3);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(w,{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]}})])])}))])}}),O=function(){functiont(){e(this,t),o(this,"component",D)}varr;returnn(t,[{key:"createController",value:(r=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(t,e,n){returnr.apply(this,arguments)})}]),t}(),I=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=E.dir("/assets/img/placeholder.svg"),a=h([]),s=h([]),c=h(!1),u=null===(r=v())||void0===r?void0:r.proxy,l=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={};s.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["未分类"]?e["未分类"].push(t):e["未分类"]=[t];returnt.ispersonal})),a.value=Object.keys(e).map((function(t){return{name:t,items:e[t]}}))}}))},f=function(){c.value&&(s.value.forEach((function(t,e){t.showorder=e})),ibiz.net.post("/appfuncs/setfuncsetting",{setting:JSON.stringify({list:s.value})}).then((function(t){t.ok&&(null==u||u.$Notice.success({title:"成功",desc:"保存成功"}),l())}))),c.value=!c.value};y((function(){returnt.isShowDrawer}),(function(t){t&&l()}));vard=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)}))},m=function(t){t.preventDefault()},b=function(t,e,r,n){if(t.stopPropagation(),e.ispersonal=Number(!e.ispersonal),"remove"===n)s.value.splice(r,1);elseif("change"===n){varo=s.value.findIndex((function(t){returnt.pssysappfuncid===e.pssysappfuncid}));-1===o?s.value.push(e):s.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(x,{on:{click:f}},[c.value?"保存":"配置"]),g(x,{on:{click:function(){returnn("on-close")}}},["返回"])])]),g("main",{class:o.b("group-content")},[s.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(){returnd(t.pssysappfuncid)},dragstart:function(t){returnfunction(t,e){varr;c.value&&(null===(r=t.dataTransfer)||void0===r||r.setData("originIndex",e.toString()))}(t,e)},dragover:m,drop:function(t){returnfunction(t,e){if(t.preventDefault(),c.value&&t.dataTransfer){varr=Number(t.dataTransfer.getData("originIndex"));if(r!==e){varn=s.value[r],o=s.value[e];s.value.splice(r,1,o),s.value.splice(e,1,n)}}}(t,e)}},attrs:{draggable:c.value}},[g("div",{class:[o.be("group-item","checkbox"),o.bem("group-item","checkbox","remove"),c.value?o.bem("group-item","checkbox","show"):""],on:{click:function(r){returnb(r,t,e,"remove")}}},[g(k,{attrs:{type:"md-remove",size:16}})]),g("div",{class:o.be("group-item","icon")},[g("img",{attrs:{src:t.icon?E.dir("/assets/img/".concat(t.icon)):i,draggable:!1}})]),g(w,{attrs:{content:t.tip,disabled:!t.tip}},[g("div",{class:o.be("group-item","text")},[t.pssysappfuncname])])])}))])]),a.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(){returnd(t.pssysappfuncid)}}},[g("div",{class:[o.be("group-item","checkbox"),t.ispersonal?o.bem("group-item","checkbox","selected"):"",c.value?o.bem("group-item","checkbox","show"):""],on:{click:function(r){returnb(r,t,e,"change")}}},[t.ispersonal?g(k,{attrs:{type:"md-checkmark",size:16}}):null]),g("div",{class:o.be("group-item","icon")},[g("img",{attrs:{src:t.icon?E.dir("/assets/img/".concat(t.icon)):i,draggable:!1}})]),g(w,{attrs:{content:t.tip,disabled:!t.tip}},[g("div",{class:o.be("group-item","text")},[t.pssysappfuncname])])])}))])])}))])])}}}),T=d({name:"FuncPortalListPortlet",components:{FuncDrawer:I},props:{modelData:{type:u,required:!0},controller:{type:i,required:!0}},setup:function(t){vare=p("func-portal-list-portlet"),r=E.dir("/assets/img/quick-entry.svg"),n=E.dir("/assets/img/editor.svg"),o=E.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?E.dir("/assets/img/".concat(e.icon)):t.placeholderImg}})]),g(w,{attrs:{content:e.tip,disabled:!e.tip}},[g("div",{class:t.ns.be("item","text")},[e.pssysappfuncname])])])}))]),g(I,{attrs:{isShowDrawer:this.isShowDrawer},on:{"on-close":this.isShowDrawerChange}})])}}),C=function(){functiont(){e(this,t),o(this,"component",T)}varr;returnn(t,[{key:"createController",value:(r=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(t,e,n){returnr.apply(this,arguments)})}]),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){returnE.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,S.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(){vart=c(a().mark((functiont(e){varr;returna().wrap((function(t){for(;;)switch(t.prev=t.next){case0:if(!(r=e.source.getPSAppFunc())){t.next=4;break}returnt.next=4,ibiz.commands.execute(P.TAG,r);case4:case"end":returnt.stop()}}),t)})));returnfunction(e){returnt.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(w,{attrs:{content:t.source.tooltip,disabled:!t.source.tooltip}},[g("div",{class:e.ns.be("item-right","text")},[t.label])])])])}))])}}),j=function(){functiont(){e(this,t),o(this,"component",_)}varr;returnn(t,[{key:"createController",value:(r=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(t,e,n){returnr.apply(this,arguments)})}]),t}();t("default",{mateUrl:r.meta.url,install:function(t){E.loadStyle(["/style.css"]),ibiz.register.portletPart.register("PORTLET_CUSTOM_AppPortalList",newO),ibiz.register.portletPart.register("PORTLET_CUSTOM_FuncPortalList",newC),ibiz.register.portletPart.register("PORTLET_CUSTOM_TodoAppMenu",newj)}})}}}))}();
!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)||null===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:String(r)}functiona(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){returne};vare={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeofSymbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";functionl(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(T){l=function(t,e,r){returnt[e]=r}}functionp(t,e,r,n){vari=e&&e.prototypeinstanceofh?e:h,a=Object.create(i.prototype),s=newD(n||[]);returno(a,"_invoke",{value:L(t,r,s)}),a}functionf(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(T){return{type:"throw",arg:T}}}e.wrap=p;vard={};functionh(){}functionv(){}functionm(){}varg={};l(g,s,(function(){returnthis}));vary=Object.getPrototypeOf,b=y&&y(y(O([])));b&&b!==r&&n.call(b,s)&&(g=b);varw=m.prototype=h.prototype=Object.create(g);functionx(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionk(e,r){functioni(o,a,s,c){varu=f(e[o],e,a);if("throw"!==u.type){varl=u.arg,p=l.value;returnp&&"object"==t(p)&&n.call(p,"__await")?r.resolve(p.__await).then((function(t){i("next",t,s,c)}),(function(t){i("throw",t,s,c)})):r.resolve(p).then((function(t){l.value=t,s(l)}),(function(t){returni("throw",t,s,c)}))}c(u.arg)}vara;o(this,"_invoke",{value:function(t,e){functionn(){returnnewr((function(r,n){i(t,e,r,n)}))}returna=a?a.then(n,n):n()}})}functionL(t,e,r){varn="suspendedStart";returnfunction(o,i){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===o)throwi;returnI()}for(r.method=o,r.arg=i;;){vara=r.delegate;if(a){vars=P(a,r);if(s){if(s===d)continue;returns}}if("next"===r.method)r.sent=r._sent=r.arg;elseif("throw"===r.method){if("suspendedStart"===n)thrown="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";varc=f(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}functionP(t,e){varr=e.method,n=t.iterator[r];if(void0===n)returne.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void0,P(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=newTypeError("The iterator does not provide a '"+r+"' method")),d;varo=f(n,t.iterator,e.arg);if("throw"===o.type)returne.method="throw",e.arg=o.arg,e.delegate=null,d;vari=o.arg;returni?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void0),e.delegate=null,d):i:(e.method="throw",e.arg=newTypeError("iterator result is not an object"),e.delegate=null,d)}functionS(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionE(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}functionD(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}functionO(t){if(t){vare=t[s];if(e)returne.call(t);if("function"==typeoft.next)returnt;if(!isNaN(t.length)){varr=-1,o=functione(){for(;++r<t.length;)if(n.call(t,r))returne.value=t[r],e.done=!1,e;returne.value=void0,e.done=!0,e};returno.next=o}}return{next:I}}functionI(){return{value:void0,done:!0}}returnv.prototype=m,o(w,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:v,configurable:!0}),v.displayName=l(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,l(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},x(k.prototype),l(k.prototype,c,(function(){returnthis})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void0===i&&(i=Promise);vara=newk(p(t,r,n,o),i);returne.isGeneratorFunction(r)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},x(w),l(w,u,"Generator"),l(w,s,(function(){returnthis})),l(w,"toString",(function(){return"[object Generator]"})),e.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}},e.values=O,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void0,this.done=!1,this.delegate=null,this.method="next",this.arg=void0,this.tryEntries.forEach(E),!t)for(vareinthis)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void0)},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;vare=this;functionr(r,n){returna.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void0),!!n}for(varo=this.tryEntries.length-1;o>=0;--o){vari=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)returnr("end");if(i.tryLoc<=this.prev){vars=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0);if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}elseif(s){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0)}else{if(!c)thrownewError("try statement without catch or finally");if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}}}},abrupt:function(t,e){for(varr=this.tryEntries.length-1;r>=0;--r){varo=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){vari=o;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,d):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),d},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),E(r),d}},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;E(r)}returno}}thrownewError("illegal catch attempt")},delegateYield:function(t,e,r){returnthis.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void0),d}},e}functions(t,e,r,n,o,i,a){try{vars=t[i](a),c=s.value}catch(u){returnvoidr(u)}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","view-design","@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,L,P,S;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.Tooltip,x=t.Button,k=t.Icon},function(t){L=t.PluginStaticResource,P=t.AppFuncCommand},function(t){S=t.CounterService}],execute:function(){varE=newL(r.meta.url),D=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:3}).map((function(t,e){returnE.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,3);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(w,{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]}})])])}))])}}),O=function(){functiont(){e(this,t),o(this,"component",D)}varr;returnn(t,[{key:"createController",value:(r=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(t,e,n){returnr.apply(this,arguments)})}]),t}(),I=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=E.dir("/assets/img/placeholder.svg"),a=h([]),s=h([]),c=h(!1),u=null===(r=v())||void0===r?void0:r.proxy,l=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={};s.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["未分类"]?e["未分类"].push(t):e["未分类"]=[t];returnt.ispersonal})),a.value=Object.keys(e).map((function(t){return{name:t,items:e[t]}}))}}))},f=function(){c.value&&(s.value.forEach((function(t,e){t.showorder=e})),ibiz.net.post("/appfuncs/setfuncsetting",{setting:JSON.stringify({list:s.value})}).then((function(t){t.ok&&(null==u||u.$Notice.success({title:"成功",desc:"保存成功"}),l())}))),c.value=!c.value};y((function(){returnt.isShowDrawer}),(function(t){t&&l()}));vard=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)}))},m=function(t){t.preventDefault()},b=function(t,e,r,n){if(t.stopPropagation(),e.ispersonal=Number(!e.ispersonal),"remove"===n)s.value.splice(r,1);elseif("change"===n){varo=s.value.findIndex((function(t){returnt.pssysappfuncid===e.pssysappfuncid}));-1===o?s.value.push(e):s.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(x,{on:{click:f}},[c.value?"保存":"配置"]),g(x,{on:{click:function(){returnn("on-close")}}},["返回"])])]),g("main",{class:o.b("group-content")},[s.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(){returnd(t.pssysappfuncid)},dragstart:function(t){returnfunction(t,e){varr;c.value&&(null===(r=t.dataTransfer)||void0===r||r.setData("originIndex",e.toString()))}(t,e)},dragover:m,drop:function(t){returnfunction(t,e){if(t.preventDefault(),c.value&&t.dataTransfer){varr=Number(t.dataTransfer.getData("originIndex"));if(r!==e){varn=s.value[r],o=s.value[e];s.value.splice(r,1,o),s.value.splice(e,1,n)}}}(t,e)}},attrs:{draggable:c.value}},[g("div",{class:[o.be("group-item","checkbox"),o.bem("group-item","checkbox","remove"),c.value?o.bem("group-item","checkbox","show"):""],on:{click:function(r){returnb(r,t,e,"remove")}}},[g(k,{attrs:{type:"md-remove",size:16}})]),g("div",{class:o.be("group-item","icon")},[g("img",{attrs:{src:t.icon?E.dir("/assets/img/".concat(t.icon)):i,draggable:!1}})]),g(w,{attrs:{content:t.tip,disabled:!t.tip}},[g("div",{class:o.be("group-item","text")},[t.pssysappfuncname])])])}))])]),a.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(){returnd(t.pssysappfuncid)}}},[g("div",{class:[o.be("group-item","checkbox"),t.ispersonal?o.bem("group-item","checkbox","selected"):"",c.value?o.bem("group-item","checkbox","show"):""],on:{click:function(r){returnb(r,t,e,"change")}}},[t.ispersonal?g(k,{attrs:{type:"md-checkmark",size:16}}):null]),g("div",{class:o.be("group-item","icon")},[g("img",{attrs:{src:t.icon?E.dir("/assets/img/".concat(t.icon)):i,draggable:!1}})]),g(w,{attrs:{content:t.tip,disabled:!t.tip}},[g("div",{class:o.be("group-item","text")},[t.pssysappfuncname])])])}))])])}))])])}}}),T=d({name:"FuncPortalListPortlet",components:{FuncDrawer:I},props:{modelData:{type:u,required:!0},controller:{type:i,required:!0}},setup:function(t){vare=p("func-portal-list-portlet"),r=E.dir("/assets/img/quick-entry.svg"),n=E.dir("/assets/img/editor.svg"),o=E.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?E.dir("/assets/img/".concat(e.icon)):t.placeholderImg}})]),g(w,{attrs:{content:e.tip,disabled:!e.tip}},[g("div",{class:t.ns.be("item","text")},[e.pssysappfuncname])])])}))]),g(I,{attrs:{isShowDrawer:this.isShowDrawer},on:{"on-close":this.isShowDrawerChange}})])}}),C=function(){functiont(){e(this,t),o(this,"component",T)}varr;returnn(t,[{key:"createController",value:(r=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(t,e,n){returnr.apply(this,arguments)})}]),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){returnE.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,S.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(P.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(w,{attrs:{content:t.source.tooltip,disabled:!t.source.tooltip}},[g("div",{class:e.ns.be("item-right","text")},[t.label])])])])}))])}}),j=function(){functiont(){e(this,t),o(this,"component",_)}varr;returnn(t,[{key:"createController",value:(r=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(t,e,n){returnr.apply(this,arguments)})}]),t}();t("default",{mateUrl:r.meta.url,install:function(t){E.loadStyle(["/style.css"]),ibiz.register.portletPart.register("PORTLET_CUSTOM_AppPortalList",newO),ibiz.register.portletPart.register("PORTLET_CUSTOM_FuncPortalList",newC),ibiz.register.portletPart.register("PORTLET_CUSTOM_TodoAppMenu",newj)}})}}}))}();