提交 0bd9e300 编写于 作者: zhf's avatar zhf

feat: 更新公文效能插件

上级 4fa56c24
......@@ -3,10 +3,10 @@ var M = (e, s, t) => s in e ? A(e, s, { enumerable: !0, configurable: !0, writab
var l = (e, s, t) => (M(e, typeof s != "symbol" ? s + "" : s, t), t);
import { PluginStaticResource as j, ViewMode as D } from "@ibiz-template/runtime";
import { CustomPortletController as B, ViewPortletController as N, SpanEditorController as R, AppPortalViewNerve as F, AppPortalViewController as G } from "@ibiz-template/controller";
import m from "dayjs";
import p from "dayjs";
import { PortletPartModel as q, ListModel as E, ViewPortletModel as Y } from "@ibiz-template/model";
import { defineComponent as w, reactive as z, watch as k, h as a, getCurrentInstance as C, ref as P, computed as _ } from "vue";
import { useNamespace as p, useTabExpViewController as U, useRouter as $, useRoute as V, getViewName as K, getSpanProps as W, useListController as L, useViewController as H } from "@ibiz-template/vue-util";
import { defineComponent as w, reactive as z, watch as k, h as a, getCurrentInstance as C, ref as f, computed as _ } from "vue";
import { useNamespace as h, useTabExpViewController as $, useRouter as U, useRoute as V, getViewName as K, getSpanProps as W, useListController as L, useViewController as H } from "@ibiz-template/vue-util";
const J = new j(import.meta.url);
class Q {
constructor() {
......@@ -35,7 +35,7 @@ class O extends B {
itemValue: 12
});
l(this, "onItemValueChange", (t) => {
const r = m();
const r = p();
this.data.selectDate = [
r.subtract(t, "month").add(1, "day").toDate(),
r.toDate()
......@@ -48,7 +48,7 @@ class O extends B {
changeViewParams() {
const [t, r] = this.data.selectDate;
if (t && r) {
const o = m(t).format("YYYY-MM-DD"), i = m(r).format("YYYY-MM-DD");
const o = p(t).format("YYYY-MM-DD"), i = p(r).format("YYYY-MM-DD");
this.dashboard.nerve.self.evt.asyncEmit(
"contextOrParamsChange",
{ ...this.context },
......@@ -181,32 +181,32 @@ const ot = w({
}
},
setup(e) {
const s = p("portal-date-picker"), t = e.controller;
const s = h("portal-date-picker"), t = e.controller;
Object.assign(t, {
data: z(t.data)
});
const r = m("2017-01-01"), o = m(), i = {
disabledDate: (d) => {
const u = m(d);
return u.isBefore(r, "day") || o.isBefore(u, "day");
const r = p("2017-01-01"), o = p(), i = {
disabledDate: (c) => {
const d = p(c);
return d.isBefore(r, "day") || o.isBefore(d, "day");
}
}, c = (d) => {
if (Array.isArray(d) && d.length === 2) {
const [u, h] = d.map((x) => m(x));
if (u.clone().add(1, "year").subtract(1, "day").isBefore(h, "day")) {
}, u = (c) => {
if (Array.isArray(c) && c.length === 2) {
const [d, m] = c.map((x) => p(x));
if (d.clone().add(1, "year").subtract(1, "day").isBefore(m, "day")) {
t.data.selectDate = [...t.data.selectDate], ibiz.message.error("统计期间不能超过一年");
return;
}
t.data.selectDate = [u.toDate(), h.toDate()], t.data.itemValue = 0;
t.data.selectDate = [d.toDate(), m.toDate()], t.data.itemValue = 0;
}
};
return k(() => t.data.selectDate, (d, u) => {
const [h, y] = d.map((n) => m(n).format("YYYY-MM-DD")), [x, S] = u.map((n) => m(n).format("YYYY-MM-DD"));
h === x && y === S || t.changeViewParams();
return k(() => t.data.selectDate, (c, d) => {
const [m, y] = c.map((n) => p(n).format("YYYY-MM-DD")), [x, S] = d.map((n) => p(n).format("YYYY-MM-DD"));
m === x && y === S || t.changeViewParams();
}), {
ns: s,
options: i,
onSelectDateChange: c
onSelectDateChange: u
};
},
render() {
......@@ -280,13 +280,13 @@ const it = w({
setup(e) {
const {
proxy: s
} = C(), t = p("custom-tab-exp-view"), r = p("view"), o = U(s, e.modelPath), i = P([]), c = P(""), d = P(!1), u = $(s), h = {}, y = async (n) => {
const f = V(s).fullPath;
h[c.value] = f;
} = C(), t = h("custom-tab-exp-view"), r = h("view"), o = $(s, e.modelPath), i = f([]), u = f(""), c = f(!1), d = U(s), m = {}, y = async (n) => {
const P = V(s).fullPath;
m[u.value] = P;
const b = o.model.tabExpPanel.tabExpPages.find((v) => v.name === n);
if ((b == null ? void 0 : b.embedView.initialized) === !1 && await b.embedView.init(), o.context.isRouter) {
if (d.value = !0, h[n])
u.push(h[n]);
if (c.value = !0, m[n])
d.push(m[n]);
else {
const v = Object.assign(o.context.clone(), {
toRouteLevel: o.modal.level + 1
......@@ -294,25 +294,25 @@ const it = w({
ibiz.openView.root(b.embedView.source, v, o.params);
}
setTimeout(() => {
d.value = !1, c.value = n;
c.value = !1, u.value = n;
}, 0);
} else
i.value.includes(n) || (i.value.push(n), c.value = n);
i.value.includes(n) || (i.value.push(n), u.value = n);
};
o.nerve.self.evt.on("created", () => {
const n = V(s), {
tabExpPages: g
} = o.model.tabExpPanel;
if (o.context.isRouter) {
const f = e.modal.level + 1, b = n.params[`view${f}`];
const P = e.modal.level + 1, b = n.params[`view${P}`];
if (b) {
const v = g.find((I) => K(I.embedView.source) === b);
v && (c.value = v.name);
v && (u.value = v.name);
}
}
if (g.length && !c.value) {
const f = g[0].name;
y(f);
if (g.length && !u.value) {
const P = g[0].name;
y(P);
}
});
const x = _(() => Object.values(o.tabExpPages).map((n) => n.key)), S = {
......@@ -324,8 +324,8 @@ const it = w({
ns2: r,
onTabClick: y,
lazyList: i,
deactivateAll: d,
activeTab: c,
deactivateAll: c,
activeTab: u,
keyHistory: x,
embedViewModal: S
};
......@@ -435,7 +435,7 @@ const it = w({
props: W(),
setup() {
return {
ns: p("growth-rate-span")
ns: h("growth-rate-span")
};
},
render() {
......@@ -506,14 +506,14 @@ const lt = w({
setup(e) {
const {
proxy: s
} = C(), t = p("bwsd-custom-list"), r = L(s, e.modelData, e.context, e.params);
} = C(), t = h("bwsd-custom-list"), r = L(s, e.modelData, e.context, e.params);
r.size = r.model.size;
let o = "";
const {
defaultSortField: i,
defaultSortDir: c
defaultSortDir: u
} = r.model;
return i && c && (o = `${i},${c}`), r.nerve.self.evt.on("beforeLoad", () => !r.model.source.noSort && o ? {
return i && u && (o = `${i},${u}`), r.nerve.self.evt.on("beforeLoad", () => !r.model.source.noSort && o ? {
sort: o
} : {}), {
c: r,
......@@ -553,17 +553,26 @@ const ct = w({
}
},
setup(e) {
const s = p("view-portlet"), t = (o) => {
e.controller.setViewNeuron(o);
const s = h("view-portlet"), t = (i) => {
e.controller.setViewNeuron(i);
};
Object.assign(e.controller, {
result: z(e.controller.result)
});
const r = p("fwzl-portal");
const r = h("fwzl-portal");
return {
ns: s,
ns2: r,
onNeuronInit: t
onNeuronInit: t,
format: (i) => {
if (i == null)
return "";
try {
return ibiz.util.text.format(`${i}`, "#,##0.##");
} catch (u) {
return ibiz.log.error(`${i} 值格式化错误`), `${i}`;
}
}
};
},
render() {
......@@ -573,7 +582,7 @@ const ct = w({
class: this.ns2.e("text")
}, ["总计退文"]), a("div", {
class: this.ns2.e("value")
}, [e.result.data.ztws || 0]), a("div", {
}, [this.format(e.result.data.ztws || 0)]), a("div", {
class: this.ns2.e("text")
}, ["件"]), a("div", {
class: this.ns2.e("rate")
......@@ -662,11 +671,20 @@ const dt = w({
var c;
const {
proxy: s
} = C(), t = L(s, e.modelData, e.context, e.params), r = p("fwzl-custom-list"), o = P([]), i = (c = t.model.source.getPSControlParam()) == null ? void 0 : c.ctrlParams;
} = C(), t = L(s, e.modelData, e.context, e.params), r = h("fwzl-custom-list"), o = f([]), i = (c = t.model.source.getPSControlParam()) == null ? void 0 : c.ctrlParams;
return i && i.COLOR && (o.value = JSON.parse(i.COLOR)), {
c: t,
ns: r,
colorList: o
colorList: o,
format: (d) => {
if (d == null)
return "";
try {
return ibiz.util.text.format(`${d}`, "#,##0.##");
} catch (m) {
return ibiz.log.error(`${d} 值格式化错误`), `${d}`;
}
}
};
},
render() {
......@@ -693,7 +711,7 @@ const dt = w({
class: this.ns.b("item")
}, [s.value != null && a("div", {
class: this.ns.be("item", "value")
}, [s.value])]))]), a("div", {
}, [this.format(s.value)])]))]), a("div", {
class: this.ns.b("item-percentage")
}, [this.c.items.map((s) => a("div", {
class: this.ns.b("item")
......@@ -704,8 +722,8 @@ const dt = w({
}, [this.c.items.map((s) => a("div", {
class: this.ns.b("item")
}, [a("div", {
class: this.ns.be("item", "rate")
}, [a("rate-span", {
class: [this.ns.be("item", "rate"), s.rate === "--" && this.ns.bem("item", "rate", "empty")]
}, [s.rate === "--" ? s.rate : a("rate-span", {
attrs: {
value: s.rate
}
......@@ -727,7 +745,7 @@ const ut = w({
}
},
setup(e) {
const s = p("rate-span"), t = P(""), r = P();
const s = h("rate-span"), t = f(""), r = f();
return k(() => e.value, (o) => {
if (!o || !parseInt(o, 10)) {
t.value = "";
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册