@web-utils/component 3.5.0 → 3.6.1
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/chunks/ElementBaseInfo.jv89Vjy1.mjs +118 -0
- package/chunks/ElementForm.4QQYs5uq.mjs +241 -0
- package/chunks/ElementListeners.vfHHHAOL.mjs +255 -0
- package/chunks/ElementMultiInstance.3Z28ewuh.mjs +191 -0
- package/chunks/ElementOtherConfig.B1NfMTYh.mjs +60 -0
- package/chunks/ElementProperties.CRIQaaPc.mjs +112 -0
- package/chunks/ElementTaskConfig.MBbkLrth.mjs +326 -0
- package/chunks/FlowCondition.BfU9kw6h.mjs +132 -0
- package/chunks/SignalAndMessage.CH6L7cYu.mjs +96 -0
- package/chunks/UserTaskListeners.XXe5dC5I.mjs +210 -0
- package/chunks/{json-beautifier.j1-U5g4P.mjs → json-beautifier.Bp3GslGm.mjs} +2 -0
- package/chunks/utilSelf.CRqpl0Cz.mjs +56 -0
- package/chunks/utils.DRcxC1Fb.mjs +60 -0
- package/element-listeners/style.css +1 -0
- package/element-multi-instance/style.css +1 -0
- package/ellipsis/index.mjs +148 -0
- package/ellipsis/style.css +1 -0
- package/flow-designer/index.mjs +519 -2134
- package/flow-designer/style.css +1 -1
- package/fy-form-design/index.mjs +1 -1
- package/index.mjs +455 -451
- package/monaco-editor/index.mjs +1 -1
- package/package.json +5 -5
- package/vue-tree-select/index.mjs +354 -347
- package/web-types.json +79 -1
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var o = Object.getOwnPropertySymbols;
|
|
3
|
+
var p = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var l = (a, e, s) => e in a ? m(a, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[e] = s, c = (a, e) => {
|
|
5
|
+
for (var s in e || (e = {}))
|
|
6
|
+
p.call(e, s) && l(a, s, e[s]);
|
|
7
|
+
if (o)
|
|
8
|
+
for (var s of o(e))
|
|
9
|
+
u.call(e, s) && l(a, s, e[s]);
|
|
10
|
+
return a;
|
|
11
|
+
};
|
|
12
|
+
import { n } from "./_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
13
|
+
const d = {
|
|
14
|
+
name: "UserTask",
|
|
15
|
+
props: {
|
|
16
|
+
id: String,
|
|
17
|
+
element: Object,
|
|
18
|
+
bpmnInstances: Object
|
|
19
|
+
},
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
defaultTaskForm: {
|
|
23
|
+
assignee: "",
|
|
24
|
+
candidateUsers: [],
|
|
25
|
+
candidateGroups: [],
|
|
26
|
+
dueDate: "",
|
|
27
|
+
followUpDate: "",
|
|
28
|
+
priority: ""
|
|
29
|
+
},
|
|
30
|
+
userTaskForm: {},
|
|
31
|
+
mockData: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
watch: {
|
|
35
|
+
id: {
|
|
36
|
+
immediate: !0,
|
|
37
|
+
handler() {
|
|
38
|
+
this.$nextTick(() => this.resetTaskForm());
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
methods: {
|
|
43
|
+
resetTaskForm() {
|
|
44
|
+
const { businessObject: a } = this.element;
|
|
45
|
+
for (const e in this.defaultTaskForm) {
|
|
46
|
+
let s;
|
|
47
|
+
["candidateUsers", "candidateGroups"].includes(e) ? s = a[e] ? a[e].split(",") : [] : s = a[e] || this.defaultTaskForm[e], this.$set(this.userTaskForm, e, s);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
updateElementTask(a) {
|
|
51
|
+
const e = {};
|
|
52
|
+
a === "candidateUsers" || a === "candidateGroups" ? e[a] = this.userTaskForm[a] && this.userTaskForm[a].length ? this.userTaskForm[a].join() : null : e[a] = this.userTaskForm[a] || null, this.bpmnInstances.modeling.updateProperties(this.element, e);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var f = function() {
|
|
57
|
+
var e = this, s = e._self._c;
|
|
58
|
+
return s("div", { staticStyle: { "margin-top": "16px" } }, [s("ElFormItem", { attrs: { label: "处理用户" } }, [s("ElSelect", { on: { change: function(t) {
|
|
59
|
+
return e.updateElementTask("assignee");
|
|
60
|
+
} }, model: { value: e.userTaskForm.assignee, callback: function(t) {
|
|
61
|
+
e.$set(e.userTaskForm, "assignee", t);
|
|
62
|
+
}, expression: "userTaskForm.assignee" } }, e._l(e.mockData, function(t) {
|
|
63
|
+
return s("ElOption", { key: `ass-${t}`, attrs: { label: `用户${t}`, value: `user${t}` } });
|
|
64
|
+
}), 1)], 1), s("ElFormItem", { attrs: { label: "候选用户" } }, [s("ElSelect", { attrs: { multiple: "", "collapse-tags": "" }, on: { change: function(t) {
|
|
65
|
+
return e.updateElementTask("candidateUsers");
|
|
66
|
+
} }, model: { value: e.userTaskForm.candidateUsers, callback: function(t) {
|
|
67
|
+
e.$set(e.userTaskForm, "candidateUsers", t);
|
|
68
|
+
}, expression: "userTaskForm.candidateUsers" } }, e._l(e.mockData, function(t) {
|
|
69
|
+
return s("ElOption", { key: `user-${t}`, attrs: { label: `用户${t}`, value: `user${t}` } });
|
|
70
|
+
}), 1)], 1), s("ElFormItem", { attrs: { label: "候选分组" } }, [s("ElSelect", { attrs: { multiple: "", "collapse-tags": "" }, on: { change: function(t) {
|
|
71
|
+
return e.updateElementTask("candidateGroups");
|
|
72
|
+
} }, model: { value: e.userTaskForm.candidateGroups, callback: function(t) {
|
|
73
|
+
e.$set(e.userTaskForm, "candidateGroups", t);
|
|
74
|
+
}, expression: "userTaskForm.candidateGroups" } }, e._l(e.mockData, function(t) {
|
|
75
|
+
return s("ElOption", { key: `ass-${t}`, attrs: { label: `分组${t}`, value: `group${t}` } });
|
|
76
|
+
}), 1)], 1), s("ElFormItem", { attrs: { label: "到期时间" } }, [s("ElInput", { attrs: { clearable: "" }, on: { change: function(t) {
|
|
77
|
+
return e.updateElementTask("dueDate");
|
|
78
|
+
} }, model: { value: e.userTaskForm.dueDate, callback: function(t) {
|
|
79
|
+
e.$set(e.userTaskForm, "dueDate", t);
|
|
80
|
+
}, expression: "userTaskForm.dueDate" } })], 1), s("ElFormItem", { attrs: { label: "跟踪时间" } }, [s("ElInput", { attrs: { clearable: "" }, on: { change: function(t) {
|
|
81
|
+
return e.updateElementTask("followUpDate");
|
|
82
|
+
} }, model: { value: e.userTaskForm.followUpDate, callback: function(t) {
|
|
83
|
+
e.$set(e.userTaskForm, "followUpDate", t);
|
|
84
|
+
}, expression: "userTaskForm.followUpDate" } })], 1), s("ElFormItem", { attrs: { label: "优先级" } }, [s("ElInput", { attrs: { clearable: "" }, on: { change: function(t) {
|
|
85
|
+
return e.updateElementTask("priority");
|
|
86
|
+
} }, model: { value: e.userTaskForm.priority, callback: function(t) {
|
|
87
|
+
e.$set(e.userTaskForm, "priority", t);
|
|
88
|
+
}, expression: "userTaskForm.priority" } })], 1)], 1);
|
|
89
|
+
}, k = [], h = /* @__PURE__ */ n(
|
|
90
|
+
d,
|
|
91
|
+
f,
|
|
92
|
+
k,
|
|
93
|
+
!1,
|
|
94
|
+
null,
|
|
95
|
+
null
|
|
96
|
+
);
|
|
97
|
+
const b = h.exports, F = {
|
|
98
|
+
name: "ScriptTask",
|
|
99
|
+
props: {
|
|
100
|
+
id: String,
|
|
101
|
+
element: Object,
|
|
102
|
+
bpmnInstances: Object
|
|
103
|
+
},
|
|
104
|
+
data() {
|
|
105
|
+
return {
|
|
106
|
+
defaultTaskForm: {
|
|
107
|
+
scriptFormat: "",
|
|
108
|
+
script: "",
|
|
109
|
+
resource: "",
|
|
110
|
+
resultVariable: ""
|
|
111
|
+
},
|
|
112
|
+
scriptTaskForm: {}
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
watch: {
|
|
116
|
+
id: {
|
|
117
|
+
immediate: !0,
|
|
118
|
+
handler() {
|
|
119
|
+
this.$nextTick(() => this.resetTaskForm());
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
methods: {
|
|
124
|
+
resetTaskForm() {
|
|
125
|
+
var a;
|
|
126
|
+
for (const e in this.defaultTaskForm) {
|
|
127
|
+
const s = ((a = this.element) == null ? void 0 : a.businessObject[e]) || this.defaultTaskForm[e];
|
|
128
|
+
this.$set(this.scriptTaskForm, e, s);
|
|
129
|
+
}
|
|
130
|
+
this.$set(this.scriptTaskForm, "scriptType", this.scriptTaskForm.script ? "inline" : "external");
|
|
131
|
+
},
|
|
132
|
+
updateElementTask() {
|
|
133
|
+
const a = /* @__PURE__ */ Object.create(null);
|
|
134
|
+
a.scriptFormat = this.scriptTaskForm.scriptFormat || null, a.resultVariable = this.scriptTaskForm.resultVariable || null, this.scriptTaskForm.scriptType === "inline" ? (a.script = this.scriptTaskForm.script || null, a.resource = null) : (a.resource = this.scriptTaskForm.resource || null, a.script = null), this.bpmnInstances.modeling.updateProperties(this.element, a);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
var g = function() {
|
|
139
|
+
var e = this, s = e._self._c;
|
|
140
|
+
return s("div", { staticStyle: { "margin-top": "16px" } }, [s("ElFormItem", { attrs: { label: "脚本格式" } }, [s("ElInput", { attrs: { clearable: "" }, on: { input: function(t) {
|
|
141
|
+
return e.updateElementTask();
|
|
142
|
+
}, change: function(t) {
|
|
143
|
+
return e.updateElementTask();
|
|
144
|
+
} }, model: { value: e.scriptTaskForm.scriptFormat, callback: function(t) {
|
|
145
|
+
e.$set(e.scriptTaskForm, "scriptFormat", t);
|
|
146
|
+
}, expression: "scriptTaskForm.scriptFormat" } })], 1), s("ElFormItem", { attrs: { label: "脚本类型" } }, [s("ElSelect", { model: { value: e.scriptTaskForm.scriptType, callback: function(t) {
|
|
147
|
+
e.$set(e.scriptTaskForm, "scriptType", t);
|
|
148
|
+
}, expression: "scriptTaskForm.scriptType" } }, [s("ElOption", { attrs: { label: "内联脚本", value: "inline" } }), s("ElOption", { attrs: { label: "外部资源", value: "external" } })], 1)], 1), s("ElFormItem", { directives: [{ name: "show", rawName: "v-show", value: e.scriptTaskForm.scriptType === "inline", expression: "scriptTaskForm.scriptType === 'inline'" }], attrs: { label: "脚本" } }, [s("ElInput", { attrs: { type: "textarea", resize: "vertical", autosize: { minRows: 2, maxRows: 4 }, clearable: "" }, on: { input: function(t) {
|
|
149
|
+
return e.updateElementTask();
|
|
150
|
+
}, change: function(t) {
|
|
151
|
+
return e.updateElementTask();
|
|
152
|
+
} }, model: { value: e.scriptTaskForm.script, callback: function(t) {
|
|
153
|
+
e.$set(e.scriptTaskForm, "script", t);
|
|
154
|
+
}, expression: "scriptTaskForm.script" } })], 1), s("ElFormItem", { directives: [{ name: "show", rawName: "v-show", value: e.scriptTaskForm.scriptType === "external", expression: "scriptTaskForm.scriptType === 'external'" }], attrs: { label: "资源地址" } }, [s("ElInput", { attrs: { clearable: "" }, on: { input: function(t) {
|
|
155
|
+
return e.updateElementTask();
|
|
156
|
+
}, change: function(t) {
|
|
157
|
+
return e.updateElementTask();
|
|
158
|
+
} }, model: { value: e.scriptTaskForm.resource, callback: function(t) {
|
|
159
|
+
e.$set(e.scriptTaskForm, "resource", t);
|
|
160
|
+
}, expression: "scriptTaskForm.resource" } })], 1), s("ElFormItem", { attrs: { label: "结果变量" } }, [s("ElInput", { attrs: { clearable: "" }, on: { input: function(t) {
|
|
161
|
+
return e.updateElementTask();
|
|
162
|
+
}, change: function(t) {
|
|
163
|
+
return e.updateElementTask();
|
|
164
|
+
} }, model: { value: e.scriptTaskForm.resultVariable, callback: function(t) {
|
|
165
|
+
e.$set(e.scriptTaskForm, "resultVariable", t);
|
|
166
|
+
}, expression: "scriptTaskForm.resultVariable" } })], 1)], 1);
|
|
167
|
+
}, T = [], v = /* @__PURE__ */ n(
|
|
168
|
+
F,
|
|
169
|
+
g,
|
|
170
|
+
T,
|
|
171
|
+
!1,
|
|
172
|
+
null,
|
|
173
|
+
null
|
|
174
|
+
);
|
|
175
|
+
const E = v.exports, _ = {
|
|
176
|
+
name: "ReceiveTask",
|
|
177
|
+
props: {
|
|
178
|
+
id: String,
|
|
179
|
+
element: Object,
|
|
180
|
+
bpmnInstances: Object
|
|
181
|
+
},
|
|
182
|
+
data() {
|
|
183
|
+
return {
|
|
184
|
+
bindMessageId: "",
|
|
185
|
+
newMessageForm: {},
|
|
186
|
+
messageMap: {},
|
|
187
|
+
messageModelVisible: !1
|
|
188
|
+
};
|
|
189
|
+
},
|
|
190
|
+
watch: {
|
|
191
|
+
id: {
|
|
192
|
+
immediate: !0,
|
|
193
|
+
handler() {
|
|
194
|
+
this.$nextTick(() => this.getBindMessage());
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
created() {
|
|
199
|
+
this.bpmnMessageRefsMap = /* @__PURE__ */ Object.create(null), this.bpmnRootElements = this.bpmnInstances.modeler.getDefinitions().rootElements, this.bpmnRootElements.filter((a) => a.$type === "bpmn:Message").forEach((a) => {
|
|
200
|
+
this.bpmnMessageRefsMap[a.id] = a, this.$set(this.messageMap, a.id, a.name);
|
|
201
|
+
}), this.$set(this.messageMap, "-1", "无");
|
|
202
|
+
},
|
|
203
|
+
methods: {
|
|
204
|
+
getBindMessage() {
|
|
205
|
+
var a, e;
|
|
206
|
+
this.bindMessageId = ((e = (a = this.element.businessObject) == null ? void 0 : a.messageRef) == null ? void 0 : e.id) || "-1";
|
|
207
|
+
},
|
|
208
|
+
openMessageModel() {
|
|
209
|
+
this.messageModelVisible = !0, this.newMessageForm = {};
|
|
210
|
+
},
|
|
211
|
+
createNewMessage() {
|
|
212
|
+
if (this.messageMap[this.newMessageForm.id]) {
|
|
213
|
+
this.$message.error("该消息已存在,请修改id后重新保存");
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
const a = this.bpmnInstances.moddle.create("bpmn:Message", this.newMessageForm);
|
|
217
|
+
this.bpmnRootElements.push(a), this.$set(this.messageMap, this.newMessageForm.id, this.newMessageForm.name), this.bpmnMessageRefsMap[this.newMessageForm.id] = a, this.messageModelVisible = !1;
|
|
218
|
+
},
|
|
219
|
+
updateTaskMessage(a) {
|
|
220
|
+
a === "-1" ? this.bpmnInstances.modeling.updateProperties(this.element, {
|
|
221
|
+
messageRef: null
|
|
222
|
+
}) : this.bpmnInstances.modeling.updateProperties(this.element, {
|
|
223
|
+
messageRef: this.bpmnMessageRefsMap[a]
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
var $ = function() {
|
|
229
|
+
var e = this, s = e._self._c;
|
|
230
|
+
return s("div", { staticStyle: { "margin-top": "16px" } }, [s("ElFormItem", { attrs: { label: "消息实例" } }, [s("div", { staticStyle: { display: "flex", "flex-wrap": "nowrap", "align-items": "center", "justify-content": "space-between" } }, [s("ElSelect", { on: { change: e.updateTaskMessage }, model: { value: e.bindMessageId, callback: function(t) {
|
|
231
|
+
e.bindMessageId = t;
|
|
232
|
+
}, expression: "bindMessageId" } }, e._l(Object.keys(e.messageMap), function(t) {
|
|
233
|
+
return s("ElOption", { key: t, attrs: { value: t, label: e.messageMap[t] } });
|
|
234
|
+
}), 1), s("ElButton", { staticStyle: { "margin-left": "8px" }, attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: e.openMessageModel } })], 1)]), s("ElementDialog", { staticClass: "flow-dialog", attrs: { visible: e.messageModelVisible, "close-on-click-modal": !1, title: "创建新消息", width: "400px", "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(t) {
|
|
235
|
+
e.messageModelVisible = t;
|
|
236
|
+
} }, scopedSlots: e._u([{ key: "footer", fn: function() {
|
|
237
|
+
return [s("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.createNewMessage } }, [e._v("确 认")])];
|
|
238
|
+
}, proxy: !0 }]) }, [s("ElForm", { attrs: { model: e.newMessageForm, size: "mini", "label-width": "90px" }, nativeOn: { submit: function(t) {
|
|
239
|
+
t.preventDefault();
|
|
240
|
+
} } }, [s("ElFormItem", { attrs: { label: "消息ID" } }, [s("ElInput", { attrs: { clearable: "" }, model: { value: e.newMessageForm.id, callback: function(t) {
|
|
241
|
+
e.$set(e.newMessageForm, "id", t);
|
|
242
|
+
}, expression: "newMessageForm.id" } })], 1), s("ElFormItem", { attrs: { label: "消息名称" } }, [s("ElInput", { attrs: { clearable: "" }, model: { value: e.newMessageForm.name, callback: function(t) {
|
|
243
|
+
e.$set(e.newMessageForm, "name", t);
|
|
244
|
+
}, expression: "newMessageForm.name" } })], 1)], 1)], 1)], 1);
|
|
245
|
+
}, y = [], x = /* @__PURE__ */ n(
|
|
246
|
+
_,
|
|
247
|
+
$,
|
|
248
|
+
y,
|
|
249
|
+
!1,
|
|
250
|
+
null,
|
|
251
|
+
null
|
|
252
|
+
);
|
|
253
|
+
const M = x.exports, w = {
|
|
254
|
+
name: "ElementTaskConfig",
|
|
255
|
+
components: { UserTask: b, ScriptTask: E, ReceiveTask: M },
|
|
256
|
+
props: {
|
|
257
|
+
id: String,
|
|
258
|
+
element: Object,
|
|
259
|
+
bpmnInstances: Object,
|
|
260
|
+
type: String
|
|
261
|
+
},
|
|
262
|
+
data() {
|
|
263
|
+
return {
|
|
264
|
+
taskConfigForm: {
|
|
265
|
+
asyncAfter: !1,
|
|
266
|
+
asyncBefore: !1,
|
|
267
|
+
exclusive: !1
|
|
268
|
+
},
|
|
269
|
+
witchTaskComponent: "",
|
|
270
|
+
installedComponent: {
|
|
271
|
+
// 手工任务与普通任务一致,不需要其他配置
|
|
272
|
+
// 接收消息任务,需要在全局下插入新的消息实例,并在该节点下的 messageRef 属性绑定该实例
|
|
273
|
+
// 发送任务、服务任务、业务规则任务共用一个相同配置
|
|
274
|
+
UserTask: "UserTask",
|
|
275
|
+
// 用户任务配置
|
|
276
|
+
ScriptTask: "ScriptTask",
|
|
277
|
+
// 脚本任务配置
|
|
278
|
+
ReceiveTask: "ReceiveTask"
|
|
279
|
+
// 消息接收任务
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
},
|
|
283
|
+
watch: {
|
|
284
|
+
id: {
|
|
285
|
+
immediate: !0,
|
|
286
|
+
handler() {
|
|
287
|
+
var a, e, s, t, r, i;
|
|
288
|
+
this.taskConfigForm.asyncBefore = (e = (a = this.element) == null ? void 0 : a.businessObject) == null ? void 0 : e.asyncBefore, this.taskConfigForm.asyncAfter = (t = (s = this.element) == null ? void 0 : s.businessObject) == null ? void 0 : t.asyncAfter, this.taskConfigForm.exclusive = (i = (r = this.element) == null ? void 0 : r.businessObject) == null ? void 0 : i.exclusive;
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
type: {
|
|
292
|
+
immediate: !0,
|
|
293
|
+
handler() {
|
|
294
|
+
this.witchTaskComponent = this.installedComponent[this.type];
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
methods: {
|
|
299
|
+
changeTaskAsync() {
|
|
300
|
+
!this.taskConfigForm.asyncBefore && !this.taskConfigForm.asyncAfter && (this.taskConfigForm.exclusive = !1), this.bpmnInstances.modeling.updateProperties(this.element, c({}, this.taskConfigForm));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
var I = function() {
|
|
305
|
+
var e = this, s = e._self._c;
|
|
306
|
+
return s("div", { staticClass: "panel-tab__content" }, [s("ElForm", { attrs: { size: "mini", "label-width": "90px" }, nativeOn: { submit: function(t) {
|
|
307
|
+
t.preventDefault();
|
|
308
|
+
} } }, [s("ElFormItem", { attrs: { label: "异步延续" } }, [s("ElCheckbox", { attrs: { label: "异步前" }, on: { change: e.changeTaskAsync }, model: { value: e.taskConfigForm.asyncBefore, callback: function(t) {
|
|
309
|
+
e.$set(e.taskConfigForm, "asyncBefore", t);
|
|
310
|
+
}, expression: "taskConfigForm.asyncBefore" } }), s("ElCheckbox", { attrs: { label: "异步后" }, on: { change: e.changeTaskAsync }, model: { value: e.taskConfigForm.asyncAfter, callback: function(t) {
|
|
311
|
+
e.$set(e.taskConfigForm, "asyncAfter", t);
|
|
312
|
+
}, expression: "taskConfigForm.asyncAfter" } }), e.taskConfigForm.asyncAfter || e.taskConfigForm.asyncBefore ? s("ElCheckbox", { attrs: { label: "排除" }, on: { change: e.changeTaskAsync }, model: { value: e.taskConfigForm.exclusive, callback: function(t) {
|
|
313
|
+
e.$set(e.taskConfigForm, "exclusive", t);
|
|
314
|
+
}, expression: "taskConfigForm.exclusive" } }) : e._e()], 1), s(e.witchTaskComponent, e._b({ tag: "Component" }, "Component", e.$props, !1))], 1)], 1);
|
|
315
|
+
}, C = [], O = /* @__PURE__ */ n(
|
|
316
|
+
w,
|
|
317
|
+
I,
|
|
318
|
+
C,
|
|
319
|
+
!1,
|
|
320
|
+
null,
|
|
321
|
+
null
|
|
322
|
+
);
|
|
323
|
+
const j = O.exports;
|
|
324
|
+
export {
|
|
325
|
+
j as default
|
|
326
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var b = Object.defineProperty, F = Object.defineProperties;
|
|
2
|
+
var h = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var d = Object.getOwnPropertySymbols;
|
|
4
|
+
var w = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var m = (t, e, o) => e in t ? b(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, p = (t, e) => {
|
|
6
|
+
for (var o in e || (e = {}))
|
|
7
|
+
w.call(e, o) && m(t, o, e[o]);
|
|
8
|
+
if (d)
|
|
9
|
+
for (var o of d(e))
|
|
10
|
+
C.call(e, o) && m(t, o, e[o]);
|
|
11
|
+
return t;
|
|
12
|
+
}, c = (t, e) => F(t, h(e));
|
|
13
|
+
var u = (t, e, o) => new Promise((n, s) => {
|
|
14
|
+
var l = (i) => {
|
|
15
|
+
try {
|
|
16
|
+
r(o.next(i));
|
|
17
|
+
} catch (a) {
|
|
18
|
+
s(a);
|
|
19
|
+
}
|
|
20
|
+
}, f = (i) => {
|
|
21
|
+
try {
|
|
22
|
+
r(o.throw(i));
|
|
23
|
+
} catch (a) {
|
|
24
|
+
s(a);
|
|
25
|
+
}
|
|
26
|
+
}, r = (i) => i.done ? n(i.value) : Promise.resolve(i.value).then(l, f);
|
|
27
|
+
r((o = o.apply(t, e)).next());
|
|
28
|
+
});
|
|
29
|
+
import { n as y } from "./_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
30
|
+
const E = {
|
|
31
|
+
name: "FlowCondition",
|
|
32
|
+
props: {
|
|
33
|
+
id: String,
|
|
34
|
+
element: Object,
|
|
35
|
+
bpmnInstances: Object
|
|
36
|
+
},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
flowConditionForm: {}
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
watch: {
|
|
43
|
+
id: {
|
|
44
|
+
immediate: !0,
|
|
45
|
+
handler() {
|
|
46
|
+
return u(this, null, function* () {
|
|
47
|
+
yield this.$nextTick(), this.resetFlowCondition();
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
beforeDestroy() {
|
|
53
|
+
this.bpmnElementSource = null, this.bpmnElementSourceRef = null;
|
|
54
|
+
},
|
|
55
|
+
methods: {
|
|
56
|
+
resetFlowCondition() {
|
|
57
|
+
if (this.bpmnElementSource = this.element.source, this.bpmnElementSourceRef = this.element.businessObject.sourceRef, this.bpmnElementSourceRef && this.bpmnElementSourceRef.default && this.bpmnElementSourceRef.default.id === this.element.id)
|
|
58
|
+
this.flowConditionForm = { type: "default" };
|
|
59
|
+
else if (!this.element.businessObject.conditionExpression)
|
|
60
|
+
this.flowConditionForm = { type: "normal" };
|
|
61
|
+
else {
|
|
62
|
+
const t = this.element.businessObject.conditionExpression;
|
|
63
|
+
if (this.flowConditionForm = c(p({}, t), { type: "condition" }), this.flowConditionForm.resource) {
|
|
64
|
+
this.$set(this.flowConditionForm, "conditionType", "script"), this.$set(this.flowConditionForm, "scriptType", "externalScript");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (t.language) {
|
|
68
|
+
this.$set(this.flowConditionForm, "conditionType", "script"), this.$set(this.flowConditionForm, "scriptType", "inlineScript");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.$set(this.flowConditionForm, "conditionType", "expression");
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
updateFlowType(t) {
|
|
75
|
+
if (t === "condition") {
|
|
76
|
+
this.flowConditionRef = this.bpmnInstances.moddle.create("bpmn:FormalExpression"), this.bpmnInstances.modeling.updateProperties(this.element, {
|
|
77
|
+
conditionExpression: this.flowConditionRef
|
|
78
|
+
});
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (t === "default") {
|
|
82
|
+
this.bpmnInstances.modeling.updateProperties(this.element, {
|
|
83
|
+
conditionExpression: null
|
|
84
|
+
}), this.bpmnInstances.modeling.updateProperties(this.bpmnElementSource, {
|
|
85
|
+
default: this.element
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.bpmnElementSourceRef.default && this.bpmnElementSourceRef.default.id === this.element.id && this.bpmnInstances.modeling.updateProperties(this.bpmnElementSource, {
|
|
90
|
+
default: null
|
|
91
|
+
}), this.bpmnInstances.modeling.updateProperties(this.element, {
|
|
92
|
+
conditionExpression: null
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
updateFlowCondition() {
|
|
96
|
+
const { conditionType: t, scriptType: e, body: o, resource: n, language: s } = this.flowConditionForm;
|
|
97
|
+
let l;
|
|
98
|
+
t === "expression" ? l = this.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: o }) : e === "inlineScript" ? (l = this.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: o, language: s }), this.$set(this.flowConditionForm, "resource", "")) : (this.$set(this.flowConditionForm, "body", ""), l = this.bpmnInstances.moddle.create("bpmn:FormalExpression", { resource: n, language: s })), this.bpmnInstances.modeling.updateProperties(this.element, { conditionExpression: l });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var x = function() {
|
|
103
|
+
var e = this, o = e._self._c;
|
|
104
|
+
return o("div", { staticClass: "panel-tab__content" }, [o("ElForm", { attrs: { model: e.flowConditionForm, "label-width": "90px", size: "mini" }, nativeOn: { submit: function(n) {
|
|
105
|
+
n.preventDefault();
|
|
106
|
+
} } }, [o("ElFormItem", { attrs: { label: "流转类型" } }, [o("ElSelect", { on: { change: e.updateFlowType }, model: { value: e.flowConditionForm.type, callback: function(n) {
|
|
107
|
+
e.$set(e.flowConditionForm, "type", n);
|
|
108
|
+
}, expression: "flowConditionForm.type" } }, [o("ElOption", { attrs: { label: "普通流转路径", value: "normal" } }), o("ElOption", { attrs: { label: "默认流转路径", value: "default" } }), o("ElOption", { attrs: { label: "条件流转路径", value: "condition" } })], 1)], 1), e.flowConditionForm.type === "condition" ? o("ElFormItem", { key: "condition", attrs: { label: "条件格式" } }, [o("ElSelect", { model: { value: e.flowConditionForm.conditionType, callback: function(n) {
|
|
109
|
+
e.$set(e.flowConditionForm, "conditionType", n);
|
|
110
|
+
}, expression: "flowConditionForm.conditionType" } }, [o("ElOption", { attrs: { label: "表达式", value: "expression" } }), o("ElOption", { attrs: { label: "脚本", value: "script" } })], 1)], 1) : e._e(), e.flowConditionForm.conditionType && e.flowConditionForm.conditionType === "expression" ? o("ElFormItem", { key: "express", attrs: { label: "表达式" } }, [o("ElInput", { attrs: { clearable: "" }, on: { change: e.updateFlowCondition }, model: { value: e.flowConditionForm.body, callback: function(n) {
|
|
111
|
+
e.$set(e.flowConditionForm, "body", n);
|
|
112
|
+
}, expression: "flowConditionForm.body" } })], 1) : e._e(), e.flowConditionForm.conditionType && e.flowConditionForm.conditionType === "script" ? [o("ElFormItem", { key: "language", attrs: { label: "脚本语言" } }, [o("ElInput", { attrs: { clearable: "" }, on: { change: e.updateFlowCondition }, model: { value: e.flowConditionForm.language, callback: function(n) {
|
|
113
|
+
e.$set(e.flowConditionForm, "language", n);
|
|
114
|
+
}, expression: "flowConditionForm.language" } })], 1), o("ElFormItem", { key: "scriptType", attrs: { label: "脚本类型" } }, [o("ElSelect", { model: { value: e.flowConditionForm.scriptType, callback: function(n) {
|
|
115
|
+
e.$set(e.flowConditionForm, "scriptType", n);
|
|
116
|
+
}, expression: "flowConditionForm.scriptType" } }, [o("ElOption", { attrs: { label: "内联脚本", value: "inlineScript" } }), o("ElOption", { attrs: { label: "外部脚本", value: "externalScript" } })], 1)], 1), e.flowConditionForm.scriptType === "inlineScript" ? o("ElFormItem", { key: "body", attrs: { label: "脚本" } }, [o("ElInput", { attrs: { type: "textarea", clearable: "" }, on: { change: e.updateFlowCondition }, model: { value: e.flowConditionForm.body, callback: function(n) {
|
|
117
|
+
e.$set(e.flowConditionForm, "body", n);
|
|
118
|
+
}, expression: "flowConditionForm.body" } })], 1) : e._e(), e.flowConditionForm.scriptType === "externalScript" ? o("ElFormItem", { key: "resource", attrs: { label: "资源地址" } }, [o("ElInput", { attrs: { clearable: "" }, on: { change: e.updateFlowCondition }, model: { value: e.flowConditionForm.resource, callback: function(n) {
|
|
119
|
+
e.$set(e.flowConditionForm, "resource", n);
|
|
120
|
+
}, expression: "flowConditionForm.resource" } })], 1) : e._e()] : e._e()], 2)], 1);
|
|
121
|
+
}, g = [], v = /* @__PURE__ */ y(
|
|
122
|
+
E,
|
|
123
|
+
x,
|
|
124
|
+
g,
|
|
125
|
+
!1,
|
|
126
|
+
null,
|
|
127
|
+
null
|
|
128
|
+
);
|
|
129
|
+
const T = v.exports;
|
|
130
|
+
export {
|
|
131
|
+
T as default
|
|
132
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var o = Object.getOwnPropertySymbols;
|
|
3
|
+
var m = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var a = (s, e, t) => e in s ? n(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, l = (s, e) => {
|
|
5
|
+
for (var t in e || (e = {}))
|
|
6
|
+
m.call(e, t) && a(s, t, e[t]);
|
|
7
|
+
if (o)
|
|
8
|
+
for (var t of o(e))
|
|
9
|
+
r.call(e, t) && a(s, t, e[t]);
|
|
10
|
+
return s;
|
|
11
|
+
};
|
|
12
|
+
import { n as d } from "./_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
13
|
+
const c = {
|
|
14
|
+
name: "SignalAndMessage",
|
|
15
|
+
props: {
|
|
16
|
+
bpmnInstances: Object
|
|
17
|
+
},
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
signalList: [],
|
|
21
|
+
messageList: [],
|
|
22
|
+
modelVisible: !1,
|
|
23
|
+
modelType: "",
|
|
24
|
+
modelObjectForm: {}
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
computed: {
|
|
28
|
+
modelConfig() {
|
|
29
|
+
return this.modelType === "message" ? { title: "创建消息", idLabel: "消息ID", nameLabel: "消息名称" } : { title: "创建信号", idLabel: "信号ID", nameLabel: "信号名称" };
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
mounted() {
|
|
33
|
+
this.initDataList();
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
initDataList() {
|
|
37
|
+
this.rootElements = this.bpmnInstances.modeler.getDefinitions().rootElements, this.messageIdMap = {}, this.signalIdMap = {}, this.messageList = [], this.signalList = [], this.rootElements.forEach((s) => {
|
|
38
|
+
s.$type === "bpmn:Message" && (this.messageIdMap[s.id] = !0, this.messageList.push(l({}, s))), s.$type === "bpmn:Signal" && (this.signalIdMap[s.id] = !0, this.signalList.push(l({}, s)));
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
openModel(s) {
|
|
42
|
+
this.modelType = s, this.modelObjectForm = {}, this.modelVisible = !0;
|
|
43
|
+
},
|
|
44
|
+
addNewObject() {
|
|
45
|
+
if (this.modelType === "message") {
|
|
46
|
+
if (this.messageIdMap[this.modelObjectForm.id])
|
|
47
|
+
return this.$message.error("该消息已存在,请修改id后重新保存");
|
|
48
|
+
const s = this.bpmnInstances.moddle.create("bpmn:Message", this.modelObjectForm);
|
|
49
|
+
this.rootElements.push(s);
|
|
50
|
+
} else {
|
|
51
|
+
if (this.signalIdMap[this.modelObjectForm.id])
|
|
52
|
+
return this.$message.error("该信号已存在,请修改id后重新保存");
|
|
53
|
+
const s = this.bpmnInstances.moddle.create("bpmn:Signal", this.modelObjectForm);
|
|
54
|
+
this.rootElements.push(s);
|
|
55
|
+
}
|
|
56
|
+
this.modelVisible = !1, this.initDataList();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
var p = function() {
|
|
61
|
+
var e = this, t = e._self._c;
|
|
62
|
+
return t("div", { staticClass: "panel-tab__content" }, [t("div", { staticClass: "panel-tab__content--title" }, [e._m(0), t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(i) {
|
|
63
|
+
return e.openModel("message");
|
|
64
|
+
} } }, [e._v("创建新消息")])], 1), t("ElTable", { attrs: { data: e.messageList, size: "mini", border: "" } }, [t("ElTableColumn", { attrs: { type: "index", label: "序号", width: "60px" } }), t("ElTableColumn", { attrs: { label: "消息ID", prop: "id", "max-width": "300px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "消息名称", prop: "name", "max-width": "300px", "show-overflow-tooltip": "" } })], 1), t("div", { staticClass: "panel-tab__content--title", staticStyle: { "margin-top": "8px", "padding-top": "8px", "border-top": "1px solid #eee" } }, [e._m(1), t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(i) {
|
|
65
|
+
return e.openModel("signal");
|
|
66
|
+
} } }, [e._v("创建新信号")])], 1), t("ElTable", { attrs: { data: e.signalList, size: "mini", border: "" } }, [t("ElTableColumn", { attrs: { type: "index", label: "序号", width: "60px" } }), t("ElTableColumn", { attrs: { label: "信号ID", prop: "id", "max-width": "300px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "信号名称", prop: "name", "max-width": "300px", "show-overflow-tooltip": "" } })], 1), t("ElementDialog", { staticClass: "flow-dialog", attrs: { visible: e.modelVisible, title: e.modelConfig.title, "close-on-click-modal": !1, width: "400px", "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(i) {
|
|
67
|
+
e.modelVisible = i;
|
|
68
|
+
} }, scopedSlots: e._u([{ key: "footer", fn: function() {
|
|
69
|
+
return [t("ElButton", { attrs: { size: "mini" }, on: { click: function(i) {
|
|
70
|
+
e.modelVisible = !1;
|
|
71
|
+
} } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.addNewObject } }, [e._v("保 存")])];
|
|
72
|
+
}, proxy: !0 }]) }, [t("ElForm", { attrs: { model: e.modelObjectForm, size: "mini", "label-width": "90px" }, nativeOn: { submit: function(i) {
|
|
73
|
+
i.preventDefault();
|
|
74
|
+
} } }, [t("ElFormItem", { attrs: { label: e.modelConfig.idLabel } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.modelObjectForm.id, callback: function(i) {
|
|
75
|
+
e.$set(e.modelObjectForm, "id", i);
|
|
76
|
+
}, expression: "modelObjectForm.id" } })], 1), t("ElFormItem", { attrs: { label: e.modelConfig.nameLabel } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.modelObjectForm.name, callback: function(i) {
|
|
77
|
+
e.$set(e.modelObjectForm, "name", i);
|
|
78
|
+
}, expression: "modelObjectForm.name" } })], 1)], 1)], 1)], 1);
|
|
79
|
+
}, b = [function() {
|
|
80
|
+
var s = this, e = s._self._c;
|
|
81
|
+
return e("span", [e("i", { staticClass: "el-icon-menu", staticStyle: { "margin-right": "8px", color: "#555" } }), s._v("消息列表")]);
|
|
82
|
+
}, function() {
|
|
83
|
+
var s = this, e = s._self._c;
|
|
84
|
+
return e("span", [e("i", { staticClass: "el-icon-menu", staticStyle: { "margin-right": "8px", color: "#555" } }), s._v("信号列表")]);
|
|
85
|
+
}], u = /* @__PURE__ */ d(
|
|
86
|
+
c,
|
|
87
|
+
p,
|
|
88
|
+
b,
|
|
89
|
+
!1,
|
|
90
|
+
null,
|
|
91
|
+
null
|
|
92
|
+
);
|
|
93
|
+
const g = u.exports;
|
|
94
|
+
export {
|
|
95
|
+
g as default
|
|
96
|
+
};
|