提交 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 ...@@ -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); 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 { 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 { 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 { 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 { 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 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 { 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); const J = new j(import.meta.url);
class Q { class Q {
constructor() { constructor() {
...@@ -35,7 +35,7 @@ class O extends B { ...@@ -35,7 +35,7 @@ class O extends B {
itemValue: 12 itemValue: 12
}); });
l(this, "onItemValueChange", (t) => { l(this, "onItemValueChange", (t) => {
const r = m(); const r = p();
this.data.selectDate = [ this.data.selectDate = [
r.subtract(t, "month").add(1, "day").toDate(), r.subtract(t, "month").add(1, "day").toDate(),
r.toDate() r.toDate()
...@@ -48,7 +48,7 @@ class O extends B { ...@@ -48,7 +48,7 @@ class O extends B {
changeViewParams() { changeViewParams() {
const [t, r] = this.data.selectDate; const [t, r] = this.data.selectDate;
if (t && r) { 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( this.dashboard.nerve.self.evt.asyncEmit(
"contextOrParamsChange", "contextOrParamsChange",
{ ...this.context }, { ...this.context },
...@@ -181,32 +181,32 @@ const ot = w({ ...@@ -181,32 +181,32 @@ const ot = w({
} }
}, },
setup(e) { setup(e) {
const s = p("portal-date-picker"), t = e.controller; const s = h("portal-date-picker"), t = e.controller;
Object.assign(t, { Object.assign(t, {
data: z(t.data) data: z(t.data)
}); });
const r = m("2017-01-01"), o = m(), i = { const r = p("2017-01-01"), o = p(), i = {
disabledDate: (d) => { disabledDate: (c) => {
const u = m(d); const d = p(c);
return u.isBefore(r, "day") || o.isBefore(u, "day"); return d.isBefore(r, "day") || o.isBefore(d, "day");
} }
}, c = (d) => { }, u = (c) => {
if (Array.isArray(d) && d.length === 2) { if (Array.isArray(c) && c.length === 2) {
const [u, h] = d.map((x) => m(x)); const [d, m] = c.map((x) => p(x));
if (u.clone().add(1, "year").subtract(1, "day").isBefore(h, "day")) { if (d.clone().add(1, "year").subtract(1, "day").isBefore(m, "day")) {
t.data.selectDate = [...t.data.selectDate], ibiz.message.error("统计期间不能超过一年"); t.data.selectDate = [...t.data.selectDate], ibiz.message.error("统计期间不能超过一年");
return; 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) => { return k(() => t.data.selectDate, (c, d) => {
const [h, y] = d.map((n) => m(n).format("YYYY-MM-DD")), [x, S] = u.map((n) => m(n).format("YYYY-MM-DD")); const [m, y] = c.map((n) => p(n).format("YYYY-MM-DD")), [x, S] = d.map((n) => p(n).format("YYYY-MM-DD"));
h === x && y === S || t.changeViewParams(); m === x && y === S || t.changeViewParams();
}), { }), {
ns: s, ns: s,
options: i, options: i,
onSelectDateChange: c onSelectDateChange: u
}; };
}, },
render() { render() {
...@@ -280,13 +280,13 @@ const it = w({ ...@@ -280,13 +280,13 @@ const it = w({
setup(e) { setup(e) {
const { const {
proxy: s 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) => { } = 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 f = V(s).fullPath; const P = V(s).fullPath;
h[c.value] = f; m[u.value] = P;
const b = o.model.tabExpPanel.tabExpPages.find((v) => v.name === n); 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 ((b == null ? void 0 : b.embedView.initialized) === !1 && await b.embedView.init(), o.context.isRouter) {
if (d.value = !0, h[n]) if (c.value = !0, m[n])
u.push(h[n]); d.push(m[n]);
else { else {
const v = Object.assign(o.context.clone(), { const v = Object.assign(o.context.clone(), {
toRouteLevel: o.modal.level + 1 toRouteLevel: o.modal.level + 1
...@@ -294,25 +294,25 @@ const it = w({ ...@@ -294,25 +294,25 @@ const it = w({
ibiz.openView.root(b.embedView.source, v, o.params); ibiz.openView.root(b.embedView.source, v, o.params);
} }
setTimeout(() => { setTimeout(() => {
d.value = !1, c.value = n; c.value = !1, u.value = n;
}, 0); }, 0);
} else } 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", () => { o.nerve.self.evt.on("created", () => {
const n = V(s), { const n = V(s), {
tabExpPages: g tabExpPages: g
} = o.model.tabExpPanel; } = o.model.tabExpPanel;
if (o.context.isRouter) { 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) { if (b) {
const v = g.find((I) => K(I.embedView.source) === 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) { if (g.length && !u.value) {
const f = g[0].name; const P = g[0].name;
y(f); y(P);
} }
}); });
const x = _(() => Object.values(o.tabExpPages).map((n) => n.key)), S = { const x = _(() => Object.values(o.tabExpPages).map((n) => n.key)), S = {
...@@ -324,8 +324,8 @@ const it = w({ ...@@ -324,8 +324,8 @@ const it = w({
ns2: r, ns2: r,
onTabClick: y, onTabClick: y,
lazyList: i, lazyList: i,
deactivateAll: d, deactivateAll: c,
activeTab: c, activeTab: u,
keyHistory: x, keyHistory: x,
embedViewModal: S embedViewModal: S
}; };
...@@ -435,7 +435,7 @@ const it = w({ ...@@ -435,7 +435,7 @@ const it = w({
props: W(), props: W(),
setup() { setup() {
return { return {
ns: p("growth-rate-span") ns: h("growth-rate-span")
}; };
}, },
render() { render() {
...@@ -506,14 +506,14 @@ const lt = w({ ...@@ -506,14 +506,14 @@ const lt = w({
setup(e) { setup(e) {
const { const {
proxy: s 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; r.size = r.model.size;
let o = ""; let o = "";
const { const {
defaultSortField: i, defaultSortField: i,
defaultSortDir: c defaultSortDir: u
} = r.model; } = 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 sort: o
} : {}), { } : {}), {
c: r, c: r,
...@@ -553,17 +553,26 @@ const ct = w({ ...@@ -553,17 +553,26 @@ const ct = w({
} }
}, },
setup(e) { setup(e) {
const s = p("view-portlet"), t = (o) => { const s = h("view-portlet"), t = (i) => {
e.controller.setViewNeuron(o); e.controller.setViewNeuron(i);
}; };
Object.assign(e.controller, { Object.assign(e.controller, {
result: z(e.controller.result) result: z(e.controller.result)
}); });
const r = p("fwzl-portal"); const r = h("fwzl-portal");
return { return {
ns: s, ns: s,
ns2: r, 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() { render() {
...@@ -573,7 +582,7 @@ const ct = w({ ...@@ -573,7 +582,7 @@ const ct = w({
class: this.ns2.e("text") class: this.ns2.e("text")
}, ["总计退文"]), a("div", { }, ["总计退文"]), a("div", {
class: this.ns2.e("value") 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") class: this.ns2.e("text")
}, ["件"]), a("div", { }, ["件"]), a("div", {
class: this.ns2.e("rate") class: this.ns2.e("rate")
...@@ -662,11 +671,20 @@ const dt = w({ ...@@ -662,11 +671,20 @@ const dt = w({
var c; var c;
const { const {
proxy: s 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)), { return i && i.COLOR && (o.value = JSON.parse(i.COLOR)), {
c: t, c: t,
ns: r, 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() { render() {
...@@ -693,7 +711,7 @@ const dt = w({ ...@@ -693,7 +711,7 @@ const dt = w({
class: this.ns.b("item") class: this.ns.b("item")
}, [s.value != null && a("div", { }, [s.value != null && a("div", {
class: this.ns.be("item", "value") class: this.ns.be("item", "value")
}, [s.value])]))]), a("div", { }, [this.format(s.value)])]))]), a("div", {
class: this.ns.b("item-percentage") class: this.ns.b("item-percentage")
}, [this.c.items.map((s) => a("div", { }, [this.c.items.map((s) => a("div", {
class: this.ns.b("item") class: this.ns.b("item")
...@@ -704,8 +722,8 @@ const dt = w({ ...@@ -704,8 +722,8 @@ const dt = w({
}, [this.c.items.map((s) => a("div", { }, [this.c.items.map((s) => a("div", {
class: this.ns.b("item") class: this.ns.b("item")
}, [a("div", { }, [a("div", {
class: this.ns.be("item", "rate") class: [this.ns.be("item", "rate"), s.rate === "--" && this.ns.bem("item", "rate", "empty")]
}, [a("rate-span", { }, [s.rate === "--" ? s.rate : a("rate-span", {
attrs: { attrs: {
value: s.rate value: s.rate
} }
...@@ -727,7 +745,7 @@ const ut = w({ ...@@ -727,7 +745,7 @@ const ut = w({
} }
}, },
setup(e) { 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) => { return k(() => e.value, (o) => {
if (!o || !parseInt(o, 10)) { if (!o || !parseInt(o, 10)) {
t.value = ""; t.value = "";
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册