@web-utils/component 2.8.15 → 2.8.17

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.
@@ -1,4791 +0,0 @@
1
- var P = Object.defineProperty, V = Object.defineProperties;
2
- var z = Object.getOwnPropertyDescriptors;
3
- var b = Object.getOwnPropertySymbols;
4
- var R = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
5
- var h = (e, i, t) => i in e ? P(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, o = (e, i) => {
6
- for (var t in i || (i = {}))
7
- R.call(i, t) && h(e, t, i[t]);
8
- if (b)
9
- for (var t of b(i))
10
- A.call(i, t) && h(e, t, i[t]);
11
- return e;
12
- }, p = (e, i) => V(e, z(i));
13
- var d = (e, i, t) => new Promise((n, s) => {
14
- var l = (c) => {
15
- try {
16
- m(t.next(c));
17
- } catch (f) {
18
- s(f);
19
- }
20
- }, r = (c) => {
21
- try {
22
- m(t.throw(c));
23
- } catch (f) {
24
- s(f);
25
- }
26
- }, m = (c) => c.done ? n(c.value) : Promise.resolve(c.value).then(l, r);
27
- m((t = t.apply(e, i)).next());
28
- });
29
- import { n as a } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
30
- import { debug as F } from "@web-utils/core";
31
- var N = function() {
32
- var e = this, i = e.$createElement, t = e._self._c || i;
33
- return t("div", {
34
- staticClass: "panel-tab__content"
35
- }, [t("ElForm", {
36
- attrs: {
37
- size: "mini",
38
- "label-width": "90px"
39
- },
40
- nativeOn: {
41
- submit: function(n) {
42
- n.preventDefault();
43
- }
44
- }
45
- }, [t("ElFormItem", {
46
- attrs: {
47
- label: "ID"
48
- }
49
- }, [t("ElInput", {
50
- attrs: {
51
- disabled: e.idEditDisabled,
52
- clearable: ""
53
- },
54
- on: {
55
- change: function(n) {
56
- return e.updateBaseInfo("id");
57
- }
58
- },
59
- model: {
60
- value: e.elementBaseInfo.id,
61
- callback: function(n) {
62
- e.$set(e.elementBaseInfo, "id", n);
63
- },
64
- expression: "elementBaseInfo.id"
65
- }
66
- })], 1), t("ElFormItem", {
67
- attrs: {
68
- label: "名称"
69
- }
70
- }, [t("ElInput", {
71
- attrs: {
72
- clearable: ""
73
- },
74
- on: {
75
- change: function(n) {
76
- return e.updateBaseInfo("name");
77
- }
78
- },
79
- model: {
80
- value: e.elementBaseInfo.name,
81
- callback: function(n) {
82
- e.$set(e.elementBaseInfo, "name", n);
83
- },
84
- expression: "elementBaseInfo.name"
85
- }
86
- })], 1), e.elementBaseInfo.$type === "bpmn:Process" ? [t("ElFormItem", {
87
- attrs: {
88
- label: "版本标签"
89
- }
90
- }, [t("ElInput", {
91
- attrs: {
92
- clearable: ""
93
- },
94
- on: {
95
- change: function(n) {
96
- return e.updateBaseInfo("versionTag");
97
- }
98
- },
99
- model: {
100
- value: e.elementBaseInfo.versionTag,
101
- callback: function(n) {
102
- e.$set(e.elementBaseInfo, "versionTag", n);
103
- },
104
- expression: "elementBaseInfo.versionTag"
105
- }
106
- })], 1), t("ElFormItem", {
107
- attrs: {
108
- label: "可执行"
109
- }
110
- }, [t("ElSwitch", {
111
- attrs: {
112
- "active-text": "是",
113
- "inactive-text": "否"
114
- },
115
- on: {
116
- change: function(n) {
117
- return e.updateBaseInfo("isExecutable");
118
- }
119
- },
120
- model: {
121
- value: e.elementBaseInfo.isExecutable,
122
- callback: function(n) {
123
- e.$set(e.elementBaseInfo, "isExecutable", n);
124
- },
125
- expression: "elementBaseInfo.isExecutable"
126
- }
127
- })], 1)] : e._e(), e.elementBaseInfo.$type === "bpmn:SubProcess" ? t("ElFormItem", {
128
- attrs: {
129
- label: "状态"
130
- }
131
- }, [t("ElSwitch", {
132
- attrs: {
133
- "active-text": "展开",
134
- "inactive-text": "折叠"
135
- },
136
- on: {
137
- change: function(n) {
138
- return e.updateBaseInfo("isExpanded");
139
- }
140
- },
141
- model: {
142
- value: e.elementBaseInfo.isExpanded,
143
- callback: function(n) {
144
- e.$set(e.elementBaseInfo, "isExpanded", n);
145
- },
146
- expression: "elementBaseInfo.isExpanded"
147
- }
148
- })], 1) : e._e()], 2)], 1);
149
- }, q = [];
150
- const J = {
151
- name: "ElementBaseInfo",
152
- props: {
153
- businessObject: Object,
154
- idEditDisabled: {
155
- type: Boolean,
156
- default: !0
157
- }
158
- },
159
- data() {
160
- return {
161
- elementBaseInfo: {}
162
- };
163
- },
164
- watch: {
165
- businessObject: {
166
- immediate: !1,
167
- handler: function(e) {
168
- e && this.$nextTick(() => this.resetBaseInfo());
169
- }
170
- }
171
- },
172
- beforeDestroy() {
173
- this.bpmnElement = null;
174
- },
175
- methods: {
176
- resetBaseInfo() {
177
- var e, i;
178
- this.bpmnElement = ((e = window == null ? void 0 : window.bpmnInstances) == null ? void 0 : e.bpmnElement) || {}, this.elementBaseInfo = JSON.parse(JSON.stringify(this.bpmnElement.businessObject)), this.elementBaseInfo && this.elementBaseInfo.$type === "bpmn:SubProcess" && this.$set(this.elementBaseInfo, "isExpanded", (i = this.elementBaseInfo.di) == null ? void 0 : i.isExpanded);
179
- },
180
- updateBaseInfo(e) {
181
- var t;
182
- if (e === "id") {
183
- window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
184
- id: this.elementBaseInfo[e],
185
- di: { id: `${this.elementBaseInfo[e]}_di` }
186
- });
187
- return;
188
- }
189
- if (e === "isExpanded") {
190
- (t = window == null ? void 0 : window.bpmnInstances) == null || t.modeling.toggleCollapse(this.bpmnElement);
191
- return;
192
- }
193
- const i = /* @__PURE__ */ Object.create(null);
194
- i[e] = this.elementBaseInfo[e], window.bpmnInstances.modeling.updateProperties(this.bpmnElement, i);
195
- }
196
- }
197
- }, v = {};
198
- var U = /* @__PURE__ */ a(
199
- J,
200
- N,
201
- q,
202
- !1,
203
- K,
204
- null,
205
- null,
206
- null
207
- );
208
- function K(e) {
209
- for (let i in v)
210
- this[i] = v[i];
211
- }
212
- const G = /* @__PURE__ */ function() {
213
- return U.exports;
214
- }();
215
- var H = function() {
216
- var e = this, i = e.$createElement, t = e._self._c || i;
217
- return t("div", {
218
- staticClass: "panel-tab__content"
219
- }, [t("div", {
220
- staticClass: "element-property input-property"
221
- }, [t("div", {
222
- staticClass: "element-property__label"
223
- }, [e._v("元素文档:")]), t("div", {
224
- staticClass: "element-property__value"
225
- }, [t("ElInput", {
226
- attrs: {
227
- type: "textarea",
228
- size: "mini",
229
- resize: "vertical",
230
- autosize: {
231
- minRows: 2,
232
- maxRows: 4
233
- }
234
- },
235
- on: {
236
- input: e.updateDocumentation,
237
- blur: e.updateDocumentation
238
- },
239
- model: {
240
- value: e.documentation,
241
- callback: function(n) {
242
- e.documentation = n;
243
- },
244
- expression: "documentation"
245
- }
246
- })], 1)])]);
247
- }, Q = [];
248
- const W = {
249
- name: "ElementOtherConfig",
250
- props: {
251
- id: String
252
- },
253
- data() {
254
- return {
255
- documentation: ""
256
- };
257
- },
258
- watch: {
259
- id: {
260
- immediate: !0,
261
- handler: function(e) {
262
- e && e.length ? this.$nextTick(() => {
263
- var t;
264
- const i = (t = window.bpmnInstances.bpmnElement.businessObject) == null ? void 0 : t.documentation;
265
- this.documentation = i && i.length ? i[0].text : "";
266
- }) : this.documentation = "";
267
- }
268
- }
269
- },
270
- beforeDestroy() {
271
- this.bpmnElement = null;
272
- },
273
- methods: {
274
- updateDocumentation() {
275
- this.bpmnElement && this.bpmnElement.id === this.id || (this.bpmnElement = window.bpmnInstances.elementRegistry.get(this.id));
276
- const e = window.bpmnInstances.bpmnFactory.create("bpmn:Documentation", { text: this.documentation });
277
- window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
278
- documentation: [e]
279
- });
280
- }
281
- }
282
- }, E = {};
283
- var X = /* @__PURE__ */ a(
284
- W,
285
- H,
286
- Q,
287
- !1,
288
- Y,
289
- null,
290
- null,
291
- null
292
- );
293
- function Y(e) {
294
- for (let i in E)
295
- this[i] = E[i];
296
- }
297
- const Z = /* @__PURE__ */ function() {
298
- return X.exports;
299
- }();
300
- var ee = function() {
301
- var e = this, i = e.$createElement, t = e._self._c || i;
302
- return t("div", {
303
- staticStyle: {
304
- "margin-top": "16px"
305
- }
306
- }, [t("ElFormItem", {
307
- attrs: {
308
- label: "处理用户"
309
- }
310
- }, [t("ElSelect", {
311
- on: {
312
- change: function(n) {
313
- return e.updateElementTask("assignee");
314
- }
315
- },
316
- model: {
317
- value: e.userTaskForm.assignee,
318
- callback: function(n) {
319
- e.$set(e.userTaskForm, "assignee", n);
320
- },
321
- expression: "userTaskForm.assignee"
322
- }
323
- }, e._l(e.mockData, function(n) {
324
- return t("ElOption", {
325
- key: `ass-${n}`,
326
- attrs: {
327
- label: `用户${n}`,
328
- value: `user${n}`
329
- }
330
- });
331
- }), 1)], 1), t("ElFormItem", {
332
- attrs: {
333
- label: "候选用户"
334
- }
335
- }, [t("ElSelect", {
336
- attrs: {
337
- multiple: "",
338
- "collapse-tags": ""
339
- },
340
- on: {
341
- change: function(n) {
342
- return e.updateElementTask("candidateUsers");
343
- }
344
- },
345
- model: {
346
- value: e.userTaskForm.candidateUsers,
347
- callback: function(n) {
348
- e.$set(e.userTaskForm, "candidateUsers", n);
349
- },
350
- expression: "userTaskForm.candidateUsers"
351
- }
352
- }, e._l(e.mockData, function(n) {
353
- return t("ElOption", {
354
- key: `user-${n}`,
355
- attrs: {
356
- label: `用户${n}`,
357
- value: `user${n}`
358
- }
359
- });
360
- }), 1)], 1), t("ElFormItem", {
361
- attrs: {
362
- label: "候选分组"
363
- }
364
- }, [t("ElSelect", {
365
- attrs: {
366
- multiple: "",
367
- "collapse-tags": ""
368
- },
369
- on: {
370
- change: function(n) {
371
- return e.updateElementTask("candidateGroups");
372
- }
373
- },
374
- model: {
375
- value: e.userTaskForm.candidateGroups,
376
- callback: function(n) {
377
- e.$set(e.userTaskForm, "candidateGroups", n);
378
- },
379
- expression: "userTaskForm.candidateGroups"
380
- }
381
- }, e._l(e.mockData, function(n) {
382
- return t("ElOption", {
383
- key: `ass-${n}`,
384
- attrs: {
385
- label: `分组${n}`,
386
- value: `group${n}`
387
- }
388
- });
389
- }), 1)], 1), t("ElFormItem", {
390
- attrs: {
391
- label: "到期时间"
392
- }
393
- }, [t("ElInput", {
394
- attrs: {
395
- clearable: ""
396
- },
397
- on: {
398
- change: function(n) {
399
- return e.updateElementTask("dueDate");
400
- }
401
- },
402
- model: {
403
- value: e.userTaskForm.dueDate,
404
- callback: function(n) {
405
- e.$set(e.userTaskForm, "dueDate", n);
406
- },
407
- expression: "userTaskForm.dueDate"
408
- }
409
- })], 1), t("ElFormItem", {
410
- attrs: {
411
- label: "跟踪时间"
412
- }
413
- }, [t("ElInput", {
414
- attrs: {
415
- clearable: ""
416
- },
417
- on: {
418
- change: function(n) {
419
- return e.updateElementTask("followUpDate");
420
- }
421
- },
422
- model: {
423
- value: e.userTaskForm.followUpDate,
424
- callback: function(n) {
425
- e.$set(e.userTaskForm, "followUpDate", n);
426
- },
427
- expression: "userTaskForm.followUpDate"
428
- }
429
- })], 1), t("ElFormItem", {
430
- attrs: {
431
- label: "优先级"
432
- }
433
- }, [t("ElInput", {
434
- attrs: {
435
- clearable: ""
436
- },
437
- on: {
438
- change: function(n) {
439
- return e.updateElementTask("priority");
440
- }
441
- },
442
- model: {
443
- value: e.userTaskForm.priority,
444
- callback: function(n) {
445
- e.$set(e.userTaskForm, "priority", n);
446
- },
447
- expression: "userTaskForm.priority"
448
- }
449
- })], 1)], 1);
450
- }, te = [];
451
- const ne = {
452
- name: "UserTask",
453
- props: {
454
- id: String
455
- },
456
- data() {
457
- return {
458
- defaultTaskForm: {
459
- assignee: "",
460
- candidateUsers: [],
461
- candidateGroups: [],
462
- dueDate: "",
463
- followUpDate: "",
464
- priority: ""
465
- },
466
- userTaskForm: {},
467
- mockData: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
468
- };
469
- },
470
- watch: {
471
- id: {
472
- immediate: !0,
473
- handler() {
474
- this.bpmnElement = window.bpmnInstances.bpmnElement, this.$nextTick(() => this.resetTaskForm());
475
- }
476
- }
477
- },
478
- beforeDestroy() {
479
- this.bpmnElement = null;
480
- },
481
- methods: {
482
- resetTaskForm() {
483
- var e, i;
484
- for (const t in this.defaultTaskForm) {
485
- let n;
486
- t === "candidateUsers" || t === "candidateGroups" ? n = (e = this.bpmnElement) != null && e.businessObject[t] ? this.bpmnElement.businessObject[t].split(",") : [] : n = ((i = this.bpmnElement) == null ? void 0 : i.businessObject[t]) || this.defaultTaskForm[t], this.$set(this.userTaskForm, t, n);
487
- }
488
- },
489
- updateElementTask(e) {
490
- const i = /* @__PURE__ */ Object.create(null);
491
- e === "candidateUsers" || e === "candidateGroups" ? i[e] = this.userTaskForm[e] && this.userTaskForm[e].length ? this.userTaskForm[e].join() : null : i[e] = this.userTaskForm[e] || null, window.bpmnInstances.modeling.updateProperties(this.bpmnElement, i);
492
- }
493
- }
494
- }, y = {};
495
- var ie = /* @__PURE__ */ a(
496
- ne,
497
- ee,
498
- te,
499
- !1,
500
- se,
501
- null,
502
- null,
503
- null
504
- );
505
- function se(e) {
506
- for (let i in y)
507
- this[i] = y[i];
508
- }
509
- const le = /* @__PURE__ */ function() {
510
- return ie.exports;
511
- }();
512
- var re = function() {
513
- var e = this, i = e.$createElement, t = e._self._c || i;
514
- return t("div", {
515
- staticStyle: {
516
- "margin-top": "16px"
517
- }
518
- }, [t("ElFormItem", {
519
- attrs: {
520
- label: "脚本格式"
521
- }
522
- }, [t("ElInput", {
523
- attrs: {
524
- clearable: ""
525
- },
526
- on: {
527
- input: function(n) {
528
- return e.updateElementTask();
529
- },
530
- change: function(n) {
531
- return e.updateElementTask();
532
- }
533
- },
534
- model: {
535
- value: e.scriptTaskForm.scriptFormat,
536
- callback: function(n) {
537
- e.$set(e.scriptTaskForm, "scriptFormat", n);
538
- },
539
- expression: "scriptTaskForm.scriptFormat"
540
- }
541
- })], 1), t("ElFormItem", {
542
- attrs: {
543
- label: "脚本类型"
544
- }
545
- }, [t("ElSelect", {
546
- model: {
547
- value: e.scriptTaskForm.scriptType,
548
- callback: function(n) {
549
- e.$set(e.scriptTaskForm, "scriptType", n);
550
- },
551
- expression: "scriptTaskForm.scriptType"
552
- }
553
- }, [t("ElOption", {
554
- attrs: {
555
- label: "内联脚本",
556
- value: "inline"
557
- }
558
- }), t("ElOption", {
559
- attrs: {
560
- label: "外部资源",
561
- value: "external"
562
- }
563
- })], 1)], 1), t("ElFormItem", {
564
- directives: [{
565
- name: "show",
566
- rawName: "v-show",
567
- value: e.scriptTaskForm.scriptType === "inline",
568
- expression: "scriptTaskForm.scriptType === 'inline'"
569
- }],
570
- attrs: {
571
- label: "脚本"
572
- }
573
- }, [t("ElInput", {
574
- attrs: {
575
- type: "textarea",
576
- resize: "vertical",
577
- autosize: {
578
- minRows: 2,
579
- maxRows: 4
580
- },
581
- clearable: ""
582
- },
583
- on: {
584
- input: function(n) {
585
- return e.updateElementTask();
586
- },
587
- change: function(n) {
588
- return e.updateElementTask();
589
- }
590
- },
591
- model: {
592
- value: e.scriptTaskForm.script,
593
- callback: function(n) {
594
- e.$set(e.scriptTaskForm, "script", n);
595
- },
596
- expression: "scriptTaskForm.script"
597
- }
598
- })], 1), t("ElFormItem", {
599
- directives: [{
600
- name: "show",
601
- rawName: "v-show",
602
- value: e.scriptTaskForm.scriptType === "external",
603
- expression: "scriptTaskForm.scriptType === 'external'"
604
- }],
605
- attrs: {
606
- label: "资源地址"
607
- }
608
- }, [t("ElInput", {
609
- attrs: {
610
- clearable: ""
611
- },
612
- on: {
613
- input: function(n) {
614
- return e.updateElementTask();
615
- },
616
- change: function(n) {
617
- return e.updateElementTask();
618
- }
619
- },
620
- model: {
621
- value: e.scriptTaskForm.resource,
622
- callback: function(n) {
623
- e.$set(e.scriptTaskForm, "resource", n);
624
- },
625
- expression: "scriptTaskForm.resource"
626
- }
627
- })], 1), t("ElFormItem", {
628
- attrs: {
629
- label: "结果变量"
630
- }
631
- }, [t("ElInput", {
632
- attrs: {
633
- clearable: ""
634
- },
635
- on: {
636
- input: function(n) {
637
- return e.updateElementTask();
638
- },
639
- change: function(n) {
640
- return e.updateElementTask();
641
- }
642
- },
643
- model: {
644
- value: e.scriptTaskForm.resultVariable,
645
- callback: function(n) {
646
- e.$set(e.scriptTaskForm, "resultVariable", n);
647
- },
648
- expression: "scriptTaskForm.resultVariable"
649
- }
650
- })], 1)], 1);
651
- }, oe = [];
652
- const ae = {
653
- name: "ScriptTask",
654
- props: {
655
- id: String
656
- },
657
- data() {
658
- return {
659
- defaultTaskForm: {
660
- scriptFormat: "",
661
- script: "",
662
- resource: "",
663
- resultVariable: ""
664
- },
665
- scriptTaskForm: {}
666
- };
667
- },
668
- watch: {
669
- id: {
670
- immediate: !0,
671
- handler() {
672
- this.bpmnElement = window.bpmnInstances.bpmnElement, this.$nextTick(() => this.resetTaskForm());
673
- }
674
- }
675
- },
676
- beforeDestroy() {
677
- this.bpmnElement = null;
678
- },
679
- methods: {
680
- resetTaskForm() {
681
- var e;
682
- for (const i in this.defaultTaskForm) {
683
- const t = ((e = this.bpmnElement) == null ? void 0 : e.businessObject[i]) || this.defaultTaskForm[i];
684
- this.$set(this.scriptTaskForm, i, t);
685
- }
686
- this.$set(this.scriptTaskForm, "scriptType", this.scriptTaskForm.script ? "inline" : "external");
687
- },
688
- updateElementTask() {
689
- const e = /* @__PURE__ */ Object.create(null);
690
- e.scriptFormat = this.scriptTaskForm.scriptFormat || null, e.resultVariable = this.scriptTaskForm.resultVariable || null, this.scriptTaskForm.scriptType === "inline" ? (e.script = this.scriptTaskForm.script || null, e.resource = null) : (e.resource = this.scriptTaskForm.resource || null, e.script = null), window.bpmnInstances.modeling.updateProperties(this.bpmnElement, e);
691
- }
692
- }
693
- }, x = {};
694
- var me = /* @__PURE__ */ a(
695
- ae,
696
- re,
697
- oe,
698
- !1,
699
- ce,
700
- null,
701
- null,
702
- null
703
- );
704
- function ce(e) {
705
- for (let i in x)
706
- this[i] = x[i];
707
- }
708
- const pe = /* @__PURE__ */ function() {
709
- return me.exports;
710
- }();
711
- var de = function() {
712
- var e = this, i = e.$createElement, t = e._self._c || i;
713
- return t("div", {
714
- staticStyle: {
715
- "margin-top": "16px"
716
- }
717
- }, [t("ElFormItem", {
718
- attrs: {
719
- label: "消息实例"
720
- }
721
- }, [t("div", {
722
- staticStyle: {
723
- display: "flex",
724
- "flex-wrap": "nowrap",
725
- "align-items": "center",
726
- "justify-content": "space-between"
727
- }
728
- }, [t("ElSelect", {
729
- on: {
730
- change: e.updateTaskMessage
731
- },
732
- model: {
733
- value: e.bindMessageId,
734
- callback: function(n) {
735
- e.bindMessageId = n;
736
- },
737
- expression: "bindMessageId"
738
- }
739
- }, e._l(Object.keys(e.messageMap), function(n) {
740
- return t("ElOption", {
741
- key: n,
742
- attrs: {
743
- value: n,
744
- label: e.messageMap[n]
745
- }
746
- });
747
- }), 1), t("ElButton", {
748
- staticStyle: {
749
- "margin-left": "8px"
750
- },
751
- attrs: {
752
- size: "mini",
753
- type: "primary",
754
- icon: "el-icon-plus"
755
- },
756
- on: {
757
- click: e.openMessageModel
758
- }
759
- })], 1)]), t("ElementDialog", {
760
- attrs: {
761
- visible: e.messageModelVisible,
762
- "close-on-click-modal": !1,
763
- title: "创建新消息",
764
- width: "400px",
765
- "append-to-body": "",
766
- "destroy-on-close": ""
767
- },
768
- on: {
769
- "update:visible": function(n) {
770
- e.messageModelVisible = n;
771
- }
772
- },
773
- scopedSlots: e._u([{
774
- key: "footer",
775
- fn: function() {
776
- return [t("ElButton", {
777
- attrs: {
778
- size: "mini",
779
- type: "primary"
780
- },
781
- on: {
782
- click: e.createNewMessage
783
- }
784
- }, [e._v("确 认")])];
785
- },
786
- proxy: !0
787
- }])
788
- }, [t("ElForm", {
789
- attrs: {
790
- model: e.newMessageForm,
791
- size: "mini",
792
- "label-width": "90px"
793
- },
794
- nativeOn: {
795
- submit: function(n) {
796
- n.preventDefault();
797
- }
798
- }
799
- }, [t("ElFormItem", {
800
- attrs: {
801
- label: "消息ID"
802
- }
803
- }, [t("ElInput", {
804
- attrs: {
805
- clearable: ""
806
- },
807
- model: {
808
- value: e.newMessageForm.id,
809
- callback: function(n) {
810
- e.$set(e.newMessageForm, "id", n);
811
- },
812
- expression: "newMessageForm.id"
813
- }
814
- })], 1), t("ElFormItem", {
815
- attrs: {
816
- label: "消息名称"
817
- }
818
- }, [t("ElInput", {
819
- attrs: {
820
- clearable: ""
821
- },
822
- model: {
823
- value: e.newMessageForm.name,
824
- callback: function(n) {
825
- e.$set(e.newMessageForm, "name", n);
826
- },
827
- expression: "newMessageForm.name"
828
- }
829
- })], 1)], 1)], 1)], 1);
830
- }, ue = [];
831
- const fe = {
832
- name: "ReceiveTask",
833
- props: {
834
- id: String
835
- },
836
- data() {
837
- return {
838
- bindMessageId: "",
839
- newMessageForm: {},
840
- messageMap: {},
841
- messageModelVisible: !1
842
- };
843
- },
844
- watch: {
845
- id: {
846
- immediate: !0,
847
- handler() {
848
- this.$nextTick(() => this.getBindMessage());
849
- }
850
- }
851
- },
852
- created() {
853
- this.bpmnMessageRefsMap = /* @__PURE__ */ Object.create(null), this.bpmnRootElements = window.bpmnInstances.modeler.getDefinitions().rootElements, this.bpmnRootElements.filter((e) => e.$type === "bpmn:Message").forEach((e) => {
854
- this.bpmnMessageRefsMap[e.id] = e, this.$set(this.messageMap, e.id, e.name);
855
- }), this.$set(this.messageMap, "-1", "无");
856
- },
857
- beforeDestroy() {
858
- this.bpmnElement = null;
859
- },
860
- methods: {
861
- getBindMessage() {
862
- var e, i;
863
- this.bpmnElement = window.bpmnInstances.bpmnElement, this.bindMessageId = ((i = (e = this.bpmnElement.businessObject) == null ? void 0 : e.messageRef) == null ? void 0 : i.id) || "-1";
864
- },
865
- openMessageModel() {
866
- this.messageModelVisible = !0, this.newMessageForm = {};
867
- },
868
- createNewMessage() {
869
- if (this.messageMap[this.newMessageForm.id]) {
870
- this.$message.error("该消息已存在,请修改id后重新保存");
871
- return;
872
- }
873
- const e = window.bpmnInstances.moddle.create("bpmn:Message", this.newMessageForm);
874
- this.bpmnRootElements.push(e), this.$set(this.messageMap, this.newMessageForm.id, this.newMessageForm.name), this.bpmnMessageRefsMap[this.newMessageForm.id] = e, this.messageModelVisible = !1;
875
- },
876
- updateTaskMessage(e) {
877
- e === "-1" ? window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
878
- messageRef: null
879
- }) : window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
880
- messageRef: this.bpmnMessageRefsMap[e]
881
- });
882
- }
883
- }
884
- }, g = {};
885
- var be = /* @__PURE__ */ a(
886
- fe,
887
- de,
888
- ue,
889
- !1,
890
- he,
891
- null,
892
- null,
893
- null
894
- );
895
- function he(e) {
896
- for (let i in g)
897
- this[i] = g[i];
898
- }
899
- const Fe = /* @__PURE__ */ function() {
900
- return be.exports;
901
- }();
902
- var ve = function() {
903
- var e = this, i = e.$createElement, t = e._self._c || i;
904
- return t("div", {
905
- staticClass: "panel-tab__content"
906
- }, [t("ElForm", {
907
- attrs: {
908
- size: "mini",
909
- "label-width": "90px"
910
- },
911
- nativeOn: {
912
- submit: function(n) {
913
- n.preventDefault();
914
- }
915
- }
916
- }, [t("ElFormItem", {
917
- attrs: {
918
- label: "异步延续"
919
- }
920
- }, [t("ElCheckbox", {
921
- attrs: {
922
- label: "异步前"
923
- },
924
- on: {
925
- change: e.changeTaskAsync
926
- },
927
- model: {
928
- value: e.taskConfigForm.asyncBefore,
929
- callback: function(n) {
930
- e.$set(e.taskConfigForm, "asyncBefore", n);
931
- },
932
- expression: "taskConfigForm.asyncBefore"
933
- }
934
- }), t("ElCheckbox", {
935
- attrs: {
936
- label: "异步后"
937
- },
938
- on: {
939
- change: e.changeTaskAsync
940
- },
941
- model: {
942
- value: e.taskConfigForm.asyncAfter,
943
- callback: function(n) {
944
- e.$set(e.taskConfigForm, "asyncAfter", n);
945
- },
946
- expression: "taskConfigForm.asyncAfter"
947
- }
948
- }), e.taskConfigForm.asyncAfter || e.taskConfigForm.asyncBefore ? t("ElCheckbox", {
949
- attrs: {
950
- label: "排除"
951
- },
952
- on: {
953
- change: e.changeTaskAsync
954
- },
955
- model: {
956
- value: e.taskConfigForm.exclusive,
957
- callback: function(n) {
958
- e.$set(e.taskConfigForm, "exclusive", n);
959
- },
960
- expression: "taskConfigForm.exclusive"
961
- }
962
- }) : e._e()], 1), t(e.witchTaskComponent, e._b({
963
- tag: "Component"
964
- }, "Component", e.$props, !1))], 1)], 1);
965
- }, Ee = [];
966
- const ye = {
967
- name: "ElementTaskConfig",
968
- components: { UserTask: le, ScriptTask: pe, ReceiveTask: Fe },
969
- props: {
970
- id: String,
971
- type: String
972
- },
973
- data() {
974
- return {
975
- taskConfigForm: {
976
- asyncAfter: !1,
977
- asyncBefore: !1,
978
- exclusive: !1
979
- },
980
- witchTaskComponent: "",
981
- installedComponent: {
982
- // 手工任务与普通任务一致,不需要其他配置
983
- // 接收消息任务,需要在全局下插入新的消息实例,并在该节点下的 messageRef 属性绑定该实例
984
- // 发送任务、服务任务、业务规则任务共用一个相同配置
985
- UserTask: "UserTask",
986
- // 用户任务配置
987
- ScriptTask: "ScriptTask",
988
- // 脚本任务配置
989
- ReceiveTask: "ReceiveTask"
990
- // 消息接收任务
991
- }
992
- };
993
- },
994
- watch: {
995
- id: {
996
- immediate: !0,
997
- handler() {
998
- var e, i, t, n, s, l;
999
- this.bpmnElement = window.bpmnInstances.bpmnElement, this.taskConfigForm.asyncBefore = (i = (e = this.bpmnElement) == null ? void 0 : e.businessObject) == null ? void 0 : i.asyncBefore, this.taskConfigForm.asyncAfter = (n = (t = this.bpmnElement) == null ? void 0 : t.businessObject) == null ? void 0 : n.asyncAfter, this.taskConfigForm.exclusive = (l = (s = this.bpmnElement) == null ? void 0 : s.businessObject) == null ? void 0 : l.exclusive;
1000
- }
1001
- },
1002
- type: {
1003
- immediate: !0,
1004
- handler() {
1005
- this.witchTaskComponent = this.installedComponent[this.type];
1006
- }
1007
- }
1008
- },
1009
- methods: {
1010
- changeTaskAsync() {
1011
- !this.taskConfigForm.asyncBefore && !this.taskConfigForm.asyncAfter && (this.taskConfigForm.exclusive = !1), window.bpmnInstances.modeling.updateProperties(window.bpmnInstances.bpmnElement, o({}, this.taskConfigForm));
1012
- }
1013
- }
1014
- }, _ = {};
1015
- var xe = /* @__PURE__ */ a(
1016
- ye,
1017
- ve,
1018
- Ee,
1019
- !1,
1020
- ge,
1021
- null,
1022
- null,
1023
- null
1024
- );
1025
- function ge(e) {
1026
- for (let i in _)
1027
- this[i] = _[i];
1028
- }
1029
- const _e = /* @__PURE__ */ function() {
1030
- return xe.exports;
1031
- }();
1032
- var we = function() {
1033
- var e = this, i = e.$createElement, t = e._self._c || i;
1034
- return t("div", {
1035
- staticClass: "panel-tab__content"
1036
- }, [t("ElForm", {
1037
- attrs: {
1038
- size: "mini",
1039
- "label-width": "90px"
1040
- },
1041
- nativeOn: {
1042
- submit: function(n) {
1043
- n.preventDefault();
1044
- }
1045
- }
1046
- }, [t("ElFormItem", {
1047
- attrs: {
1048
- label: "回路特性"
1049
- }
1050
- }, [t("ElSelect", {
1051
- on: {
1052
- change: e.changeLoopCharacteristicsType
1053
- },
1054
- model: {
1055
- value: e.loopCharacteristics,
1056
- callback: function(n) {
1057
- e.loopCharacteristics = n;
1058
- },
1059
- expression: "loopCharacteristics"
1060
- }
1061
- }, [t("ElOption", {
1062
- attrs: {
1063
- label: "并行多重事件",
1064
- value: "ParallelMultiInstance"
1065
- }
1066
- }), t("ElOption", {
1067
- attrs: {
1068
- label: "时序多重事件",
1069
- value: "SequentialMultiInstance"
1070
- }
1071
- }), t("ElOption", {
1072
- attrs: {
1073
- label: "循环事件",
1074
- value: "StandardLoop"
1075
- }
1076
- }), t("ElOption", {
1077
- attrs: {
1078
- label: "无",
1079
- value: "Null"
1080
- }
1081
- })], 1)], 1), e.loopCharacteristics === "ParallelMultiInstance" || e.loopCharacteristics === "SequentialMultiInstance" ? [t("ElFormItem", {
1082
- key: "loopCardinality",
1083
- attrs: {
1084
- label: "循环基数"
1085
- }
1086
- }, [t("ElInput", {
1087
- attrs: {
1088
- clearable: ""
1089
- },
1090
- on: {
1091
- change: e.updateLoopCardinality
1092
- },
1093
- model: {
1094
- value: e.loopInstanceForm.loopCardinality,
1095
- callback: function(n) {
1096
- e.$set(e.loopInstanceForm, "loopCardinality", n);
1097
- },
1098
- expression: "loopInstanceForm.loopCardinality"
1099
- }
1100
- })], 1), t("ElFormItem", {
1101
- key: "collection",
1102
- attrs: {
1103
- label: "集合"
1104
- }
1105
- }, [t("ElInput", {
1106
- attrs: {
1107
- clearable: ""
1108
- },
1109
- on: {
1110
- change: e.updateLoopBase
1111
- },
1112
- model: {
1113
- value: e.loopInstanceForm.collection,
1114
- callback: function(n) {
1115
- e.$set(e.loopInstanceForm, "collection", n);
1116
- },
1117
- expression: "loopInstanceForm.collection"
1118
- }
1119
- })], 1), t("ElFormItem", {
1120
- key: "elementVariable",
1121
- attrs: {
1122
- label: "元素变量"
1123
- }
1124
- }, [t("ElInput", {
1125
- attrs: {
1126
- clearable: ""
1127
- },
1128
- on: {
1129
- change: e.updateLoopBase
1130
- },
1131
- model: {
1132
- value: e.loopInstanceForm.elementVariable,
1133
- callback: function(n) {
1134
- e.$set(e.loopInstanceForm, "elementVariable", n);
1135
- },
1136
- expression: "loopInstanceForm.elementVariable"
1137
- }
1138
- })], 1), t("ElFormItem", {
1139
- key: "completionCondition",
1140
- attrs: {
1141
- label: "完成条件"
1142
- }
1143
- }, [t("ElInput", {
1144
- attrs: {
1145
- clearable: ""
1146
- },
1147
- on: {
1148
- change: e.updateLoopCondition
1149
- },
1150
- model: {
1151
- value: e.loopInstanceForm.completionCondition,
1152
- callback: function(n) {
1153
- e.$set(e.loopInstanceForm, "completionCondition", n);
1154
- },
1155
- expression: "loopInstanceForm.completionCondition"
1156
- }
1157
- })], 1), t("ElFormItem", {
1158
- key: "async",
1159
- attrs: {
1160
- label: "异步状态"
1161
- }
1162
- }, [t("ElCheckbox", {
1163
- attrs: {
1164
- label: "异步前"
1165
- },
1166
- on: {
1167
- change: function(n) {
1168
- return e.updateLoopAsync("asyncBefore");
1169
- }
1170
- },
1171
- model: {
1172
- value: e.loopInstanceForm.asyncBefore,
1173
- callback: function(n) {
1174
- e.$set(e.loopInstanceForm, "asyncBefore", n);
1175
- },
1176
- expression: "loopInstanceForm.asyncBefore"
1177
- }
1178
- }), t("ElCheckbox", {
1179
- attrs: {
1180
- label: "异步后"
1181
- },
1182
- on: {
1183
- change: function(n) {
1184
- return e.updateLoopAsync("asyncAfter");
1185
- }
1186
- },
1187
- model: {
1188
- value: e.loopInstanceForm.asyncAfter,
1189
- callback: function(n) {
1190
- e.$set(e.loopInstanceForm, "asyncAfter", n);
1191
- },
1192
- expression: "loopInstanceForm.asyncAfter"
1193
- }
1194
- }), e.loopInstanceForm.asyncAfter || e.loopInstanceForm.asyncBefore ? t("ElCheckbox", {
1195
- attrs: {
1196
- label: "排除"
1197
- },
1198
- on: {
1199
- change: function(n) {
1200
- return e.updateLoopAsync("exclusive");
1201
- }
1202
- },
1203
- model: {
1204
- value: e.loopInstanceForm.exclusive,
1205
- callback: function(n) {
1206
- e.$set(e.loopInstanceForm, "exclusive", n);
1207
- },
1208
- expression: "loopInstanceForm.exclusive"
1209
- }
1210
- }) : e._e()], 1), e.loopInstanceForm.asyncAfter || e.loopInstanceForm.asyncBefore ? t("ElFormItem", {
1211
- key: "timeCycle",
1212
- attrs: {
1213
- label: "重试周期",
1214
- prop: "timeCycle"
1215
- }
1216
- }, [t("ElInput", {
1217
- attrs: {
1218
- clearable: ""
1219
- },
1220
- on: {
1221
- change: e.updateLoopTimeCycle
1222
- },
1223
- model: {
1224
- value: e.loopInstanceForm.timeCycle,
1225
- callback: function(n) {
1226
- e.$set(e.loopInstanceForm, "timeCycle", n);
1227
- },
1228
- expression: "loopInstanceForm.timeCycle"
1229
- }
1230
- })], 1) : e._e()] : e._e()], 2)], 1);
1231
- }, Ie = [];
1232
- const Te = {
1233
- name: "ElementMultiInstance",
1234
- inject: {
1235
- prefix: "prefix"
1236
- },
1237
- props: {
1238
- businessObject: Object
1239
- },
1240
- data() {
1241
- return {
1242
- loopCharacteristics: "",
1243
- // 默认配置,用来覆盖原始不存在的选项,避免报错
1244
- defaultLoopInstanceForm: {
1245
- completionCondition: "",
1246
- loopCardinality: "",
1247
- extensionElements: [],
1248
- asyncAfter: !1,
1249
- asyncBefore: !1,
1250
- exclusive: !1
1251
- },
1252
- loopInstanceForm: {}
1253
- };
1254
- },
1255
- watch: {
1256
- businessObject: {
1257
- immediate: !0,
1258
- handler(e) {
1259
- this.bpmnElement = window.bpmnInstances.bpmnElement, this.getElementLoop(e);
1260
- }
1261
- }
1262
- },
1263
- beforeDestroy() {
1264
- this.multiLoopInstance = null, this.bpmnElement = null;
1265
- },
1266
- methods: {
1267
- getElementLoop(e) {
1268
- var i, t, n, s, l, r;
1269
- if (!e.loopCharacteristics) {
1270
- this.loopCharacteristics = "Null", this.loopInstanceForm = {};
1271
- return;
1272
- }
1273
- if (e.loopCharacteristics.$type === "bpmn:StandardLoopCharacteristics") {
1274
- this.loopCharacteristics = "StandardLoop", this.loopInstanceForm = {};
1275
- return;
1276
- }
1277
- e.loopCharacteristics.isSequential ? this.loopCharacteristics = "SequentialMultiInstance" : this.loopCharacteristics = "ParallelMultiInstance", this.loopInstanceForm = p(o(o({}, this.defaultLoopInstanceForm), e.loopCharacteristics), {
1278
- completionCondition: (n = (t = (i = e.loopCharacteristics) == null ? void 0 : i.completionCondition) == null ? void 0 : t.body) != null ? n : "",
1279
- loopCardinality: (r = (l = (s = e.loopCharacteristics) == null ? void 0 : s.loopCardinality) == null ? void 0 : l.body) != null ? r : ""
1280
- }), this.multiLoopInstance = window.bpmnInstances.bpmnElement.businessObject.loopCharacteristics, e.loopCharacteristics.extensionElements && e.loopCharacteristics.extensionElements.values && e.loopCharacteristics.extensionElements.values.length && this.$set(this.loopInstanceForm, "timeCycle", e.loopCharacteristics.extensionElements.values[0].body);
1281
- },
1282
- changeLoopCharacteristicsType(e) {
1283
- if (e === "Null") {
1284
- window.bpmnInstances.modeling.updateProperties(this.bpmnElement, { loopCharacteristics: null });
1285
- return;
1286
- }
1287
- if (e === "StandardLoop") {
1288
- const i = window.bpmnInstances.moddle.create("bpmn:StandardLoopCharacteristics");
1289
- window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
1290
- loopCharacteristics: i
1291
- }), this.multiLoopInstance = null;
1292
- return;
1293
- }
1294
- e === "SequentialMultiInstance" ? this.multiLoopInstance = window.bpmnInstances.moddle.create("bpmn:MultiInstanceLoopCharacteristics", {
1295
- isSequential: !0
1296
- }) : this.multiLoopInstance = window.bpmnInstances.moddle.create("bpmn:MultiInstanceLoopCharacteristics"), window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
1297
- loopCharacteristics: this.multiLoopInstance
1298
- });
1299
- },
1300
- // 循环基数
1301
- updateLoopCardinality(e) {
1302
- let i = null;
1303
- e && e.length && (i = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: e })), window.bpmnInstances.modeling.updateModdleProperties(this.bpmnElement, this.multiLoopInstance, {
1304
- loopCardinality: i
1305
- });
1306
- },
1307
- // 完成条件
1308
- updateLoopCondition(e) {
1309
- let i = null;
1310
- e && e.length && (i = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: e })), window.bpmnInstances.modeling.updateModdleProperties(this.bpmnElement, this.multiLoopInstance, {
1311
- completionCondition: i
1312
- });
1313
- },
1314
- // 重试周期
1315
- updateLoopTimeCycle(e) {
1316
- const i = window.bpmnInstances.moddle.create("bpmn:ExtensionElements", {
1317
- values: [
1318
- window.bpmnInstances.moddle.create(`${this.prefix}:FailedJobRetryTimeCycle`, {
1319
- body: e
1320
- })
1321
- ]
1322
- });
1323
- window.bpmnInstances.modeling.updateModdleProperties(this.bpmnElement, this.multiLoopInstance, {
1324
- extensionElements: i
1325
- });
1326
- },
1327
- // 直接更新的基础信息
1328
- updateLoopBase() {
1329
- window.bpmnInstances.modeling.updateModdleProperties(this.bpmnElement, this.multiLoopInstance, {
1330
- collection: this.loopInstanceForm.collection || null,
1331
- elementVariable: this.loopInstanceForm.elementVariable || null
1332
- });
1333
- },
1334
- // 各异步状态
1335
- updateLoopAsync(e) {
1336
- const { asyncBefore: i, asyncAfter: t } = this.loopInstanceForm;
1337
- let n = /* @__PURE__ */ Object.create(null);
1338
- !i && !t ? (this.$set(this.loopInstanceForm, "exclusive", !1), n = { asyncBefore: !1, asyncAfter: !1, exclusive: !1, extensionElements: null }) : n[e] = this.loopInstanceForm[e], window.bpmnInstances.modeling.updateModdleProperties(this.bpmnElement, this.multiLoopInstance, n);
1339
- }
1340
- }
1341
- }, w = {};
1342
- var ke = /* @__PURE__ */ a(
1343
- Te,
1344
- we,
1345
- Ie,
1346
- !1,
1347
- $e,
1348
- null,
1349
- null,
1350
- null
1351
- );
1352
- function $e(e) {
1353
- for (let i in w)
1354
- this[i] = w[i];
1355
- }
1356
- const Ce = /* @__PURE__ */ function() {
1357
- return ke.exports;
1358
- }();
1359
- var Le = function() {
1360
- var e = this, i = e.$createElement, t = e._self._c || i;
1361
- return t("div", {
1362
- staticClass: "panel-tab__content"
1363
- }, [t("ElForm", {
1364
- attrs: {
1365
- model: e.flowConditionForm,
1366
- "label-width": "90px",
1367
- size: "mini"
1368
- },
1369
- nativeOn: {
1370
- submit: function(n) {
1371
- n.preventDefault();
1372
- }
1373
- }
1374
- }, [t("ElFormItem", {
1375
- attrs: {
1376
- label: "流转类型"
1377
- }
1378
- }, [t("ElSelect", {
1379
- on: {
1380
- change: e.updateFlowType
1381
- },
1382
- model: {
1383
- value: e.flowConditionForm.type,
1384
- callback: function(n) {
1385
- e.$set(e.flowConditionForm, "type", n);
1386
- },
1387
- expression: "flowConditionForm.type"
1388
- }
1389
- }, [t("ElOption", {
1390
- attrs: {
1391
- label: "普通流转路径",
1392
- value: "normal"
1393
- }
1394
- }), t("ElOption", {
1395
- attrs: {
1396
- label: "默认流转路径",
1397
- value: "default"
1398
- }
1399
- }), t("ElOption", {
1400
- attrs: {
1401
- label: "条件流转路径",
1402
- value: "condition"
1403
- }
1404
- })], 1)], 1), e.flowConditionForm.type === "condition" ? t("ElFormItem", {
1405
- key: "condition",
1406
- attrs: {
1407
- label: "条件格式"
1408
- }
1409
- }, [t("ElSelect", {
1410
- model: {
1411
- value: e.flowConditionForm.conditionType,
1412
- callback: function(n) {
1413
- e.$set(e.flowConditionForm, "conditionType", n);
1414
- },
1415
- expression: "flowConditionForm.conditionType"
1416
- }
1417
- }, [t("ElOption", {
1418
- attrs: {
1419
- label: "表达式",
1420
- value: "expression"
1421
- }
1422
- }), t("ElOption", {
1423
- attrs: {
1424
- label: "脚本",
1425
- value: "script"
1426
- }
1427
- })], 1)], 1) : e._e(), e.flowConditionForm.conditionType && e.flowConditionForm.conditionType === "expression" ? t("ElFormItem", {
1428
- key: "express",
1429
- attrs: {
1430
- label: "表达式"
1431
- }
1432
- }, [t("ElInput", {
1433
- attrs: {
1434
- clearable: ""
1435
- },
1436
- on: {
1437
- change: e.updateFlowCondition
1438
- },
1439
- model: {
1440
- value: e.flowConditionForm.body,
1441
- callback: function(n) {
1442
- e.$set(e.flowConditionForm, "body", n);
1443
- },
1444
- expression: "flowConditionForm.body"
1445
- }
1446
- })], 1) : e._e(), e.flowConditionForm.conditionType && e.flowConditionForm.conditionType === "script" ? [t("ElFormItem", {
1447
- key: "language",
1448
- attrs: {
1449
- label: "脚本语言"
1450
- }
1451
- }, [t("ElInput", {
1452
- attrs: {
1453
- clearable: ""
1454
- },
1455
- on: {
1456
- change: e.updateFlowCondition
1457
- },
1458
- model: {
1459
- value: e.flowConditionForm.language,
1460
- callback: function(n) {
1461
- e.$set(e.flowConditionForm, "language", n);
1462
- },
1463
- expression: "flowConditionForm.language"
1464
- }
1465
- })], 1), t("ElFormItem", {
1466
- key: "scriptType",
1467
- attrs: {
1468
- label: "脚本类型"
1469
- }
1470
- }, [t("ElSelect", {
1471
- model: {
1472
- value: e.flowConditionForm.scriptType,
1473
- callback: function(n) {
1474
- e.$set(e.flowConditionForm, "scriptType", n);
1475
- },
1476
- expression: "flowConditionForm.scriptType"
1477
- }
1478
- }, [t("ElOption", {
1479
- attrs: {
1480
- label: "内联脚本",
1481
- value: "inlineScript"
1482
- }
1483
- }), t("ElOption", {
1484
- attrs: {
1485
- label: "外部脚本",
1486
- value: "externalScript"
1487
- }
1488
- })], 1)], 1), e.flowConditionForm.scriptType === "inlineScript" ? t("ElFormItem", {
1489
- key: "body",
1490
- attrs: {
1491
- label: "脚本"
1492
- }
1493
- }, [t("ElInput", {
1494
- attrs: {
1495
- type: "textarea",
1496
- clearable: ""
1497
- },
1498
- on: {
1499
- change: e.updateFlowCondition
1500
- },
1501
- model: {
1502
- value: e.flowConditionForm.body,
1503
- callback: function(n) {
1504
- e.$set(e.flowConditionForm, "body", n);
1505
- },
1506
- expression: "flowConditionForm.body"
1507
- }
1508
- })], 1) : e._e(), e.flowConditionForm.scriptType === "externalScript" ? t("ElFormItem", {
1509
- key: "resource",
1510
- attrs: {
1511
- label: "资源地址"
1512
- }
1513
- }, [t("ElInput", {
1514
- attrs: {
1515
- clearable: ""
1516
- },
1517
- on: {
1518
- change: e.updateFlowCondition
1519
- },
1520
- model: {
1521
- value: e.flowConditionForm.resource,
1522
- callback: function(n) {
1523
- e.$set(e.flowConditionForm, "resource", n);
1524
- },
1525
- expression: "flowConditionForm.resource"
1526
- }
1527
- })], 1) : e._e()] : e._e()], 2)], 1);
1528
- }, Oe = [];
1529
- const Se = {
1530
- name: "FlowCondition",
1531
- props: {
1532
- businessObject: Object
1533
- },
1534
- data() {
1535
- return {
1536
- flowConditionForm: {}
1537
- };
1538
- },
1539
- watch: {
1540
- businessObject: {
1541
- immediate: !0,
1542
- handler() {
1543
- this.$nextTick(() => this.resetFlowCondition());
1544
- }
1545
- }
1546
- },
1547
- beforeDestroy() {
1548
- this.bpmnElement = null, this.bpmnElementSource = null, this.bpmnElementSourceRef = null;
1549
- },
1550
- methods: {
1551
- resetFlowCondition() {
1552
- if (this.bpmnElement = window.bpmnInstances.bpmnElement, this.bpmnElementSource = this.bpmnElement.source, this.bpmnElementSourceRef = this.bpmnElement.businessObject.sourceRef, this.bpmnElementSourceRef && this.bpmnElementSourceRef.default && this.bpmnElementSourceRef.default.id === this.bpmnElement.id)
1553
- this.flowConditionForm = { type: "default" };
1554
- else if (!this.bpmnElement.businessObject.conditionExpression)
1555
- this.flowConditionForm = { type: "normal" };
1556
- else {
1557
- const e = this.bpmnElement.businessObject.conditionExpression;
1558
- if (this.flowConditionForm = p(o({}, e), { type: "condition" }), this.flowConditionForm.resource) {
1559
- this.$set(this.flowConditionForm, "conditionType", "script"), this.$set(this.flowConditionForm, "scriptType", "externalScript");
1560
- return;
1561
- }
1562
- if (e.language) {
1563
- this.$set(this.flowConditionForm, "conditionType", "script"), this.$set(this.flowConditionForm, "scriptType", "inlineScript");
1564
- return;
1565
- }
1566
- this.$set(this.flowConditionForm, "conditionType", "expression");
1567
- }
1568
- },
1569
- updateFlowType(e) {
1570
- if (e === "condition") {
1571
- this.flowConditionRef = window.bpmnInstances.moddle.create("bpmn:FormalExpression"), window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
1572
- conditionExpression: this.flowConditionRef
1573
- });
1574
- return;
1575
- }
1576
- if (e === "default") {
1577
- window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
1578
- conditionExpression: null
1579
- }), window.bpmnInstances.modeling.updateProperties(this.bpmnElementSource, {
1580
- default: this.bpmnElement
1581
- });
1582
- return;
1583
- }
1584
- this.bpmnElementSourceRef.default && this.bpmnElementSourceRef.default.id === this.bpmnElement.id && window.bpmnInstances.modeling.updateProperties(this.bpmnElementSource, {
1585
- default: null
1586
- }), window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
1587
- conditionExpression: null
1588
- });
1589
- },
1590
- updateFlowCondition() {
1591
- const { conditionType: e, scriptType: i, body: t, resource: n, language: s } = this.flowConditionForm;
1592
- let l;
1593
- e === "expression" ? l = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: t }) : i === "inlineScript" ? (l = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: t, language: s }), this.$set(this.flowConditionForm, "resource", "")) : (this.$set(this.flowConditionForm, "body", ""), l = window.bpmnInstances.moddle.create("bpmn:FormalExpression", { resource: n, language: s })), window.bpmnInstances.modeling.updateProperties(this.bpmnElement, { conditionExpression: l });
1594
- }
1595
- }
1596
- }, I = {};
1597
- var Me = /* @__PURE__ */ a(
1598
- Se,
1599
- Le,
1600
- Oe,
1601
- !1,
1602
- Be,
1603
- null,
1604
- null,
1605
- null
1606
- );
1607
- function Be(e) {
1608
- for (let i in I)
1609
- this[i] = I[i];
1610
- }
1611
- const De = /* @__PURE__ */ function() {
1612
- return Me.exports;
1613
- }();
1614
- var je = function() {
1615
- var e = this, i = e.$createElement, t = e._self._c || i;
1616
- return t("div", {
1617
- staticClass: "panel-tab__content"
1618
- }, [t("div", {
1619
- staticClass: "panel-tab__content--title"
1620
- }, [e._m(0), t("ElButton", {
1621
- attrs: {
1622
- size: "mini",
1623
- type: "primary",
1624
- icon: "el-icon-plus"
1625
- },
1626
- on: {
1627
- click: function(n) {
1628
- return e.openModel("message");
1629
- }
1630
- }
1631
- }, [e._v("创建新消息")])], 1), t("ElTable", {
1632
- attrs: {
1633
- data: e.messageList,
1634
- size: "mini",
1635
- border: ""
1636
- }
1637
- }, [t("ElTableColumn", {
1638
- attrs: {
1639
- type: "index",
1640
- label: "序号",
1641
- width: "60px"
1642
- }
1643
- }), t("ElTableColumn", {
1644
- attrs: {
1645
- label: "消息ID",
1646
- prop: "id",
1647
- "max-width": "300px",
1648
- "show-overflow-tooltip": ""
1649
- }
1650
- }), t("ElTableColumn", {
1651
- attrs: {
1652
- label: "消息名称",
1653
- prop: "name",
1654
- "max-width": "300px",
1655
- "show-overflow-tooltip": ""
1656
- }
1657
- })], 1), t("div", {
1658
- staticClass: "panel-tab__content--title",
1659
- staticStyle: {
1660
- "margin-top": "8px",
1661
- "padding-top": "8px",
1662
- "border-top": "1px solid #eee"
1663
- }
1664
- }, [e._m(1), t("ElButton", {
1665
- attrs: {
1666
- size: "mini",
1667
- type: "primary",
1668
- icon: "el-icon-plus"
1669
- },
1670
- on: {
1671
- click: function(n) {
1672
- return e.openModel("signal");
1673
- }
1674
- }
1675
- }, [e._v("创建新信号")])], 1), t("ElTable", {
1676
- attrs: {
1677
- data: e.signalList,
1678
- size: "mini",
1679
- border: ""
1680
- }
1681
- }, [t("ElTableColumn", {
1682
- attrs: {
1683
- type: "index",
1684
- label: "序号",
1685
- width: "60px"
1686
- }
1687
- }), t("ElTableColumn", {
1688
- attrs: {
1689
- label: "信号ID",
1690
- prop: "id",
1691
- "max-width": "300px",
1692
- "show-overflow-tooltip": ""
1693
- }
1694
- }), t("ElTableColumn", {
1695
- attrs: {
1696
- label: "信号名称",
1697
- prop: "name",
1698
- "max-width": "300px",
1699
- "show-overflow-tooltip": ""
1700
- }
1701
- })], 1), t("ElementDialog", {
1702
- attrs: {
1703
- visible: e.modelVisible,
1704
- title: e.modelConfig.title,
1705
- "close-on-click-modal": !1,
1706
- width: "400px",
1707
- "append-to-body": "",
1708
- "destroy-on-close": ""
1709
- },
1710
- on: {
1711
- "update:visible": function(n) {
1712
- e.modelVisible = n;
1713
- }
1714
- },
1715
- scopedSlots: e._u([{
1716
- key: "footer",
1717
- fn: function() {
1718
- return [t("ElButton", {
1719
- attrs: {
1720
- size: "mini"
1721
- },
1722
- on: {
1723
- click: function(n) {
1724
- e.modelVisible = !1;
1725
- }
1726
- }
1727
- }, [e._v("取 消")]), t("ElButton", {
1728
- attrs: {
1729
- size: "mini",
1730
- type: "primary"
1731
- },
1732
- on: {
1733
- click: e.addNewObject
1734
- }
1735
- }, [e._v("保 存")])];
1736
- },
1737
- proxy: !0
1738
- }])
1739
- }, [t("ElForm", {
1740
- attrs: {
1741
- model: e.modelObjectForm,
1742
- size: "mini",
1743
- "label-width": "90px"
1744
- },
1745
- nativeOn: {
1746
- submit: function(n) {
1747
- n.preventDefault();
1748
- }
1749
- }
1750
- }, [t("ElFormItem", {
1751
- attrs: {
1752
- label: e.modelConfig.idLabel
1753
- }
1754
- }, [t("ElInput", {
1755
- attrs: {
1756
- clearable: ""
1757
- },
1758
- model: {
1759
- value: e.modelObjectForm.id,
1760
- callback: function(n) {
1761
- e.$set(e.modelObjectForm, "id", n);
1762
- },
1763
- expression: "modelObjectForm.id"
1764
- }
1765
- })], 1), t("ElFormItem", {
1766
- attrs: {
1767
- label: e.modelConfig.nameLabel
1768
- }
1769
- }, [t("ElInput", {
1770
- attrs: {
1771
- clearable: ""
1772
- },
1773
- model: {
1774
- value: e.modelObjectForm.name,
1775
- callback: function(n) {
1776
- e.$set(e.modelObjectForm, "name", n);
1777
- },
1778
- expression: "modelObjectForm.name"
1779
- }
1780
- })], 1)], 1)], 1)], 1);
1781
- }, Pe = [function() {
1782
- var e = this, i = e.$createElement, t = e._self._c || i;
1783
- return t("span", [t("i", {
1784
- staticClass: "el-icon-menu",
1785
- staticStyle: {
1786
- "margin-right": "8px",
1787
- color: "#555"
1788
- }
1789
- }), e._v("消息列表")]);
1790
- }, function() {
1791
- var e = this, i = e.$createElement, t = e._self._c || i;
1792
- return t("span", [t("i", {
1793
- staticClass: "el-icon-menu",
1794
- staticStyle: {
1795
- "margin-right": "8px",
1796
- color: "#555"
1797
- }
1798
- }), e._v("信号列表")]);
1799
- }];
1800
- const Ve = {
1801
- name: "SignalAndMessage",
1802
- data() {
1803
- return {
1804
- signalList: [],
1805
- messageList: [],
1806
- modelVisible: !1,
1807
- modelType: "",
1808
- modelObjectForm: {}
1809
- };
1810
- },
1811
- computed: {
1812
- modelConfig() {
1813
- return this.modelType === "message" ? { title: "创建消息", idLabel: "消息ID", nameLabel: "消息名称" } : { title: "创建信号", idLabel: "信号ID", nameLabel: "信号名称" };
1814
- }
1815
- },
1816
- mounted() {
1817
- this.initDataList();
1818
- },
1819
- methods: {
1820
- initDataList() {
1821
- this.rootElements = window.bpmnInstances.modeler.getDefinitions().rootElements, this.messageIdMap = {}, this.signalIdMap = {}, this.messageList = [], this.signalList = [], this.rootElements.forEach((e) => {
1822
- e.$type === "bpmn:Message" && (this.messageIdMap[e.id] = !0, this.messageList.push(o({}, e))), e.$type === "bpmn:Signal" && (this.signalIdMap[e.id] = !0, this.signalList.push(o({}, e)));
1823
- });
1824
- },
1825
- openModel(e) {
1826
- this.modelType = e, this.modelObjectForm = {}, this.modelVisible = !0;
1827
- },
1828
- addNewObject() {
1829
- if (this.modelType === "message") {
1830
- if (this.messageIdMap[this.modelObjectForm.id])
1831
- return this.$message.error("该消息已存在,请修改id后重新保存");
1832
- const e = window.bpmnInstances.moddle.create("bpmn:Message", this.modelObjectForm);
1833
- this.rootElements.push(e);
1834
- } else {
1835
- if (this.signalIdMap[this.modelObjectForm.id])
1836
- return this.$message.error("该信号已存在,请修改id后重新保存");
1837
- const e = window.bpmnInstances.moddle.create("bpmn:Signal", this.modelObjectForm);
1838
- this.rootElements.push(e);
1839
- }
1840
- this.modelVisible = !1, this.initDataList();
1841
- }
1842
- }
1843
- }, T = {};
1844
- var ze = /* @__PURE__ */ a(
1845
- Ve,
1846
- je,
1847
- Pe,
1848
- !1,
1849
- Re,
1850
- null,
1851
- null,
1852
- null
1853
- );
1854
- function Re(e) {
1855
- for (let i in T)
1856
- this[i] = T[i];
1857
- }
1858
- const Ae = /* @__PURE__ */ function() {
1859
- return ze.exports;
1860
- }();
1861
- function S(e, i, t) {
1862
- const n = /* @__PURE__ */ Object.create(null);
1863
- switch (n.event = e.event, i && (n.id = e.id), e.listenerType) {
1864
- case "scriptListener":
1865
- n.script = qe(e, t);
1866
- break;
1867
- case "expressionListener":
1868
- n.expression = e.expression;
1869
- break;
1870
- case "delegateExpressionListener":
1871
- n.delegateExpression = e.delegateExpression;
1872
- break;
1873
- default:
1874
- n.class = e.class;
1875
- }
1876
- if (e.fields && (n.fields = e.fields.map((s) => Ne(s, t))), i && e.event === "timeout" && e.eventDefinitionType) {
1877
- const s = window.bpmnInstances.moddle.create("bpmn:FormalExpression", {
1878
- body: e.eventTimeDefinitions
1879
- }), l = window.bpmnInstances.moddle.create("bpmn:TimerEventDefinition", {
1880
- id: `TimerEventDefinition_${Je(8)}`,
1881
- [`time${e.eventDefinitionType.replace(/^\S/, (r) => r.toUpperCase())}`]: s
1882
- });
1883
- n.eventDefinitions = [l];
1884
- }
1885
- return window.bpmnInstances.moddle.create(`${t}:${i ? "TaskListener" : "ExecutionListener"}`, n);
1886
- }
1887
- function Ne(e, i) {
1888
- const { name: t, fieldType: n, string: s, expression: l } = e, r = n === "string" ? { name: t, string: s } : { name: t, expression: l };
1889
- return window.bpmnInstances.moddle.create(`${i}:Field`, r);
1890
- }
1891
- function qe(e, i) {
1892
- const { scriptType: t, scriptFormat: n, value: s, resource: l } = e, r = t === "inlineScript" ? { scriptFormat: n, value: s } : { scriptFormat: n, resource: l };
1893
- return window.bpmnInstances.moddle.create(`${i}:Script`, r);
1894
- }
1895
- function u(e, i) {
1896
- const t = window.bpmnInstances.moddle.create("bpmn:ExtensionElements", {
1897
- values: i
1898
- });
1899
- window.bpmnInstances.modeling.updateProperties(e, {
1900
- extensionElements: t
1901
- });
1902
- }
1903
- function Je(e = 8, i) {
1904
- let t = "";
1905
- const n = i || "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
1906
- for (let s = e; s > 0; --s)
1907
- t += n[Math.floor(Math.random() * n.length)];
1908
- return t;
1909
- }
1910
- function M(e) {
1911
- let i = o({}, e);
1912
- if (e.script && (i = p(o(o({}, e), e.script), {
1913
- scriptType: e.script.resource ? "externalScript" : "inlineScript"
1914
- })), e.event === "timeout" && e.eventDefinitions && e.eventDefinitions.length) {
1915
- let t = "";
1916
- for (const n in e.eventDefinitions[0])
1917
- console.log(e.eventDefinitions, n), n.indexOf("time") !== -1 && (t = n, i.eventDefinitionType = n.replace("time", "").toLowerCase());
1918
- console.log(t), i.eventTimeDefinitions = e.eventDefinitions[0][t].body;
1919
- }
1920
- return i;
1921
- }
1922
- function B(e) {
1923
- var t;
1924
- let i;
1925
- return e.class && (i = "classListener"), e.expression && (i = "expressionListener"), e.delegateExpression && (i = "delegateExpressionListener"), e.script && (i = "scriptListener"), p(o(o({}, JSON.parse(JSON.stringify(e))), (t = e.script) != null ? t : {}), {
1926
- listenerType: i
1927
- });
1928
- }
1929
- const D = {
1930
- classListener: "Java 类",
1931
- expressionListener: "表达式",
1932
- delegateExpressionListener: "代理表达式",
1933
- scriptListener: "脚本"
1934
- }, Ue = {
1935
- create: "创建",
1936
- assignment: "指派",
1937
- complete: "完成",
1938
- delete: "删除",
1939
- update: "更新",
1940
- timeout: "超时"
1941
- }, j = {
1942
- string: "字符串",
1943
- expression: "表达式"
1944
- };
1945
- var Ke = function() {
1946
- var e = this, i = e.$createElement, t = e._self._c || i;
1947
- return t("div", {
1948
- staticClass: "panel-tab__content"
1949
- }, [t("ElTable", {
1950
- attrs: {
1951
- data: e.elementListenersList,
1952
- size: "mini",
1953
- border: ""
1954
- }
1955
- }, [t("ElTableColumn", {
1956
- attrs: {
1957
- label: "序号",
1958
- width: "50px",
1959
- type: "index"
1960
- }
1961
- }), t("ElTableColumn", {
1962
- attrs: {
1963
- label: "事件类型",
1964
- "min-width": "100px",
1965
- prop: "event"
1966
- }
1967
- }), t("ElTableColumn", {
1968
- attrs: {
1969
- label: "监听器类型",
1970
- "min-width": "100px",
1971
- "show-overflow-tooltip": "",
1972
- formatter: function(n) {
1973
- return e.listenerTypeObject[n.listenerType];
1974
- }
1975
- }
1976
- }), t("ElTableColumn", {
1977
- attrs: {
1978
- label: "操作",
1979
- width: "90px"
1980
- },
1981
- scopedSlots: e._u([{
1982
- key: "default",
1983
- fn: function(n) {
1984
- var s = n.row, l = n.$index;
1985
- return [t("ElButton", {
1986
- attrs: {
1987
- size: "mini",
1988
- type: "text"
1989
- },
1990
- on: {
1991
- click: function(r) {
1992
- return e.openListenerForm(s, l);
1993
- }
1994
- }
1995
- }, [e._v("编辑")]), t("ElDivider", {
1996
- attrs: {
1997
- direction: "vertical"
1998
- }
1999
- }), t("ElButton", {
2000
- staticStyle: {
2001
- color: "#ff4d4f"
2002
- },
2003
- attrs: {
2004
- size: "mini",
2005
- type: "text"
2006
- },
2007
- on: {
2008
- click: function(r) {
2009
- return e.removeListener(s, l);
2010
- }
2011
- }
2012
- }, [e._v("移除")])];
2013
- }
2014
- }])
2015
- })], 1), t("div", {
2016
- staticClass: "element-drawer__button"
2017
- }, [t("ElButton", {
2018
- attrs: {
2019
- size: "mini",
2020
- type: "primary",
2021
- icon: "el-icon-plus"
2022
- },
2023
- on: {
2024
- click: function(n) {
2025
- return e.openListenerForm(null);
2026
- }
2027
- }
2028
- }, [e._v("添加监听器")])], 1), t("ElDrawer", {
2029
- attrs: {
2030
- visible: e.listenerFormModelVisible,
2031
- title: "执行监听器",
2032
- size: `${e.width}px`,
2033
- "append-to-body": "",
2034
- "destroy-on-close": ""
2035
- },
2036
- on: {
2037
- "update:visible": function(n) {
2038
- e.listenerFormModelVisible = n;
2039
- }
2040
- }
2041
- }, [t("ElForm", {
2042
- ref: "listenerFormRef",
2043
- attrs: {
2044
- size: "mini",
2045
- model: e.listenerForm,
2046
- "label-width": "96px"
2047
- },
2048
- nativeOn: {
2049
- submit: function(n) {
2050
- n.preventDefault();
2051
- }
2052
- }
2053
- }, [t("ElFormItem", {
2054
- attrs: {
2055
- label: "事件类型",
2056
- prop: "event",
2057
- rules: {
2058
- required: !0,
2059
- trigger: ["blur", "change"]
2060
- }
2061
- }
2062
- }, [t("ElSelect", {
2063
- model: {
2064
- value: e.listenerForm.event,
2065
- callback: function(n) {
2066
- e.$set(e.listenerForm, "event", n);
2067
- },
2068
- expression: "listenerForm.event"
2069
- }
2070
- }, [t("ElOption", {
2071
- attrs: {
2072
- label: "start",
2073
- value: "start"
2074
- }
2075
- }), t("ElOption", {
2076
- attrs: {
2077
- label: "end",
2078
- value: "end"
2079
- }
2080
- })], 1)], 1), t("ElFormItem", {
2081
- attrs: {
2082
- label: "监听器类型",
2083
- prop: "listenerType",
2084
- rules: {
2085
- required: !0,
2086
- trigger: ["blur", "change"]
2087
- }
2088
- }
2089
- }, [t("ElSelect", {
2090
- model: {
2091
- value: e.listenerForm.listenerType,
2092
- callback: function(n) {
2093
- e.$set(e.listenerForm, "listenerType", n);
2094
- },
2095
- expression: "listenerForm.listenerType"
2096
- }
2097
- }, e._l(Object.keys(e.listenerTypeObject), function(n) {
2098
- return t("ElOption", {
2099
- key: n,
2100
- attrs: {
2101
- label: e.listenerTypeObject[n],
2102
- value: n
2103
- }
2104
- });
2105
- }), 1)], 1), e.listenerForm.listenerType === "classListener" ? t("ElFormItem", {
2106
- key: "listener-class",
2107
- attrs: {
2108
- label: "Java类",
2109
- prop: "class",
2110
- rules: {
2111
- required: !0,
2112
- trigger: ["blur", "change"]
2113
- }
2114
- }
2115
- }, [t("ElInput", {
2116
- attrs: {
2117
- clearable: ""
2118
- },
2119
- model: {
2120
- value: e.listenerForm.class,
2121
- callback: function(n) {
2122
- e.$set(e.listenerForm, "class", n);
2123
- },
2124
- expression: "listenerForm.class"
2125
- }
2126
- })], 1) : e._e(), e.listenerForm.listenerType === "expressionListener" ? t("ElFormItem", {
2127
- key: "listener-expression",
2128
- attrs: {
2129
- label: "表达式",
2130
- prop: "expression",
2131
- rules: {
2132
- required: !0,
2133
- trigger: ["blur", "change"]
2134
- }
2135
- }
2136
- }, [t("ElInput", {
2137
- attrs: {
2138
- clearable: ""
2139
- },
2140
- model: {
2141
- value: e.listenerForm.expression,
2142
- callback: function(n) {
2143
- e.$set(e.listenerForm, "expression", n);
2144
- },
2145
- expression: "listenerForm.expression"
2146
- }
2147
- })], 1) : e._e(), e.listenerForm.listenerType === "delegateExpressionListener" ? t("ElFormItem", {
2148
- key: "listener-delegate",
2149
- attrs: {
2150
- label: "代理表达式",
2151
- prop: "delegateExpression",
2152
- rules: {
2153
- required: !0,
2154
- trigger: ["blur", "change"]
2155
- }
2156
- }
2157
- }, [t("ElInput", {
2158
- attrs: {
2159
- clearable: ""
2160
- },
2161
- model: {
2162
- value: e.listenerForm.delegateExpression,
2163
- callback: function(n) {
2164
- e.$set(e.listenerForm, "delegateExpression", n);
2165
- },
2166
- expression: "listenerForm.delegateExpression"
2167
- }
2168
- })], 1) : e._e(), e.listenerForm.listenerType === "scriptListener" ? [t("ElFormItem", {
2169
- key: "listener-script-format",
2170
- attrs: {
2171
- label: "脚本格式",
2172
- prop: "scriptFormat",
2173
- rules: {
2174
- required: !0,
2175
- trigger: ["blur", "change"],
2176
- message: "请填写脚本格式"
2177
- }
2178
- }
2179
- }, [t("ElInput", {
2180
- attrs: {
2181
- clearable: ""
2182
- },
2183
- model: {
2184
- value: e.listenerForm.scriptFormat,
2185
- callback: function(n) {
2186
- e.$set(e.listenerForm, "scriptFormat", n);
2187
- },
2188
- expression: "listenerForm.scriptFormat"
2189
- }
2190
- })], 1), t("ElFormItem", {
2191
- key: "listener-script-type",
2192
- attrs: {
2193
- label: "脚本类型",
2194
- prop: "scriptType",
2195
- rules: {
2196
- required: !0,
2197
- trigger: ["blur", "change"],
2198
- message: "请选择脚本类型"
2199
- }
2200
- }
2201
- }, [t("ElSelect", {
2202
- model: {
2203
- value: e.listenerForm.scriptType,
2204
- callback: function(n) {
2205
- e.$set(e.listenerForm, "scriptType", n);
2206
- },
2207
- expression: "listenerForm.scriptType"
2208
- }
2209
- }, [t("ElOption", {
2210
- attrs: {
2211
- label: "内联脚本",
2212
- value: "inlineScript"
2213
- }
2214
- }), t("ElOption", {
2215
- attrs: {
2216
- label: "外部脚本",
2217
- value: "externalScript"
2218
- }
2219
- })], 1)], 1), e.listenerForm.scriptType === "inlineScript" ? t("ElFormItem", {
2220
- key: "listener-script",
2221
- attrs: {
2222
- label: "脚本内容",
2223
- prop: "value",
2224
- rules: {
2225
- required: !0,
2226
- trigger: ["blur", "change"],
2227
- message: "请填写脚本内容"
2228
- }
2229
- }
2230
- }, [t("ElInput", {
2231
- attrs: {
2232
- clearable: ""
2233
- },
2234
- model: {
2235
- value: e.listenerForm.value,
2236
- callback: function(n) {
2237
- e.$set(e.listenerForm, "value", n);
2238
- },
2239
- expression: "listenerForm.value"
2240
- }
2241
- })], 1) : e._e(), e.listenerForm.scriptType === "externalScript" ? t("ElFormItem", {
2242
- key: "listener-resource",
2243
- attrs: {
2244
- label: "资源地址",
2245
- prop: "resource",
2246
- rules: {
2247
- required: !0,
2248
- trigger: ["blur", "change"],
2249
- message: "请填写资源地址"
2250
- }
2251
- }
2252
- }, [t("ElInput", {
2253
- attrs: {
2254
- clearable: ""
2255
- },
2256
- model: {
2257
- value: e.listenerForm.resource,
2258
- callback: function(n) {
2259
- e.$set(e.listenerForm, "resource", n);
2260
- },
2261
- expression: "listenerForm.resource"
2262
- }
2263
- })], 1) : e._e()] : e._e()], 2), t("ElDivider"), t("p", {
2264
- staticClass: "listener-filed__title"
2265
- }, [t("span", [t("i", {
2266
- staticClass: "el-icon-menu"
2267
- }), e._v("注入字段:")]), t("ElButton", {
2268
- attrs: {
2269
- size: "mini",
2270
- type: "primary"
2271
- },
2272
- on: {
2273
- click: function(n) {
2274
- return e.openListenerFieldForm(null);
2275
- }
2276
- }
2277
- }, [e._v("添加字段")])], 1), t("ElTable", {
2278
- staticStyle: {
2279
- flex: "none"
2280
- },
2281
- attrs: {
2282
- data: e.fieldsListOfListener,
2283
- size: "mini",
2284
- "max-height": "240",
2285
- border: "",
2286
- fit: ""
2287
- }
2288
- }, [t("ElTableColumn", {
2289
- attrs: {
2290
- label: "序号",
2291
- width: "50px",
2292
- type: "index"
2293
- }
2294
- }), t("ElTableColumn", {
2295
- attrs: {
2296
- label: "字段名称",
2297
- "min-width": "100px",
2298
- prop: "name"
2299
- }
2300
- }), t("ElTableColumn", {
2301
- attrs: {
2302
- label: "字段类型",
2303
- "min-width": "80px",
2304
- "show-overflow-tooltip": "",
2305
- formatter: function(n) {
2306
- return e.fieldTypeObject[n.fieldType];
2307
- }
2308
- }
2309
- }), t("ElTableColumn", {
2310
- attrs: {
2311
- label: "字段值/表达式",
2312
- "min-width": "100px",
2313
- "show-overflow-tooltip": "",
2314
- formatter: function(n) {
2315
- return n.string || n.expression;
2316
- }
2317
- }
2318
- }), t("ElTableColumn", {
2319
- attrs: {
2320
- label: "操作",
2321
- width: "100px"
2322
- },
2323
- scopedSlots: e._u([{
2324
- key: "default",
2325
- fn: function(n) {
2326
- var s = n.row, l = n.$index;
2327
- return [t("ElButton", {
2328
- attrs: {
2329
- size: "mini",
2330
- type: "text"
2331
- },
2332
- on: {
2333
- click: function(r) {
2334
- return e.openListenerFieldForm(s, l);
2335
- }
2336
- }
2337
- }, [e._v("编辑")]), t("ElDivider", {
2338
- attrs: {
2339
- direction: "vertical"
2340
- }
2341
- }), t("ElButton", {
2342
- staticStyle: {
2343
- color: "#ff4d4f"
2344
- },
2345
- attrs: {
2346
- size: "mini",
2347
- type: "text"
2348
- },
2349
- on: {
2350
- click: function(r) {
2351
- return e.removeListenerField(s, l);
2352
- }
2353
- }
2354
- }, [e._v("移除")])];
2355
- }
2356
- }])
2357
- })], 1), t("div", {
2358
- staticClass: "element-drawer__button"
2359
- }, [t("ElButton", {
2360
- attrs: {
2361
- size: "mini"
2362
- },
2363
- on: {
2364
- click: function(n) {
2365
- e.listenerFormModelVisible = !1;
2366
- }
2367
- }
2368
- }, [e._v("取 消")]), t("ElButton", {
2369
- attrs: {
2370
- size: "mini",
2371
- type: "primary"
2372
- },
2373
- on: {
2374
- click: e.saveListenerConfig
2375
- }
2376
- }, [e._v("保 存")])], 1)], 1), t("ElementDialog", {
2377
- attrs: {
2378
- title: "字段配置",
2379
- visible: e.listenerFieldFormModelVisible,
2380
- width: "600px",
2381
- "append-to-body": "",
2382
- "destroy-on-close": ""
2383
- },
2384
- on: {
2385
- "update:visible": function(n) {
2386
- e.listenerFieldFormModelVisible = n;
2387
- }
2388
- },
2389
- scopedSlots: e._u([{
2390
- key: "footer",
2391
- fn: function() {
2392
- return [t("ElButton", {
2393
- attrs: {
2394
- size: "mini"
2395
- },
2396
- on: {
2397
- click: function(n) {
2398
- e.listenerFieldFormModelVisible = !1;
2399
- }
2400
- }
2401
- }, [e._v("取 消")]), t("ElButton", {
2402
- attrs: {
2403
- size: "mini",
2404
- type: "primary"
2405
- },
2406
- on: {
2407
- click: e.saveListenerFiled
2408
- }
2409
- }, [e._v("确 定")])];
2410
- },
2411
- proxy: !0
2412
- }])
2413
- }, [t("ElForm", {
2414
- ref: "listenerFieldFormRef",
2415
- staticStyle: {
2416
- height: "136px"
2417
- },
2418
- attrs: {
2419
- model: e.listenerFieldForm,
2420
- size: "mini",
2421
- "label-width": "96px"
2422
- },
2423
- nativeOn: {
2424
- submit: function(n) {
2425
- n.preventDefault();
2426
- }
2427
- }
2428
- }, [t("ElFormItem", {
2429
- attrs: {
2430
- label: "字段名称:",
2431
- prop: "name",
2432
- rules: {
2433
- required: !0,
2434
- trigger: ["blur", "change"]
2435
- }
2436
- }
2437
- }, [t("ElInput", {
2438
- attrs: {
2439
- clearable: ""
2440
- },
2441
- model: {
2442
- value: e.listenerFieldForm.name,
2443
- callback: function(n) {
2444
- e.$set(e.listenerFieldForm, "name", n);
2445
- },
2446
- expression: "listenerFieldForm.name"
2447
- }
2448
- })], 1), t("ElFormItem", {
2449
- attrs: {
2450
- label: "字段类型:",
2451
- prop: "fieldType",
2452
- rules: {
2453
- required: !0,
2454
- trigger: ["blur", "change"]
2455
- }
2456
- }
2457
- }, [t("ElSelect", {
2458
- model: {
2459
- value: e.listenerFieldForm.fieldType,
2460
- callback: function(n) {
2461
- e.$set(e.listenerFieldForm, "fieldType", n);
2462
- },
2463
- expression: "listenerFieldForm.fieldType"
2464
- }
2465
- }, e._l(Object.keys(e.fieldTypeObject), function(n) {
2466
- return t("ElOption", {
2467
- key: n,
2468
- attrs: {
2469
- label: e.fieldTypeObject[n],
2470
- value: n
2471
- }
2472
- });
2473
- }), 1)], 1), e.listenerFieldForm.fieldType === "string" ? t("ElFormItem", {
2474
- key: "field-string",
2475
- attrs: {
2476
- label: "字段值:",
2477
- prop: "string",
2478
- rules: {
2479
- required: !0,
2480
- trigger: ["blur", "change"]
2481
- }
2482
- }
2483
- }, [t("ElInput", {
2484
- attrs: {
2485
- clearable: ""
2486
- },
2487
- model: {
2488
- value: e.listenerFieldForm.string,
2489
- callback: function(n) {
2490
- e.$set(e.listenerFieldForm, "string", n);
2491
- },
2492
- expression: "listenerFieldForm.string"
2493
- }
2494
- })], 1) : e._e(), e.listenerFieldForm.fieldType === "expression" ? t("ElFormItem", {
2495
- key: "field-expression",
2496
- attrs: {
2497
- label: "表达式:",
2498
- prop: "expression",
2499
- rules: {
2500
- required: !0,
2501
- trigger: ["blur", "change"]
2502
- }
2503
- }
2504
- }, [t("ElInput", {
2505
- attrs: {
2506
- clearable: ""
2507
- },
2508
- model: {
2509
- value: e.listenerFieldForm.expression,
2510
- callback: function(n) {
2511
- e.$set(e.listenerFieldForm, "expression", n);
2512
- },
2513
- expression: "listenerFieldForm.expression"
2514
- }
2515
- })], 1) : e._e()], 1)], 1)], 1);
2516
- }, Ge = [];
2517
- const He = {
2518
- name: "ElementListeners",
2519
- inject: {
2520
- prefix: "prefix",
2521
- width: "width"
2522
- },
2523
- props: {
2524
- id: String
2525
- },
2526
- data() {
2527
- return {
2528
- elementListenersList: [],
2529
- // 监听器列表
2530
- listenerForm: {},
2531
- // 监听器详情表单
2532
- listenerFormModelVisible: !1,
2533
- // 监听器 编辑 侧边栏显示状态
2534
- fieldsListOfListener: [],
2535
- listenerFieldForm: {},
2536
- // 监听器 注入字段 详情表单
2537
- listenerFieldFormModelVisible: !1,
2538
- // 监听器 注入字段表单弹窗 显示状态
2539
- editingListenerIndex: -1,
2540
- // 监听器所在下标,-1 为新增
2541
- editingListenerFieldIndex: -1,
2542
- // 字段所在下标,-1 为新增
2543
- listenerTypeObject: D,
2544
- fieldTypeObject: j
2545
- };
2546
- },
2547
- watch: {
2548
- id: {
2549
- immediate: !0,
2550
- handler(e) {
2551
- e && e.length && this.$nextTick(() => this.resetListenersList());
2552
- }
2553
- }
2554
- },
2555
- methods: {
2556
- resetListenersList() {
2557
- var e, i, t, n;
2558
- this.bpmnElement = window.bpmnInstances.bpmnElement, this.otherExtensionList = [], this.bpmnElementListeners = (n = (t = (i = (e = this.bpmnElement.businessObject) == null ? void 0 : e.extensionElements) == null ? void 0 : i.values) == null ? void 0 : t.filter((s) => s.$type === `${this.prefix}:ExecutionListener`)) != null ? n : [], this.elementListenersList = this.bpmnElementListeners.map((s) => B(s));
2559
- },
2560
- // 打开 监听器详情 侧边栏
2561
- openListenerForm(e, i) {
2562
- e ? (this.listenerForm = M(e), this.editingListenerIndex = i) : (this.listenerForm = {}, this.editingListenerIndex = -1), e && e.fields ? this.fieldsListOfListener = e.fields.map((t) => p(o({}, t), {
2563
- fieldType: t.string ? "string" : "expression"
2564
- })) : (this.fieldsListOfListener = [], this.$set(this.listenerForm, "fields", [])), this.listenerFormModelVisible = !0, this.$nextTick(() => {
2565
- this.$refs.listenerFormRef && this.$refs.listenerFormRef.clearValidate();
2566
- });
2567
- },
2568
- // 打开监听器字段编辑弹窗
2569
- openListenerFieldForm(e, i) {
2570
- this.listenerFieldForm = e ? JSON.parse(JSON.stringify(e)) : {}, this.editingListenerFieldIndex = e ? i : -1, this.listenerFieldFormModelVisible = !0, this.$nextTick(() => {
2571
- this.$refs.listenerFieldFormRef && this.$refs.listenerFieldFormRef.clearValidate();
2572
- });
2573
- },
2574
- // 保存监听器注入字段
2575
- saveListenerFiled() {
2576
- return d(this, null, function* () {
2577
- (yield this.$refs.listenerFieldFormRef.validate()) && (this.editingListenerFieldIndex === -1 ? (this.fieldsListOfListener.push(this.listenerFieldForm), this.listenerForm.fields.push(this.listenerFieldForm)) : (this.fieldsListOfListener.splice(this.editingListenerFieldIndex, 1, this.listenerFieldForm), this.listenerForm.fields.splice(this.editingListenerFieldIndex, 1, this.listenerFieldForm)), this.listenerFieldFormModelVisible = !1, this.$nextTick(() => this.listenerFieldForm = {}));
2578
- });
2579
- },
2580
- // 移除监听器字段
2581
- removeListenerField(e, i) {
2582
- this.$confirm("确认移除该字段吗?", "提示", {
2583
- confirmButtonText: "确 认",
2584
- cancelButtonText: "取 消"
2585
- }).then(() => {
2586
- this.fieldsListOfListener.splice(i, 1), this.listenerForm.fields.splice(i, 1);
2587
- }).catch(() => console.info("操作取消"));
2588
- },
2589
- // 移除监听器
2590
- removeListener(e, i) {
2591
- this.$confirm("确认移除该监听器吗?", "提示", {
2592
- confirmButtonText: "确 认",
2593
- cancelButtonText: "取 消"
2594
- }).then(() => {
2595
- this.bpmnElementListeners.splice(i, 1), this.elementListenersList.splice(i, 1), u(this.bpmnElement, this.otherExtensionList.concat(this.bpmnElementListeners));
2596
- }).catch(() => console.info("操作取消"));
2597
- },
2598
- // 保存监听器配置
2599
- saveListenerConfig() {
2600
- return d(this, null, function* () {
2601
- var t, n, s, l;
2602
- if (!(yield this.$refs.listenerFormRef.validate()))
2603
- return;
2604
- const i = S(this.listenerForm, !1, this.prefix);
2605
- this.editingListenerIndex === -1 ? (this.bpmnElementListeners.push(i), this.elementListenersList.push(this.listenerForm)) : (this.bpmnElementListeners.splice(this.editingListenerIndex, 1, i), this.elementListenersList.splice(this.editingListenerIndex, 1, this.listenerForm)), this.otherExtensionList = (l = (s = (n = (t = this.bpmnElement.businessObject) == null ? void 0 : t.extensionElements) == null ? void 0 : n.values) == null ? void 0 : s.filter((r) => r.$type !== `${this.prefix}:ExecutionListener`)) != null ? l : [], u(this.bpmnElement, this.otherExtensionList.concat(this.bpmnElementListeners)), this.listenerFormModelVisible = !1, this.listenerForm = {};
2606
- });
2607
- }
2608
- }
2609
- }, k = {};
2610
- var Qe = /* @__PURE__ */ a(
2611
- He,
2612
- Ke,
2613
- Ge,
2614
- !1,
2615
- We,
2616
- null,
2617
- null,
2618
- null
2619
- );
2620
- function We(e) {
2621
- for (let i in k)
2622
- this[i] = k[i];
2623
- }
2624
- const Xe = /* @__PURE__ */ function() {
2625
- return Qe.exports;
2626
- }();
2627
- var Ye = function() {
2628
- var e = this, i = e.$createElement, t = e._self._c || i;
2629
- return t("div", {
2630
- staticClass: "panel-tab__content"
2631
- }, [t("ElTable", {
2632
- attrs: {
2633
- data: e.elementPropertyList,
2634
- size: "mini",
2635
- "max-height": "240",
2636
- border: "",
2637
- fit: ""
2638
- }
2639
- }, [t("ElTableColumn", {
2640
- attrs: {
2641
- label: "序号",
2642
- width: "50px",
2643
- type: "index"
2644
- }
2645
- }), t("ElTableColumn", {
2646
- attrs: {
2647
- label: "属性名",
2648
- prop: "name",
2649
- "min-width": "100px",
2650
- "show-overflow-tooltip": ""
2651
- }
2652
- }), t("ElTableColumn", {
2653
- attrs: {
2654
- label: "属性值",
2655
- prop: "value",
2656
- "min-width": "100px",
2657
- "show-overflow-tooltip": ""
2658
- }
2659
- }), t("ElTableColumn", {
2660
- attrs: {
2661
- label: "操作",
2662
- width: "90px"
2663
- },
2664
- scopedSlots: e._u([{
2665
- key: "default",
2666
- fn: function(n) {
2667
- var s = n.row, l = n.$index;
2668
- return [t("ElButton", {
2669
- attrs: {
2670
- size: "mini",
2671
- type: "text"
2672
- },
2673
- on: {
2674
- click: function(r) {
2675
- return e.openAttributesForm(s, l);
2676
- }
2677
- }
2678
- }, [e._v("编辑")]), t("ElDivider", {
2679
- attrs: {
2680
- direction: "vertical"
2681
- }
2682
- }), t("ElButton", {
2683
- staticStyle: {
2684
- color: "#ff4d4f"
2685
- },
2686
- attrs: {
2687
- size: "mini",
2688
- type: "text"
2689
- },
2690
- on: {
2691
- click: function(r) {
2692
- return e.removeAttributes(s, l);
2693
- }
2694
- }
2695
- }, [e._v("移除")])];
2696
- }
2697
- }])
2698
- })], 1), t("div", {
2699
- staticClass: "element-drawer__button"
2700
- }, [t("ElButton", {
2701
- attrs: {
2702
- size: "mini",
2703
- type: "primary",
2704
- icon: "el-icon-plus"
2705
- },
2706
- on: {
2707
- click: function(n) {
2708
- return e.openAttributesForm(null, -1);
2709
- }
2710
- }
2711
- }, [e._v("添加属性")])], 1), t("ElementDialog", {
2712
- attrs: {
2713
- visible: e.propertyFormModelVisible,
2714
- title: "属性配置",
2715
- width: "600px",
2716
- "append-to-body": "",
2717
- "destroy-on-close": ""
2718
- },
2719
- on: {
2720
- "update:visible": function(n) {
2721
- e.propertyFormModelVisible = n;
2722
- }
2723
- },
2724
- scopedSlots: e._u([{
2725
- key: "footer",
2726
- fn: function() {
2727
- return [t("ElButton", {
2728
- attrs: {
2729
- size: "mini"
2730
- },
2731
- on: {
2732
- click: function(n) {
2733
- e.propertyFormModelVisible = !1;
2734
- }
2735
- }
2736
- }, [e._v("取 消")]), t("ElButton", {
2737
- attrs: {
2738
- size: "mini",
2739
- type: "primary"
2740
- },
2741
- on: {
2742
- click: e.saveAttribute
2743
- }
2744
- }, [e._v("确 定")])];
2745
- },
2746
- proxy: !0
2747
- }])
2748
- }, [t("ElForm", {
2749
- ref: "attributeFormRef",
2750
- attrs: {
2751
- model: e.propertyForm,
2752
- "label-width": "80px",
2753
- size: "mini"
2754
- },
2755
- nativeOn: {
2756
- submit: function(n) {
2757
- n.preventDefault();
2758
- }
2759
- }
2760
- }, [t("ElFormItem", {
2761
- attrs: {
2762
- label: "属性名:",
2763
- prop: "name"
2764
- }
2765
- }, [t("ElInput", {
2766
- attrs: {
2767
- clearable: ""
2768
- },
2769
- model: {
2770
- value: e.propertyForm.name,
2771
- callback: function(n) {
2772
- e.$set(e.propertyForm, "name", n);
2773
- },
2774
- expression: "propertyForm.name"
2775
- }
2776
- })], 1), t("ElFormItem", {
2777
- attrs: {
2778
- label: "属性值:",
2779
- prop: "value"
2780
- }
2781
- }, [t("ElInput", {
2782
- attrs: {
2783
- clearable: ""
2784
- },
2785
- model: {
2786
- value: e.propertyForm.value,
2787
- callback: function(n) {
2788
- e.$set(e.propertyForm, "value", n);
2789
- },
2790
- expression: "propertyForm.value"
2791
- }
2792
- })], 1)], 1)], 1)], 1);
2793
- }, Ze = [];
2794
- const et = {
2795
- name: "ElementProperties",
2796
- inject: {
2797
- prefix: "prefix",
2798
- width: "width"
2799
- },
2800
- props: {
2801
- id: String
2802
- },
2803
- data() {
2804
- return {
2805
- elementPropertyList: [],
2806
- propertyForm: {},
2807
- editingPropertyIndex: -1,
2808
- propertyFormModelVisible: !1
2809
- };
2810
- },
2811
- watch: {
2812
- id: {
2813
- immediate: !0,
2814
- handler(e) {
2815
- e && e.length && this.resetAttributesList();
2816
- }
2817
- }
2818
- },
2819
- methods: {
2820
- resetAttributesList() {
2821
- var e, i, t, n, s;
2822
- this.bpmnElement = window.bpmnInstances.bpmnElement, this.otherExtensionList = [], this.bpmnElementProperties = (n = (t = (i = (e = this.bpmnElement.businessObject) == null ? void 0 : e.extensionElements) == null ? void 0 : i.values) == null ? void 0 : t.filter((l) => (l.$type !== `${this.prefix}:Properties` && this.otherExtensionList.push(l), l.$type === `${this.prefix}:Properties`))) != null ? n : [], this.bpmnElementPropertyList = this.bpmnElementProperties.reduce((l, r) => l.concat(r.values), []), this.elementPropertyList = JSON.parse(JSON.stringify((s = this.bpmnElementPropertyList) != null ? s : []));
2823
- },
2824
- openAttributesForm(e, i) {
2825
- this.editingPropertyIndex = i, this.propertyForm = i === -1 ? {} : JSON.parse(JSON.stringify(e)), this.propertyFormModelVisible = !0, this.$nextTick(() => {
2826
- this.$refs.attributeFormRef && this.$refs.attributeFormRef.clearValidate();
2827
- });
2828
- },
2829
- removeAttributes(e, i) {
2830
- this.$confirm("确认移除该属性吗?", "提示", {
2831
- confirmButtonText: "确 认",
2832
- cancelButtonText: "取 消"
2833
- }).then(() => {
2834
- this.elementPropertyList.splice(i, 1), this.bpmnElementPropertyList.splice(i, 1);
2835
- const t = window.bpmnInstances.moddle.create(`${this.prefix}:Properties`, {
2836
- values: this.bpmnElementPropertyList
2837
- });
2838
- this.updateElementExtensions(t), this.resetAttributesList();
2839
- }).catch(() => console.info("操作取消"));
2840
- },
2841
- saveAttribute() {
2842
- const { name: e, value: i } = this.propertyForm;
2843
- if (console.log(this.bpmnElementPropertyList), this.editingPropertyIndex !== -1)
2844
- window.bpmnInstances.modeling.updateModdleProperties(this.bpmnElement, this.bpmnElementPropertyList[this.editingPropertyIndex], {
2845
- name: e,
2846
- value: i
2847
- });
2848
- else {
2849
- const t = window.bpmnInstances.moddle.create(`${this.prefix}:Property`, { name: e, value: i }), n = window.bpmnInstances.moddle.create(`${this.prefix}:Properties`, {
2850
- values: this.bpmnElementPropertyList.concat([t])
2851
- });
2852
- this.updateElementExtensions(n);
2853
- }
2854
- this.propertyFormModelVisible = !1, this.resetAttributesList();
2855
- },
2856
- updateElementExtensions(e) {
2857
- const i = window.bpmnInstances.moddle.create("bpmn:ExtensionElements", {
2858
- values: this.otherExtensionList.concat([e])
2859
- });
2860
- window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
2861
- extensionElements: i
2862
- });
2863
- }
2864
- }
2865
- }, $ = {};
2866
- var tt = /* @__PURE__ */ a(
2867
- et,
2868
- Ye,
2869
- Ze,
2870
- !1,
2871
- nt,
2872
- null,
2873
- null,
2874
- null
2875
- );
2876
- function nt(e) {
2877
- for (let i in $)
2878
- this[i] = $[i];
2879
- }
2880
- const it = /* @__PURE__ */ function() {
2881
- return tt.exports;
2882
- }();
2883
- var st = function() {
2884
- var e = this, i = e.$createElement, t = e._self._c || i;
2885
- return t("div", {
2886
- staticClass: "panel-tab__content"
2887
- }, [t("ElForm", {
2888
- attrs: {
2889
- size: "mini",
2890
- "label-width": "80px"
2891
- },
2892
- nativeOn: {
2893
- submit: function(n) {
2894
- n.preventDefault();
2895
- }
2896
- }
2897
- }, [t("ElFormItem", {
2898
- attrs: {
2899
- label: "表单标识"
2900
- }
2901
- }, [t("ElInput", {
2902
- attrs: {
2903
- clearable: ""
2904
- },
2905
- on: {
2906
- change: e.updateElementFormKey
2907
- },
2908
- model: {
2909
- value: e.formKey,
2910
- callback: function(n) {
2911
- e.formKey = n;
2912
- },
2913
- expression: "formKey"
2914
- }
2915
- })], 1), t("ElFormItem", {
2916
- attrs: {
2917
- label: "业务标识"
2918
- }
2919
- }, [t("ElSelect", {
2920
- on: {
2921
- change: e.updateElementBusinessKey
2922
- },
2923
- model: {
2924
- value: e.businessKey,
2925
- callback: function(n) {
2926
- e.businessKey = n;
2927
- },
2928
- expression: "businessKey"
2929
- }
2930
- }, [e._l(e.fieldList, function(n) {
2931
- return t("ElOption", {
2932
- key: n.id,
2933
- attrs: {
2934
- value: n.id,
2935
- label: n.label
2936
- }
2937
- });
2938
- }), t("ElOption", {
2939
- attrs: {
2940
- label: "无",
2941
- value: ""
2942
- }
2943
- })], 2)], 1)], 1), t("div", {
2944
- staticClass: "element-property list-property"
2945
- }, [t("ElDivider", [t("i", {
2946
- staticClass: "el-icon-coin"
2947
- }), e._v(" 表单字段")]), t("ElTable", {
2948
- attrs: {
2949
- data: e.fieldList,
2950
- size: "mini",
2951
- "max-height": "240",
2952
- border: "",
2953
- fit: ""
2954
- }
2955
- }, [t("ElTableColumn", {
2956
- attrs: {
2957
- label: "序号",
2958
- type: "index",
2959
- width: "50px"
2960
- }
2961
- }), t("ElTableColumn", {
2962
- attrs: {
2963
- label: "字段名称",
2964
- prop: "label",
2965
- "min-width": "80px",
2966
- "show-overflow-tooltip": ""
2967
- }
2968
- }), t("ElTableColumn", {
2969
- attrs: {
2970
- label: "字段类型",
2971
- prop: "type",
2972
- "min-width": "80px",
2973
- formatter: function(n) {
2974
- return e.fieldType[n.type] || n.type;
2975
- },
2976
- "show-overflow-tooltip": ""
2977
- }
2978
- }), t("ElTableColumn", {
2979
- attrs: {
2980
- label: "默认值",
2981
- prop: "defaultValue",
2982
- "min-width": "80px",
2983
- "show-overflow-tooltip": ""
2984
- }
2985
- }), t("ElTableColumn", {
2986
- attrs: {
2987
- label: "操作",
2988
- width: "90px"
2989
- },
2990
- scopedSlots: e._u([{
2991
- key: "default",
2992
- fn: function(n) {
2993
- var s = n.row, l = n.$index;
2994
- return [t("ElButton", {
2995
- attrs: {
2996
- size: "mini",
2997
- type: "text"
2998
- },
2999
- on: {
3000
- click: function(r) {
3001
- return e.openFieldForm(s, l);
3002
- }
3003
- }
3004
- }, [e._v("编辑")]), t("ElDivider", {
3005
- attrs: {
3006
- direction: "vertical"
3007
- }
3008
- }), t("ElButton", {
3009
- staticStyle: {
3010
- color: "#ff4d4f"
3011
- },
3012
- attrs: {
3013
- size: "mini",
3014
- type: "text"
3015
- },
3016
- on: {
3017
- click: function(r) {
3018
- return e.removeField(s, l);
3019
- }
3020
- }
3021
- }, [e._v("移除")])];
3022
- }
3023
- }])
3024
- })], 1)], 1), t("div", {
3025
- staticClass: "element-drawer__button"
3026
- }, [t("ElButton", {
3027
- attrs: {
3028
- size: "mini",
3029
- type: "primary",
3030
- icon: "el-icon-plus"
3031
- },
3032
- on: {
3033
- click: function(n) {
3034
- return e.openFieldForm(null, -1);
3035
- }
3036
- }
3037
- }, [e._v("添加字段")])], 1), t("ElDrawer", {
3038
- attrs: {
3039
- visible: e.fieldModelVisible,
3040
- title: "字段配置",
3041
- size: `${e.width}px`,
3042
- "append-to-body": "",
3043
- "destroy-on-close": ""
3044
- },
3045
- on: {
3046
- "update:visible": function(n) {
3047
- e.fieldModelVisible = n;
3048
- }
3049
- }
3050
- }, [t("ElForm", {
3051
- attrs: {
3052
- model: e.formFieldForm,
3053
- "label-width": "90px",
3054
- size: "mini"
3055
- },
3056
- nativeOn: {
3057
- submit: function(n) {
3058
- n.preventDefault();
3059
- }
3060
- }
3061
- }, [t("ElFormItem", {
3062
- attrs: {
3063
- label: "字段ID"
3064
- }
3065
- }, [t("ElInput", {
3066
- attrs: {
3067
- clearable: ""
3068
- },
3069
- model: {
3070
- value: e.formFieldForm.id,
3071
- callback: function(n) {
3072
- e.$set(e.formFieldForm, "id", n);
3073
- },
3074
- expression: "formFieldForm.id"
3075
- }
3076
- })], 1), t("ElFormItem", {
3077
- attrs: {
3078
- label: "类型"
3079
- }
3080
- }, [t("ElSelect", {
3081
- attrs: {
3082
- placeholder: "请选择字段类型",
3083
- clearable: ""
3084
- },
3085
- on: {
3086
- change: e.changeFieldTypeType
3087
- },
3088
- model: {
3089
- value: e.formFieldForm.typeType,
3090
- callback: function(n) {
3091
- e.$set(e.formFieldForm, "typeType", n);
3092
- },
3093
- expression: "formFieldForm.typeType"
3094
- }
3095
- }, e._l(e.fieldType, function(n, s) {
3096
- return t("ElOption", {
3097
- key: s,
3098
- attrs: {
3099
- label: n,
3100
- value: s
3101
- }
3102
- });
3103
- }), 1)], 1), e.formFieldForm.typeType === "custom" ? t("ElFormItem", {
3104
- attrs: {
3105
- label: "类型名称"
3106
- }
3107
- }, [t("ElInput", {
3108
- attrs: {
3109
- clearable: ""
3110
- },
3111
- model: {
3112
- value: e.formFieldForm.type,
3113
- callback: function(n) {
3114
- e.$set(e.formFieldForm, "type", n);
3115
- },
3116
- expression: "formFieldForm.type"
3117
- }
3118
- })], 1) : e._e(), t("ElFormItem", {
3119
- attrs: {
3120
- label: "名称"
3121
- }
3122
- }, [t("ElInput", {
3123
- attrs: {
3124
- clearable: ""
3125
- },
3126
- model: {
3127
- value: e.formFieldForm.label,
3128
- callback: function(n) {
3129
- e.$set(e.formFieldForm, "label", n);
3130
- },
3131
- expression: "formFieldForm.label"
3132
- }
3133
- })], 1), e.formFieldForm.typeType === "date" ? t("ElFormItem", {
3134
- attrs: {
3135
- label: "时间格式"
3136
- }
3137
- }, [t("ElInput", {
3138
- attrs: {
3139
- clearable: ""
3140
- },
3141
- model: {
3142
- value: e.formFieldForm.datePattern,
3143
- callback: function(n) {
3144
- e.$set(e.formFieldForm, "datePattern", n);
3145
- },
3146
- expression: "formFieldForm.datePattern"
3147
- }
3148
- })], 1) : e._e(), t("ElFormItem", {
3149
- attrs: {
3150
- label: "默认值"
3151
- }
3152
- }, [t("ElInput", {
3153
- attrs: {
3154
- clearable: ""
3155
- },
3156
- model: {
3157
- value: e.formFieldForm.defaultValue,
3158
- callback: function(n) {
3159
- e.$set(e.formFieldForm, "defaultValue", n);
3160
- },
3161
- expression: "formFieldForm.defaultValue"
3162
- }
3163
- })], 1)], 1), e.formFieldForm.type === "enum" ? [t("ElDivider", {
3164
- key: "enum-divider"
3165
- }), t("p", {
3166
- key: "enum-title",
3167
- staticClass: "listener-filed__title"
3168
- }, [t("span", [t("i", {
3169
- staticClass: "el-icon-menu"
3170
- }), e._v("枚举值列表:")]), t("ElButton", {
3171
- attrs: {
3172
- size: "mini",
3173
- type: "primary"
3174
- },
3175
- on: {
3176
- click: function(n) {
3177
- return e.openFieldOptionForm(null, -1, "enum");
3178
- }
3179
- }
3180
- }, [e._v("添加枚举值")])], 1), t("ElTable", {
3181
- key: "enum-table",
3182
- attrs: {
3183
- data: e.fieldEnumList,
3184
- size: "mini",
3185
- "max-height": "240",
3186
- border: "",
3187
- fit: ""
3188
- }
3189
- }, [t("ElTableColumn", {
3190
- attrs: {
3191
- label: "序号",
3192
- width: "50px",
3193
- type: "index"
3194
- }
3195
- }), t("ElTableColumn", {
3196
- attrs: {
3197
- label: "枚举值编号",
3198
- prop: "id",
3199
- "min-width": "100px",
3200
- "show-overflow-tooltip": ""
3201
- }
3202
- }), t("ElTableColumn", {
3203
- attrs: {
3204
- label: "枚举值名称",
3205
- prop: "name",
3206
- "min-width": "100px",
3207
- "show-overflow-tooltip": ""
3208
- }
3209
- }), t("ElTableColumn", {
3210
- attrs: {
3211
- label: "操作",
3212
- width: "90px"
3213
- },
3214
- scopedSlots: e._u([{
3215
- key: "default",
3216
- fn: function(n) {
3217
- var s = n.row, l = n.$index;
3218
- return [t("ElButton", {
3219
- attrs: {
3220
- size: "mini",
3221
- type: "text"
3222
- },
3223
- on: {
3224
- click: function(r) {
3225
- return e.openFieldOptionForm(s, l, "enum");
3226
- }
3227
- }
3228
- }, [e._v("编辑")]), t("ElDivider", {
3229
- attrs: {
3230
- direction: "vertical"
3231
- }
3232
- }), t("ElButton", {
3233
- staticStyle: {
3234
- color: "#ff4d4f"
3235
- },
3236
- attrs: {
3237
- size: "mini",
3238
- type: "text"
3239
- },
3240
- on: {
3241
- click: function(r) {
3242
- return e.removeFieldOptionItem(s, l, "enum");
3243
- }
3244
- }
3245
- }, [e._v("移除")])];
3246
- }
3247
- }], null, !1, 747635382)
3248
- })], 1)] : e._e(), t("ElDivider", {
3249
- key: "validation-divider"
3250
- }), t("p", {
3251
- key: "validation-title",
3252
- staticClass: "listener-filed__title"
3253
- }, [t("span", [t("i", {
3254
- staticClass: "el-icon-menu"
3255
- }), e._v("约束条件列表:")]), t("ElButton", {
3256
- attrs: {
3257
- size: "mini",
3258
- type: "primary"
3259
- },
3260
- on: {
3261
- click: function(n) {
3262
- return e.openFieldOptionForm(null, -1, "constraint");
3263
- }
3264
- }
3265
- }, [e._v("添加约束")])], 1), t("ElTable", {
3266
- key: "validation-table",
3267
- attrs: {
3268
- data: e.fieldConstraintsList,
3269
- size: "mini",
3270
- "max-height": "240",
3271
- border: "",
3272
- fit: ""
3273
- }
3274
- }, [t("ElTableColumn", {
3275
- attrs: {
3276
- label: "序号",
3277
- width: "50px",
3278
- type: "index"
3279
- }
3280
- }), t("ElTableColumn", {
3281
- attrs: {
3282
- label: "约束名称",
3283
- prop: "name",
3284
- "min-width": "100px",
3285
- "show-overflow-tooltip": ""
3286
- }
3287
- }), t("ElTableColumn", {
3288
- attrs: {
3289
- label: "约束配置",
3290
- prop: "config",
3291
- "min-width": "100px",
3292
- "show-overflow-tooltip": ""
3293
- }
3294
- }), t("ElTableColumn", {
3295
- attrs: {
3296
- label: "操作",
3297
- width: "90px"
3298
- },
3299
- scopedSlots: e._u([{
3300
- key: "default",
3301
- fn: function(n) {
3302
- var s = n.row, l = n.$index;
3303
- return [t("ElButton", {
3304
- attrs: {
3305
- size: "mini",
3306
- type: "text"
3307
- },
3308
- on: {
3309
- click: function(r) {
3310
- return e.openFieldOptionForm(s, l, "constraint");
3311
- }
3312
- }
3313
- }, [e._v("编辑")]), t("ElDivider", {
3314
- attrs: {
3315
- direction: "vertical"
3316
- }
3317
- }), t("ElButton", {
3318
- staticStyle: {
3319
- color: "#ff4d4f"
3320
- },
3321
- attrs: {
3322
- size: "mini",
3323
- type: "text"
3324
- },
3325
- on: {
3326
- click: function(r) {
3327
- return e.removeFieldOptionItem(s, l, "constraint");
3328
- }
3329
- }
3330
- }, [e._v("移除")])];
3331
- }
3332
- }])
3333
- })], 1), t("ElDivider", {
3334
- key: "property-divider"
3335
- }), t("p", {
3336
- key: "property-title",
3337
- staticClass: "listener-filed__title"
3338
- }, [t("span", [t("i", {
3339
- staticClass: "el-icon-menu"
3340
- }), e._v("字段属性列表:")]), t("ElButton", {
3341
- attrs: {
3342
- size: "mini",
3343
- type: "primary"
3344
- },
3345
- on: {
3346
- click: function(n) {
3347
- return e.openFieldOptionForm(null, -1, "property");
3348
- }
3349
- }
3350
- }, [e._v("添加属性")])], 1), t("ElTable", {
3351
- key: "property-table",
3352
- attrs: {
3353
- data: e.fieldPropertiesList,
3354
- size: "mini",
3355
- "max-height": "240",
3356
- border: "",
3357
- fit: ""
3358
- }
3359
- }, [t("ElTableColumn", {
3360
- attrs: {
3361
- label: "序号",
3362
- width: "50px",
3363
- type: "index"
3364
- }
3365
- }), t("ElTableColumn", {
3366
- attrs: {
3367
- label: "属性编号",
3368
- prop: "id",
3369
- "min-width": "100px",
3370
- "show-overflow-tooltip": ""
3371
- }
3372
- }), t("ElTableColumn", {
3373
- attrs: {
3374
- label: "属性值",
3375
- prop: "value",
3376
- "min-width": "100px",
3377
- "show-overflow-tooltip": ""
3378
- }
3379
- }), t("ElTableColumn", {
3380
- attrs: {
3381
- label: "操作",
3382
- width: "90px"
3383
- },
3384
- scopedSlots: e._u([{
3385
- key: "default",
3386
- fn: function(n) {
3387
- var s = n.row, l = n.$index;
3388
- return [t("ElButton", {
3389
- attrs: {
3390
- size: "mini",
3391
- type: "text"
3392
- },
3393
- on: {
3394
- click: function(r) {
3395
- return e.openFieldOptionForm(s, l, "property");
3396
- }
3397
- }
3398
- }, [e._v("编辑")]), t("ElDivider", {
3399
- attrs: {
3400
- direction: "vertical"
3401
- }
3402
- }), t("ElButton", {
3403
- staticStyle: {
3404
- color: "#ff4d4f"
3405
- },
3406
- attrs: {
3407
- size: "mini",
3408
- type: "text"
3409
- },
3410
- on: {
3411
- click: function(r) {
3412
- return e.removeFieldOptionItem(s, l, "property");
3413
- }
3414
- }
3415
- }, [e._v("移除")])];
3416
- }
3417
- }])
3418
- })], 1), t("div", {
3419
- staticClass: "element-drawer__button"
3420
- }, [t("ElButton", {
3421
- attrs: {
3422
- size: "mini"
3423
- }
3424
- }, [e._v("取 消")]), t("ElButton", {
3425
- attrs: {
3426
- size: "mini",
3427
- type: "primary"
3428
- },
3429
- on: {
3430
- click: e.saveField
3431
- }
3432
- }, [e._v("保 存")])], 1)], 2), t("ElementDialog", {
3433
- attrs: {
3434
- visible: e.fieldOptionModelVisible,
3435
- title: e.optionModelTitle,
3436
- width: "600px",
3437
- "append-to-body": "",
3438
- "destroy-on-close": ""
3439
- },
3440
- on: {
3441
- "update:visible": function(n) {
3442
- e.fieldOptionModelVisible = n;
3443
- }
3444
- },
3445
- scopedSlots: e._u([{
3446
- key: "footer",
3447
- fn: function() {
3448
- return [t("ElButton", {
3449
- attrs: {
3450
- size: "mini"
3451
- },
3452
- on: {
3453
- click: function(n) {
3454
- e.fieldOptionModelVisible = !1;
3455
- }
3456
- }
3457
- }, [e._v("取 消")]), t("ElButton", {
3458
- attrs: {
3459
- size: "mini",
3460
- type: "primary"
3461
- },
3462
- on: {
3463
- click: e.saveFieldOption
3464
- }
3465
- }, [e._v("确 定")])];
3466
- },
3467
- proxy: !0
3468
- }])
3469
- }, [t("ElForm", {
3470
- attrs: {
3471
- model: e.fieldOptionForm,
3472
- size: "mini",
3473
- "label-width": "96px"
3474
- },
3475
- nativeOn: {
3476
- submit: function(n) {
3477
- n.preventDefault();
3478
- }
3479
- }
3480
- }, [e.fieldOptionType !== "constraint" ? t("ElFormItem", {
3481
- key: "option-id",
3482
- attrs: {
3483
- label: "编号/ID"
3484
- }
3485
- }, [t("ElInput", {
3486
- attrs: {
3487
- clearable: ""
3488
- },
3489
- model: {
3490
- value: e.fieldOptionForm.id,
3491
- callback: function(n) {
3492
- e.$set(e.fieldOptionForm, "id", n);
3493
- },
3494
- expression: "fieldOptionForm.id"
3495
- }
3496
- })], 1) : e._e(), e.fieldOptionType !== "property" ? t("ElFormItem", {
3497
- key: "option-name",
3498
- attrs: {
3499
- label: "名称"
3500
- }
3501
- }, [t("ElInput", {
3502
- attrs: {
3503
- clearable: ""
3504
- },
3505
- model: {
3506
- value: e.fieldOptionForm.name,
3507
- callback: function(n) {
3508
- e.$set(e.fieldOptionForm, "name", n);
3509
- },
3510
- expression: "fieldOptionForm.name"
3511
- }
3512
- })], 1) : e._e(), e.fieldOptionType === "constraint" ? t("ElFormItem", {
3513
- key: "option-config",
3514
- attrs: {
3515
- label: "配置"
3516
- }
3517
- }, [t("ElInput", {
3518
- attrs: {
3519
- clearable: ""
3520
- },
3521
- model: {
3522
- value: e.fieldOptionForm.config,
3523
- callback: function(n) {
3524
- e.$set(e.fieldOptionForm, "config", n);
3525
- },
3526
- expression: "fieldOptionForm.config"
3527
- }
3528
- })], 1) : e._e(), e.fieldOptionType === "property" ? t("ElFormItem", {
3529
- key: "option-value",
3530
- attrs: {
3531
- label: "值"
3532
- }
3533
- }, [t("ElInput", {
3534
- attrs: {
3535
- clearable: ""
3536
- },
3537
- model: {
3538
- value: e.fieldOptionForm.value,
3539
- callback: function(n) {
3540
- e.$set(e.fieldOptionForm, "value", n);
3541
- },
3542
- expression: "fieldOptionForm.value"
3543
- }
3544
- })], 1) : e._e()], 1)], 1)], 1);
3545
- }, lt = [];
3546
- const rt = {
3547
- name: "ElementForm",
3548
- inject: {
3549
- prefix: "prefix",
3550
- width: "width"
3551
- },
3552
- props: {
3553
- id: String
3554
- },
3555
- data() {
3556
- return {
3557
- formKey: "",
3558
- businessKey: "",
3559
- optionModelTitle: "",
3560
- fieldList: [],
3561
- formFieldForm: {},
3562
- fieldType: {
3563
- long: "长整型",
3564
- string: "字符串",
3565
- boolean: "布尔类",
3566
- date: "日期类",
3567
- enum: "枚举类",
3568
- custom: "自定义类型"
3569
- },
3570
- formFieldIndex: -1,
3571
- // 编辑中的字段, -1 为新增
3572
- formFieldOptionIndex: -1,
3573
- // 编辑中的字段配置项, -1 为新增
3574
- fieldModelVisible: !1,
3575
- fieldOptionModelVisible: !1,
3576
- fieldOptionForm: {},
3577
- // 当前激活的字段配置项数据
3578
- fieldOptionType: "",
3579
- // 当前激活的字段配置项弹窗 类型
3580
- fieldEnumList: [],
3581
- // 枚举值列表
3582
- fieldConstraintsList: [],
3583
- // 约束条件列表
3584
- fieldPropertiesList: []
3585
- // 绑定属性列表
3586
- };
3587
- },
3588
- watch: {
3589
- id: {
3590
- immediate: !0,
3591
- handler(e) {
3592
- e && e.length && this.$nextTick(() => this.resetFormList());
3593
- }
3594
- }
3595
- },
3596
- methods: {
3597
- resetFormList() {
3598
- var e;
3599
- this.bpmnElement = window.bpmnInstances.bpmnElement, this.formKey = this.bpmnElement.businessObject.formKey, this.elExtensionElements = this.bpmnElement.businessObject.get("extensionElements") || window.bpmnInstances.moddle.create("bpmn:ExtensionElements", { values: [] }), this.formData = ((e = this.elExtensionElements.values.filter((i) => i.$type === `${this.prefix}:FormData`)) == null ? void 0 : e[0]) || window.bpmnInstances.moddle.create(`${this.prefix}:FormData`, { fields: [] }), this.businessKey = this.formData.businessKey, this.otherExtensions = this.elExtensionElements.values.filter((i) => i.$type !== `${this.prefix}:FormData`), this.fieldList = JSON.parse(JSON.stringify(this.formData.fields || [])), this.updateElementExtensions();
3600
- },
3601
- updateElementFormKey() {
3602
- window.bpmnInstances.modeling.updateProperties(this.bpmnElement, { formKey: this.formKey });
3603
- },
3604
- updateElementBusinessKey() {
3605
- window.bpmnInstances.modeling.updateModdleProperties(this.bpmnElement, this.formData, {
3606
- businessKey: this.businessKey
3607
- });
3608
- },
3609
- // 根据类型调整字段type
3610
- changeFieldTypeType(e) {
3611
- this.$set(this.formFieldForm, "type", e === "custom" ? "" : e);
3612
- },
3613
- // 打开字段详情侧边栏
3614
- openFieldForm(e, i) {
3615
- var t, n;
3616
- if (this.formFieldIndex = i, i !== -1) {
3617
- const s = this.formData.fields[i];
3618
- this.formFieldForm = JSON.parse(JSON.stringify(e)), this.$set(this.formFieldForm, "typeType", this.fieldType[e.type] ? e.type : "custom"), e.type === "enum" && (this.fieldEnumList = JSON.parse(JSON.stringify((s == null ? void 0 : s.values) || []))), this.fieldConstraintsList = JSON.parse(JSON.stringify(((t = s == null ? void 0 : s.validation) == null ? void 0 : t.constraints) || [])), this.fieldPropertiesList = JSON.parse(JSON.stringify(((n = s == null ? void 0 : s.properties) == null ? void 0 : n.values) || []));
3619
- } else
3620
- this.formFieldForm = {}, this.fieldEnumList = [], this.fieldConstraintsList = [], this.fieldPropertiesList = [];
3621
- this.fieldModelVisible = !0;
3622
- },
3623
- // 打开字段 某个 配置项 弹窗
3624
- openFieldOptionForm(e, i, t) {
3625
- return this.fieldOptionModelVisible = !0, this.fieldOptionType = t, this.formFieldOptionIndex = i, t === "property" ? (this.fieldOptionForm = e ? JSON.parse(JSON.stringify(e)) : {}, this.optionModelTitle = "属性配置") : t === "enum" ? (this.fieldOptionForm = e ? JSON.parse(JSON.stringify(e)) : {}, this.optionModelTitle = "枚举值配置") : (this.fieldOptionForm = e ? JSON.parse(JSON.stringify(e)) : {}, this.optionModelTitle = "约束条件配置");
3626
- },
3627
- // 保存字段 某个 配置项
3628
- saveFieldOption() {
3629
- this.formFieldOptionIndex === -1 ? (this.fieldOptionType === "property" && this.fieldPropertiesList.push(this.fieldOptionForm), this.fieldOptionType === "constraint" && this.fieldConstraintsList.push(this.fieldOptionForm), this.fieldOptionType === "enum" && this.fieldEnumList.push(this.fieldOptionForm)) : (this.fieldOptionType === "property" && this.fieldPropertiesList.splice(this.formFieldOptionIndex, 1, this.fieldOptionForm), this.fieldOptionType === "constraint" && this.fieldConstraintsList.splice(this.formFieldOptionIndex, 1, this.fieldOptionForm), this.fieldOptionType === "enum" && this.fieldEnumList.splice(this.formFieldOptionIndex, 1, this.fieldOptionForm)), this.fieldOptionModelVisible = !1, this.fieldOptionForm = {};
3630
- },
3631
- // 保存字段配置
3632
- saveField() {
3633
- const { id: e, type: i, label: t, defaultValue: n, datePattern: s } = this.formFieldForm, l = window.bpmnInstances.moddle.create(`${this.prefix}:FormField`, { id: e, type: i, label: t });
3634
- if (n && (l.defaultValue = n), s && (l.datePattern = s), this.fieldPropertiesList && this.fieldPropertiesList.length) {
3635
- const r = this.fieldPropertiesList.map((m) => window.bpmnInstances.moddle.create(`${this.prefix}:Property`, { id: m.id, value: m.value }));
3636
- l.properties = window.bpmnInstances.moddle.create(`${this.prefix}:Properties`, {
3637
- values: r
3638
- });
3639
- }
3640
- if (this.fieldConstraintsList && this.fieldConstraintsList.length) {
3641
- const r = this.fieldConstraintsList.map((m) => window.bpmnInstances.moddle.create(`${this.prefix}:Constraint`, { name: m.name, config: m.config }));
3642
- l.validation = window.bpmnInstances.moddle.create(`${this.prefix}:Validation`, {
3643
- constraints: r
3644
- });
3645
- }
3646
- this.fieldEnumList && this.fieldEnumList.length && (l.values = this.fieldEnumList.map((r) => window.bpmnInstances.moddle.create(`${this.prefix}:Value`, { name: r.name, id: r.id }))), this.formFieldIndex === -1 ? (this.fieldList.push(this.formFieldForm), this.formData.fields.push(l)) : (this.fieldList.splice(this.formFieldIndex, 1, this.formFieldForm), this.formData.fields.splice(this.formFieldIndex, 1, l)), this.updateElementExtensions(), this.fieldModelVisible = !1;
3647
- },
3648
- // 移除某个 字段的 配置项
3649
- removeFieldOptionItem(e, i, t) {
3650
- if (t === "property") {
3651
- this.fieldPropertiesList.splice(i, 1);
3652
- return;
3653
- }
3654
- if (t === "enum") {
3655
- this.fieldEnumList.splice(i, 1);
3656
- return;
3657
- }
3658
- this.fieldConstraintsList.splice(i, 1);
3659
- },
3660
- // 移除 字段
3661
- removeField(e, i) {
3662
- this.fieldList.splice(i, 1), this.formData.fields.splice(i, 1), this.updateElementExtensions();
3663
- },
3664
- updateElementExtensions() {
3665
- const e = window.bpmnInstances.moddle.create("bpmn:ExtensionElements", {
3666
- values: this.otherExtensions.concat(this.formData)
3667
- });
3668
- window.bpmnInstances.modeling.updateProperties(this.bpmnElement, {
3669
- extensionElements: e
3670
- });
3671
- }
3672
- }
3673
- }, C = {};
3674
- var ot = /* @__PURE__ */ a(
3675
- rt,
3676
- st,
3677
- lt,
3678
- !1,
3679
- at,
3680
- null,
3681
- null,
3682
- null
3683
- );
3684
- function at(e) {
3685
- for (let i in C)
3686
- this[i] = C[i];
3687
- }
3688
- const mt = /* @__PURE__ */ function() {
3689
- return ot.exports;
3690
- }();
3691
- var ct = function() {
3692
- var e = this, i = e.$createElement, t = e._self._c || i;
3693
- return t("div", {
3694
- staticClass: "panel-tab__content"
3695
- }, [t("ElTable", {
3696
- attrs: {
3697
- data: e.elementListenersList,
3698
- size: "mini",
3699
- border: ""
3700
- }
3701
- }, [t("ElTableColumn", {
3702
- attrs: {
3703
- label: "序号",
3704
- width: "50px",
3705
- type: "index"
3706
- }
3707
- }), t("ElTableColumn", {
3708
- attrs: {
3709
- label: "事件类型",
3710
- "min-width": "80px",
3711
- "show-overflow-tooltip": "",
3712
- formatter: function(n) {
3713
- return e.listenerEventTypeObject[n.event];
3714
- }
3715
- }
3716
- }), t("ElTableColumn", {
3717
- attrs: {
3718
- label: "事件id",
3719
- "min-width": "80px",
3720
- prop: "id",
3721
- "show-overflow-tooltip": ""
3722
- }
3723
- }), t("ElTableColumn", {
3724
- attrs: {
3725
- label: "监听器类型",
3726
- "min-width": "80px",
3727
- "show-overflow-tooltip": "",
3728
- formatter: function(n) {
3729
- return e.listenerTypeObject[n.listenerType];
3730
- }
3731
- }
3732
- }), t("ElTableColumn", {
3733
- attrs: {
3734
- label: "操作",
3735
- width: "90px"
3736
- },
3737
- scopedSlots: e._u([{
3738
- key: "default",
3739
- fn: function(n) {
3740
- var s = n.row, l = n.$index;
3741
- return [t("ElButton", {
3742
- attrs: {
3743
- size: "mini",
3744
- type: "text"
3745
- },
3746
- on: {
3747
- click: function(r) {
3748
- return e.openListenerForm(s, l);
3749
- }
3750
- }
3751
- }, [e._v("编辑")]), t("ElDivider", {
3752
- attrs: {
3753
- direction: "vertical"
3754
- }
3755
- }), t("ElButton", {
3756
- staticStyle: {
3757
- color: "#ff4d4f"
3758
- },
3759
- attrs: {
3760
- size: "mini",
3761
- type: "text"
3762
- },
3763
- on: {
3764
- click: function(r) {
3765
- return e.removeListener(s, l);
3766
- }
3767
- }
3768
- }, [e._v("移除")])];
3769
- }
3770
- }])
3771
- })], 1), t("div", {
3772
- staticClass: "element-drawer__button"
3773
- }, [t("ElButton", {
3774
- attrs: {
3775
- size: "mini",
3776
- type: "primary",
3777
- icon: "el-icon-plus"
3778
- },
3779
- on: {
3780
- click: function(n) {
3781
- return e.openListenerForm(null);
3782
- }
3783
- }
3784
- }, [e._v("添加监听器")])], 1), t("ElDrawer", {
3785
- attrs: {
3786
- visible: e.listenerFormModelVisible,
3787
- title: "任务监听器",
3788
- size: `${e.width}px`,
3789
- "append-to-body": "",
3790
- "destroy-on-close": ""
3791
- },
3792
- on: {
3793
- "update:visible": function(n) {
3794
- e.listenerFormModelVisible = n;
3795
- }
3796
- }
3797
- }, [t("ElForm", {
3798
- ref: "listenerFormRef",
3799
- attrs: {
3800
- size: "mini",
3801
- model: e.listenerForm,
3802
- "label-width": "96px"
3803
- },
3804
- nativeOn: {
3805
- submit: function(n) {
3806
- n.preventDefault();
3807
- }
3808
- }
3809
- }, [t("ElFormItem", {
3810
- attrs: {
3811
- label: "事件类型",
3812
- prop: "event",
3813
- rules: {
3814
- required: !0,
3815
- trigger: ["blur", "change"]
3816
- }
3817
- }
3818
- }, [t("ElSelect", {
3819
- model: {
3820
- value: e.listenerForm.event,
3821
- callback: function(n) {
3822
- e.$set(e.listenerForm, "event", n);
3823
- },
3824
- expression: "listenerForm.event"
3825
- }
3826
- }, e._l(Object.keys(e.listenerEventTypeObject), function(n) {
3827
- return t("ElOption", {
3828
- key: n,
3829
- attrs: {
3830
- label: e.listenerEventTypeObject[n],
3831
- value: n
3832
- }
3833
- });
3834
- }), 1)], 1), t("ElFormItem", {
3835
- attrs: {
3836
- label: "监听器ID",
3837
- prop: "id",
3838
- rules: {
3839
- required: !0,
3840
- trigger: ["blur", "change"]
3841
- }
3842
- }
3843
- }, [t("ElInput", {
3844
- attrs: {
3845
- clearable: ""
3846
- },
3847
- model: {
3848
- value: e.listenerForm.id,
3849
- callback: function(n) {
3850
- e.$set(e.listenerForm, "id", n);
3851
- },
3852
- expression: "listenerForm.id"
3853
- }
3854
- })], 1), t("ElFormItem", {
3855
- attrs: {
3856
- label: "监听器类型",
3857
- prop: "listenerType",
3858
- rules: {
3859
- required: !0,
3860
- trigger: ["blur", "change"]
3861
- }
3862
- }
3863
- }, [t("ElSelect", {
3864
- model: {
3865
- value: e.listenerForm.listenerType,
3866
- callback: function(n) {
3867
- e.$set(e.listenerForm, "listenerType", n);
3868
- },
3869
- expression: "listenerForm.listenerType"
3870
- }
3871
- }, e._l(Object.keys(e.listenerTypeObject), function(n) {
3872
- return t("ElOption", {
3873
- key: n,
3874
- attrs: {
3875
- label: e.listenerTypeObject[n],
3876
- value: n
3877
- }
3878
- });
3879
- }), 1)], 1), e.listenerForm.listenerType === "classListener" ? t("ElFormItem", {
3880
- key: "listener-class",
3881
- attrs: {
3882
- label: "Java类",
3883
- prop: "class",
3884
- rules: {
3885
- required: !0,
3886
- trigger: ["blur", "change"]
3887
- }
3888
- }
3889
- }, [t("ElInput", {
3890
- attrs: {
3891
- clearable: ""
3892
- },
3893
- model: {
3894
- value: e.listenerForm.class,
3895
- callback: function(n) {
3896
- e.$set(e.listenerForm, "class", n);
3897
- },
3898
- expression: "listenerForm.class"
3899
- }
3900
- })], 1) : e._e(), e.listenerForm.listenerType === "expressionListener" ? t("ElFormItem", {
3901
- key: "listener-expression",
3902
- attrs: {
3903
- label: "表达式",
3904
- prop: "expression",
3905
- rules: {
3906
- required: !0,
3907
- trigger: ["blur", "change"]
3908
- }
3909
- }
3910
- }, [t("ElInput", {
3911
- attrs: {
3912
- clearable: ""
3913
- },
3914
- model: {
3915
- value: e.listenerForm.expression,
3916
- callback: function(n) {
3917
- e.$set(e.listenerForm, "expression", n);
3918
- },
3919
- expression: "listenerForm.expression"
3920
- }
3921
- })], 1) : e._e(), e.listenerForm.listenerType === "delegateExpressionListener" ? t("ElFormItem", {
3922
- key: "listener-delegate",
3923
- attrs: {
3924
- label: "代理表达式",
3925
- prop: "delegateExpression",
3926
- rules: {
3927
- required: !0,
3928
- trigger: ["blur", "change"]
3929
- }
3930
- }
3931
- }, [t("ElInput", {
3932
- attrs: {
3933
- clearable: ""
3934
- },
3935
- model: {
3936
- value: e.listenerForm.delegateExpression,
3937
- callback: function(n) {
3938
- e.$set(e.listenerForm, "delegateExpression", n);
3939
- },
3940
- expression: "listenerForm.delegateExpression"
3941
- }
3942
- })], 1) : e._e(), e.listenerForm.listenerType === "scriptListener" ? [t("ElFormItem", {
3943
- key: "listener-script-format",
3944
- attrs: {
3945
- label: "脚本格式",
3946
- prop: "scriptFormat",
3947
- rules: {
3948
- required: !0,
3949
- trigger: ["blur", "change"],
3950
- message: "请填写脚本格式"
3951
- }
3952
- }
3953
- }, [t("ElInput", {
3954
- attrs: {
3955
- clearable: ""
3956
- },
3957
- model: {
3958
- value: e.listenerForm.scriptFormat,
3959
- callback: function(n) {
3960
- e.$set(e.listenerForm, "scriptFormat", n);
3961
- },
3962
- expression: "listenerForm.scriptFormat"
3963
- }
3964
- })], 1), t("ElFormItem", {
3965
- key: "listener-script-type",
3966
- attrs: {
3967
- label: "脚本类型",
3968
- prop: "scriptType",
3969
- rules: {
3970
- required: !0,
3971
- trigger: ["blur", "change"],
3972
- message: "请选择脚本类型"
3973
- }
3974
- }
3975
- }, [t("ElSelect", {
3976
- model: {
3977
- value: e.listenerForm.scriptType,
3978
- callback: function(n) {
3979
- e.$set(e.listenerForm, "scriptType", n);
3980
- },
3981
- expression: "listenerForm.scriptType"
3982
- }
3983
- }, [t("ElOption", {
3984
- attrs: {
3985
- label: "内联脚本",
3986
- value: "inlineScript"
3987
- }
3988
- }), t("ElOption", {
3989
- attrs: {
3990
- label: "外部脚本",
3991
- value: "externalScript"
3992
- }
3993
- })], 1)], 1), e.listenerForm.scriptType === "inlineScript" ? t("ElFormItem", {
3994
- key: "listener-script",
3995
- attrs: {
3996
- label: "脚本内容",
3997
- prop: "value",
3998
- rules: {
3999
- required: !0,
4000
- trigger: ["blur", "change"],
4001
- message: "请填写脚本内容"
4002
- }
4003
- }
4004
- }, [t("ElInput", {
4005
- attrs: {
4006
- clearable: ""
4007
- },
4008
- model: {
4009
- value: e.listenerForm.value,
4010
- callback: function(n) {
4011
- e.$set(e.listenerForm, "value", n);
4012
- },
4013
- expression: "listenerForm.value"
4014
- }
4015
- })], 1) : e._e(), e.listenerForm.scriptType === "externalScript" ? t("ElFormItem", {
4016
- key: "listener-resource",
4017
- attrs: {
4018
- label: "资源地址",
4019
- prop: "resource",
4020
- rules: {
4021
- required: !0,
4022
- trigger: ["blur", "change"],
4023
- message: "请填写资源地址"
4024
- }
4025
- }
4026
- }, [t("ElInput", {
4027
- attrs: {
4028
- clearable: ""
4029
- },
4030
- model: {
4031
- value: e.listenerForm.resource,
4032
- callback: function(n) {
4033
- e.$set(e.listenerForm, "resource", n);
4034
- },
4035
- expression: "listenerForm.resource"
4036
- }
4037
- })], 1) : e._e()] : e._e(), e.listenerForm.event === "timeout" ? [t("ElFormItem", {
4038
- key: "eventDefinitionType",
4039
- attrs: {
4040
- label: "定时器类型",
4041
- prop: "eventDefinitionType"
4042
- }
4043
- }, [t("ElSelect", {
4044
- model: {
4045
- value: e.listenerForm.eventDefinitionType,
4046
- callback: function(n) {
4047
- e.$set(e.listenerForm, "eventDefinitionType", n);
4048
- },
4049
- expression: "listenerForm.eventDefinitionType"
4050
- }
4051
- }, [t("ElOption", {
4052
- attrs: {
4053
- label: "日期",
4054
- value: "date"
4055
- }
4056
- }), t("ElOption", {
4057
- attrs: {
4058
- label: "持续时长",
4059
- value: "duration"
4060
- }
4061
- }), t("ElOption", {
4062
- attrs: {
4063
- label: "循环",
4064
- value: "cycle"
4065
- }
4066
- }), t("ElOption", {
4067
- attrs: {
4068
- label: "无",
4069
- value: "null"
4070
- }
4071
- })], 1)], 1), e.listenerForm.eventDefinitionType && e.listenerForm.eventDefinitionType !== "null" ? t("ElFormItem", {
4072
- key: "eventTimeDefinitions",
4073
- attrs: {
4074
- label: "定时器",
4075
- prop: "eventTimeDefinitions",
4076
- rules: {
4077
- required: !0,
4078
- trigger: ["blur", "change"],
4079
- message: "请填写定时器配置"
4080
- }
4081
- }
4082
- }, [t("ElInput", {
4083
- attrs: {
4084
- clearable: ""
4085
- },
4086
- model: {
4087
- value: e.listenerForm.eventTimeDefinitions,
4088
- callback: function(n) {
4089
- e.$set(e.listenerForm, "eventTimeDefinitions", n);
4090
- },
4091
- expression: "listenerForm.eventTimeDefinitions"
4092
- }
4093
- })], 1) : e._e()] : e._e()], 2), t("ElDivider"), t("p", {
4094
- staticClass: "listener-filed__title"
4095
- }, [t("span", [t("i", {
4096
- staticClass: "el-icon-menu"
4097
- }), e._v("注入字段:")]), t("ElButton", {
4098
- attrs: {
4099
- size: "mini",
4100
- type: "primary"
4101
- },
4102
- on: {
4103
- click: function(n) {
4104
- return e.openListenerFieldForm(null);
4105
- }
4106
- }
4107
- }, [e._v("添加字段")])], 1), t("ElTable", {
4108
- staticStyle: {
4109
- flex: "none"
4110
- },
4111
- attrs: {
4112
- data: e.fieldsListOfListener,
4113
- size: "mini",
4114
- "max-height": "240",
4115
- border: "",
4116
- fit: ""
4117
- }
4118
- }, [t("ElTableColumn", {
4119
- attrs: {
4120
- label: "序号",
4121
- width: "50px",
4122
- type: "index"
4123
- }
4124
- }), t("ElTableColumn", {
4125
- attrs: {
4126
- label: "字段名称",
4127
- "min-width": "100px",
4128
- prop: "name"
4129
- }
4130
- }), t("ElTableColumn", {
4131
- attrs: {
4132
- label: "字段类型",
4133
- "min-width": "80px",
4134
- "show-overflow-tooltip": "",
4135
- formatter: function(n) {
4136
- return e.fieldTypeObject[n.fieldType];
4137
- }
4138
- }
4139
- }), t("ElTableColumn", {
4140
- attrs: {
4141
- label: "字段值/表达式",
4142
- "min-width": "100px",
4143
- "show-overflow-tooltip": "",
4144
- formatter: function(n) {
4145
- return n.string || n.expression;
4146
- }
4147
- }
4148
- }), t("ElTableColumn", {
4149
- attrs: {
4150
- label: "操作",
4151
- width: "100px"
4152
- },
4153
- scopedSlots: e._u([{
4154
- key: "default",
4155
- fn: function(n) {
4156
- var s = n.row, l = n.$index;
4157
- return [t("ElButton", {
4158
- attrs: {
4159
- size: "mini",
4160
- type: "text"
4161
- },
4162
- on: {
4163
- click: function(r) {
4164
- return e.openListenerFieldForm(s, l);
4165
- }
4166
- }
4167
- }, [e._v("编辑")]), t("ElDivider", {
4168
- attrs: {
4169
- direction: "vertical"
4170
- }
4171
- }), t("ElButton", {
4172
- staticStyle: {
4173
- color: "#ff4d4f"
4174
- },
4175
- attrs: {
4176
- size: "mini",
4177
- type: "text"
4178
- },
4179
- on: {
4180
- click: function(r) {
4181
- return e.removeListenerField(s, l);
4182
- }
4183
- }
4184
- }, [e._v("移除")])];
4185
- }
4186
- }])
4187
- })], 1), t("div", {
4188
- staticClass: "element-drawer__button"
4189
- }, [t("ElButton", {
4190
- attrs: {
4191
- size: "mini"
4192
- },
4193
- on: {
4194
- click: function(n) {
4195
- e.listenerFormModelVisible = !1;
4196
- }
4197
- }
4198
- }, [e._v("取 消")]), t("ElButton", {
4199
- attrs: {
4200
- size: "mini",
4201
- type: "primary"
4202
- },
4203
- on: {
4204
- click: e.saveListenerConfig
4205
- }
4206
- }, [e._v("保 存")])], 1)], 1), t("ElementDialog", {
4207
- attrs: {
4208
- title: "字段配置",
4209
- visible: e.listenerFieldFormModelVisible,
4210
- width: "600px",
4211
- "append-to-body": "",
4212
- "destroy-on-close": ""
4213
- },
4214
- on: {
4215
- "update:visible": function(n) {
4216
- e.listenerFieldFormModelVisible = n;
4217
- }
4218
- },
4219
- scopedSlots: e._u([{
4220
- key: "footer",
4221
- fn: function() {
4222
- return [t("ElButton", {
4223
- attrs: {
4224
- size: "mini"
4225
- },
4226
- on: {
4227
- click: function(n) {
4228
- e.listenerFieldFormModelVisible = !1;
4229
- }
4230
- }
4231
- }, [e._v("取 消")]), t("ElButton", {
4232
- attrs: {
4233
- size: "mini",
4234
- type: "primary"
4235
- },
4236
- on: {
4237
- click: e.saveListenerFiled
4238
- }
4239
- }, [e._v("确 定")])];
4240
- },
4241
- proxy: !0
4242
- }])
4243
- }, [t("ElForm", {
4244
- ref: "listenerFieldFormRef",
4245
- staticStyle: {
4246
- height: "136px"
4247
- },
4248
- attrs: {
4249
- model: e.listenerFieldForm,
4250
- size: "mini",
4251
- "label-width": "96px"
4252
- },
4253
- nativeOn: {
4254
- submit: function(n) {
4255
- n.preventDefault();
4256
- }
4257
- }
4258
- }, [t("ElFormItem", {
4259
- attrs: {
4260
- label: "字段名称:",
4261
- prop: "name",
4262
- rules: {
4263
- required: !0,
4264
- trigger: ["blur", "change"]
4265
- }
4266
- }
4267
- }, [t("ElInput", {
4268
- attrs: {
4269
- clearable: ""
4270
- },
4271
- model: {
4272
- value: e.listenerFieldForm.name,
4273
- callback: function(n) {
4274
- e.$set(e.listenerFieldForm, "name", n);
4275
- },
4276
- expression: "listenerFieldForm.name"
4277
- }
4278
- })], 1), t("ElFormItem", {
4279
- attrs: {
4280
- label: "字段类型:",
4281
- prop: "fieldType",
4282
- rules: {
4283
- required: !0,
4284
- trigger: ["blur", "change"]
4285
- }
4286
- }
4287
- }, [t("ElSelect", {
4288
- model: {
4289
- value: e.listenerFieldForm.fieldType,
4290
- callback: function(n) {
4291
- e.$set(e.listenerFieldForm, "fieldType", n);
4292
- },
4293
- expression: "listenerFieldForm.fieldType"
4294
- }
4295
- }, e._l(Object.keys(e.fieldTypeObject), function(n) {
4296
- return t("ElOption", {
4297
- key: n,
4298
- attrs: {
4299
- label: e.fieldTypeObject[n],
4300
- value: n
4301
- }
4302
- });
4303
- }), 1)], 1), e.listenerFieldForm.fieldType === "string" ? t("ElFormItem", {
4304
- key: "field-string",
4305
- attrs: {
4306
- label: "字段值:",
4307
- prop: "string",
4308
- rules: {
4309
- required: !0,
4310
- trigger: ["blur", "change"]
4311
- }
4312
- }
4313
- }, [t("ElInput", {
4314
- attrs: {
4315
- clearable: ""
4316
- },
4317
- model: {
4318
- value: e.listenerFieldForm.string,
4319
- callback: function(n) {
4320
- e.$set(e.listenerFieldForm, "string", n);
4321
- },
4322
- expression: "listenerFieldForm.string"
4323
- }
4324
- })], 1) : e._e(), e.listenerFieldForm.fieldType === "expression" ? t("ElFormItem", {
4325
- key: "field-expression",
4326
- attrs: {
4327
- label: "表达式:",
4328
- prop: "expression",
4329
- rules: {
4330
- required: !0,
4331
- trigger: ["blur", "change"]
4332
- }
4333
- }
4334
- }, [t("ElInput", {
4335
- attrs: {
4336
- clearable: ""
4337
- },
4338
- model: {
4339
- value: e.listenerFieldForm.expression,
4340
- callback: function(n) {
4341
- e.$set(e.listenerFieldForm, "expression", n);
4342
- },
4343
- expression: "listenerFieldForm.expression"
4344
- }
4345
- })], 1) : e._e()], 1)], 1)], 1);
4346
- }, pt = [];
4347
- const dt = {
4348
- name: "UserTaskListeners",
4349
- inject: {
4350
- prefix: "prefix",
4351
- width: "width"
4352
- },
4353
- props: {
4354
- id: String
4355
- },
4356
- data() {
4357
- return {
4358
- elementListenersList: [],
4359
- listenerEventTypeObject: Ue,
4360
- listenerTypeObject: D,
4361
- listenerFormModelVisible: !1,
4362
- listenerForm: {},
4363
- fieldTypeObject: j,
4364
- fieldsListOfListener: [],
4365
- listenerFieldFormModelVisible: !1,
4366
- // 监听器 注入字段表单弹窗 显示状态
4367
- editingListenerIndex: -1,
4368
- // 监听器所在下标,-1 为新增
4369
- editingListenerFieldIndex: -1,
4370
- // 字段所在下标,-1 为新增
4371
- listenerFieldForm: {}
4372
- // 监听器 注入字段 详情表单
4373
- };
4374
- },
4375
- watch: {
4376
- id: {
4377
- immediate: !0,
4378
- handler(e) {
4379
- e && e.length && this.$nextTick(() => this.resetListenersList());
4380
- }
4381
- }
4382
- },
4383
- methods: {
4384
- resetListenersList() {
4385
- var e, i, t, n;
4386
- this.bpmnElement = window.bpmnInstances.bpmnElement, this.otherExtensionList = [], this.bpmnElementListeners = (n = (t = (i = (e = this.bpmnElement.businessObject) == null ? void 0 : e.extensionElements) == null ? void 0 : i.values) == null ? void 0 : t.filter((s) => s.$type === `${this.prefix}:TaskListener`)) != null ? n : [], this.elementListenersList = this.bpmnElementListeners.map((s) => B(s));
4387
- },
4388
- openListenerForm(e, i) {
4389
- e ? (this.listenerForm = M(e), this.editingListenerIndex = i) : (this.listenerForm = {}, this.editingListenerIndex = -1), e && e.fields ? this.fieldsListOfListener = e.fields.map((t) => p(o({}, t), {
4390
- fieldType: t.string ? "string" : "expression"
4391
- })) : (this.fieldsListOfListener = [], this.$set(this.listenerForm, "fields", [])), this.listenerFormModelVisible = !0, this.$nextTick(() => {
4392
- this.$refs.listenerFormRef && this.$refs.listenerFormRef.clearValidate();
4393
- });
4394
- },
4395
- // 移除监听器
4396
- removeListener(e, i) {
4397
- this.$confirm("确认移除该监听器吗?", "提示", {
4398
- confirmButtonText: "确 认",
4399
- cancelButtonText: "取 消"
4400
- }).then(() => {
4401
- this.bpmnElementListeners.splice(i, 1), this.elementListenersList.splice(i, 1), u(this.bpmnElement, this.otherExtensionList.concat(this.bpmnElementListeners));
4402
- }).catch(() => console.info("操作取消"));
4403
- },
4404
- // 保存监听器
4405
- saveListenerConfig() {
4406
- return d(this, null, function* () {
4407
- var t, n, s, l;
4408
- if (!(yield this.$refs.listenerFormRef.validate()))
4409
- return;
4410
- const i = S(this.listenerForm, !0, this.prefix);
4411
- this.editingListenerIndex === -1 ? (this.bpmnElementListeners.push(i), this.elementListenersList.push(this.listenerForm)) : (this.bpmnElementListeners.splice(this.editingListenerIndex, 1, i), this.elementListenersList.splice(this.editingListenerIndex, 1, this.listenerForm)), this.otherExtensionList = (l = (s = (n = (t = this.bpmnElement.businessObject) == null ? void 0 : t.extensionElements) == null ? void 0 : n.values) == null ? void 0 : s.filter((r) => r.$type !== `${this.prefix}:TaskListener`)) != null ? l : [], u(this.bpmnElement, this.otherExtensionList.concat(this.bpmnElementListeners)), this.listenerFormModelVisible = !1, this.listenerForm = {};
4412
- });
4413
- },
4414
- // 打开监听器字段编辑弹窗
4415
- openListenerFieldForm(e, i) {
4416
- this.listenerFieldForm = e ? JSON.parse(JSON.stringify(e)) : {}, this.editingListenerFieldIndex = e ? i : -1, this.listenerFieldFormModelVisible = !0, this.$nextTick(() => {
4417
- this.$refs.listenerFieldFormRef && this.$refs.listenerFieldFormRef.clearValidate();
4418
- });
4419
- },
4420
- // 保存监听器注入字段
4421
- saveListenerFiled() {
4422
- return d(this, null, function* () {
4423
- (yield this.$refs.listenerFieldFormRef.validate()) && (this.editingListenerFieldIndex === -1 ? (this.fieldsListOfListener.push(this.listenerFieldForm), this.listenerForm.fields.push(this.listenerFieldForm)) : (this.fieldsListOfListener.splice(this.editingListenerFieldIndex, 1, this.listenerFieldForm), this.listenerForm.fields.splice(this.editingListenerFieldIndex, 1, this.listenerFieldForm)), this.listenerFieldFormModelVisible = !1, this.$nextTick(() => this.listenerFieldForm = {}));
4424
- });
4425
- },
4426
- // 移除监听器字段
4427
- removeListenerField(e, i) {
4428
- this.$confirm("确认移除该字段吗?", "提示", {
4429
- confirmButtonText: "确 认",
4430
- cancelButtonText: "取 消"
4431
- }).then(() => {
4432
- this.fieldsListOfListener.splice(i, 1), this.listenerForm.fields.splice(i, 1);
4433
- }).catch(() => console.info("操作取消"));
4434
- }
4435
- }
4436
- }, L = {};
4437
- var ut = /* @__PURE__ */ a(
4438
- dt,
4439
- ct,
4440
- pt,
4441
- !1,
4442
- ft,
4443
- null,
4444
- null,
4445
- null
4446
- );
4447
- function ft(e) {
4448
- for (let i in L)
4449
- this[i] = L[i];
4450
- }
4451
- const bt = /* @__PURE__ */ function() {
4452
- return ut.exports;
4453
- }();
4454
- var ht = function() {
4455
- var e = this, i = e.$createElement, t = e._self._c || i;
4456
- return t("div", {
4457
- staticClass: "process-panel__container",
4458
- style: {
4459
- width: `${e.width}px`
4460
- }
4461
- }, [t("ElCollapse", {
4462
- model: {
4463
- value: e.activeTab,
4464
- callback: function(n) {
4465
- e.activeTab = n;
4466
- },
4467
- expression: "activeTab"
4468
- }
4469
- }, [t("ElCollapseItem", {
4470
- attrs: {
4471
- name: "base"
4472
- },
4473
- scopedSlots: e._u([{
4474
- key: "title",
4475
- fn: function() {
4476
- return [t("div", {
4477
- staticClass: "panel-tab__title"
4478
- }, [t("i", {
4479
- staticClass: "el-icon-info"
4480
- }), e._v("常规")])];
4481
- },
4482
- proxy: !0
4483
- }])
4484
- }, [t("ElementBaseInfo", {
4485
- attrs: {
4486
- "id-edit-disabled": e.idEditDisabled,
4487
- "business-object": e.elementBusinessObject,
4488
- type: e.elementType
4489
- }
4490
- })], 1), e.elementType === "Process" ? t("ElCollapseItem", {
4491
- key: "message",
4492
- attrs: {
4493
- name: "condition"
4494
- },
4495
- scopedSlots: e._u([{
4496
- key: "title",
4497
- fn: function() {
4498
- return [t("div", {
4499
- staticClass: "panel-tab__title"
4500
- }, [t("i", {
4501
- staticClass: "el-icon-s-comment"
4502
- }), e._v("消息与信号")])];
4503
- },
4504
- proxy: !0
4505
- }], null, !1, 2715634709)
4506
- }, [t("SignalAndMassage")], 1) : e._e(), e.conditionFormVisible ? t("ElCollapseItem", {
4507
- key: "condition",
4508
- attrs: {
4509
- name: "condition"
4510
- },
4511
- scopedSlots: e._u([{
4512
- key: "title",
4513
- fn: function() {
4514
- return [t("div", {
4515
- staticClass: "panel-tab__title"
4516
- }, [t("i", {
4517
- staticClass: "el-icon-s-promotion"
4518
- }), e._v("流转条件")])];
4519
- },
4520
- proxy: !0
4521
- }], null, !1, 2203010800)
4522
- }, [t("FlowCondition", {
4523
- attrs: {
4524
- "business-object": e.elementBusinessObject,
4525
- type: e.elementType
4526
- }
4527
- })], 1) : e._e(), e.formVisible ? t("ElCollapseItem", {
4528
- key: "form",
4529
- attrs: {
4530
- name: "condition"
4531
- },
4532
- scopedSlots: e._u([{
4533
- key: "title",
4534
- fn: function() {
4535
- return [t("div", {
4536
- staticClass: "panel-tab__title"
4537
- }, [t("i", {
4538
- staticClass: "el-icon-s-order"
4539
- }), e._v("表单")])];
4540
- },
4541
- proxy: !0
4542
- }], null, !1, 1341048650)
4543
- }, [t("ElementForm", {
4544
- attrs: {
4545
- id: e.elementId,
4546
- type: e.elementType
4547
- }
4548
- })], 1) : e._e(), e.elementType.indexOf("Task") !== -1 ? t("ElCollapseItem", {
4549
- key: "task",
4550
- attrs: {
4551
- name: "task"
4552
- },
4553
- scopedSlots: e._u([{
4554
- key: "title",
4555
- fn: function() {
4556
- return [t("div", {
4557
- staticClass: "panel-tab__title"
4558
- }, [t("i", {
4559
- staticClass: "el-icon-s-claim"
4560
- }), e._v("任务")])];
4561
- },
4562
- proxy: !0
4563
- }], null, !1, 2144785833)
4564
- }, [t("ElementTask", {
4565
- attrs: {
4566
- id: e.elementId,
4567
- type: e.elementType
4568
- }
4569
- })], 1) : e._e(), e.elementType.indexOf("Task") !== -1 ? t("ElCollapseItem", {
4570
- key: "multiInstance",
4571
- attrs: {
4572
- name: "multiInstance"
4573
- },
4574
- scopedSlots: e._u([{
4575
- key: "title",
4576
- fn: function() {
4577
- return [t("div", {
4578
- staticClass: "panel-tab__title"
4579
- }, [t("i", {
4580
- staticClass: "el-icon-s-help"
4581
- }), e._v("多实例")])];
4582
- },
4583
- proxy: !0
4584
- }], null, !1, 1253501895)
4585
- }, [t("ElementMultiInstance", {
4586
- attrs: {
4587
- "business-object": e.elementBusinessObject,
4588
- type: e.elementType
4589
- }
4590
- })], 1) : e._e(), t("ElCollapseItem", {
4591
- key: "listeners",
4592
- attrs: {
4593
- name: "listeners"
4594
- },
4595
- scopedSlots: e._u([{
4596
- key: "title",
4597
- fn: function() {
4598
- return [t("div", {
4599
- staticClass: "panel-tab__title"
4600
- }, [t("i", {
4601
- staticClass: "el-icon-message-solid"
4602
- }), e._v("执行监听器")])];
4603
- },
4604
- proxy: !0
4605
- }])
4606
- }, [t("ElementListeners", {
4607
- attrs: {
4608
- id: e.elementId,
4609
- type: e.elementType
4610
- }
4611
- })], 1), e.elementType === "UserTask" ? t("ElCollapseItem", {
4612
- key: "taskListeners",
4613
- attrs: {
4614
- name: "taskListeners"
4615
- },
4616
- scopedSlots: e._u([{
4617
- key: "title",
4618
- fn: function() {
4619
- return [t("div", {
4620
- staticClass: "panel-tab__title"
4621
- }, [t("i", {
4622
- staticClass: "el-icon-message-solid"
4623
- }), e._v("任务监听器")])];
4624
- },
4625
- proxy: !0
4626
- }], null, !1, 3617698803)
4627
- }, [t("UserTaskListeners", {
4628
- attrs: {
4629
- id: e.elementId,
4630
- type: e.elementType
4631
- }
4632
- })], 1) : e._e(), t("ElCollapseItem", {
4633
- key: "extensions",
4634
- attrs: {
4635
- name: "extensions"
4636
- },
4637
- scopedSlots: e._u([{
4638
- key: "title",
4639
- fn: function() {
4640
- return [t("div", {
4641
- staticClass: "panel-tab__title"
4642
- }, [t("i", {
4643
- staticClass: "el-icon-circle-plus"
4644
- }), e._v("扩展属性")])];
4645
- },
4646
- proxy: !0
4647
- }])
4648
- }, [t("ElementProperties", {
4649
- attrs: {
4650
- id: e.elementId,
4651
- type: e.elementType
4652
- }
4653
- })], 1), t("ElCollapseItem", {
4654
- key: "other",
4655
- attrs: {
4656
- name: "other"
4657
- },
4658
- scopedSlots: e._u([{
4659
- key: "title",
4660
- fn: function() {
4661
- return [t("div", {
4662
- staticClass: "panel-tab__title"
4663
- }, [t("i", {
4664
- staticClass: "el-icon-s-promotion"
4665
- }), e._v("其他")])];
4666
- },
4667
- proxy: !0
4668
- }])
4669
- }, [t("ElementOtherConfig", {
4670
- attrs: {
4671
- id: e.elementId
4672
- }
4673
- })], 1)], 1)], 1);
4674
- }, Ft = [];
4675
- const vt = {
4676
- name: "PropertiesPanel",
4677
- components: {
4678
- UserTaskListeners: bt,
4679
- ElementForm: mt,
4680
- ElementProperties: it,
4681
- ElementListeners: Xe,
4682
- SignalAndMassage: Ae,
4683
- FlowCondition: De,
4684
- ElementMultiInstance: Ce,
4685
- ElementTask: _e,
4686
- ElementOtherConfig: Z,
4687
- ElementBaseInfo: G
4688
- },
4689
- componentName: "MyPropertiesPanel",
4690
- provide() {
4691
- return {
4692
- prefix: this.prefix,
4693
- width: this.width
4694
- };
4695
- },
4696
- props: {
4697
- bpmnModeler: Object,
4698
- prefix: {
4699
- type: String,
4700
- default: "camunda"
4701
- },
4702
- width: {
4703
- type: Number,
4704
- default: 480
4705
- },
4706
- idEditDisabled: {
4707
- type: Boolean,
4708
- default: !1
4709
- }
4710
- },
4711
- data() {
4712
- return {
4713
- activeTab: "base",
4714
- elementId: "",
4715
- elementType: "",
4716
- elementBusinessObject: {},
4717
- // 元素 businessObject 镜像,提供给需要做判断的组件使用
4718
- conditionFormVisible: !1,
4719
- // 流转条件设置
4720
- formVisible: !1
4721
- // 表单配置
4722
- };
4723
- },
4724
- watch: {
4725
- elementId: {
4726
- handler() {
4727
- this.activeTab = "base";
4728
- }
4729
- }
4730
- },
4731
- created() {
4732
- this.initModels();
4733
- },
4734
- methods: {
4735
- initModels() {
4736
- if (!this.bpmnModeler) {
4737
- this.timer = setTimeout(() => this.initModels(), 10);
4738
- return;
4739
- }
4740
- this.timer && clearTimeout(this.timer), window.bpmnInstances = {
4741
- modeler: this.bpmnModeler,
4742
- modeling: this.bpmnModeler.get("modeling"),
4743
- moddle: this.bpmnModeler.get("moddle"),
4744
- eventBus: this.bpmnModeler.get("eventBus"),
4745
- bpmnFactory: this.bpmnModeler.get("bpmnFactory"),
4746
- elementFactory: this.bpmnModeler.get("elementFactory"),
4747
- elementRegistry: this.bpmnModeler.get("elementRegistry"),
4748
- replace: this.bpmnModeler.get("replace"),
4749
- selection: this.bpmnModeler.get("selection")
4750
- }, this.getActiveElement();
4751
- },
4752
- getActiveElement() {
4753
- this.initFormOnChanged(null), this.bpmnModeler.on("import.done", () => {
4754
- this.initFormOnChanged(null);
4755
- }), this.bpmnModeler.on("selection.changed", ({ newSelection: e }) => {
4756
- this.initFormOnChanged(e[0] || null);
4757
- }), this.bpmnModeler.on("element.changed", ({ element: e }) => {
4758
- e && e.id === this.elementId && this.initFormOnChanged(e);
4759
- });
4760
- },
4761
- // 初始化数据
4762
- initFormOnChanged(e) {
4763
- var t;
4764
- let i = e;
4765
- i || (i = (t = window.bpmnInstances.elementRegistry.find((n) => n.type === "bpmn:Process")) != null ? t : window.bpmnInstances.elementRegistry.find((n) => n.type === "bpmn:Collaboration")), i && (F.call(this, `select element changed: id: ${i.id} , type: ${i.businessObject.$type}`), F.call(this, "businessObject", i.businessObject), window.bpmnInstances.bpmnElement = i, this.bpmnElement = i, this.elementId = i.id, this.elementType = i.type.split(":")[1] || "", this.elementBusinessObject = JSON.parse(JSON.stringify(i.businessObject)), this.conditionFormVisible = !!(this.elementType === "SequenceFlow" && i.source && i.source.type.indexOf("StartEvent") === -1), this.formVisible = this.elementType === "UserTask" || this.elementType === "StartEvent");
4766
- },
4767
- beforeDestroy() {
4768
- window.bpmnInstances = null;
4769
- }
4770
- }
4771
- }, O = {};
4772
- var Et = /* @__PURE__ */ a(
4773
- vt,
4774
- ht,
4775
- Ft,
4776
- !1,
4777
- yt,
4778
- null,
4779
- null,
4780
- null
4781
- );
4782
- function yt(e) {
4783
- for (let i in O)
4784
- this[i] = O[i];
4785
- }
4786
- const wt = /* @__PURE__ */ function() {
4787
- return Et.exports;
4788
- }();
4789
- export {
4790
- wt as default
4791
- };