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

feat: 更新插件包sy-web

上级 d5870a3d
var ce = Object.defineProperty;
var de = (e, t, s) => t in e ? ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
var U = (e, t, s) => (de(e, typeof t != "symbol" ? t + "" : t, s), s);
import { IndexViewModel as ue, GridModel as he, ViewType as me, ModelUtil as pe } from "@ibiz-template/model";
import { GridFieldColumnController as Z, GridRowController as X, WFStepTraceViewController as fe, UploadEditorController as J, GridController as ge, GridNotifyState as we, WFDynaEditView3Controller as ve } from "@ibiz-template/controller";
import { defineComponent as L, computed as D, h as c, getCurrentInstance as A, ref as g, watch as P, toRefs as $, onUnmounted as be } from "vue";
import { useNamespace as E, useViewController as Q, usePropsWatch as B, getUploadProps as ye, getEditorEmits as K, getGridUploadProps as z, getGridEditorEmits as _, useClickOutside as Ce, useEventListener as xe, getInputProps as ke, getGridInputProps as Fe, useGridCellEditor as Se, useControlController as Le, useWFStepTraceViewController as Ee, useEditView3Controller as Ue } from "@ibiz-template/vue-util";
import { colorBlend as Pe, HttpError as Y, isImage as Ne, uploadFile as Ie, RuntimeError as Te } from "@ibiz-template/core";
import { getCookie as De, createUUID as W } from "qx-util";
import { debounce as Me } from "lodash-es";
import { safeRedirect as Re, ViewMode as ee, UIActionHandler as te, PluginStaticResource as Ae } from "@ibiz-template/runtime";
const Ge = L({
var ue = Object.defineProperty;
var he = (e, s, t) => s in e ? ue(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
var I = (e, s, t) => (he(e, typeof s != "symbol" ? s + "" : s, t), t);
import { IndexViewModel as me, GridModel as pe, ViewType as fe, ModelUtil as ge } from "@ibiz-template/model";
import { GridFieldColumnController as X, GridRowController as J, WFStepTraceViewController as ve, UploadEditorController as Q, GridController as we, GridNotifyState as be, WFDynaEditView3Controller as ye } from "@ibiz-template/controller";
import { defineComponent as U, computed as $, h as c, getCurrentInstance as A, ref as v, watch as T, toRefs as z, onUnmounted as Ce } from "vue";
import { useNamespace as N, useViewController as K, usePropsWatch as B, getUploadProps as xe, getEditorEmits as Y, getGridUploadProps as _, getGridEditorEmits as j, useClickOutside as ke, useEventListener as Fe, getInputProps as Se, getGridInputProps as Le, useGridCellEditor as Ee, useControlController as Ue, useWFStepTraceViewController as Pe, useEditView3Controller as Ne } from "@ibiz-template/vue-util";
import { colorBlend as Ie, HttpError as ee, isImage as Te, uploadFile as De, RuntimeError as Me } from "@ibiz-template/core";
import { getCookie as $e, createUUID as V } from "qx-util";
import { debounce as Re } from "lodash-es";
import { safeRedirect as Ae, ViewMode as te, UIActionHandler as se, PluginStaticResource as Ge } from "@ibiz-template/runtime";
const Oe = U({
name: "CodeListGridColumn",
props: {
controller: {
type: Z,
type: X,
required: !0
},
row: {
type: X,
type: J,
required: !0
}
},
setup(e) {
const t = E("grid-field-column"), s = D(() => {
var r;
const s = N("grid-field-column"), t = $(() => {
var n;
if (e.controller.model.source.cLConvertMode !== "FRONT")
return [];
const n = e.row.data[e.controller.model.codeName];
return (r = e.controller.codeListItems) != null && r.length && n ? n.split(",").map((m) => {
const p = e.controller.codeListItems.find((f) => f.value === m);
const r = e.row.data[e.controller.model.codeName];
return (n = e.controller.codeListItems) != null && n.length && r ? r.split(",").map((h) => {
const p = e.controller.codeListItems.find((g) => g.value === h);
if (p) {
const f = p.color || "#515a6e";
const g = p.color || "#515a6e";
return {
text: p.text,
colorStyle: t.cssVarBlock({
color: f,
"border-color": f,
"bg-color": Pe(f, "#fff")
colorStyle: s.cssVarBlock({
color: g,
"border-color": g,
"bg-color": Ie(g, "#fff")
})
};
}
}).filter(Boolean) : [];
}), o = (n) => {
e.controller.isLinkColumn && e.controller.openLinkView(e.row, n);
}, i = D(() => {
let n = "";
}), o = (r) => {
e.controller.isLinkColumn && e.controller.openLinkView(e.row, r);
}, i = $(() => {
let r = "";
switch (e.controller.model.align) {
case "LEFT":
n = "flex-start";
r = "flex-start";
break;
case "RIGHT":
n = "flex-end";
r = "flex-end";
break;
default:
n = "center";
r = "center";
break;
}
return t.cssVarBlock({
"justify-content": n
return s.cssVarBlock({
"justify-content": r
});
});
return {
ns: t,
ns: s,
alignStyle: i,
selectedItems: s,
selectedItems: t,
onCellClick: o
};
},
render() {
const e = this.controller, t = this.row.data[e.model.codeName];
const e = this.controller, s = this.row.data[e.model.codeName];
return c("div", {
class: [this.ns.b(), e.isLinkColumn && this.ns.m("link-column")],
style: this.alignStyle,
on: {
click: this.onCellClick
}
}, [this.selectedItems.length > 0 ? this.selectedItems.map((s) => c("span", {
}, [this.selectedItems.length > 0 ? this.selectedItems.map((t) => c("span", {
class: this.ns.e("code-list-item"),
style: s.colorStyle
}, [s.text])) : c("span", {
style: t.colorStyle
}, [t.text])) : c("span", {
class: this.ns.e("text")
}, [t])]);
}, [s])]);
}
});
class Oe extends fe {
class ze extends ve {
constructor() {
super(...arguments);
/**
......@@ -92,16 +92,16 @@ class Oe extends fe {
* @type {string}
* @memberof PresetWFChartViewController
*/
U(this, "imgSrc");
I(this, "imgSrc");
}
async getUIData() {
const s = Object.assign(this.context.clone(), this.params), o = await this.entityService.wf.getWFProcessDiagram(s), i = new Blob([o.data], {
const t = Object.assign(this.context.clone(), this.params), o = await this.entityService.wf.getWFProcessDiagram(t), i = new Blob([o.data], {
type: "image/svg+xml"
});
this.imgSrc = URL.createObjectURL(i);
}
}
const $e = L({
const Be = U({
name: "PresetWFChartView",
props: {
context: Object,
......@@ -121,12 +121,12 @@ const $e = L({
}
},
setup(e) {
const t = E("preset-wf-chart-view"), {
proxy: s
} = A(), o = Q(s, (i, n) => new Oe(e.modelPath, i, n));
return B(s, "deName", o.setDeName.bind(o)), {
const s = N("preset-wf-chart-view"), {
proxy: t
} = A(), o = K(t, (i, r) => new ze(e.modelPath, i, r));
return B(t, "deName", o.setDeName.bind(o)), {
c: o,
ns: t
ns: s
};
},
render() {
......@@ -139,7 +139,7 @@ const $e = L({
})]);
}
});
const Be = L({
const _e = U({
name: "WFToolbar",
props: {
wfLinks: {
......@@ -148,16 +148,16 @@ const Be = L({
}
},
setup(e, {
emit: t
emit: s
}) {
const s = E("wf-toolbar"), o = async (n, r) => {
t("wf-link-click", n, r);
const t = N("wf-toolbar"), o = async (r, n) => {
s("wf-link-click", r, n);
};
return {
ns: s,
handleClick: async (n, r) => {
ns: t,
handleClick: async (r, n) => {
setTimeout(() => {
o(n, r);
o(r, n);
}, 30);
}
};
......@@ -166,200 +166,209 @@ const Be = L({
const e = this.wfLinks || [];
return c("div", {
class: `${this.ns.b()}`
}, [e.length > 0 && e.map((t) => {
const s = t.sequenceFlowName == "驳回" || t.sequenceFlowName == "取消", o = t.sequenceFlowName.startsWith("保存") || t.sequenceFlowName.startsWith("关闭") || t.sequenceFlowName.startsWith("保存并关闭");
}, [e.length > 0 && e.map((s) => {
const t = s.sequenceFlowName == "驳回" || s.sequenceFlowName == "取消", o = s.sequenceFlowName.startsWith("保存") || s.sequenceFlowName.startsWith("关闭") || s.sequenceFlowName.startsWith("保存并关闭");
return c("div", {
key: t.sequenceFlowId,
class: [this.ns.e("item"), o ? this.ns.em("item", "plain") : "", s ? this.ns.em("item", "reject") : ""]
key: s.sequenceFlowId,
class: [this.ns.e("item"), o ? this.ns.em("item", "plain") : "", t ? this.ns.em("item", "reject") : ""]
}, [c("i-button", {
attrs: {
title: t.sequenceFlowName
title: s.sequenceFlowName
},
on: {
click: (i) => this.handleClick(t, i)
click: (i) => this.handleClick(s, i)
}
}, [t.sequenceFlowName || ""])]);
}, [s.sequenceFlowName || ""])]);
})]);
}
}), ze = typeof btoa == "function", j = typeof Buffer == "function";
}), je = typeof btoa == "function", W = typeof Buffer == "function";
typeof TextDecoder == "function" && new TextDecoder();
const V = typeof TextEncoder == "function" ? new TextEncoder() : void 0, _e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", R = Array.prototype.slice.call(_e);
const q = typeof TextEncoder == "function" ? new TextEncoder() : void 0, We = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", R = Array.prototype.slice.call(We);
((e) => {
let t = {};
return e.forEach((s, o) => t[s] = o), t;
let s = {};
return e.forEach((t, o) => s[t] = o), s;
})(R);
const T = String.fromCharCode.bind(String);
const M = String.fromCharCode.bind(String);
typeof Uint8Array.from == "function" && Uint8Array.from.bind(Uint8Array);
const je = (e) => e.replace(/=/g, "").replace(/[+\/]/g, (t) => t == "+" ? "-" : "_"), We = (e) => {
let t, s, o, i, n = "";
const r = e.length % 3;
const Ve = (e) => e.replace(/=/g, "").replace(/[+\/]/g, (s) => s == "+" ? "-" : "_"), qe = (e) => {
let s, t, o, i, r = "";
const n = e.length % 3;
for (let a = 0; a < e.length; ) {
if ((s = e.charCodeAt(a++)) > 255 || (o = e.charCodeAt(a++)) > 255 || (i = e.charCodeAt(a++)) > 255)
if ((t = e.charCodeAt(a++)) > 255 || (o = e.charCodeAt(a++)) > 255 || (i = e.charCodeAt(a++)) > 255)
throw new TypeError("invalid character found");
t = s << 16 | o << 8 | i, n += R[t >> 18 & 63] + R[t >> 12 & 63] + R[t >> 6 & 63] + R[t & 63];
s = t << 16 | o << 8 | i, r += R[s >> 18 & 63] + R[s >> 12 & 63] + R[s >> 6 & 63] + R[s & 63];
}
return r ? n.slice(0, r - 3) + "===".substring(r) : n;
}, se = ze ? (e) => btoa(e) : j ? (e) => Buffer.from(e, "binary").toString("base64") : We, Ve = j ? (e) => Buffer.from(e).toString("base64") : (e) => {
let s = [];
return n ? r.slice(0, n - 3) + "===".substring(n) : r;
}, oe = je ? (e) => btoa(e) : W ? (e) => Buffer.from(e, "binary").toString("base64") : qe, He = W ? (e) => Buffer.from(e).toString("base64") : (e) => {
let t = [];
for (let o = 0, i = e.length; o < i; o += 4096)
s.push(T.apply(null, e.subarray(o, o + 4096)));
return se(s.join(""));
}, qe = (e) => {
t.push(M.apply(null, e.subarray(o, o + 4096)));
return oe(t.join(""));
}, Ze = (e) => {
if (e.length < 2) {
var t = e.charCodeAt(0);
return t < 128 ? e : t < 2048 ? T(192 | t >>> 6) + T(128 | t & 63) : T(224 | t >>> 12 & 15) + T(128 | t >>> 6 & 63) + T(128 | t & 63);
var s = e.charCodeAt(0);
return s < 128 ? e : s < 2048 ? M(192 | s >>> 6) + M(128 | s & 63) : M(224 | s >>> 12 & 15) + M(128 | s >>> 6 & 63) + M(128 | s & 63);
} else {
var t = 65536 + (e.charCodeAt(0) - 55296) * 1024 + (e.charCodeAt(1) - 56320);
return T(240 | t >>> 18 & 7) + T(128 | t >>> 12 & 63) + T(128 | t >>> 6 & 63) + T(128 | t & 63);
}
}, He = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, Ze = (e) => e.replace(He, qe), q = j ? (e) => Buffer.from(e, "utf8").toString("base64") : V ? (e) => Ve(V.encode(e)) : (e) => se(Ze(e)), oe = (e, t = !1) => t ? je(q(e)) : q(e);
function Xe(e, t, s) {
var k;
const o = g([]), i = g({
Authorization: `Bearer ${De("access_token")}`
}), n = g(""), r = g(""), a = {
var s = 65536 + (e.charCodeAt(0) - 55296) * 1024 + (e.charCodeAt(1) - 56320);
return M(240 | s >>> 18 & 7) + M(128 | s >>> 12 & 63) + M(128 | s >>> 6 & 63) + M(128 | s & 63);
}
}, Xe = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, Je = (e) => e.replace(Xe, Ze), H = W ? (e) => Buffer.from(e, "utf8").toString("base64") : q ? (e) => He(q.encode(e)) : (e) => oe(Je(e)), ie = (e, s = !1) => s ? Ve(H(e)) : H(e);
function Qe(e, s, t) {
var y;
const o = v([]), i = v({
Authorization: `Bearer ${$e("access_token")}`
}), r = v(""), n = v(""), a = {
count: 0,
cacheFiles: []
// iview上传过程中不能改default-file-list,所以需要缓存
}, d = (k = s.editorParams) == null ? void 0 : k.blackList;
let m = [];
d && typeof d == "string" && (m = d.split(",")), P(
}, l = (y = t.editorParams) == null ? void 0 : y.blackList;
let h = [];
l && typeof l == "string" && (h = l.split(",")), T(
() => e.value,
(l) => {
o.value = l ? JSON.parse(l) : [];
(d) => {
o.value = d ? JSON.parse(d) : [];
},
{ immediate: !0 }
), P(
), T(
() => e.data,
(l) => {
if (l) {
const h = s.calcBaseUrl(l);
n.value = h.uploadUrl, r.value = h.downloadUrl;
(d) => {
if (d) {
const m = t.calcBaseUrl(d);
r.value = m.uploadUrl, n.value = m.downloadUrl;
}
},
{ immediate: !0, deep: !0 }
), P(
), T(
o,
(l) => {
l != null && l.length && r.value && l.forEach((h) => {
h.url = h.url || r.value.replace("%fileId%", h.id);
(d) => {
d != null && d.length && n.value && d.forEach((m) => {
m.url = m.url || n.value.replace("%fileId%", m.id);
});
},
{ immediate: !0 }
), P(
r,
(l) => {
l && o.value.length && o.value.forEach((h) => {
h.url = r.value.replace("%fileId%", h.id);
), T(
n,
(d) => {
d && o.value.length && o.value.forEach((m) => {
m.url = n.value.replace("%fileId%", m.id);
});
},
{ immediate: !0 }
);
const p = () => {
const l = [...o.value, ...a.cacheFiles], h = l.length > 0 ? JSON.stringify(l.map((b) => ({ name: b.name, id: b.id }))) : null;
a.cacheFiles = [], t(h);
}, f = (l) => {
const h = l.name.trim().toLowerCase();
if (m.some((C) => h.endsWith(`.${C}`)))
return ibiz.message.error(`不可上传 ${m.join("、")}类型的文件!`), !1;
const d = [...o.value, ...a.cacheFiles], m = d.length > 0 ? JSON.stringify(d.map((w) => ({ name: w.name, id: w.id }))) : null;
a.cacheFiles = [], s(m);
}, g = (d) => {
const m = d.name.split(".").pop() || "";
if (t.whiteList && t.whiteList.length > 0 && !t.whiteList.includes(m))
return ibiz.message.error(`${d.name} 文件格式不正确`, 2.5, !0), !1;
if (d.size > t.defaultSize * 1024 * 1024)
return ibiz.message.error(
`${d.name} 超出限制,请选择小于${t.defaultSize}MB的文件`,
2.5,
!0
), !1;
const w = d.name.trim().toLowerCase();
if (h.some((F) => w.endsWith(`.${F}`)))
return ibiz.message.error(`不可上传 ${h.join("、")}类型的文件!`), !1;
a.count += 1;
}, F = (l) => {
l && (a.cacheFiles.push({
name: l.filename,
id: l.fileid
}, C = (d) => {
d && (a.cacheFiles.push({
name: d.filename,
id: d.fileid
}), a.count -= 1, a.count === 0 && p());
}, y = (l, h) => {
throw a.count -= 1, new Y({
response: { data: h, status: l.status }
}, b = (d, m) => {
throw a.count -= 1, new ee({
response: { data: m, status: d.status }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
});
}, x = (l) => {
}, x = (d) => {
if (e.disabled)
return;
const h = o.value.findIndex((b) => b.id === l.id);
h !== -1 && o.value.splice(h, 1), p();
}, w = (l) => {
const b = (s.parent.form || s.parent.grid).model.appEntity.deName, C = `${l.id}|${b}|${e.data.srfkey}|${s.context.srfpersonid || s.context.srfuserid}`, M = l.url || r.value.replace("%fileId%", l.id);
s.fileDownload({
url: `${M}?key=${window.btoa(C)}${Math.floor(
const m = o.value.findIndex((w) => w.id === d.id);
m !== -1 && o.value.splice(m, 1), p();
}, k = (d) => {
const w = (t.parent.form || t.parent.grid).model.appEntity.deName, P = `${d.id}|${w}|${e.data.srfkey}|${t.context.srfpersonid || t.context.srfuserid}`, F = d.url || n.value.replace("%fileId%", d.id);
t.fileDownload({
url: `${F}?key=${window.btoa(P)}${Math.floor(
1e3 + Math.random() * 9e3
)}`,
name: l.name
name: d.name
});
}, u = g(!1), v = g(""), N = g("");
}, u = v(!1), f = v(""), E = v("");
return {
uploadUrl: n,
downloadUrl: r,
uploadUrl: r,
downloadUrl: n,
headers: i,
files: o,
onDownload: w,
onError: y,
onDownload: k,
onError: b,
onRemove: x,
onSuccess: F,
beforeUpload: f,
onSuccess: C,
beforeUpload: g,
showModal: u,
modalTitle: v,
iframeUrl: N,
modalTitle: f,
iframeUrl: E,
onModalCancel: () => {
u.value = !1, v.value = "", N.value = "";
},
previewFile: (l) => {
u.value = !0, v.value = l.name;
const h = window.Environment.previewFileUrl;
if (h) {
const b = encodeURIComponent(
oe(
`${window.location.origin}${l.url}?fullfilename=${l.name}`
u.value = !1, f.value = "", E.value = "";
},
previewFile: (d) => {
u.value = !0, f.value = d.name;
const m = window.Environment.previewFileUrl;
if (m) {
const w = encodeURIComponent(
ie(
`${window.location.origin}${d.url}?fullfilename=${d.name}`
)
);
N.value = `${h}/onlinePreview?url=${b}`;
E.value = `${m}/onlinePreview?url=${w}`;
}
}
};
}
const Je = L({
const Ke = U({
name: "SyFileUpload",
props: ye(),
emits: K(),
props: xe(),
emits: Y(),
setup(e, {
emit: t
emit: s
}) {
const s = E("sy-file-upload"), o = e.controller, {
const t = N("sy-file-upload"), o = e.controller, {
uploadUrl: i,
headers: n,
files: r,
headers: r,
files: n,
onDownload: a,
onError: d,
onRemove: m,
onError: l,
onRemove: h,
onSuccess: p,
beforeUpload: f,
showModal: F,
modalTitle: y,
beforeUpload: g,
showModal: C,
modalTitle: b,
iframeUrl: x,
onModalCancel: w,
onModalCancel: k,
previewFile: u
} = Xe(e, (I) => {
t("change", I);
}, o), v = D(() => o.editorParams.showPreview ? o.editorParams.showPreview === "true" : window.Environment.kkviewon);
} = Qe(e, (D) => {
s("change", D);
}, o), f = $(() => o.editorParams.showPreview ? o.editorParams.showPreview === "true" : window.Environment.kkviewon);
return {
ns: s,
ns: t,
c: o,
uploadUrl: i,
headers: n,
files: r,
headers: r,
files: n,
onDownload: a,
onError: d,
onRemove: m,
onError: l,
onRemove: h,
onSuccess: p,
beforeUpload: f,
showModal: F,
modalTitle: y,
beforeUpload: g,
showModal: C,
modalTitle: b,
iframeUrl: x,
onModalCancel: w,
onPreview: (I) => {
v.value && u(I);
onModalCancel: k,
onPreview: (D) => {
f.value && u(D);
},
showPreview: v
showPreview: f
};
},
render(e) {
......@@ -406,9 +415,9 @@ const Je = L({
class: this.ns.b("accept-description")
}, [this.c.uploadDescription])]), e("div", {
class: this.ns.b("file-list")
}, [this.files.map((t) => e("div", {
}, [this.files.map((s) => e("div", {
class: this.ns.b("file-item"),
key: t.id
key: s.id
}, [e("div", {
class: this.ns.b("file-item-right")
}, [e("div", {
......@@ -455,14 +464,14 @@ const Je = L({
})])])])])]), e("div", {
class: this.ns.b("file-item-right-title"),
on: {
click: () => this.onPreview(t)
click: () => this.onPreview(s)
}
}, [t.name]), e("div", {
}, [s.name]), e("div", {
class: this.ns.b("file-item-right-action")
}, [e("span", {
class: this.ns.e("icon-download"),
on: {
click: () => this.onDownload(t)
click: () => this.onDownload(s)
}
}, [e("svg", {
attrs: {
......@@ -504,7 +513,7 @@ const Je = L({
})])])])]), this.showPreview ? e("span", {
class: this.ns.e("icon-preview"),
on: {
click: () => this.onPreview(t)
click: () => this.onPreview(s)
}
}, [e("svg", {
attrs: {
......@@ -553,7 +562,7 @@ const Je = L({
})])])])])]) : null, this.disabled || this.readonly ? null : e("span", {
class: this.ns.e("icon-remove"),
on: {
click: () => this.onRemove(t)
click: () => this.onRemove(s)
}
}, [e("svg", {
attrs: {
......@@ -616,55 +625,80 @@ const Je = L({
})])]);
}
});
function O(e, t) {
if (e.url = t.replace("%fileId%", e.id), e.status || (e.status = "finished"), !e.fileName) {
const s = e.name.lastIndexOf(".");
e.fileName = e.name.substring(0, s), e.fileExt = e.name.substring(s), e.isImage = Ne(e.name);
function O(e, s, t, o) {
var n, a;
const i = s.replace("%fileId%", e.id), r = ((n = t.parent) == null ? void 0 : n.form) || ((a = t.parent) == null ? void 0 : a.grid);
if (r) {
const l = r.model.appEntity.deName, h = `${e.id}|${l}|${o.srfkey}|${t.context.srfpersonid || t.context.srfuserid}`;
e.url = `${i}?key=${window.btoa(h)}${Math.floor(
1e3 + Math.random() * 9e3
)}`;
}
if (e.status || (e.status = "finished"), !e.fileName) {
const l = e.name.lastIndexOf(".");
e.fileName = e.name.substring(0, l), e.fileExt = e.name.substring(l), e.isImage = Te(e.name);
}
return e;
}
function ie(e) {
const t = g(""), s = g(""), o = g([]);
return P(
function ne(e) {
const s = v(""), t = v(""), o = v([]);
return T(
e.data,
(i) => {
if (i) {
const n = e.controller.value.calcBaseUrl(i);
t.value = n.uploadUrl, s.value = n.downloadUrl;
const r = e.controller.value.calcBaseUrl(i);
s.value = r.uploadUrl, t.value = r.downloadUrl;
}
},
{ immediate: !0, deep: !0 }
), P(
), T(
e.value,
(i) => {
o.value = i ? JSON.parse(i) : [], o.value.length && s.value && o.value.forEach((n) => {
O(n, s.value);
o.value = i ? JSON.parse(i) : [], o.value.length && t.value && o.value.forEach((r) => {
O(
r,
t.value,
e.controller.value,
e.data.value
);
});
},
{ immediate: !0 }
), P(
s,
), T(
t,
(i) => {
i && o.value.length && o.value.forEach((n) => {
O(n, i);
i && o.value.length && o.value.forEach((r) => {
O(
r,
i,
e.controller.value,
e.data.value
);
});
},
{ immediate: !0 }
), {
downloadUrl: s,
uploadUrl: t,
downloadUrl: t,
uploadUrl: s,
valueList: o
};
}
function ne(e) {
var S, k;
const t = g("undo"), s = g([]), { downloadUrl: o, value: i, uploadUrl: n, controller: r } = e, a = (k = (S = r == null ? void 0 : r.value) == null ? void 0 : S.editorParams) == null ? void 0 : k.blackList;
let d = [];
a && typeof a == "string" && (d = a.split(",")), P(
function re(e) {
var y, d;
const s = v("undo"), t = v([]), { downloadUrl: o, value: i, uploadUrl: r, controller: n, data: a } = e, l = (d = (y = n == null ? void 0 : n.value) == null ? void 0 : y.editorParams) == null ? void 0 : d.blackList;
let h = [];
l && typeof l == "string" && (h = l.split(",")), T(
i,
(l) => {
l.length > 0 && (s.value = [], l.forEach((h) => {
s.value.push(O(h, o.value));
(m) => {
m.length > 0 && (t.value = [], m.forEach((w) => {
t.value.push(
O(
w,
o.value,
n.value,
a.value
)
);
}));
},
{
......@@ -672,126 +706,133 @@ function ne(e) {
deep: !0
}
);
const m = (l, h) => {
const b = [];
return h.forEach((C, M) => {
const G = C.name.trim().toLowerCase();
if (d.some((le) => G.endsWith(`.${le}`))) {
b.push(M);
const p = (m, w) => {
if (m.some((L) => L.size > n.value.defaultSize * 1024 * 1024 ? (ibiz.message.error(
`${L.name} 超出限制,请选择小于${n.value.defaultSize}MB的文件`,
2.5,
!0
), !0) : n.value.whiteList && n.value.whiteList.length > 0 && !n.value.whiteList.includes(L.name) ? (ibiz.message.error(`${L.name} 文件格式不正确`, 2.5, !0), !0) : !1))
return !1;
const F = [];
return w.forEach((L, G) => {
const ce = L.name.trim().toLowerCase();
if (h.some((de) => ce.endsWith(`.${de}`))) {
F.push(G);
return;
}
s.value.push({
name: C.name,
status: C.status,
percentage: C.percentage,
id: C.uid,
t.value.push({
name: L.name,
status: L.status,
percentage: L.percentage,
id: L.uid,
url: ""
});
}), b.length === h.length ? (ibiz.message.error(`不可上传 ${d.join("、")}类型的文件!`), !1) : (b.length && (b.forEach((C) => {
l.splice(C, 1), h.splice(C, 1);
}), ibiz.message.error(`不可上传 ${d.join("、")}类型的文件!`)), !0);
}, p = (l) => {
l.forEach((h) => {
s.value.find((b) => b.id === h.uid ? (b.percentage = h.percentage, !0) : !1);
}), F.length === w.length ? (ibiz.message.error(`不可上传 ${h.join("、")}类型的文件!`), !1) : (F.length && (F.forEach((L) => {
m.splice(L, 1), w.splice(L, 1);
}), ibiz.message.error(`不可上传 ${h.join("、")}类型的文件!`)), !0);
}, g = (m) => {
m.forEach((w) => {
t.value.find((P) => P.id === w.uid ? (P.percentage = w.percentage, !0) : !1);
});
}, f = (l, h) => {
l.forEach((b) => {
s.value.find((C) => C.id === b.uid ? (C.status = b.status, C.id = h.data.fileid, C.name = h.data.filename, O(C, o.value), !0) : !1);
}, C = (m, w) => {
m.forEach((P) => {
t.value.find((F) => F.id === P.uid ? (F.status = P.status, F.id = w.data.fileid, F.name = w.data.filename, O(F, o.value, n.value, a.value), !0) : !1);
});
}, F = (l, h) => {
var C;
l.forEach((M) => {
s.value.find((G) => G.id === M.uid ? (G.status = M.status, !0) : !1);
}, b = (m, w) => {
var F;
m.forEach((L) => {
t.value.find((G) => G.id === L.uid ? (G.status = L.status, !0) : !1);
});
const b = new Y(h);
const P = new ee(w);
ibiz.notification.error({
title: (C = b.status) == null ? void 0 : C.toString(),
desc: b.message,
title: (F = P.status) == null ? void 0 : F.toString(),
desc: P.message,
duration: 10
});
}, y = (l) => {
s.value = s.value.filter((h) => h.status === "finished"), t.value = "done";
}, x = () => {
Ie({
}, x = (m) => {
t.value = t.value.filter((w) => w.status === "finished"), s.value = "done";
}, k = () => {
De({
multiple: e.multiple,
accept: e.accept,
uploadUrl: n.value,
beforeUpload: m,
progress: p,
success: f,
error: F,
finish: y
uploadUrl: r.value,
beforeUpload: p,
progress: g,
success: C,
error: b,
finish: x
});
}, w = g(!1), u = g(""), v = g("");
}, u = v(!1), f = v(""), E = v("");
return {
selectFile: x,
fileList: s,
uploadState: t,
showModal: w,
modalTitle: u,
iframeUrl: v,
selectFile: k,
fileList: t,
uploadState: s,
showModal: u,
modalTitle: f,
iframeUrl: E,
onModalCancel: () => {
w.value = !1, u.value = "", v.value = "";
},
previewFile: (l) => {
w.value = !0, u.value = l.name;
const h = window.Environment.previewFileUrl;
if (h) {
const b = encodeURIComponent(
oe(
`${window.location.origin}${l.url}?fullfilename=${l.name}`
u.value = !1, f.value = "", E.value = "";
},
previewFile: (m) => {
u.value = !0, f.value = m.name;
const w = window.Environment.previewFileUrl;
if (w) {
const P = encodeURIComponent(
ie(
`${window.location.origin}${m.url}?fullfilename=${m.name}`
)
);
v.value = `${h}/onlinePreview?url=${b}`;
E.value = `${w}/onlinePreview?url=${P}`;
}
}
};
}
const Qe = L({
const Ye = U({
name: "SyGridFileUpload",
props: z(),
props: _(),
setup(e) {
const t = E("sy-grid-file-upload"), {
value: s,
const s = N("sy-grid-file-upload"), {
value: t,
data: o,
controller: i
} = $(e), {
downloadUrl: n,
uploadUrl: r,
} = z(e), {
downloadUrl: r,
uploadUrl: n,
valueList: a
} = ie({
value: s,
} = ne({
value: t,
data: o,
controller: i
}), {
fileList: d,
showModal: m,
fileList: l,
showModal: h,
modalTitle: p,
iframeUrl: f,
previewFile: F,
onModalCancel: y
} = ne({
downloadUrl: n,
uploadUrl: r,
iframeUrl: g,
previewFile: C,
onModalCancel: b
} = re({
downloadUrl: r,
uploadUrl: n,
value: a,
controller: i
controller: i,
data: o
}), x = (u) => {
const v = e.controller, I = v.parent.grid.model.appEntity.deName, S = `${u.id}|${I}|${o.value.srfkey}|${v.context.srfpersonid || v.context.srfuserid}`, k = u.url || n.value.replace("%fileId%", u.id);
v.fileDownload({
url: `${k}?key=${window.btoa(S)}${Math.floor(1e3 + Math.random() * 9e3)}`,
const f = e.controller, D = f.parent.grid.model.appEntity.deName, S = `${u.id}|${D}|${o.value.srfkey}|${f.context.srfpersonid || f.context.srfuserid}`, y = u.url || r.value.replace("%fileId%", u.id);
f.fileDownload({
url: `${y}?key=${window.btoa(S)}${Math.floor(1e3 + Math.random() * 9e3)}`,
name: u.name
});
}, w = D(() => e.controller.editorParams.showPreview ? e.controller.editorParams.showPreview === "true" : window.Environment.kkviewon);
}, k = $(() => e.controller.editorParams.showPreview ? e.controller.editorParams.showPreview === "true" : window.Environment.kkviewon);
return {
ns: t,
fileList: d,
showModal: m,
ns: s,
fileList: l,
showModal: h,
modalTitle: p,
iframeUrl: f,
showPreview: w,
iframeUrl: g,
showPreview: k,
downloadFile: x,
previewFile: F,
onModalCancel: y
previewFile: C,
onModalCancel: b
};
},
render() {
......@@ -839,10 +880,10 @@ const Qe = L({
}
})])]);
}
}), Ke = L({
}), et = U({
name: "SyGridFileUploadContainer",
props: z(),
emits: _(),
props: _(),
emits: j(),
render(e) {
return this.disabled || this.readonly ? e("SyGridFileUpload", {
props: {
......@@ -853,8 +894,8 @@ const Qe = L({
...this.$props
},
on: {
change: (t, s) => {
this.$emit("change", t, s);
change: (s, t) => {
this.$emit("change", s, t);
},
rowSave: () => {
this.$emit("rowSave");
......@@ -863,7 +904,7 @@ const Qe = L({
});
}
});
const Ye = L({
const tt = U({
name: "SyEditGridFileUploadPopover",
props: {
uploadUrl: {
......@@ -879,7 +920,7 @@ const Ye = L({
required: !0
},
controller: {
type: J,
type: Q,
required: !0
},
data: {
......@@ -891,44 +932,46 @@ const Ye = L({
close: (e) => !0
},
setup(e, {
emit: t
emit: s
}) {
const s = E("sy-edit-grid-file-upload-popover"), {
const t = N("sy-edit-grid-file-upload-popover"), {
downloadUrl: o,
value: i,
uploadUrl: n,
controller: r
} = $(e), {
fileList: a,
uploadState: d,
selectFile: m
} = ne({
uploadUrl: r,
controller: n,
data: a
} = z(e), {
fileList: l,
uploadState: h,
selectFile: p
} = re({
downloadUrl: o,
value: i,
uploadUrl: n,
controller: r
}), p = g(), f = g(!1), F = Ce(p, async (w) => {
t("close", {
isModified: f.value,
resultFiles: a.value
uploadUrl: r,
controller: n,
data: a
}), g = v(), C = v(!1), b = ke(g, async (u) => {
s("close", {
isModified: C.value,
resultFiles: l.value
});
});
return P(d, (w) => {
w === "done" ? (f.value = !0, F.proceed()) : w === "loading" && F.pause();
return T(h, (u) => {
u === "done" ? (C.value = !0, b.proceed()) : u === "loading" && b.pause();
}), {
ns: s,
componentRef: p,
fileList: a,
deleteFile: (w) => {
const u = a.value.findIndex((v) => v.id === w.id);
a.value.splice(u, 1), f.value = !0;
},
selectFile: m,
downloadFile: (w) => {
const u = e.controller, N = u.parent.grid.model.appEntity.deName, I = `${w.id}|${N}|${e.data.srfkey}|${u.context.srfpersonid || u.context.srfuserid}`, S = w.url || o.value.replace("%fileId%", w.id);
u.fileDownload({
url: `${S}?key=${window.btoa(I)}${Math.floor(1e3 + Math.random() * 9e3)}`,
name: w.name
ns: t,
componentRef: g,
fileList: l,
deleteFile: (u) => {
const f = l.value.findIndex((E) => E.id === u.id);
l.value.splice(f, 1), C.value = !0;
},
selectFile: p,
downloadFile: (u) => {
const f = e.controller, D = f.parent.grid.model.appEntity.deName, S = `${u.id}|${D}|${e.data.srfkey}|${f.context.srfpersonid || f.context.srfuserid}`, y = u.url || o.value.replace("%fileId%", u.id);
f.fileDownload({
url: `${y}?key=${window.btoa(S)}${Math.floor(1e3 + Math.random() * 9e3)}`,
name: u.name
});
}
};
......@@ -971,68 +1014,68 @@ const Ye = L({
}, [this.controller.uploadDescription])]);
}
});
const et = L({
const st = U({
name: "SyEditGridFileUpload",
props: z(),
emits: _(),
props: _(),
emits: j(),
setup(e, {
emit: t
emit: s
}) {
const s = E("sy-edit-grid-file-upload"), {
const t = N("sy-edit-grid-file-upload"), {
value: o,
data: i,
controller: n
} = $(e), {
downloadUrl: r,
controller: r
} = z(e), {
downloadUrl: n,
uploadUrl: a,
valueList: d
} = ie({
valueList: l
} = ne({
value: o,
data: i,
controller: n
}), m = g(), p = async () => {
if (!m.value)
throw new Te("容器元素不存在");
const f = m.value.$el, F = f.offsetHeight, y = ibiz.overlay.createPopover((u) => u(Ye, {
controller: r
}), h = v(), p = async () => {
if (!h.value)
throw new Me("容器元素不存在");
const g = h.value.$el, C = g.offsetHeight, b = ibiz.overlay.createPopover((u) => u(tt, {
props: {
value: d.value,
value: l.value,
data: i.value,
uploadUrl: a.value,
downloadUrl: r.value,
controller: n.value
downloadUrl: n.value,
controller: r.value
},
on: {
close: (v) => {
y.dismiss(v);
close: (f) => {
b.dismiss(f);
}
}
}), void 0, {
noArrow: !0,
placement: "bottom-start",
offsetOpts: {
mainAxis: -F,
mainAxis: -C,
crossAxis: 0
}
});
await y.present(f);
await b.present(g);
const {
isModified: x,
resultFiles: w
} = await y.onWillDismiss();
resultFiles: k
} = await b.onWillDismiss();
if (x) {
const u = w.length > 0 ? JSON.stringify(w.map((v) => ({
name: v.name,
id: v.id
const u = k.length > 0 ? JSON.stringify(k.map((f) => ({
name: f.name,
id: f.id
}))) : null;
t("change", u), t("rowSave");
s("change", u), s("rowSave");
}
};
return xe(m, "click", (f) => {
e.disabled || p();
return Fe(h, "click", (g) => {
!e.disabled && !e.readonly && p();
}), {
ns: s,
valueList: d,
componentRef: m
ns: t,
valueList: l,
componentRef: h
};
},
render() {
......@@ -1053,16 +1096,16 @@ const et = L({
}, [e.name])]))])]);
}
});
L({
U({
name: "SyInput",
props: ke(),
emits: K(),
props: Se(),
emits: Y(),
setup(e, {
emit: t
emit: s
}) {
const s = E("input"), i = e.controller.model, n = g(), r = g(2);
i.editorType === "TEXTAREA_10" && (r.value = 10);
const a = D(() => {
const t = N("input"), i = e.controller.model, r = v(), n = v(2);
i.editorType === "TEXTAREA_10" && (n.value = 10);
const a = $(() => {
switch (i.editorType) {
case "TEXTBOX":
return "text";
......@@ -1074,37 +1117,37 @@ L({
default:
return "string";
}
}), d = g("");
P(() => e.value, (u, v) => {
u !== v && (u ? d.value = u : d.value = "");
}), l = v("");
T(() => e.value, (u, f) => {
u !== f && (u ? l.value = u : l.value = "");
}, {
immediate: !0
});
let m = !1, p, f;
const F = Me((u) => {
f !== u.target.value && t("change", u.target.value), f = void 0, m = !1, p && p();
let h = !1, p, g;
const C = Re((u) => {
g !== u.target.value && s("change", u.target.value), g = void 0, h = !1, p && p();
}, 300, {
leading: !0
}), y = (u) => {
m = !0, F(u);
}), b = (u) => {
h = !0, C(u);
}, x = (u) => {
u && u.code === "Enter" && m && (p = () => {
n.value.$el.dispatchEvent(u);
u && u.code === "Enter" && h && (p = () => {
r.value.$el.dispatchEvent(u);
});
}, w = () => {
f = n.value.currentValue, t("change", f);
}, k = () => {
g = r.value.currentValue, s("change", g);
};
return e.autoFocus && P(n, (u) => {
return e.autoFocus && T(r, (u) => {
u && u.$el.getElementsByTagName("input")[0].focus();
}), {
ns: s,
rows: r,
ns: t,
rows: n,
type: a,
currentVal: d,
handleChange: y,
currentVal: l,
handleChange: b,
handleKeyUp: x,
handleBlur: w,
inputRef: n
handleBlur: k,
inputRef: r
};
},
render() {
......@@ -1134,28 +1177,28 @@ L({
}, [this.controller.model.unitName])])]);
}
});
L({
U({
name: "SyGridInput",
props: Fe(),
emits: _(),
props: Le(),
emits: j(),
setup(e, {
emit: t
emit: s
}) {
const s = E("grid-input"), {
const t = N("grid-input"), {
isInfoMode: o,
autoFocus: i,
componentRef: n,
onOperateChange: r,
componentRef: r,
onOperateChange: n,
onChange: a
} = Se(e, {
emit: t
} = Ee(e, {
emit: s
});
return {
ns: s,
ns: t,
isInfoMode: o,
autoFocus: i,
componentRef: n,
onOperateChange: r,
componentRef: r,
onOperateChange: n,
onChange: a
};
},
......@@ -1181,23 +1224,23 @@ L({
})]);
}
});
function H(e, t) {
function Z(e, s) {
return c("div", {
class: e.e("logo")
}, [t.appIconPath ? c("img", {
}, [s.appIconPath ? c("img", {
class: e.e("logo-img"),
attrs: {
src: t.appIconPath
src: s.appIconPath
}
}) : null, c("div", {
class: e.e("logo-caption")
}, [t.caption])]);
}, [s.caption])]);
}
const tt = L({
const ot = U({
name: "UserAppLayout",
props: {
model: {
type: ue,
type: me,
required: !0
},
// 视图是否完成加载
......@@ -1212,20 +1255,20 @@ const tt = L({
}
},
setup(e, {
emit: t
emit: s
}) {
const s = E("layout"), o = g(!1), i = () => {
o.value = !o.value, t("onCollapseChange", o.value);
}, n = D(() => e.model.source.blankMode === !0), r = D(() => !!(window.Environment.manualdownloadurl || ibiz.env.manualdownloadurl));
const t = N("layout"), o = v(!1), i = () => {
o.value = !o.value, s("onCollapseChange", o.value);
}, r = $(() => e.model.source.blankMode === !0), n = $(() => !!(window.Environment.manualdownloadurl || ibiz.env.manualdownloadurl));
return {
ns: s,
ns: t,
collapseChange: o,
isBlank: n,
isBlank: r,
collapseMenus: i,
isShowDownload: r,
isShowDownload: n,
downloadUserBook: () => {
const d = window.Environment.manualdownloadurl || ibiz.env.manualdownloadurl;
d ? Re(d, {
const l = window.Environment.manualdownloadurl || ibiz.env.manualdownloadurl;
l ? Ae(l, {
type: "_blank"
}) : console.log("环境变量里没有manualdownloadurl");
}
......@@ -1240,13 +1283,13 @@ const tt = L({
value: this.collapseChange
},
class: [this.ns.b("nav"), this.ns.is("collapse", this.collapseChange)]
}, [H(this.ns, this.model), this.$slots.menu]), c("i-layout", {
}, [Z(this.ns, this.model), this.$slots.menu]), c("i-layout", {
class: [this.ns.b("content")]
}, [c("i-header", {
class: this.ns.b("header")
}, [c("div", {
class: this.ns.be("header", "left")
}, [H(this.ns, this.model), c("div", {
}, [Z(this.ns, this.model), c("div", {
class: this.ns.be("header", "collapse-icon")
}, [this.collapseChange ? c("ion-icon", {
attrs: {
......@@ -1280,17 +1323,17 @@ const tt = L({
}, [this.$slots.tabPageExp, this.$slots.default])])]) : null;
}
});
function re(e, t) {
var n;
const s = t.firstColName, o = [];
e.source.columnType === "GROUPGRIDCOLUMN" && e.children.forEach((r) => {
o.push(re(r, t));
function ae(e, s) {
var r;
const t = s.firstColName, o = [];
e.source.columnType === "GROUPGRIDCOLUMN" && e.children.forEach((n) => {
o.push(ae(n, s));
});
const i = {
title: e.title,
width: e.source.widthUnit === "STAR" ? void 0 : e.width,
minWidth: e.width,
align: ((n = e.source.align) == null ? void 0 : n.toLowerCase()) || "center",
align: ((r = e.source.align) == null ? void 0 : r.toLowerCase()) || "center",
slot: e.codeName,
key: e.codeName,
fieldName: e.deFieldName,
......@@ -1298,74 +1341,74 @@ function re(e, t) {
tooltip: !1,
// todo 表格提示用title
resizable: !0,
sortable: !t.noSort && e.source.enableSort ? "custom" : !1,
sortable: !s.noSort && e.source.enableSort ? "custom" : !1,
columnType: e.source.columnType,
tree: e.codeName === s,
className: e.codeName === s ? "grid-group-grid-column" : ""
tree: e.codeName === t,
className: e.codeName === t ? "grid-group-grid-column" : ""
};
return o.length > 0 && Object.assign(i, { children: o }), i;
}
function st(e) {
const t = e.model, s = [], o = t.columns.map((i) => re(i, e));
return t.children.forEach((i) => {
const n = o.find((a) => a.key === i.codeName), r = e.groupField;
n && i.codeName !== r && s.push(n);
}), e.singleSelect || s.splice(0, 0, { type: "selection", width: 60 }), s;
function it(e) {
const s = e.model, t = [], o = s.columns.map((i) => ae(i, e));
return s.children.forEach((i) => {
const r = o.find((a) => a.key === i.codeName), n = e.groupField;
r && i.codeName !== n && t.push(r);
}), e.singleSelect || t.splice(0, 0, { type: "selection", width: 60 }), t;
}
function ot(e) {
const t = g([]);
function nt(e) {
const s = v([]);
return e.nerve.self.evt.on("created", () => {
t.value = st(e);
}), [D(() => {
const o = [...t.value];
if (!o.find((r) => !r.width)) {
let r = o.length - 1;
o[r].key === "rowEdit" && (r -= 1), o[r] = {
...o[r],
s.value = it(e);
}), [$(() => {
const o = [...s.value];
if (!o.find((n) => !n.width)) {
let n = o.length - 1;
o[n].key === "rowEdit" && (n -= 1), o[n] = {
...o[n],
width: void 0
};
}
const n = o.find((r) => r.columnType === "UAGRIDCOLUMN");
return n && (n.fixed = "right"), o;
}), t];
const r = o.find((n) => n.columnType === "UAGRIDCOLUMN");
return r && (r.fixed = "right"), o;
}), s];
}
function it(e) {
const t = (r) => e.items.find((a) => a.srfkey === r.srfkey);
function s(r) {
const a = t(r);
function rt(e) {
const s = (n) => e.items.find((a) => a.srfkey === n.srfkey);
function t(n) {
const a = s(n);
e.singleSelect && e.onSelectionChange([a]), e.onRowClick(a);
}
function o(r) {
e.onDbRowClick(t(r));
function o(n) {
e.onDbRowClick(s(n));
}
function i(r) {
function i(n) {
if (!e.singleSelect) {
const a = [];
r.forEach((d) => {
const m = t(d);
m && a.push(m);
n.forEach((l) => {
const h = s(l);
h && a.push(h);
}), e.onSelectionChange(a);
}
}
function n(r) {
const { column: a, order: d } = r, m = d === "asc" || d === "desc" ? d : void 0;
e.setSort(a.fieldName, m), e.load();
function r(n) {
const { column: a, order: l } = n, h = l === "asc" || l === "desc" ? l : void 0;
e.setSort(a.fieldName, h), e.load();
}
return { onRowClick: s, onDbRowClick: o, onSelectionChange: i, onSortChange: n };
return { onRowClick: t, onDbRowClick: o, onSelectionChange: i, onSortChange: r };
}
function nt(e) {
function t(i) {
function at(e) {
function s(i) {
!i || i === e.curPage || (e.curPage = i, e.load());
}
function s(i) {
function t(i) {
!i || i === e.size || (e.size = i, e.curPage === 1 && e.load());
}
function o() {
e.curPage = 1, e.load();
}
return { onPageChange: t, onPageSizeChange: s, onPageReset: o };
return { onPageChange: s, onPageSizeChange: t, onPageReset: o };
}
class rt extends ge {
class lt extends we {
constructor() {
super(...arguments);
/**
......@@ -1374,7 +1417,7 @@ class rt extends ge {
* @author: zhujiamin
* @Date: 2023-10-09 14:00:38
*/
U(this, "groups", []);
I(this, "groups", []);
/**
* 分组名称属性
*
......@@ -1382,7 +1425,7 @@ class rt extends ge {
* @date 2024-12-19 10:12:56
* @type {string}
*/
U(this, "groupField", "");
I(this, "groupField", "");
/**
* 第一列名称
*
......@@ -1390,16 +1433,16 @@ class rt extends ge {
* @date 2024-12-19 10:12:30
* @type {string}
*/
U(this, "firstColName", "");
I(this, "firstColName", "");
}
async onInit() {
const s = this.model.columns.find(
const t = this.model.columns.find(
(i) => {
var n;
return (n = i.source) == null ? void 0 : n.groupItem;
var r;
return (r = i.source) == null ? void 0 : r.groupItem;
}
);
s && (this.groupField = s.codeName);
t && (this.groupField = t.codeName);
const o = this.model.columns.find((i) => i.codeName !== this.groupField && !i.source.hideDefault && !i.source.hiddenDataItem);
o && (this.firstColName = o.codeName), await super.onInit();
}
......@@ -1409,15 +1452,15 @@ class rt extends ge {
* @author lxm
* @date 2022-08-19 14:08:50
*/
async afterLoad(s) {
async afterLoad(t) {
return await Promise.allSettled(
Object.values(this.fieldColumns).map(async (o) => {
await o.loadCodeList();
})
), this.rows = s.map((o) => {
const i = new X(o, this);
return this.gridStateNotify(i, we.LOAD), i;
}), this.handleGroup(s), s;
), this.rows = t.map((o) => {
const i = new J(o, this);
return this.gridStateNotify(i, be.LOAD), i;
}), this.handleGroup(t), t;
}
/**
* 处理分组数据
......@@ -1426,29 +1469,29 @@ class rt extends ge {
* @author: zhujiamin
* @Date: 2023-10-09 14:03:17
*/
handleGroup(s) {
handleGroup(t) {
const o = /* @__PURE__ */ new Map();
s.forEach((i) => {
const n = i[this.groupField];
o.has(n) || o.set(n, []), o.has(n) && o.get(n).push(i);
}), this.groups = [], o.forEach((i, n) => {
t.forEach((i) => {
const r = i[this.groupField];
o.has(r) || o.set(r, []), o.has(r) && o.get(r).push(i);
}), this.groups = [], o.forEach((i, r) => {
this.groups.push({
caption: `${n}`,
key: n,
caption: `${r}`,
key: r,
children: i
});
});
}
}
function at(e, t, s, o = {}) {
return Le(e, () => {
const i = new rt(t, s, o);
function ct(e, s, t, o = {}) {
return Ue(e, () => {
const i = new lt(s, t, o);
return B(e, "gridRowActiveMode", i.setGridRowActiveMode.bind(i)), i;
});
}
const lt = L({
const dt = U({
props: {
modelData: he,
modelData: pe,
context: {
type: Object,
required: !0
......@@ -1475,99 +1518,99 @@ const lt = L({
},
setup(e) {
const {
proxy: t
} = A(), s = E("grid"), o = at(t, e.modelData, e.context, e.params), [i] = ot(o), {
onRowClick: n,
onDbRowClick: r,
proxy: s
} = A(), t = N("grid"), o = ct(s, e.modelData, e.context, e.params), [i] = nt(o), {
onRowClick: r,
onDbRowClick: n,
onSelectionChange: a,
onSortChange: d
} = it(o), {
onPageChange: m,
onSortChange: l
} = rt(o), {
onPageChange: h,
onPageReset: p,
onPageSizeChange: f
} = nt(o), F = (S, k) => {
const l = t.$refs.grid;
l && (l.toggleSelect && l.toggleSelect(k), l.highlightCurrentRow && l.highlightCurrentRow(k)), n(S);
}, y = g(0), x = g(null), w = g(null);
let u = null, v = 0;
const N = () => {
onPageSizeChange: g
} = at(o), C = (S, y) => {
const d = s.$refs.grid;
d && (d.toggleSelect && d.toggleSelect(y), d.highlightCurrentRow && d.highlightCurrentRow(y)), r(S);
}, b = v(0), x = v(null), k = v(null);
let u = null, f = 0;
const E = () => {
var S;
if (x.value && ((S = e.modal) == null ? void 0 : S.mode) !== "EMBED")
if (o.model.source.enablePagingBar && w.value) {
const k = w.value.$el, l = k.offsetHeight + parseFloat(window.getComputedStyle(k).paddingTop);
y.value = x.value.offsetHeight - l;
if (o.model.source.enablePagingBar && k.value) {
const y = k.value.$el, d = y.offsetHeight + parseFloat(window.getComputedStyle(y).paddingTop);
b.value = x.value.offsetHeight - d;
} else
y.value = x.value.offsetHeight;
o.model.source.height > 0 && (y.value = o.model.source.height);
b.value = x.value.offsetHeight;
o.model.source.height > 0 && (b.value = o.model.source.height);
};
P(x, (S, k) => {
S && S !== k && (N(), window.ResizeObserver && x.value && (u = new ResizeObserver((l) => {
const h = l[0].contentRect.height;
h !== v && (N(), v = h);
T(x, (S, y) => {
S && S !== y && (E(), window.ResizeObserver && x.value && (u = new ResizeObserver((d) => {
const m = d[0].contentRect.height;
m !== f && (E(), f = m);
}), u.observe(x.value)));
}), be(() => {
}), Ce(() => {
u && u.disconnect();
});
const I = D(() => {
const D = $(() => {
const S = [];
return o.groups.forEach((k) => {
if (!k.children.length)
return o.groups.forEach((y) => {
if (!y.children.length)
return;
const h = [...k.children].shift();
const m = [...y.children].shift();
S.push({
srfkey: k.caption,
srfkey: y.caption,
isGroupData: !0,
first: h,
children: k.children,
first: m,
children: y.children,
_showChildren: !0
});
}), S;
});
return {
c: o,
ns: s,
ns: t,
columns: i,
tableData: I,
onDbRowClick: r,
onUIRowClick: F,
tableData: D,
onDbRowClick: n,
onUIRowClick: C,
onSelectionChange: a,
onSortChange: d,
onPageChange: m,
onPageSizeChange: f,
onSortChange: l,
onPageChange: h,
onPageSizeChange: g,
onPageReset: p,
tableHeight: y,
tableHeight: b,
gridRef: x,
girdPaginationRef: w
girdPaginationRef: k
};
},
render() {
if (!this.c.complete)
return;
const e = {};
return this.c.model.columns.forEach((t) => {
if (t.source.columnType === "GROUPGRIDCOLUMN")
return this.c.model.columns.forEach((s) => {
if (s.source.columnType === "GROUPGRIDCOLUMN")
return;
const s = t.codeName;
e[s] = (o) => {
const t = s.codeName;
e[t] = (o) => {
const {
row: i,
column: n
column: r
} = o;
if (i.isGroupData && n.key === this.c.firstColName)
if (i.isGroupData && r.key === this.c.firstColName)
return c("div", {
class: this.ns.b("sum"),
attrs: {
title: i.first[this.c.groupField]
}
}, [c("span", [i.first[this.c.groupField]])]);
const r = this.c.rows.find((a) => a.data.srfkey === i.srfkey);
if (r)
return c(this.c.providers[s].component, {
const n = this.c.rows.find((a) => a.data.srfkey === i.srfkey);
if (n)
return c(this.c.providers[t].component, {
props: {
controller: this.c.columns[s],
row: r
controller: this.c.columns[t],
row: n
},
key: i.srfkey + s
key: i.srfkey + t
});
};
}), c("control-layout", {
......@@ -1610,26 +1653,26 @@ const lt = L({
})])]);
}
});
class ct {
class ut {
constructor() {
U(this, "component", $e);
I(this, "component", Be);
}
}
class dt {
class ht {
constructor() {
U(this, "component", Ge);
I(this, "component", Oe);
}
async createController(t, s) {
const o = new Z(t, s);
async createController(s, t) {
const o = new X(s, t);
return await o.init(), o;
}
}
class ut {
class mt {
constructor() {
U(this, "component", "IndexView");
I(this, "component", "IndexView");
}
}
const ae = L({
const le = U({
name: "WFStepTraceGrid",
props: {
context: Object,
......@@ -1650,55 +1693,55 @@ const ae = L({
},
setup(e) {
const {
proxy: t
} = A(), s = Ee(t, e.modelPath);
B(t, "deName", s.setDeName.bind(s));
const o = E("wf-step-trace-grid"), i = g([]), n = (a, d, m = !1) => {
proxy: s
} = A(), t = Pe(s, e.modelPath);
B(s, "deName", t.setDeName.bind(t));
const o = N("wf-step-trace-grid"), i = v([]), r = (a, l, h = !1) => {
a.identitylinks.length > 0 || a.comments.length > 0 && a.comments.forEach((p) => {
var f, F, y;
m && p.type === "启动流程" || d.push({
id: W(),
var g, C, b;
h && p.type === "启动流程" || l.push({
id: V(),
nodeName: a.userTaskName,
personName: (f = p.authorName) == null ? void 0 : f.replace(/\([^)]*\)[^(]*$/, ""),
deptName: ((y = (F = p.authorName) == null ? void 0 : F.match(/.*\(([^)]*)\)[^(]*$/)) == null ? void 0 : y[1]) || "",
personName: (g = p.authorName) == null ? void 0 : g.replace(/\([^)]*\)[^(]*$/, ""),
deptName: ((b = (C = p.authorName) == null ? void 0 : C.match(/.*\(([^)]*)\)[^(]*$/)) == null ? void 0 : b[1]) || "",
time: p.time,
content: p.type,
comment: p.fullMessage
});
});
};
s.nerve.self.evt.on("mounted", () => {
t.nerve.self.evt.on("mounted", () => {
var a;
s.data && ((a = s.data.usertasks) == null || a.forEach((d) => {
if (d.usertasks && d.usertasks.length > 0) {
const m = [];
d.usertasks.forEach((p) => {
n(p, m, !0);
t.data && ((a = t.data.usertasks) == null || a.forEach((l) => {
if (l.usertasks && l.usertasks.length > 0) {
const h = [];
l.usertasks.forEach((p) => {
r(p, h, !0);
}), i.value.push({
id: W(),
nodeName: `${d.userTaskName}`,
id: V(),
nodeName: `${l.userTaskName}`,
personName: "",
deptName: "",
time: "",
content: "",
comment: "",
children: m,
children: h,
_showChildren: !0
});
} else
n(d, i.value);
}), i.value.sort((d, m) => Date.parse(d.time) - Date.parse(m.time)));
r(l, i.value);
}), i.value.sort((l, h) => Date.parse(l.time) - Date.parse(h.time)));
});
const r = g([{
const n = v([{
title: "序号",
key: "index",
width: 60,
resizable: !0,
render: (a, d) => i.value.findIndex((p) => p.id === d.row.id) === -1 ? null : a("span", {
render: (a, l) => i.value.findIndex((p) => p.id === l.row.id) === -1 ? null : a("span", {
style: {
textAlign: "center"
}
}, d.index + 1)
}, l.index + 1)
}, {
title: "审批人",
key: "personName",
......@@ -1732,10 +1775,10 @@ const ae = L({
width: 100
}]);
return {
c: s,
c: t,
ns: o,
gridData: i,
columns: r
columns: n
};
},
render() {
......@@ -1754,18 +1797,18 @@ const ae = L({
})]);
}
});
class ht extends ve {
class pt extends ye {
async calcWfToolbar() {
await super.calcWfToolbar(), this.isEditable && this.wfLinks.unshift({
sequenceFlowName: "保存",
type: "FORM_SAVE"
});
}
async onLinkClick(t) {
t.type === "FORM_SAVE" ? await this.save() : super.onLinkClick(t);
async onLinkClick(s) {
s.type === "FORM_SAVE" ? await this.save() : super.onLinkClick(s);
}
}
L({
U({
props: {
context: Object,
params: {
......@@ -1781,26 +1824,26 @@ L({
},
setup(e) {
const {
proxy: t
} = A(), s = Q(t, (r, a) => new ht(e.modelPath, r, a)), o = E(`view-${me.DE_WF_DYNA_EDIT_VIEW3}`.toLowerCase()), i = g(["mainForm"]);
proxy: s
} = A(), t = K(s, (n, a) => new pt(e.modelPath, n, a)), o = N(`view-${fe.DE_WF_DYNA_EDIT_VIEW3}`.toLowerCase()), i = v(["mainForm"]);
return {
c: s,
c: t,
ns: o,
onTabClick: (r) => {
i.value.includes(r) || i.value.push(r);
onTabClick: (n) => {
i.value.includes(n) || i.value.push(n);
},
lazyList: i
};
},
render(e) {
const t = [];
const s = [];
if (this.c.complete) {
const {
activeForm: s
activeForm: t
} = this.c;
s && this.c.providers[s.name] && t.push(e(this.c.providers[s.name].component, {
t && this.c.providers[t.name] && s.push(e(this.c.providers[t.name].component, {
props: {
modelData: s,
modelData: t,
context: this.c.context,
params: this.c.params
},
......@@ -1813,14 +1856,14 @@ L({
}));
}
if (this.c.complete && this.c.model.drTab.pages[0]) {
const s = this.c.model.drTab.pages[0], o = this.c.drPages[s.source.name];
t.push(e(ae, {
const t = this.c.model.drTab.pages[0], o = this.c.drPages[t.source.name];
s.push(e(le, {
attrs: {
context: o.context,
params: o.params,
deName: this.c.model.appEntity.source.codeName,
modal: this.modal,
modelPath: s.embedView.source.modelPath
modelPath: t.embedView.source.modelPath
}
}));
}
......@@ -1834,8 +1877,8 @@ L({
wfLinks: this.c.wfLinks
},
on: {
"wf-link-click": (s) => {
this.c.onLinkClick(s);
"wf-link-click": (t) => {
this.c.onLinkClick(t);
}
}
})] : null
......@@ -1855,36 +1898,36 @@ L({
label: this.c.model.drTab.source.editItemCaption,
name: "mainForm"
}
}, [t]), this.c.model.drTab.pages.map((s) => {
const o = this.c.drPages[s.source.name];
}, [s]), this.c.model.drTab.pages.map((t) => {
const o = this.c.drPages[t.source.name];
return e("i-tab-pane", {
class: this.ns.be("", "tab-item"),
attrs: {
tab: this.c.model.drTab.source.name,
disabled: this.c.isNewData,
label: s.source.caption,
name: s.source.name
label: t.source.caption,
name: t.source.name
}
}, [!this.c.isNewData && this.lazyList.includes(s.source.name) && e("ViewShell", {
}, [!this.c.isNewData && this.lazyList.includes(t.source.name) && e("ViewShell", {
attrs: {
context: o.context,
params: o.params,
modal: {
mode: ee.EMBED
mode: te.EMBED
},
modelPath: s.embedView.source.modelPath,
modelPath: t.embedView.source.modelPath,
// 流程跟踪视图用
deName: this.c.model.appEntity.source.codeName
},
on: {
neuronInit: this.c.nerve.onNeuronInit(s.source.name)
neuronInit: this.c.nerve.onNeuronInit(t.source.name)
},
key: o.key
})]);
})])]);
}
});
L({
U({
name: "SyEditView3",
props: {
context: Object,
......@@ -1901,13 +1944,13 @@ L({
},
setup(e) {
const {
proxy: t
} = A(), s = Ue(t, e.modelPath), o = E("view-deeditview3"), i = g(["mainForm"]);
proxy: s
} = A(), t = Ne(s, e.modelPath), o = N("view-deeditview3"), i = v(["mainForm"]);
return {
c: s,
c: t,
ns: o,
onTabClick: (r) => {
i.value.includes(r) || i.value.push(r);
onTabClick: (n) => {
i.value.includes(n) || i.value.push(n);
},
lazyList: i
};
......@@ -1944,7 +1987,7 @@ L({
on: {
neuronInit: this.c.nerve.onNeuronInit(this.c.model.form.source.name)
}
}), e(ae, {
}), e(le, {
attrs: {
context: this.c.drPages[this.c.model.drTab.pages[0].source.name].context,
params: this.c.drPages[this.c.model.drTab.pages[0].source.name].params,
......@@ -1952,53 +1995,53 @@ L({
modal: this.modal,
modelPath: this.c.model.drTab.pages[0].embedView.source.modelPath
}
})]), this.c.model.drTab.pages.map((t) => {
const s = this.c.drPages[t.source.name];
if (s)
})]), this.c.model.drTab.pages.map((s) => {
const t = this.c.drPages[s.source.name];
if (t)
return e("i-tab-pane", {
class: this.ns.be("", "tab-item"),
attrs: {
tab: this.c.model.drTab.source.name,
disabled: this.c.isNewData,
label: t.source.caption,
name: t.source.name
label: s.source.caption,
name: s.source.name
}
}, [!this.c.isNewData && this.lazyList.includes(t.source.name) && e("ViewShell", {
}, [!this.c.isNewData && this.lazyList.includes(s.source.name) && e("ViewShell", {
attrs: {
context: s.context,
params: s.params,
context: t.context,
params: t.params,
modal: {
mode: ee.EMBED
mode: te.EMBED
},
modelPath: t.embedView.source.modelPath,
modelPath: s.embedView.source.modelPath,
// 流程跟踪视图用
deName: this.c.model.appEntity.source.codeName
},
on: {
neuronInit: this.c.nerve.onNeuronInit(t.source.name)
neuronInit: this.c.nerve.onNeuronInit(s.source.name)
},
key: s.key
key: t.key
})]);
})])]);
}
});
class mt {
class ft {
constructor() {
U(this, "formEditor", "SyFileUpload");
U(this, "gridEditor", "SyGridFileUploadContainer");
I(this, "formEditor", "SyFileUpload");
I(this, "gridEditor", "SyGridFileUploadContainer");
}
async createController(t, s) {
const o = new J(t, s);
async createController(s, t) {
const o = new Q(s, t);
return await o.init(), o;
}
}
class pt extends te {
async execAction(t, s, o, i, n) {
class gt extends se {
async execAction(s, t, o, i, r) {
if (o && o.length > 0) {
const a = (await ibiz.entityService.getService("XQFBXQPS", s)).local.getList(s);
o.forEach((d) => {
const m = a.find((p) => p.srfkey === d.srfkey);
m && (m.psjg = "10", d.psjg = "10");
const a = (await ibiz.entityService.getService("XQFBXQPS", t)).local.getList(t);
o.forEach((l) => {
const h = a.find((p) => p.srfkey === l.srfkey);
h && (h.psjg = "10", l.psjg = "10");
});
}
return {
......@@ -2007,21 +2050,21 @@ class pt extends te {
};
}
}
class ft {
class vt {
constructor() {
U(this, "handler");
I(this, "handler");
}
async getHandler() {
return this.handler || (this.handler = new pt()), this.handler;
return this.handler || (this.handler = new gt()), this.handler;
}
}
class gt extends te {
async execAction(t, s, o, i, n) {
class wt extends se {
async execAction(s, t, o, i, r) {
if (o && o.length > 0) {
const a = (await ibiz.entityService.getService("XQFBXQPS", s)).local.getList(s);
o.forEach((d) => {
const m = a.find((p) => p.srfkey === d.srfkey);
m && (m.psjg = "20", d.psjg = "20");
const a = (await ibiz.entityService.getService("XQFBXQPS", t)).local.getList(t);
o.forEach((l) => {
const h = a.find((p) => p.srfkey === l.srfkey);
h && (h.psjg = "20", l.psjg = "20");
});
}
return {
......@@ -2030,49 +2073,49 @@ class gt extends te {
};
}
}
class wt {
class bt {
constructor() {
U(this, "handler");
I(this, "handler");
}
async getHandler() {
return this.handler || (this.handler = new gt()), this.handler;
return this.handler || (this.handler = new wt()), this.handler;
}
}
class vt {
class yt {
constructor() {
U(this, "component", "GroupGrid");
I(this, "component", "GroupGrid");
}
}
const bt = new Ae(import.meta.url), Nt = {
const Ct = new Ge(import.meta.url), Tt = {
mateUrl: import.meta.url,
install(e) {
pe.getModelService().then((t) => {
ge.getModelService().then((s) => {
var o;
((o = t.app.userParams) == null ? void 0 : o.autoWidth) === "true" && document.getElementsByClassName("app")[0].classList.add("auto-width");
}), bt.loadStyle(["/style.css"]), ibiz.config.enableDataInfoBar = !1, ibiz.config.gridEditShowMode = "all", e.component("WfToolbar", Be), ibiz.register.view.register(
((o = s.app.userParams) == null ? void 0 : o.autoWidth) === "true" && document.getElementsByClassName("app")[0].classList.add("auto-width");
}), Ct.loadStyle(["/style.css"]), ibiz.config.enableDataInfoBar = !1, ibiz.config.gridEditShowMode = "all", e.component("WfToolbar", _e), ibiz.register.view.register(
"VIEW_CUSTOM_SyWebIndexView",
new ut()
new mt()
), ibiz.register.view.register(
"VIEW_CUSTOM_PresetWFChartView",
new ct()
new ut()
), ibiz.register.gridColumn.register(
"GRID_COLRENDER_CodeListGridColumn",
new dt()
), e.component("SyFileUpload", Je), e.component("SyGridFileUpload", Qe), e.component("SyEditGridFileUpload", et), e.component("SyGridFileUploadContainer", Ke), ibiz.register.editor.register(
new ht()
), e.component("SyFileUpload", Ke), e.component("SyGridFileUpload", Ye), e.component("SyEditGridFileUpload", st), e.component("SyGridFileUploadContainer", et), ibiz.register.editor.register(
"EDITOR_CUSTOMSTYLE_SyFileUpload",
new mt()
), e.component("AppLayout", tt), ibiz.register.uiAction.register(
"DEUIACTION_BatchApprovalOrdersId",
new ft()
), e.component("AppLayout", ot), ibiz.register.uiAction.register(
"DEUIACTION_BatchApprovalOrdersId",
new vt()
), ibiz.register.uiAction.register(
"DEUIACTION_BatchNoApprovalOrdersId",
new wt()
), e.component("GroupGrid", lt), ibiz.register.control.register(
new bt()
), e.component("GroupGrid", dt), ibiz.register.control.register(
"GRID_RENDER_GROUP_GRID",
new vt()
new yt()
);
}
};
export {
Nt as default
Tt as default
};
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册