@ximatai/muyun-web-app 0.26.18 → 0.26.20
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-CNW817Sf.js → BusinessActivityLogView-BpcmlT8u.js} +2 -2
- package/dist/BusinessLogListDrawer-C3EteOgv.js +864 -0
- package/dist/CodeConfigurationView-CxqzINb9.js +1667 -0
- package/dist/{ConfigurationTranslationView-CbBt5s1q.js → ConfigurationTranslationView-QUeVtdcE.js} +37 -37
- package/dist/{LoginAuditLogView-CZF1Jfq_.js → LoginAuditLogView-Cd699_OD.js} +2 -2
- package/dist/ModuleActionManagementView-Ct1PqAXF.js +755 -0
- package/dist/{ModuleGovernanceView-CcwGyO3x.js → ModuleGovernanceView-CjKt6ryi.js} +2254 -2254
- package/dist/{RequestErrorLogView-DpudZrC2.js → RequestErrorLogView-B9sIOhWs.js} +2 -2
- package/dist/RoleDetailWorkspaceView-BnBL_Ihe.js +1435 -0
- package/dist/{RuntimeLogView-444BL_xs.js → RuntimeLogView-CjV223Pk.js} +70 -70
- package/dist/WorkflowAdministrationView-C2jgy4N4.js +650 -0
- package/dist/WorkflowConfigurationView-CNXwdgUP.js +980 -0
- package/dist/WorkflowWorkbenchView-DdJOTmtG.js +759 -0
- package/dist/{codeConfiguration-ChJ6ktRR.js → codeConfiguration-pvXI4qaR.js} +45 -45
- package/dist/index.css +1 -1
- package/dist/index.js +999 -627
- package/dist/{moduleMenuWorkspace-B8DKwC3L.js → moduleMenuWorkspace-D8ih_X-m.js} +204 -204
- package/dist/platform-components-DlKD3nyL.js +30676 -0
- package/dist/{platform-workbench-BhZPARiH.js → platform-workbench-D5w7Odpt.js} +5246 -5224
- package/dist/types/app/executeBusinessNotificationRecordAction.d.ts +7 -0
- package/dist/types/consumer/index.d.ts +8 -0
- package/dist/types/dynamic-page-runtime/ModulePageHostRuntime.vue.d.ts +3 -3
- package/dist/types/dynamic-page-runtime/composables/useModulePageDetailExtensionRuntime.d.ts +1 -0
- package/dist/types/dynamic-page-runtime/modulePageEnhancementState.d.ts +5 -0
- package/dist/types/dynamic-page-runtime/modulePageEnhancements.d.ts +4 -0
- package/dist/types/platform-admin-runtime/workflow/ModuleWorkflowDrawer.vue.d.ts +7 -0
- package/dist/types/platform-components/BusinessNotificationPanel.vue.d.ts +5 -3
- package/dist/types/platform-components/EmployeePicker.vue.d.ts +1 -1
- package/dist/types/platform-components/FormulaExpressionEditor.vue.d.ts +5 -0
- package/dist/types/platform-components/QueryCriteriaComposer.vue.d.ts +3 -1
- package/dist/types/platform-components/ReadonlyRecordWorkspace.vue.d.ts +56 -0
- package/dist/types/platform-components/RecordAdaptiveDetailPanel.vue.d.ts +30 -0
- package/dist/types/platform-components/RecordQueryControls.vue.d.ts +21 -0
- package/dist/types/platform-components/RecordQueryFieldControls.vue.d.ts +32 -0
- package/dist/types/platform-components/RecordQueryListPanel.vue.d.ts +1 -1
- package/dist/types/platform-components/RecordQueryListSurface.vue.d.ts +6 -2
- package/dist/types/platform-components/ReferencePicker.vue.d.ts +1 -1
- package/dist/types/platform-components/UserPicker.vue.d.ts +1 -1
- package/dist/types/platform-components/WorkflowBusinessTaskEditor.vue.d.ts +2 -0
- package/dist/types/platform-components/WorkflowDesignProperties.vue.d.ts +2 -6
- package/dist/types/platform-components/WorkflowDiagram.vue.d.ts +32 -1
- package/dist/types/platform-components/formulaExpressionTokens.d.ts +2 -0
- package/dist/types/platform-components/formulaExpressionTools.d.ts +6 -0
- package/dist/types/platform-components/index.d.ts +3 -0
- package/dist/types/platform-components/queryCriteria.d.ts +7 -0
- package/dist/types/platform-components/referencePickerModel.d.ts +5 -1
- package/dist/types/platform-components/useWorkflowDesignHistory.d.ts +14 -0
- package/dist/types/platform-components/useWorkspaceDetailSurface.d.ts +3 -0
- package/dist/types/platform-components/workflowDesignClipboard.d.ts +7 -0
- package/dist/types/platform-components/workflowPresentation.d.ts +4 -0
- package/dist/types/views/WorkflowConfigurationView.vue.d.ts +1 -0
- package/dist/types/views/WorkflowDefinitionSettings.vue.d.ts +35 -0
- package/dist/types/views/WorkflowSelectionFields.vue.d.ts +2 -4
- package/dist/types/views/useWorkflowConfigurationContext.d.ts +49 -0
- package/dist/types/views/workflowConfigurationWorkspaceView.d.ts +2 -0
- package/dist/types/vue-ui-antdv/components/UiIcon.vue.d.ts +1 -1
- package/dist/types/vue-ui-antdv/components/UiRadioGroup.vue.d.ts +4 -0
- package/dist/types/vue-ui-antdv/components/UiSidePanel.vue.d.ts +5 -0
- package/dist/types/vue-ui-antdv/index.d.ts +1 -0
- package/dist/types/vue-ui-antdv/overlayLayers.d.ts +5 -0
- package/dist/types/vue-ui-antdv/types.d.ts +2 -0
- package/dist/types/web-contracts/index.d.ts +7 -0
- package/dist/types/web-contracts/workflow.d.ts +16 -8
- package/dist/types/web-core/businessNotifications.d.ts +3 -1
- package/dist/types/web-core/index.d.ts +3 -0
- package/dist/types/web-core/recordReadEntry.d.ts +23 -0
- package/dist/types/web-core/recordReadView.d.ts +28 -0
- package/dist/types/web-core/useRecordReadSession.d.ts +27 -0
- package/dist/types/web-core/workflow.d.ts +13 -1
- package/dist/useWorkflowConfigurationContext-B6Wdt26l.js +66 -0
- package/dist/{workspaceViews-DeBqozVb.js → workspaceViews-B9wsCYdy.js} +1510 -930
- package/package.json +1 -1
- package/dist/BusinessLogListDrawer-YiJxOlnD.js +0 -864
- package/dist/CodeConfigurationView-DU8tjPMt.js +0 -1667
- package/dist/ModuleActionManagementView-CaiXH1l_.js +0 -755
- package/dist/RoleDetailWorkspaceView-DNMGsAJC.js +0 -1435
- package/dist/WorkflowAdministrationView-C-VIjvwB.js +0 -650
- package/dist/WorkflowConfigurationView-DLFY2x7V.js +0 -1110
- package/dist/WorkflowWorkbenchView-Gr02dbBc.js +0 -759
- package/dist/platform-components-5AE0j2_3.js +0 -29879
|
@@ -0,0 +1,980 @@
|
|
|
1
|
+
import { E as e } from "./platform-workbench-D5w7Odpt.js";
|
|
2
|
+
import { An as t, Da as n, G as r, Hn as i, Ht as a, Ln as o, Mn as s, Nn as c, On as l, Xa as ee, Xt as te, Zn as ne, _n as u, a as re, c as ie, d as ae, fr as d, jr as oe, kn as se, l as ce, m as le, n as ue, nn as de, o as fe, or as pe, s as me, t as he, ur as f, wa as ge } from "./platform-components-DlKD3nyL.js";
|
|
3
|
+
import { t as _e } from "./useWorkflowConfigurationContext-B6Wdt26l.js";
|
|
4
|
+
import { Fragment as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createSlots as ve, createTextVNode as y, createVNode as b, defineComponent as x, normalizeStyle as ye, onActivated as be, onBeforeUnmount as xe, onMounted as Se, onScopeDispose as Ce, openBlock as S, ref as C, renderList as w, toDisplayString as T, unref as E, watch as we, withCtx as D } from "vue";
|
|
5
|
+
//#region src/platform-components/useWorkflowDesignHistory.ts
|
|
6
|
+
function Te(e, t = 100) {
|
|
7
|
+
let n = C([JSON.stringify(e.value)]), r = C(0), i = C(n.value[0]), a = !1, o = 0;
|
|
8
|
+
Ce(() => {
|
|
9
|
+
o++;
|
|
10
|
+
}), we(() => 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: m(() => r.value > 0),
|
|
25
|
+
canRedo: m(() => r.value < n.value.length - 1),
|
|
26
|
+
dirty: m(() => 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 O(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 Ee(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
|
+
O(`${n}_path1`, "分支审批1"),
|
|
59
|
+
O(`${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 De(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, O(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 Oe(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 ke(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 Ae(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 je(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 Me(e) {
|
|
189
|
+
let t = [
|
|
190
|
+
{
|
|
191
|
+
nodeKey: "start",
|
|
192
|
+
nodeType: "start",
|
|
193
|
+
title: "提交"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
...O("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 k = /* @__PURE__ */ new Set([
|
|
228
|
+
"approval",
|
|
229
|
+
"task",
|
|
230
|
+
"milestone",
|
|
231
|
+
"branch",
|
|
232
|
+
"converge"
|
|
233
|
+
]);
|
|
234
|
+
function A(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) => !k.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 Ne(e, t) {
|
|
262
|
+
let n = new Set(t.filter((t) => k.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(Oe(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 A(a), JSON.stringify(a);
|
|
279
|
+
}
|
|
280
|
+
function Pe(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
|
+
A(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
|
+
}), l = 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
|
+
...l,
|
|
320
|
+
{
|
|
321
|
+
routeKey: s(l.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 Fe = { class: "workflow-configuration" }, Ie = { class: "configuration-status" }, Le = {
|
|
335
|
+
class: "configuration-state configuration-state--dirty",
|
|
336
|
+
role: "status"
|
|
337
|
+
}, Re = { class: "configuration-state" }, ze = { class: "configuration-property-operations" }, Be = { class: "publish-nodes" }, Ve = { key: 0 }, He = { key: 0 }, Ue = { key: 1 }, We = { key: 0 }, Ge = 720, j = /*#__PURE__*/ d(/* @__PURE__ */ x({
|
|
338
|
+
name: "WorkflowConfigurationView",
|
|
339
|
+
__name: "WorkflowConfigurationView",
|
|
340
|
+
props: {
|
|
341
|
+
moduleAlias: {},
|
|
342
|
+
moduleTitle: {},
|
|
343
|
+
definitionId: {}
|
|
344
|
+
},
|
|
345
|
+
setup(d) {
|
|
346
|
+
let x = ee();
|
|
347
|
+
function Ce(e) {
|
|
348
|
+
return le(e, x);
|
|
349
|
+
}
|
|
350
|
+
let k = d, { context: A, client: j, businessRuntime: Ke, fields: M, conditionTools: qe } = _e(k.moduleAlias), N = C({
|
|
351
|
+
tasks: [],
|
|
352
|
+
queries: [],
|
|
353
|
+
generations: [],
|
|
354
|
+
associations: []
|
|
355
|
+
}), Je = m(() => (Ke.value?.actions ?? []).map((e) => ({
|
|
356
|
+
value: e.actionCode,
|
|
357
|
+
label: e.title ?? Ce(e.actionCode)
|
|
358
|
+
}))), Ye = C(), Xe = ue(Ye, () => Ge + o.compact + de.columnGap), P = C(!1), F = C(!1), Ze = m(() => [
|
|
359
|
+
{
|
|
360
|
+
key: "save",
|
|
361
|
+
title: x.t("platform.screen.WorkflowConfigurationView.save-draft", "保存草稿"),
|
|
362
|
+
level: "primary",
|
|
363
|
+
disabled: !J.value || !K.value
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
key: "validate",
|
|
367
|
+
title: x.t("platform.screen.WorkflowConfigurationView.validate-workflow", "校验流程"),
|
|
368
|
+
level: "secondary",
|
|
369
|
+
disabled: !J.value
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
key: "publish",
|
|
373
|
+
title: B.value?.publishStatus === "published" ? x.t("platform.screen.WorkflowConfigurationView.enable-published", "启用已发布版本") : x.t("platform.screen.WorkflowConfigurationView.publish-workflow", "发布流程"),
|
|
374
|
+
disabled: !B.value || W.value
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
key: "upgrade",
|
|
378
|
+
title: x.t("platform.screen.WorkflowConfigurationView.create-version", "创建新版本"),
|
|
379
|
+
level: "secondary",
|
|
380
|
+
disabled: !z.value || W.value || K.value
|
|
381
|
+
}
|
|
382
|
+
]), Qe = m(() => Y.value?.nodeType === "branch" ? [{
|
|
383
|
+
key: "path",
|
|
384
|
+
title: x.t("platform.screen.WorkflowDesignProperties.add-branch-route", "增加分支路径"),
|
|
385
|
+
disabled: !J.value
|
|
386
|
+
}] : [{
|
|
387
|
+
key: "node",
|
|
388
|
+
title: x.t("platform.screen.WorkflowConfigurationView.insert-approval-node", "插入节点"),
|
|
389
|
+
disabled: !J.value || !$()
|
|
390
|
+
}, {
|
|
391
|
+
key: "branch",
|
|
392
|
+
title: x.t("platform.screen.WorkflowConfigurationView.insert-branch-and-convergence", "添加分支"),
|
|
393
|
+
disabled: !J.value || !$()
|
|
394
|
+
}]);
|
|
395
|
+
function $e(e) {
|
|
396
|
+
e === "node" ? Tt() : e === "branch" ? St() : e === "path" && Ct();
|
|
397
|
+
}
|
|
398
|
+
function et(e) {
|
|
399
|
+
e === "save" ? mt() : e === "validate" ? ht() : e === "publish" ? F.value = !0 : e === "upgrade" && _t();
|
|
400
|
+
}
|
|
401
|
+
function tt(e) {
|
|
402
|
+
try {
|
|
403
|
+
return ce(e).map((e) => ({
|
|
404
|
+
INITIATOR_SELF: x.t("platform.workflow-participant.initiator", "提交人本人"),
|
|
405
|
+
USER: x.t("platform.workflow-participant.named-accounts", "指定账号"),
|
|
406
|
+
ROLE: x.t("platform.workflow-participant.role-members", "角色成员"),
|
|
407
|
+
DEPT: x.t("platform.workflow-participant.department-members", "部门成员"),
|
|
408
|
+
ORG: x.t("platform.workflow-participant.organization-members", "组织成员"),
|
|
409
|
+
FIELD: x.t("platform.workflow-participant.participant-field", "业务人员字段"),
|
|
410
|
+
RELATIVE: x.t("platform.workflow-participant.relative-participants", "相对人员")
|
|
411
|
+
}[e.type] ?? e.type) + (e.ids?.length ? x.t("platform.workflow-config.target-count", "({count} 个目标)", { count: e.ids.length }) : e.fieldName ? `(${M.value.find((t) => t.name === e.fieldName)?.label ?? e.fieldName})` : "")).join("、") || x.t("platform.workflow-config.empty-participants", "尚未配置参与人");
|
|
412
|
+
} catch {
|
|
413
|
+
return x.t("platform.workflow-config.invalid-participants", "人员配置格式无效");
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
let I = C(!1), L = C(), R = C([]), z = C(), B = C(), V = C({
|
|
417
|
+
nodes: [],
|
|
418
|
+
links: []
|
|
419
|
+
}), H = C(""), U = C(""), W = C(!1), G = Te(V), K = G.dirty, q = C([]), nt = m(() => ["published", "archived"].includes(B.value?.publishStatus ?? "")), J = m(() => B.value?.publishStatus === "draft" && !W.value), Y = m(() => V.value.nodes.find((e) => e.nodeKey === H.value)), rt = m(() => V.value.links.find((e) => e.routeKey === U.value)), it = C(!1), at = m(() => J.value && !it.value && q.value.length === 1 && Y.value != null && ![
|
|
420
|
+
"start",
|
|
421
|
+
"end",
|
|
422
|
+
"converge"
|
|
423
|
+
].includes(Y.value.nodeType));
|
|
424
|
+
async function ot() {
|
|
425
|
+
if (at.value) {
|
|
426
|
+
it.value = !0;
|
|
427
|
+
try {
|
|
428
|
+
Y.value?.nodeType === "branch" ? await wt() : Et();
|
|
429
|
+
} finally {
|
|
430
|
+
it.value = !1;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function st(e) {
|
|
435
|
+
let t = V.value.nodes.find((t) => t.nodeKey === e.convergeNodeKey), n = {
|
|
436
|
+
all: x.t("platform.workflow-config.all-arrive", "全部到达"),
|
|
437
|
+
any: x.t("platform.workflow-config.any-arrive", "任一到达"),
|
|
438
|
+
ratio: x.t("platform.workflow-config.ratio-arrive", "比例到达")
|
|
439
|
+
}, r = t?.convergeMode ?? "all";
|
|
440
|
+
return `${n[r]}${r === "ratio" ? ` ${t?.convergeRatio ?? 100}%` : ""}`;
|
|
441
|
+
}
|
|
442
|
+
oe(() => x.t("platform.workflow-config.configuration", "流程配置"), () => K.value, () => W.value), Se(() => {
|
|
443
|
+
dt();
|
|
444
|
+
});
|
|
445
|
+
let X = 0, ct = !1, lt = !1;
|
|
446
|
+
xe(() => {
|
|
447
|
+
lt = !0, X++;
|
|
448
|
+
});
|
|
449
|
+
async function ut() {
|
|
450
|
+
if (lt || !z.value) return;
|
|
451
|
+
if (W.value) {
|
|
452
|
+
ct = !0;
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
let e = ++X;
|
|
456
|
+
try {
|
|
457
|
+
let t = await j.view(k.definitionId);
|
|
458
|
+
e === X && (z.value = t);
|
|
459
|
+
} catch (t) {
|
|
460
|
+
e === X && u(t, {
|
|
461
|
+
source: "workflow-design",
|
|
462
|
+
phase: "load"
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
be(() => {
|
|
467
|
+
ut();
|
|
468
|
+
}), e({
|
|
469
|
+
moduleAlias: "platform.workflow.definition",
|
|
470
|
+
recordId: () => k.definitionId,
|
|
471
|
+
handler: ut
|
|
472
|
+
});
|
|
473
|
+
async function Z(e) {
|
|
474
|
+
if (!W.value) {
|
|
475
|
+
X++, W.value = !0;
|
|
476
|
+
try {
|
|
477
|
+
await e();
|
|
478
|
+
} catch (e) {
|
|
479
|
+
u(e, {
|
|
480
|
+
source: "workflow-design",
|
|
481
|
+
phase: "action"
|
|
482
|
+
});
|
|
483
|
+
} finally {
|
|
484
|
+
W.value = !1, ct && (ct = !1, await ut());
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
async function dt() {
|
|
489
|
+
W.value || K.value || (I.value = !0, L.value = void 0, await Z(async () => {
|
|
490
|
+
try {
|
|
491
|
+
let e = await j.view(k.definitionId), t = await j.catalog(e.id), n = (await j.versions(e.id)).sort((e, t) => t.versionNo - e.versionNo), r = n[0] ?? await j.upgrade(e.id);
|
|
492
|
+
n.length || n.push(r);
|
|
493
|
+
let i = await j.design(e.id, r.id), a = r.publishStatus === "draft" && !i.nodes.length;
|
|
494
|
+
a && (i = Me(e.approvalEnabled)), z.value = e, N.value = t, R.value = n, B.value = r, G.reset(i, a ? {
|
|
495
|
+
nodes: [],
|
|
496
|
+
links: []
|
|
497
|
+
} : i), q.value = [], H.value = "", U.value = "", P.value = !1;
|
|
498
|
+
} catch (e) {
|
|
499
|
+
L.value = () => n(ge(e), x);
|
|
500
|
+
}
|
|
501
|
+
}), I.value = !1);
|
|
502
|
+
}
|
|
503
|
+
async function ft(e) {
|
|
504
|
+
let t = await j.design(z.value.id, e.id);
|
|
505
|
+
B.value = e, G.reset(t), q.value = [], H.value = V.value.nodes[0]?.nodeKey ?? "", U.value = "", P.value = !1;
|
|
506
|
+
}
|
|
507
|
+
async function pt(e) {
|
|
508
|
+
if (K.value) return;
|
|
509
|
+
let t = R.value.find((t) => t.id === e);
|
|
510
|
+
t && await Z(() => ft(t));
|
|
511
|
+
}
|
|
512
|
+
async function mt() {
|
|
513
|
+
B.value && z.value && await Z(async () => {
|
|
514
|
+
B.value = await j.saveDesign(z.value.id, B.value.id, B.value.version, V.value), R.value = R.value.map((e) => e.id === B.value.id ? B.value : e), G.markSaved(), se(x.t("platform.workflow-config.draft-saved", "流程草稿已保存"));
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
async function ht() {
|
|
518
|
+
K.value && await mt(), !K.value && B.value && await Z(async () => {
|
|
519
|
+
await j.validate(z.value.id, B.value.id), se(x.t("platform.workflow-config.validated", "流程发布校验通过"));
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
async function gt() {
|
|
523
|
+
if (V.value.nodes.some((e) => ["approval", "task"].includes(e.nodeType) && !ie(e.participantPolicyText))) {
|
|
524
|
+
u(Error(x.t("platform.workflow-config.participants-required", "请为每个审批或业务任务节点明确配置参与人")), {
|
|
525
|
+
source: "workflow-design",
|
|
526
|
+
phase: "validation"
|
|
527
|
+
});
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
K.value && await mt(), !K.value && z.value && B.value && (await Z(async () => {
|
|
531
|
+
B.value = await j.publish(z.value.id, B.value.id, z.value.version, B.value.version), R.value = R.value.map((e) => e.id === B.value.id ? B.value : e), z.value = await j.view(z.value.id), G.markSaved(), F.value = !1, se(x.t("platform.workflow-config.published", "流程已发布,后续新申请使用该版本"));
|
|
532
|
+
}), await dt());
|
|
533
|
+
}
|
|
534
|
+
async function _t() {
|
|
535
|
+
z.value && await Z(async () => {
|
|
536
|
+
let e = await j.upgrade(z.value.id);
|
|
537
|
+
R.value = [e, ...R.value.filter((t) => t.id !== e.id)], await ft(e), V.value.nodes.length || (V.value = Me(z.value.approvalEnabled), Q("approval"));
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
function Q(e) {
|
|
541
|
+
V.value.nodes.some((t) => t.nodeKey === e) || (e = ""), q.value = e ? [e] : [], H.value = e, U.value = "", P.value = !!e;
|
|
542
|
+
}
|
|
543
|
+
function vt(e) {
|
|
544
|
+
V.value.links.some((t) => t.routeKey === e) || (e = ""), q.value = [], U.value = e, H.value = "", P.value = !!e;
|
|
545
|
+
}
|
|
546
|
+
function yt(e) {
|
|
547
|
+
J.value && V.value.layoutJson !== e && (V.value = {
|
|
548
|
+
...V.value,
|
|
549
|
+
layoutJson: e
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
function bt(e) {
|
|
553
|
+
Y.value && J.value && (V.value = {
|
|
554
|
+
...V.value,
|
|
555
|
+
nodes: V.value.nodes.map((t) => t.nodeKey === H.value ? {
|
|
556
|
+
...t,
|
|
557
|
+
...e
|
|
558
|
+
} : t)
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
function xt(e) {
|
|
562
|
+
rt.value && J.value && (V.value = ke(V.value, rt.value.routeKey, e));
|
|
563
|
+
}
|
|
564
|
+
function $() {
|
|
565
|
+
let e = V.value.links.filter((e) => e.sourceNodeKey === H.value);
|
|
566
|
+
return U.value || (e.length === 1 ? e[0]?.routeKey : void 0) || "";
|
|
567
|
+
}
|
|
568
|
+
function St() {
|
|
569
|
+
if (!J.value) return;
|
|
570
|
+
let e = `branch_${Date.now().toString(36)}`;
|
|
571
|
+
try {
|
|
572
|
+
V.value = Ee(V.value, $(), e), Q(e);
|
|
573
|
+
} catch (e) {
|
|
574
|
+
u(e, {
|
|
575
|
+
source: "workflow-design",
|
|
576
|
+
phase: "validation"
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
function Ct() {
|
|
581
|
+
if (J.value) try {
|
|
582
|
+
V.value = De(V.value, H.value, `path_${Date.now().toString(36)}`);
|
|
583
|
+
} catch (e) {
|
|
584
|
+
u(e, {
|
|
585
|
+
source: "workflow-design",
|
|
586
|
+
phase: "validation"
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
async function wt() {
|
|
591
|
+
if (J.value) try {
|
|
592
|
+
let e = G.checkpoint(), n = Oe(V.value, H.value);
|
|
593
|
+
if (!await t({
|
|
594
|
+
title: x.t("platform.workflow-config.delete-branch-confirm", "删除整个分支?"),
|
|
595
|
+
content: x.t("platform.workflow-config.delete-branch-detail", "将删除分支、配对汇聚及其中 {count} 个节点,并连接前后路径。", { count: V.value.nodes.length - n.nodes.length - 2 }),
|
|
596
|
+
danger: !0,
|
|
597
|
+
okText: x.t("platform.workflow-config.delete-branch", "删除分支")
|
|
598
|
+
}, x) || !Ot(e)) return;
|
|
599
|
+
V.value = n, H.value = "", P.value = !1;
|
|
600
|
+
} catch (e) {
|
|
601
|
+
u(e, {
|
|
602
|
+
source: "workflow-design",
|
|
603
|
+
phase: "validation"
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
function Tt() {
|
|
608
|
+
if (!J.value) return;
|
|
609
|
+
let e = V.value.links.filter((e) => e.sourceNodeKey === H.value), t = U.value || (e.length === 1 ? e[0]?.routeKey : void 0), n = `node_${Date.now().toString(36)}`;
|
|
610
|
+
try {
|
|
611
|
+
V.value = Ae(V.value, t ?? "", O(n, "新审批节点")), Q(n);
|
|
612
|
+
} catch (e) {
|
|
613
|
+
u(e, {
|
|
614
|
+
source: "workflow-design",
|
|
615
|
+
phase: "validation"
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
function Et() {
|
|
620
|
+
if (J.value) try {
|
|
621
|
+
V.value = je(V.value, H.value), H.value = "", P.value = !1;
|
|
622
|
+
} catch (e) {
|
|
623
|
+
u(e, {
|
|
624
|
+
source: "workflow-design",
|
|
625
|
+
phase: "validation"
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
function Dt(e) {
|
|
630
|
+
let t = new Set(V.value.nodes.map((e) => e.nodeKey));
|
|
631
|
+
e = [...new Set(e)].filter((e) => t.has(e)), q.value = e, H.value = e.length === 1 ? e[0] : "", U.value = "", P.value = !1;
|
|
632
|
+
}
|
|
633
|
+
we(() => [V.value.nodes.map((e) => e.nodeKey), V.value.links.map((e) => e.routeKey)], ([e, t]) => {
|
|
634
|
+
let n = new Set(e);
|
|
635
|
+
q.value = q.value.filter((e) => n.has(e)), H.value && !n.has(H.value) && (H.value = "", P.value = !1), U.value && !t.includes(U.value) && (U.value = "", P.value = !1);
|
|
636
|
+
}, { flush: "sync" });
|
|
637
|
+
function Ot(e) {
|
|
638
|
+
return lt ? !1 : J.value && e() ? !0 : (l(x.t("platform.workflow-config.stale-edit", "流程已变更,本次操作未应用,请重新操作。")), !1);
|
|
639
|
+
}
|
|
640
|
+
function kt() {
|
|
641
|
+
J.value && G.undo();
|
|
642
|
+
}
|
|
643
|
+
function At() {
|
|
644
|
+
J.value && G.redo();
|
|
645
|
+
}
|
|
646
|
+
function jt(e) {
|
|
647
|
+
if (e.clipboardData) try {
|
|
648
|
+
let t = Ne(V.value, q.value);
|
|
649
|
+
e.clipboardData.setData("text/plain", t), e.preventDefault();
|
|
650
|
+
} catch (e) {
|
|
651
|
+
u(e, {
|
|
652
|
+
source: "workflow-design",
|
|
653
|
+
phase: "action"
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
function Mt() {
|
|
658
|
+
let e = Y.value?.nodeType === "branch" ? Y.value.convergeNodeKey : void 0;
|
|
659
|
+
return $() || (e ? V.value.links.find((t) => t.sourceNodeKey === e)?.routeKey : void 0) || V.value.links.find((e) => V.value.nodes.some((t) => t.nodeKey === e.targetNodeKey && t.nodeType === "end"))?.routeKey || "";
|
|
660
|
+
}
|
|
661
|
+
function Nt(e, t) {
|
|
662
|
+
if (!J.value || !e.includes("muyun.workflow.fragment")) return;
|
|
663
|
+
let n = Pe(V.value, t, e, `copy_${crypto.randomUUID().replaceAll("-", "")}`);
|
|
664
|
+
if (V.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
|
+
l(x.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 (!J.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
|
+
u(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(Ne(V.value, q.value));
|
|
688
|
+
} catch (e) {
|
|
689
|
+
u(e, {
|
|
690
|
+
source: "workflow-design",
|
|
691
|
+
phase: "action"
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
async function It() {
|
|
696
|
+
if (!J.value) return;
|
|
697
|
+
let e = G.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
|
+
u(e, {
|
|
704
|
+
source: "workflow-design",
|
|
705
|
+
phase: "action"
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
return (e, t) => (S(), _("section", Fe, [b(E(r), { title: z.value?.title ?? E(x).t("platform.workflow-config.configuration", "流程配置") }, ve({
|
|
710
|
+
actions: D(() => [b(E(te), {
|
|
711
|
+
class: "configuration-action-bar",
|
|
712
|
+
actions: Ze.value,
|
|
713
|
+
onAction: t[0] ||= (e) => et(e.key)
|
|
714
|
+
}, null, 8, ["actions"])]),
|
|
715
|
+
default: D(() => [
|
|
716
|
+
I.value ? (S(), h(E(c), { key: 0 })) : g("v-if", !0),
|
|
717
|
+
L.value ? (S(), h(E(s), {
|
|
718
|
+
key: 1,
|
|
719
|
+
message: L.value()
|
|
720
|
+
}, null, 8, ["message"])) : g("v-if", !0),
|
|
721
|
+
L.value ? (S(), h(E(f), {
|
|
722
|
+
key: 2,
|
|
723
|
+
onClick: dt
|
|
724
|
+
}, {
|
|
725
|
+
default: D(() => [y(T(E(x).t("platform.screen.CrudRecordListExplorer.reload", "重新加载")), 1)]),
|
|
726
|
+
_: 1
|
|
727
|
+
})) : g("v-if", !0),
|
|
728
|
+
z.value ? (S(), _("div", {
|
|
729
|
+
key: 3,
|
|
730
|
+
ref_key: "designHost",
|
|
731
|
+
ref: Ye,
|
|
732
|
+
class: "configuration-design",
|
|
733
|
+
style: ye({ gap: `${E(de).columnGap}px` })
|
|
734
|
+
}, [(S(), h(E(ae), {
|
|
735
|
+
key: B.value?.id,
|
|
736
|
+
nodes: V.value.nodes,
|
|
737
|
+
routes: V.value.links,
|
|
738
|
+
"selected-node-key": H.value,
|
|
739
|
+
"selected-node-keys": q.value,
|
|
740
|
+
"can-undo": E(G).canUndo.value,
|
|
741
|
+
"can-redo": E(G).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": U.value,
|
|
751
|
+
"layout-json": V.value.layoutJson,
|
|
752
|
+
editable: J.value,
|
|
753
|
+
interactive: "",
|
|
754
|
+
presentation: "designer",
|
|
755
|
+
onSelect: Q,
|
|
756
|
+
onSelectRoute: vt,
|
|
757
|
+
onLayoutChange: yt
|
|
758
|
+
}, {
|
|
759
|
+
actions: D(() => [b(E(i), {
|
|
760
|
+
items: Qe.value,
|
|
761
|
+
align: "start",
|
|
762
|
+
onSelect: $e
|
|
763
|
+
}, {
|
|
764
|
+
default: D(() => [b(E(f), {
|
|
765
|
+
"icon-name": "plus",
|
|
766
|
+
disabled: !J.value
|
|
767
|
+
}, {
|
|
768
|
+
default: D(() => [y(T(E(x).t("platform.workflow-config.add-element", "添加节点 / 分支")), 1)]),
|
|
769
|
+
_: 1
|
|
770
|
+
}, 8, ["disabled"])]),
|
|
771
|
+
_: 1
|
|
772
|
+
}, 8, ["items"])]),
|
|
773
|
+
navigation: D(() => [b(E(pe), {
|
|
774
|
+
class: "configuration-route-locator",
|
|
775
|
+
value: U.value || void 0,
|
|
776
|
+
placeholder: E(x).t("platform.screen.WorkflowConfigurationView.select-link", "选择连线"),
|
|
777
|
+
options: V.value.links.map((e) => ({
|
|
778
|
+
value: e.routeKey,
|
|
779
|
+
label: `${e.title ?? E(x).t("platform.workflow-config.route", "路径")}:${V.value.nodes.find((t) => t.nodeKey === e.sourceNodeKey)?.title} → ${V.value.nodes.find((t) => t.nodeKey === e.targetNodeKey)?.title}`
|
|
780
|
+
})),
|
|
781
|
+
"onUpdate:value": t[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
|
+
])), b(E(he), {
|
|
799
|
+
docked: !E(Xe),
|
|
800
|
+
width: "compact",
|
|
801
|
+
open: P.value,
|
|
802
|
+
title: Y.value?.title ? E(x).t("platform.workflow-config.node-properties", "节点属性 · {title}", { title: Y.value.title }) : E(x).t("platform.workflow-config.route-properties", "路径属性"),
|
|
803
|
+
onClose: t[4] ||= (e) => P.value = !1
|
|
804
|
+
}, {
|
|
805
|
+
operation: D(() => [v("div", ze, [Y.value?.nodeType === "branch" ? (S(), h(E(f), {
|
|
806
|
+
key: 0,
|
|
807
|
+
danger: "",
|
|
808
|
+
disabled: !at.value,
|
|
809
|
+
onClick: ot
|
|
810
|
+
}, {
|
|
811
|
+
default: D(() => [y(T(E(x).t("platform.screen.WorkflowDesignProperties.delete-entire-branch", "删除整个分支")), 1)]),
|
|
812
|
+
_: 1
|
|
813
|
+
}, 8, ["disabled"])) : Y.value ? (S(), h(E(f), {
|
|
814
|
+
key: 1,
|
|
815
|
+
danger: "",
|
|
816
|
+
disabled: !at.value,
|
|
817
|
+
onClick: ot
|
|
818
|
+
}, {
|
|
819
|
+
default: D(() => [y(T(E(x).t("platform.screen.WorkflowDesignProperties.delete-and-reconnect-adjacent-nodes", "删除节点")), 1)]),
|
|
820
|
+
_: 1
|
|
821
|
+
}, 8, ["disabled"])) : g("v-if", !0), b(E(f), {
|
|
822
|
+
disabled: W.value,
|
|
823
|
+
onClick: t[3] ||= (e) => P.value = !1
|
|
824
|
+
}, {
|
|
825
|
+
default: D(() => [y(T(E(x).t("platform.screen.WorkflowConfigurationView.finish-configuration", "完成配置")), 1)]),
|
|
826
|
+
_: 1
|
|
827
|
+
}, 8, ["disabled"])])]),
|
|
828
|
+
default: D(() => [b(E(re), {
|
|
829
|
+
"condition-tools": E(qe),
|
|
830
|
+
design: V.value,
|
|
831
|
+
"node-key": H.value,
|
|
832
|
+
"route-key": U.value,
|
|
833
|
+
editable: J.value,
|
|
834
|
+
http: E(A).http,
|
|
835
|
+
"module-alias": d.moduleAlias,
|
|
836
|
+
fields: E(M),
|
|
837
|
+
catalog: N.value,
|
|
838
|
+
actions: Je.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)) : g("v-if", !0)
|
|
861
|
+
]),
|
|
862
|
+
_: 2
|
|
863
|
+
}, [z.value ? {
|
|
864
|
+
name: "status",
|
|
865
|
+
fn: D(() => [v("div", Ie, [b(E(pe), {
|
|
866
|
+
class: "configuration-version-selector",
|
|
867
|
+
value: B.value?.id,
|
|
868
|
+
options: R.value.map((e) => ({
|
|
869
|
+
value: e.id,
|
|
870
|
+
label: E(x).t("platform.screen.WorkflowConfigurationView.version-value-value", "版本 {value1} · {value2}", {
|
|
871
|
+
value1: e.versionNo,
|
|
872
|
+
value2: Ce(e.publishStatus)
|
|
873
|
+
})
|
|
874
|
+
})),
|
|
875
|
+
disabled: W.value || E(K),
|
|
876
|
+
"onUpdate:value": t[1] ||= (e) => pt(String(e))
|
|
877
|
+
}, null, 8, [
|
|
878
|
+
"value",
|
|
879
|
+
"options",
|
|
880
|
+
"disabled"
|
|
881
|
+
]), E(K) ? (S(), h(E(ne), {
|
|
882
|
+
key: 0,
|
|
883
|
+
title: E(x).t("platform.screen.WorkflowConfigurationView.the-draft-has-unsaved-changes", "草稿有未保存的修改")
|
|
884
|
+
}, {
|
|
885
|
+
default: D(() => [v("span", Le, T(E(x).t("platform.workflow-config.unsaved", "未保存")), 1)]),
|
|
886
|
+
_: 1
|
|
887
|
+
}, 8, ["title"])) : nt.value ? (S(), h(E(ne), {
|
|
888
|
+
key: 1,
|
|
889
|
+
title: E(x).t("platform.screen.WorkflowConfigurationView.this-version-is-frozen-create-a-new", "此版本已冻结。修改流程请创建新版本;已有实例继续使用原版本。")
|
|
890
|
+
}, {
|
|
891
|
+
default: D(() => [v("span", Re, T(E(x).t("platform.workflow-config.readonly", "只读")), 1)]),
|
|
892
|
+
_: 1
|
|
893
|
+
}, 8, ["title"])) : g("v-if", !0)])]),
|
|
894
|
+
key: "0"
|
|
895
|
+
} : void 0]), 1032, ["title"]), b(E(a), {
|
|
896
|
+
width: "extraWide",
|
|
897
|
+
open: F.value,
|
|
898
|
+
title: E(x).t("platform.screen.WorkflowConfigurationView.confirm-workflow-publication", "确认发布流程"),
|
|
899
|
+
onClose: t[5] ||= (e) => F.value = !1
|
|
900
|
+
}, {
|
|
901
|
+
operation: D(() => [b(E(f), {
|
|
902
|
+
type: "primary",
|
|
903
|
+
loading: W.value,
|
|
904
|
+
onClick: gt
|
|
905
|
+
}, {
|
|
906
|
+
default: D(() => [y(T(E(x).t("platform.screen.WorkflowConfigurationView.confirm-publication", "确认发布")), 1)]),
|
|
907
|
+
_: 1
|
|
908
|
+
}, 8, ["loading"])]),
|
|
909
|
+
default: D(() => [
|
|
910
|
+
v("p", null, T(E(x).t("platform.workflow-config.publication-frozen", "流程:{title} · 版本 {version}。发布后配置冻结;已有实例继续使用原版本。", {
|
|
911
|
+
title: z.value?.title,
|
|
912
|
+
version: B.value?.versionNo
|
|
913
|
+
})), 1),
|
|
914
|
+
v("p", null, T(E(x).t("platform.workflow-config.matching-scope", "匹配范围")) + ":" + T(z.value?.organizationId ? E(x).t("platform.workflow-config.scoped-organizations", "指定组织及下级组织") : E(x).t("platform.workflow-config.all-organizations", "模块内全部组织")) + ";" + T(z.value?.defaultDefinition ? E(x).t("platform.workflow-config.default-workflow", "作为默认兜底流程") : E(x).t("platform.workflow-config.conditional-workflow", "按匹配条件选择")) + "。 " + T(z.value?.matchExpression ? E(x).t("platform.workflow-config.matching-expression", "匹配条件:{expression}", { expression: z.value.matchExpression }) : E(x).t("platform.workflow-config.no-matching-condition", "未设置额外条件")), 1),
|
|
915
|
+
v("ul", Be, [(S(!0), _(p, null, w(V.value.nodes.filter((e) => ["approval", "task"].includes(e.nodeType)), (e) => (S(), _("li", { key: e.nodeKey }, [
|
|
916
|
+
v("strong", null, T(e.title), 1),
|
|
917
|
+
y(" · " + T(tt(e.participantPolicyText)) + " ", 1),
|
|
918
|
+
v("details", null, [v("summary", null, T(E(x).t("platform.screen.WorkflowConfigurationView.view-complete-participant-rules", "查看完整人员规则")), 1), b(E(me), {
|
|
919
|
+
value: e.participantPolicyText,
|
|
920
|
+
http: E(A).http,
|
|
921
|
+
fields: E(M),
|
|
922
|
+
disabled: ""
|
|
923
|
+
}, null, 8, [
|
|
924
|
+
"value",
|
|
925
|
+
"http",
|
|
926
|
+
"fields"
|
|
927
|
+
])]),
|
|
928
|
+
e.nodeType === "task" ? (S(), _("details", Ve, [
|
|
929
|
+
v("summary", null, T(E(x).t("platform.screen.WorkflowConfigurationView.view-business-task-checks-and-instructions", "查看业务任务检查与办理指引")), 1),
|
|
930
|
+
e.taskDefinitionId ? (S(), _("p", He, T(E(x).t("platform.workflow-config.referenced-task", "引用任务")) + ":" + T(N.value.tasks.find((t) => t.id === e.taskDefinitionId)?.title ?? e.taskDefinitionId), 1)) : g("v-if", !0),
|
|
931
|
+
b(E(fe), {
|
|
932
|
+
"condition-tools": E(qe),
|
|
933
|
+
value: e.nodeConfigText,
|
|
934
|
+
"module-alias": d.moduleAlias,
|
|
935
|
+
fields: E(M),
|
|
936
|
+
catalog: N.value,
|
|
937
|
+
actions: Je.value,
|
|
938
|
+
associations: N.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
|
+
])) : g("v-if", !0),
|
|
953
|
+
e.participantPolicyText?.includes("INITIATOR_SELF") ? (S(), _("p", Ue, T(E(x).t("platform.screen.WorkflowConfigurationView.the-submitter-processes-this-node-confirm-that", "此节点由提交人本人办理,请确认符合业务要求。")), 1)) : g("v-if", !0)
|
|
954
|
+
]))), 128))]),
|
|
955
|
+
(S(!0), _(p, null, w(V.value.nodes.filter((e) => e.nodeType === "branch"), (e) => (S(), _("div", { key: e.nodeKey }, [
|
|
956
|
+
v("strong", null, T(e.title) + " · " + T(e.routeMode === "manual" ? E(x).t("platform.workflow-config.manual-route", "人工单选") : E(x).t("platform.workflow-config.auto-route", "自动判定(全部命中出口)")), 1),
|
|
957
|
+
e.routeMode === "manual" ? (S(), _("p", We, T(E(x).t("platform.workflow-config.selector-summary", "由{title}的实际办理人选路;{reason}。", {
|
|
958
|
+
title: V.value.nodes.find((t) => t.nodeKey === e.selectorNodeKey)?.title ?? E(x).t("platform.workflow-config.missing-selector", "未配置选择节点"),
|
|
959
|
+
reason: e.requireManualSelectionReason ? E(x).t("platform.workflow-config.reason-required", "必须填写原因") : E(x).t("platform.workflow-config.reason-optional", "原因选填")
|
|
960
|
+
})), 1)) : g("v-if", !0),
|
|
961
|
+
v("ul", null, [(S(!0), _(p, null, w(V.value.links.filter((t) => t.sourceNodeKey === e.nodeKey), (e) => (S(), _("li", { key: e.routeKey }, T(e.title ?? E(x).t("platform.workflow-config.exit", "出口")) + ":" + T(e.defaultRoute ? E(x).t("platform.workflow-config.fallback-exit", "默认兜底") : e.conditionExpression || E(x).t("platform.workflow-config.unconditional", "无条件(始终命中)")), 1))), 128))]),
|
|
962
|
+
v("p", null, T(E(x).t("platform.workflow-config.convergence-counting", "汇聚:{summary},只计算有效出口。", { summary: st(e) })), 1)
|
|
963
|
+
]))), 128)),
|
|
964
|
+
v("details", null, [v("summary", null, T(E(x).t("platform.screen.WorkflowConfigurationView.view-published-workflow", "查看发布流程图")), 1), b(E(ae), {
|
|
965
|
+
presentation: "detail",
|
|
966
|
+
nodes: V.value.nodes,
|
|
967
|
+
routes: V.value.links,
|
|
968
|
+
"layout-json": V.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 { j as default };
|