@ximatai/muyun-web-app 0.26.27 → 0.26.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BusinessActivityLogView-Bbe-GbNG.js → BusinessActivityLogView-fzxP3P68.js} +2 -2
- package/dist/BusinessLogListDrawer-C7wb2R6q.js +868 -0
- package/dist/CodeConfigurationView-DXrXp7kg.js +2333 -0
- package/dist/{ConfigurationTranslationView-B3Cr9Wes.js → ConfigurationTranslationView-CNWJhB8C.js} +49 -49
- package/dist/{LoginAuditLogView-DOwkqtVB.js → LoginAuditLogView-D2q4WT8W.js} +2 -2
- package/dist/{ModuleActionManagementView-DNXAhdXk.js → ModuleActionManagementView-Xd8uB3iR.js} +191 -191
- package/dist/{ModuleGovernanceView-g5W2R_Zl.js → ModuleGovernanceView-BFCfy5wB.js} +3403 -3421
- package/dist/{RequestErrorLogView-9GIz2mkQ.js → RequestErrorLogView-C-dZhHvD.js} +2 -2
- package/dist/RoleDetailWorkspaceView-BmtEBE0r.js +1435 -0
- package/dist/{RuntimeLogView-C5i19Z-u.js → RuntimeLogView-BuFuboQh.js} +51 -51
- package/dist/{WorkflowAdministrationView-CnoTudpI.js → WorkflowAdministrationView-Cb6RnlGU.js} +57 -57
- package/dist/WorkflowConfigurationView-VLObweIg.js +2227 -0
- package/dist/{WorkflowWorkbenchView-DbWqspEB.js → WorkflowWorkbenchView-CbZervUv.js} +248 -248
- package/dist/{codeConfiguration-Bno8cWxB.js → codeConfiguration-DbUEhnW7.js} +66 -49
- package/dist/configurationEditorNavigation-DZeBbg3z.js +15 -0
- package/dist/formulaReferences-CKkkdA_R.js +23 -0
- package/dist/index.css +1 -1
- package/dist/index.js +727 -727
- package/dist/{moduleMenuWorkspace-DW13bHG5.js → moduleMenuWorkspace-COanAuqc.js} +237 -248
- package/dist/{platform-components-D3NvMY3T.js → platform-components-5joS6YaR.js} +4677 -4489
- package/dist/{platform-workbench-C4OFiuG5.js → platform-workbench-le7pFe4d.js} +5457 -5296
- package/dist/types/consumer/index.d.ts +2 -1
- package/dist/types/dynamic-page-runtime/ModulePageBusinessSession.d.ts +32 -26
- package/dist/types/dynamic-page-runtime/ModulePageHostRuntime.vue.d.ts +60 -29
- package/dist/types/dynamic-page-runtime/ModuleRecordDetailActions.vue.d.ts +2 -0
- package/dist/types/dynamic-page-runtime/ModuleReferenceRecordDetailBrowser.vue.d.ts +13 -4
- package/dist/types/dynamic-page-runtime/index.d.ts +2 -2
- package/dist/types/dynamic-page-runtime/modulePageActionControls.d.ts +12 -0
- package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +18 -5
- package/dist/types/dynamic-page-runtime/recordFormAssistantCapabilities.d.ts +3 -1
- package/dist/types/dynamic-page-runtime/recordFormDraftAccess.d.ts +2 -0
- package/dist/types/dynamic-page-runtime/useModulePageSession.d.ts +16 -13
- package/dist/types/dynamic-page-runtime/useModuleRecordDataChanges.d.ts +4 -1
- package/dist/types/platform-components/ActionControlHost.vue.d.ts +16 -0
- package/dist/types/platform-components/AdaptiveHeaderActionBar.vue.d.ts +3 -0
- package/dist/types/platform-components/BusinessNotificationPanel.vue.d.ts +2 -0
- package/dist/types/platform-components/ReferenceRecordDetailBrowser.vue.d.ts +10 -0
- package/dist/types/platform-components/actionControl.d.ts +28 -0
- package/dist/types/platform-components/adaptiveHeaderActionLayout.d.ts +4 -2
- package/dist/types/platform-components/index.d.ts +3 -2
- package/dist/types/platform-components/optionFieldOptionCache.d.ts +11 -1
- package/dist/types/platform-components/recordActionBarModel.d.ts +5 -0
- package/dist/types/platform-components/recordFormFieldModel.d.ts +1 -0
- package/dist/types/platform-components/referenceRecordDetailBrowser.d.ts +13 -1
- package/dist/types/platform-components/useWorkflowDesignSession.d.ts +141 -0
- package/dist/types/platform-components/workflowDesignEditing.d.ts +8 -7
- package/dist/types/platform-components/workflowDesignOperations.d.ts +107 -0
- package/dist/types/views/CodeRuleRecoveryPanel.vue.d.ts +20 -0
- package/dist/types/views/businessRuleGovernance.d.ts +1 -2
- package/dist/types/views/codeConfiguration.d.ts +29 -1
- package/dist/types/views/codeConfigurationAssistantSurface.d.ts +17 -0
- package/dist/types/views/codeRuleSaveRecovery.d.ts +12 -0
- package/dist/types/views/useCodeConfigurationAssistant.d.ts +10 -0
- package/dist/types/views/useCodeConfigurationSession.d.ts +16 -0
- package/dist/types/views/useWorkflowConfigurationAssistant.d.ts +16 -0
- package/dist/types/views/useWorkflowConfigurationContext.d.ts +16 -2
- package/dist/types/views/useWorkflowConfigurationSession.d.ts +146 -0
- package/dist/types/views/workflowConfigurationAssistantSurface.d.ts +169 -0
- package/dist/types/views/workflowSaveRecovery.d.ts +11 -0
- package/dist/types/vue-ui-antdv/components/sidePanelHost.d.ts +3 -1
- package/dist/types/vue-ui-antdv/index.d.ts +1 -0
- package/dist/types/web-core/formulaReferences.d.ts +2 -0
- package/dist/types/web-core/workflow.d.ts +11 -1
- package/dist/useWorkflowConfigurationContext-B9GigSF8.js +78 -0
- package/dist/{workspaceViews-D2Uh4KAq.js → workspaceViews-8-LaaGxD.js} +680 -680
- package/package.json +1 -1
- package/dist/BusinessLogListDrawer-BmF-14We.js +0 -868
- package/dist/CodeConfigurationView-DdPfBjoC.js +0 -1667
- package/dist/RoleDetailWorkspaceView-BuqRT0pd.js +0 -1435
- package/dist/WorkflowConfigurationView-Cku-F1Fm.js +0 -980
- package/dist/useWorkflowConfigurationContext-eQKyqe6_.js +0 -66
|
@@ -1,980 +0,0 @@
|
|
|
1
|
-
import { E as e } from "./platform-workbench-C4OFiuG5.js";
|
|
2
|
-
import { In as t, Ir as n, Kn as r, Ln as i, Mn as a, Nn as o, Pa as s, Pn as c, Qt as ee, Vn as te, Wt as ne, a as re, bn as l, c as ie, d as ae, fr as oe, gr as u, in as se, ja as ce, l as le, m as ue, n as de, o as fe, q as pe, ro as me, s as he, t as ge, tr as _e, vr as d } from "./platform-components-D3NvMY3T.js";
|
|
3
|
-
import { t as ve } from "./useWorkflowConfigurationContext-eQKyqe6_.js";
|
|
4
|
-
import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as ye, createTextVNode as v, createVNode as y, defineComponent as b, normalizeStyle as be, onActivated as xe, onBeforeUnmount as Se, onMounted as Ce, onScopeDispose as x, openBlock as S, ref as C, renderList as we, toDisplayString as w, unref as T, watch as Te, withCtx as E } from "vue";
|
|
5
|
-
//#region src/platform-components/useWorkflowDesignHistory.ts
|
|
6
|
-
function Ee(e, t = 100) {
|
|
7
|
-
let n = C([JSON.stringify(e.value)]), r = C(0), i = C(n.value[0]), a = !1, o = 0;
|
|
8
|
-
x(() => {
|
|
9
|
-
o++;
|
|
10
|
-
}), Te(() => JSON.stringify(e.value), (e) => {
|
|
11
|
-
a || e === n.value[r.value] || (o++, n.value = [...n.value.slice(0, r.value + 1), e].slice(-t), r.value = n.value.length - 1);
|
|
12
|
-
}, { flush: "sync" });
|
|
13
|
-
function s(t) {
|
|
14
|
-
t < 0 || t >= n.value.length || (o++, a = !0, r.value = t, e.value = JSON.parse(n.value[t]), a = !1);
|
|
15
|
-
}
|
|
16
|
-
function c(t, s = t) {
|
|
17
|
-
o++, a = !0, e.value = t, n.value = [JSON.stringify(t)], r.value = 0, i.value = JSON.stringify(s), a = !1;
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
checkpoint() {
|
|
21
|
-
let e = o;
|
|
22
|
-
return () => o === e;
|
|
23
|
-
},
|
|
24
|
-
canUndo: p(() => r.value > 0),
|
|
25
|
-
canRedo: p(() => r.value < n.value.length - 1),
|
|
26
|
-
dirty: p(() => JSON.stringify(e.value) !== i.value),
|
|
27
|
-
undo: () => s(r.value - 1),
|
|
28
|
-
redo: () => s(r.value + 1),
|
|
29
|
-
markSaved: () => {
|
|
30
|
-
i.value = JSON.stringify(e.value);
|
|
31
|
-
},
|
|
32
|
-
reset: c
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region src/platform-components/workflowDesignEditing.ts
|
|
37
|
-
function D(e, t) {
|
|
38
|
-
return {
|
|
39
|
-
nodeKey: e,
|
|
40
|
-
nodeType: "approval",
|
|
41
|
-
title: t,
|
|
42
|
-
approvalMode: "all",
|
|
43
|
-
participantPolicyText: "{\"rules\":[]}",
|
|
44
|
-
allowReject: !0
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function De(e, t, n) {
|
|
48
|
-
let r = e.links.find((e) => e.routeKey === t);
|
|
49
|
-
if (!r) throw Error("请选择需要插入分支的路径");
|
|
50
|
-
let i = `${n}_join`, a = [
|
|
51
|
-
{
|
|
52
|
-
nodeKey: n,
|
|
53
|
-
nodeType: "branch",
|
|
54
|
-
title: "条件分支",
|
|
55
|
-
routeMode: "auto",
|
|
56
|
-
convergeNodeKey: i
|
|
57
|
-
},
|
|
58
|
-
D(`${n}_path1`, "分支审批1"),
|
|
59
|
-
D(`${n}_path2`, "分支审批2"),
|
|
60
|
-
{
|
|
61
|
-
nodeKey: i,
|
|
62
|
-
nodeType: "converge",
|
|
63
|
-
title: "分支汇聚",
|
|
64
|
-
convergeMode: "all"
|
|
65
|
-
}
|
|
66
|
-
];
|
|
67
|
-
if (a.some((t) => e.nodes.some((e) => e.nodeKey === t.nodeKey))) throw Error("节点标识已存在");
|
|
68
|
-
let o = [...[1, 2].flatMap((e) => [{
|
|
69
|
-
routeKey: `${n}_exit${e}`,
|
|
70
|
-
sourceNodeKey: n,
|
|
71
|
-
targetNodeKey: `${n}_path${e}`,
|
|
72
|
-
title: `路径${e}`
|
|
73
|
-
}, {
|
|
74
|
-
routeKey: `${n}_return${e}`,
|
|
75
|
-
sourceNodeKey: `${n}_path${e}`,
|
|
76
|
-
targetNodeKey: i,
|
|
77
|
-
title: "汇聚"
|
|
78
|
-
}]), {
|
|
79
|
-
routeKey: `${n}_next`,
|
|
80
|
-
sourceNodeKey: i,
|
|
81
|
-
targetNodeKey: r.targetNodeKey,
|
|
82
|
-
title: "继续"
|
|
83
|
-
}];
|
|
84
|
-
return {
|
|
85
|
-
...e,
|
|
86
|
-
nodes: [...e.nodes, ...a],
|
|
87
|
-
links: [...e.links.map((e) => e === r ? {
|
|
88
|
-
...e,
|
|
89
|
-
targetNodeKey: n
|
|
90
|
-
} : e), ...o]
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function Oe(e, t, n) {
|
|
94
|
-
let r = e.nodes.find((e) => e.nodeKey === t && e.nodeType === "branch"), i = e.nodes.find((e) => e.nodeKey === r?.convergeNodeKey && e.nodeType === "converge");
|
|
95
|
-
if (!r || !i) throw Error("分支必须绑定有效汇聚节点");
|
|
96
|
-
if (e.nodes.some((e) => e.nodeKey === n)) throw Error("节点标识已存在");
|
|
97
|
-
let a = e.links.filter((e) => e.sourceNodeKey === t).length + 1;
|
|
98
|
-
return {
|
|
99
|
-
...e,
|
|
100
|
-
nodes: [...e.nodes, D(n, `分支审批${a}`)],
|
|
101
|
-
links: [
|
|
102
|
-
...e.links,
|
|
103
|
-
{
|
|
104
|
-
routeKey: `${n}_in`,
|
|
105
|
-
sourceNodeKey: t,
|
|
106
|
-
targetNodeKey: n,
|
|
107
|
-
title: `路径${a}`
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
routeKey: `${n}_out`,
|
|
111
|
-
sourceNodeKey: n,
|
|
112
|
-
targetNodeKey: i.nodeKey,
|
|
113
|
-
title: "汇聚"
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
function ke(e, t) {
|
|
119
|
-
let n = e.nodes.find((e) => e.nodeKey === t && e.nodeType === "branch"), r = e.nodes.find((e) => e.nodeKey === n?.convergeNodeKey && e.nodeType === "converge");
|
|
120
|
-
if (!n || !r) throw Error("分支必须绑定有效汇聚节点");
|
|
121
|
-
let i = /* @__PURE__ */ new Set([t]);
|
|
122
|
-
function a(t, n = /* @__PURE__ */ new Set()) {
|
|
123
|
-
if (t === r.nodeKey) return;
|
|
124
|
-
if (n.has(t)) throw Error("分支内存在循环,请先修正路径");
|
|
125
|
-
let o = e.links.filter((e) => e.sourceNodeKey === t);
|
|
126
|
-
if (!o.length) throw Error("分支路径未到达配对汇聚节点");
|
|
127
|
-
i.add(t), o.forEach((e) => a(e.targetNodeKey, /* @__PURE__ */ new Set([...n, t])));
|
|
128
|
-
}
|
|
129
|
-
a(t), i.add(r.nodeKey);
|
|
130
|
-
let o = e.links.filter((e) => !i.has(e.sourceNodeKey) && i.has(e.targetNodeKey)), s = e.links.filter((e) => i.has(e.sourceNodeKey) && !i.has(e.targetNodeKey));
|
|
131
|
-
if (o.length !== 1 || o[0]?.targetNodeKey !== t || s.length !== 1 || s[0]?.sourceNodeKey !== r.nodeKey) throw Error("分支包含外部交叉路径,不能整体删除");
|
|
132
|
-
return {
|
|
133
|
-
...e,
|
|
134
|
-
nodes: e.nodes.filter((e) => !i.has(e.nodeKey)),
|
|
135
|
-
links: e.links.filter((e) => !i.has(e.sourceNodeKey) && (!i.has(e.targetNodeKey) || e === o[0])).map((e) => e === o[0] ? {
|
|
136
|
-
...e,
|
|
137
|
-
targetNodeKey: s[0].targetNodeKey
|
|
138
|
-
} : e)
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
function Ae(e, t, n) {
|
|
142
|
-
let r = e.links.find((e) => e.routeKey === t);
|
|
143
|
-
if (!r) throw Error("路径不存在");
|
|
144
|
-
return {
|
|
145
|
-
...e,
|
|
146
|
-
links: e.links.map((e) => e === r ? {
|
|
147
|
-
...e,
|
|
148
|
-
...n,
|
|
149
|
-
...n.defaultRoute === !0 ? { conditionExpression: void 0 } : {}
|
|
150
|
-
} : n.defaultRoute === !0 && e.sourceNodeKey === r.sourceNodeKey ? {
|
|
151
|
-
...e,
|
|
152
|
-
defaultRoute: !1
|
|
153
|
-
} : e)
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
function je(e, t, n) {
|
|
157
|
-
let r = e.links.find((e) => e.routeKey === t);
|
|
158
|
-
if (!r) throw Error("请选择需要插入节点的路径");
|
|
159
|
-
if (e.nodes.some((e) => e.nodeKey === n.nodeKey)) throw Error("节点标识已存在");
|
|
160
|
-
return {
|
|
161
|
-
...e,
|
|
162
|
-
nodes: [...e.nodes, n],
|
|
163
|
-
links: [...e.links.map((e) => e === r ? {
|
|
164
|
-
...e,
|
|
165
|
-
targetNodeKey: n.nodeKey
|
|
166
|
-
} : e), {
|
|
167
|
-
routeKey: `${n.nodeKey}_next`,
|
|
168
|
-
sourceNodeKey: n.nodeKey,
|
|
169
|
-
targetNodeKey: r.targetNodeKey,
|
|
170
|
-
title: "继续"
|
|
171
|
-
}]
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
function Me(e, t) {
|
|
175
|
-
let n = e.nodes.find((e) => e.nodeKey === t);
|
|
176
|
-
if (!n || ["start", "end"].includes(n.nodeType)) throw Error("开始和结束节点必须保留");
|
|
177
|
-
let r = e.links.filter((e) => e.targetNodeKey === t), i = e.links.filter((e) => e.sourceNodeKey === t);
|
|
178
|
-
if (r.length !== 1 || i.length !== 1 || i[0]?.conditionExpression) throw Error("该节点包含分支或复杂路径,请先调整连线,确保删除后路径含义明确");
|
|
179
|
-
return {
|
|
180
|
-
...e,
|
|
181
|
-
nodes: e.nodes.filter((e) => e.nodeKey !== t),
|
|
182
|
-
links: e.links.filter((e) => e.sourceNodeKey !== t).map((e) => e.targetNodeKey === t ? {
|
|
183
|
-
...e,
|
|
184
|
-
targetNodeKey: i[0].targetNodeKey
|
|
185
|
-
} : e)
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
function Ne(e) {
|
|
189
|
-
let t = [
|
|
190
|
-
{
|
|
191
|
-
nodeKey: "start",
|
|
192
|
-
nodeType: "start",
|
|
193
|
-
title: "提交"
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
...D("approval", "审批"),
|
|
197
|
-
requireRejectReason: !0,
|
|
198
|
-
allowRejectReturnToMe: !0,
|
|
199
|
-
allowRollback: !0,
|
|
200
|
-
requireRollbackReason: !0,
|
|
201
|
-
allowAddSign: !0
|
|
202
|
-
},
|
|
203
|
-
...e ? [{
|
|
204
|
-
nodeKey: "approved",
|
|
205
|
-
nodeType: "milestone",
|
|
206
|
-
title: "审批完成",
|
|
207
|
-
milestoneType: "approval_completed"
|
|
208
|
-
}] : [],
|
|
209
|
-
{
|
|
210
|
-
nodeKey: "end",
|
|
211
|
-
nodeType: "end",
|
|
212
|
-
title: "完成"
|
|
213
|
-
}
|
|
214
|
-
];
|
|
215
|
-
return {
|
|
216
|
-
nodes: t,
|
|
217
|
-
links: t.slice(1).map((e, n) => ({
|
|
218
|
-
routeKey: `route_${n + 1}`,
|
|
219
|
-
sourceNodeKey: t[n].nodeKey,
|
|
220
|
-
targetNodeKey: e.nodeKey,
|
|
221
|
-
title: "继续"
|
|
222
|
-
}))
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
//#endregion
|
|
226
|
-
//#region src/platform-components/workflowDesignClipboard.ts
|
|
227
|
-
var O = /* @__PURE__ */ new Set([
|
|
228
|
-
"approval",
|
|
229
|
-
"task",
|
|
230
|
-
"milestone",
|
|
231
|
-
"branch",
|
|
232
|
-
"converge"
|
|
233
|
-
]);
|
|
234
|
-
function k(e) {
|
|
235
|
-
if (e?.kind !== "muyun.workflow.fragment" || e.version !== 1 || !Array.isArray(e.nodes) || !Array.isArray(e.links) || !e.nodes.length || e.nodes.length > 500 || e.links.length > 2e3) throw Error("剪贴板中不是有效的流程片段");
|
|
236
|
-
let t = new Set(e.nodes.map((e) => e?.nodeKey)), n = new Set(e.links.map((e) => e?.routeKey));
|
|
237
|
-
if (t.size !== e.nodes.length || [...t].some((e) => typeof e != "string" || !e) || n.size !== e.links.length || [...n].some((e) => typeof e != "string" || !e) || e.nodes.some((e) => !O.has(e.nodeType)) || !t.has(e.entry) || !t.has(e.exit) || e.links.some((e) => !t.has(e.sourceNodeKey) || !t.has(e.targetNodeKey))) throw Error("流程片段包含无效节点或路径");
|
|
238
|
-
for (let t of e.nodes) if (t.nodeType === "branch" && !e.nodes.some((e) => e.nodeKey === t.convergeNodeKey && e.nodeType === "converge") || t.nodeType === "converge" && !e.nodes.some((e) => e.nodeType === "branch" && e.convergeNodeKey === t.nodeKey)) throw Error("请完整复制分支及其汇聚");
|
|
239
|
-
let r = /* @__PURE__ */ new Set();
|
|
240
|
-
function i(t, n = /* @__PURE__ */ new Set()) {
|
|
241
|
-
if (n.has(t)) throw Error("流程片段不能包含循环");
|
|
242
|
-
if (r.has(t)) return;
|
|
243
|
-
let a = e.links.filter((e) => e.sourceNodeKey === t);
|
|
244
|
-
if (t === e.exit != (a.length === 0)) throw Error("请选择具有单一入口和出口的连续流程片段");
|
|
245
|
-
for (let e of a) i(e.targetNodeKey, /* @__PURE__ */ new Set([...n, t]));
|
|
246
|
-
r.add(t);
|
|
247
|
-
}
|
|
248
|
-
if (e.links.some((t) => t.targetNodeKey === e.entry)) throw Error("流程片段入口无效");
|
|
249
|
-
if (i(e.entry), r.size !== t.size) throw Error("请选择连续的流程片段");
|
|
250
|
-
for (let t of e.nodes.filter((e) => e.nodeType === "branch")) {
|
|
251
|
-
let n = /* @__PURE__ */ new Set();
|
|
252
|
-
function r(i) {
|
|
253
|
-
if (n.has(i) || (n.add(i), i === t.convergeNodeKey)) return;
|
|
254
|
-
let a = e.links.filter((e) => e.sourceNodeKey === i);
|
|
255
|
-
if (!a.length) throw Error("分支路径必须到达配对汇聚");
|
|
256
|
-
a.forEach((e) => r(e.targetNodeKey));
|
|
257
|
-
}
|
|
258
|
-
if (r(t.nodeKey), e.links.some((e) => !n.has(e.sourceNodeKey) && n.has(e.targetNodeKey) && e.targetNodeKey !== t.nodeKey || n.has(e.sourceNodeKey) && !n.has(e.targetNodeKey) && e.sourceNodeKey !== t.convergeNodeKey)) throw Error("分支不能包含外部交叉路径");
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
function Pe(e, t) {
|
|
262
|
-
let n = new Set(t.filter((t) => O.has(e.nodes.find((e) => e.nodeKey === t)?.nodeType ?? "")));
|
|
263
|
-
for (let t of [...n]) {
|
|
264
|
-
if (e.nodes.find((e) => e.nodeKey === t)?.nodeType !== "branch") continue;
|
|
265
|
-
let r = new Set(ke(e, t).nodes.map((e) => e.nodeKey));
|
|
266
|
-
e.nodes.filter((e) => !r.has(e.nodeKey)).forEach((e) => n.add(e.nodeKey));
|
|
267
|
-
}
|
|
268
|
-
let r = e.links.filter((e) => !n.has(e.sourceNodeKey) && n.has(e.targetNodeKey)), i = e.links.filter((e) => n.has(e.sourceNodeKey) && !n.has(e.targetNodeKey));
|
|
269
|
-
if (r.length !== 1 || i.length !== 1) throw Error("请选择具有单一入口和出口的连续节点;分支会整体复制");
|
|
270
|
-
let a = {
|
|
271
|
-
kind: "muyun.workflow.fragment",
|
|
272
|
-
version: 1,
|
|
273
|
-
nodes: e.nodes.filter((e) => n.has(e.nodeKey)),
|
|
274
|
-
links: e.links.filter((e) => n.has(e.sourceNodeKey) && n.has(e.targetNodeKey)),
|
|
275
|
-
entry: r[0].targetNodeKey,
|
|
276
|
-
exit: i[0].sourceNodeKey
|
|
277
|
-
};
|
|
278
|
-
return k(a), JSON.stringify(a);
|
|
279
|
-
}
|
|
280
|
-
function Fe(e, t, n, r) {
|
|
281
|
-
if (n.length > 1e6) throw Error("流程片段过大");
|
|
282
|
-
let i;
|
|
283
|
-
try {
|
|
284
|
-
i = JSON.parse(n);
|
|
285
|
-
} catch {
|
|
286
|
-
throw Error("剪贴板中不是有效的流程片段");
|
|
287
|
-
}
|
|
288
|
-
k(i);
|
|
289
|
-
let a = e.links.find((e) => e.routeKey === t);
|
|
290
|
-
if (!a) throw Error("请选择粘贴位置的路径或节点");
|
|
291
|
-
let o = new Map(i.nodes.map((e, t) => [e.nodeKey, `${r}_n${t}`])), s = (e) => `${r}_r${e}`;
|
|
292
|
-
if (e.nodes.some((e) => [...o.values()].includes(e.nodeKey)) || e.links.some((e) => Array.from({ length: i.links.length + 1 }, (e, t) => s(t)).includes(e.routeKey))) throw Error("粘贴标识冲突,请重试");
|
|
293
|
-
let c = i.nodes.map((e) => {
|
|
294
|
-
let t = { ...e };
|
|
295
|
-
return delete t.id, delete t.version, delete t.nodeStatus, {
|
|
296
|
-
...t,
|
|
297
|
-
nodeKey: o.get(e.nodeKey),
|
|
298
|
-
convergeNodeKey: e.convergeNodeKey ? o.get(e.convergeNodeKey) : void 0,
|
|
299
|
-
selectorNodeKey: e.selectorNodeKey ? o.get(e.selectorNodeKey) : void 0
|
|
300
|
-
};
|
|
301
|
-
}), ee = i.links.map((e, t) => {
|
|
302
|
-
let n = { ...e };
|
|
303
|
-
return delete n.id, delete n.routeStatus, delete n.routeReason, delete n.selectedReason, {
|
|
304
|
-
...n,
|
|
305
|
-
routeKey: s(t),
|
|
306
|
-
sourceNodeKey: o.get(e.sourceNodeKey),
|
|
307
|
-
targetNodeKey: o.get(e.targetNodeKey)
|
|
308
|
-
};
|
|
309
|
-
});
|
|
310
|
-
return {
|
|
311
|
-
design: {
|
|
312
|
-
...e,
|
|
313
|
-
nodes: [...e.nodes, ...c],
|
|
314
|
-
links: [
|
|
315
|
-
...e.links.map((e) => e === a ? {
|
|
316
|
-
...e,
|
|
317
|
-
targetNodeKey: o.get(i.entry)
|
|
318
|
-
} : e),
|
|
319
|
-
...ee,
|
|
320
|
-
{
|
|
321
|
-
routeKey: s(ee.length),
|
|
322
|
-
sourceNodeKey: o.get(i.exit),
|
|
323
|
-
targetNodeKey: a.targetNodeKey,
|
|
324
|
-
title: "继续"
|
|
325
|
-
}
|
|
326
|
-
]
|
|
327
|
-
},
|
|
328
|
-
keys: c.map((e) => e.nodeKey),
|
|
329
|
-
reconfigureSelectorKeys: c.filter((e) => e.nodeType === "branch" && e.routeMode === "manual" && !e.selectorNodeKey).map((e) => e.nodeKey)
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region src/views/WorkflowConfigurationView.vue?vue&type=script&setup=true&lang.ts
|
|
334
|
-
var Ie = { class: "workflow-configuration" }, Le = { class: "configuration-status" }, Re = {
|
|
335
|
-
class: "configuration-state configuration-state--dirty",
|
|
336
|
-
role: "status"
|
|
337
|
-
}, ze = { class: "configuration-state" }, Be = { class: "configuration-property-operations" }, Ve = { class: "publish-nodes" }, He = { key: 0 }, Ue = { key: 0 }, We = { key: 1 }, Ge = { key: 0 }, Ke = 720, A = /*#__PURE__*/ d(/* @__PURE__ */ b({
|
|
338
|
-
name: "WorkflowConfigurationView",
|
|
339
|
-
__name: "WorkflowConfigurationView",
|
|
340
|
-
props: {
|
|
341
|
-
moduleAlias: {},
|
|
342
|
-
moduleTitle: {},
|
|
343
|
-
definitionId: {}
|
|
344
|
-
},
|
|
345
|
-
setup(d) {
|
|
346
|
-
let b = me();
|
|
347
|
-
function x(e) {
|
|
348
|
-
return ue(e, b);
|
|
349
|
-
}
|
|
350
|
-
let O = d, { context: k, client: A, businessRuntime: qe, fields: j, conditionTools: Je } = ve(O.moduleAlias), M = C({
|
|
351
|
-
tasks: [],
|
|
352
|
-
queries: [],
|
|
353
|
-
generations: [],
|
|
354
|
-
associations: []
|
|
355
|
-
}), Ye = p(() => (qe.value?.actions ?? []).map((e) => ({
|
|
356
|
-
value: e.actionCode,
|
|
357
|
-
label: e.title ?? x(e.actionCode)
|
|
358
|
-
}))), Xe = C(), Ze = de(Xe, () => Ke + te.compact + se.columnGap), N = C(!1), P = C(!1), Qe = p(() => [
|
|
359
|
-
{
|
|
360
|
-
key: "save",
|
|
361
|
-
title: b.t("platform.screen.WorkflowConfigurationView.save-draft", "保存草稿"),
|
|
362
|
-
level: "primary",
|
|
363
|
-
disabled: !K.value || !W.value
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
key: "validate",
|
|
367
|
-
title: b.t("platform.screen.WorkflowConfigurationView.validate-workflow", "校验流程"),
|
|
368
|
-
level: "secondary",
|
|
369
|
-
disabled: !K.value
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
key: "publish",
|
|
373
|
-
title: R.value?.publishStatus === "published" ? b.t("platform.screen.WorkflowConfigurationView.enable-published", "启用已发布版本") : b.t("platform.screen.WorkflowConfigurationView.publish-workflow", "发布流程"),
|
|
374
|
-
disabled: !R.value || H.value
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
key: "upgrade",
|
|
378
|
-
title: b.t("platform.screen.WorkflowConfigurationView.create-version", "创建新版本"),
|
|
379
|
-
level: "secondary",
|
|
380
|
-
disabled: !L.value || H.value || W.value
|
|
381
|
-
}
|
|
382
|
-
]), $e = p(() => q.value?.nodeType === "branch" ? [{
|
|
383
|
-
key: "path",
|
|
384
|
-
title: b.t("platform.screen.WorkflowDesignProperties.add-branch-route", "增加分支路径"),
|
|
385
|
-
disabled: !K.value
|
|
386
|
-
}] : [{
|
|
387
|
-
key: "node",
|
|
388
|
-
title: b.t("platform.screen.WorkflowConfigurationView.insert-approval-node", "插入节点"),
|
|
389
|
-
disabled: !K.value || !$()
|
|
390
|
-
}, {
|
|
391
|
-
key: "branch",
|
|
392
|
-
title: b.t("platform.screen.WorkflowConfigurationView.insert-branch-and-convergence", "添加分支"),
|
|
393
|
-
disabled: !K.value || !$()
|
|
394
|
-
}]);
|
|
395
|
-
function et(e) {
|
|
396
|
-
e === "node" ? Tt() : e === "branch" ? St() : e === "path" && Ct();
|
|
397
|
-
}
|
|
398
|
-
function tt(e) {
|
|
399
|
-
e === "save" ? mt() : e === "validate" ? ht() : e === "publish" ? P.value = !0 : e === "upgrade" && _t();
|
|
400
|
-
}
|
|
401
|
-
function nt(e) {
|
|
402
|
-
try {
|
|
403
|
-
return le(e).map((e) => ({
|
|
404
|
-
INITIATOR_SELF: b.t("platform.workflow-participant.initiator", "提交人本人"),
|
|
405
|
-
USER: b.t("platform.workflow-participant.named-accounts", "指定账号"),
|
|
406
|
-
ROLE: b.t("platform.workflow-participant.role-members", "角色成员"),
|
|
407
|
-
DEPT: b.t("platform.workflow-participant.department-members", "部门成员"),
|
|
408
|
-
ORG: b.t("platform.workflow-participant.organization-members", "组织成员"),
|
|
409
|
-
FIELD: b.t("platform.workflow-participant.participant-field", "业务人员字段"),
|
|
410
|
-
RELATIVE: b.t("platform.workflow-participant.relative-participants", "相对人员")
|
|
411
|
-
}[e.type] ?? e.type) + (e.ids?.length ? b.t("platform.workflow-config.target-count", "({count} 个目标)", { count: e.ids.length }) : e.fieldName ? `(${j.value.find((t) => t.name === e.fieldName)?.label ?? e.fieldName})` : "")).join("、") || b.t("platform.workflow-config.empty-participants", "尚未配置参与人");
|
|
412
|
-
} catch {
|
|
413
|
-
return b.t("platform.workflow-config.invalid-participants", "人员配置格式无效");
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
let rt = C(!1), F = C(), I = C([]), L = C(), R = C(), z = C({
|
|
417
|
-
nodes: [],
|
|
418
|
-
links: []
|
|
419
|
-
}), B = C(""), V = C(""), H = C(!1), U = Ee(z), W = U.dirty, G = C([]), it = p(() => ["published", "archived"].includes(R.value?.publishStatus ?? "")), K = p(() => R.value?.publishStatus === "draft" && !H.value), q = p(() => z.value.nodes.find((e) => e.nodeKey === B.value)), at = p(() => z.value.links.find((e) => e.routeKey === V.value)), J = C(!1), Y = p(() => K.value && !J.value && G.value.length === 1 && q.value != null && ![
|
|
420
|
-
"start",
|
|
421
|
-
"end",
|
|
422
|
-
"converge"
|
|
423
|
-
].includes(q.value.nodeType));
|
|
424
|
-
async function ot() {
|
|
425
|
-
if (Y.value) {
|
|
426
|
-
J.value = !0;
|
|
427
|
-
try {
|
|
428
|
-
q.value?.nodeType === "branch" ? await wt() : Et();
|
|
429
|
-
} finally {
|
|
430
|
-
J.value = !1;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
function st(e) {
|
|
435
|
-
let t = z.value.nodes.find((t) => t.nodeKey === e.convergeNodeKey), n = {
|
|
436
|
-
all: b.t("platform.workflow-config.all-arrive", "全部到达"),
|
|
437
|
-
any: b.t("platform.workflow-config.any-arrive", "任一到达"),
|
|
438
|
-
ratio: b.t("platform.workflow-config.ratio-arrive", "比例到达")
|
|
439
|
-
}, r = t?.convergeMode ?? "all";
|
|
440
|
-
return `${n[r]}${r === "ratio" ? ` ${t?.convergeRatio ?? 100}%` : ""}`;
|
|
441
|
-
}
|
|
442
|
-
n(() => b.t("platform.workflow-config.configuration", "流程配置"), () => W.value, () => H.value), Ce(() => {
|
|
443
|
-
dt();
|
|
444
|
-
});
|
|
445
|
-
let X = 0, ct = !1, lt = !1;
|
|
446
|
-
Se(() => {
|
|
447
|
-
lt = !0, X++;
|
|
448
|
-
});
|
|
449
|
-
async function ut() {
|
|
450
|
-
if (lt || !L.value) return;
|
|
451
|
-
if (H.value) {
|
|
452
|
-
ct = !0;
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
let e = ++X;
|
|
456
|
-
try {
|
|
457
|
-
let t = await A.view(O.definitionId);
|
|
458
|
-
e === X && (L.value = t);
|
|
459
|
-
} catch (t) {
|
|
460
|
-
e === X && l(t, {
|
|
461
|
-
source: "workflow-design",
|
|
462
|
-
phase: "load"
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
xe(() => {
|
|
467
|
-
ut();
|
|
468
|
-
}), e({
|
|
469
|
-
moduleAlias: "platform.workflow.definition",
|
|
470
|
-
recordId: () => O.definitionId,
|
|
471
|
-
handler: ut
|
|
472
|
-
});
|
|
473
|
-
async function Z(e) {
|
|
474
|
-
if (!H.value) {
|
|
475
|
-
X++, H.value = !0;
|
|
476
|
-
try {
|
|
477
|
-
await e();
|
|
478
|
-
} catch (e) {
|
|
479
|
-
l(e, {
|
|
480
|
-
source: "workflow-design",
|
|
481
|
-
phase: "action"
|
|
482
|
-
});
|
|
483
|
-
} finally {
|
|
484
|
-
H.value = !1, ct && (ct = !1, await ut());
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
async function dt() {
|
|
489
|
-
H.value || W.value || (rt.value = !0, F.value = void 0, await Z(async () => {
|
|
490
|
-
try {
|
|
491
|
-
let e = await A.view(O.definitionId), t = await A.catalog(e.id), n = (await A.versions(e.id)).sort((e, t) => t.versionNo - e.versionNo), r = n[0] ?? await A.upgrade(e.id);
|
|
492
|
-
n.length || n.push(r);
|
|
493
|
-
let i = await A.design(e.id, r.id), a = r.publishStatus === "draft" && !i.nodes.length;
|
|
494
|
-
a && (i = Ne(e.approvalEnabled)), L.value = e, M.value = t, I.value = n, R.value = r, U.reset(i, a ? {
|
|
495
|
-
nodes: [],
|
|
496
|
-
links: []
|
|
497
|
-
} : i), G.value = [], B.value = "", V.value = "", N.value = !1;
|
|
498
|
-
} catch (e) {
|
|
499
|
-
F.value = () => s(ce(e), b);
|
|
500
|
-
}
|
|
501
|
-
}), rt.value = !1);
|
|
502
|
-
}
|
|
503
|
-
async function ft(e) {
|
|
504
|
-
let t = await A.design(L.value.id, e.id);
|
|
505
|
-
R.value = e, U.reset(t), G.value = [], B.value = z.value.nodes[0]?.nodeKey ?? "", V.value = "", N.value = !1;
|
|
506
|
-
}
|
|
507
|
-
async function pt(e) {
|
|
508
|
-
if (W.value) return;
|
|
509
|
-
let t = I.value.find((t) => t.id === e);
|
|
510
|
-
t && await Z(() => ft(t));
|
|
511
|
-
}
|
|
512
|
-
async function mt() {
|
|
513
|
-
R.value && L.value && await Z(async () => {
|
|
514
|
-
R.value = await A.saveDesign(L.value.id, R.value.id, R.value.version, z.value), I.value = I.value.map((e) => e.id === R.value.id ? R.value : e), U.markSaved(), o(b.t("platform.workflow-config.draft-saved", "流程草稿已保存"));
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
async function ht() {
|
|
518
|
-
W.value && await mt(), !W.value && R.value && await Z(async () => {
|
|
519
|
-
await A.validate(L.value.id, R.value.id), o(b.t("platform.workflow-config.validated", "流程发布校验通过"));
|
|
520
|
-
});
|
|
521
|
-
}
|
|
522
|
-
async function gt() {
|
|
523
|
-
if (z.value.nodes.some((e) => ["approval", "task"].includes(e.nodeType) && !ie(e.participantPolicyText))) {
|
|
524
|
-
l(Error(b.t("platform.workflow-config.participants-required", "请为每个审批或业务任务节点明确配置参与人")), {
|
|
525
|
-
source: "workflow-design",
|
|
526
|
-
phase: "validation"
|
|
527
|
-
});
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
W.value && await mt(), !W.value && L.value && R.value && (await Z(async () => {
|
|
531
|
-
R.value = await A.publish(L.value.id, R.value.id, L.value.version, R.value.version), I.value = I.value.map((e) => e.id === R.value.id ? R.value : e), L.value = await A.view(L.value.id), U.markSaved(), P.value = !1, o(b.t("platform.workflow-config.published", "流程已发布,后续新申请使用该版本"));
|
|
532
|
-
}), await dt());
|
|
533
|
-
}
|
|
534
|
-
async function _t() {
|
|
535
|
-
L.value && await Z(async () => {
|
|
536
|
-
let e = await A.upgrade(L.value.id);
|
|
537
|
-
I.value = [e, ...I.value.filter((t) => t.id !== e.id)], await ft(e), z.value.nodes.length || (z.value = Ne(L.value.approvalEnabled), Q("approval"));
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
function Q(e) {
|
|
541
|
-
z.value.nodes.some((t) => t.nodeKey === e) || (e = ""), G.value = e ? [e] : [], B.value = e, V.value = "", N.value = !!e;
|
|
542
|
-
}
|
|
543
|
-
function vt(e) {
|
|
544
|
-
z.value.links.some((t) => t.routeKey === e) || (e = ""), G.value = [], V.value = e, B.value = "", N.value = !!e;
|
|
545
|
-
}
|
|
546
|
-
function yt(e) {
|
|
547
|
-
K.value && z.value.layoutJson !== e && (z.value = {
|
|
548
|
-
...z.value,
|
|
549
|
-
layoutJson: e
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
function bt(e) {
|
|
553
|
-
q.value && K.value && (z.value = {
|
|
554
|
-
...z.value,
|
|
555
|
-
nodes: z.value.nodes.map((t) => t.nodeKey === B.value ? {
|
|
556
|
-
...t,
|
|
557
|
-
...e
|
|
558
|
-
} : t)
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
function xt(e) {
|
|
562
|
-
at.value && K.value && (z.value = Ae(z.value, at.value.routeKey, e));
|
|
563
|
-
}
|
|
564
|
-
function $() {
|
|
565
|
-
let e = z.value.links.filter((e) => e.sourceNodeKey === B.value);
|
|
566
|
-
return V.value || (e.length === 1 ? e[0]?.routeKey : void 0) || "";
|
|
567
|
-
}
|
|
568
|
-
function St() {
|
|
569
|
-
if (!K.value) return;
|
|
570
|
-
let e = `branch_${Date.now().toString(36)}`;
|
|
571
|
-
try {
|
|
572
|
-
z.value = De(z.value, $(), e), Q(e);
|
|
573
|
-
} catch (e) {
|
|
574
|
-
l(e, {
|
|
575
|
-
source: "workflow-design",
|
|
576
|
-
phase: "validation"
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
function Ct() {
|
|
581
|
-
if (K.value) try {
|
|
582
|
-
z.value = Oe(z.value, B.value, `path_${Date.now().toString(36)}`);
|
|
583
|
-
} catch (e) {
|
|
584
|
-
l(e, {
|
|
585
|
-
source: "workflow-design",
|
|
586
|
-
phase: "validation"
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
async function wt() {
|
|
591
|
-
if (K.value) try {
|
|
592
|
-
let e = U.checkpoint(), t = ke(z.value, B.value);
|
|
593
|
-
if (!await c({
|
|
594
|
-
title: b.t("platform.workflow-config.delete-branch-confirm", "删除整个分支?"),
|
|
595
|
-
content: b.t("platform.workflow-config.delete-branch-detail", "将删除分支、配对汇聚及其中 {count} 个节点,并连接前后路径。", { count: z.value.nodes.length - t.nodes.length - 2 }),
|
|
596
|
-
danger: !0,
|
|
597
|
-
okText: b.t("platform.workflow-config.delete-branch", "删除分支")
|
|
598
|
-
}, b) || !Ot(e)) return;
|
|
599
|
-
z.value = t, B.value = "", N.value = !1;
|
|
600
|
-
} catch (e) {
|
|
601
|
-
l(e, {
|
|
602
|
-
source: "workflow-design",
|
|
603
|
-
phase: "validation"
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
function Tt() {
|
|
608
|
-
if (!K.value) return;
|
|
609
|
-
let e = z.value.links.filter((e) => e.sourceNodeKey === B.value), t = V.value || (e.length === 1 ? e[0]?.routeKey : void 0), n = `node_${Date.now().toString(36)}`;
|
|
610
|
-
try {
|
|
611
|
-
z.value = je(z.value, t ?? "", D(n, "新审批节点")), Q(n);
|
|
612
|
-
} catch (e) {
|
|
613
|
-
l(e, {
|
|
614
|
-
source: "workflow-design",
|
|
615
|
-
phase: "validation"
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
function Et() {
|
|
620
|
-
if (K.value) try {
|
|
621
|
-
z.value = Me(z.value, B.value), B.value = "", N.value = !1;
|
|
622
|
-
} catch (e) {
|
|
623
|
-
l(e, {
|
|
624
|
-
source: "workflow-design",
|
|
625
|
-
phase: "validation"
|
|
626
|
-
});
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
function Dt(e) {
|
|
630
|
-
let t = new Set(z.value.nodes.map((e) => e.nodeKey));
|
|
631
|
-
e = [...new Set(e)].filter((e) => t.has(e)), G.value = e, B.value = e.length === 1 ? e[0] : "", V.value = "", N.value = !1;
|
|
632
|
-
}
|
|
633
|
-
Te(() => [z.value.nodes.map((e) => e.nodeKey), z.value.links.map((e) => e.routeKey)], ([e, t]) => {
|
|
634
|
-
let n = new Set(e);
|
|
635
|
-
G.value = G.value.filter((e) => n.has(e)), B.value && !n.has(B.value) && (B.value = "", N.value = !1), V.value && !t.includes(V.value) && (V.value = "", N.value = !1);
|
|
636
|
-
}, { flush: "sync" });
|
|
637
|
-
function Ot(e) {
|
|
638
|
-
return lt ? !1 : K.value && e() ? !0 : (a(b.t("platform.workflow-config.stale-edit", "流程已变更,本次操作未应用,请重新操作。")), !1);
|
|
639
|
-
}
|
|
640
|
-
function kt() {
|
|
641
|
-
K.value && U.undo();
|
|
642
|
-
}
|
|
643
|
-
function At() {
|
|
644
|
-
K.value && U.redo();
|
|
645
|
-
}
|
|
646
|
-
function jt(e) {
|
|
647
|
-
if (e.clipboardData) try {
|
|
648
|
-
let t = Pe(z.value, G.value);
|
|
649
|
-
e.clipboardData.setData("text/plain", t), e.preventDefault();
|
|
650
|
-
} catch (e) {
|
|
651
|
-
l(e, {
|
|
652
|
-
source: "workflow-design",
|
|
653
|
-
phase: "action"
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
function Mt() {
|
|
658
|
-
let e = q.value?.nodeType === "branch" ? q.value.convergeNodeKey : void 0;
|
|
659
|
-
return $() || (e ? z.value.links.find((t) => t.sourceNodeKey === e)?.routeKey : void 0) || z.value.links.find((e) => z.value.nodes.some((t) => t.nodeKey === e.targetNodeKey && t.nodeType === "end"))?.routeKey || "";
|
|
660
|
-
}
|
|
661
|
-
function Nt(e, t) {
|
|
662
|
-
if (!K.value || !e.includes("muyun.workflow.fragment")) return;
|
|
663
|
-
let n = Fe(z.value, t, e, `copy_${crypto.randomUUID().replaceAll("-", "")}`);
|
|
664
|
-
if (z.value = n.design, n.reconfigureSelectorKeys.length) {
|
|
665
|
-
let e = n.reconfigureSelectorKeys.map((e) => n.design.nodes.find((t) => t.nodeKey === e)?.title ?? e).join("、");
|
|
666
|
-
a(b.t("platform.workflow-config.paste-reconfigure-selectors", "已粘贴,以下人工分支需要重新配置选择来源:{names}。", { names: e })), Q(n.reconfigureSelectorKeys[0]);
|
|
667
|
-
} else Dt(n.keys);
|
|
668
|
-
}
|
|
669
|
-
function Pt(e) {
|
|
670
|
-
if (!K.value || !e.clipboardData) return;
|
|
671
|
-
let t = e.clipboardData.getData("text/plain");
|
|
672
|
-
if (t.includes("muyun.workflow.fragment")) {
|
|
673
|
-
e.preventDefault();
|
|
674
|
-
try {
|
|
675
|
-
Nt(t, Mt());
|
|
676
|
-
} catch (e) {
|
|
677
|
-
l(e, {
|
|
678
|
-
source: "workflow-design",
|
|
679
|
-
phase: "action"
|
|
680
|
-
});
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
async function Ft() {
|
|
685
|
-
try {
|
|
686
|
-
if (!navigator.clipboard) throw Error("当前浏览器不支持访问剪贴板");
|
|
687
|
-
await navigator.clipboard.writeText(Pe(z.value, G.value));
|
|
688
|
-
} catch (e) {
|
|
689
|
-
l(e, {
|
|
690
|
-
source: "workflow-design",
|
|
691
|
-
phase: "action"
|
|
692
|
-
});
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
async function It() {
|
|
696
|
-
if (!K.value) return;
|
|
697
|
-
let e = U.checkpoint(), t = Mt();
|
|
698
|
-
try {
|
|
699
|
-
if (!navigator.clipboard) throw Error("当前浏览器不支持访问剪贴板");
|
|
700
|
-
let n = await navigator.clipboard.readText();
|
|
701
|
-
n.includes("muyun.workflow.fragment") && Ot(e) && Nt(n, t);
|
|
702
|
-
} catch (e) {
|
|
703
|
-
l(e, {
|
|
704
|
-
source: "workflow-design",
|
|
705
|
-
phase: "action"
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
return (e, n) => (S(), g("section", Ie, [y(T(pe), { title: L.value?.title ?? T(b).t("platform.workflow-config.configuration", "流程配置") }, ye({
|
|
710
|
-
actions: E(() => [y(T(ee), {
|
|
711
|
-
class: "configuration-action-bar",
|
|
712
|
-
actions: Qe.value,
|
|
713
|
-
onAction: n[0] ||= (e) => tt(e.key)
|
|
714
|
-
}, null, 8, ["actions"])]),
|
|
715
|
-
default: E(() => [
|
|
716
|
-
rt.value ? (S(), m(T(i), { key: 0 })) : h("v-if", !0),
|
|
717
|
-
F.value ? (S(), m(T(t), {
|
|
718
|
-
key: 1,
|
|
719
|
-
message: F.value()
|
|
720
|
-
}, null, 8, ["message"])) : h("v-if", !0),
|
|
721
|
-
F.value ? (S(), m(T(u), {
|
|
722
|
-
key: 2,
|
|
723
|
-
onClick: dt
|
|
724
|
-
}, {
|
|
725
|
-
default: E(() => [v(w(T(b).t("platform.screen.CrudRecordListExplorer.reload", "重新加载")), 1)]),
|
|
726
|
-
_: 1
|
|
727
|
-
})) : h("v-if", !0),
|
|
728
|
-
L.value ? (S(), g("div", {
|
|
729
|
-
key: 3,
|
|
730
|
-
ref_key: "designHost",
|
|
731
|
-
ref: Xe,
|
|
732
|
-
class: "configuration-design",
|
|
733
|
-
style: be({ gap: `${T(se).columnGap}px` })
|
|
734
|
-
}, [(S(), m(T(ae), {
|
|
735
|
-
key: R.value?.id,
|
|
736
|
-
nodes: z.value.nodes,
|
|
737
|
-
routes: z.value.links,
|
|
738
|
-
"selected-node-key": B.value,
|
|
739
|
-
"selected-node-keys": G.value,
|
|
740
|
-
"can-undo": T(U).canUndo.value,
|
|
741
|
-
"can-redo": T(U).canRedo.value,
|
|
742
|
-
onUndo: kt,
|
|
743
|
-
onRedo: At,
|
|
744
|
-
onSelectionChange: Dt,
|
|
745
|
-
onCopy: jt,
|
|
746
|
-
onCopyShortcut: Ft,
|
|
747
|
-
onPasteShortcut: It,
|
|
748
|
-
onDeleteSelection: ot,
|
|
749
|
-
onPaste: Pt,
|
|
750
|
-
"selected-route-key": V.value,
|
|
751
|
-
"layout-json": z.value.layoutJson,
|
|
752
|
-
editable: K.value,
|
|
753
|
-
interactive: "",
|
|
754
|
-
presentation: "designer",
|
|
755
|
-
onSelect: Q,
|
|
756
|
-
onSelectRoute: vt,
|
|
757
|
-
onLayoutChange: yt
|
|
758
|
-
}, {
|
|
759
|
-
actions: E(() => [y(T(r), {
|
|
760
|
-
items: $e.value,
|
|
761
|
-
align: "start",
|
|
762
|
-
onSelect: et
|
|
763
|
-
}, {
|
|
764
|
-
default: E(() => [y(T(u), {
|
|
765
|
-
"icon-name": "plus",
|
|
766
|
-
disabled: !K.value
|
|
767
|
-
}, {
|
|
768
|
-
default: E(() => [v(w(T(b).t("platform.workflow-config.add-element", "添加节点 / 分支")), 1)]),
|
|
769
|
-
_: 1
|
|
770
|
-
}, 8, ["disabled"])]),
|
|
771
|
-
_: 1
|
|
772
|
-
}, 8, ["items"])]),
|
|
773
|
-
navigation: E(() => [y(T(oe), {
|
|
774
|
-
class: "configuration-route-locator",
|
|
775
|
-
value: V.value || void 0,
|
|
776
|
-
placeholder: T(b).t("platform.screen.WorkflowConfigurationView.select-link", "选择连线"),
|
|
777
|
-
options: z.value.links.map((e) => ({
|
|
778
|
-
value: e.routeKey,
|
|
779
|
-
label: `${e.title ?? T(b).t("platform.workflow-config.route", "路径")}:${z.value.nodes.find((t) => t.nodeKey === e.sourceNodeKey)?.title} → ${z.value.nodes.find((t) => t.nodeKey === e.targetNodeKey)?.title}`
|
|
780
|
-
})),
|
|
781
|
-
"onUpdate:value": n[2] ||= (e) => vt(String(e))
|
|
782
|
-
}, null, 8, [
|
|
783
|
-
"value",
|
|
784
|
-
"placeholder",
|
|
785
|
-
"options"
|
|
786
|
-
])]),
|
|
787
|
-
_: 1
|
|
788
|
-
}, 8, [
|
|
789
|
-
"nodes",
|
|
790
|
-
"routes",
|
|
791
|
-
"selected-node-key",
|
|
792
|
-
"selected-node-keys",
|
|
793
|
-
"can-undo",
|
|
794
|
-
"can-redo",
|
|
795
|
-
"selected-route-key",
|
|
796
|
-
"layout-json",
|
|
797
|
-
"editable"
|
|
798
|
-
])), y(T(ge), {
|
|
799
|
-
docked: !T(Ze),
|
|
800
|
-
width: "compact",
|
|
801
|
-
open: N.value,
|
|
802
|
-
title: q.value?.title ? T(b).t("platform.workflow-config.node-properties", "节点属性 · {title}", { title: q.value.title }) : T(b).t("platform.workflow-config.route-properties", "路径属性"),
|
|
803
|
-
onClose: n[4] ||= (e) => N.value = !1
|
|
804
|
-
}, {
|
|
805
|
-
operation: E(() => [_("div", Be, [q.value?.nodeType === "branch" ? (S(), m(T(u), {
|
|
806
|
-
key: 0,
|
|
807
|
-
danger: "",
|
|
808
|
-
disabled: !Y.value,
|
|
809
|
-
onClick: ot
|
|
810
|
-
}, {
|
|
811
|
-
default: E(() => [v(w(T(b).t("platform.screen.WorkflowDesignProperties.delete-entire-branch", "删除整个分支")), 1)]),
|
|
812
|
-
_: 1
|
|
813
|
-
}, 8, ["disabled"])) : q.value ? (S(), m(T(u), {
|
|
814
|
-
key: 1,
|
|
815
|
-
danger: "",
|
|
816
|
-
disabled: !Y.value,
|
|
817
|
-
onClick: ot
|
|
818
|
-
}, {
|
|
819
|
-
default: E(() => [v(w(T(b).t("platform.screen.WorkflowDesignProperties.delete-and-reconnect-adjacent-nodes", "删除节点")), 1)]),
|
|
820
|
-
_: 1
|
|
821
|
-
}, 8, ["disabled"])) : h("v-if", !0), y(T(u), {
|
|
822
|
-
disabled: H.value,
|
|
823
|
-
onClick: n[3] ||= (e) => N.value = !1
|
|
824
|
-
}, {
|
|
825
|
-
default: E(() => [v(w(T(b).t("platform.screen.WorkflowConfigurationView.finish-configuration", "完成配置")), 1)]),
|
|
826
|
-
_: 1
|
|
827
|
-
}, 8, ["disabled"])])]),
|
|
828
|
-
default: E(() => [y(T(re), {
|
|
829
|
-
"condition-tools": T(Je),
|
|
830
|
-
design: z.value,
|
|
831
|
-
"node-key": B.value,
|
|
832
|
-
"route-key": V.value,
|
|
833
|
-
editable: K.value,
|
|
834
|
-
http: T(k).http,
|
|
835
|
-
"module-alias": d.moduleAlias,
|
|
836
|
-
fields: T(j),
|
|
837
|
-
catalog: M.value,
|
|
838
|
-
actions: Ye.value,
|
|
839
|
-
onUpdateNode: bt,
|
|
840
|
-
onUpdateRoute: xt,
|
|
841
|
-
onSelectRoute: vt,
|
|
842
|
-
onAppendBranchPath: Ct
|
|
843
|
-
}, null, 8, [
|
|
844
|
-
"condition-tools",
|
|
845
|
-
"design",
|
|
846
|
-
"node-key",
|
|
847
|
-
"route-key",
|
|
848
|
-
"editable",
|
|
849
|
-
"http",
|
|
850
|
-
"module-alias",
|
|
851
|
-
"fields",
|
|
852
|
-
"catalog",
|
|
853
|
-
"actions"
|
|
854
|
-
])]),
|
|
855
|
-
_: 1
|
|
856
|
-
}, 8, [
|
|
857
|
-
"docked",
|
|
858
|
-
"open",
|
|
859
|
-
"title"
|
|
860
|
-
])], 4)) : h("v-if", !0)
|
|
861
|
-
]),
|
|
862
|
-
_: 2
|
|
863
|
-
}, [L.value ? {
|
|
864
|
-
name: "status",
|
|
865
|
-
fn: E(() => [_("div", Le, [y(T(oe), {
|
|
866
|
-
class: "configuration-version-selector",
|
|
867
|
-
value: R.value?.id,
|
|
868
|
-
options: I.value.map((e) => ({
|
|
869
|
-
value: e.id,
|
|
870
|
-
label: T(b).t("platform.screen.WorkflowConfigurationView.version-value-value", "版本 {value1} · {value2}", {
|
|
871
|
-
value1: e.versionNo,
|
|
872
|
-
value2: x(e.publishStatus)
|
|
873
|
-
})
|
|
874
|
-
})),
|
|
875
|
-
disabled: H.value || T(W),
|
|
876
|
-
"onUpdate:value": n[1] ||= (e) => pt(String(e))
|
|
877
|
-
}, null, 8, [
|
|
878
|
-
"value",
|
|
879
|
-
"options",
|
|
880
|
-
"disabled"
|
|
881
|
-
]), T(W) ? (S(), m(T(_e), {
|
|
882
|
-
key: 0,
|
|
883
|
-
title: T(b).t("platform.screen.WorkflowConfigurationView.the-draft-has-unsaved-changes", "草稿有未保存的修改")
|
|
884
|
-
}, {
|
|
885
|
-
default: E(() => [_("span", Re, w(T(b).t("platform.workflow-config.unsaved", "未保存")), 1)]),
|
|
886
|
-
_: 1
|
|
887
|
-
}, 8, ["title"])) : it.value ? (S(), m(T(_e), {
|
|
888
|
-
key: 1,
|
|
889
|
-
title: T(b).t("platform.screen.WorkflowConfigurationView.this-version-is-frozen-create-a-new", "此版本已冻结。修改流程请创建新版本;已有实例继续使用原版本。")
|
|
890
|
-
}, {
|
|
891
|
-
default: E(() => [_("span", ze, w(T(b).t("platform.workflow-config.readonly", "只读")), 1)]),
|
|
892
|
-
_: 1
|
|
893
|
-
}, 8, ["title"])) : h("v-if", !0)])]),
|
|
894
|
-
key: "0"
|
|
895
|
-
} : void 0]), 1032, ["title"]), y(T(ne), {
|
|
896
|
-
width: "extraWide",
|
|
897
|
-
open: P.value,
|
|
898
|
-
title: T(b).t("platform.screen.WorkflowConfigurationView.confirm-workflow-publication", "确认发布流程"),
|
|
899
|
-
onClose: n[5] ||= (e) => P.value = !1
|
|
900
|
-
}, {
|
|
901
|
-
operation: E(() => [y(T(u), {
|
|
902
|
-
type: "primary",
|
|
903
|
-
loading: H.value,
|
|
904
|
-
onClick: gt
|
|
905
|
-
}, {
|
|
906
|
-
default: E(() => [v(w(T(b).t("platform.screen.WorkflowConfigurationView.confirm-publication", "确认发布")), 1)]),
|
|
907
|
-
_: 1
|
|
908
|
-
}, 8, ["loading"])]),
|
|
909
|
-
default: E(() => [
|
|
910
|
-
_("p", null, w(T(b).t("platform.workflow-config.publication-frozen", "流程:{title} · 版本 {version}。发布后配置冻结;已有实例继续使用原版本。", {
|
|
911
|
-
title: L.value?.title,
|
|
912
|
-
version: R.value?.versionNo
|
|
913
|
-
})), 1),
|
|
914
|
-
_("p", null, w(T(b).t("platform.workflow-config.matching-scope", "匹配范围")) + ":" + w(L.value?.organizationId ? T(b).t("platform.workflow-config.scoped-organizations", "指定组织及下级组织") : T(b).t("platform.workflow-config.all-organizations", "模块内全部组织")) + ";" + w(L.value?.defaultDefinition ? T(b).t("platform.workflow-config.default-workflow", "作为默认兜底流程") : T(b).t("platform.workflow-config.conditional-workflow", "按匹配条件选择")) + "。 " + w(L.value?.matchExpression ? T(b).t("platform.workflow-config.matching-expression", "匹配条件:{expression}", { expression: L.value.matchExpression }) : T(b).t("platform.workflow-config.no-matching-condition", "未设置额外条件")), 1),
|
|
915
|
-
_("ul", Ve, [(S(!0), g(f, null, we(z.value.nodes.filter((e) => ["approval", "task"].includes(e.nodeType)), (e) => (S(), g("li", { key: e.nodeKey }, [
|
|
916
|
-
_("strong", null, w(e.title), 1),
|
|
917
|
-
v(" · " + w(nt(e.participantPolicyText)) + " ", 1),
|
|
918
|
-
_("details", null, [_("summary", null, w(T(b).t("platform.screen.WorkflowConfigurationView.view-complete-participant-rules", "查看完整人员规则")), 1), y(T(he), {
|
|
919
|
-
value: e.participantPolicyText,
|
|
920
|
-
http: T(k).http,
|
|
921
|
-
fields: T(j),
|
|
922
|
-
disabled: ""
|
|
923
|
-
}, null, 8, [
|
|
924
|
-
"value",
|
|
925
|
-
"http",
|
|
926
|
-
"fields"
|
|
927
|
-
])]),
|
|
928
|
-
e.nodeType === "task" ? (S(), g("details", He, [
|
|
929
|
-
_("summary", null, w(T(b).t("platform.screen.WorkflowConfigurationView.view-business-task-checks-and-instructions", "查看业务任务检查与办理指引")), 1),
|
|
930
|
-
e.taskDefinitionId ? (S(), g("p", Ue, w(T(b).t("platform.workflow-config.referenced-task", "引用任务")) + ":" + w(M.value.tasks.find((t) => t.id === e.taskDefinitionId)?.title ?? e.taskDefinitionId), 1)) : h("v-if", !0),
|
|
931
|
-
y(T(fe), {
|
|
932
|
-
"condition-tools": T(Je),
|
|
933
|
-
value: e.nodeConfigText,
|
|
934
|
-
"module-alias": d.moduleAlias,
|
|
935
|
-
fields: T(j),
|
|
936
|
-
catalog: M.value,
|
|
937
|
-
actions: Ye.value,
|
|
938
|
-
associations: M.value.associations.map((e) => ({
|
|
939
|
-
value: e.id,
|
|
940
|
-
label: e.title
|
|
941
|
-
})),
|
|
942
|
-
disabled: ""
|
|
943
|
-
}, null, 8, [
|
|
944
|
-
"condition-tools",
|
|
945
|
-
"value",
|
|
946
|
-
"module-alias",
|
|
947
|
-
"fields",
|
|
948
|
-
"catalog",
|
|
949
|
-
"actions",
|
|
950
|
-
"associations"
|
|
951
|
-
])
|
|
952
|
-
])) : h("v-if", !0),
|
|
953
|
-
e.participantPolicyText?.includes("INITIATOR_SELF") ? (S(), g("p", We, w(T(b).t("platform.screen.WorkflowConfigurationView.the-submitter-processes-this-node-confirm-that", "此节点由提交人本人办理,请确认符合业务要求。")), 1)) : h("v-if", !0)
|
|
954
|
-
]))), 128))]),
|
|
955
|
-
(S(!0), g(f, null, we(z.value.nodes.filter((e) => e.nodeType === "branch"), (e) => (S(), g("div", { key: e.nodeKey }, [
|
|
956
|
-
_("strong", null, w(e.title) + " · " + w(e.routeMode === "manual" ? T(b).t("platform.workflow-config.manual-route", "人工单选") : T(b).t("platform.workflow-config.auto-route", "自动判定(全部命中出口)")), 1),
|
|
957
|
-
e.routeMode === "manual" ? (S(), g("p", Ge, w(T(b).t("platform.workflow-config.selector-summary", "由{title}的实际办理人选路;{reason}。", {
|
|
958
|
-
title: z.value.nodes.find((t) => t.nodeKey === e.selectorNodeKey)?.title ?? T(b).t("platform.workflow-config.missing-selector", "未配置选择节点"),
|
|
959
|
-
reason: e.requireManualSelectionReason ? T(b).t("platform.workflow-config.reason-required", "必须填写原因") : T(b).t("platform.workflow-config.reason-optional", "原因选填")
|
|
960
|
-
})), 1)) : h("v-if", !0),
|
|
961
|
-
_("ul", null, [(S(!0), g(f, null, we(z.value.links.filter((t) => t.sourceNodeKey === e.nodeKey), (e) => (S(), g("li", { key: e.routeKey }, w(e.title ?? T(b).t("platform.workflow-config.exit", "出口")) + ":" + w(e.defaultRoute ? T(b).t("platform.workflow-config.fallback-exit", "默认兜底") : e.conditionExpression || T(b).t("platform.workflow-config.unconditional", "无条件(始终命中)")), 1))), 128))]),
|
|
962
|
-
_("p", null, w(T(b).t("platform.workflow-config.convergence-counting", "汇聚:{summary},只计算有效出口。", { summary: st(e) })), 1)
|
|
963
|
-
]))), 128)),
|
|
964
|
-
_("details", null, [_("summary", null, w(T(b).t("platform.screen.WorkflowConfigurationView.view-published-workflow", "查看发布流程图")), 1), y(T(ae), {
|
|
965
|
-
presentation: "detail",
|
|
966
|
-
nodes: z.value.nodes,
|
|
967
|
-
routes: z.value.links,
|
|
968
|
-
"layout-json": z.value.layoutJson
|
|
969
|
-
}, null, 8, [
|
|
970
|
-
"nodes",
|
|
971
|
-
"routes",
|
|
972
|
-
"layout-json"
|
|
973
|
-
])])
|
|
974
|
-
]),
|
|
975
|
-
_: 1
|
|
976
|
-
}, 8, ["open", "title"])]));
|
|
977
|
-
}
|
|
978
|
-
}), [["__scopeId", "data-v-778f30d4"]]);
|
|
979
|
-
//#endregion
|
|
980
|
-
export { A as default };
|