提交 a84e2b0f 编写于 作者: jlj05024111@163.com's avatar jlj05024111@163.com

feat: 更新dsf-web插件包

上级 c40ac78f
var de = Object.defineProperty; var de = Object.defineProperty;
var ue = (s, t, a) => t in s ? de(s, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : s[t] = a; var ue = (s, e, t) => e in s ? de(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
var E = (s, t, a) => (ue(s, typeof t != "symbol" ? t + "" : t, a), a); var C = (s, e, t) => (ue(s, typeof e != "symbol" ? e + "" : e, t), t);
import { EditFormModel as me, FormMDCtrlModel as pe, DefectModelError as he, AppEntityModel as H } from "@ibiz-template/model"; import { EditFormModel as me, FormMDCtrlModel as pe, DefectModelError as he, AppEntityModel as H } from "@ibiz-template/model";
import { useNamespace as B, useControlController as fe, usePropsWatch as ve, getDatePickerProps as ye, getEditorEmits as G, useController as ge, getDataPickerProps as se, useViewController as we } from "@ibiz-template/vue-util"; import { useNamespace as B, useControlController as fe, usePropsWatch as ve, getDatePickerProps as ye, getEditorEmits as G, useController as ge, getDataPickerProps as se, useViewController as we } from "@ibiz-template/vue-util";
import { defineComponent as M, getCurrentInstance as W, ref as C, watch as V, h as r, onMounted as De, computed as j } from "vue"; import { defineComponent as M, getCurrentInstance as W, ref as b, watch as V, h as r, onMounted as De, computed as j } from "vue";
import { createUUID as te } from "qx-util"; import { createUUID as te } from "qx-util";
import { ViewMode as ae, PluginStaticResource as Ee, OpenAppViewCommand as q, UIActionHandler as Ce, FrontUIActionHandler as re } from "@ibiz-template/runtime"; import { ViewMode as ae, PluginStaticResource as Ee, OpenAppViewCommand as q, UIActionHandler as Ce, FrontUIActionHandler as re } from "@ibiz-template/runtime";
import { EditFormController as be, FormMDCtrlController as Pe, FormDRUIPartController as Ae, EditViewController as Ie, DatePickerEditorController as Fe, UploadEditorController as Se, PickerEditorController as oe } from "@ibiz-template/controller"; import { EditFormController as be, FormMDCtrlController as Pe, FormDRUIPartController as Ae, EditViewController as Fe, DatePickerEditorController as Ie, UploadEditorController as Se, PickerEditorController as oe } from "@ibiz-template/controller";
import { ControlVO as ke, calcResPath as K } from "@ibiz-template/service"; import { ControlVO as xe, calcResPath as K } from "@ibiz-template/service";
import $ from "dayjs"; import $ from "dayjs";
import { RuntimeError as xe, StringUtil as ne } from "@ibiz-template/core"; import { RuntimeError as ke, StringUtil as ne } from "@ibiz-template/core";
class Ne extends be { class Ne extends be {
constructor() { constructor() {
super(...arguments); super(...arguments);
...@@ -20,7 +20,7 @@ class Ne extends be { ...@@ -20,7 +20,7 @@ class Ne extends be {
* @date 2024-04-26 17:04:49 * @date 2024-04-26 17:04:49
* @type {IData} * @type {IData}
*/ */
E(this, "baseResData", []); C(this, "baseResData", []);
/** /**
* 对比数据 * 对比数据
* *
...@@ -28,7 +28,7 @@ class Ne extends be { ...@@ -28,7 +28,7 @@ class Ne extends be {
* @date 2024-04-26 17:04:49 * @date 2024-04-26 17:04:49
* @type {IData} * @type {IData}
*/ */
E(this, "compareResData", []); C(this, "compareResData", []);
/** /**
* 表单旧数据 * 表单旧数据
* *
...@@ -38,7 +38,7 @@ class Ne extends be { ...@@ -38,7 +38,7 @@ class Ne extends be {
* @type {IData} * @type {IData}
* @memberof FormController * @memberof FormController
*/ */
E(this, "oldData", new ke()); C(this, "oldData", new xe());
/** /**
* version数据 * version数据
* *
...@@ -46,7 +46,7 @@ class Ne extends be { ...@@ -46,7 +46,7 @@ class Ne extends be {
* @date 2024-04-26 16:04:37 * @date 2024-04-26 16:04:37
* @type {IData[]} * @type {IData[]}
*/ */
E(this, "versionData", []); C(this, "versionData", []);
/** /**
* 对比数据 * 对比数据
* *
...@@ -54,7 +54,7 @@ class Ne extends be { ...@@ -54,7 +54,7 @@ class Ne extends be {
* @date 2024-04-26 16:04:37 * @date 2024-04-26 16:04:37
* @type {IData[]} * @type {IData[]}
*/ */
E(this, "comparisonArr", {}); C(this, "comparisonArr", {});
/** /**
* 基础表格数据 * 基础表格数据
* *
...@@ -62,7 +62,7 @@ class Ne extends be { ...@@ -62,7 +62,7 @@ class Ne extends be {
* @date 2024-05-06 11:05:57 * @date 2024-05-06 11:05:57
* @type {IData[]} * @type {IData[]}
*/ */
E(this, "gridData", []); C(this, "gridData", []);
/** /**
* 展示完全数据 * 展示完全数据
* *
...@@ -70,7 +70,7 @@ class Ne extends be { ...@@ -70,7 +70,7 @@ class Ne extends be {
* @date 2024-05-06 11:05:04 * @date 2024-05-06 11:05:04
* @type {IData[]} * @type {IData[]}
*/ */
E(this, "AllGridData", []); C(this, "AllGridData", []);
/** /**
* 去除相同数据 * 去除相同数据
* *
...@@ -78,7 +78,7 @@ class Ne extends be { ...@@ -78,7 +78,7 @@ class Ne extends be {
* @date 2024-05-06 11:05:15 * @date 2024-05-06 11:05:15
* @type {IData[]} * @type {IData[]}
*/ */
E(this, "removeSameGridData", []); C(this, "removeSameGridData", []);
/** /**
* 关系界面数据 * 关系界面数据
* *
...@@ -86,7 +86,7 @@ class Ne extends be { ...@@ -86,7 +86,7 @@ class Ne extends be {
* @date 2024-04-30 10:04:33 * @date 2024-04-30 10:04:33
* @type {IData} * @type {IData}
*/ */
E(this, "AlldruipartData", /* @__PURE__ */ new Map()); C(this, "AlldruipartData", /* @__PURE__ */ new Map());
/** /**
* 关系界面数据长度 * 关系界面数据长度
* *
...@@ -94,7 +94,7 @@ class Ne extends be { ...@@ -94,7 +94,7 @@ class Ne extends be {
* @date 2024-05-06 11:05:56 * @date 2024-05-06 11:05:56
* @type {number} * @type {number}
*/ */
E(this, "druipartDataSize", 0); C(this, "druipartDataSize", 0);
/** /**
* 关系界面实际数据 * 关系界面实际数据
* *
...@@ -102,7 +102,7 @@ class Ne extends be { ...@@ -102,7 +102,7 @@ class Ne extends be {
* @date 2024-05-06 11:05:13 * @date 2024-05-06 11:05:13
* @type {IData} * @type {IData}
*/ */
E(this, "newDruipartData", {}); C(this, "newDruipartData", {});
} }
/** /**
* 加载数据 * 加载数据
...@@ -112,11 +112,11 @@ class Ne extends be { ...@@ -112,11 +112,11 @@ class Ne extends be {
*/ */
async loadGridData() { async loadGridData() {
await this.startLoading(); await this.startLoading();
const a = this.model.source.M.getPSControlParam.ctrlParams, { BASEENTITY: e, COMPAREENTITY: i } = a, n = await ibiz.entityService.getService(e), c = await ibiz.entityService.getService(i), v = Object.assign({}, this.context.clone(), { const t = this.model.source.M.getPSControlParam.ctrlParams, { BASEENTITY: a, COMPAREENTITY: c } = t, n = await ibiz.entityService.getService(a), d = await ibiz.entityService.getService(c), v = Object.assign({}, this.context.clone(), {
[e.toLowerCase()]: this.params.base_version [a.toLowerCase()]: this.params.base_version
}), p = Object.assign({}, this.context.clone(), { }), p = Object.assign({}, this.context.clone(), {
[i.toLowerCase()]: this.params.compare_version [c.toLowerCase()]: this.params.compare_version
}), h = await n.exec("Get", v, this.params), g = await c.exec( }), h = await n.exec("Get", v, this.params), g = await d.exec(
"Get", "Get",
p, p,
this.params this.params
...@@ -133,8 +133,8 @@ class Ne extends be { ...@@ -133,8 +133,8 @@ class Ne extends be {
* @return {*} * @return {*}
* @memberof FormDataComparisonController * @memberof FormDataComparisonController
*/ */
isFalseyButNotEmpty(a) { isFalseyButNotEmpty(t) {
return a == null || typeof a == "string" && a === "" || Array.isArray(a) && a.length === 0 || typeof a == "object" && Object.keys(a).length === 0; return t == null || typeof t == "string" && t === "" || Array.isArray(t) && t.length === 0 || typeof t == "object" && Object.keys(t).length === 0;
} }
/** /**
* 比较两个值 * 比较两个值
...@@ -144,8 +144,8 @@ class Ne extends be { ...@@ -144,8 +144,8 @@ class Ne extends be {
* @return {*} * @return {*}
* @memberof FormDataComparisonController * @memberof FormDataComparisonController
*/ */
compareObjectValues(a, e) { compareObjectValues(t, a) {
return JSON.stringify(a) !== JSON.stringify(e); return JSON.stringify(t) !== JSON.stringify(a);
} }
} }
const Oe = M({ const Oe = M({
...@@ -169,73 +169,73 @@ const Oe = M({ ...@@ -169,73 +169,73 @@ const Oe = M({
} }
}, },
setup(s) { setup(s) {
const t = B("form-data-comparison"), { const e = B("form-data-comparison"), {
proxy: a proxy: t
} = W(), e = fe(a, () => { } = W(), a = fe(t, () => {
const o = new Ne(s.modelData, s.context, s.params); const o = new Ne(s.modelData, s.context, s.params);
return ve(a, "enableAutoSave", o.setEnableAutoSave.bind(o)), o; return ve(t, "enableAutoSave", o.setEnableAutoSave.bind(o)), o;
}), i = C(!0), n = C(!1), c = C({}), v = C({}), p = C([]), h = [], g = C([]), l = C([]), y = C([]), f = /* @__PURE__ */ new Map(), u = C(0), m = (o) => { }), c = b(!0), n = b(!1), d = b({}), v = b({}), p = b([]), h = [], g = b([]), i = b([]), y = b([]), f = /* @__PURE__ */ new Map(), u = b(0), l = (o) => {
const d = []; const m = [];
if (d.push(o), o && o.children) { if (m.push(o), o && o.children) {
const A = []; const A = [];
o.children.forEach((I) => { o.children.forEach((F) => {
const O = m(I); const O = l(F);
A.push(...O); A.push(...O);
}), d.push(...A); }), m.push(...A);
} }
return d; return m;
}, D = m(s.modelData); }, w = l(s.modelData);
h.push(...D); h.push(...w);
const P = (o) => { const E = (o) => {
const d = e.details[o.source.name], A = r("not-supported-editor", { const m = a.details[o.source.name], A = r("not-supported-editor", {
attrs: { attrs: {
modelData: o.editor modelData: o.editor
} }
}); });
return r("div", { return r("div", {
class: [t.e("form-grid-item"), t.is("add", g.value.includes(o.source.name)), t.is("update", y.value.includes(o.source.name)), t.is("delete", l.value.includes(o.source.name))] class: [e.e("form-grid-item"), e.is("add", g.value.includes(o.source.name)), e.is("update", y.value.includes(o.source.name)), e.is("delete", i.value.includes(o.source.name))]
}, [r("div", { }, [r("div", {
class: t.em("form-grid-item", "name") class: e.em("form-grid-item", "name")
}, [o.source.caption]), r("div", { }, [o.source.caption]), r("div", {
class: t.em("form-grid-item", "left") class: e.em("form-grid-item", "left")
}, [d.editorProvider ? r(d.editorProvider.formEditor, { }, [m.editorProvider ? r(m.editorProvider.formEditor, {
props: { props: {
value: v.value[o.source.name], value: v.value[o.source.name],
data: d.data, data: m.data,
controller: d.editor, controller: m.editor,
disabled: d.disabled, disabled: m.disabled,
readonly: !0 readonly: !0
} }
}) : A]), r("div", { }) : A]), r("div", {
class: t.em("form-grid-item", "right") class: e.em("form-grid-item", "right")
}, [d.editorProvider ? r(d.editorProvider.formEditor, { }, [m.editorProvider ? r(m.editorProvider.formEditor, {
props: { props: {
value: c.value[o.source.name], value: d.value[o.source.name],
data: d.data, data: m.data,
controller: d.editor, controller: m.editor,
disabled: d.disabled, disabled: m.disabled,
readonly: !0 readonly: !0
} }
}) : A])]); }) : A])]);
}, k = (o, d) => { }, I = (o, m) => {
f.set(o.source.id, d), d.evt.on("mounted", () => { f.set(o.source.id, m), m.evt.on("mounted", () => {
i.value && e.startLoading(), u.value += 1, d.call.refresh(); c.value && a.startLoading(), u.value += 1, m.call.refresh();
}), d.evt.on("refreshed", () => { }), m.evt.on("refreshed", () => {
u.value -= 1, setTimeout(() => { u.value -= 1, setTimeout(() => {
i.value && e.endLoading(); c.value && a.endLoading();
}, 500); }, 500);
}); });
}, w = (o) => { }, D = (o) => {
const d = h.find((L) => L.id === `${o.source.id}_srfcopy`), A = o.embedView.source.modelPath, I = d == null ? void 0 : d.embedView.source.modelPath, O = e.context.clone(), N = { const m = h.find((L) => L.id === `${o.source.id}_srfcopy`), A = o.embedView.source.modelPath, F = m == null ? void 0 : m.embedView.source.modelPath, O = a.context.clone(), N = {
base_version: s.params.base_version base_version: s.params.base_version
}, T = e.context.clone(); }, T = a.context.clone();
Object.assign(T, { Object.assign(T, {
gysrlzy_info: s.params.compare_version, gysrlzy_info: s.params.compare_version,
compare_version: s.params.compare_version compare_version: s.params.compare_version
}); });
const _ = { const _ = {
compare_version: s.params.compare_version compare_version: s.params.compare_version
}, R = c.value[o.source.userTag], U = v.value[d == null ? void 0 : d.source.userTag]; }, R = d.value[o.source.userTag], U = v.value[m == null ? void 0 : m.source.userTag];
let J = !1, z = !1, X = !1; let J = !1, z = !1, X = !1;
if (o.source.userTag2) { if (o.source.userTag2) {
const L = JSON.parse(o.source.userTag2), { const L = JSON.parse(o.source.userTag2), {
...@@ -248,28 +248,28 @@ const Oe = M({ ...@@ -248,28 +248,28 @@ const Oe = M({
}))); })));
} }
return r("div", { return r("div", {
class: [t.e("druipart"), t.is("add", J), t.is("update", z), t.is("delete", X)] class: [e.e("druipart"), e.is("add", J), e.is("update", z), e.is("delete", X)]
}, [r("div", { }, [r("div", {
class: t.em("druipart", "caption") class: e.em("druipart", "caption")
}, [o.source.caption]), r("div", { }, [o.source.caption]), r("div", {
class: t.em("druipart", "left") class: e.em("druipart", "left")
}, [I && r("ViewShell", { }, [F && r("ViewShell", {
attrs: { attrs: {
context: T, context: T,
params: _, params: _,
modal: { modal: {
mode: ae.EMBED mode: ae.EMBED
}, },
modelPath: I, modelPath: F,
noLoadDefault: !0, noLoadDefault: !0,
name: d == null ? void 0 : d.source.id name: m == null ? void 0 : m.source.id
}, },
key: te(), key: te(),
on: { on: {
neuronInit: (L) => k(d, L) neuronInit: (L) => I(m, L)
} }
})]), r("div", { })]), r("div", {
class: t.em("druipart", "right") class: e.em("druipart", "right")
}, [A && r("ViewShell", { }, [A && r("ViewShell", {
attrs: { attrs: {
context: O, context: O,
...@@ -283,115 +283,115 @@ const Oe = M({ ...@@ -283,115 +283,115 @@ const Oe = M({
}, },
key: te(), key: te(),
on: { on: {
neuronInit: (L) => k(o, L) neuronInit: (L) => I(o, L)
} }
})])]); })])]);
}, b = (o) => { }, P = (o) => {
const d = { const m = {
modelData: o, modelData: o,
controller: e.details[o.source.name] controller: a.details[o.source.name]
}, A = e.providers[o.source.name], I = r(A.component, { }, A = a.providers[o.source.name], F = r(A.component, {
props: { props: {
...d ...m
}, },
key: o.id key: o.id
}), O = r(A.component, { }), O = r(A.component, {
props: { props: {
...d ...m
}, },
key: `compare_${o.id}` key: `compare_${o.id}`
}); });
return r("div", { return r("div", {
class: t.e("mdctrl") class: e.e("mdctrl")
}, [r("div", { }, [r("div", {
class: t.em("mdctrl", "caption") class: e.em("mdctrl", "caption")
}, [o.source.caption]), r("div", { }, [o.source.caption]), r("div", {
class: t.em("mdctrl", "left") class: e.em("mdctrl", "left")
}, [I]), r("div", { }, [F]), r("div", {
class: t.em("mdctrl", "right") class: e.em("mdctrl", "right")
}, [O])]); }, [O])]);
}, F = (o) => { }, S = (o) => {
i.value = !1; c.value = !1;
const d = p.value.findIndex((A) => A === o.source.name); const m = p.value.findIndex((A) => A === o.source.name);
d > -1 ? p.value.splice(d, 1) : p.value.push(o.source.name); m > -1 ? p.value.splice(m, 1) : p.value.push(o.source.name);
}, x = (o) => { }, k = (o) => {
if (!o.source.hidden) { if (!o.source.hidden) {
if (o.source.detailType === "FORMPAGE") if (o.source.detailType === "FORMPAGE")
return r("div", { return r("div", {
class: t.e("form-page") class: e.e("form-page")
}, [o.children.map((d) => x(d))]); }, [o.children.map((m) => k(m))]);
if (o.source.detailType === "FORMITEM") { if (o.source.detailType === "FORMITEM") {
const d = g.value.includes(o.source.name), A = l.value.includes(o.source.name), I = y.value.includes(o.source.name); const m = g.value.includes(o.source.name), A = i.value.includes(o.source.name), F = y.value.includes(o.source.name);
return n.value && !d && !A && !I ? null : P(o); return n.value && !m && !A && !F ? null : E(o);
} }
if (o.source.detailType === "GROUPPANEL") { if (o.source.detailType === "GROUPPANEL") {
const d = p.value.includes(o.source.name); const m = p.value.includes(o.source.name);
return r("div", { return r("div", {
class: t.b("group") class: e.b("group")
}, [r("div", { }, [r("div", {
class: [t.be("group", "header"), t.is("hide-caption", !o.source.showCaption)] class: [e.be("group", "header"), e.is("hide-caption", !o.source.showCaption)]
}, [r("div", { }, [r("div", {
class: t.bem("group", "header", "name") class: e.bem("group", "header", "name")
}, [d ? r("i-icon", { }, [m ? r("i-icon", {
class: t.bem("group", "header", "icon"), class: e.bem("group", "header", "icon"),
attrs: { attrs: {
type: "ios-arrow-forward", type: "ios-arrow-forward",
title: "展开" title: "展开"
}, },
on: { on: {
click: () => F(o) click: () => S(o)
} }
}) : r("i-icon", { }) : r("i-icon", {
class: t.bem("group", "header", "icon"), class: e.bem("group", "header", "icon"),
attrs: { attrs: {
type: "ios-arrow-down", type: "ios-arrow-down",
title: "收缩" title: "收缩"
}, },
on: { on: {
click: () => F(o) click: () => S(o)
} }
}), r("span", { }), r("span", {
class: t.bem("group", "header", "name-text") class: e.bem("group", "header", "name-text")
}, [o.source.caption || o.source.title])]), r("div", ["---"]), r("div", ["---"])]), r("div", { }, [o.source.caption || o.source.title])]), r("div", ["---"]), r("div", ["---"])]), r("div", {
class: [t.be("group", "content"), t.is("collapse", d)] class: [e.be("group", "content"), e.is("collapse", m)]
}, [o.children.map((A) => x(A))])]); }, [o.children.map((A) => k(A))])]);
} }
return o.source.detailType === "DRUIPART" && !o.source.name.endsWith("_srfcopy") ? w(o) : o.source.detailType === "MDCTRL" ? b(o) : null; return o.source.detailType === "DRUIPART" && !o.source.name.endsWith("_srfcopy") ? D(o) : o.source.detailType === "MDCTRL" ? P(o) : null;
} }
}, S = (o, d) => { }, x = (o, m) => {
const A = [], I = [], O = []; const A = [], F = [], O = [];
return Object.keys(d).forEach((N) => { return Object.keys(m).forEach((N) => {
const T = o[N], _ = d[N]; const T = o[N], _ = m[N];
e.isFalseyButNotEmpty(T) && !e.isFalseyButNotEmpty(_) && A.push(N), !e.isFalseyButNotEmpty(T) && !e.isFalseyButNotEmpty(_) && e.compareObjectValues(T, _) && I.push(N); a.isFalseyButNotEmpty(T) && !a.isFalseyButNotEmpty(_) && A.push(N), !a.isFalseyButNotEmpty(T) && !a.isFalseyButNotEmpty(_) && a.compareObjectValues(T, _) && F.push(N);
}), Object.keys(o).forEach((N) => { }), Object.keys(o).forEach((N) => {
if (!Object.prototype.hasOwnProperty.call(d, N) || e.isFalseyButNotEmpty(d[N])) { if (!Object.prototype.hasOwnProperty.call(m, N) || a.isFalseyButNotEmpty(m[N])) {
const T = o[N]; const T = o[N];
e.isFalseyButNotEmpty(T) || O.push(N); a.isFalseyButNotEmpty(T) || O.push(N);
} }
}), { }), {
added: A, added: A,
modified: I, modified: F,
deleted: O deleted: O
}; };
}; };
return V(() => s.params, async () => { return V(() => s.params, async () => {
const o = await e.loadGridData(); const o = await a.loadGridData();
c.value = o.baseData, v.value = o.compareData; d.value = o.baseData, v.value = o.compareData;
const { const {
added: d, added: m,
modified: A, modified: A,
deleted: I deleted: F
} = S(v.value, c.value); } = x(v.value, d.value);
g.value = d, y.value = A, l.value = I; g.value = m, y.value = A, i.value = F;
}, { }, {
immediate: !0 immediate: !0
}), { }), {
ns: t, ns: e,
c: e, c: a,
switchValue: n, switchValue: n,
druipartNum: u, druipartNum: u,
renderEditor: P, renderEditor: E,
renderByDetailType: x renderByDetailType: k
}; };
}, },
render() { render() {
...@@ -457,15 +457,15 @@ const Te = M({ ...@@ -457,15 +457,15 @@ const Te = M({
} }
}, },
setup(s, { setup(s, {
emit: t emit: e
}) { }) {
const a = B("data-import"), e = C(), i = C({ const t = B("data-import"), a = b(), c = b({
state: "ready", state: "ready",
message: "", message: "",
rowError: [] rowError: []
}), n = C(""), c = async (l) => { }), n = b(""), d = async (i) => {
const y = new FormData(), f = $(n.value).format("YYYY-MM"); const y = new FormData(), f = $(n.value).format("YYYY-MM");
y.append("file", l), y.append("ny", f); y.append("file", i), y.append("ny", f);
try { try {
const u = await ibiz.net.request(s.importUrl, { const u = await ibiz.net.request(s.importUrl, {
method: "post", method: "post",
...@@ -474,48 +474,48 @@ const Te = M({ ...@@ -474,48 +474,48 @@ const Te = M({
"Content-Type": "multipart/form-data" "Content-Type": "multipart/form-data"
} }
}); });
i.value.state = "success", i.value.message = "导入成功"; c.value.state = "success", c.value.message = "导入成功";
const { const {
errorinfo: m, errorinfo: l,
success: D, success: w,
total: P total: E
} = u.data, k = P ? Number(P) : 0, w = D ? Number(D) : 0, b = P - D; } = u.data, I = E ? Number(E) : 0, D = w ? Number(w) : 0, P = E - w;
i.value.message = `共计导入数据 ${k} 条,错误[${b}],成功[${w}]`, m && Object.keys(m).length > 0 && (i.value.rowError = [], Object.keys(m).forEach((F) => { c.value.message = `共计导入数据 ${I} 条,错误[${P}],成功[${D}]`, l && Object.keys(l).length > 0 && (c.value.rowError = [], Object.keys(l).forEach((S) => {
i.value.rowError.push({ c.value.rowError.push({
index: Number(F) + 1, index: Number(S) + 1,
info: m[F].errorInfo info: l[S].errorInfo
}); });
})); }));
} catch (u) { } catch (u) {
i.value.state = "fail", i.value.message = `导入失败!${u.message}`; c.value.state = "fail", c.value.message = `导入失败!${u.message}`;
} }
}, v = (l) => { }, v = (i) => {
const y = l.target; const y = i.target;
if (!y.files) if (!y.files)
return; return;
const f = y.files[0]; const f = y.files[0];
y.value = null, c(f); y.value = null, d(f);
}, p = async () => { }, p = async () => {
var y; var y;
const l = await ibiz.net.request(s.templateUrl, { const i = await ibiz.net.request(s.templateUrl, {
responseType: "blob" responseType: "blob"
}); });
if (l.status === 200) { if (i.status === 200) {
let f = ((y = l.headers["content-disposition"].split(";").find((D) => D.indexOf("filename=") !== -1)) == null ? void 0 : y.slice(9)) || ""; let f = ((y = i.headers["content-disposition"].split(";").find((w) => w.indexOf("filename=") !== -1)) == null ? void 0 : y.slice(9)) || "";
f = decodeURIComponent(f); f = decodeURIComponent(f);
const u = new Blob([l.data], { const u = new Blob([i.data], {
type: "application/vnd.ms-excel" type: "application/vnd.ms-excel"
}), m = document.createElement("a"); }), l = document.createElement("a");
m.download = f, m.style.display = "none", m.href = URL.createObjectURL(u), document.body.appendChild(m), m.click(), URL.revokeObjectURL(m.href), document.body.removeChild(m); l.download = f, l.style.display = "none", l.href = URL.createObjectURL(u), document.body.appendChild(l), l.click(), URL.revokeObjectURL(l.href), document.body.removeChild(l);
} }
}, h = () => { }, h = () => {
e.value.click(); a.value.click();
}, g = () => { }, g = () => {
var l; var i;
t("close", { e("close", {
ok: !1, ok: !1,
data: {} data: {}
}), (l = s.dismiss) == null || l.call(s, { }), (i = s.dismiss) == null || i.call(s, {
ok: !1, ok: !1,
data: {} data: {}
}); });
...@@ -523,14 +523,14 @@ const Te = M({ ...@@ -523,14 +523,14 @@ const Te = M({
return De(() => { return De(() => {
n.value = $().format("YYYY年MM月"); n.value = $().format("YYYY年MM月");
}), { }), {
ns: a, ns: t,
curDate: n, curDate: n,
onLinkClick: p, onLinkClick: p,
selectFile: h, selectFile: h,
onCancelButtonClick: g, onCancelButtonClick: g,
onFileChange: v, onFileChange: v,
inputUpLoad: e, inputUpLoad: a,
message: i message: c
}; };
}, },
render() { render() {
...@@ -611,10 +611,10 @@ const Me = M({ ...@@ -611,10 +611,10 @@ const Me = M({
props: ye(), props: ye(),
emits: G(), emits: G(),
setup(s, { setup(s, {
emit: t emit: e
}) { }) {
const a = B("date-picker"), e = s.controller, i = e.model, n = C("date"), c = C("yyyy-MM-dd"), v = C(!1); const t = B("date-picker"), a = s.controller, c = a.model, n = b("date"), d = b("yyyy-MM-dd"), v = b(!1);
switch (i.editorType) { switch (c.editorType) {
case "DATEPICKEREX": case "DATEPICKEREX":
case "DATEPICKEREX_NOTIME": case "DATEPICKEREX_NOTIME":
n.value = "date"; n.value = "date";
...@@ -631,14 +631,14 @@ const Me = M({ ...@@ -631,14 +631,14 @@ const Me = M({
default: default:
n.value = "datetime"; n.value = "datetime";
} }
const p = e.valueFormat; const p = a.valueFormat;
if (p) { if (p) {
p === "YYYY-MM" ? n.value = "month" : p === "YYYY" && (n.value = "year"); p === "YYYY-MM" ? n.value = "month" : p === "YYYY" && (n.value = "year");
const f = p.replace("YYYY", "yyyy").replace("DD", "dd"); const f = p.replace("YYYY", "yyyy").replace("DD", "dd");
c.value = f; d.value = f;
} }
i.editorParams.formatText && (c.value = i.editorParams.formatText.replace("YYYY", "yyyy").replace("DD", "dd")); c.editorParams.formatText && (d.value = c.editorParams.formatText.replace("YYYY", "yyyy").replace("DD", "dd"));
const h = C(); const h = b();
V(() => s.value, (f, u) => { V(() => s.value, (f, u) => {
f && f !== u && (h.value = $(f).format(p)); f && f !== u && (h.value = $(f).format(p));
}, { }, {
...@@ -646,24 +646,24 @@ const Me = M({ ...@@ -646,24 +646,24 @@ const Me = M({
}); });
const g = (f, u) => { const g = (f, u) => {
if (f) { if (f) {
const m = $(f.replace(/[年月]/g, "-")).format(p); const l = $(f.replace(/[年月]/g, "-")).format(p);
t("change", m); e("change", l);
} else } else
t("change", f); e("change", f);
}, l = (f) => { }, i = (f) => {
t("operate", f); e("operate", f);
}, y = C(); }, y = b();
return s.autoFocus && V(y, (f) => { return s.autoFocus && V(y, (f) => {
f && f.$el.getElementsByTagName("input")[0].click(); f && f.$el.getElementsByTagName("input")[0].click();
}), { }), {
ns: a, ns: t,
c: e, c: a,
editorModel: i, editorModel: c,
type: n, type: n,
format: c, format: d,
formatValue: h, formatValue: h,
handleChange: g, handleChange: g,
onOpenChange: l, onOpenChange: i,
inputRef: y, inputRef: y,
isTimePicker: v isTimePicker: v
}; };
...@@ -708,10 +708,10 @@ const ie = new Ee(import.meta.url), Re = M({ ...@@ -708,10 +708,10 @@ const ie = new Ee(import.meta.url), Re = M({
name: "DownLoadSafeFile", name: "DownLoadSafeFile",
props: {}, props: {},
setup() { setup() {
const s = B("download-safe-file"), t = ie.dir("/assets/doc/safe-file.doc"); const s = B("download-safe-file"), e = ie.dir("/assets/doc/safe-file.doc");
return { return {
ns: s, ns: s,
url: t url: e
}; };
}, },
render() { render() {
...@@ -734,17 +734,17 @@ class le extends Pe { ...@@ -734,17 +734,17 @@ class le extends Pe {
* @type {number} * @type {number}
* @memberof FormMDCtrlFormStyle2Controller * @memberof FormMDCtrlFormStyle2Controller
*/ */
E(this, "active", 0); C(this, "active", 0);
} }
connect(a, e) { connect(t, a) {
this.formNeurons.get(a) || (this.formNeurons.set(a, e), e.evt.on("mounted", () => { this.formNeurons.get(t) || (this.formNeurons.set(t, a), a.evt.on("mounted", () => {
e.call.load(); a.call.load();
}), e.evt.on("destroyed", () => { }), a.evt.on("destroyed", () => {
this.formNeurons.delete(a); this.formNeurons.delete(t);
}), e.evt.on("valueChange", (i) => { }), a.evt.on("valueChange", (c) => {
if (i) { if (c) {
const n = this.contentCtrlData.find((c) => c.srfkey === i.srfkey); const n = this.contentCtrlData.find((d) => d.srfkey === c.srfkey);
n && Object.assign(n, i), this.force(); n && Object.assign(n, c), this.force();
} }
})); }));
} }
...@@ -755,23 +755,23 @@ class le extends Pe { ...@@ -755,23 +755,23 @@ class le extends Pe {
* @memberof FormMDCtrlFormStyle2Controller * @memberof FormMDCtrlFormStyle2Controller
*/ */
async validate() { async validate() {
const a = []; const t = [];
this.formNeurons.forEach((n, c) => { this.formNeurons.forEach((n, d) => {
const v = n.call.getFormController(); const v = n.call.getFormController();
a.push({ key: c, controller: v }); t.push({ key: d, controller: v });
}); });
let e = ""; let a = "";
const i = await Promise.all( const c = await Promise.all(
a.map(async (n) => { t.map(async (n) => {
const c = await n.controller.validate(); const d = await n.controller.validate();
return !e && !c && (e = n.key), c; return !a && !d && (a = n.key), d;
}) })
); );
if (e) { if (a) {
const n = this.contentCtrlData.findIndex((c) => c.srfkey === e); const n = this.contentCtrlData.findIndex((d) => d.srfkey === a);
n > -1 && (this.active = n); n > -1 && (this.active = n);
} }
return i.findIndex((n) => !n) === -1; return c.findIndex((n) => !n) === -1;
} }
/** /**
* 静默校验 * 静默校验
...@@ -780,23 +780,23 @@ class le extends Pe { ...@@ -780,23 +780,23 @@ class le extends Pe {
* @memberof FormMDCtrlFormStyle2Controller * @memberof FormMDCtrlFormStyle2Controller
*/ */
async silentValidate() { async silentValidate() {
const a = []; const t = [];
this.formNeurons.forEach((n, c) => { this.formNeurons.forEach((n, d) => {
const v = n.call.getFormController(); const v = n.call.getFormController();
a.push({ key: c, controller: v }); t.push({ key: d, controller: v });
}); });
let e = ""; let a = "";
const i = await Promise.all( const c = await Promise.all(
a.map(async (n) => { t.map(async (n) => {
const c = await n.controller.silentValidate(); const d = await n.controller.silentValidate();
return !e && !c && (e = n.key), c; return !a && !d && (a = n.key), d;
}) })
); );
if (e) { if (a) {
const n = this.contentCtrlData.findIndex((c) => c.srfkey === e); const n = this.contentCtrlData.findIndex((d) => d.srfkey === a);
n > -1 && (this.active = n); n > -1 && (this.active = n);
} }
return i.findIndex((n) => !n) === -1; return c.findIndex((n) => !n) === -1;
} }
} }
const Ue = M({ const Ue = M({
...@@ -812,93 +812,108 @@ const Ue = M({ ...@@ -812,93 +812,108 @@ const Ue = M({
} }
}, },
setup(s) { setup(s) {
const t = B("form-mdctrl-form-style2"), a = s.controller, { const e = B("form-mdctrl-form-style2"), t = s.controller, {
proxy: e proxy: a
} = W(); } = W();
ge(e, s.controller); ge(a, s.controller);
const i = async (h, g, l) => { const c = async (h, g, i) => {
l.stopPropagation(), l.preventDefault(); i.stopPropagation(), i.preventDefault();
const y = a.contentCtrlData.length; const y = t.contentCtrlData.length;
await a.handleRemove(h, g), y !== a.contentCtrlData.length && g <= a.active && a.active !== 0 && (a.active -= 1); await t.handleRemove(h, g), y !== t.contentCtrlData.length && g <= t.active && t.active !== 0 && (t.active -= 1);
}, n = (h) => { }, n = (h) => {
a.active = h, a.force(); t.active = h, t.force();
}, c = async () => { }, d = async () => {
const h = JSON.parse(JSON.stringify(a.contentCtrlData)).length; const h = JSON.parse(JSON.stringify(t.contentCtrlData)).length;
await a.handleAdd(), h < a.contentCtrlData.length && (a.active = a.contentCtrlData.length - 1); await t.handleAdd(), h < t.contentCtrlData.length && (t.active = t.contentCtrlData.length - 1);
}, v = () => { }, v = () => {
const h = s.modelData.source.userTag; const h = s.modelData.source.userTag;
let g = {}; let g = {};
h && (g = JSON.parse(h)); h && (g = JSON.parse(h));
const { const {
tabtitle: l, tabtitle: i,
addtitle: y addtitle: y,
usermode: f
} = g; } = g;
return r("div", { return f === "user1" && t.contentCtrlData.some((l) => l.rcrylx === "system") ? r("div", {
class: t.e("header") class: e.e("header")
}, [a.contentCtrlData.map((f, u) => { }, [t.contentCtrlData.map((l, w) => {
let m = `新建${u + 1}`; let E = "";
return f.srfmajortext ? m = f.srfmajortext : l && f[l] ? m = f[l] : y && (m = `${y}${u + 1}`), r("div", { l.srfmajortext ? E = l.srfmajortext : i && l[i] && (E = l[i]);
class: [t.e("header-item"), t.is("actived", u === a.active)], let I = "待确认";
return l.is_rc === 1 ? I = "确认入场" : l.is_rc === 0 && (I = "放弃入场"), r("div", {
class: [e.e("header-item"), e.is("actived", w === t.active)],
on: { on: {
click: () => n(u) click: () => n(w)
} }
}, [r("div", { }, [r("div", {
class: t.em("header-item", "title") class: e.em("header-item", "title")
}, [m]), a.enableDelete && r("div", { }, [E, "(", I, ")"])]);
class: t.em("header-item", "delete"), })]) : r("div", {
class: e.e("header")
}, [t.contentCtrlData.map((u, l) => {
let w = `新建${l + 1}`;
return u.srfmajortext ? w = u.srfmajortext : i && u[i] ? w = u[i] : y && (w = `${y}${l + 1}`), r("div", {
class: [e.e("header-item"), e.is("actived", l === t.active)],
on: {
click: () => n(l)
}
}, [r("div", {
class: e.em("header-item", "title")
}, [w]), t.enableDelete && r("div", {
class: e.em("header-item", "delete"),
attrs: { attrs: {
title: "移除" title: "移除"
}, },
on: { on: {
click: (D) => i(f, u, D) click: (E) => c(u, l, E)
} }
}, [r("i", { }, [r("i", {
class: "fa fa-close" class: "fa fa-close"
})])]); })])]);
}), a.enableCreate && r("div", { }), t.enableCreate && r("div", {
class: [t.e("header-item"), t.e("add")], class: [e.e("header-item"), e.e("add")],
attrs: { attrs: {
title: "添加" title: "添加"
}, },
on: { on: {
click: () => c() click: () => d()
} }
}, [r("span", ["添加"]), r("i", { }, [r("span", ["添加"]), r("i", {
class: "fa fa-plus" class: "fa fa-plus"
})])]); })])]);
}; };
return V(() => a.form.isLoaded, (h, g) => { return V(() => t.form.isLoaded, (h, g) => {
h !== g && h === !0 && a.loadData(); h !== g && h === !0 && t.loadData();
}), { }), {
ns: t, ns: e,
rendertanHeader: v, rendertanHeader: v,
renderTabs: () => a.contentCtrlData.map((h, g) => { renderTabs: () => t.contentCtrlData.map((h, g) => {
var f; var f;
let l = null; let i = null;
const { const {
form: y form: y
} = a.model; } = t.model;
if (y && a.providers[y.name] && a.model.appEntity) { if (y && t.providers[y.name] && t.model.appEntity) {
const u = Object.assign(a.form.context.clone(), { const u = Object.assign(t.form.context.clone(), {
[(f = a.model.appEntity.codeName) == null ? void 0 : f.toLowerCase()]: h[a.model.appEntity.keyName] [(f = t.model.appEntity.codeName) == null ? void 0 : f.toLowerCase()]: h[t.model.appEntity.keyName]
}); });
l = r(a.providers[y.name].component, { i = r(t.providers[y.name].component, {
props: { props: {
modelData: y, modelData: y,
context: u, context: u,
params: a.form.params, params: t.form.params,
enableAutoSave: !0, enableAutoSave: !0,
silentVerify: !0 silentVerify: !0
}, },
on: { on: {
neuronInit: a.onNeuronInit(h.srfkey) neuronInit: t.onNeuronInit(h.srfkey)
} }
}); });
} }
return r("div", { return r("div", {
class: [t.e("content"), t.is("actived", g === a.active)], class: [e.e("content"), e.is("actived", g === t.active)],
key: h.srfkey key: h.srfkey
}, [l]); }, [i]);
}) })
}; };
}, },
...@@ -912,93 +927,93 @@ const Ue = M({ ...@@ -912,93 +927,93 @@ const Ue = M({
props: se(), props: se(),
emits: G(), emits: G(),
setup(s, { setup(s, {
emit: t emit: e
}) { }) {
const a = B("mpicker"), e = s.controller, i = C([]), n = C([]), c = C([]), v = C(!1), p = C(!1), h = C(null), g = C([]), l = j(() => { const t = B("mpicker"), a = s.controller, c = b([]), n = b([]), d = b([]), v = b(!1), p = b(!1), h = b(null), g = b([]), i = j(() => {
const w = e.editorParams.followitem; const D = a.editorParams.followitem;
return w ? s.data[w] : ""; return D ? s.data[D] : "";
}); });
V(() => s.value, (w) => { V(() => s.value, (D) => {
i.value = [], c.value = [], w && (c.value = JSON.parse(w), c.value.length > 0 && c.value.forEach((b) => { c.value = [], d.value = [], D && (d.value = JSON.parse(D), d.value.length > 0 && d.value.forEach((P) => {
n.value.findIndex((x) => Object.is(x.srfkey, b.srfkey)) < 0 && (n.value.push(b), g.value.push(b.srfmajortext)), i.value.push(b.srfkey); n.value.findIndex((k) => Object.is(k.srfkey, P.srfkey)) < 0 && (n.value.push(P), g.value.push(P.srfmajortext)), c.value.push(P.srfkey);
})); }));
}, { }, {
immediate: !0, immediate: !0,
deep: !0 deep: !0
}); });
const y = async (w) => { const y = async (D) => {
const b = []; const P = [];
if (w && Array.isArray(w)) if (D && Array.isArray(D))
for (let x = 0; x < w.length; x++) { for (let k = 0; k < D.length; k++) {
const S = w[x], o = { const x = D[k], o = {
srfkey: S[e.keyName] || S.srfkey, srfkey: x[a.keyName] || x.srfkey,
srfmajortext: S[e.textName] || S.srfmajortext srfmajortext: x[a.textName] || x.srfmajortext
}, d = await e.calcFillDataItems(S); }, m = await a.calcFillDataItems(x);
d.length > 0 && d.forEach((I) => { m.length > 0 && m.forEach((F) => {
Object.assign(o, { Object.assign(o, {
[I.name]: I.value [F.name]: F.value
}); });
}), b.push(o), n.value.findIndex((I) => Object.is(I[e.keyName], S[e.keyName])) < 0 && n.value.push(o); }), P.push(o), n.value.findIndex((F) => Object.is(F[a.keyName], x[a.keyName])) < 0 && n.value.push(o);
} }
const F = b.length > 0 ? JSON.stringify(b) : ""; const S = P.length > 0 ? JSON.stringify(P) : "";
t("change", F); e("change", S);
}, f = async () => { }, f = async () => {
let w; let D;
c.value.length && (w = JSON.stringify(c.value)); d.value.length && (D = JSON.stringify(d.value));
const b = await e.openPickUpView(s.data, w); const P = await a.openPickUpView(s.data, D);
b && y(b); P && y(P);
}, u = (w) => { }, u = (D) => {
const b = []; const P = [];
if (w.length > 0) { if (D.length > 0) {
w.forEach((x) => { D.forEach((k) => {
let S = n.value.findIndex((d) => Object.is(d.srfkey, x)), o = null; let x = n.value.findIndex((m) => Object.is(m.srfkey, k)), o = null;
S >= 0 ? o = n.value[S] : (S = c.value.findIndex((d) => Object.is(d.srfkey, x)), S >= 0 && (o = c.value[S])), o && b.push(o); x >= 0 ? o = n.value[x] : (x = d.value.findIndex((m) => Object.is(m.srfkey, k)), x >= 0 && (o = d.value[x])), o && P.push(o);
}); });
const F = b.length > 0 ? JSON.stringify(b) : ""; const S = P.length > 0 ? JSON.stringify(P) : "";
t("change", F); e("change", S);
} else } else
t("change", ""); e("change", "");
}, m = async (w) => { }, l = async (D) => {
if (e.model.appDataEntity) { if (a.model.appDataEntity) {
p.value = !0; p.value = !0;
try { try {
const b = await e.getServiceData(w, s.data); const P = await a.getServiceData(D, s.data);
p.value = !1, n.value = [], b.data.length > 0 && (n.value = b.data.map((F) => ({ p.value = !1, n.value = [], P.data.length > 0 && (n.value = P.data.map((S) => ({
srfkey: F[e.keyName], srfkey: S[a.keyName],
srfmajortext: F[e.textName] srfmajortext: S[a.textName]
}))); })));
} catch (b) { } catch (P) {
p.value = !1; p.value = !1;
} }
} }
}, D = (w) => { }, w = (D) => {
v.value = w, t("operate", w), v.value && m(""); v.value = D, e("operate", D), v.value && l("");
}, P = j(() => c.value.map((w) => w.srfmajortext).join("、")), k = (w) => { }, E = j(() => d.value.map((D) => D.srfmajortext).join("、")), I = (D) => {
n.value = w; n.value = D;
}; };
return V(() => l.value, async (w) => { return V(() => i.value, async (D) => {
if (w) { if (D) {
await m(""); await l("");
const b = n.value.map((F) => F.srfkey); const P = n.value.map((S) => S.srfkey);
u(b); u(P);
} else } else
n.value = [], t("change", ""); n.value = [], e("change", "");
}, { }, {
immediate: !0 immediate: !0
}), { }), {
ns: a, ns: t,
c: e, c: a,
selectRef: h, selectRef: h,
curValue: i, curValue: c,
loading: p, loading: p,
items: n, items: n,
defaultLabel: g, defaultLabel: g,
valueText: P, valueText: E,
onSearch: m, onSearch: l,
onOpenChange: D, onOpenChange: w,
onSelect: u, onSelect: u,
openPickUpView: f, openPickUpView: f,
setDefaultOptions: k setDefaultOptions: I
}; };
}, },
render(s) { render(s) {
...@@ -1022,13 +1037,13 @@ const Ue = M({ ...@@ -1022,13 +1037,13 @@ const Ue = M({
"on-change": this.onSelect, "on-change": this.onSelect,
"on-open-change": this.onOpenChange "on-open-change": this.onOpenChange
} }
}, [this.items.map((t) => s("i-option", { }, [this.items.map((e) => s("i-option", {
key: t.srfkey, key: e.srfkey,
attrs: { attrs: {
value: t.srfkey, value: e.srfkey,
label: t.srfmajortext label: e.srfmajortext
} }
}, [t.srfmajortext]))]), !this.readonly && s("div", { }, [e.srfmajortext]))]), !this.readonly && s("div", {
class: this.ns.e("buns-position") class: this.ns.e("buns-position")
}, [s("div", { }, [s("div", {
class: this.ns.e("btns") class: this.ns.e("btns")
...@@ -1048,70 +1063,70 @@ const Ve = M({ ...@@ -1048,70 +1063,70 @@ const Ve = M({
props: se(), props: se(),
emits: G(), emits: G(),
setup(s, { setup(s, {
emit: t emit: e
}) { }) {
const a = B("checkbox"), e = s.controller, i = C([]), n = C([]), c = ",", v = j({ const t = B("checkbox"), a = s.controller, c = b([]), n = b([]), d = ",", v = j({
get() { get() {
var u; var u;
return ((u = s.value) == null ? void 0 : u.split(",")) || []; return ((u = s.value) == null ? void 0 : u.split(",")) || [];
}, },
set(u) { set(u) {
let m = null; let l = null;
const D = []; const w = [];
i.value.length > 0 && (i.value.forEach((P) => { c.value.length > 0 && (c.value.forEach((E) => {
u.findIndex((w) => Object.is(P.value, w)) !== -1 && D.push(P.value); u.findIndex((D) => Object.is(E.value, D)) !== -1 && w.push(E.value);
}), m = D.join(c)), t("change", m); }), l = w.join(d)), e("change", l);
} }
}), p = async (u) => { }), p = async (u) => {
const { const {
context: m, context: l,
params: D params: w
} = e.handlePublicParams(u, e.context, e.params); } = a.handlePublicParams(u, a.context, a.params);
if (e.editorParams.codeTag) { if (a.editorParams.codeTag) {
let P = []; let E = [];
const k = e.editorParams.codeTag; const I = a.editorParams.codeTag;
return P = await ibiz.codeListService.get(k, m, D), P; return E = await ibiz.codeListService.get(I, l, w), E;
} }
throw new he(e.model.source, "请配置代码表"); throw new he(a.model.source, "请配置代码表");
}, h = (u) => { }, h = (u) => {
v.value = u; v.value = u;
}, g = j(() => { }, g = j(() => {
const u = Array.isArray(v.value) ? v.value : [v.value]; const u = Array.isArray(v.value) ? v.value : [v.value];
return i.value.filter((m) => u.includes(m.srfkey)).map((m) => m.srfmajortext).join("、"); return c.value.filter((l) => u.includes(l.srfkey)).map((l) => l.srfmajortext).join("、");
}), l = async (u) => { }), i = async (u) => {
if (e.model.appDataEntity) if (a.model.appDataEntity)
try { try {
const m = await e.getServiceData(u, s.data); const l = await a.getServiceData(u, s.data);
n.value = [], m.data.length > 0 && (n.value = m.data.map((D) => ({ n.value = [], l.data.length > 0 && (n.value = l.data.map((w) => ({
srfkey: D[e.keyName], srfkey: w[a.keyName],
srfmajortext: D[e.textName] srfmajortext: w[a.textName]
}))); })));
} catch (m) { } catch (l) {
console.error(m); console.error(l);
} }
}, y = j(() => { }, y = j(() => {
const u = e.editorParams.followitem; const u = a.editorParams.followitem;
return u ? s.data[u] : ""; return u ? s.data[u] : "";
}), f = () => { }), f = () => {
const u = []; const u = [];
i.value.forEach((m) => { c.value.forEach((l) => {
n.value.findIndex((P) => P.srfkey === m.value) > -1 && u.push(m.value); n.value.findIndex((E) => E.srfkey === l.value) > -1 && u.push(l.value);
}), h(u); }), h(u);
}; };
return V(() => y, async (u) => { return V(() => y, async (u) => {
await p(u).then((m) => { await p(u).then((l) => {
i.value = m; c.value = l;
}), await l(""), f(); }), await i(""), f();
}, { }, {
immediate: !0, immediate: !0,
deep: !0 deep: !0
}), { }), {
ns: a, ns: t,
c: e, c: a,
valueText: g, valueText: g,
selectArray: v, selectArray: v,
items: i, items: c,
onSearch: l, onSearch: i,
onSelectArrayChange: h onSelectArrayChange: h
}; };
}, },
...@@ -1126,15 +1141,15 @@ const Ve = M({ ...@@ -1126,15 +1141,15 @@ const Ve = M({
on: { on: {
"on-change": this.onSelectArrayChange "on-change": this.onSelectArrayChange
} }
}, [this.items.map((t, a) => s("i-checkbox", { }, [this.items.map((e, t) => s("i-checkbox", {
key: a, key: t,
attrs: { attrs: {
label: t.value, label: e.value,
disabled: this.disabled disabled: this.disabled
} }
}, [s("span", { }, [s("span", {
class: this.ns.e("text") class: this.ns.e("text")
}, [t.text])]))])]); }, [e.text])]))])]);
} }
}); });
class Be extends Ae { class Be extends Ae {
...@@ -1145,25 +1160,25 @@ class Be extends Ae { ...@@ -1145,25 +1160,25 @@ class Be extends Ae {
* @date 2022-09-15 10:09:22 * @date 2022-09-15 10:09:22
* @param {ViewNeuron} neuron * @param {ViewNeuron} neuron
*/ */
setViewNeuron(t) { setViewNeuron(e) {
this.neuron = t, this.neuron.evt.on("refreshed", (a) => { this.neuron = e, this.neuron.evt.on("refreshed", (t) => {
if (ibiz.log.debug("接收到关系界面的刷新变更事件", a), this.model.formItemUpdate) { if (ibiz.log.debug("接收到关系界面的刷新变更事件", t), this.model.formItemUpdate) {
const { methodName: e, itemNames: i, model: n } = this.model.formItemUpdate; const { methodName: a, itemNames: c, model: n } = this.model.formItemUpdate;
this.form.updateFormItem( this.form.updateFormItem(
e, a,
i, c,
n n
); );
} }
}), this.neuron.evt.on("mounted", () => { }), this.neuron.evt.on("mounted", () => {
this.neuron.call.refresh(); this.neuron.call.refresh();
}), this.neuron.evt.on("viewDataChange", async (a) => { }), this.neuron.evt.on("viewDataChange", async (t) => {
if (!["LOAD", "LOADDRAFT"].includes(a.type) && (ibiz.log.debug("接收到关系界面的数据变更事件", a.data), this.model.formItemUpdate)) { if (!["LOAD", "LOADDRAFT"].includes(t.type) && (ibiz.log.debug("接收到关系界面的数据变更事件", t.data), this.model.formItemUpdate)) {
const { methodName: e, itemNames: i, model: n } = this.model.formItemUpdate; const { methodName: a, itemNames: c, model: n } = this.model.formItemUpdate;
try { try {
this.processState.formItemUpdate = !0, await this.form.updateFormItem( this.processState.formItemUpdate = !0, await this.form.updateFormItem(
e, a,
i, c,
n n
); );
} finally { } finally {
...@@ -1171,8 +1186,8 @@ class Be extends Ae { ...@@ -1171,8 +1186,8 @@ class Be extends Ae {
} }
} }
}), this.neuron.evt.on("destroyed", () => { }), this.neuron.evt.on("destroyed", () => {
Object.keys(this.processState).forEach((a) => { Object.keys(this.processState).forEach((t) => {
this.processState[a] = !1; this.processState[t] = !1;
}); });
}), this.neuron.evt.on("viewSaveStart", () => { }), this.neuron.evt.on("viewSaveStart", () => {
this.processState.viewSave = !0; this.processState.viewSave = !0;
...@@ -1181,7 +1196,7 @@ class Be extends Ae { ...@@ -1181,7 +1196,7 @@ class Be extends Ae {
}); });
} }
} }
class _e extends Ie { class _e extends Fe {
constructor() { constructor() {
super(...arguments); super(...arguments);
/** /**
...@@ -1190,7 +1205,7 @@ class _e extends Ie { ...@@ -1190,7 +1205,7 @@ class _e extends Ie {
* @type {string} * @type {string}
* @memberof WfEditViewController * @memberof WfEditViewController
*/ */
E(this, "userAction"); C(this, "userAction");
} }
async onInit() { async onInit() {
await super.onInit(), this.getUserAction(); await super.onInit(), this.getUserAction();
...@@ -1205,23 +1220,23 @@ class _e extends Ie { ...@@ -1205,23 +1220,23 @@ class _e extends Ie {
async wfStart() { async wfStart() {
var h; var h;
await this.save(), await this.execUserAction(); await this.save(), await this.execUserAction();
const a = await this.entityService.wf.getWFVersion(); const t = await this.entityService.wf.getWFVersion();
if (a.data.length === 0) if (t.data.length === 0)
throw new xe("当前工作流版本不存在"); throw new ke("当前工作流版本不存在");
const e = a.data[0], i = `WFSTART@${e.wfversion}`, n = Object.assign(this.context.clone(), { const a = t.data[0], c = `WFSTART@${a.wfversion}`, n = Object.assign(this.context.clone(), {
activeForm: e["process-form"] activeForm: a["process-form"]
}), c = { }), d = {
processDefinitionKey: e.definitionkey processDefinitionKey: a.definitionkey
}, v = (h = this.model.source.findPSAppViewRef(i)) == null ? void 0 : h.getRefPSAppView(); }, v = (h = this.model.source.findPSAppViewRef(c)) == null ? void 0 : h.getRefPSAppView();
if (!v) { if (!v) {
await this.nerve.form.call.wfStart(c), await this.closeView(); await this.nerve.form.call.wfStart(d), await this.closeView();
return; return;
} }
(await ibiz.commands.execute( (await ibiz.commands.execute(
q.TAG, q.TAG,
v, v,
n, n,
c d
)).ok && await this.closeView(); )).ok && await this.closeView();
} }
/** /**
...@@ -1230,10 +1245,10 @@ class _e extends Ie { ...@@ -1230,10 +1245,10 @@ class _e extends Ie {
* @memberof EditViewController * @memberof EditViewController
*/ */
getUserAction() { getUserAction() {
const { form: a } = this.model, e = a.source.getPSControlHandler(); const { form: t } = this.model, a = t.source.getPSControlHandler();
if (e) { if (a) {
const i = e.findPSControlHandlerAction("user"); const c = a.findPSControlHandlerAction("user");
i && i.getPSAppDEMethod() && (this.userAction = i.getPSAppDEMethod().codeName); c && c.getPSAppDEMethod() && (this.userAction = c.getPSAppDEMethod().codeName);
} }
} }
/** /**
...@@ -1243,15 +1258,15 @@ class _e extends Ie { ...@@ -1243,15 +1258,15 @@ class _e extends Ie {
*/ */
async execUserAction() { async execUserAction() {
if (this.userAction) { if (this.userAction) {
const a = this.getData(); const t = this.getData();
await this.entityService.exec(this.userAction, this.context, a[0]); await this.entityService.exec(this.userAction, this.context, t[0]);
} }
} }
} }
function je(s, t) { function je(s, e) {
return we( return we(
s, s,
(a, e) => new _e(t, a, e) (t, a) => new _e(e, t, a)
); );
} }
const ze = M({ const ze = M({
...@@ -1274,26 +1289,26 @@ const ze = M({ ...@@ -1274,26 +1289,26 @@ const ze = M({
}, },
setup(s) { setup(s) {
const { const {
proxy: t proxy: e
} = W(); } = W();
return { return {
c: je(t, s.modelPath) c: je(e, s.modelPath)
}; };
}, },
render(s) { render(s) {
let t = null; let e = null;
if (this.c.complete) { if (this.c.complete) {
const { const {
form: a form: t
} = this.c.model; } = this.c.model;
this.c.providers[a.name] && (t = s(this.c.providers[a.name].component, { this.c.providers[t.name] && (e = s(this.c.providers[t.name].component, {
props: { props: {
modelData: a, modelData: t,
context: this.c.context, context: this.c.context,
params: this.c.params params: this.c.params
}, },
on: { on: {
neuronInit: this.c.nerve.onNeuronInit(a.name) neuronInit: this.c.nerve.onNeuronInit(t.name)
} }
})); }));
} }
...@@ -1301,40 +1316,40 @@ const ze = M({ ...@@ -1301,40 +1316,40 @@ const ze = M({
attrs: { attrs: {
controller: this.c controller: this.c
} }
}, [t]); }, [e]);
} }
}); });
class Ye { class Ye {
constructor() { constructor() {
E(this, "component", "IBizFormDataComparison"); C(this, "component", "IBizFormDataComparison");
} }
} }
class $e extends Ce { class $e extends Ce {
async execAction(t, a, e, i) { async execAction(e, t, a, c) {
const n = {}, c = t.getPSAppDataEntity(); const n = {}, d = e.getPSAppDataEntity();
if (c) { if (d) {
c.isFill === !1 && await c.fill(!0); d.isFill === !1 && await d.fill(!0);
const v = new H(c); const v = new H(d);
await v.init(); await v.init();
const { resultContext: p } = await this.handleParams( const { resultContext: p } = await this.handleParams(
e,
t, t,
a, a,
e, c
i
), h = ibiz.resourcePathUtil.calcPaths( ), h = ibiz.resourcePathUtil.calcPaths(
p, p,
v.codeName v.codeName
), g = K(p, h); ), g = K(p, h);
let l = `${g}/${v.deNamePlural}/importtemplate`, y = `${g}/${v.deNamePlural}/importdata2`; let i = `${g}/${v.deNamePlural}/importtemplate`, y = `${g}/${v.deNamePlural}/importdata2`;
const f = t.getPSAppDEDataImport(); const f = e.getPSAppDEDataImport();
f && (l += `?srfimporttag=${f.codeName}`, y += `?srfimporttag=${f.codeName}`); f && (i += `?srfimporttag=${f.codeName}`, y += `?srfimporttag=${f.codeName}`);
const u = ibiz.overlay.createModal( const u = ibiz.overlay.createModal(
"CustomDataImport", "CustomDataImport",
{ {
templateUrl: l, templateUrl: i,
importUrl: y, importUrl: y,
dismiss: (m) => { dismiss: (l) => {
u.dismiss(m); u.dismiss(l);
} }
}, },
{ {
...@@ -1351,7 +1366,7 @@ class $e extends Ce { ...@@ -1351,7 +1366,7 @@ class $e extends Ce {
} }
class He { class He {
constructor() { constructor() {
E(this, "handler"); C(this, "handler");
} }
async getHandler() { async getHandler() {
return this.handler || (this.handler = new $e()), this.handler; return this.handler || (this.handler = new $e()), this.handler;
...@@ -1359,56 +1374,56 @@ class He { ...@@ -1359,56 +1374,56 @@ class He {
} }
class Ge { class Ge {
constructor() { constructor() {
E(this, "gridEditor", "YearMonthPicker"); C(this, "gridEditor", "YearMonthPicker");
E(this, "formEditor", "YearMonthPicker"); C(this, "formEditor", "YearMonthPicker");
} }
async createController(t, a) { async createController(e, t) {
const e = new Fe(t, a); const a = new Ie(e, t);
return await e.init(), e; return await a.init(), a;
} }
} }
class We { class We {
constructor() { constructor() {
E(this, "formEditor", "DownLoadSafeFile"); C(this, "formEditor", "DownLoadSafeFile");
E(this, "gridEditor", "DownLoadSafeFile"); C(this, "gridEditor", "DownLoadSafeFile");
} }
async createController(t, a) { async createController(e, t) {
const e = new Se(t, a); const a = new Se(e, t);
return await e.init(), e; return await a.init(), a;
} }
} }
class qe extends re { class qe extends re {
async execAction(t, a, e, i, n) { async execAction(e, t, a, c, n) {
const c = {}, { frontProcessType: v } = t; const d = {}, { frontProcessType: v } = e;
if (v === "OPENHTMLPAGE") { if (v === "OPENHTMLPAGE") {
const p = ne.fill(t.htmlPageUrl, a, e == null ? void 0 : e[0]); const p = ne.fill(e.htmlPageUrl, t, a == null ? void 0 : a[0]);
window.open(p, "_blank"); window.open(p, "_blank");
} }
if (v === "DATAIMP") { if (v === "DATAIMP") {
const p = t.getPSAppDataEntity(); const p = e.getPSAppDataEntity();
if (p) { if (p) {
p.isFill === !1 && await p.fill(!0); p.isFill === !1 && await p.fill(!0);
const h = new H(p); const h = new H(p);
await h.init(); await h.init();
const { resultContext: g } = await this.handleParams( const { resultContext: g } = await this.handleParams(
e,
t, t,
a, a,
e, c
i ), i = ibiz.resourcePathUtil.calcPaths(
), l = ibiz.resourcePathUtil.calcPaths(
g, g,
h.codeName h.codeName
), y = K(g, l); ), y = K(g, i);
let f = `${y}/${h.deNamePlural}/importtemplate`, u = `${y}/${h.deNamePlural}/importdata2`; let f = `${y}/${h.deNamePlural}/importtemplate`, u = `${y}/${h.deNamePlural}/importdata2`;
const m = t.getPSAppDEDataImport(); const l = e.getPSAppDEDataImport();
m && (f += `?srfimporttag=${m.codeName}`, u += `?srfimporttag=${m.codeName}`); l && (f += `?srfimporttag=${l.codeName}`, u += `?srfimporttag=${l.codeName}`);
const D = ibiz.overlay.createModal( const w = ibiz.overlay.createModal(
"DataImport", "DataImport",
{ {
templateUrl: f, templateUrl: f,
importUrl: u, importUrl: u,
dismiss: (P) => { dismiss: (E) => {
D.dismiss(P); w.dismiss(E);
} }
}, },
{ {
...@@ -1416,35 +1431,35 @@ class qe extends re { ...@@ -1416,35 +1431,35 @@ class qe extends re {
placement: "center" placement: "center"
} }
); );
return D.present(), await D.onWillDismiss(), { return w.present(), await w.onWillDismiss(), {
refresh: !0 refresh: !0
}; };
} }
} }
if (["TOP", "WIZARD"].includes(v)) { if (["TOP", "WIZARD"].includes(v)) {
const p = t.getFrontPSAppView(); const p = e.getFrontPSAppView();
if (!p) if (!p)
throw new Error("未配置打开视图"); throw new Error("未配置打开视图");
await p.fill(!0); await p.fill(!0);
const { resultContext: h, resultParams: g } = await this.handleParams( const { resultContext: h, resultParams: g } = await this.handleParams(
e,
t, t,
a, a,
e, c
i ), i = await ibiz.commands.execute(
), l = await ibiz.commands.execute(
q.TAG, q.TAG,
p, p,
h, h,
g, g,
n n
); );
(l == null ? void 0 : l.ok) === !1 && (c.closeView = !1, c.refresh = !1, c.cancel = !0), l != null && l.ok && l.data && (c.data = l.data); (i == null ? void 0 : i.ok) === !1 && (d.closeView = !1, d.refresh = !1, d.cancel = !0), i != null && i.ok && i.data && (d.data = i.data);
} else if (n) { } else if (n) {
const { neuron: p } = n, g = p.call.getFormController().call.getFormController(), { druipart1: l, druipart2: y, druipart3: f } = g.details; const { neuron: p } = n, g = p.call.getFormController().call.getFormController(), { druipart1: i, druipart2: y, druipart3: f } = g.details;
[ [
{ {
message: "服务履历为空", message: "服务履历为空",
neuron: l neuron: i
}, },
{ {
message: "教育经验为空", message: "教育经验为空",
...@@ -1454,22 +1469,22 @@ class qe extends re { ...@@ -1454,22 +1469,22 @@ class qe extends re {
message: "项目经验为空", message: "项目经验为空",
neuron: f neuron: f
} }
].some((D) => { ].some((w) => {
const P = D.neuron.neuron.call.getGridController(); const E = w.neuron.neuron.call.getGridController();
if (P) { if (E) {
const k = P.call.getGridController(); const I = E.call.getGridController();
if (k && k.items && k.items.length > 0) if (I && I.items && I.items.length > 0)
return !1; return !1;
} }
return ibiz.message.error(`${D.message}`, 1.5, !0), !0; return ibiz.message.error(`${w.message}`, 1.5, !0), !0;
}) || await p.call.wfStart(); }) || await p.call.wfStart();
} }
return c; return d;
} }
} }
class Ke { class Ke {
constructor() { constructor() {
E(this, "handler"); C(this, "handler");
} }
async getHandler() { async getHandler() {
return this.handler || (this.handler = new qe()), this.handler; return this.handler || (this.handler = new qe()), this.handler;
...@@ -1477,65 +1492,65 @@ class Ke { ...@@ -1477,65 +1492,65 @@ class Ke {
} }
class Je { class Je {
constructor() { constructor() {
E(this, "component", "FormMDCtrlFormStyle2"); C(this, "component", "FormMDCtrlFormStyle2");
} }
async createController(t, a, e) { async createController(e, t, a) {
const i = new le(t, a, e); const c = new le(e, t, a);
return await i.init(), i; return await c.init(), c;
} }
} }
class Xe { class Xe {
constructor() { constructor() {
E(this, "formEditor", "AutoSelectAll"); C(this, "formEditor", "AutoSelectAll");
E(this, "gridEditor", "AutoSelectAll"); C(this, "gridEditor", "AutoSelectAll");
} }
async createController(t, a) { async createController(e, t) {
const e = new oe(t, a); const a = new oe(e, t);
return await e.init(), e; return await a.init(), a;
} }
} }
class Ze { class Ze {
constructor() { constructor() {
E(this, "formEditor", "MPickerCheckbox"); C(this, "formEditor", "MPickerCheckbox");
E(this, "gridEditor", "IBizGridPicker"); C(this, "gridEditor", "IBizGridPicker");
} }
async createController(t, a) { async createController(e, t) {
const e = new oe(t, a); const a = new oe(e, t);
return await e.init(), e; return await a.init(), a;
} }
} }
class Qe extends re { class Qe extends re {
async execAction(t, a, e, i, n) { async execAction(e, t, a, c, n) {
const c = {}, { frontProcessType: v } = t; const d = {}, { frontProcessType: v } = e;
if (v === "OPENHTMLPAGE") { if (v === "OPENHTMLPAGE") {
const p = ne.fill(t.htmlPageUrl, a, e == null ? void 0 : e[0]); const p = ne.fill(e.htmlPageUrl, t, a == null ? void 0 : a[0]);
window.open(p, "_blank"); window.open(p, "_blank");
} }
if (v === "DATAIMP") { if (v === "DATAIMP") {
const p = t.getPSAppDataEntity(); const p = e.getPSAppDataEntity();
if (p) { if (p) {
p.isFill === !1 && await p.fill(!0); p.isFill === !1 && await p.fill(!0);
const h = new H(p); const h = new H(p);
await h.init(); await h.init();
const { resultContext: g } = await this.handleParams( const { resultContext: g } = await this.handleParams(
e,
t, t,
a, a,
e, c
i ), i = ibiz.resourcePathUtil.calcPaths(
), l = ibiz.resourcePathUtil.calcPaths(
g, g,
h.codeName h.codeName
), y = K(g, l); ), y = K(g, i);
let f = `${y}/${h.deNamePlural}/importtemplate`, u = `${y}/${h.deNamePlural}/importdata2`; let f = `${y}/${h.deNamePlural}/importtemplate`, u = `${y}/${h.deNamePlural}/importdata2`;
const m = t.getPSAppDEDataImport(); const l = e.getPSAppDEDataImport();
m && (f += `?srfimporttag=${m.codeName}`, u += `?srfimporttag=${m.codeName}`); l && (f += `?srfimporttag=${l.codeName}`, u += `?srfimporttag=${l.codeName}`);
const D = ibiz.overlay.createModal( const w = ibiz.overlay.createModal(
"DataImport", "DataImport",
{ {
templateUrl: f, templateUrl: f,
importUrl: u, importUrl: u,
dismiss: (P) => { dismiss: (E) => {
D.dismiss(P); w.dismiss(E);
} }
}, },
{ {
...@@ -1543,39 +1558,39 @@ class Qe extends re { ...@@ -1543,39 +1558,39 @@ class Qe extends re {
placement: "center" placement: "center"
} }
); );
return D.present(), await D.onWillDismiss(), { return w.present(), await w.onWillDismiss(), {
refresh: !0 refresh: !0
}; };
} }
} }
if (["TOP", "WIZARD"].includes(v)) { if (["TOP", "WIZARD"].includes(v)) {
const p = t.getFrontPSAppView(); const p = e.getFrontPSAppView();
if (!p) if (!p)
throw new Error("未配置打开视图"); throw new Error("未配置打开视图");
await p.fill(!0); await p.fill(!0);
const { resultContext: h, resultParams: g } = await this.handleParams( const { resultContext: h, resultParams: g } = await this.handleParams(
e,
t, t,
a, a,
e, c
i ), i = await ibiz.commands.execute(
), l = await ibiz.commands.execute(
q.TAG, q.TAG,
p, p,
h, h,
g, g,
n n
); );
(l == null ? void 0 : l.ok) === !1 && (c.closeView = !1, c.refresh = !1, c.cancel = !0), l != null && l.ok && l.data && (c.data = l.data); (i == null ? void 0 : i.ok) === !1 && (d.closeView = !1, d.refresh = !1, d.cancel = !0), i != null && i.ok && i.data && (d.data = i.data);
} else if (e && e.length > 0 && n) { } else if (a && a.length > 0 && n) {
const { neuron: p } = n, l = await p.call.getFormController().call.getFormController().autoSave(); const { neuron: p } = n, i = await p.call.getFormController().call.getFormController().autoSave();
l && l.rcryqd && Array.isArray(l.rcryqd) && l.rcryqd.length > 0 ? await p.call.wfStart() : ibiz.message.error("入场信息为空"); i && i.rcryqd && Array.isArray(i.rcryqd) && i.rcryqd.length > 0 ? await p.call.wfStart() : ibiz.message.error("入场信息为空");
} }
return c; return d;
} }
} }
class et { class et {
constructor() { constructor() {
E(this, "handler"); C(this, "handler");
} }
async getHandler() { async getHandler() {
return this.handler || (this.handler = new Qe()), this.handler; return this.handler || (this.handler = new Qe()), this.handler;
...@@ -1583,16 +1598,16 @@ class et { ...@@ -1583,16 +1598,16 @@ class et {
} }
class tt { class tt {
constructor() { constructor() {
E(this, "component", "FormDruipart"); C(this, "component", "FormDruipart");
} }
async createController(t, a, e) { async createController(e, t, a) {
const i = new Be(t, a, e); const c = new Be(e, t, a);
return await i.init(), i; return await c.init(), c;
} }
} }
class at { class at {
constructor() { constructor() {
E(this, "component", "WfEditView"); C(this, "component", "WfEditView");
} }
} }
const pt = { const pt = {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册