提交 ce4c3432 编写于 作者: zhujiamin's avatar zhujiamin

feat: 更新插件

上级 d5c1be8c
......@@ -2,7 +2,7 @@ var Z = Object.defineProperty;
var ee = (t, a, s) => a in t ? Z(t, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[a] = s;
var w = (t, a, s) => (ee(t, typeof a != "symbol" ? a + "" : a, s), s);
import { PluginStaticResource as te, ViewMode as se, AppFuncCommand as ae } from "@ibiz-template/runtime";
import { ref as C, watch as _, defineComponent as D, getCurrentInstance as j, computed as R, onMounted as L, h as i, toRefs as ie, reactive as re, nextTick as F, toRef as ne, onActivated as oe } from "vue";
import { ref as C, watch as _, defineComponent as D, getCurrentInstance as j, computed as R, onMounted as L, h as i, toRefs as ie, reactive as re, nextTick as K, toRef as ne, onActivated as oe } from "vue";
import { useRouter as G, useRoute as B, useIndexViewController as le, useNamespace as S, useControlController as ce, usePropsWatch as de, useListController as ue, useListExpViewController as he, useRouteKey as pe, getUploadProps as me, getEditorEmits as fe, useMPickupViewController as ge, useTreeController as ve, useViewController as ye } from "@ibiz-template/vue-util";
import { createUUID as we, notNilEmpty as be } from "qx-util";
import { IndexViewModel as Ce, PortletPartModel as xe, ViewPortletModel as ke, ListModel as H, TreeModel as Pe, getControl as $, GridModel as U } from "@ibiz-template/model";
......@@ -31,7 +31,7 @@ const Re = (t) => {
const { view1: a, appContext: s } = t.params;
return `/${s}/${a}/${ibiz.env.routePlaceholder}`;
};
function Ke(t, a) {
function Fe(t, a) {
const s = G(t), e = C(""), r = C(""), n = C([]), d = C([]), f = (l) => {
l.forEach((h) => {
const b = n.value.indexOf(h);
......@@ -135,7 +135,7 @@ function Ke(t, a) {
}
};
}
const Fe = /* @__PURE__ */ D({
const Ke = /* @__PURE__ */ D({
__name: "index-view",
props: {
context: null,
......@@ -159,7 +159,7 @@ const Fe = /* @__PURE__ */ D({
handleTabDelete: V,
handleCloseAll: T,
handleCloseOther: J
} = Ke(s, e);
} = Fe(s, e);
m = k, x = y, l = q, o = O, p = I, g = V, v = T, u = J, n = (E) => {
const N = m.value;
E.evt.on("closeView", () => {
......@@ -219,7 +219,7 @@ var $e = function() {
var a = this, s = a._self._c, e = a._self._setupProxy;
return s("UserAppLayout", { attrs: { "is-complete": e.c.complete, model: e.c.model, "is-show-tab-page-exp": e.isShowTabPageExp }, on: { onCollapseChange: e.collapseChange } }, [e.c.complete ? [e.c.complete ? s("app-menu", { attrs: { slot: "menu", "current-path": e.currentPath, "model-data": e.c.model.appMenu, context: e.c.context, "collapse-change": e.c.collapseChange }, on: { menuRouteChange: e.onMenuRouteChange }, slot: "menu" }) : a._e(), e.isShowTabPageExp ? s("user-tab-page-exp", { attrs: { slot: "tabPageExp", "route-msgs": e.routeMsgs, "current-key": e.currentKey }, on: { "tab-click": e.handleTabClick, "tab-delete": e.handleTabDelete, "close-all": e.handleCloseAll, "close-other": e.handleCloseOther }, slot: "tabPageExp" }) : a._e(), e.isShowTabPageExp ? s("AppKeepAlive", { attrs: { "key-list": e.keyHistory } }, [s("router-view", { key: e.currentKey, on: { neuronInit: e.onCreated, viewFound: e.onViewFound } })], 1) : s("AppKeepAlive", { key: e.appKeepAliveKey, attrs: { "key-list": e.keyHistory } }, [s("router-view", { key: e.currentKey, on: { neuronInit: e.onCreated, viewFound: e.onViewFound } })], 1)] : a._e()], 2);
}, Ue = [], Ge = /* @__PURE__ */ Be(
Fe,
Ke,
$e,
Ue,
!1,
......@@ -1229,7 +1229,7 @@ function ht(t) {
t.handleDblClick(e);
} };
}
const K = D({
const F = D({
name: "ListExpControl",
props: {
modelData: {
......@@ -1330,7 +1330,7 @@ const K = D({
}
}, ["\u5168\u90E8"]) : null;
};
return F(() => {
return K(() => {
d && (g({
deptid: e.params.n_orgid_eq,
orgid: e.params.n_orgid_eq,
......@@ -1339,7 +1339,7 @@ const K = D({
sysdepartment: void 0
}), e.selectedData.length = 0);
}), _(() => e.items, () => {
F(() => {
K(() => {
d = !0, Object.assign(e.context, {
n_orgid_eq: e.params.n_orgid_eq
}), g({
......@@ -1376,7 +1376,7 @@ const pt = D({
name: "ListExpSelectTreeView",
components: {
Treeselect: Ae,
ListExpControl: K
ListExpControl: F
},
props: {
context: Object,
......@@ -1448,7 +1448,7 @@ const pt = D({
expBarModel: this.c.model.listExpBar
},
scopedSlots: {
default: () => i(K, {
default: () => i(F, {
attrs: {
modelData: s,
context: this.c.context,
......@@ -2081,8 +2081,8 @@ const Dt = D({
class St extends ae {
custom(a, s, e) {
if (a.id === "performanceappraisal") {
const r = { userid: s == null ? void 0 : s.srfjxuserid }, n = JSON.stringify(r), d = window.btoa(n), f = `${a.htmlPageUrl}param=${d}`;
window.open(f, "_blank");
const r = { userid: s == null ? void 0 : s.srfjxuserid }, n = window.Environment, d = JSON.stringify(r), f = window.btoa(d), o = `${n.jxkhUrl}param=${f}`;
window.open(o, "_blank");
} else
throw ibiz.log.warn("custom", a, s, e), new Error("\u672A\u5B9E\u73B0");
}
......@@ -2090,7 +2090,7 @@ class St extends ae {
const Lt = {
mateUrl: import.meta.url,
install(t) {
new St(), t.component("UserTabPageExp", Ct), t.component("UserIndexView", He), t.component("UserAppLayout", Qe), t.component("ListExpSelectTreeView", pt), t.component("ListExpControl", K), t.component("ChangePassword", Y), t.component(
new St(), t.component("UserTabPageExp", Ct), t.component("UserIndexView", He), t.component("UserAppLayout", Qe), t.component("ListExpSelectTreeView", pt), t.component("ListExpControl", F), t.component("ChangePassword", Y), t.component(
"BYQKEditView",
() => import("./byqk-edit-view.fea98c06.js")
), t.component(
......
var R = Object.defineProperty;
var N = (s, n, e) => n in s ? R(s, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[n] = e;
var y = (s, n, e) => (N(s, typeof n != "symbol" ? n + "" : n, e), e);
import { ListPortletController as D, AppMenuPortletController as E } from "@ibiz-template/controller";
import { ListPortletModel as z, AppMenuPortletModel as U } from "@ibiz-template/model";
import { useNamespace as k, useListController as O } from "@ibiz-template/vue-util";
import { defineComponent as L, ref as f, getCurrentInstance as C, onMounted as x, h as t, watch as j, onUnmounted as B } from "vue";
import { Tooltip as P, Button as A, Icon as F } from "view-design";
import { PluginStaticResource as G, AppFuncCommand as J } from "@ibiz-template/runtime";
import { CounterService as H } from "@ibiz-template/service";
const d = new G(import.meta.url), K = L({
var q = Object.defineProperty;
var _ = (s, n, e) => n in s ? q(s, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[n] = e;
var w = (s, n, e) => (_(s, typeof n != "symbol" ? n + "" : n, e), e);
import { ListPortletController as y, AppMenuPortletController as A } from "@ibiz-template/controller";
import { ListPortletModel as F, AppMenuPortletModel as $ } from "@ibiz-template/model";
import { useNamespace as D, useListController as T } from "@ibiz-template/vue-util";
import { defineComponent as k, ref as f, getCurrentInstance as L, onMounted as C, h as t, watch as R, onUnmounted as N } from "vue";
import { PluginStaticResource as U, AppFuncCommand as j } from "@ibiz-template/runtime";
import { CounterService as B } from "@ibiz-template/service";
const d = new U(import.meta.url), G = k({
name: "AppPortalListPortlet",
props: {
modelData: {
type: z,
type: F,
required: !0
},
controller: {
type: D,
type: y,
required: !0
}
},
setup(s) {
const n = k("app-portal-list-portlet"), e = f([]), p = Array.from({
const n = D("app-portal-list-portlet"), e = f([]), p = Array.from({
length: 3
}).map((c, i) => d.dir(`/assets/img/app-portal-list-${i}.svg`)), l = C();
}).map((c, i) => d.dir(`/assets/img/app-portal-list-${i}.svg`)), l = L();
if (l && s.modelData.list) {
const c = O(l.proxy, s.modelData.list, s.controller.context);
x(() => {
const c = T(l.proxy, s.modelData.list, s.controller.context);
C(() => {
c.nerve.self.evt.on("mounted", async () => {
const i = await c.load();
e.value = i.slice(0, 3);
......@@ -51,7 +50,7 @@ const d = new G(import.meta.url), K = L({
on: {
click: () => this.openPage(s.url)
}
}, [t(P, {
}, [t("i-tooltip", {
attrs: {
content: s.tip,
disabled: !s.tip
......@@ -67,12 +66,12 @@ const d = new G(import.meta.url), K = L({
})])]))]);
}
});
class Q {
class J {
constructor() {
y(this, "component", K);
w(this, "component", G);
}
async createController(n, e, p) {
const l = new D(
const l = new y(
n,
e,
p
......@@ -80,7 +79,7 @@ class Q {
return await l.init(), l;
}
}
const T = L({
const M = k({
name: "FuncDrawer",
props: {
isShowDrawer: {
......@@ -95,69 +94,69 @@ const T = L({
setup(s, {
emit: n
}) {
var M;
const e = k("func-drawer"), p = d.dir("/assets/img/placeholder.svg"), l = "未分类", h = f([]), c = f([]), i = f(!1), m = (M = C()) == null ? void 0 : M.proxy, b = () => {
var S;
const e = D("func-drawer"), p = d.dir("/assets/img/placeholder.svg"), l = "未分类", h = f([]), c = f([]), i = f(!1), m = (S = L()) == null ? void 0 : S.proxy, b = () => {
ibiz.net.post("/appfuncs/fetchpersonfuncsetting", {
page: 0,
size: 1e3,
sort: "showorder,asc"
}).then((o) => {
if (o.ok && o.data && o.data.length) {
}).then((a) => {
if (a.ok && a.data && a.data.length) {
const r = {};
c.value = o.data.filter((a) => {
if (a.ispersonal || (a.ispersonal = 0), !a.pssystemappid)
r[l] ? r[l].push(a) : r[l] = [a];
c.value = a.data.filter((o) => {
if (o.ispersonal || (o.ispersonal = 0), !o.pssystemappid)
r[l] ? r[l].push(o) : r[l] = [o];
else {
const u = a.pssystemappname;
r[u] ? r[u].push(a) : r[u] = [a];
const u = o.pssystemappname;
r[u] ? r[u].push(o) : r[u] = [o];
}
return a.ispersonal;
}), h.value = Object.keys(r).map((a) => ({
name: a,
items: r[a]
return o.ispersonal;
}), h.value = Object.keys(r).map((o) => ({
name: o,
items: r[o]
}));
}
});
}, I = () => {
i.value && (c.value.forEach((o, r) => {
o.showorder = r;
}, x = () => {
i.value && (c.value.forEach((a, r) => {
a.showorder = r;
}), ibiz.net.post("/appfuncs/setfuncsetting", {
setting: JSON.stringify({
list: c.value
})
}).then((o) => {
o.ok && (m == null || m.$Notice.success({
}).then((a) => {
a.ok && (m == null || m.$Notice.success({
title: "成功",
desc: "保存成功"
}), b());
})), i.value = !i.value;
};
j(() => s.isShowDrawer, (o) => {
o && b();
R(() => s.isShowDrawer, (a) => {
a && b();
});
const g = (o) => {
o && ibiz.net.get(`/appfuncs/${o}/getfuncurl`).then((r) => {
const g = (a) => {
a && ibiz.net.get(`/appfuncs/${a}/getfuncurl`).then((r) => {
r.ok && r.data && r.data.url && window.open(r.data.url);
});
}, v = (o, r) => {
var a;
i.value && ((a = o.dataTransfer) == null || a.setData("originIndex", r.toString()));
}, q = (o) => {
o.preventDefault();
}, _ = (o, r) => {
if (o.preventDefault(), i.value && o.dataTransfer) {
const a = Number(o.dataTransfer.getData("originIndex"));
if (a !== r) {
const u = c.value[a], w = c.value[r];
c.value.splice(a, 1, w), c.value.splice(r, 1, u);
}, v = (a, r) => {
var o;
i.value && ((o = a.dataTransfer) == null || o.setData("originIndex", r.toString()));
}, E = (a) => {
a.preventDefault();
}, z = (a, r) => {
if (a.preventDefault(), i.value && a.dataTransfer) {
const o = Number(a.dataTransfer.getData("originIndex"));
if (o !== r) {
const u = c.value[o], P = c.value[r];
c.value.splice(o, 1, P), c.value.splice(r, 1, u);
}
}
}, S = (o, r, a, u) => {
if (o.stopPropagation(), r.ispersonal = +!r.ispersonal, u === "remove")
c.value.splice(a, 1);
}, I = (a, r, o, u) => {
if (a.stopPropagation(), r.ispersonal = +!r.ispersonal, u === "remove")
c.value.splice(o, 1);
else if (u === "change") {
const w = c.value.findIndex(($) => $.pssysappfuncid === r.pssysappfuncid);
w === -1 ? c.value.push(r) : c.value.splice(w, 1);
const P = c.value.findIndex((O) => O.pssysappfuncid === r.pssysappfuncid);
P === -1 ? c.value.push(r) : c.value.splice(P, 1);
}
};
return () => t("div", {
......@@ -172,24 +171,24 @@ const T = L({
class: e.b("group-header-left")
}, ["常用应用"]), t("div", {
class: e.b("group-header-right")
}, [t(A, {
}, [t("i-button", {
on: {
click: I
click: x
}
}, [i.value ? "保存" : "配置"]), t(A, {
}, [i.value ? "保存" : "配置"]), t("i-button", {
on: {
click: () => n("on-close")
}
}, ["返回"])])]), t("main", {
class: e.b("group-content")
}, [c.value.map((o, r) => t("div", {
class: [e.b("group-item"), o.pssysappfuncid ? "" : e.bm("group-item", "disabled")],
key: o.pssysappfuncid,
}, [c.value.map((a, r) => t("div", {
class: [e.b("group-item"), a.pssysappfuncid ? "" : e.bm("group-item", "disabled")],
key: a.pssysappfuncid,
on: {
click: () => g(o.pssysappfuncid),
dragstart: (a) => v(a, r),
dragover: q,
drop: (a) => _(a, r)
click: () => g(a.pssysappfuncid),
dragstart: (o) => v(o, r),
dragover: E,
drop: (o) => z(o, r)
},
attrs: {
draggable: i.value
......@@ -197,9 +196,9 @@ const T = L({
}, [t("div", {
class: [e.be("group-item", "checkbox"), e.bem("group-item", "checkbox", "remove"), i.value ? e.bem("group-item", "checkbox", "show") : ""],
on: {
click: (a) => S(a, o, r, "remove")
click: (o) => I(o, a, r, "remove")
}
}, [t(F, {
}, [t("i-icon", {
attrs: {
type: "md-remove",
size: 16
......@@ -208,35 +207,35 @@ const T = L({
class: e.be("group-item", "icon")
}, [t("img", {
attrs: {
src: o.icon ? d.dir(`/assets/img/${o.icon}`) : p,
src: a.icon ? d.dir(`/assets/img/${a.icon}`) : p,
draggable: !1
}
})]), t(P, {
})]), t("i-tooltip", {
attrs: {
content: o.tip,
disabled: !o.tip
content: a.tip,
disabled: !a.tip
}
}, [t("div", {
class: e.be("group-item", "text")
}, [o.pssysappfuncname])])]))])]), h.value.map((o, r) => t("div", {
}, [a.pssysappfuncname])])]))])]), h.value.map((a, r) => t("div", {
class: e.b("group"),
key: r
}, [t("header", {
class: e.b("group-header")
}, [o.name]), t("main", {
}, [a.name]), t("main", {
class: e.b("group-content")
}, [o.items.map((a) => t("div", {
class: [e.b("group-item"), a.pssysappfuncid ? "" : e.bm("group-item", "disabled")],
key: a.pssysappfuncid,
}, [a.items.map((o) => t("div", {
class: [e.b("group-item"), o.pssysappfuncid ? "" : e.bm("group-item", "disabled")],
key: o.pssysappfuncid,
on: {
click: () => g(a.pssysappfuncid)
click: () => g(o.pssysappfuncid)
}
}, [t("div", {
class: [e.be("group-item", "checkbox"), a.ispersonal ? e.bem("group-item", "checkbox", "selected") : "", i.value ? e.bem("group-item", "checkbox", "show") : ""],
class: [e.be("group-item", "checkbox"), o.ispersonal ? e.bem("group-item", "checkbox", "selected") : "", i.value ? e.bem("group-item", "checkbox", "show") : ""],
on: {
click: (u) => S(u, a, r, "change")
click: (u) => I(u, o, r, "change")
}
}, [a.ispersonal ? t(F, {
}, [o.ispersonal ? t("i-icon", {
attrs: {
type: "md-checkmark",
size: 16
......@@ -245,37 +244,37 @@ const T = L({
class: e.be("group-item", "icon")
}, [t("img", {
attrs: {
src: a.icon ? d.dir(`/assets/img/${a.icon}`) : p,
src: o.icon ? d.dir(`/assets/img/${o.icon}`) : p,
draggable: !1
}
})]), t(P, {
})]), t("i-tooltip", {
attrs: {
content: a.tip,
disabled: !a.tip
content: o.tip,
disabled: !o.tip
}
}, [t("div", {
class: e.be("group-item", "text")
}, [a.pssysappfuncname])])]))])]))])]);
}, [o.pssysappfuncname])])]))])]))])]);
}
}), V = L({
}), H = k({
name: "FuncPortalListPortlet",
components: {
FuncDrawer: T
FuncDrawer: M
},
props: {
modelData: {
type: z,
type: F,
required: !0
},
controller: {
type: D,
type: y,
required: !0
}
},
setup(s) {
const n = k("func-portal-list-portlet"), e = d.dir("/assets/img/quick-entry.svg"), p = d.dir("/assets/img/editor.svg"), l = d.dir("/assets/img/placeholder.svg"), h = f([]), c = C();
const n = D("func-portal-list-portlet"), e = d.dir("/assets/img/quick-entry.svg"), p = d.dir("/assets/img/editor.svg"), l = d.dir("/assets/img/placeholder.svg"), h = f([]), c = L();
let i = null;
c && s.modelData.list && (i = O(c.proxy, s.modelData.list, s.controller.context), x(() => {
c && s.modelData.list && (i = T(c.proxy, s.modelData.list, s.controller.context), C(() => {
i == null || i.nerve.self.evt.on("mounted", async () => {
if (i) {
const g = await i.load();
......@@ -350,14 +349,14 @@ const T = L({
attrs: {
src: s.icon ? d.dir(`/assets/img/${s.icon}`) : this.placeholderImg
}
})]), t(P, {
})]), t("i-tooltip", {
attrs: {
content: s.tip,
disabled: !s.tip
}
}, [t("div", {
class: this.ns.be("item", "text")
}, [s.pssysappfuncname])])]))]), t(T, {
}, [s.pssysappfuncname])])]))]), t(M, {
attrs: {
isShowDrawer: this.isShowDrawer
},
......@@ -367,12 +366,12 @@ const T = L({
})]);
}
});
class W {
class K {
constructor() {
y(this, "component", V);
w(this, "component", H);
}
async createController(n, e, p) {
const l = new D(
const l = new y(
n,
e,
p
......@@ -380,31 +379,31 @@ class W {
return await l.init(), l;
}
}
const X = L({
const Q = k({
name: "TodoAppMenuPortlet",
props: {
modelData: {
type: U,
type: $,
required: !0
},
controller: {
type: E,
type: A,
required: !0
}
},
setup(s) {
const n = k("todo-app-menu-portlet"), e = Array.from({
const n = D("todo-app-menu-portlet"), e = Array.from({
length: 5
}).map((c, i) => d.dir(`/assets/img/todo-app-menu-${i}.svg`));
let p = null;
const l = f({});
if (s.modelData.appMenu) {
const i = s.modelData.appMenu.source.getPSAppCounterRef();
i && (x(async () => {
p = await H.getCounterByRef(i), p.onChange((m) => {
i && (C(async () => {
p = await B.getCounterByRef(i), p.onChange((m) => {
l.value = m;
});
}), B(() => {
}), N(() => {
p == null || p.destroy();
}));
}
......@@ -415,7 +414,7 @@ const X = L({
counterData: l,
onClickMenuItem: async (c) => {
const i = c.source.getPSAppFunc();
i && await ibiz.commands.execute(J.TAG, i, s.controller.context, s.controller.params);
i && await ibiz.commands.execute(j.TAG, i, s.controller.context, s.controller.params);
}
};
},
......@@ -443,7 +442,7 @@ const X = L({
class: this.ns.be("item-right", "count")
}, [t("span", {
class: [(this.counterData[n.counterId] || 0) > 99 ? this.ns.be("item-right", "add") : ""]
}, [(this.counterData[n.counterId] || 0) > 99 ? 99 : this.counterData[n.counterId] || 0]), t("span", ["件"])]), t(P, {
}, [(this.counterData[n.counterId] || 0) > 99 ? 99 : this.counterData[n.counterId] || 0]), t("span", ["件"])]), t("i-tooltip", {
attrs: {
content: n.source.tooltip,
disabled: !n.source.tooltip
......@@ -453,12 +452,12 @@ const X = L({
}, [n.label])])])]))]);
}
});
class Y {
class V {
constructor() {
y(this, "component", X);
w(this, "component", Q);
}
async createController(n, e, p) {
const l = new E(
const l = new A(
n,
e,
p
......@@ -466,21 +465,21 @@ class Y {
return await l.init(), l;
}
}
const it = {
const ot = {
mateUrl: import.meta.url,
install(s) {
d.loadStyle(["/style.css"]), ibiz.register.portletPart.register(
"PORTLET_CUSTOM_AppPortalList",
new Q()
new J()
), ibiz.register.portletPart.register(
"PORTLET_CUSTOM_FuncPortalList",
new W()
new K()
), ibiz.register.portletPart.register(
"PORTLET_CUSTOM_TodoAppMenu",
new Y()
new V()
);
}
};
export {
it as default
ot as default
};
!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,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}function a(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(T){l=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),s=new D(n||[]);return o(a,"_invoke",{value:L(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(T){return{type:"throw",arg:T}}}e.wrap=p;var d={};function h(){}function v(){}function m(){}var g={};l(g,s,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(O([])));b&&b!==r&&n.call(b,s)&&(g=b);var w=m.prototype=h.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(e,r){function i(o,a,s,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,p=l.value;return p&&"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){return i("throw",t,s,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,e){function n(){return new r((function(r,n){i(t,e,r,n)}))}return a=a?a.then(n,n):n()}})}function L(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return I()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=P(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=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)}}}function P(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,P(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function S(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 E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function O(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:I}}function I(){return{value:void 0,done:!0}}return v.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){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.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(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),l(w,u,"Generator"),l(w,s,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=O,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},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 e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.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)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),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function s(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){s(i,n,o,a,c,"next",t)}function c(t){s(i,n,o,a,c,"throw",t)}a(void 0)}))}}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";var i,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(){var E=new L(r.meta.url),D=d({name:"AppPortalListPortlet",props:{modelData:{type:u,required:!0},controller:{type:i,required:!0}},setup:function(t){var e=p("app-portal-list-portlet"),r=h([]),n=Array.from({length:3}).map((function(t,e){return E.dir("/assets/img/app-portal-list-".concat(e,".svg"))})),o=v();if(o&&t.modelData.list){var i=f(o.proxy,t.modelData.list,t.controller.context);m((function(){i.nerve.self.evt.on("mounted",c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.load();case 2:e=t.sent,r.value=e.slice(0,3);case 4:case"end":return t.stop()}}),t)}))))}))}return{ns:e,appPortalList:r,appPortalImgList:n,openPage:function(t){t&&window.open(t)}}},render:function(){var t=this;return g("div",{class:this.ns.b()},[this.appPortalList.map((function(e,r){return g("div",{class:[t.ns.b("item"),e.url?"":t.ns.bm("item","disabled")],key:e.srfkey,on:{click:function(){return t.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(){function t(){e(this,t),o(this,"component",D)}var r;return n(t,[{key:"createController",value:(r=c(a().mark((function t(e,r,n){var o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new i(e,r,n),t.next=3,o.init();case 3:return t.abrupt("return",o);case 4:case"end":return t.stop()}}),t)}))),function(t,e,n){return r.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){var r,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())||void 0===r?void 0: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){var e={};s.value=t.data.filter((function(t){if(t.ispersonal||(t.ispersonal=0),t.pssystemappid){var r=t.pssystemappname;e[r]?e[r].push(t):e[r]=[t]}else e["未分类"]?e["未分类"].push(t):e["未分类"]=[t];return t.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(){return t.isShowDrawer}),(function(t){t&&l()}));var d=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);else if("change"===n){var o=s.value.findIndex((function(t){return t.pssysappfuncid===e.pssysappfuncid}));-1===o?s.value.push(e):s.value.splice(o,1)}};return function(){return g("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(){return n("on-close")}}},["返回"])])]),g("main",{class:o.b("group-content")},[s.value.map((function(t,e){return g("div",{class:[o.b("group-item"),t.pssysappfuncid?"":o.bm("group-item","disabled")],key:t.pssysappfuncid,on:{click:function(){return d(t.pssysappfuncid)},dragstart:function(t){return function(t,e){var r;c.value&&(null===(r=t.dataTransfer)||void 0===r||r.setData("originIndex",e.toString()))}(t,e)},dragover:m,drop:function(t){return function(t,e){if(t.preventDefault(),c.value&&t.dataTransfer){var r=Number(t.dataTransfer.getData("originIndex"));if(r!==e){var n=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){return b(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){return g("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){return g("div",{class:[o.b("group-item"),t.pssysappfuncid?"":o.bm("group-item","disabled")],key:t.pssysappfuncid,on:{click:function(){return d(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){return b(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){var e=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(){var t;null===(t=u)||void 0===t||t.nerve.self.evt.on("mounted",c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u){t.next=5;break}return t.next=3,u.load();case 3:e=t.sent,i.value=e;case 5:case"end":return t.stop()}}),t)}))))})));var l=h(!1),d=function(){var t=c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l.value=!1,!u){t.next=6;break}return t.next=4,u.load();case 4:e=t.sent,i.value=e;case 6:case"end":return t.stop()}}),t)})));return function(){return t.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(){var t=this;return g("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){return g("div",{class:[t.ns.b("item"),e.pssysappfuncid?"":t.ns.bm("item","disabled")],key:e.pssysappfuncid,on:{click:function(){return t.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(){function t(){e(this,t),o(this,"component",T)}var r;return n(t,[{key:"createController",value:(r=c(a().mark((function t(e,r,n){var o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new i(e,r,n),t.next=3,o.init();case 3:return t.abrupt("return",o);case 4:case"end":return t.stop()}}),t)}))),function(t,e,n){return r.apply(this,arguments)})}]),t}(),_=d({name:"TodoAppMenuPortlet",props:{modelData:{type:l,required:!0},controller:{type:s,required:!0}},setup:function(t){var e=p("todo-app-menu-portlet"),r=Array.from({length:5}).map((function(t,e){return E.dir("/assets/img/todo-app-menu-".concat(e,".svg"))})),n=null,o=h({});if(t.modelData.appMenu){var i=t.modelData.appMenu.source.getPSAppCounterRef();i&&(m(c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.getCounterByRef(i);case 2:(n=t.sent).onChange((function(t){o.value=t}));case 4:case"end":return t.stop()}}),t)})))),b((function(){var t;null===(t=n)||void 0===t||t.destroy()})))}var s=function(){var e=c(a().mark((function e(r){var n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=r.source.getPSAppFunc())){e.next=4;break}return e.next=4,ibiz.commands.execute(P.TAG,n,t.controller.context,t.controller.params);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return{ns:e,todoImgList:r,counter:n,counterData:o,onClickMenuItem:s}},render:function(){var t,e=this;return g("div",{class:this.ns.b()},[null===(t=this.modelData.appMenu)||void 0===t?void 0:t.items.map((function(t,r){return g("div",{class:[e.ns.b("item"),t.source.getPSAppFunc()?"":e.ns.bm("item","disabled")],key:t.id,on:{click:function(){return e.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(){function t(){e(this,t),o(this,"component",_)}var r;return n(t,[{key:"createController",value:(r=c(a().mark((function t(e,r,n){var o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new s(e,r,n),t.next=3,o.init();case 3:return t.abrupt("return",o);case 4:case"end":return t.stop()}}),t)}))),function(t,e,n){return r.apply(this,arguments)})}]),t}();t("default",{mateUrl:r.meta.url,install:function(t){E.loadStyle(["/style.css"]),ibiz.register.portletPart.register("PORTLET_CUSTOM_AppPortalList",new O),ibiz.register.portletPart.register("PORTLET_CUSTOM_FuncPortalList",new C),ibiz.register.portletPart.register("PORTLET_CUSTOM_TodoAppMenu",new j)}})}}}))}();
!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,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}function a(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(T){l=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),s=new D(n||[]);return o(a,"_invoke",{value:L(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(T){return{type:"throw",arg:T}}}e.wrap=p;var d={};function h(){}function v(){}function m(){}var g={};l(g,s,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(O([])));b&&b!==r&&n.call(b,s)&&(g=b);var w=m.prototype=h.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(e,r){function i(o,a,s,c){var u=f(e[o],e,a);if("throw"!==u.type){var l=u.arg,p=l.value;return p&&"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){return i("throw",t,s,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,e){function n(){return new r((function(r,n){i(t,e,r,n)}))}return a=a?a.then(n,n):n()}})}function L(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return I()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=P(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=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)}}}function P(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,P(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function S(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 E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function O(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:I}}function I(){return{value:void 0,done:!0}}return v.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){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.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(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),l(w,u,"Generator"),l(w,s,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=O,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},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 e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.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)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),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}function s(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(u){return void r(u)}s.done?e(c):Promise.resolve(c).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){s(i,n,o,a,c,"next",t)}function c(t){s(i,n,o,a,c,"throw",t)}a(void 0)}))}}System.register(["@ibiz-template/controller","@ibiz-template/model","@ibiz-template/vue-util","vue","@ibiz-template/runtime","@ibiz-template/service"],(function(t,r){"use strict";var i,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(){var L=new w(r.meta.url),P=d({name:"AppPortalListPortlet",props:{modelData:{type:u,required:!0},controller:{type:i,required:!0}},setup:function(t){var e=p("app-portal-list-portlet"),r=h([]),n=Array.from({length:3}).map((function(t,e){return L.dir("/assets/img/app-portal-list-".concat(e,".svg"))})),o=v();if(o&&t.modelData.list){var i=f(o.proxy,t.modelData.list,t.controller.context);m((function(){i.nerve.self.evt.on("mounted",c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.load();case 2:e=t.sent,r.value=e.slice(0,3);case 4:case"end":return t.stop()}}),t)}))))}))}return{ns:e,appPortalList:r,appPortalImgList:n,openPage:function(t){t&&window.open(t)}}},render:function(){var t=this;return g("div",{class:this.ns.b()},[this.appPortalList.map((function(e,r){return g("div",{class:[t.ns.b("item"),e.url?"":t.ns.bm("item","disabled")],key:e.srfkey,on:{click:function(){return t.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(){function t(){e(this,t),o(this,"component",P)}var r;return n(t,[{key:"createController",value:(r=c(a().mark((function t(e,r,n){var o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new i(e,r,n),t.next=3,o.init();case 3:return t.abrupt("return",o);case 4:case"end":return t.stop()}}),t)}))),function(t,e,n){return r.apply(this,arguments)})}]),t}(),E=d({name:"FuncDrawer",props:{isShowDrawer:{type:Boolean,required:!0,default:!1}},emits:{"on-close":function(){return!0}},setup:function(t,e){var r,n=e.emit,o=p("func-drawer"),i=L.dir("/assets/img/placeholder.svg"),a=h([]),s=h([]),c=h(!1),u=null===(r=v())||void 0===r?void 0: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){var e={};s.value=t.data.filter((function(t){if(t.ispersonal||(t.ispersonal=0),t.pssystemappid){var r=t.pssystemappname;e[r]?e[r].push(t):e[r]=[t]}else e["未分类"]?e["未分类"].push(t):e["未分类"]=[t];return t.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(){return t.isShowDrawer}),(function(t){t&&l()}));var d=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);else if("change"===n){var o=s.value.findIndex((function(t){return t.pssysappfuncid===e.pssysappfuncid}));-1===o?s.value.push(e):s.value.splice(o,1)}};return function(){return g("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:f}},[c.value?"保存":"配置"]),g("i-button",{on:{click:function(){return n("on-close")}}},["返回"])])]),g("main",{class:o.b("group-content")},[s.value.map((function(t,e){return g("div",{class:[o.b("group-item"),t.pssysappfuncid?"":o.bm("group-item","disabled")],key:t.pssysappfuncid,on:{click:function(){return d(t.pssysappfuncid)},dragstart:function(t){return function(t,e){var r;c.value&&(null===(r=t.dataTransfer)||void 0===r||r.setData("originIndex",e.toString()))}(t,e)},dragover:m,drop:function(t){return function(t,e){if(t.preventDefault(),c.value&&t.dataTransfer){var r=Number(t.dataTransfer.getData("originIndex"));if(r!==e){var n=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){return b(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])])])}))])]),a.value.map((function(t,e){return g("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){return g("div",{class:[o.b("group-item"),t.pssysappfuncid?"":o.bm("group-item","disabled")],key:t.pssysappfuncid,on:{click:function(){return d(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){return b(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){var e=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(){var t;null===(t=u)||void 0===t||t.nerve.self.evt.on("mounted",c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u){t.next=5;break}return t.next=3,u.load();case 3:e=t.sent,i.value=e;case 5:case"end":return t.stop()}}),t)}))))})));var l=h(!1),d=function(){var t=c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l.value=!1,!u){t.next=6;break}return t.next=4,u.load();case 4:e=t.sent,i.value=e;case 6:case"end":return t.stop()}}),t)})));return function(){return t.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(){var t=this;return g("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){return g("div",{class:[t.ns.b("item"),e.pssysappfuncid?"":t.ns.bm("item","disabled")],key:e.pssysappfuncid,on:{click:function(){return t.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(){function t(){e(this,t),o(this,"component",D)}var r;return n(t,[{key:"createController",value:(r=c(a().mark((function t(e,r,n){var o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new i(e,r,n),t.next=3,o.init();case 3:return t.abrupt("return",o);case 4:case"end":return t.stop()}}),t)}))),function(t,e,n){return r.apply(this,arguments)})}]),t}(),I=d({name:"TodoAppMenuPortlet",props:{modelData:{type:l,required:!0},controller:{type:s,required:!0}},setup:function(t){var e=p("todo-app-menu-portlet"),r=Array.from({length:5}).map((function(t,e){return L.dir("/assets/img/todo-app-menu-".concat(e,".svg"))})),n=null,o=h({});if(t.modelData.appMenu){var i=t.modelData.appMenu.source.getPSAppCounterRef();i&&(m(c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k.getCounterByRef(i);case 2:(n=t.sent).onChange((function(t){o.value=t}));case 4:case"end":return t.stop()}}),t)})))),b((function(){var t;null===(t=n)||void 0===t||t.destroy()})))}var s=function(){var e=c(a().mark((function e(r){var n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=r.source.getPSAppFunc())){e.next=4;break}return e.next=4,ibiz.commands.execute(x.TAG,n,t.controller.context,t.controller.params);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return{ns:e,todoImgList:r,counter:n,counterData:o,onClickMenuItem:s}},render:function(){var t,e=this;return g("div",{class:this.ns.b()},[null===(t=this.modelData.appMenu)||void 0===t?void 0:t.items.map((function(t,r){return g("div",{class:[e.ns.b("item"),t.source.getPSAppFunc()?"":e.ns.bm("item","disabled")],key:t.id,on:{click:function(){return e.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])])])])}))])}}),T=function(){function t(){e(this,t),o(this,"component",I)}var r;return n(t,[{key:"createController",value:(r=c(a().mark((function t(e,r,n){var o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=new s(e,r,n),t.next=3,o.init();case 3:return t.abrupt("return",o);case 4:case"end":return t.stop()}}),t)}))),function(t,e,n){return r.apply(this,arguments)})}]),t}();t("default",{mateUrl:r.meta.url,install:function(t){L.loadStyle(["/style.css"]),ibiz.register.portletPart.register("PORTLET_CUSTOM_AppPortalList",new S),ibiz.register.portletPart.register("PORTLET_CUSTOM_FuncPortalList",new O),ibiz.register.portletPart.register("PORTLET_CUSTOM_TodoAppMenu",new T)}})}}}))}();
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册