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

feat: 更新dsf插件包

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