@web-utils/component 3.5.0 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,63 +1,63 @@
1
- var Se = Object.defineProperty, Te = Object.defineProperties;
2
- var Ce = Object.getOwnPropertyDescriptors;
3
- var te = Object.getOwnPropertySymbols;
4
- var Ie = Object.prototype.hasOwnProperty, ke = Object.prototype.propertyIsEnumerable;
5
- var ne = (i, e, t) => e in i ? Se(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, d = (i, e) => {
1
+ var ye = Object.defineProperty, be = Object.defineProperties;
2
+ var ge = Object.getOwnPropertyDescriptors;
3
+ var Q = Object.getOwnPropertySymbols;
4
+ var fe = Object.prototype.hasOwnProperty, ve = Object.prototype.propertyIsEnumerable;
5
+ var ee = (n, e, t) => e in n ? ye(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, P = (n, e) => {
6
6
  for (var t in e || (e = {}))
7
- Ie.call(e, t) && ne(i, t, e[t]);
8
- if (te)
9
- for (var t of te(e))
10
- ke.call(e, t) && ne(i, t, e[t]);
11
- return i;
12
- }, T = (i, e) => Te(i, Ce(e));
13
- var c = (i, e, t) => new Promise((n, s) => {
14
- var a = (p) => {
7
+ fe.call(e, t) && ee(n, t, e[t]);
8
+ if (Q)
9
+ for (var t of Q(e))
10
+ ve.call(e, t) && ee(n, t, e[t]);
11
+ return n;
12
+ }, L = (n, e) => be(n, ge(e));
13
+ var w = (n, e, t) => new Promise((i, r) => {
14
+ var a = (m) => {
15
15
  try {
16
- o(t.next(p));
17
- } catch (E) {
18
- s(E);
16
+ o(t.next(m));
17
+ } catch (g) {
18
+ r(g);
19
19
  }
20
- }, r = (p) => {
20
+ }, l = (m) => {
21
21
  try {
22
- o(t.throw(p));
23
- } catch (E) {
24
- s(E);
22
+ o(t.throw(m));
23
+ } catch (g) {
24
+ r(g);
25
25
  }
26
- }, o = (p) => p.done ? n(p.value) : Promise.resolve(p.value).then(a, r);
27
- o((t = t.apply(i, e)).next());
26
+ }, o = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(a, l);
27
+ o((t = t.apply(n, e)).next());
28
28
  });
29
- import { assign as y, isArray as _e, forEach as Ae, isObject as we, isFunction as $e, some as _ } from "min-dash";
30
- import { is as V } from "bpmn-js/lib/util/ModelUtil";
31
- import { isExpanded as Le, isEventSubProcess as Oe } from "bpmn-js/lib/util/DiUtil";
32
- import { isAny as G } from "bpmn-js/lib/features/modeling/util/ModelingUtil";
33
- import { getChildLanes as Pe } from "bpmn-js/lib/features/modeling/util/LaneUtil";
34
- import { hasPrimaryModifier as Me } from "diagram-js/lib/util/Mouse";
35
- import ue from "bpmn-js/lib/features/palette/PaletteProvider";
36
- import J from "diagram-js/lib/features/auto-place/AutoPlace";
37
- import { getMid as De, asTRBL as Be } from "diagram-js/lib/layout/LayoutUtil";
38
- import { fastClone as v, isBlank as Re, capitalize as Ve, isArray as ie } from "@web-utils/core";
39
- import { n as h } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
29
+ import { assign as y, isArray as Se, forEach as Ae, isObject as he, isFunction as Ee, some as T } from "min-dash";
30
+ import { is as R } from "bpmn-js/lib/util/ModelUtil";
31
+ import { isExpanded as Te, isEventSubProcess as Ce } from "bpmn-js/lib/util/DiUtil";
32
+ import { isAny as z } from "bpmn-js/lib/features/modeling/util/ModelingUtil";
33
+ import { getChildLanes as xe } from "bpmn-js/lib/features/modeling/util/LaneUtil";
34
+ import { hasPrimaryModifier as Ie } from "diagram-js/lib/util/Mouse";
35
+ import le from "bpmn-js/lib/features/palette/PaletteProvider";
36
+ import j from "diagram-js/lib/features/auto-place/AutoPlace";
37
+ import { getMid as Pe, asTRBL as we } from "diagram-js/lib/layout/LayoutUtil";
40
38
  import { markRaw as N } from "vue";
39
+ import { n as J } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
41
40
  import "bpmn-js/dist/assets/bpmn-js.css";
42
41
  import "bpmn-js/dist/assets/diagram-js.css";
43
42
  import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
44
43
  import "bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css";
45
- import je from "bpmn-js/lib/Modeler";
46
- import ze from "bpmn-js/lib/features/drilldown/index.js";
47
- import Ne from "bpmn-js-token-simulation";
48
- import se from "x2js";
49
- import de from "highlight.js/lib/core";
50
- import Ue from "highlight.js/lib/languages/xml";
51
- import Ge from "highlight.js/lib/languages/json";
52
- import qe from "../highlight-j-s/index.mjs";
44
+ import ke from "bpmn-js/lib/Modeler";
45
+ import _e from "bpmn-js/lib/features/drilldown";
46
+ import Me from "bpmn-js-token-simulation";
47
+ import te from "x2js";
48
+ import pe from "highlight.js/lib/core";
49
+ import De from "highlight.js/lib/languages/xml";
50
+ import Be from "highlight.js/lib/languages/json";
51
+ import { isArray as ne } from "@web-utils/core";
52
+ import Oe from "../highlight-j-s/index.mjs";
53
53
  import "../highlight-j-s/style.css";
54
- function Z(i, e, t, n, s, a, r, o, p, E, m, l, u) {
55
- i = i || {}, n.registerProvider(this), this._contextPad = n, this._modeling = s, this._elementFactory = a, this._connect = r, this._create = o, this._popupMenu = p, this._canvas = E, this._rules = m, this._translate = l, i.autoPlace !== !1 && (this._autoPlace = e.get("autoPlace", !1)), t.on("create.end", 250, function(F) {
56
- const C = F.context.shape;
57
- if (!Me(F) || !n.isOpen(C))
54
+ function Z(n, e, t, i, r, a, l, o, m, g, p, s, u) {
55
+ n = n || {}, i.registerProvider(this), this._contextPad = i, this._modeling = r, this._elementFactory = a, this._connect = l, this._create = o, this._popupMenu = m, this._canvas = g, this._rules = p, this._translate = s, n.autoPlace !== !1 && (this._autoPlace = e.get("autoPlace", !1)), t.on("create.end", 250, function(f) {
56
+ const A = f.context.shape;
57
+ if (!Ie(f) || !i.isOpen(A))
58
58
  return;
59
- const f = n.getEntries(C);
60
- f.replace && f.replace.action.click(F, C);
59
+ const c = i.getEntries(A);
60
+ c.replace && c.replace.action.click(f, A);
61
61
  });
62
62
  }
63
63
  Z.$inject = [
@@ -75,248 +75,248 @@ Z.$inject = [
75
75
  "translate",
76
76
  "elementRegistry"
77
77
  ];
78
- Z.prototype.getContextPadEntries = function(i) {
79
- const e = this._contextPad, t = this._modeling, n = this._elementFactory, s = this._connect, a = this._create, r = this._popupMenu, o = this._canvas, p = this._rules, E = this._autoPlace, m = this._translate, l = {};
80
- if (i.type === "label")
81
- return l;
82
- const u = i.businessObject;
83
- function F(b, S) {
84
- s.start(b, S);
78
+ Z.prototype.getContextPadEntries = function(n) {
79
+ const e = this._contextPad, t = this._modeling, i = this._elementFactory, r = this._connect, a = this._create, l = this._popupMenu, o = this._canvas, m = this._rules, g = this._autoPlace, p = this._translate, s = {};
80
+ if (n.type === "label")
81
+ return s;
82
+ const u = n.businessObject;
83
+ function f(d, S) {
84
+ r.start(d, S);
85
85
  }
86
- function O() {
87
- t.removeElements([i]);
86
+ function _() {
87
+ t.removeElements([n]);
88
88
  }
89
- function C(b) {
90
- const g = o.getContainer(), w = e.getPad(b).html, $ = g.getBoundingClientRect(), M = w.getBoundingClientRect(), D = M.top - $.top;
89
+ function A(d) {
90
+ const b = o.getContainer(), x = e.getPad(d).html, I = b.getBoundingClientRect(), D = x.getBoundingClientRect(), B = D.top - I.top;
91
91
  return {
92
- x: M.left - $.left,
93
- y: D + M.height + 5
92
+ x: D.left - I.left,
93
+ y: B + D.height + 5
94
94
  };
95
95
  }
96
- function f(b, S, g, w) {
97
- typeof g != "string" && (w = g, g = m("Append {type}", { type: b.replace(/^bpmn:/, "") }));
98
- function $(D, B) {
99
- const R = n.createShape(y({ type: b }, w));
100
- a.start(D, R, {
101
- source: B
96
+ function c(d, S, b, x) {
97
+ typeof b != "string" && (x = b, b = p("Append {type}", { type: d.replace(/^bpmn:/, "") }));
98
+ function I(B, O) {
99
+ const F = i.createShape(y({ type: d }, x));
100
+ a.start(B, F, {
101
+ source: O
102
102
  });
103
103
  }
104
104
  return {
105
105
  group: "model",
106
106
  className: S,
107
- title: g,
107
+ title: b,
108
108
  action: {
109
- dragstart: $,
110
- click: E ? function(D, B) {
111
- const R = n.createShape(y({ type: b }, w));
112
- E.append(B, R);
113
- } : $
109
+ dragstart: I,
110
+ click: g ? function(B, O) {
111
+ const F = i.createShape(y({ type: d }, x));
112
+ g.append(O, F);
113
+ } : I
114
114
  }
115
115
  };
116
116
  }
117
- function P(b) {
118
- return function(S, g) {
119
- t.splitLane(g, b), e.open(g, !0);
117
+ function M(d) {
118
+ return function(S, b) {
119
+ t.splitLane(b, d), e.open(b, !0);
120
120
  };
121
121
  }
122
- if (G(u, ["bpmn:Lane", "bpmn:Participant"]) && Le(u)) {
123
- const b = Pe(i);
124
- y(l, {
122
+ if (z(u, ["bpmn:Lane", "bpmn:Participant"]) && Te(u)) {
123
+ const d = xe(n);
124
+ y(s, {
125
125
  "lane-insert-above": {
126
126
  group: "lane-insert-above",
127
127
  className: "bpmn-icon-lane-insert-above",
128
- title: m("Add Lane above"),
128
+ title: p("Add Lane above"),
129
129
  action: {
130
- click: function(S, g) {
131
- t.addLane(g, "top");
130
+ click: function(S, b) {
131
+ t.addLane(b, "top");
132
132
  }
133
133
  }
134
134
  }
135
- }), b.length < 2 && (i.height >= 120 && y(l, {
135
+ }), d.length < 2 && (n.height >= 120 && y(s, {
136
136
  "lane-divide-two": {
137
137
  group: "lane-divide",
138
138
  className: "bpmn-icon-lane-divide-two",
139
- title: m("Divide into two Lanes"),
139
+ title: p("Divide into two Lanes"),
140
140
  action: {
141
- click: P(2)
141
+ click: M(2)
142
142
  }
143
143
  }
144
- }), i.height >= 180 && y(l, {
144
+ }), n.height >= 180 && y(s, {
145
145
  "lane-divide-three": {
146
146
  group: "lane-divide",
147
147
  className: "bpmn-icon-lane-divide-three",
148
- title: m("Divide into three Lanes"),
148
+ title: p("Divide into three Lanes"),
149
149
  action: {
150
- click: P(3)
150
+ click: M(3)
151
151
  }
152
152
  }
153
- })), y(l, {
153
+ })), y(s, {
154
154
  "lane-insert-below": {
155
155
  group: "lane-insert-below",
156
156
  className: "bpmn-icon-lane-insert-below",
157
- title: m("Add Lane below"),
157
+ title: p("Add Lane below"),
158
158
  action: {
159
- click: function(S, g) {
160
- t.addLane(g, "bottom");
159
+ click: function(S, b) {
160
+ t.addLane(b, "bottom");
161
161
  }
162
162
  }
163
163
  }
164
164
  });
165
165
  }
166
- V(u, "bpmn:FlowNode") && (V(u, "bpmn:EventBasedGateway") ? y(l, {
167
- "append.receive-task": f("bpmn:ReceiveTask", "bpmn-icon-receive-task", m("Append ReceiveTask")),
168
- "append.message-intermediate-event": f(
166
+ R(u, "bpmn:FlowNode") && (R(u, "bpmn:EventBasedGateway") ? y(s, {
167
+ "append.receive-task": c("bpmn:ReceiveTask", "bpmn-icon-receive-task", p("Append ReceiveTask")),
168
+ "append.message-intermediate-event": c(
169
169
  "bpmn:IntermediateCatchEvent",
170
170
  "bpmn-icon-intermediate-event-catch-message",
171
- m("Append MessageIntermediateCatchEvent"),
171
+ p("Append MessageIntermediateCatchEvent"),
172
172
  { eventDefinitionType: "bpmn:MessageEventDefinition" }
173
173
  ),
174
- "append.timer-intermediate-event": f(
174
+ "append.timer-intermediate-event": c(
175
175
  "bpmn:IntermediateCatchEvent",
176
176
  "bpmn-icon-intermediate-event-catch-timer",
177
- m("Append TimerIntermediateCatchEvent"),
177
+ p("Append TimerIntermediateCatchEvent"),
178
178
  { eventDefinitionType: "bpmn:TimerEventDefinition" }
179
179
  ),
180
- "append.condition-intermediate-event": f(
180
+ "append.condition-intermediate-event": c(
181
181
  "bpmn:IntermediateCatchEvent",
182
182
  "bpmn-icon-intermediate-event-catch-condition",
183
- m("Append ConditionIntermediateCatchEvent"),
183
+ p("Append ConditionIntermediateCatchEvent"),
184
184
  { eventDefinitionType: "bpmn:ConditionalEventDefinition" }
185
185
  ),
186
- "append.signal-intermediate-event": f(
186
+ "append.signal-intermediate-event": c(
187
187
  "bpmn:IntermediateCatchEvent",
188
188
  "bpmn-icon-intermediate-event-catch-signal",
189
- m("Append SignalIntermediateCatchEvent"),
189
+ p("Append SignalIntermediateCatchEvent"),
190
190
  { eventDefinitionType: "bpmn:SignalEventDefinition" }
191
191
  )
192
- }) : re(u, "bpmn:BoundaryEvent", "bpmn:CompensateEventDefinition") ? y(l, {
193
- "append.compensation-activity": f("bpmn:Task", "bpmn-icon-task", m("Append compensation activity"), {
192
+ }) : ie(u, "bpmn:BoundaryEvent", "bpmn:CompensateEventDefinition") ? y(s, {
193
+ "append.compensation-activity": c("bpmn:Task", "bpmn-icon-task", p("Append compensation activity"), {
194
194
  isForCompensation: !0
195
195
  })
196
- }) : !V(u, "bpmn:EndEvent") && !u.isForCompensation && !re(u, "bpmn:IntermediateThrowEvent", "bpmn:LinkEventDefinition") && !Oe(u) && y(l, {
197
- "append.end-event": f("bpmn:EndEvent", "bpmn-icon-end-event-none", m("Append EndEvent")),
198
- "append.gateway": f("bpmn:ExclusiveGateway", "bpmn-icon-gateway-none", m("Append Gateway")),
199
- "append.append-task": f("bpmn:UserTask", "bpmn-icon-user-task", m("Append Task")),
200
- "append.intermediate-event": f(
196
+ }) : !R(u, "bpmn:EndEvent") && !u.isForCompensation && !ie(u, "bpmn:IntermediateThrowEvent", "bpmn:LinkEventDefinition") && !Ce(u) && y(s, {
197
+ "append.end-event": c("bpmn:EndEvent", "bpmn-icon-end-event-none", p("Append EndEvent")),
198
+ "append.gateway": c("bpmn:ExclusiveGateway", "bpmn-icon-gateway-none", p("Append Gateway")),
199
+ "append.append-task": c("bpmn:UserTask", "bpmn-icon-user-task", p("Append Task")),
200
+ "append.intermediate-event": c(
201
201
  "bpmn:IntermediateThrowEvent",
202
202
  "bpmn-icon-intermediate-event-none",
203
- m("Append Intermediate/Boundary Event")
203
+ p("Append Intermediate/Boundary Event")
204
204
  )
205
- })), r.isEmpty(i, "bpmn-replace") || y(l, {
205
+ })), l.isEmpty(n, "bpmn-replace") || y(s, {
206
206
  replace: {
207
207
  group: "edit",
208
208
  className: "bpmn-icon-screw-wrench",
209
- title: m("Change type"),
209
+ title: p("Change type"),
210
210
  action: {
211
- click: function(b, S) {
212
- const g = y(C(S), {
213
- cursor: { x: b.x, y: b.y }
211
+ click: function(d, S) {
212
+ const b = y(A(S), {
213
+ cursor: { x: d.x, y: d.y }
214
214
  });
215
- r.open(S, "bpmn-replace", g);
215
+ l.open(S, "bpmn-replace", b);
216
216
  }
217
217
  }
218
218
  }
219
- }), G(u, ["bpmn:FlowNode", "bpmn:InteractionNode", "bpmn:DataObjectReference", "bpmn:DataStoreReference"]) && y(l, {
220
- "append.text-annotation": f("bpmn:TextAnnotation", "bpmn-icon-text-annotation"),
219
+ }), z(u, ["bpmn:FlowNode", "bpmn:InteractionNode", "bpmn:DataObjectReference", "bpmn:DataStoreReference"]) && y(s, {
220
+ "append.text-annotation": c("bpmn:TextAnnotation", "bpmn-icon-text-annotation"),
221
221
  connect: {
222
222
  group: "connect",
223
223
  className: "bpmn-icon-connection-multi",
224
- title: m(`Connect using ${u.isForCompensation ? "" : "Sequence/MessageFlow or "}Association`),
224
+ title: p(`Connect using ${u.isForCompensation ? "" : "Sequence/MessageFlow or "}Association`),
225
225
  action: {
226
- click: F,
227
- dragstart: F
226
+ click: f,
227
+ dragstart: f
228
228
  }
229
229
  }
230
- }), G(u, ["bpmn:DataObjectReference", "bpmn:DataStoreReference"]) && y(l, {
230
+ }), z(u, ["bpmn:DataObjectReference", "bpmn:DataStoreReference"]) && y(s, {
231
231
  connect: {
232
232
  group: "connect",
233
233
  className: "bpmn-icon-connection-multi",
234
- title: m("Connect using DataInputAssociation"),
234
+ title: p("Connect using DataInputAssociation"),
235
235
  action: {
236
- click: F,
237
- dragstart: F
236
+ click: f,
237
+ dragstart: f
238
238
  }
239
239
  }
240
- }), V(u, "bpmn:Group") && y(l, {
241
- "append.text-annotation": f("bpmn:TextAnnotation", "bpmn-icon-text-annotation")
240
+ }), R(u, "bpmn:Group") && y(s, {
241
+ "append.text-annotation": c("bpmn:TextAnnotation", "bpmn-icon-text-annotation")
242
242
  });
243
- let I = p.allowed("elements.delete", { elements: [i] });
244
- return _e(I) && (I = I[0] === i), I && y(l, {
243
+ let h = m.allowed("elements.delete", { elements: [n] });
244
+ return Se(h) && (h = h[0] === n), h && y(s, {
245
245
  delete: {
246
246
  group: "edit",
247
247
  className: "bpmn-icon-trash",
248
- title: m("Remove"),
248
+ title: p("Remove"),
249
249
  action: {
250
- click: O
250
+ click: _
251
251
  }
252
252
  }
253
- }), l;
253
+ }), s;
254
254
  };
255
- function re(i, e, t) {
256
- const n = i.$instanceOf(e);
257
- let s = !1;
258
- const a = i.eventDefinitions || [];
259
- return Ae(a, function(r) {
260
- r.$type === t && (s = !0);
261
- }), n && s;
255
+ function ie(n, e, t) {
256
+ const i = n.$instanceOf(e);
257
+ let r = !1;
258
+ const a = n.eventDefinitions || [];
259
+ return Ae(a, function(l) {
260
+ l.$type === t && (r = !0);
261
+ }), i && r;
262
262
  }
263
- const Ke = {
263
+ const Fe = {
264
264
  __init__: ["contextPadProvider"],
265
265
  contextPadProvider: ["type", Z]
266
266
  };
267
- function L(i, e, t, n, s, a, r, o, p) {
268
- ue.call(this, i, e, t, n, s, a, r, o, p, 2e3), this._create = e, this._elementFactory = t, this._spaceTool = n, this._lassoTool = s, this._handTool = a, this._globalConnect = r, this._moddle = o, this._translate = p;
267
+ function k(n, e, t, i, r, a, l, o, m) {
268
+ le.call(this, n, e, t, i, r, a, l, o, m, 2e3), this._create = e, this._elementFactory = t, this._spaceTool = i, this._lassoTool = r, this._handTool = a, this._globalConnect = l, this._moddle = o, this._translate = m;
269
269
  }
270
270
  const H = function() {
271
271
  };
272
- H.prototype = ue.prototype;
272
+ H.prototype = le.prototype;
273
273
  H.prototype.getPaletteEntries = function() {
274
- const i = {}, e = this._create, t = this._elementFactory, n = this._spaceTool, s = this._lassoTool, a = this._handTool, r = this._globalConnect, o = this._translate;
275
- function p(l, u, F, O, C) {
276
- function f(I) {
277
- const b = t.createShape(y({ type: l }, C));
278
- l === "bpmn:UserTask" && (b.businessObject.candidateUsers = "${handlers}"), e.start(I, b);
274
+ const n = {}, e = this._create, t = this._elementFactory, i = this._spaceTool, r = this._lassoTool, a = this._handTool, l = this._globalConnect, o = this._translate;
275
+ function m(s, u, f, _, A) {
276
+ function c(h) {
277
+ const d = t.createShape(y({ type: s }, A));
278
+ s === "bpmn:UserTask" && (d.businessObject.candidateUsers = "${handlers}"), e.start(h, d);
279
279
  }
280
- const P = l.replace(/^bpmn:/, "");
280
+ const M = s.replace(/^bpmn:/, "");
281
281
  return {
282
282
  group: u,
283
- className: F,
284
- title: O || o("Create {type}", { type: P }),
283
+ className: f,
284
+ title: _ || o("Create {type}", { type: M }),
285
285
  action: {
286
- dragstart: f,
287
- click: f
286
+ dragstart: c,
287
+ click: c
288
288
  }
289
289
  };
290
290
  }
291
- function E(l) {
291
+ function g(s) {
292
292
  const u = t.createShape({
293
293
  type: "bpmn:SubProcess",
294
294
  x: 0,
295
295
  y: 0,
296
296
  isExpanded: !0
297
- }), F = t.createShape({
297
+ }), f = t.createShape({
298
298
  type: "bpmn:StartEvent",
299
299
  x: 40,
300
300
  y: 82,
301
301
  parent: u
302
302
  });
303
- e.start(l, [u, F], {
303
+ e.start(s, [u, f], {
304
304
  hints: {
305
- autoSelect: [F]
305
+ autoSelect: [f]
306
306
  }
307
307
  });
308
308
  }
309
- function m(l) {
310
- e.start(l, t.createParticipantShape());
309
+ function p(s) {
310
+ e.start(s, t.createParticipantShape());
311
311
  }
312
- return y(i, {
312
+ return y(n, {
313
313
  "hand-tool": {
314
314
  group: "tools",
315
315
  className: "bpmn-icon-hand-tool",
316
316
  title: o("Activate the hand tool"),
317
317
  action: {
318
- click: function(l) {
319
- a.activateHand(l);
318
+ click: function(s) {
319
+ a.activateHand(s);
320
320
  }
321
321
  }
322
322
  },
@@ -325,8 +325,8 @@ H.prototype.getPaletteEntries = function() {
325
325
  className: "bpmn-icon-lasso-tool",
326
326
  title: o("Activate the lasso tool"),
327
327
  action: {
328
- click: function(l) {
329
- s.activateSelection(l);
328
+ click: function(s) {
329
+ r.activateSelection(s);
330
330
  }
331
331
  }
332
332
  },
@@ -335,8 +335,8 @@ H.prototype.getPaletteEntries = function() {
335
335
  className: "bpmn-icon-space-tool",
336
336
  title: o("Activate the create/remove space tool"),
337
337
  action: {
338
- click: function(l) {
339
- n.activateSelection(l);
338
+ click: function(s) {
339
+ i.activateSelection(s);
340
340
  }
341
341
  }
342
342
  },
@@ -345,22 +345,22 @@ H.prototype.getPaletteEntries = function() {
345
345
  className: "bpmn-icon-connection-multi",
346
346
  title: o("Activate the global connect tool"),
347
347
  action: {
348
- click: function(l) {
349
- r.toggle(l);
348
+ click: function(s) {
349
+ l.toggle(s);
350
350
  }
351
351
  }
352
352
  },
353
353
  "tool-separator": { group: "tools", separator: !0 },
354
- "create.start-event": p("bpmn:StartEvent", "event", "bpmn-icon-start-event-none", o("Create StartEvent")),
355
- "create.intermediate-event": p(
354
+ "create.start-event": m("bpmn:StartEvent", "event", "bpmn-icon-start-event-none", o("Create StartEvent")),
355
+ "create.intermediate-event": m(
356
356
  "bpmn:IntermediateThrowEvent",
357
357
  "event",
358
358
  "bpmn-icon-intermediate-event-none",
359
359
  o("Create Intermediate/Boundary Event")
360
360
  ),
361
- "create.user-task": p("bpmn:UserTask", "activity", "bpmn-icon-user-task", o("Create User Task")),
362
- "create.exclusive-gateway": p("bpmn:ExclusiveGateway", "activity", "bpmn-icon-gateway-none", o("Create Gateway")),
363
- "create.end-event": p("bpmn:EndEvent", "activity", "bpmn-icon-end-event-none", o("Create EndEvent")),
361
+ "create.user-task": m("bpmn:UserTask", "activity", "bpmn-icon-user-task", o("Create User Task")),
362
+ "create.exclusive-gateway": m("bpmn:ExclusiveGateway", "activity", "bpmn-icon-gateway-none", o("Create Gateway")),
363
+ "create.end-event": m("bpmn:EndEvent", "activity", "bpmn-icon-end-event-none", o("Create EndEvent")),
364
364
  // 'create.sql-task': createAction('user:MySql', 'activity', 'bpmn-icon-mysql', 'MySQL 节点'),
365
365
  // 'create.data-object': createAction('bpmn:DataObjectReference', 'data-object', 'bpmn-icon-data-object', translate('Create DataObjectReference')),
366
366
  // 'create.data-store': createAction('bpmn:DataStoreReference', 'data-store', 'bpmn-icon-data-store', translate('Create DataStoreReference')),
@@ -370,8 +370,8 @@ H.prototype.getPaletteEntries = function() {
370
370
  className: "bpmn-icon-subprocess-expanded",
371
371
  title: o("Create expanded SubProcess"),
372
372
  action: {
373
- dragstart: E,
374
- click: E
373
+ dragstart: g,
374
+ click: g
375
375
  }
376
376
  },
377
377
  "create.participant-expanded": {
@@ -379,1758 +379,121 @@ H.prototype.getPaletteEntries = function() {
379
379
  className: "bpmn-icon-participant",
380
380
  title: o("Create Pool/Participant"),
381
381
  action: {
382
- dragstart: m,
383
- click: m
382
+ dragstart: p,
383
+ click: p
384
384
  }
385
385
  }
386
386
  // 'create.group': createAction('bpmn:Group', 'artifact', 'bpmn-icon-group', translate('Create Group'))
387
- }), i;
387
+ }), n;
388
388
  };
389
- L.$inject = ["palette", "create", "elementFactory", "spaceTool", "lassoTool", "handTool", "globalConnect", "moddle", "translate"];
390
- L.prototype = new H();
391
- L.prototype.constructor = L;
392
- const Je = {
389
+ k.$inject = ["palette", "create", "elementFactory", "spaceTool", "lassoTool", "handTool", "globalConnect", "moddle", "translate"];
390
+ k.prototype = new H();
391
+ k.prototype.constructor = k;
392
+ const Le = {
393
393
  __init__: ["customPalette"],
394
- customPalette: ["type", L]
394
+ customPalette: ["type", k]
395
395
  };
396
- function fe(i, e) {
397
- J.call(this, i, e, 3e3), i.on("autoPlace", 3e3, function(t) {
398
- const n = t.shape, s = t.source;
399
- return Xe(s, n);
400
- }), this.append = function(t, n, s) {
401
- i.fire("autoPlace.start", {
396
+ function me(n, e) {
397
+ j.call(this, n, e, 3e3), n.on("autoPlace", 3e3, function(t) {
398
+ const i = t.shape, r = t.source;
399
+ return Ne(r, i);
400
+ }), this.append = function(t, i, r) {
401
+ n.fire("autoPlace.start", {
402
402
  source: t,
403
- shape: n
403
+ shape: i
404
404
  });
405
- const a = i.fire("autoPlace", {
405
+ const a = n.fire("autoPlace", {
406
406
  source: t,
407
- shape: n
407
+ shape: i
408
408
  });
409
- console.log("hints", s, "position", a);
410
- const r = e.appendShape(t, n, a, t.parent, s);
411
- return i.fire("autoPlace.end", {
409
+ console.log("hints", r, "position", a);
410
+ const l = e.appendShape(t, i, a, t.parent, r);
411
+ return n.fire("autoPlace.end", {
412
412
  source: t,
413
- shape: r
414
- }), r;
413
+ shape: l
414
+ }), l;
415
415
  };
416
416
  }
417
- function Ze(i) {
417
+ function Re(n) {
418
418
  return {
419
- top: i.y,
420
- right: i.x + (i.width || 0),
421
- bottom: i.y + (i.height || 0),
422
- left: i.x
419
+ top: n.y,
420
+ right: n.x + (n.width || 0),
421
+ bottom: n.y + (n.height || 0),
422
+ left: n.x
423
423
  };
424
424
  }
425
- function He(i) {
425
+ function $e(n) {
426
426
  return {
427
- x: Math.round(i.x),
428
- y: Math.round(i.y)
427
+ x: Math.round(n.x),
428
+ y: Math.round(n.y)
429
429
  };
430
430
  }
431
- function We(i) {
432
- return He({
433
- x: i.x + (i.width || 0) / 2,
434
- y: i.y + (i.height || 0) / 2
431
+ function Ve(n) {
432
+ return $e({
433
+ x: n.x + (n.width || 0) / 2,
434
+ y: n.y + (n.height || 0) / 2
435
435
  });
436
436
  }
437
- function Xe(i, e, t) {
437
+ function Ne(n, e, t) {
438
438
  t || (t = {});
439
- const n = t.defaultDistance || 50, s = We(i), a = Ze(i);
439
+ const i = t.defaultDistance || 50, r = Ve(n), a = Re(n);
440
440
  return {
441
- x: s.x,
442
- y: a.bottom + n + e.height / 2
441
+ x: r.x,
442
+ y: a.bottom + i + e.height / 2
443
443
  };
444
444
  }
445
- const be = function() {
445
+ const ue = function() {
446
446
  };
447
- be.prototype = J.prototype;
448
- fe.prototype = new be();
449
- fe.prototype.constructor = J;
450
- const Ye = 200, Qe = 100;
451
- function ye(i, e, t) {
452
- i.on("autoPlace", Qe, function(n) {
453
- const s = n.shape, a = n.source;
454
- return et(a, s);
455
- }), i.on("autoPlace.end", function(n) {
456
- t.scrollToElement(n.shape);
457
- }), this.append = function(n, s, a) {
458
- i.fire("autoPlace.start", {
459
- source: n,
460
- shape: s
447
+ ue.prototype = j.prototype;
448
+ me.prototype = new ue();
449
+ me.prototype.constructor = j;
450
+ const ze = 200, Ue = 100;
451
+ function ce(n, e, t) {
452
+ n.on("autoPlace", Ue, function(i) {
453
+ const r = i.shape, a = i.source;
454
+ return Ge(a, r);
455
+ }), n.on("autoPlace.end", function(i) {
456
+ t.scrollToElement(i.shape);
457
+ }), this.append = function(i, r, a) {
458
+ n.fire("autoPlace.start", {
459
+ source: i,
460
+ shape: r
461
461
  });
462
- const r = i.fire("autoPlace", {
463
- source: n,
464
- shape: s
465
- }), o = e.appendShape(n, s, r, n.parent, a);
466
- return i.fire("autoPlace.end", {
467
- source: n,
462
+ const l = n.fire("autoPlace", {
463
+ source: i,
464
+ shape: r
465
+ }), o = e.appendShape(i, r, l, i.parent, a);
466
+ return n.fire("autoPlace.end", {
467
+ source: i,
468
468
  shape: o
469
469
  }), o;
470
470
  };
471
471
  }
472
- ye.$inject = ["eventBus", "modeling", "canvas"];
473
- function et(i, e) {
474
- const t = Ye, n = De(i);
472
+ ce.$inject = ["eventBus", "modeling", "canvas"];
473
+ function Ge(n, e) {
474
+ const t = ze, i = Pe(n);
475
475
  return {
476
- x: Be(i).right + t + e.width / 2,
477
- y: n.y
476
+ x: we(n).right + t + e.width / 2,
477
+ y: i.y
478
478
  };
479
479
  }
480
- const tt = {
480
+ const je = {
481
481
  __init__: ["autoPlaceSelectionBehavior"],
482
- autoPlace: ["type", ye]
483
- };
484
- function he(i, e, t, n) {
485
- const s = /* @__PURE__ */ Object.create(null);
486
- switch (s.event = e.event, t && (s.id = e.id), e.listenerType) {
487
- case "scriptListener":
488
- s.script = it(i, e, n);
489
- break;
490
- case "expressionListener":
491
- s.expression = e.expression;
492
- break;
493
- case "delegateExpressionListener":
494
- s.delegateExpression = e.delegateExpression;
495
- break;
496
- default:
497
- s.class = e.class;
498
- }
499
- if (e.fields && (s.fields = e.fields.map((a) => nt(i, a, n))), t && e.event === "timeout" && e.eventDefinitionType) {
500
- const a = i.moddle.create("bpmn:FormalExpression", {
501
- body: e.eventTimeDefinitions
502
- }), r = i.moddle.create("bpmn:TimerEventDefinition", {
503
- id: `TimerEventDefinition_${st(8)}`,
504
- [`time${e.eventDefinitionType.replace(/^\S/, (o) => o.toUpperCase())}`]: a
505
- });
506
- s.eventDefinitions = [r];
507
- }
508
- return i.moddle.create(`${n}:${t ? "TaskListener" : "ExecutionListener"}`, s);
509
- }
510
- function nt(i, e, t) {
511
- const { name: n, fieldType: s, string: a, expression: r } = e, o = s === "string" ? { name: n, string: a } : { name: n, expression: r };
512
- return i.moddle.create(`${t}:Field`, o);
513
- }
514
- function it(i, e, t) {
515
- const { scriptType: n, scriptFormat: s, value: a, resource: r } = e, o = n === "inlineScript" ? { scriptFormat: s, value: a } : { scriptFormat: s, resource: r };
516
- return i.moddle.create(`${t}:Script`, o);
517
- }
518
- function U(i, e, t) {
519
- const n = i.moddle.create("bpmn:ExtensionElements", {
520
- values: t
521
- });
522
- i.modeling.updateProperties(e, {
523
- extensionElements: n
524
- });
525
- }
526
- function st(i = 8, e) {
527
- let t = "";
528
- const n = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
529
- for (let s = i; s > 0; --s)
530
- t += n[Math.floor(Math.random() * n.length)];
531
- return t;
532
- }
533
- const ae = (i, e = "body") => i ? i.get(e) : null, oe = (i, e, t = "body", n) => {
534
- rt(i, e, { [t]: n });
535
- }, rt = ({ modeling: i }, e, t) => {
536
- i.updateProperties(e, t);
537
- }, at = {
538
- name: "ElementBaseInfo",
539
- inject: {
540
- prefix: "prefix",
541
- width: "width"
542
- },
543
- props: {
544
- id: String,
545
- idEditDisabled: {
546
- type: Boolean,
547
- default: !0
548
- },
549
- element: Object,
550
- bpmnInstances: Object
551
- },
552
- data() {
553
- return {
554
- skipExpression: "",
555
- businessObject: {},
556
- attrs: {
557
- commentInForm: null,
558
- commentOrder: null,
559
- commentNodeIds: null,
560
- commentLabel: null
561
- },
562
- nodes: []
563
- };
564
- },
565
- watch: {
566
- id: "init"
567
- },
568
- methods: {
569
- init(i) {
570
- const e = this.bpmnInstances.elementRegistry.filter((n) => n.type === "bpmn:UserTask");
571
- this.nodes = e.map(({ businessObject: { id: n, name: s } }) => ({ label: s, value: n }));
572
- const { businessObject: t } = this.element;
573
- if (i ? (this.businessObject = v(t), this.businessObject.$type === "bpmn:SubProcess" && this.$set(this.businessObject, "isExpanded", this.element.di.isExpanded)) : this.businessObject = {}, this.businessObject.$type === "bpmn:UserTask")
574
- for (const n in this.attrs) {
575
- let s = ae(t, `${this.prefix}:${n}`);
576
- n === "commentNodeIds" && (s = s ? s.split(",") : []), this.attrs[n] = s;
577
- }
578
- this.skipExpression = ae(t, `${this.prefix}:skipExpression`);
579
- },
580
- updateBaseInfo(i) {
581
- const { modeling: e } = this.bpmnInstances;
582
- if (i === "id") {
583
- e.updateProperties(this.element, {
584
- id: this.businessObject[i],
585
- di: { id: `${this.businessObject[i]}_di` }
586
- });
587
- return;
588
- }
589
- if (i === "isExpanded") {
590
- e.toggleCollapse(this.element);
591
- return;
592
- }
593
- e.updateProperties(this.element, { [i]: this.businessObject[i] });
594
- },
595
- updateProp(i, e) {
596
- if (i === "commentInForm" && !e)
597
- for (const t in this.attrs)
598
- t !== "commentInForm" && (this.attrs[t] = null, oe(this.bpmnInstances, this.element, `${this.prefix}:${t}`, this.attrs[t]));
599
- i === "commentNodeIds" ? e = e != null && e.length ? e.join(",") : null : e = e || null, oe(this.bpmnInstances, this.element, `${this.prefix}:${i}`, e);
600
- }
601
- }
602
- };
603
- var ot = function() {
604
- var e = this, t = e._self._c;
605
- return t("div", { staticClass: "panel-tab__content" }, [t("ElForm", { attrs: { size: "mini", "label-width": "90px" }, nativeOn: { submit: function(n) {
606
- n.preventDefault();
607
- } } }, [t("ElFormItem", { attrs: { label: "ID" } }, [t("ElInput", { attrs: { disabled: e.idEditDisabled, clearable: "" }, on: { input: function(n) {
608
- return e.updateBaseInfo("id");
609
- } }, model: { value: e.businessObject.id, callback: function(n) {
610
- e.$set(e.businessObject, "id", n);
611
- }, expression: "businessObject.id" } })], 1), t("ElFormItem", { attrs: { label: "名称" } }, [t("ElInput", { attrs: { clearable: "" }, on: { input: function(n) {
612
- return e.updateBaseInfo("name");
613
- } }, model: { value: e.businessObject.name, callback: function(n) {
614
- e.$set(e.businessObject, "name", n);
615
- }, expression: "businessObject.name" } })], 1), e.businessObject.$type === "bpmn:UserTask" ? [t("ElFormItem", { attrs: { label: "跳过表达式" } }, [t("ElInput", { attrs: { clearable: "" }, on: { input: (n) => e.updateProp("skipExpression", n) }, model: { value: e.skipExpression, callback: function(n) {
616
- e.skipExpression = n;
617
- }, expression: "skipExpression" } })], 1), t("ElFormItem", { attrs: { label: "意见在表单" } }, [t("ElSwitch", { attrs: { "active-text": "是", "inactive-text": "否" }, on: { input: (n) => e.updateProp("commentInForm", n) }, model: { value: e.attrs.commentInForm, callback: function(n) {
618
- e.$set(e.attrs, "commentInForm", n);
619
- }, expression: "attrs.commentInForm" } })], 1), e.attrs.commentInForm ? [t("ElFormItem", { attrs: { label: "意见名称" } }, [t("ElInput", { attrs: { clearable: "" }, on: { input: (n) => e.updateProp("commentLabel", n) }, model: { value: e.attrs.commentLabel, callback: function(n) {
620
- e.$set(e.attrs, "commentLabel", n);
621
- }, expression: "attrs.commentLabel" } })], 1), t("ElFormItem", { attrs: { label: "意见聚合" } }, [t("ElSelect", { attrs: { multiple: "", clearable: "" }, on: { input: (n) => e.updateProp("commentNodeIds", n) }, model: { value: e.attrs.commentNodeIds, callback: function(n) {
622
- e.$set(e.attrs, "commentNodeIds", n);
623
- }, expression: "attrs.commentNodeIds" } }, e._l(e.nodes, function(n) {
624
- return t("ElOption", { key: n.value, attrs: { label: n.label, value: n.value } });
625
- }), 1)], 1), t("ElFormItem", { attrs: { label: "意见排序号" } }, [t("ElInput", { attrs: { clearable: "" }, on: { input: (n) => e.updateProp("commentOrder", n) }, model: { value: e.attrs.commentOrder, callback: function(n) {
626
- e.$set(e.attrs, "commentOrder", n);
627
- }, expression: "attrs.commentOrder" } })], 1)] : e._e()] : e._e(), e.businessObject.$type === "bpmn:Process" ? [t("ElFormItem", { attrs: { label: "版本标签" } }, [t("ElInput", { attrs: { clearable: "" }, on: { input: function(n) {
628
- return e.updateBaseInfo("versionTag");
629
- } }, model: { value: e.businessObject.versionTag, callback: function(n) {
630
- e.$set(e.businessObject, "versionTag", n);
631
- }, expression: "businessObject.versionTag" } })], 1), t("ElFormItem", { attrs: { label: "可执行" } }, [t("ElSwitch", { attrs: { "active-text": "是", "inactive-text": "否" }, on: { input: function(n) {
632
- return e.updateBaseInfo("isExecutable");
633
- } }, model: { value: e.businessObject.isExecutable, callback: function(n) {
634
- e.$set(e.businessObject, "isExecutable", n);
635
- }, expression: "businessObject.isExecutable" } })], 1)] : e._e(), e.businessObject.$type === "bpmn:SubProcess" ? t("ElFormItem", { attrs: { label: "状态" } }, [t("ElSwitch", { attrs: { "active-text": "展开", "inactive-text": "折叠" }, on: { input: function(n) {
636
- return e.updateBaseInfo("isExpanded");
637
- } }, model: { value: e.businessObject.isExpanded, callback: function(n) {
638
- e.$set(e.businessObject, "isExpanded", n);
639
- }, expression: "businessObject.isExpanded" } })], 1) : e._e()], 2)], 1);
640
- }, lt = [], pt = /* @__PURE__ */ h(
641
- at,
642
- ot,
643
- lt,
644
- !1,
645
- null,
646
- null
647
- );
648
- const mt = pt.exports, ct = {
649
- name: "ElementOtherConfig",
650
- props: {
651
- id: String,
652
- element: Object,
653
- bpmnInstances: Object
654
- },
655
- data() {
656
- return {
657
- documentation: ""
658
- };
659
- },
660
- watch: {
661
- id: {
662
- immediate: !0,
663
- handler() {
664
- if (Re(this.element))
665
- this.documentation = "";
666
- else {
667
- const {
668
- businessObject: { documentation: i }
669
- } = this.element;
670
- this.documentation = (i == null ? void 0 : i[0].text) || "";
671
- }
672
- }
673
- }
674
- },
675
- methods: {
676
- updateDocumentation() {
677
- const { modeling: i } = this.bpmnInstances, {
678
- businessObject: { documentation: e }
679
- } = this.element;
680
- if (e != null && e.length)
681
- e[0].set("text", this.documentation), i.updateProperties(this.element, { documentation: e });
682
- else {
683
- const { bpmnFactory: t } = this.bpmnInstances, n = t.create("bpmn:Documentation", { text: this.documentation });
684
- i.updateProperties(this.element, { documentation: [n] });
685
- }
686
- }
687
- }
688
- };
689
- var ut = function() {
690
- var e = this, t = e._self._c;
691
- return t("div", { staticClass: "panel-tab__content" }, [t("div", { staticClass: "element-property input-property" }, [t("div", { staticClass: "element-property__label" }, [e._v("元素文档:")]), t("div", { staticClass: "element-property__value" }, [t("ElInput", { attrs: { type: "textarea", size: "mini", resize: "vertical", autosize: { minRows: 2, maxRows: 4 } }, on: { input: e.updateDocumentation }, model: { value: e.documentation, callback: function(n) {
692
- e.documentation = n;
693
- }, expression: "documentation" } })], 1)])]);
694
- }, dt = [], ft = /* @__PURE__ */ h(
695
- ct,
696
- ut,
697
- dt,
698
- !1,
699
- null,
700
- null
701
- );
702
- const bt = ft.exports, yt = {
703
- name: "UserTask",
704
- props: {
705
- id: String,
706
- element: Object,
707
- bpmnInstances: Object
708
- },
709
- data() {
710
- return {
711
- defaultTaskForm: {
712
- assignee: "",
713
- candidateUsers: [],
714
- candidateGroups: [],
715
- dueDate: "",
716
- followUpDate: "",
717
- priority: ""
718
- },
719
- userTaskForm: {},
720
- mockData: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
721
- };
722
- },
723
- watch: {
724
- id: {
725
- immediate: !0,
726
- handler() {
727
- this.$nextTick(() => this.resetTaskForm());
728
- }
729
- }
730
- },
731
- methods: {
732
- resetTaskForm() {
733
- const { businessObject: i } = this.element;
734
- for (const e in this.defaultTaskForm) {
735
- let t;
736
- ["candidateUsers", "candidateGroups"].includes(e) ? t = i[e] ? i[e].split(",") : [] : t = i[e] || this.defaultTaskForm[e], this.$set(this.userTaskForm, e, t);
737
- }
738
- },
739
- updateElementTask(i) {
740
- const e = {};
741
- i === "candidateUsers" || i === "candidateGroups" ? e[i] = this.userTaskForm[i] && this.userTaskForm[i].length ? this.userTaskForm[i].join() : null : e[i] = this.userTaskForm[i] || null, this.bpmnInstances.modeling.updateProperties(this.element, e);
742
- }
743
- }
744
- };
745
- var ht = function() {
746
- var e = this, t = e._self._c;
747
- return t("div", { staticStyle: { "margin-top": "16px" } }, [t("ElFormItem", { attrs: { label: "处理用户" } }, [t("ElSelect", { on: { change: function(n) {
748
- return e.updateElementTask("assignee");
749
- } }, model: { value: e.userTaskForm.assignee, callback: function(n) {
750
- e.$set(e.userTaskForm, "assignee", n);
751
- }, expression: "userTaskForm.assignee" } }, e._l(e.mockData, function(n) {
752
- return t("ElOption", { key: `ass-${n}`, attrs: { label: `用户${n}`, value: `user${n}` } });
753
- }), 1)], 1), t("ElFormItem", { attrs: { label: "候选用户" } }, [t("ElSelect", { attrs: { multiple: "", "collapse-tags": "" }, on: { change: function(n) {
754
- return e.updateElementTask("candidateUsers");
755
- } }, model: { value: e.userTaskForm.candidateUsers, callback: function(n) {
756
- e.$set(e.userTaskForm, "candidateUsers", n);
757
- }, expression: "userTaskForm.candidateUsers" } }, e._l(e.mockData, function(n) {
758
- return t("ElOption", { key: `user-${n}`, attrs: { label: `用户${n}`, value: `user${n}` } });
759
- }), 1)], 1), t("ElFormItem", { attrs: { label: "候选分组" } }, [t("ElSelect", { attrs: { multiple: "", "collapse-tags": "" }, on: { change: function(n) {
760
- return e.updateElementTask("candidateGroups");
761
- } }, model: { value: e.userTaskForm.candidateGroups, callback: function(n) {
762
- e.$set(e.userTaskForm, "candidateGroups", n);
763
- }, expression: "userTaskForm.candidateGroups" } }, e._l(e.mockData, function(n) {
764
- return t("ElOption", { key: `ass-${n}`, attrs: { label: `分组${n}`, value: `group${n}` } });
765
- }), 1)], 1), t("ElFormItem", { attrs: { label: "到期时间" } }, [t("ElInput", { attrs: { clearable: "" }, on: { change: function(n) {
766
- return e.updateElementTask("dueDate");
767
- } }, model: { value: e.userTaskForm.dueDate, callback: function(n) {
768
- e.$set(e.userTaskForm, "dueDate", n);
769
- }, expression: "userTaskForm.dueDate" } })], 1), t("ElFormItem", { attrs: { label: "跟踪时间" } }, [t("ElInput", { attrs: { clearable: "" }, on: { change: function(n) {
770
- return e.updateElementTask("followUpDate");
771
- } }, model: { value: e.userTaskForm.followUpDate, callback: function(n) {
772
- e.$set(e.userTaskForm, "followUpDate", n);
773
- }, expression: "userTaskForm.followUpDate" } })], 1), t("ElFormItem", { attrs: { label: "优先级" } }, [t("ElInput", { attrs: { clearable: "" }, on: { change: function(n) {
774
- return e.updateElementTask("priority");
775
- } }, model: { value: e.userTaskForm.priority, callback: function(n) {
776
- e.$set(e.userTaskForm, "priority", n);
777
- }, expression: "userTaskForm.priority" } })], 1)], 1);
778
- }, gt = [], vt = /* @__PURE__ */ h(
779
- yt,
780
- ht,
781
- gt,
782
- !1,
783
- null,
784
- null
785
- );
786
- const Et = vt.exports, Ft = {
787
- name: "ScriptTask",
788
- props: {
789
- id: String,
790
- element: Object,
791
- bpmnInstances: Object
792
- },
793
- data() {
794
- return {
795
- defaultTaskForm: {
796
- scriptFormat: "",
797
- script: "",
798
- resource: "",
799
- resultVariable: ""
800
- },
801
- scriptTaskForm: {}
802
- };
803
- },
804
- watch: {
805
- id: {
806
- immediate: !0,
807
- handler() {
808
- this.$nextTick(() => this.resetTaskForm());
809
- }
810
- }
811
- },
812
- methods: {
813
- resetTaskForm() {
814
- var i;
815
- for (const e in this.defaultTaskForm) {
816
- const t = ((i = this.element) == null ? void 0 : i.businessObject[e]) || this.defaultTaskForm[e];
817
- this.$set(this.scriptTaskForm, e, t);
818
- }
819
- this.$set(this.scriptTaskForm, "scriptType", this.scriptTaskForm.script ? "inline" : "external");
820
- },
821
- updateElementTask() {
822
- const i = /* @__PURE__ */ Object.create(null);
823
- i.scriptFormat = this.scriptTaskForm.scriptFormat || null, i.resultVariable = this.scriptTaskForm.resultVariable || null, this.scriptTaskForm.scriptType === "inline" ? (i.script = this.scriptTaskForm.script || null, i.resource = null) : (i.resource = this.scriptTaskForm.resource || null, i.script = null), this.bpmnInstances.modeling.updateProperties(this.element, i);
824
- }
825
- }
826
- };
827
- var xt = function() {
828
- var e = this, t = e._self._c;
829
- return t("div", { staticStyle: { "margin-top": "16px" } }, [t("ElFormItem", { attrs: { label: "脚本格式" } }, [t("ElInput", { attrs: { clearable: "" }, on: { input: function(n) {
830
- return e.updateElementTask();
831
- }, change: function(n) {
832
- return e.updateElementTask();
833
- } }, model: { value: e.scriptTaskForm.scriptFormat, callback: function(n) {
834
- e.$set(e.scriptTaskForm, "scriptFormat", n);
835
- }, expression: "scriptTaskForm.scriptFormat" } })], 1), t("ElFormItem", { attrs: { label: "脚本类型" } }, [t("ElSelect", { model: { value: e.scriptTaskForm.scriptType, callback: function(n) {
836
- e.$set(e.scriptTaskForm, "scriptType", n);
837
- }, expression: "scriptTaskForm.scriptType" } }, [t("ElOption", { attrs: { label: "内联脚本", value: "inline" } }), t("ElOption", { attrs: { label: "外部资源", value: "external" } })], 1)], 1), t("ElFormItem", { directives: [{ name: "show", rawName: "v-show", value: e.scriptTaskForm.scriptType === "inline", expression: "scriptTaskForm.scriptType === 'inline'" }], attrs: { label: "脚本" } }, [t("ElInput", { attrs: { type: "textarea", resize: "vertical", autosize: { minRows: 2, maxRows: 4 }, clearable: "" }, on: { input: function(n) {
838
- return e.updateElementTask();
839
- }, change: function(n) {
840
- return e.updateElementTask();
841
- } }, model: { value: e.scriptTaskForm.script, callback: function(n) {
842
- e.$set(e.scriptTaskForm, "script", n);
843
- }, expression: "scriptTaskForm.script" } })], 1), t("ElFormItem", { directives: [{ name: "show", rawName: "v-show", value: e.scriptTaskForm.scriptType === "external", expression: "scriptTaskForm.scriptType === 'external'" }], attrs: { label: "资源地址" } }, [t("ElInput", { attrs: { clearable: "" }, on: { input: function(n) {
844
- return e.updateElementTask();
845
- }, change: function(n) {
846
- return e.updateElementTask();
847
- } }, model: { value: e.scriptTaskForm.resource, callback: function(n) {
848
- e.$set(e.scriptTaskForm, "resource", n);
849
- }, expression: "scriptTaskForm.resource" } })], 1), t("ElFormItem", { attrs: { label: "结果变量" } }, [t("ElInput", { attrs: { clearable: "" }, on: { input: function(n) {
850
- return e.updateElementTask();
851
- }, change: function(n) {
852
- return e.updateElementTask();
853
- } }, model: { value: e.scriptTaskForm.resultVariable, callback: function(n) {
854
- e.$set(e.scriptTaskForm, "resultVariable", n);
855
- }, expression: "scriptTaskForm.resultVariable" } })], 1)], 1);
856
- }, St = [], Tt = /* @__PURE__ */ h(
857
- Ft,
858
- xt,
859
- St,
860
- !1,
861
- null,
862
- null
863
- );
864
- const Ct = Tt.exports, It = {
865
- name: "ReceiveTask",
866
- props: {
867
- id: String,
868
- element: Object,
869
- bpmnInstances: Object
870
- },
871
- data() {
872
- return {
873
- bindMessageId: "",
874
- newMessageForm: {},
875
- messageMap: {},
876
- messageModelVisible: !1
877
- };
878
- },
879
- watch: {
880
- id: {
881
- immediate: !0,
882
- handler() {
883
- this.$nextTick(() => this.getBindMessage());
884
- }
885
- }
886
- },
887
- created() {
888
- this.bpmnMessageRefsMap = /* @__PURE__ */ Object.create(null), this.bpmnRootElements = this.bpmnInstances.modeler.getDefinitions().rootElements, this.bpmnRootElements.filter((i) => i.$type === "bpmn:Message").forEach((i) => {
889
- this.bpmnMessageRefsMap[i.id] = i, this.$set(this.messageMap, i.id, i.name);
890
- }), this.$set(this.messageMap, "-1", "无");
891
- },
892
- methods: {
893
- getBindMessage() {
894
- var i, e;
895
- this.bindMessageId = ((e = (i = this.element.businessObject) == null ? void 0 : i.messageRef) == null ? void 0 : e.id) || "-1";
896
- },
897
- openMessageModel() {
898
- this.messageModelVisible = !0, this.newMessageForm = {};
899
- },
900
- createNewMessage() {
901
- if (this.messageMap[this.newMessageForm.id]) {
902
- this.$message.error("该消息已存在,请修改id后重新保存");
903
- return;
904
- }
905
- const i = this.bpmnInstances.moddle.create("bpmn:Message", this.newMessageForm);
906
- this.bpmnRootElements.push(i), this.$set(this.messageMap, this.newMessageForm.id, this.newMessageForm.name), this.bpmnMessageRefsMap[this.newMessageForm.id] = i, this.messageModelVisible = !1;
907
- },
908
- updateTaskMessage(i) {
909
- i === "-1" ? this.bpmnInstances.modeling.updateProperties(this.element, {
910
- messageRef: null
911
- }) : this.bpmnInstances.modeling.updateProperties(this.element, {
912
- messageRef: this.bpmnMessageRefsMap[i]
913
- });
914
- }
915
- }
916
- };
917
- var kt = function() {
918
- var e = this, t = e._self._c;
919
- return t("div", { staticStyle: { "margin-top": "16px" } }, [t("ElFormItem", { attrs: { label: "消息实例" } }, [t("div", { staticStyle: { display: "flex", "flex-wrap": "nowrap", "align-items": "center", "justify-content": "space-between" } }, [t("ElSelect", { on: { change: e.updateTaskMessage }, model: { value: e.bindMessageId, callback: function(n) {
920
- e.bindMessageId = n;
921
- }, expression: "bindMessageId" } }, e._l(Object.keys(e.messageMap), function(n) {
922
- return t("ElOption", { key: n, attrs: { value: n, label: e.messageMap[n] } });
923
- }), 1), t("ElButton", { staticStyle: { "margin-left": "8px" }, attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: e.openMessageModel } })], 1)]), t("ElementDialog", { staticClass: "flow-dialog", attrs: { visible: e.messageModelVisible, "close-on-click-modal": !1, title: "创建新消息", width: "400px", "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(n) {
924
- e.messageModelVisible = n;
925
- } }, scopedSlots: e._u([{ key: "footer", fn: function() {
926
- return [t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.createNewMessage } }, [e._v("确 认")])];
927
- }, proxy: !0 }]) }, [t("ElForm", { attrs: { model: e.newMessageForm, size: "mini", "label-width": "90px" }, nativeOn: { submit: function(n) {
928
- n.preventDefault();
929
- } } }, [t("ElFormItem", { attrs: { label: "消息ID" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.newMessageForm.id, callback: function(n) {
930
- e.$set(e.newMessageForm, "id", n);
931
- }, expression: "newMessageForm.id" } })], 1), t("ElFormItem", { attrs: { label: "消息名称" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.newMessageForm.name, callback: function(n) {
932
- e.$set(e.newMessageForm, "name", n);
933
- }, expression: "newMessageForm.name" } })], 1)], 1)], 1)], 1);
934
- }, _t = [], At = /* @__PURE__ */ h(
935
- It,
936
- kt,
937
- _t,
938
- !1,
939
- null,
940
- null
941
- );
942
- const wt = At.exports, $t = {
943
- name: "ElementTaskConfig",
944
- components: { UserTask: Et, ScriptTask: Ct, ReceiveTask: wt },
945
- props: {
946
- id: String,
947
- element: Object,
948
- bpmnInstances: Object,
949
- type: String
950
- },
951
- data() {
952
- return {
953
- taskConfigForm: {
954
- asyncAfter: !1,
955
- asyncBefore: !1,
956
- exclusive: !1
957
- },
958
- witchTaskComponent: "",
959
- installedComponent: {
960
- // 手工任务与普通任务一致,不需要其他配置
961
- // 接收消息任务,需要在全局下插入新的消息实例,并在该节点下的 messageRef 属性绑定该实例
962
- // 发送任务、服务任务、业务规则任务共用一个相同配置
963
- UserTask: "UserTask",
964
- // 用户任务配置
965
- ScriptTask: "ScriptTask",
966
- // 脚本任务配置
967
- ReceiveTask: "ReceiveTask"
968
- // 消息接收任务
969
- }
970
- };
971
- },
972
- watch: {
973
- id: {
974
- immediate: !0,
975
- handler() {
976
- var i, e, t, n, s, a;
977
- this.taskConfigForm.asyncBefore = (e = (i = this.element) == null ? void 0 : i.businessObject) == null ? void 0 : e.asyncBefore, this.taskConfigForm.asyncAfter = (n = (t = this.element) == null ? void 0 : t.businessObject) == null ? void 0 : n.asyncAfter, this.taskConfigForm.exclusive = (a = (s = this.element) == null ? void 0 : s.businessObject) == null ? void 0 : a.exclusive;
978
- }
979
- },
980
- type: {
981
- immediate: !0,
982
- handler() {
983
- this.witchTaskComponent = this.installedComponent[this.type];
984
- }
985
- }
986
- },
987
- methods: {
988
- changeTaskAsync() {
989
- !this.taskConfigForm.asyncBefore && !this.taskConfigForm.asyncAfter && (this.taskConfigForm.exclusive = !1), this.bpmnInstances.modeling.updateProperties(this.element, d({}, this.taskConfigForm));
990
- }
991
- }
992
- };
993
- var Lt = function() {
994
- var e = this, t = e._self._c;
995
- return t("div", { staticClass: "panel-tab__content" }, [t("ElForm", { attrs: { size: "mini", "label-width": "90px" }, nativeOn: { submit: function(n) {
996
- n.preventDefault();
997
- } } }, [t("ElFormItem", { attrs: { label: "异步延续" } }, [t("ElCheckbox", { attrs: { label: "异步前" }, on: { change: e.changeTaskAsync }, model: { value: e.taskConfigForm.asyncBefore, callback: function(n) {
998
- e.$set(e.taskConfigForm, "asyncBefore", n);
999
- }, expression: "taskConfigForm.asyncBefore" } }), t("ElCheckbox", { attrs: { label: "异步后" }, on: { change: e.changeTaskAsync }, model: { value: e.taskConfigForm.asyncAfter, callback: function(n) {
1000
- e.$set(e.taskConfigForm, "asyncAfter", n);
1001
- }, expression: "taskConfigForm.asyncAfter" } }), e.taskConfigForm.asyncAfter || e.taskConfigForm.asyncBefore ? t("ElCheckbox", { attrs: { label: "排除" }, on: { change: e.changeTaskAsync }, model: { value: e.taskConfigForm.exclusive, callback: function(n) {
1002
- e.$set(e.taskConfigForm, "exclusive", n);
1003
- }, expression: "taskConfigForm.exclusive" } }) : e._e()], 1), t(e.witchTaskComponent, e._b({ tag: "Component" }, "Component", e.$props, !1))], 1)], 1);
1004
- }, Ot = [], Pt = /* @__PURE__ */ h(
1005
- $t,
1006
- Lt,
1007
- Ot,
1008
- !1,
1009
- null,
1010
- null
1011
- );
1012
- const Mt = Pt.exports, Dt = {
1013
- name: "ElementMultiInstance",
1014
- inject: {
1015
- prefix: "prefix"
1016
- },
1017
- props: {
1018
- id: String,
1019
- element: Object,
1020
- bpmnInstances: Object
1021
- },
1022
- data() {
1023
- return {
1024
- loopCharacteristics: "",
1025
- // 默认配置,用来覆盖原始不存在的选项,避免报错
1026
- defaultLoopInstanceForm: {
1027
- completionCondition: "",
1028
- loopCardinality: "",
1029
- extensionElements: [],
1030
- asyncAfter: !1,
1031
- asyncBefore: !1,
1032
- exclusive: !1
1033
- },
1034
- loopInstanceForm: {}
1035
- };
1036
- },
1037
- watch: {
1038
- id: {
1039
- immediate: !0,
1040
- handler() {
1041
- const { businessObject: i } = this.element;
1042
- this.getElementLoop(i);
1043
- }
1044
- }
1045
- },
1046
- beforeDestroy() {
1047
- this.multiLoopInstance = null;
1048
- },
1049
- methods: {
1050
- getElementLoop(i) {
1051
- var e, t, n, s, a, r;
1052
- if (!i.loopCharacteristics) {
1053
- this.loopCharacteristics = "Null", this.loopInstanceForm = {};
1054
- return;
1055
- }
1056
- if (i.loopCharacteristics.$type === "bpmn:StandardLoopCharacteristics") {
1057
- this.loopCharacteristics = "StandardLoop", this.loopInstanceForm = {};
1058
- return;
1059
- }
1060
- i.loopCharacteristics.isSequential ? this.loopCharacteristics = "SequentialMultiInstance" : this.loopCharacteristics = "ParallelMultiInstance", this.loopInstanceForm = T(d(d({}, this.defaultLoopInstanceForm), i.loopCharacteristics), {
1061
- completionCondition: (n = (t = (e = i.loopCharacteristics) == null ? void 0 : e.completionCondition) == null ? void 0 : t.body) != null ? n : "",
1062
- loopCardinality: (r = (a = (s = i.loopCharacteristics) == null ? void 0 : s.loopCardinality) == null ? void 0 : a.body) != null ? r : ""
1063
- }), this.multiLoopInstance = this.element.businessObject.loopCharacteristics, i.loopCharacteristics.extensionElements && i.loopCharacteristics.extensionElements.values && i.loopCharacteristics.extensionElements.values.length && this.$set(this.loopInstanceForm, "timeCycle", i.loopCharacteristics.extensionElements.values[0].body);
1064
- },
1065
- changeLoopCharacteristicsType(i) {
1066
- if (i === "Null") {
1067
- this.bpmnInstances.modeling.updateProperties(this.element, { loopCharacteristics: null });
1068
- return;
1069
- }
1070
- if (i === "StandardLoop") {
1071
- const e = this.bpmnInstances.moddle.create("bpmn:StandardLoopCharacteristics");
1072
- this.bpmnInstances.modeling.updateProperties(this.element, {
1073
- loopCharacteristics: e
1074
- }), this.multiLoopInstance = null;
1075
- return;
1076
- }
1077
- i === "SequentialMultiInstance" ? this.multiLoopInstance = this.bpmnInstances.moddle.create("bpmn:MultiInstanceLoopCharacteristics", {
1078
- isSequential: !0
1079
- }) : this.multiLoopInstance = this.bpmnInstances.moddle.create("bpmn:MultiInstanceLoopCharacteristics"), this.bpmnInstances.modeling.updateProperties(this.element, {
1080
- loopCharacteristics: this.multiLoopInstance
1081
- });
1082
- },
1083
- // 循环基数
1084
- updateLoopCardinality(i) {
1085
- let e = null;
1086
- i && i.length && (e = this.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: i })), this.bpmnInstances.modeling.updateModdleProperties(this.element, this.multiLoopInstance, {
1087
- loopCardinality: e
1088
- });
1089
- },
1090
- // 完成条件
1091
- updateLoopCondition(i) {
1092
- let e = null;
1093
- i && i.length && (e = this.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: i })), this.bpmnInstances.modeling.updateModdleProperties(this.element, this.multiLoopInstance, {
1094
- completionCondition: e
1095
- });
1096
- },
1097
- // 重试周期
1098
- updateLoopTimeCycle(i) {
1099
- const e = this.bpmnInstances.moddle.create("bpmn:ExtensionElements", {
1100
- values: [
1101
- this.bpmnInstances.moddle.create(`${this.prefix}:FailedJobRetryTimeCycle`, {
1102
- body: i
1103
- })
1104
- ]
1105
- });
1106
- this.bpmnInstances.modeling.updateModdleProperties(this.element, this.multiLoopInstance, {
1107
- extensionElements: e
1108
- });
1109
- },
1110
- // 直接更新的基础信息
1111
- updateLoopBase() {
1112
- this.bpmnInstances.modeling.updateModdleProperties(this.element, this.multiLoopInstance, {
1113
- collection: this.loopInstanceForm.collection || null,
1114
- elementVariable: this.loopInstanceForm.elementVariable || null
1115
- });
1116
- },
1117
- // 各异步状态
1118
- updateLoopAsync(i) {
1119
- const { asyncBefore: e, asyncAfter: t } = this.loopInstanceForm;
1120
- let n = /* @__PURE__ */ Object.create(null);
1121
- !e && !t ? (this.$set(this.loopInstanceForm, "exclusive", !1), n = { asyncBefore: !1, asyncAfter: !1, exclusive: !1, extensionElements: null }) : n[i] = this.loopInstanceForm[i], this.bpmnInstances.modeling.updateModdleProperties(this.element, this.multiLoopInstance, n);
1122
- }
1123
- }
1124
- };
1125
- var Bt = function() {
1126
- var e = this, t = e._self._c;
1127
- return t("div", { staticClass: "panel-tab__content element-multi-instance" }, [t("ElForm", { attrs: { size: "mini", "label-width": "100px" }, nativeOn: { submit: function(n) {
1128
- n.preventDefault();
1129
- } } }, [t("ElFormItem", { attrs: { label: "回路特性" }, scopedSlots: e._u([{ key: "label", fn: function() {
1130
- return [e._v(" 回路特性 "), t("ElTooltip", { attrs: { effect: "light" }, scopedSlots: e._u([{ key: "content", fn: function() {
1131
- return [t("ul", [t("li", { staticClass: "flow-tips-list-item" }, [t("span", { staticClass: "flow-tips-keyword" }, [e._v("并行")]), e._v(" 一次性创建所有任务实例")]), t("li", { staticClass: "flow-tips-list-item" }, [t("span", { staticClass: "flow-tips-keyword" }, [e._v("串行")]), e._v(" 完成一个任务实例再创建一个任务实例,直到环节完成")]), t("li", { staticClass: "flow-tips-list-item" }, [t("span", { staticClass: "flow-tips-keyword" }, [e._v("循环事件")]), e._v(" 未知")])])];
1132
- }, proxy: !0 }]) }, [t("i", { staticClass: "el-icon-info" })])];
1133
- }, proxy: !0 }]) }, [t("ElSelect", { on: { change: e.changeLoopCharacteristicsType }, model: { value: e.loopCharacteristics, callback: function(n) {
1134
- e.loopCharacteristics = n;
1135
- }, expression: "loopCharacteristics" } }, [t("ElOption", { attrs: { label: "并行", value: "ParallelMultiInstance" } }), t("ElOption", { attrs: { label: "串行", value: "SequentialMultiInstance" } }), t("ElOption", { attrs: { label: "循环事件", value: "StandardLoop" } }), t("ElOption", { attrs: { label: "无", value: "Null" } })], 1)], 1), e.loopCharacteristics === "ParallelMultiInstance" || e.loopCharacteristics === "SequentialMultiInstance" ? [t("ElFormItem", { key: "loopCardinality", attrs: { label: "循环基数" }, scopedSlots: e._u([{ key: "label", fn: function() {
1136
- return [e._v(" 循环基数 "), t("ElTooltip", { attrs: { effect: "light" }, scopedSlots: e._u([{ key: "content", fn: function() {
1137
- return [t("div", [e._v("与任务实例数相对,可不填")])];
1138
- }, proxy: !0 }], null, !1, 3306633709) }, [t("i", { staticClass: "el-icon-info" })])];
1139
- }, proxy: !0 }], null, !1, 3757615878) }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateLoopCardinality }, model: { value: e.loopInstanceForm.loopCardinality, callback: function(n) {
1140
- e.$set(e.loopInstanceForm, "loopCardinality", n);
1141
- }, expression: "loopInstanceForm.loopCardinality" } })], 1), t("ElFormItem", { key: "collection", attrs: { label: "集合名称", required: "" }, scopedSlots: e._u([{ key: "label", fn: function() {
1142
- return [e._v(" 集合变量 "), t("ElTooltip", { attrs: { effect: "light" }, scopedSlots: e._u([{ key: "content", fn: function() {
1143
- return [t("p", [e._v("流程变量名,设置为 "), t("span", { staticClass: "flow-tips-keyword" }, [e._v("${handlers}")]), e._v(" 就行")])];
1144
- }, proxy: !0 }], null, !1, 2769289721) }, [t("i", { staticClass: "el-icon-info" })])];
1145
- }, proxy: !0 }], null, !1, 3139340263) }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateLoopBase }, model: { value: e.loopInstanceForm.collection, callback: function(n) {
1146
- e.$set(e.loopInstanceForm, "collection", n);
1147
- }, expression: "loopInstanceForm.collection" } })], 1), t("ElFormItem", { key: "elementVariable", attrs: { label: "元素名称", required: "" }, scopedSlots: e._u([{ key: "label", fn: function() {
1148
- return [e._v(" 元素变量 "), t("ElTooltip", { attrs: { effect: "light" }, scopedSlots: e._u([{ key: "content", fn: function() {
1149
- return [t("p", [e._v(" 流程变量名,设置为 "), t("span", { staticClass: "flow-tips-keyword" }, [e._v("handler")]), e._v(' 就行,注意与"'), t("span", { staticClass: "flow-tips-keyword" }, [e._v("处理人")]), e._v('"中的"'), t("span", { staticClass: "flow-tips-keyword" }, [e._v("分配人员")]), e._v('"值保持一致 ')])];
1150
- }, proxy: !0 }], null, !1, 952223137) }, [t("i", { staticClass: "el-icon-info" })])];
1151
- }, proxy: !0 }], null, !1, 1907746023) }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateLoopBase }, model: { value: e.loopInstanceForm.elementVariable, callback: function(n) {
1152
- e.$set(e.loopInstanceForm, "elementVariable", n);
1153
- }, expression: "loopInstanceForm.elementVariable" } })], 1), t("ElFormItem", { key: "completionCondition", attrs: { label: "完成条件" }, scopedSlots: e._u([{ key: "label", fn: function() {
1154
- return [e._v(" 完成条件 "), t("ElTooltip", { attrs: { effect: "light" }, scopedSlots: e._u([{ key: "content", fn: function() {
1155
- return [t("p", { staticClass: "flow-tips-title" }, [e._v("特殊流程变量:")]), t("ul", [t("li", { staticClass: "flow-tips-list-item" }, [t("span", { staticClass: "flow-tips-keyword" }, [e._v("nrOfInstances")]), e._v(" 总实例数")]), t("li", { staticClass: "flow-tips-list-item" }, [t("span", { staticClass: "flow-tips-keyword" }, [e._v("nrOfCompletedInstances")]), e._v(" 已完成的实例数")]), t("li", { staticClass: "flow-tips-list-item" }, [t("span", { staticClass: "flow-tips-keyword" }, [e._v("nrOfActiveInstances")]), e._v(" 未完成实例数")])]), t("p", { staticClass: "flow-tips-title" }, [e._v("示例:")]), t("ul", [t("li", { staticClass: "flow-tips-list-item" }, [t("span", { staticClass: "flow-tips-keyword" }, [e._v("${nrOfCompletedInstances/nrOfInstances >= 1}")]), e._v(":所有实例完成结束该环节 ")]), t("li", { staticClass: "flow-tips-list-item" }, [t("span", { staticClass: "flow-tips-keyword" }, [e._v("${nrOfCompletedInstances/nrOfInstances >= 0.5}")]), e._v(":50%实例完成结束该环节 ")]), t("li", { staticClass: "flow-tips-list-item" }, [t("span", { staticClass: "flow-tips-keyword" }, [e._v("${nrOfCompletedInstances >= 1}")]), e._v(":有一个实例完成结束该环节")])]), t("p", { staticClass: "flow-tips-title" }, [e._v("不填要等所有实例完成才会结束该环节")])];
1156
- }, proxy: !0 }], null, !1, 2952075778) }, [t("i", { staticClass: "el-icon-info" })])];
1157
- }, proxy: !0 }], null, !1, 2319413861) }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateLoopCondition }, model: { value: e.loopInstanceForm.completionCondition, callback: function(n) {
1158
- e.$set(e.loopInstanceForm, "completionCondition", n);
1159
- }, expression: "loopInstanceForm.completionCondition" } })], 1), t("ElFormItem", { key: "async", attrs: { label: "异步状态" }, scopedSlots: e._u([{ key: "label", fn: function() {
1160
- return [e._v(" 异步状态 "), t("ElTooltip", { attrs: { effect: "light" }, scopedSlots: e._u([{ key: "content", fn: function() {
1161
- return [t("div", [e._v("目前没用到")])];
1162
- }, proxy: !0 }], null, !1, 1935913218) }, [t("i", { staticClass: "el-icon-info" })])];
1163
- }, proxy: !0 }], null, !1, 474663414) }, [t("ElCheckbox", { attrs: { label: "异步前" }, on: { change: function(n) {
1164
- return e.updateLoopAsync("asyncBefore");
1165
- } }, model: { value: e.loopInstanceForm.asyncBefore, callback: function(n) {
1166
- e.$set(e.loopInstanceForm, "asyncBefore", n);
1167
- }, expression: "loopInstanceForm.asyncBefore" } }), t("ElCheckbox", { attrs: { label: "异步后" }, on: { change: function(n) {
1168
- return e.updateLoopAsync("asyncAfter");
1169
- } }, model: { value: e.loopInstanceForm.asyncAfter, callback: function(n) {
1170
- e.$set(e.loopInstanceForm, "asyncAfter", n);
1171
- }, expression: "loopInstanceForm.asyncAfter" } }), e.loopInstanceForm.asyncAfter || e.loopInstanceForm.asyncBefore ? t("ElCheckbox", { attrs: { label: "排除" }, on: { change: function(n) {
1172
- return e.updateLoopAsync("exclusive");
1173
- } }, model: { value: e.loopInstanceForm.exclusive, callback: function(n) {
1174
- e.$set(e.loopInstanceForm, "exclusive", n);
1175
- }, expression: "loopInstanceForm.exclusive" } }) : e._e()], 1), e.loopInstanceForm.asyncAfter || e.loopInstanceForm.asyncBefore ? t("ElFormItem", { key: "timeCycle", attrs: { label: "重试周期", prop: "timeCycle" } }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateLoopTimeCycle }, model: { value: e.loopInstanceForm.timeCycle, callback: function(n) {
1176
- e.$set(e.loopInstanceForm, "timeCycle", n);
1177
- }, expression: "loopInstanceForm.timeCycle" } })], 1) : e._e()] : e._e()], 2)], 1);
1178
- }, Rt = [], Vt = /* @__PURE__ */ h(
1179
- Dt,
1180
- Bt,
1181
- Rt,
1182
- !1,
1183
- null,
1184
- null
1185
- );
1186
- const jt = Vt.exports, zt = {
1187
- name: "FlowCondition",
1188
- props: {
1189
- id: String,
1190
- element: Object,
1191
- bpmnInstances: Object
1192
- },
1193
- data() {
1194
- return {
1195
- flowConditionForm: {}
1196
- };
1197
- },
1198
- watch: {
1199
- id: {
1200
- immediate: !0,
1201
- handler() {
1202
- return c(this, null, function* () {
1203
- yield this.$nextTick(), this.resetFlowCondition();
1204
- });
1205
- }
1206
- }
1207
- },
1208
- beforeDestroy() {
1209
- this.bpmnElementSource = null, this.bpmnElementSourceRef = null;
1210
- },
1211
- methods: {
1212
- resetFlowCondition() {
1213
- if (this.bpmnElementSource = this.element.source, this.bpmnElementSourceRef = this.element.businessObject.sourceRef, this.bpmnElementSourceRef && this.bpmnElementSourceRef.default && this.bpmnElementSourceRef.default.id === this.element.id)
1214
- this.flowConditionForm = { type: "default" };
1215
- else if (!this.element.businessObject.conditionExpression)
1216
- this.flowConditionForm = { type: "normal" };
1217
- else {
1218
- const i = this.element.businessObject.conditionExpression;
1219
- if (this.flowConditionForm = T(d({}, i), { type: "condition" }), this.flowConditionForm.resource) {
1220
- this.$set(this.flowConditionForm, "conditionType", "script"), this.$set(this.flowConditionForm, "scriptType", "externalScript");
1221
- return;
1222
- }
1223
- if (i.language) {
1224
- this.$set(this.flowConditionForm, "conditionType", "script"), this.$set(this.flowConditionForm, "scriptType", "inlineScript");
1225
- return;
1226
- }
1227
- this.$set(this.flowConditionForm, "conditionType", "expression");
1228
- }
1229
- },
1230
- updateFlowType(i) {
1231
- if (i === "condition") {
1232
- this.flowConditionRef = this.bpmnInstances.moddle.create("bpmn:FormalExpression"), this.bpmnInstances.modeling.updateProperties(this.element, {
1233
- conditionExpression: this.flowConditionRef
1234
- });
1235
- return;
1236
- }
1237
- if (i === "default") {
1238
- this.bpmnInstances.modeling.updateProperties(this.element, {
1239
- conditionExpression: null
1240
- }), this.bpmnInstances.modeling.updateProperties(this.bpmnElementSource, {
1241
- default: this.element
1242
- });
1243
- return;
1244
- }
1245
- this.bpmnElementSourceRef.default && this.bpmnElementSourceRef.default.id === this.element.id && this.bpmnInstances.modeling.updateProperties(this.bpmnElementSource, {
1246
- default: null
1247
- }), this.bpmnInstances.modeling.updateProperties(this.element, {
1248
- conditionExpression: null
1249
- });
1250
- },
1251
- updateFlowCondition() {
1252
- const { conditionType: i, scriptType: e, body: t, resource: n, language: s } = this.flowConditionForm;
1253
- let a;
1254
- i === "expression" ? a = this.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: t }) : e === "inlineScript" ? (a = this.bpmnInstances.moddle.create("bpmn:FormalExpression", { body: t, language: s }), this.$set(this.flowConditionForm, "resource", "")) : (this.$set(this.flowConditionForm, "body", ""), a = this.bpmnInstances.moddle.create("bpmn:FormalExpression", { resource: n, language: s })), this.bpmnInstances.modeling.updateProperties(this.element, { conditionExpression: a });
1255
- }
1256
- }
1257
- };
1258
- var Nt = function() {
1259
- var e = this, t = e._self._c;
1260
- return t("div", { staticClass: "panel-tab__content" }, [t("ElForm", { attrs: { model: e.flowConditionForm, "label-width": "90px", size: "mini" }, nativeOn: { submit: function(n) {
1261
- n.preventDefault();
1262
- } } }, [t("ElFormItem", { attrs: { label: "流转类型" } }, [t("ElSelect", { on: { change: e.updateFlowType }, model: { value: e.flowConditionForm.type, callback: function(n) {
1263
- e.$set(e.flowConditionForm, "type", n);
1264
- }, expression: "flowConditionForm.type" } }, [t("ElOption", { attrs: { label: "普通流转路径", value: "normal" } }), t("ElOption", { attrs: { label: "默认流转路径", value: "default" } }), t("ElOption", { attrs: { label: "条件流转路径", value: "condition" } })], 1)], 1), e.flowConditionForm.type === "condition" ? t("ElFormItem", { key: "condition", attrs: { label: "条件格式" } }, [t("ElSelect", { model: { value: e.flowConditionForm.conditionType, callback: function(n) {
1265
- e.$set(e.flowConditionForm, "conditionType", n);
1266
- }, expression: "flowConditionForm.conditionType" } }, [t("ElOption", { attrs: { label: "表达式", value: "expression" } }), t("ElOption", { attrs: { label: "脚本", value: "script" } })], 1)], 1) : e._e(), e.flowConditionForm.conditionType && e.flowConditionForm.conditionType === "expression" ? t("ElFormItem", { key: "express", attrs: { label: "表达式" } }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateFlowCondition }, model: { value: e.flowConditionForm.body, callback: function(n) {
1267
- e.$set(e.flowConditionForm, "body", n);
1268
- }, expression: "flowConditionForm.body" } })], 1) : e._e(), e.flowConditionForm.conditionType && e.flowConditionForm.conditionType === "script" ? [t("ElFormItem", { key: "language", attrs: { label: "脚本语言" } }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateFlowCondition }, model: { value: e.flowConditionForm.language, callback: function(n) {
1269
- e.$set(e.flowConditionForm, "language", n);
1270
- }, expression: "flowConditionForm.language" } })], 1), t("ElFormItem", { key: "scriptType", attrs: { label: "脚本类型" } }, [t("ElSelect", { model: { value: e.flowConditionForm.scriptType, callback: function(n) {
1271
- e.$set(e.flowConditionForm, "scriptType", n);
1272
- }, expression: "flowConditionForm.scriptType" } }, [t("ElOption", { attrs: { label: "内联脚本", value: "inlineScript" } }), t("ElOption", { attrs: { label: "外部脚本", value: "externalScript" } })], 1)], 1), e.flowConditionForm.scriptType === "inlineScript" ? t("ElFormItem", { key: "body", attrs: { label: "脚本" } }, [t("ElInput", { attrs: { type: "textarea", clearable: "" }, on: { change: e.updateFlowCondition }, model: { value: e.flowConditionForm.body, callback: function(n) {
1273
- e.$set(e.flowConditionForm, "body", n);
1274
- }, expression: "flowConditionForm.body" } })], 1) : e._e(), e.flowConditionForm.scriptType === "externalScript" ? t("ElFormItem", { key: "resource", attrs: { label: "资源地址" } }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateFlowCondition }, model: { value: e.flowConditionForm.resource, callback: function(n) {
1275
- e.$set(e.flowConditionForm, "resource", n);
1276
- }, expression: "flowConditionForm.resource" } })], 1) : e._e()] : e._e()], 2)], 1);
1277
- }, Ut = [], Gt = /* @__PURE__ */ h(
1278
- zt,
1279
- Nt,
1280
- Ut,
1281
- !1,
1282
- null,
1283
- null
1284
- );
1285
- const qt = Gt.exports, Kt = {
1286
- name: "SignalAndMessage",
1287
- props: {
1288
- bpmnInstances: Object
1289
- },
1290
- data() {
1291
- return {
1292
- signalList: [],
1293
- messageList: [],
1294
- modelVisible: !1,
1295
- modelType: "",
1296
- modelObjectForm: {}
1297
- };
1298
- },
1299
- computed: {
1300
- modelConfig() {
1301
- return this.modelType === "message" ? { title: "创建消息", idLabel: "消息ID", nameLabel: "消息名称" } : { title: "创建信号", idLabel: "信号ID", nameLabel: "信号名称" };
1302
- }
1303
- },
1304
- mounted() {
1305
- this.initDataList();
1306
- },
1307
- methods: {
1308
- initDataList() {
1309
- this.rootElements = this.bpmnInstances.modeler.getDefinitions().rootElements, this.messageIdMap = {}, this.signalIdMap = {}, this.messageList = [], this.signalList = [], this.rootElements.forEach((i) => {
1310
- i.$type === "bpmn:Message" && (this.messageIdMap[i.id] = !0, this.messageList.push(d({}, i))), i.$type === "bpmn:Signal" && (this.signalIdMap[i.id] = !0, this.signalList.push(d({}, i)));
1311
- });
1312
- },
1313
- openModel(i) {
1314
- this.modelType = i, this.modelObjectForm = {}, this.modelVisible = !0;
1315
- },
1316
- addNewObject() {
1317
- if (this.modelType === "message") {
1318
- if (this.messageIdMap[this.modelObjectForm.id])
1319
- return this.$message.error("该消息已存在,请修改id后重新保存");
1320
- const i = this.bpmnInstances.moddle.create("bpmn:Message", this.modelObjectForm);
1321
- this.rootElements.push(i);
1322
- } else {
1323
- if (this.signalIdMap[this.modelObjectForm.id])
1324
- return this.$message.error("该信号已存在,请修改id后重新保存");
1325
- const i = this.bpmnInstances.moddle.create("bpmn:Signal", this.modelObjectForm);
1326
- this.rootElements.push(i);
1327
- }
1328
- this.modelVisible = !1, this.initDataList();
1329
- }
1330
- }
1331
- };
1332
- var Jt = function() {
1333
- var e = this, t = e._self._c;
1334
- return t("div", { staticClass: "panel-tab__content" }, [t("div", { staticClass: "panel-tab__content--title" }, [e._m(0), t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(n) {
1335
- return e.openModel("message");
1336
- } } }, [e._v("创建新消息")])], 1), t("ElTable", { attrs: { data: e.messageList, size: "mini", border: "" } }, [t("ElTableColumn", { attrs: { type: "index", label: "序号", width: "60px" } }), t("ElTableColumn", { attrs: { label: "消息ID", prop: "id", "max-width": "300px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "消息名称", prop: "name", "max-width": "300px", "show-overflow-tooltip": "" } })], 1), t("div", { staticClass: "panel-tab__content--title", staticStyle: { "margin-top": "8px", "padding-top": "8px", "border-top": "1px solid #eee" } }, [e._m(1), t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(n) {
1337
- return e.openModel("signal");
1338
- } } }, [e._v("创建新信号")])], 1), t("ElTable", { attrs: { data: e.signalList, size: "mini", border: "" } }, [t("ElTableColumn", { attrs: { type: "index", label: "序号", width: "60px" } }), t("ElTableColumn", { attrs: { label: "信号ID", prop: "id", "max-width": "300px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "信号名称", prop: "name", "max-width": "300px", "show-overflow-tooltip": "" } })], 1), t("ElementDialog", { staticClass: "flow-dialog", attrs: { visible: e.modelVisible, title: e.modelConfig.title, "close-on-click-modal": !1, width: "400px", "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(n) {
1339
- e.modelVisible = n;
1340
- } }, scopedSlots: e._u([{ key: "footer", fn: function() {
1341
- return [t("ElButton", { attrs: { size: "mini" }, on: { click: function(n) {
1342
- e.modelVisible = !1;
1343
- } } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.addNewObject } }, [e._v("保 存")])];
1344
- }, proxy: !0 }]) }, [t("ElForm", { attrs: { model: e.modelObjectForm, size: "mini", "label-width": "90px" }, nativeOn: { submit: function(n) {
1345
- n.preventDefault();
1346
- } } }, [t("ElFormItem", { attrs: { label: e.modelConfig.idLabel } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.modelObjectForm.id, callback: function(n) {
1347
- e.$set(e.modelObjectForm, "id", n);
1348
- }, expression: "modelObjectForm.id" } })], 1), t("ElFormItem", { attrs: { label: e.modelConfig.nameLabel } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.modelObjectForm.name, callback: function(n) {
1349
- e.$set(e.modelObjectForm, "name", n);
1350
- }, expression: "modelObjectForm.name" } })], 1)], 1)], 1)], 1);
1351
- }, Zt = [function() {
1352
- var i = this, e = i._self._c;
1353
- return e("span", [e("i", { staticClass: "el-icon-menu", staticStyle: { "margin-right": "8px", color: "#555" } }), i._v("消息列表")]);
1354
- }, function() {
1355
- var i = this, e = i._self._c;
1356
- return e("span", [e("i", { staticClass: "el-icon-menu", staticStyle: { "margin-right": "8px", color: "#555" } }), i._v("信号列表")]);
1357
- }], Ht = /* @__PURE__ */ h(
1358
- Kt,
1359
- Jt,
1360
- Zt,
1361
- !1,
1362
- null,
1363
- null
1364
- );
1365
- const Wt = Ht.exports;
1366
- function ge(i) {
1367
- let e = d({}, i);
1368
- if (i.script && (e = T(d(d({}, i), i.script), {
1369
- scriptType: i.script.resource ? "externalScript" : "inlineScript"
1370
- })), i.event === "timeout" && i.eventDefinitions && i.eventDefinitions.length) {
1371
- let t = "";
1372
- for (const n in i.eventDefinitions[0])
1373
- n.indexOf("time") !== -1 && (t = n, e.eventDefinitionType = n.replace("time", "").toLowerCase());
1374
- e.eventTimeDefinitions = i.eventDefinitions[0][t].body;
1375
- }
1376
- return e;
1377
- }
1378
- function ve(i) {
1379
- var t, n;
1380
- let e;
1381
- return i.class && (e = "classListener"), i.expression && (e = "expressionListener"), i.delegateExpression && (e = "delegateExpressionListener"), i.script && (e = "scriptListener"), T(d(d({}, v(i)), (t = i.script) != null ? t : {}), {
1382
- fields: (n = i.fields) == null ? void 0 : n.map((s) => T(d({}, s), { fieldType: s.expression ? "expression" : "string" })),
1383
- listenerType: e
1384
- });
1385
- }
1386
- const Ee = {
1387
- classListener: "Java 类",
1388
- expressionListener: "表达式",
1389
- delegateExpressionListener: "代理表达式",
1390
- scriptListener: "脚本"
1391
- }, Xt = {
1392
- create: "创建",
1393
- assignment: "指派",
1394
- complete: "完成",
1395
- delete: "删除",
1396
- update: "更新",
1397
- timeout: "超时"
1398
- }, Fe = {
1399
- string: "字符串",
1400
- expression: "表达式"
1401
- }, Yt = (i) => ({
1402
- $type: "flowable:ExecutionListener",
1403
- event: i === "draft" ? "start" : i,
1404
- // eslint-disable-next-line no-template-curly-in-string
1405
- delegateExpression: "${httpInvokeExecutionListener}",
1406
- fields: [],
1407
- listenerType: "delegateExpressionListener"
1408
- }), Qt = (i, e) => [
1409
- { $type: "flowable:Field", name: "serviceId", string: e.serviceId, fieldType: "string" },
1410
- {
1411
- $type: "flowable:Field",
1412
- name: "url",
1413
- string: `${e != null && e.url ? `/${e.url}` : ""}/flow${Ve(i)}`,
1414
- fieldType: "string"
1415
- }
1416
- ], en = {
1417
- name: "ElementListeners",
1418
- inject: {
1419
- prefix: "prefix",
1420
- width: "width",
1421
- context: "context"
1422
- },
1423
- props: {
1424
- id: String,
1425
- element: Object,
1426
- bpmnInstances: Object
1427
- },
1428
- data() {
1429
- return {
1430
- elementListenersList: [],
1431
- // 监听器列表
1432
- listenerForm: {},
1433
- // 监听器详情表单
1434
- listenerFormModelVisible: !1,
1435
- // 监听器 编辑 侧边栏显示状态
1436
- fieldsListOfListener: [],
1437
- listenerFieldForm: {},
1438
- // 监听器 注入字段 详情表单
1439
- listenerFieldFormModelVisible: !1,
1440
- // 监听器 注入字段表单弹窗 显示状态
1441
- editingListenerIndex: -1,
1442
- // 监听器所在下标,-1 为新增
1443
- editingListenerFieldIndex: -1,
1444
- // 字段所在下标,-1 为新增
1445
- listenerTypeObject: Ee,
1446
- fieldTypeObject: Fe
1447
- };
1448
- },
1449
- computed: {
1450
- apis() {
1451
- var e;
1452
- return (((e = this.context) == null ? void 0 : e.apis) || ["flowDraft", "flowStart", "flowEnd"]).map((t) => {
1453
- var n;
1454
- return `${(n = this.context) != null && n.url ? `/${this.context.url}/` : ""}${t}`;
1455
- }) || [];
1456
- }
1457
- },
1458
- watch: {
1459
- id: {
1460
- immediate: !0,
1461
- handler(i) {
1462
- return c(this, null, function* () {
1463
- i && (yield this.$nextTick(), this.resetListenersList());
1464
- });
1465
- }
1466
- }
1467
- },
1468
- methods: {
1469
- resetListenersList() {
1470
- var i, e, t, n;
1471
- this.otherExtensionList = [], this.bpmnElementListeners = (n = (t = (e = (i = this.element.businessObject) == null ? void 0 : i.extensionElements) == null ? void 0 : e.values) == null ? void 0 : t.filter((s) => s.$type === `${this.prefix}:ExecutionListener`)) != null ? n : [], this.elementListenersList = this.bpmnElementListeners.map((s) => ve(s));
1472
- },
1473
- changeFiledType(i) {
1474
- i === "string" ? (delete this.listenerFieldForm.expression, this.$set(this.listenerFieldForm, "string", "")) : (delete this.listenerFieldForm.string, this.$set(this.listenerFieldForm, "expression", ""));
1475
- },
1476
- assignListener(i) {
1477
- const e = Yt(i, this.context);
1478
- e.fields = Qt(i, this.context), this.listenerForm = e, this.fieldsListOfListener = e.fields;
1479
- },
1480
- setDefaultFieldValue(i) {
1481
- i !== "url" ? this.$set(this.listenerFieldForm, "string", this.context[i] || "") : this.$set(this.listenerFieldForm, "string", "");
1482
- },
1483
- // 打开 监听器详情 侧边栏
1484
- openListenerForm(i, e) {
1485
- return c(this, null, function* () {
1486
- var t;
1487
- i ? (this.listenerForm = ge(i), this.fieldsListOfListener = i.fields ? i.fields.map((n) => d({}, n)) : [], this.editingListenerIndex = e) : (this.listenerForm = { fields: [] }, this.fieldsListOfListener = [], this.editingListenerIndex = -1), this.listenerFormModelVisible = !0, yield this.$nextTick(), (t = this.$refs.listenerFormRef) == null || t.clearValidate();
1488
- });
1489
- },
1490
- // 打开监听器字段编辑弹窗
1491
- openListenerFieldForm(i, e) {
1492
- this.listenerFieldForm = i ? v(i) : { fieldType: "string" }, this.editingListenerFieldIndex = i ? e : -1, this.listenerFieldFormModelVisible = !0, this.$nextTick(() => {
1493
- this.$refs.listenerFieldFormRef && this.$refs.listenerFieldFormRef.clearValidate();
1494
- });
1495
- },
1496
- // 保存监听器注入字段
1497
- saveListenerFiled() {
1498
- return c(this, null, function* () {
1499
- (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, yield this.$nextTick(), this.listenerFieldForm = {});
1500
- });
1501
- },
1502
- // 移除监听器字段
1503
- removeListenerField(i, e) {
1504
- return c(this, null, function* () {
1505
- try {
1506
- yield this.$confirm("确认移除该字段吗?", "提示"), this.fieldsListOfListener.splice(e, 1), this.listenerForm.fields.splice(e, 1);
1507
- } catch (t) {
1508
- }
1509
- });
1510
- },
1511
- // 移除监听器
1512
- removeListener(i, e) {
1513
- return c(this, null, function* () {
1514
- try {
1515
- yield this.$confirm("确认移除该监听器吗?", "提示"), this.bpmnElementListeners.splice(e, 1), this.elementListenersList.splice(e, 1), U(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners));
1516
- } catch (t) {
1517
- }
1518
- });
1519
- },
1520
- // 保存监听器配置
1521
- saveListenerConfig() {
1522
- return c(this, null, function* () {
1523
- var t, n, s, a;
1524
- if (!(yield this.$refs.listenerFormRef.validate())) return;
1525
- const e = he(this.bpmnInstances, this.listenerForm, !1, this.prefix);
1526
- this.editingListenerIndex === -1 ? (this.bpmnElementListeners.push(e), this.elementListenersList.push(this.listenerForm)) : (this.bpmnElementListeners.splice(this.editingListenerIndex, 1, e), this.elementListenersList.splice(this.editingListenerIndex, 1, this.listenerForm)), this.otherExtensionList = (a = (s = (n = (t = this.element.businessObject) == null ? void 0 : t.extensionElements) == null ? void 0 : n.values) == null ? void 0 : s.filter((r) => r.$type !== `${this.prefix}:ExecutionListener`)) != null ? a : [], U(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners)), this.listenerFormModelVisible = !1, this.listenerForm = {};
1527
- });
1528
- }
1529
- }
1530
- };
1531
- var tn = function() {
1532
- var n, s, a;
1533
- var e = this, t = e._self._c;
1534
- return t("div", { staticClass: "panel-tab__content element-listeners" }, [t("ElTable", { attrs: { data: e.elementListenersList, size: "mini", border: "" } }, [t("ElTableColumn", { attrs: { label: "序号", width: "50px", type: "index" } }), t("ElTableColumn", { attrs: { label: "事件类型", "min-width": "100px", prop: "event" } }), t("ElTableColumn", { attrs: { label: "监听器类型", "min-width": "100px", "show-overflow-tooltip": "", formatter: (r) => e.listenerTypeObject[r.listenerType] } }), t("ElTableColumn", { attrs: { label: "操作", width: "90px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: r, $index: o }) {
1535
- return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(p) {
1536
- return e.openListenerForm(r, o);
1537
- } } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(p) {
1538
- return e.removeListener(r, o);
1539
- } } }, [e._v("移除")])];
1540
- } }]) })], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(r) {
1541
- return e.openListenerForm(null);
1542
- } } }, [e._v("添加监听器")])], 1), t("ElDrawer", { staticClass: "flow-drawer element-listeners-drawer", attrs: { visible: e.listenerFormModelVisible, title: "执行监听器", size: `${e.width}px`, "wrapper-closable": !1, "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(r) {
1543
- e.listenerFormModelVisible = r;
1544
- } } }, [t("ElDivider"), t("p", { staticClass: "listener-filed__title" }, [t("span", [t("i", { staticClass: "el-icon-menu" }), e._v("监听器类型:")]), t("ElButton", { staticStyle: { "margin-left": "auto" }, attrs: { size: "mini", type: "primary" }, on: { click: function(r) {
1545
- return e.assignListener("start");
1546
- } } }, [e._v("开始")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: function(r) {
1547
- return e.assignListener("end");
1548
- } } }, [e._v("结束")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: function(r) {
1549
- return e.assignListener("draft");
1550
- } } }, [e._v("草稿")])], 1), t("ElForm", { ref: "listenerFormRef", attrs: { size: "mini", model: e.listenerForm, "label-width": "96px" }, nativeOn: { submit: function(r) {
1551
- r.preventDefault();
1552
- } } }, [t("ElFormItem", { attrs: { label: "事件类型", prop: "event", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElSelect", { model: { value: e.listenerForm.event, callback: function(r) {
1553
- e.$set(e.listenerForm, "event", r);
1554
- }, expression: "listenerForm.event" } }, [t("ElOption", { attrs: { label: "开始", value: "start" } }), t("ElOption", { attrs: { label: "结束", value: "end" } })], 1)], 1), t("ElFormItem", { attrs: { label: "监听器类型", prop: "listenerType", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElSelect", { model: { value: e.listenerForm.listenerType, callback: function(r) {
1555
- e.$set(e.listenerForm, "listenerType", r);
1556
- }, expression: "listenerForm.listenerType" } }, e._l(Object.keys(e.listenerTypeObject), function(r) {
1557
- return t("ElOption", { key: r, attrs: { label: e.listenerTypeObject[r], value: r } });
1558
- }), 1)], 1), e.listenerForm.listenerType === "classListener" ? t("ElFormItem", { key: "listener-class", attrs: { label: "Java类", prop: "class", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.class, callback: function(r) {
1559
- e.$set(e.listenerForm, "class", r);
1560
- }, expression: "listenerForm.class" } })], 1) : e._e(), e.listenerForm.listenerType === "expressionListener" ? t("ElFormItem", { key: "listener-expression", attrs: { label: "表达式", prop: "expression", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.expression, callback: function(r) {
1561
- e.$set(e.listenerForm, "expression", r);
1562
- }, expression: "listenerForm.expression" } })], 1) : e._e(), e.listenerForm.listenerType === "delegateExpressionListener" ? t("ElFormItem", { key: "listener-delegate", attrs: { label: "代理表达式", prop: "delegateExpression", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElSelect", { attrs: { "default-first-option": "", "allow-create": "", filterable: "", clearable: "" }, model: { value: e.listenerForm.delegateExpression, callback: function(r) {
1563
- e.$set(e.listenerForm, "delegateExpression", r);
1564
- }, expression: "listenerForm.delegateExpression" } }, e._l(((n = e.context) == null ? void 0 : n.delegateExpressions) || [], function(r) {
1565
- return t("ElOption", { key: r, attrs: { value: r, label: r } });
1566
- }), 1)], 1) : e._e(), e.listenerForm.listenerType === "scriptListener" ? [t("ElFormItem", { key: "listener-script-format", attrs: { label: "脚本格式", prop: "scriptFormat", rules: { required: !0, trigger: ["blur", "change"], message: "请填写脚本格式" } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.scriptFormat, callback: function(r) {
1567
- e.$set(e.listenerForm, "scriptFormat", r);
1568
- }, expression: "listenerForm.scriptFormat" } })], 1), t("ElFormItem", { key: "listener-script-type", attrs: { label: "脚本类型", prop: "scriptType", rules: { required: !0, trigger: ["blur", "change"], message: "请选择脚本类型" } } }, [t("ElSelect", { model: { value: e.listenerForm.scriptType, callback: function(r) {
1569
- e.$set(e.listenerForm, "scriptType", r);
1570
- }, expression: "listenerForm.scriptType" } }, [t("ElOption", { attrs: { label: "内联脚本", value: "inlineScript" } }), t("ElOption", { attrs: { label: "外部脚本", value: "externalScript" } })], 1)], 1), e.listenerForm.scriptType === "inlineScript" ? t("ElFormItem", { key: "listener-script", attrs: { label: "脚本内容", prop: "value", rules: { required: !0, trigger: ["blur", "change"], message: "请填写脚本内容" } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.value, callback: function(r) {
1571
- e.$set(e.listenerForm, "value", r);
1572
- }, expression: "listenerForm.value" } })], 1) : e._e(), e.listenerForm.scriptType === "externalScript" ? t("ElFormItem", { key: "listener-resource", attrs: { label: "资源地址", prop: "resource", rules: { required: !0, trigger: ["blur", "change"], message: "请填写资源地址" } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.resource, callback: function(r) {
1573
- e.$set(e.listenerForm, "resource", r);
1574
- }, expression: "listenerForm.resource" } })], 1) : e._e()] : e._e()], 2), t("ElDivider"), t("p", { staticClass: "listener-filed__title" }, [t("span", [t("i", { staticClass: "el-icon-menu" }), e._v("注入字段:")]), t("ElButton", { staticStyle: { "margin-left": "auto" }, attrs: { size: "mini", type: "primary" }, on: { click: function(r) {
1575
- return e.openListenerFieldForm(null);
1576
- } } }, [e._v(" 添加字段 ")])], 1), t("ElTable", { staticStyle: { flex: "none" }, attrs: { data: e.fieldsListOfListener, size: "mini", "max-height": "240", border: "", fit: "" } }, [t("ElTableColumn", { attrs: { label: "序号", width: "50px", type: "index" } }), t("ElTableColumn", { attrs: { label: "字段名称", "min-width": "100px", prop: "name" } }), t("ElTableColumn", { attrs: { label: "字段类型", "min-width": "80px", "show-overflow-tooltip": "", formatter: (r) => e.fieldTypeObject[r.fieldType] } }), t("ElTableColumn", { attrs: { label: "字段值/表达式", "min-width": "100px", "show-overflow-tooltip": "", formatter: (r) => r.string || r.expression } }), t("ElTableColumn", { attrs: { label: "操作", width: "100px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: r, $index: o }) {
1577
- return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(p) {
1578
- return e.openListenerFieldForm(r, o);
1579
- } } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(p) {
1580
- return e.removeListenerField(r, o);
1581
- } } }, [e._v(" 移除 ")])];
1582
- } }]) })], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini" }, on: { click: function(r) {
1583
- e.listenerFormModelVisible = !1;
1584
- } } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.saveListenerConfig } }, [e._v("保 存")])], 1)], 1), t("ElementDialog", { staticClass: "flow-dialog", attrs: { title: "字段配置", visible: e.listenerFieldFormModelVisible, width: "600px", "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(r) {
1585
- e.listenerFieldFormModelVisible = r;
1586
- } }, scopedSlots: e._u([{ key: "footer", fn: function() {
1587
- return [t("ElButton", { attrs: { size: "mini" }, on: { click: function(r) {
1588
- e.listenerFieldFormModelVisible = !1;
1589
- } } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.saveListenerFiled } }, [e._v("确 定")])];
1590
- }, proxy: !0 }]) }, [t("ElForm", { ref: "listenerFieldFormRef", staticStyle: { height: "136px" }, attrs: { model: e.listenerFieldForm, size: "mini", "label-width": "96px" }, nativeOn: { submit: function(r) {
1591
- r.preventDefault();
1592
- } } }, [t("ElFormItem", { attrs: { label: "字段名称:", prop: "name", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElSelect", { attrs: { "default-first-option": "", "allow-create": "", filterable: "", clearable: "" }, on: { input: e.setDefaultFieldValue }, model: { value: e.listenerFieldForm.name, callback: function(r) {
1593
- e.$set(e.listenerFieldForm, "name", r);
1594
- }, expression: "listenerFieldForm.name" } }, e._l(((s = e.context) == null ? void 0 : s.fields) || [], function(r) {
1595
- return t("ElOption", { key: r, attrs: { value: r, label: r } });
1596
- }), 1)], 1), t("ElFormItem", { attrs: { label: "字段类型:", prop: "fieldType", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElSelect", { on: { input: e.changeFiledType }, model: { value: e.listenerFieldForm.fieldType, callback: function(r) {
1597
- e.$set(e.listenerFieldForm, "fieldType", r);
1598
- }, expression: "listenerFieldForm.fieldType" } }, e._l(Object.keys(e.fieldTypeObject), function(r) {
1599
- return t("ElOption", { key: r, attrs: { label: e.fieldTypeObject[r], value: r } });
1600
- }), 1)], 1), e.listenerFieldForm.fieldType === "string" ? t("ElFormItem", { key: "field-string", staticClass: "element-listeners-field-name", attrs: { label: "字段值:", prop: "string", rules: { required: !0, trigger: ["blur", "change"] } } }, [e.listenerFieldForm.name === "url" ? t("ElSelect", { attrs: { "default-first-option": "", "allow-create": "", filterable: "", clearable: "" }, model: { value: e.listenerFieldForm.string, callback: function(r) {
1601
- e.$set(e.listenerFieldForm, "string", r);
1602
- }, expression: "listenerFieldForm.string" } }, e._l(e.apis, function(r) {
1603
- return t("ElOption", { key: r, attrs: { value: r, label: r } });
1604
- }), 1) : e.listenerFieldForm.name === "serviceId" ? t("ElSelect", { attrs: { "default-first-option": "", "allow-create": "", filterable: "", clearable: "" }, model: { value: e.listenerFieldForm.string, callback: function(r) {
1605
- e.$set(e.listenerFieldForm, "string", r);
1606
- }, expression: "listenerFieldForm.string" } }, e._l(((a = e.context) == null ? void 0 : a.services) || [], function(r) {
1607
- return t("ElOption", { key: r, attrs: { value: r, label: r } });
1608
- }), 1) : t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerFieldForm.string, callback: function(r) {
1609
- e.$set(e.listenerFieldForm, "string", r);
1610
- }, expression: "listenerFieldForm.string" } })], 1) : e._e(), e.listenerFieldForm.fieldType === "expression" ? t("ElFormItem", { key: "field-expression", attrs: { label: "表达式:", prop: "expression", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerFieldForm.expression, callback: function(r) {
1611
- e.$set(e.listenerFieldForm, "expression", r);
1612
- }, expression: "listenerFieldForm.expression" } })], 1) : e._e()], 1)], 1)], 1);
1613
- }, nn = [], sn = /* @__PURE__ */ h(
1614
- en,
1615
- tn,
1616
- nn,
1617
- !1,
1618
- null,
1619
- null
1620
- );
1621
- const rn = sn.exports, an = {
1622
- name: "ElementProperties",
1623
- inject: {
1624
- prefix: "prefix",
1625
- width: "width"
1626
- },
1627
- props: {
1628
- id: String,
1629
- element: Object,
1630
- bpmnInstances: Object
1631
- },
1632
- data() {
1633
- return {
1634
- elementPropertyList: [],
1635
- propertyForm: {},
1636
- editingPropertyIndex: -1,
1637
- propertyFormModelVisible: !1
1638
- };
1639
- },
1640
- watch: {
1641
- id: {
1642
- immediate: !0,
1643
- handler(i) {
1644
- i && i.length && this.resetAttributesList();
1645
- }
1646
- }
1647
- },
1648
- methods: {
1649
- resetAttributesList() {
1650
- var i, e, t, n, s;
1651
- this.otherExtensionList = [], this.bpmnElementProperties = (n = (t = (e = (i = this.element.businessObject) == null ? void 0 : i.extensionElements) == null ? void 0 : e.values) == null ? void 0 : t.filter((a) => (a.$type !== `${this.prefix}:Properties` && this.otherExtensionList.push(a), a.$type === `${this.prefix}:Properties`))) != null ? n : [], this.bpmnElementPropertyList = this.bpmnElementProperties.reduce((a, r) => a.concat(r.values), []), this.elementPropertyList = v((s = this.bpmnElementPropertyList) != null ? s : []);
1652
- },
1653
- openAttributesForm(i, e) {
1654
- this.editingPropertyIndex = e, this.propertyForm = e === -1 ? {} : v(i), this.propertyFormModelVisible = !0, this.$nextTick(() => {
1655
- this.$refs.attributeFormRef && this.$refs.attributeFormRef.clearValidate();
1656
- });
1657
- },
1658
- removeAttributes(i, e) {
1659
- this.$confirm("确认移除该属性吗?", "提示", {
1660
- confirmButtonText: "确 认",
1661
- cancelButtonText: "取 消"
1662
- }).then(() => {
1663
- this.elementPropertyList.splice(e, 1), this.bpmnElementPropertyList.splice(e, 1);
1664
- const t = this.bpmnInstances.moddle.create(`${this.prefix}:Properties`, {
1665
- values: this.bpmnElementPropertyList
1666
- });
1667
- this.updateElementExtensions(t), this.resetAttributesList();
1668
- }).catch(() => {
1669
- });
1670
- },
1671
- saveAttribute() {
1672
- const { name: i, value: e } = this.propertyForm;
1673
- if (this.editingPropertyIndex !== -1)
1674
- this.bpmnInstances.modeling.updateModdleProperties(this.element, this.bpmnElementPropertyList[this.editingPropertyIndex], {
1675
- name: i,
1676
- value: e
1677
- });
1678
- else {
1679
- const t = this.bpmnInstances.moddle.create(`${this.prefix}:Property`, { name: i, value: e }), n = this.bpmnInstances.moddle.create(`${this.prefix}:Properties`, {
1680
- values: this.bpmnElementPropertyList.concat([t])
1681
- });
1682
- this.updateElementExtensions(n);
1683
- }
1684
- this.propertyFormModelVisible = !1, this.resetAttributesList();
1685
- },
1686
- updateElementExtensions(i) {
1687
- const e = this.bpmnInstances.moddle.create("bpmn:ExtensionElements", {
1688
- values: this.otherExtensionList.concat([i])
1689
- });
1690
- this.bpmnInstances.modeling.updateProperties(this.element, {
1691
- extensionElements: e
1692
- });
1693
- }
1694
- }
1695
- };
1696
- var on = function() {
1697
- var e = this, t = e._self._c;
1698
- return t("div", { staticClass: "panel-tab__content" }, [t("ElTable", { attrs: { data: e.elementPropertyList, size: "mini", "max-height": "240", border: "", fit: "" } }, [t("ElTableColumn", { attrs: { label: "序号", width: "50px", type: "index" } }), t("ElTableColumn", { attrs: { label: "属性名", prop: "name", "min-width": "100px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "属性值", prop: "value", "min-width": "100px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "操作", width: "90px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: n, $index: s }) {
1699
- return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1700
- return e.openAttributesForm(n, s);
1701
- } } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1702
- return e.removeAttributes(n, s);
1703
- } } }, [e._v("移除")])];
1704
- } }]) })], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(n) {
1705
- return e.openAttributesForm(null, -1);
1706
- } } }, [e._v("添加属性")])], 1), t("ElementDialog", { staticClass: "flow-dialog", attrs: { visible: e.propertyFormModelVisible, title: "属性配置", width: "600px", "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(n) {
1707
- e.propertyFormModelVisible = n;
1708
- } }, scopedSlots: e._u([{ key: "footer", fn: function() {
1709
- return [t("ElButton", { attrs: { size: "mini" }, on: { click: function(n) {
1710
- e.propertyFormModelVisible = !1;
1711
- } } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.saveAttribute } }, [e._v("确 定")])];
1712
- }, proxy: !0 }]) }, [t("ElForm", { ref: "attributeFormRef", attrs: { model: e.propertyForm, "label-width": "80px", size: "mini" }, nativeOn: { submit: function(n) {
1713
- n.preventDefault();
1714
- } } }, [t("ElFormItem", { attrs: { label: "属性名:", prop: "name" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.propertyForm.name, callback: function(n) {
1715
- e.$set(e.propertyForm, "name", n);
1716
- }, expression: "propertyForm.name" } })], 1), t("ElFormItem", { attrs: { label: "属性值:", prop: "value" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.propertyForm.value, callback: function(n) {
1717
- e.$set(e.propertyForm, "value", n);
1718
- }, expression: "propertyForm.value" } })], 1)], 1)], 1)], 1);
1719
- }, ln = [], pn = /* @__PURE__ */ h(
1720
- an,
1721
- on,
1722
- ln,
1723
- !1,
1724
- null,
1725
- null
1726
- );
1727
- const mn = pn.exports, cn = {
1728
- name: "ElementForm",
1729
- inject: {
1730
- prefix: "prefix",
1731
- width: "width"
1732
- },
1733
- props: {
1734
- id: String,
1735
- element: Object,
1736
- bpmnInstances: Object
1737
- },
1738
- data() {
1739
- return {
1740
- formKey: "",
1741
- businessKey: "",
1742
- optionModelTitle: "",
1743
- fieldList: [],
1744
- formFieldForm: {},
1745
- fieldType: {
1746
- long: "长整型",
1747
- string: "字符串",
1748
- boolean: "布尔类",
1749
- date: "日期类",
1750
- enum: "枚举类",
1751
- custom: "自定义类型"
1752
- },
1753
- formFieldIndex: -1,
1754
- // 编辑中的字段, -1 为新增
1755
- formFieldOptionIndex: -1,
1756
- // 编辑中的字段配置项, -1 为新增
1757
- fieldModelVisible: !1,
1758
- fieldOptionModelVisible: !1,
1759
- fieldOptionForm: {},
1760
- // 当前激活的字段配置项数据
1761
- fieldOptionType: "",
1762
- // 当前激活的字段配置项弹窗 类型
1763
- fieldEnumList: [],
1764
- // 枚举值列表
1765
- fieldConstraintsList: [],
1766
- // 约束条件列表
1767
- fieldPropertiesList: []
1768
- // 绑定属性列表
1769
- };
1770
- },
1771
- watch: {
1772
- id: {
1773
- immediate: !0,
1774
- handler(i) {
1775
- return c(this, null, function* () {
1776
- i && (yield this.$nextTick(), this.resetFormList());
1777
- });
1778
- }
1779
- }
1780
- },
1781
- methods: {
1782
- resetFormList() {
1783
- var i;
1784
- this.formKey = this.element.businessObject.formKey, this.elExtensionElements = this.element.businessObject.get("extensionElements") || this.bpmnInstances.moddle.create("bpmn:ExtensionElements", { values: [] }), this.formData = ((i = this.elExtensionElements.values.filter((e) => e.$type === `${this.prefix}:FormData`)) == null ? void 0 : i[0]) || this.bpmnInstances.moddle.create(`${this.prefix}:FormData`, { fields: [] }), this.businessKey = this.formData.businessKey, this.otherExtensions = this.elExtensionElements.values.filter((e) => e.$type !== `${this.prefix}:FormData`), this.fieldList = v(this.formData.fields || []), this.updateElementExtensions();
1785
- },
1786
- updateElementFormKey() {
1787
- this.bpmnInstances.modeling.updateProperties(this.element, { formKey: this.formKey });
1788
- },
1789
- updateElementBusinessKey() {
1790
- this.bpmnInstances.modeling.updateModdleProperties(this.element, this.formData, {
1791
- businessKey: this.businessKey
1792
- });
1793
- },
1794
- // 根据类型调整字段type
1795
- changeFieldTypeType(i) {
1796
- this.$set(this.formFieldForm, "type", i === "custom" ? "" : i);
1797
- },
1798
- // 打开字段详情侧边栏
1799
- openFieldForm(i, e) {
1800
- var t, n;
1801
- if (this.formFieldIndex = e, e !== -1) {
1802
- const s = this.formData.fields[e];
1803
- this.formFieldForm = v(i), this.$set(this.formFieldForm, "typeType", this.fieldType[i.type] ? i.type : "custom"), i.type === "enum" && (this.fieldEnumList = v((s == null ? void 0 : s.values) || [])), this.fieldConstraintsList = v(((t = s == null ? void 0 : s.validation) == null ? void 0 : t.constraints) || []), this.fieldPropertiesList = v(((n = s == null ? void 0 : s.properties) == null ? void 0 : n.values) || []);
1804
- } else
1805
- this.formFieldForm = {}, this.fieldEnumList = [], this.fieldConstraintsList = [], this.fieldPropertiesList = [];
1806
- this.fieldModelVisible = !0;
1807
- },
1808
- // 打开字段 某个 配置项 弹窗
1809
- openFieldOptionForm(i, e, t) {
1810
- return this.fieldOptionModelVisible = !0, this.fieldOptionType = t, this.formFieldOptionIndex = e, t === "property" ? (this.fieldOptionForm = i ? v(i) : {}, this.optionModelTitle = "属性配置") : t === "enum" ? (this.fieldOptionForm = i ? v(i) : {}, this.optionModelTitle = "枚举值配置") : (this.fieldOptionForm = i ? v(i) : {}, this.optionModelTitle = "约束条件配置");
1811
- },
1812
- // 保存字段 某个 配置项
1813
- saveFieldOption() {
1814
- 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 = {};
1815
- },
1816
- // 保存字段配置
1817
- saveField() {
1818
- const { id: i, type: e, label: t, defaultValue: n, datePattern: s } = this.formFieldForm, a = this.bpmnInstances.moddle.create(`${this.prefix}:FormField`, { id: i, type: e, label: t });
1819
- if (n && (a.defaultValue = n), s && (a.datePattern = s), this.fieldPropertiesList && this.fieldPropertiesList.length) {
1820
- const r = this.fieldPropertiesList.map((o) => this.bpmnInstances.moddle.create(`${this.prefix}:Property`, { id: o.id, value: o.value }));
1821
- a.properties = this.bpmnInstances.moddle.create(`${this.prefix}:Properties`, {
1822
- values: r
1823
- });
1824
- }
1825
- if (this.fieldConstraintsList && this.fieldConstraintsList.length) {
1826
- const r = this.fieldConstraintsList.map((o) => this.bpmnInstances.moddle.create(`${this.prefix}:Constraint`, { name: o.name, config: o.config }));
1827
- a.validation = this.bpmnInstances.moddle.create(`${this.prefix}:Validation`, {
1828
- constraints: r
1829
- });
1830
- }
1831
- this.fieldEnumList && this.fieldEnumList.length && (a.values = this.fieldEnumList.map((r) => this.bpmnInstances.moddle.create(`${this.prefix}:Value`, { name: r.name, id: r.id }))), this.formFieldIndex === -1 ? (this.fieldList.push(this.formFieldForm), this.formData.fields.push(a)) : (this.fieldList.splice(this.formFieldIndex, 1, this.formFieldForm), this.formData.fields.splice(this.formFieldIndex, 1, a)), this.updateElementExtensions(), this.fieldModelVisible = !1;
1832
- },
1833
- // 移除某个 字段的 配置项
1834
- removeFieldOptionItem(i, e, t) {
1835
- if (t === "property") {
1836
- this.fieldPropertiesList.splice(e, 1);
1837
- return;
1838
- }
1839
- if (t === "enum") {
1840
- this.fieldEnumList.splice(e, 1);
1841
- return;
1842
- }
1843
- this.fieldConstraintsList.splice(e, 1);
1844
- },
1845
- // 移除 字段
1846
- removeField(i, e) {
1847
- this.fieldList.splice(e, 1), this.formData.fields.splice(e, 1), this.updateElementExtensions();
1848
- },
1849
- updateElementExtensions() {
1850
- const i = this.bpmnInstances.moddle.create("bpmn:ExtensionElements", {
1851
- values: this.otherExtensions.concat(this.formData)
1852
- });
1853
- this.bpmnInstances.modeling.updateProperties(this.element, {
1854
- extensionElements: i
1855
- });
1856
- }
1857
- }
1858
- };
1859
- var un = function() {
1860
- var e = this, t = e._self._c;
1861
- return t("div", { staticClass: "panel-tab__content" }, [t("ElForm", { attrs: { size: "mini", "label-width": "80px" }, nativeOn: { submit: function(n) {
1862
- n.preventDefault();
1863
- } } }, [t("ElFormItem", { attrs: { label: "表单标识" } }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateElementFormKey }, model: { value: e.formKey, callback: function(n) {
1864
- e.formKey = n;
1865
- }, expression: "formKey" } })], 1), t("ElFormItem", { attrs: { label: "业务标识" } }, [t("ElSelect", { on: { change: e.updateElementBusinessKey }, model: { value: e.businessKey, callback: function(n) {
1866
- e.businessKey = n;
1867
- }, expression: "businessKey" } }, [e._l(e.fieldList, function(n) {
1868
- return t("ElOption", { key: n.id, attrs: { value: n.id, label: n.label } });
1869
- }), t("ElOption", { attrs: { label: "无", value: "" } })], 2)], 1)], 1), t("div", { staticClass: "element-property list-property" }, [t("ElDivider", [t("i", { staticClass: "el-icon-coin" }), e._v(" 表单字段")]), t("ElTable", { attrs: { data: e.fieldList, size: "mini", "max-height": "240", border: "", fit: "" } }, [t("ElTableColumn", { attrs: { label: "序号", type: "index", width: "50px" } }), t("ElTableColumn", { attrs: { label: "字段名称", prop: "label", "min-width": "80px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "字段类型", prop: "type", "min-width": "80px", formatter: (n) => e.fieldType[n.type] || n.type, "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "默认值", prop: "defaultValue", "min-width": "80px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "操作", width: "90px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: n, $index: s }) {
1870
- return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1871
- return e.openFieldForm(n, s);
1872
- } } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1873
- return e.removeField(n, s);
1874
- } } }, [e._v("移除")])];
1875
- } }]) })], 1)], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(n) {
1876
- return e.openFieldForm(null, -1);
1877
- } } }, [e._v("添加字段")])], 1), t("ElDrawer", { staticClass: "flow-drawer", attrs: { visible: e.fieldModelVisible, title: "字段配置", size: `${e.width}px`, "wrapper-closable": !1, "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(n) {
1878
- e.fieldModelVisible = n;
1879
- } } }, [t("ElForm", { attrs: { model: e.formFieldForm, "label-width": "90px", size: "mini" }, nativeOn: { submit: function(n) {
1880
- n.preventDefault();
1881
- } } }, [t("ElFormItem", { attrs: { label: "字段ID" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.id, callback: function(n) {
1882
- e.$set(e.formFieldForm, "id", n);
1883
- }, expression: "formFieldForm.id" } })], 1), t("ElFormItem", { attrs: { label: "类型" } }, [t("ElSelect", { attrs: { placeholder: "请选择字段类型", clearable: "" }, on: { change: e.changeFieldTypeType }, model: { value: e.formFieldForm.typeType, callback: function(n) {
1884
- e.$set(e.formFieldForm, "typeType", n);
1885
- }, expression: "formFieldForm.typeType" } }, e._l(e.fieldType, function(n, s) {
1886
- return t("ElOption", { key: s, attrs: { label: n, value: s } });
1887
- }), 1)], 1), e.formFieldForm.typeType === "custom" ? t("ElFormItem", { attrs: { label: "类型名称" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.type, callback: function(n) {
1888
- e.$set(e.formFieldForm, "type", n);
1889
- }, expression: "formFieldForm.type" } })], 1) : e._e(), t("ElFormItem", { attrs: { label: "名称" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.label, callback: function(n) {
1890
- e.$set(e.formFieldForm, "label", n);
1891
- }, expression: "formFieldForm.label" } })], 1), e.formFieldForm.typeType === "date" ? t("ElFormItem", { attrs: { label: "时间格式" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.datePattern, callback: function(n) {
1892
- e.$set(e.formFieldForm, "datePattern", n);
1893
- }, expression: "formFieldForm.datePattern" } })], 1) : e._e(), t("ElFormItem", { attrs: { label: "默认值" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.defaultValue, callback: function(n) {
1894
- e.$set(e.formFieldForm, "defaultValue", n);
1895
- }, expression: "formFieldForm.defaultValue" } })], 1)], 1), e.formFieldForm.type === "enum" ? [t("ElDivider", { key: "enum-divider" }), t("p", { key: "enum-title", staticClass: "listener-filed__title" }, [t("span", [t("i", { staticClass: "el-icon-menu" }), e._v("枚举值列表:")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: function(n) {
1896
- return e.openFieldOptionForm(null, -1, "enum");
1897
- } } }, [e._v("添加枚举值")])], 1), t("ElTable", { key: "enum-table", attrs: { data: e.fieldEnumList, size: "mini", "max-height": "240", border: "", fit: "" } }, [t("ElTableColumn", { attrs: { label: "序号", width: "50px", type: "index" } }), t("ElTableColumn", { attrs: { label: "枚举值编号", prop: "id", "min-width": "100px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "枚举值名称", prop: "name", "min-width": "100px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "操作", width: "90px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: n, $index: s }) {
1898
- return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1899
- return e.openFieldOptionForm(n, s, "enum");
1900
- } } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1901
- return e.removeFieldOptionItem(n, s, "enum");
1902
- } } }, [e._v("移除")])];
1903
- } }], null, !1, 747635382) })], 1)] : e._e(), t("ElDivider", { key: "validation-divider" }), t("p", { key: "validation-title", staticClass: "listener-filed__title", staticStyle: { "padding-bottom": "6px" } }, [t("span", [t("i", { staticClass: "el-icon-menu" }), e._v("约束条件列表:")]), t("ElButton", { staticStyle: { "margin-left": "auto" }, attrs: { size: "mini", type: "primary" }, on: { click: function(n) {
1904
- return e.openFieldOptionForm(null, -1, "constraint");
1905
- } } }, [e._v("添加约束")])], 1), t("ElTable", { key: "validation-table", attrs: { data: e.fieldConstraintsList, size: "mini", "max-height": "240", border: "", fit: "" } }, [t("ElTableColumn", { attrs: { label: "序号", width: "50px", type: "index" } }), t("ElTableColumn", { attrs: { label: "约束名称", prop: "name", "min-width": "100px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "约束配置", prop: "config", "min-width": "100px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "操作", width: "90px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: n, $index: s }) {
1906
- return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1907
- return e.openFieldOptionForm(n, s, "constraint");
1908
- } } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1909
- return e.removeFieldOptionItem(n, s, "constraint");
1910
- } } }, [e._v("移除")])];
1911
- } }]) })], 1), t("ElDivider", { key: "property-divider" }), t("p", { key: "property-title", staticClass: "listener-filed__title", staticStyle: { "padding-bottom": "6px" } }, [t("span", [t("i", { staticClass: "el-icon-menu" }), e._v("字段属性列表:")]), t("ElButton", { staticStyle: { "margin-left": "auto" }, attrs: { size: "mini", type: "primary" }, on: { click: function(n) {
1912
- return e.openFieldOptionForm(null, -1, "property");
1913
- } } }, [e._v("添加属性")])], 1), t("ElTable", { key: "property-table", attrs: { data: e.fieldPropertiesList, size: "mini", "max-height": "240", border: "", fit: "" } }, [t("ElTableColumn", { attrs: { label: "序号", width: "50px", type: "index" } }), t("ElTableColumn", { attrs: { label: "属性编号", prop: "id", "min-width": "100px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "属性值", prop: "value", "min-width": "100px", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "操作", width: "90px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: n, $index: s }) {
1914
- return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1915
- return e.openFieldOptionForm(n, s, "property");
1916
- } } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(a) {
1917
- return e.removeFieldOptionItem(n, s, "property");
1918
- } } }, [e._v("移除")])];
1919
- } }]) })], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini" }, on: { click: function(n) {
1920
- e.fieldModelVisible = !1;
1921
- } } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.saveField } }, [e._v("保 存")])], 1)], 2), t("ElementDialog", { staticClass: "flow-dialog", attrs: { visible: e.fieldOptionModelVisible, title: e.optionModelTitle, width: "600px", "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(n) {
1922
- e.fieldOptionModelVisible = n;
1923
- } }, scopedSlots: e._u([{ key: "footer", fn: function() {
1924
- return [t("ElButton", { attrs: { size: "mini" }, on: { click: function(n) {
1925
- e.fieldOptionModelVisible = !1;
1926
- } } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.saveFieldOption } }, [e._v("确 定")])];
1927
- }, proxy: !0 }]) }, [t("ElForm", { attrs: { model: e.fieldOptionForm, size: "mini", "label-width": "96px" }, nativeOn: { submit: function(n) {
1928
- n.preventDefault();
1929
- } } }, [e.fieldOptionType !== "constraint" ? t("ElFormItem", { key: "option-id", attrs: { label: "编号/ID" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.fieldOptionForm.id, callback: function(n) {
1930
- e.$set(e.fieldOptionForm, "id", n);
1931
- }, expression: "fieldOptionForm.id" } })], 1) : e._e(), e.fieldOptionType !== "property" ? t("ElFormItem", { key: "option-name", attrs: { label: "名称" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.fieldOptionForm.name, callback: function(n) {
1932
- e.$set(e.fieldOptionForm, "name", n);
1933
- }, expression: "fieldOptionForm.name" } })], 1) : e._e(), e.fieldOptionType === "constraint" ? t("ElFormItem", { key: "option-config", attrs: { label: "配置" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.fieldOptionForm.config, callback: function(n) {
1934
- e.$set(e.fieldOptionForm, "config", n);
1935
- }, expression: "fieldOptionForm.config" } })], 1) : e._e(), e.fieldOptionType === "property" ? t("ElFormItem", { key: "option-value", attrs: { label: "值" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.fieldOptionForm.value, callback: function(n) {
1936
- e.$set(e.fieldOptionForm, "value", n);
1937
- }, expression: "fieldOptionForm.value" } })], 1) : e._e()], 1)], 1)], 1);
1938
- }, dn = [], fn = /* @__PURE__ */ h(
1939
- cn,
1940
- un,
1941
- dn,
1942
- !1,
1943
- null,
1944
- null
1945
- );
1946
- const bn = fn.exports, yn = {
1947
- name: "UserTaskListeners",
1948
- inject: {
1949
- prefix: "prefix",
1950
- width: "width"
1951
- },
1952
- props: {
1953
- id: String,
1954
- element: Object,
1955
- bpmnInstances: Object
1956
- },
1957
- data() {
1958
- return {
1959
- elementListenersList: [],
1960
- listenerEventTypeObject: Xt,
1961
- listenerTypeObject: Ee,
1962
- listenerFormModelVisible: !1,
1963
- listenerForm: {},
1964
- fieldTypeObject: Fe,
1965
- fieldsListOfListener: [],
1966
- listenerFieldFormModelVisible: !1,
1967
- // 监听器 注入字段表单弹窗 显示状态
1968
- editingListenerIndex: -1,
1969
- // 监听器所在下标,-1 为新增
1970
- editingListenerFieldIndex: -1,
1971
- // 字段所在下标,-1 为新增
1972
- listenerFieldForm: {}
1973
- // 监听器 注入字段 详情表单
1974
- };
1975
- },
1976
- watch: {
1977
- id: {
1978
- immediate: !0,
1979
- handler(i) {
1980
- return c(this, null, function* () {
1981
- i && (yield this.$nextTick(), this.resetListenersList());
1982
- });
1983
- }
1984
- }
1985
- },
1986
- methods: {
1987
- resetListenersList() {
1988
- var i, e, t, n;
1989
- this.otherExtensionList = [], this.bpmnElementListeners = (n = (t = (e = (i = this.element.businessObject) == null ? void 0 : i.extensionElements) == null ? void 0 : e.values) == null ? void 0 : t.filter((s) => s.$type === `${this.prefix}:TaskListener`)) != null ? n : [], this.elementListenersList = this.bpmnElementListeners.map((s) => ve(s));
1990
- },
1991
- openListenerForm(i, e) {
1992
- return c(this, null, function* () {
1993
- var t;
1994
- i ? (this.listenerForm = ge(i), this.editingListenerIndex = e) : (this.listenerForm = {}, this.editingListenerIndex = -1), i && i.fields ? this.fieldsListOfListener = i.fields.map((n) => T(d({}, n), {
1995
- fieldType: n.string ? "string" : "expression"
1996
- })) : (this.fieldsListOfListener = [], this.$set(this.listenerForm, "fields", [])), this.listenerFormModelVisible = !0, yield this.$nextTick(), (t = this.$refs.listenerFormRef) == null || t.clearValidate();
1997
- });
1998
- },
1999
- // 移除监听器
2000
- removeListener(i, e) {
2001
- return c(this, null, function* () {
2002
- try {
2003
- yield this.$confirm("确认移除该监听器吗?", "提示"), this.bpmnElementListeners.splice(e, 1), this.elementListenersList.splice(e, 1), U(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners));
2004
- } catch (t) {
2005
- }
2006
- });
2007
- },
2008
- // 保存监听器
2009
- saveListenerConfig() {
2010
- return c(this, null, function* () {
2011
- var t, n, s, a;
2012
- if (!(yield this.$refs.listenerFormRef.validate())) return;
2013
- const e = he(this.bpmnInstances, this.listenerForm, !0, this.prefix);
2014
- this.editingListenerIndex === -1 ? (this.bpmnElementListeners.push(e), this.elementListenersList.push(this.listenerForm)) : (this.bpmnElementListeners.splice(this.editingListenerIndex, 1, e), this.elementListenersList.splice(this.editingListenerIndex, 1, this.listenerForm)), this.otherExtensionList = (a = (s = (n = (t = this.element.businessObject) == null ? void 0 : t.extensionElements) == null ? void 0 : n.values) == null ? void 0 : s.filter((r) => r.$type !== `${this.prefix}:TaskListener`)) != null ? a : [], U(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners)), this.listenerFormModelVisible = !1, this.listenerForm = {};
2015
- });
2016
- },
2017
- // 打开监听器字段编辑弹窗
2018
- openListenerFieldForm(i, e) {
2019
- return c(this, null, function* () {
2020
- var t;
2021
- this.listenerFieldForm = i ? v(i) : {}, this.editingListenerFieldIndex = i ? e : -1, this.listenerFieldFormModelVisible = !0, yield this.$nextTick(), (t = this.$refs.listenerFieldFormRef) == null || t.clearValidate();
2022
- });
2023
- },
2024
- // 保存监听器注入字段
2025
- saveListenerFiled() {
2026
- return c(this, null, function* () {
2027
- (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, yield this.$nextTick(), this.listenerFieldForm = {});
2028
- });
2029
- },
2030
- // 移除监听器字段
2031
- removeListenerField(i, e) {
2032
- return c(this, null, function* () {
2033
- try {
2034
- yield this.$confirm("确认移除该字段吗?", "提示"), this.fieldsListOfListener.splice(e, 1), this.listenerForm.fields.splice(e, 1);
2035
- } catch (t) {
2036
- }
2037
- });
2038
- }
2039
- }
2040
- };
2041
- var hn = function() {
2042
- var e = this, t = e._self._c;
2043
- return t("div", { staticClass: "panel-tab__content" }, [t("ElTable", { attrs: { data: e.elementListenersList, size: "mini", border: "" } }, [t("ElTableColumn", { attrs: { label: "序号", width: "50px", type: "index" } }), t("ElTableColumn", { attrs: { label: "事件类型", "min-width": "80px", "show-overflow-tooltip": "", formatter: (n) => e.listenerEventTypeObject[n.event] } }), t("ElTableColumn", { attrs: { label: "事件id", "min-width": "80px", prop: "id", "show-overflow-tooltip": "" } }), t("ElTableColumn", { attrs: { label: "监听器类型", "min-width": "80px", "show-overflow-tooltip": "", formatter: (n) => e.listenerTypeObject[n.listenerType] } }), t("ElTableColumn", { attrs: { label: "操作", width: "90px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: n, $index: s }) {
2044
- return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(a) {
2045
- return e.openListenerForm(n, s);
2046
- } } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(a) {
2047
- return e.removeListener(n, s);
2048
- } } }, [e._v("移除")])];
2049
- } }]) })], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(n) {
2050
- return e.openListenerForm(null);
2051
- } } }, [e._v("添加监听器")])], 1), t("ElDrawer", { staticClass: "flow-drawer", attrs: { visible: e.listenerFormModelVisible, title: "任务监听器", size: `${e.width}px`, "wrapper-closable": !1, "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(n) {
2052
- e.listenerFormModelVisible = n;
2053
- } } }, [t("ElForm", { ref: "listenerFormRef", attrs: { size: "mini", model: e.listenerForm, "label-width": "96px" }, nativeOn: { submit: function(n) {
2054
- n.preventDefault();
2055
- } } }, [t("ElFormItem", { attrs: { label: "事件类型", prop: "event", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElSelect", { model: { value: e.listenerForm.event, callback: function(n) {
2056
- e.$set(e.listenerForm, "event", n);
2057
- }, expression: "listenerForm.event" } }, e._l(Object.keys(e.listenerEventTypeObject), function(n) {
2058
- return t("ElOption", { key: n, attrs: { label: e.listenerEventTypeObject[n], value: n } });
2059
- }), 1)], 1), t("ElFormItem", { attrs: { label: "监听器ID", prop: "id", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.id, callback: function(n) {
2060
- e.$set(e.listenerForm, "id", n);
2061
- }, expression: "listenerForm.id" } })], 1), t("ElFormItem", { attrs: { label: "监听器类型", prop: "listenerType", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElSelect", { model: { value: e.listenerForm.listenerType, callback: function(n) {
2062
- e.$set(e.listenerForm, "listenerType", n);
2063
- }, expression: "listenerForm.listenerType" } }, e._l(Object.keys(e.listenerTypeObject), function(n) {
2064
- return t("ElOption", { key: n, attrs: { label: e.listenerTypeObject[n], value: n } });
2065
- }), 1)], 1), e.listenerForm.listenerType === "classListener" ? t("ElFormItem", { key: "listener-class", attrs: { label: "Java类", prop: "class", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.class, callback: function(n) {
2066
- e.$set(e.listenerForm, "class", n);
2067
- }, expression: "listenerForm.class" } })], 1) : e._e(), e.listenerForm.listenerType === "expressionListener" ? t("ElFormItem", { key: "listener-expression", attrs: { label: "表达式", prop: "expression", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.expression, callback: function(n) {
2068
- e.$set(e.listenerForm, "expression", n);
2069
- }, expression: "listenerForm.expression" } })], 1) : e._e(), e.listenerForm.listenerType === "delegateExpressionListener" ? t("ElFormItem", { key: "listener-delegate", attrs: { label: "代理表达式", prop: "delegateExpression", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.delegateExpression, callback: function(n) {
2070
- e.$set(e.listenerForm, "delegateExpression", n);
2071
- }, expression: "listenerForm.delegateExpression" } })], 1) : e._e(), e.listenerForm.listenerType === "scriptListener" ? [t("ElFormItem", { key: "listener-script-format", attrs: { label: "脚本格式", prop: "scriptFormat", rules: { required: !0, trigger: ["blur", "change"], message: "请填写脚本格式" } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.scriptFormat, callback: function(n) {
2072
- e.$set(e.listenerForm, "scriptFormat", n);
2073
- }, expression: "listenerForm.scriptFormat" } })], 1), t("ElFormItem", { key: "listener-script-type", attrs: { label: "脚本类型", prop: "scriptType", rules: { required: !0, trigger: ["blur", "change"], message: "请选择脚本类型" } } }, [t("ElSelect", { model: { value: e.listenerForm.scriptType, callback: function(n) {
2074
- e.$set(e.listenerForm, "scriptType", n);
2075
- }, expression: "listenerForm.scriptType" } }, [t("ElOption", { attrs: { label: "内联脚本", value: "inlineScript" } }), t("ElOption", { attrs: { label: "外部脚本", value: "externalScript" } })], 1)], 1), e.listenerForm.scriptType === "inlineScript" ? t("ElFormItem", { key: "listener-script", attrs: { label: "脚本内容", prop: "value", rules: { required: !0, trigger: ["blur", "change"], message: "请填写脚本内容" } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.value, callback: function(n) {
2076
- e.$set(e.listenerForm, "value", n);
2077
- }, expression: "listenerForm.value" } })], 1) : e._e(), e.listenerForm.scriptType === "externalScript" ? t("ElFormItem", { key: "listener-resource", attrs: { label: "资源地址", prop: "resource", rules: { required: !0, trigger: ["blur", "change"], message: "请填写资源地址" } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.resource, callback: function(n) {
2078
- e.$set(e.listenerForm, "resource", n);
2079
- }, expression: "listenerForm.resource" } })], 1) : e._e()] : e._e(), e.listenerForm.event === "timeout" ? [t("ElFormItem", { key: "eventDefinitionType", attrs: { label: "定时器类型", prop: "eventDefinitionType" } }, [t("ElSelect", { model: { value: e.listenerForm.eventDefinitionType, callback: function(n) {
2080
- e.$set(e.listenerForm, "eventDefinitionType", n);
2081
- }, expression: "listenerForm.eventDefinitionType" } }, [t("ElOption", { attrs: { label: "日期", value: "date" } }), t("ElOption", { attrs: { label: "持续时长", value: "duration" } }), t("ElOption", { attrs: { label: "循环", value: "cycle" } }), t("ElOption", { attrs: { label: "无", value: "null" } })], 1)], 1), e.listenerForm.eventDefinitionType && e.listenerForm.eventDefinitionType !== "null" ? t("ElFormItem", { key: "eventTimeDefinitions", attrs: { label: "定时器", prop: "eventTimeDefinitions", rules: { required: !0, trigger: ["blur", "change"], message: "请填写定时器配置" } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerForm.eventTimeDefinitions, callback: function(n) {
2082
- e.$set(e.listenerForm, "eventTimeDefinitions", n);
2083
- }, expression: "listenerForm.eventTimeDefinitions" } })], 1) : e._e()] : e._e()], 2), t("ElDivider"), t("p", { staticClass: "listener-filed__title", staticStyle: { "padding-bottom": "6px" } }, [t("span", [t("i", { staticClass: "el-icon-menu" }), e._v("注入字段:")]), t("ElButton", { staticStyle: { "margin-left": "auto" }, attrs: { size: "mini", type: "primary" }, on: { click: function(n) {
2084
- return e.openListenerFieldForm(null);
2085
- } } }, [e._v("添加字段")])], 1), t("ElTable", { staticStyle: { flex: "none" }, attrs: { data: e.fieldsListOfListener, size: "mini", "max-height": "240", border: "", fit: "" } }, [t("ElTableColumn", { attrs: { label: "序号", width: "50px", type: "index" } }), t("ElTableColumn", { attrs: { label: "字段名称", "min-width": "100px", prop: "name" } }), t("ElTableColumn", { attrs: { label: "字段类型", "min-width": "80px", "show-overflow-tooltip": "", formatter: (n) => e.fieldTypeObject[n.fieldType] } }), t("ElTableColumn", { attrs: { label: "字段值/表达式", "min-width": "100px", "show-overflow-tooltip": "", formatter: (n) => n.string || n.expression } }), t("ElTableColumn", { attrs: { label: "操作", width: "100px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: n, $index: s }) {
2086
- return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(a) {
2087
- return e.openListenerFieldForm(n, s);
2088
- } } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(a) {
2089
- return e.removeListenerField(n, s);
2090
- } } }, [e._v(" 移除 ")])];
2091
- } }]) })], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini" }, on: { click: function(n) {
2092
- e.listenerFormModelVisible = !1;
2093
- } } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.saveListenerConfig } }, [e._v("保 存")])], 1)], 1), t("ElementDialog", { staticClass: "flow-dialog", attrs: { title: "字段配置", visible: e.listenerFieldFormModelVisible, width: "600px", "append-to-body": "", "destroy-on-close": "" }, on: { "update:visible": function(n) {
2094
- e.listenerFieldFormModelVisible = n;
2095
- } }, scopedSlots: e._u([{ key: "footer", fn: function() {
2096
- return [t("ElButton", { attrs: { size: "mini" }, on: { click: function(n) {
2097
- e.listenerFieldFormModelVisible = !1;
2098
- } } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.saveListenerFiled } }, [e._v("确 定")])];
2099
- }, proxy: !0 }]) }, [t("ElForm", { ref: "listenerFieldFormRef", staticStyle: { height: "136px" }, attrs: { model: e.listenerFieldForm, size: "mini", "label-width": "96px" }, nativeOn: { submit: function(n) {
2100
- n.preventDefault();
2101
- } } }, [t("ElFormItem", { attrs: { label: "字段名称:", prop: "name", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerFieldForm.name, callback: function(n) {
2102
- e.$set(e.listenerFieldForm, "name", n);
2103
- }, expression: "listenerFieldForm.name" } })], 1), t("ElFormItem", { attrs: { label: "字段类型:", prop: "fieldType", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElSelect", { model: { value: e.listenerFieldForm.fieldType, callback: function(n) {
2104
- e.$set(e.listenerFieldForm, "fieldType", n);
2105
- }, expression: "listenerFieldForm.fieldType" } }, e._l(Object.keys(e.fieldTypeObject), function(n) {
2106
- return t("ElOption", { key: n, attrs: { label: e.fieldTypeObject[n], value: n } });
2107
- }), 1)], 1), e.listenerFieldForm.fieldType === "string" ? t("ElFormItem", { key: "field-string", attrs: { label: "字段值:", prop: "string", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerFieldForm.string, callback: function(n) {
2108
- e.$set(e.listenerFieldForm, "string", n);
2109
- }, expression: "listenerFieldForm.string" } })], 1) : e._e(), e.listenerFieldForm.fieldType === "expression" ? t("ElFormItem", { key: "field-expression", attrs: { label: "表达式:", prop: "expression", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerFieldForm.expression, callback: function(n) {
2110
- e.$set(e.listenerFieldForm, "expression", n);
2111
- }, expression: "listenerFieldForm.expression" } })], 1) : e._e()], 1)], 1)], 1);
2112
- }, gn = [], vn = /* @__PURE__ */ h(
2113
- yn,
2114
- hn,
2115
- gn,
2116
- !1,
2117
- null,
2118
- null
2119
- );
2120
- const En = vn.exports, le = ["base", "task", "form", "multiInstance"], Fn = {
482
+ autoPlace: ["type", ce]
483
+ }, re = ["base", "task", "form", "multiInstance"], Je = {
2121
484
  name: "PropertiesPanel",
2122
485
  componentName: "MyPropertiesPanel",
2123
486
  components: {
2124
- UserTaskListeners: En,
2125
- ElementForm: bn,
2126
- ElementProperties: mn,
2127
- ElementListeners: rn,
2128
- SignalAndMassage: Wt,
2129
- FlowCondition: qt,
2130
- ElementMultiInstance: jt,
2131
- ElementTask: Mt,
2132
- ElementOtherConfig: bt,
2133
- ElementBaseInfo: mt
487
+ UserTaskListeners: () => import("../chunks/UserTaskListeners.XXe5dC5I.mjs"),
488
+ ElementForm: () => import("../chunks/ElementForm.4QQYs5uq.mjs"),
489
+ ElementProperties: () => import("../chunks/ElementProperties.CRIQaaPc.mjs"),
490
+ ElementListeners: () => import("../chunks/ElementListeners.vfHHHAOL.mjs"),
491
+ SignalAndMassage: () => import("../chunks/SignalAndMessage.CH6L7cYu.mjs"),
492
+ FlowCondition: () => import("../chunks/FlowCondition.BfU9kw6h.mjs"),
493
+ ElementMultiInstance: () => import("../chunks/ElementMultiInstance.3Z28ewuh.mjs"),
494
+ ElementTask: () => import("../chunks/ElementTaskConfig.MBbkLrth.mjs"),
495
+ ElementOtherConfig: () => import("../chunks/ElementOtherConfig.B1NfMTYh.mjs"),
496
+ ElementBaseInfo: () => import("../chunks/ElementBaseInfo.jv89Vjy1.mjs")
2134
497
  },
2135
498
  provide() {
2136
499
  return {
@@ -2180,13 +543,16 @@ const En = vn.exports, le = ["base", "task", "form", "multiInstance"], Fn = {
2180
543
  idEditDisabled: {
2181
544
  type: Boolean,
2182
545
  default: !1
546
+ },
547
+ panelType: {
548
+ type: String
2183
549
  }
2184
550
  },
2185
551
  data() {
2186
552
  return {
2187
553
  element: {},
2188
554
  bpmnInstances: {},
2189
- activeTab: ["base"],
555
+ activeTab: this.panelType === "tab" ? "base" : ["base"],
2190
556
  elementId: "",
2191
557
  elementType: "",
2192
558
  conditionFormVisible: !1,
@@ -2202,18 +568,27 @@ const En = vn.exports, le = ["base", "task", "form", "multiInstance"], Fn = {
2202
568
  },
2203
569
  isNullOrUndefined() {
2204
570
  return this.useTabs === null || this.useTabs === void 0;
571
+ },
572
+ isTab() {
573
+ return this.panelType === "tab";
2205
574
  }
2206
575
  },
2207
576
  watch: {
2208
577
  activeTabs: {
2209
578
  immediate: !0,
2210
579
  handler() {
2211
- this.activeTab = le;
580
+ this.activeTab = this.isTab ? "base" : re;
2212
581
  }
2213
582
  },
2214
583
  elementId: {
2215
584
  handler() {
2216
- this.activeTab = le;
585
+ this.activeTab = this.isTab ? "base" : re;
586
+ }
587
+ },
588
+ isTab: {
589
+ immediate: !0,
590
+ handler(n) {
591
+ n ? this.activeTab = "base" : this.activeTab = ["base"];
2217
592
  }
2218
593
  }
2219
594
  },
@@ -2241,28 +616,35 @@ const En = vn.exports, le = ["base", "task", "form", "multiInstance"], Fn = {
2241
616
  getActiveElement() {
2242
617
  this.initFormOnChanged(null), this.bpmnModeler.on("import.done", () => {
2243
618
  this.bpmnModeler.get("canvas").zoom("fit-viewport", "center"), this.initFormOnChanged(null);
2244
- }), this.bpmnModeler.on("selection.changed", ({ newSelection: i }) => {
2245
- this.initFormOnChanged(i[0] || null);
2246
- }), this.bpmnModeler.on("element.changed", ({ element: i }) => {
2247
- i && i.id === this.elementId && this.initFormOnChanged(i);
619
+ }), this.bpmnModeler.on("selection.changed", ({ newSelection: n }) => {
620
+ this.initFormOnChanged(n[0] || null);
621
+ }), this.bpmnModeler.on("element.changed", ({ element: n }) => {
622
+ n && n.id === this.elementId && this.initFormOnChanged(n);
2248
623
  });
2249
624
  },
2250
625
  // 初始化数据
2251
- initFormOnChanged(i) {
626
+ initFormOnChanged(n) {
2252
627
  var t;
2253
- let e = i;
2254
- e || (e = (t = this.bpmnInstances.elementRegistry.find((n) => n.type === "bpmn:Process")) != null ? t : this.bpmnInstances.elementRegistry.find((n) => n.type === "bpmn:Collaboration")), e && (this.element = N(e), this.elementId = e.id, this.elementType = e.type.split(":")[1] || "", this.conditionFormVisible = !!(this.elementType === "SequenceFlow" && e.source && e.source.type.indexOf("StartEvent") === -1), this.formVisible = this.elementType === "UserTask");
628
+ let e = n;
629
+ e || (e = (t = this.bpmnInstances.elementRegistry.find((i) => i.type === "bpmn:Process")) != null ? t : this.bpmnInstances.elementRegistry.find((i) => i.type === "bpmn:Collaboration")), e && (this.element = N(e), this.elementId = e.id, this.elementType = e.type.split(":")[1] || "", this.conditionFormVisible = !!(this.elementType === "SequenceFlow" && e.source && e.source.type.indexOf("StartEvent") === -1), this.formVisible = this.elementType === "UserTask");
2255
630
  }
2256
631
  }
2257
632
  };
2258
- var xn = function() {
633
+ var Ze = function() {
634
+ var i, r;
2259
635
  var e = this, t = e._self._c;
2260
- return t("div", { class: ["process-panel__container", { show: e.isPanelVisible, hide: !e.isPanelVisible }], style: { width: `${e.isPanelVisible ? e.width : 34}px` }, on: { click: function(n) {
636
+ return t("div", { class: ["process-panel__container", { show: e.isPanelVisible, hide: !e.isPanelVisible }], style: { width: `${e.isPanelVisible ? e.width : 34}px` }, on: { click: function(a) {
2261
637
  e.isPanelVisible = !0;
2262
- } } }, [t("div", { staticStyle: { height: "40px", "line-height": "40px" } }, [t("i", { class: ["open-properties-handel", e.isPanelVisible ? "el-icon-caret-right" : "el-icon-caret-left"], on: { click: function(n) {
2263
- n.stopPropagation(), e.isPanelVisible = !e.isPanelVisible;
2264
- } } })]), t("ElCollapse", { directives: [{ name: "show", rawName: "v-show", value: e.isPanelVisible, expression: "isPanelVisible" }], model: { value: e.activeTab, callback: function(n) {
2265
- e.activeTab = n;
638
+ } } }, [t("div", { staticStyle: { height: "40px", "line-height": "40px" } }, [t("i", { class: ["open-properties-handel", e.isPanelVisible ? "el-icon-caret-right" : "el-icon-caret-left"], on: { click: function(a) {
639
+ a.stopPropagation(), e.isPanelVisible = !e.isPanelVisible;
640
+ } } }), e._v(" " + e._s(e.isPanelVisible ? (r = (i = e.element) == null ? void 0 : i.businessObject) == null ? void 0 : r.name : "") + " ")]), e.panelType === "tab" ? t("ElTabs", { directives: [{ name: "show", rawName: "v-show", value: e.isPanelVisible, expression: "isPanelVisible" }], model: { value: e.activeTab, callback: function(a) {
641
+ e.activeTab = a;
642
+ }, expression: "activeTab" } }, [e.isNullOrUndefined || e.isArray && e.useTabs.includes("base") ? t("ElTabPane", { attrs: { label: "常规", name: "base", lazy: "" } }, [t("ElementBaseInfo", { attrs: { id: e.elementId, "id-edit-disabled": e.idEditDisabled, type: e.elementType, element: e.element, "bpmn-instances": e.bpmnInstances } })], 1) : e._e(), (e.isNullOrUndefined || e.isArray && e.useTabs.includes("message")) && e.elementType === "Process" ? t("ElTabPane", { attrs: { label: "消息与信号", name: "message", lazy: "" } }, [t("SignalAndMassage", { attrs: { "bpmn-instances": e.bpmnInstances } })], 1) : e._e(), (e.isNullOrUndefined || e.isArray && e.useTabs.includes("condition")) && e.conditionFormVisible ? t("ElTabPane", { attrs: { label: "流转条件", name: "condition", lazy: "" } }, [t("SignalAndMassage", { attrs: { "bpmn-instances": e.bpmnInstances } })], 1) : e._e(), e.isNullOrUndefined || e.isArray && e.useTabs.includes("form") ? e._t("form", function() {
643
+ return [(e.isNullOrUndefined || e.isArray && e.useTabs.includes("base")) && e.formVisible ? t("ElTabPane", { key: "form", attrs: { label: "表单", name: "form", lazy: "" } }, [t("ElementForm", { attrs: { id: e.elementId, "bpmn-instances": e.bpmnInstances, element: e.element, type: e.elementType } })], 1) : e._e()];
644
+ }, { id: e.elementId, bpmnInstances: e.bpmnInstances, element: e.element, type: e.elementType }) : e._e(), e.isNullOrUndefined || e.isArray && e.useTabs.includes("task") ? e._t("task", function() {
645
+ return [e.elementType.indexOf("Task") !== -1 ? t("ElTabPane", { key: "task", attrs: { label: "任务", name: "task", lazy: "" } }, [t("ElementTask", { attrs: { id: e.elementId, "bpmn-instances": e.bpmnInstances, element: e.element, type: e.elementType } })], 1) : e._e()];
646
+ }, { id: e.elementId, bpmnInstances: e.bpmnInstances, element: e.element, type: e.elementType }) : e._e(), (e.isNullOrUndefined || e.isArray && e.useTabs.includes("multiInstance")) && e.elementType.indexOf("Task") !== -1 ? t("ElTabPane", { key: "multiInstance", attrs: { label: "多实例", name: "multiInstance", lazy: "" } }, [t("ElementMultiInstance", { attrs: { id: e.elementId, "bpmn-instances": e.bpmnInstances, element: e.element, type: e.elementType } })], 1) : e._e(), e.isNullOrUndefined || e.isArray && e.useTabs.includes("listeners") ? t("ElTabPane", { key: "listeners", attrs: { label: "执行监听器", name: "listeners", lazy: "" } }, [t("ElementListeners", { attrs: { id: e.elementId, "bpmn-instances": e.bpmnInstances, element: e.element, type: e.elementType } })], 1) : e._e(), (e.isNullOrUndefined || e.isArray && e.useTabs.includes("taskListeners")) && e.elementType === "UserTask" ? t("ElTabPane", { key: "taskListeners", attrs: { label: "任务监听器", name: "taskListeners", lazy: "" } }, [t("UserTaskListeners", { attrs: { id: e.elementId, "bpmn-instances": e.bpmnInstances, element: e.element, type: e.elementType } })], 1) : e._e(), e.isNullOrUndefined || e.isArray && e.useTabs.includes("extensions") ? t("ElTabPane", { key: "extensions", attrs: { label: "扩展属性", name: "extensions", lazy: "" } }, [t("ElementProperties", { attrs: { id: e.elementId, "bpmn-instances": e.bpmnInstances, element: e.element, type: e.elementType } })], 1) : e._e(), e.isNullOrUndefined || e.isArray && e.useTabs.includes("other") ? t("ElTabPane", { key: "other", attrs: { label: "其他", name: "other", lazy: "" } }, [t("ElementOtherConfig", { attrs: { id: e.elementId, element: e.element, "bpmn-instances": e.bpmnInstances } })], 1) : e._e(), e.isNullOrUndefined || e.isArray && e.useTabs.includes("extend") ? e._t("extend", null, { id: e.elementId, bpmnInstances: e.bpmnInstances, element: e.element, type: e.elementType }) : e._e()], 2) : t("ElCollapse", { directives: [{ name: "show", rawName: "v-show", value: e.isPanelVisible, expression: "isPanelVisible" }], model: { value: e.activeTab, callback: function(a) {
647
+ e.activeTab = a;
2266
648
  }, expression: "activeTab" } }, [e.isNullOrUndefined || e.isArray && e.useTabs.includes("base") ? t("ElCollapseItem", { attrs: { name: "base" }, scopedSlots: e._u([{ key: "title", fn: function() {
2267
649
  return [t("div", { staticClass: "panel-tab__title" }, [t("i", { staticClass: "el-icon-info" }), e._v("常规")])];
2268
650
  }, proxy: !0 }], null, !1, 2621733365) }, [t("ElementBaseInfo", { attrs: { id: e.elementId, "id-edit-disabled": e.idEditDisabled, type: e.elementType, element: e.element, "bpmn-instances": e.bpmnInstances } })], 1) : e._e(), (e.isNullOrUndefined || e.isArray && e.useTabs.includes("message")) && e.elementType === "Process" ? t("ElCollapseItem", { key: "message", attrs: { name: "message" }, scopedSlots: e._u([{ key: "title", fn: function() {
@@ -2292,43 +674,43 @@ var xn = function() {
2292
674
  }, proxy: !0 }], null, !1, 1854866151) }, [t("ElementProperties", { attrs: { id: e.elementId, "bpmn-instances": e.bpmnInstances, element: e.element, type: e.elementType } })], 1) : e._e(), e.isNullOrUndefined || e.isArray && e.useTabs.includes("other") ? t("ElCollapseItem", { key: "other", attrs: { name: "other" }, scopedSlots: e._u([{ key: "title", fn: function() {
2293
675
  return [t("div", { staticClass: "panel-tab__title" }, [t("i", { staticClass: "el-icon-s-promotion" }), e._v("其他")])];
2294
676
  }, proxy: !0 }], null, !1, 520255146) }, [t("ElementOtherConfig", { attrs: { id: e.elementId, element: e.element, "bpmn-instances": e.bpmnInstances } })], 1) : e._e(), e.isNullOrUndefined || e.isArray && e.useTabs.includes("extend") ? e._t("extend", null, { id: e.elementId, bpmnInstances: e.bpmnInstances, element: e.element, type: e.elementType }) : e._e()], 2)], 1);
2295
- }, Sn = [], Tn = /* @__PURE__ */ h(
2296
- Fn,
2297
- xn,
2298
- Sn,
677
+ }, He = [], qe = /* @__PURE__ */ J(
678
+ Je,
679
+ Ze,
680
+ He,
2299
681
  !1,
2300
682
  null,
2301
683
  null
2302
684
  );
2303
- const Cn = Tn.exports, In = (i, e, t) => (t = t || "camunda", `<?xml version="1.0" encoding="UTF-8"?>
685
+ const We = qe.exports, Xe = (n, e, t) => (t = t || "camunda", `<?xml version="1.0" encoding="UTF-8"?>
2304
686
  <bpmn2:definitions
2305
687
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2306
688
  xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
2307
689
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
2308
690
  xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
2309
691
  xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
2310
- id="diagram_${i}"
692
+ id="diagram_${n}"
2311
693
  targetNamespace="${{
2312
694
  activiti: "http://activiti.org/bpmn",
2313
695
  camunda: "http://bpmn.io/schema/bpmn",
2314
696
  flowable: "http://flowable.org/bpmn"
2315
697
  }[t]}">
2316
- <bpmn2:process id="${i}" name="${e}" isExecutable="true">
698
+ <bpmn2:process id="${n}" name="${e}" isExecutable="true">
2317
699
  </bpmn2:process>
2318
700
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
2319
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${i}">
701
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${n}">
2320
702
  </bpmndi:BPMNPlane>
2321
703
  </bpmndi:BPMNDiagram>
2322
704
  </bpmn2:definitions>`);
2323
- function kn(i) {
705
+ function Ke(n) {
2324
706
  return function(e, t) {
2325
- return t = t || {}, e = i[e] || e, e.replace(/{([^}]+)}/g, function(n, s) {
2326
- let a = t[s];
2327
- return i[t[s]] !== null && i[t[s]] !== void 0 && (a = i[t[s]]), a || `{${s}}`;
707
+ return t = t || {}, e = n[e] || e, e.replace(/{([^}]+)}/g, function(i, r) {
708
+ let a = t[r];
709
+ return n[t[r]] !== null && n[t[r]] !== void 0 && (a = n[t[r]]), a || `{${r}}`;
2328
710
  });
2329
711
  };
2330
712
  }
2331
- const _n = {
713
+ const Ye = {
2332
714
  // 添加部分
2333
715
  "Append EndEvent": "追加结束事件",
2334
716
  "Append Gateway": "追加网关",
@@ -2576,7 +958,7 @@ const _n = {
2576
958
  Data: "数据",
2577
959
  TextAnnotation: "文本说明",
2578
960
  Tasks: "任务"
2579
- }, W = [
961
+ }, q = [
2580
962
  {
2581
963
  name: "commentInForm",
2582
964
  isAttr: !0,
@@ -2597,7 +979,7 @@ const _n = {
2597
979
  isAttr: !0,
2598
980
  type: "String"
2599
981
  }
2600
- ], pe = {
982
+ ], ae = {
2601
983
  name: "Camunda",
2602
984
  uri: "http://camunda.org/schema/1.0/bpmn",
2603
985
  prefix: "camunda",
@@ -2919,7 +1301,7 @@ const _n = {
2919
1301
  isAttr: !0,
2920
1302
  type: "String"
2921
1303
  },
2922
- ...W
1304
+ ...q
2923
1305
  ]
2924
1306
  },
2925
1307
  {
@@ -3598,7 +1980,7 @@ const _n = {
3598
1980
  }
3599
1981
  ],
3600
1982
  emumerations: []
3601
- }, me = {
1983
+ }, se = {
3602
1984
  name: "Activiti",
3603
1985
  uri: "http://activiti.org/bpmn",
3604
1986
  prefix: "activiti",
@@ -3933,7 +2315,7 @@ const _n = {
3933
2315
  isAttr: !0,
3934
2316
  type: "String"
3935
2317
  },
3936
- ...W
2318
+ ...q
3937
2319
  ]
3938
2320
  },
3939
2321
  {
@@ -4583,7 +2965,7 @@ const _n = {
4583
2965
  }
4584
2966
  ],
4585
2967
  emumerations: []
4586
- }, ce = {
2968
+ }, oe = {
4587
2969
  name: "Flowable",
4588
2970
  uri: "http://flowable.org/bpmn",
4589
2971
  prefix: "flowable",
@@ -4906,7 +3288,7 @@ const _n = {
4906
3288
  isAttr: !0,
4907
3289
  type: "String"
4908
3290
  },
4909
- ...W
3291
+ ...q
4910
3292
  ]
4911
3293
  },
4912
3294
  {
@@ -5810,157 +4192,157 @@ const _n = {
5810
4192
  ]
5811
4193
  }
5812
4194
  ]
5813
- }, An = "*";
5814
- function A(i) {
4195
+ }, Qe = "*";
4196
+ function C(n) {
5815
4197
  const e = this;
5816
- i.on("moddleCopy.canCopyProperty", function(t) {
5817
- const n = t.property, s = t.parent;
5818
- return e.canCopyProperty(n, s);
4198
+ n.on("moddleCopy.canCopyProperty", function(t) {
4199
+ const i = t.property, r = t.parent;
4200
+ return e.canCopyProperty(i, r);
5819
4201
  });
5820
4202
  }
5821
- A.$inject = ["eventBus"];
5822
- A.prototype.canCopyProperty = function(i, e) {
5823
- if (we(i) && !wn(i, e) || k(i, "camunda:InputOutput") && !this.canHostInputOutput(e) || xe(i, ["camunda:Connector", "camunda:Field"]) && !this.canHostConnector(e) || k(i, "camunda:In") && !this.canHostIn(e))
4203
+ C.$inject = ["eventBus"];
4204
+ C.prototype.canCopyProperty = function(n, e) {
4205
+ if (he(n) && !et(n, e) || E(n, "camunda:InputOutput") && !this.canHostInputOutput(e) || de(n, ["camunda:Connector", "camunda:Field"]) && !this.canHostConnector(e) || E(n, "camunda:In") && !this.canHostIn(e))
5824
4206
  return !1;
5825
4207
  };
5826
- A.prototype.canHostInputOutput = function(i) {
5827
- if (x(i, "camunda:Connector"))
4208
+ C.prototype.canHostInputOutput = function(n) {
4209
+ if (v(n, "camunda:Connector"))
5828
4210
  return !0;
5829
- const t = x(i, "bpmn:FlowNode");
5830
- return !(!t || xe(t, ["bpmn:StartEvent", "bpmn:Gateway", "bpmn:BoundaryEvent"]) || k(t, "bpmn:SubProcess") && t.get("triggeredByEvent"));
4211
+ const t = v(n, "bpmn:FlowNode");
4212
+ return !(!t || de(t, ["bpmn:StartEvent", "bpmn:Gateway", "bpmn:BoundaryEvent"]) || E(t, "bpmn:SubProcess") && t.get("triggeredByEvent"));
5831
4213
  };
5832
- A.prototype.canHostConnector = function(i) {
5833
- const e = x(i, "camunda:ServiceTaskLike");
5834
- return k(e, "bpmn:MessageEventDefinition") ? x(i, "bpmn:IntermediateThrowEvent") || x(i, "bpmn:EndEvent") : !0;
4214
+ C.prototype.canHostConnector = function(n) {
4215
+ const e = v(n, "camunda:ServiceTaskLike");
4216
+ return E(e, "bpmn:MessageEventDefinition") ? v(n, "bpmn:IntermediateThrowEvent") || v(n, "bpmn:EndEvent") : !0;
5835
4217
  };
5836
- A.prototype.canHostIn = function(i) {
5837
- return x(i, "bpmn:CallActivity") ? !0 : x(i, "bpmn:SignalEventDefinition") ? x(i, "bpmn:IntermediateThrowEvent") || x(i, "bpmn:EndEvent") : !0;
4218
+ C.prototype.canHostIn = function(n) {
4219
+ return v(n, "bpmn:CallActivity") ? !0 : v(n, "bpmn:SignalEventDefinition") ? v(n, "bpmn:IntermediateThrowEvent") || v(n, "bpmn:EndEvent") : !0;
5838
4220
  };
5839
- function k(i, e) {
5840
- return i && $e(i.$instanceOf) && i.$instanceOf(e);
4221
+ function E(n, e) {
4222
+ return n && Ee(n.$instanceOf) && n.$instanceOf(e);
5841
4223
  }
5842
- function xe(i, e) {
5843
- return _(e, function(t) {
5844
- return k(i, t);
4224
+ function de(n, e) {
4225
+ return T(e, function(t) {
4226
+ return E(n, t);
5845
4227
  });
5846
4228
  }
5847
- function x(i, e) {
4229
+ function v(n, e) {
5848
4230
  if (!e)
5849
- return i.$parent;
5850
- if (k(i, e))
5851
- return i;
5852
- if (i.$parent)
5853
- return x(i.$parent, e);
4231
+ return n.$parent;
4232
+ if (E(n, e))
4233
+ return n;
4234
+ if (n.$parent)
4235
+ return v(n.$parent, e);
5854
4236
  }
5855
- function wn(i, e) {
5856
- const t = i.$type && i.$model.getTypeDescriptor(i.$type), n = t && t.meta && t.meta.allowedIn;
5857
- return !n || $n(n) ? !0 : _(n, function(s) {
5858
- return x(e, s);
4237
+ function et(n, e) {
4238
+ const t = n.$type && n.$model.getTypeDescriptor(n.$type), i = t && t.meta && t.meta.allowedIn;
4239
+ return !i || tt(i) ? !0 : T(i, function(r) {
4240
+ return v(e, r);
5859
4241
  });
5860
4242
  }
5861
- function $n(i) {
5862
- return i.indexOf(An) !== -1;
4243
+ function tt(n) {
4244
+ return n.indexOf(Qe) !== -1;
5863
4245
  }
5864
- const Ln = {
4246
+ const nt = {
5865
4247
  __init__: ["camundaModdleExtension"],
5866
- camundaModdleExtension: ["type", A]
5867
- }, On = {
4248
+ camundaModdleExtension: ["type", C]
4249
+ }, it = {
5868
4250
  FailedJobRetryTimeCycle: ["bpmn:StartEvent", "bpmn:BoundaryEvent", "bpmn:IntermediateCatchEvent", "bpmn:Activity"],
5869
4251
  Connector: ["bpmn:EndEvent", "bpmn:IntermediateThrowEvent"],
5870
4252
  Field: ["bpmn:EndEvent", "bpmn:IntermediateThrowEvent"]
5871
4253
  };
5872
- function X(i, e) {
5873
- return i && typeof i.$instanceOf == "function" && i.$instanceOf(e);
4254
+ function W(n, e) {
4255
+ return n && typeof n.$instanceOf == "function" && n.$instanceOf(e);
5874
4256
  }
5875
- function Pn(i) {
5876
- return i && i.length;
4257
+ function rt(n) {
4258
+ return n && n.length;
5877
4259
  }
5878
- function j(i, e) {
5879
- return Pn(i) && _(i, function(t) {
5880
- return X(t, e);
4260
+ function $(n, e) {
4261
+ return rt(n) && T(n, function(t) {
4262
+ return W(t, e);
5881
4263
  });
5882
4264
  }
5883
- function Mn(i, e) {
5884
- return _(e, function(t) {
5885
- return X(i, t);
4265
+ function at(n, e) {
4266
+ return T(e, function(t) {
4267
+ return W(n, t);
5886
4268
  });
5887
4269
  }
5888
- function q(i, e, t) {
5889
- const n = e.name, s = On[n.replace(/activiti:/, "")];
5890
- return n === i && Mn(t, s);
4270
+ function U(n, e, t) {
4271
+ const i = e.name, r = it[i.replace(/activiti:/, "")];
4272
+ return i === n && at(t, r);
5891
4273
  }
5892
- function Y(i) {
5893
- i.on(
4274
+ function X(n) {
4275
+ n.on(
5894
4276
  "property.clone",
5895
4277
  function(e) {
5896
- const t = e.newElement, n = e.propertyDescriptor;
5897
- this.canCloneProperty(t, n);
4278
+ const t = e.newElement, i = e.propertyDescriptor;
4279
+ this.canCloneProperty(t, i);
5898
4280
  },
5899
4281
  this
5900
4282
  );
5901
4283
  }
5902
- Y.$inject = ["eventBus"];
5903
- Y.prototype.canCloneProperty = function(i, e) {
5904
- if (q("activiti:FailedJobRetryTimeCycle", e, i))
5905
- return j(i.eventDefinitions, "bpmn:TimerEventDefinition") || j(i.eventDefinitions, "bpmn:SignalEventDefinition") || X(i.loopCharacteristics, "bpmn:MultiInstanceLoopCharacteristics");
5906
- if (q("activiti:Connector", e, i) || q("activiti:Field", e, i))
5907
- return j(i.eventDefinitions, "bpmn:MessageEventDefinition");
4284
+ X.$inject = ["eventBus"];
4285
+ X.prototype.canCloneProperty = function(n, e) {
4286
+ if (U("activiti:FailedJobRetryTimeCycle", e, n))
4287
+ return $(n.eventDefinitions, "bpmn:TimerEventDefinition") || $(n.eventDefinitions, "bpmn:SignalEventDefinition") || W(n.loopCharacteristics, "bpmn:MultiInstanceLoopCharacteristics");
4288
+ if (U("activiti:Connector", e, n) || U("activiti:Field", e, n))
4289
+ return $(n.eventDefinitions, "bpmn:MessageEventDefinition");
5908
4290
  };
5909
- const Dn = {
4291
+ const st = {
5910
4292
  __init__: ["ActivitiModdleExtension"],
5911
- ActivitiModdleExtension: ["type", Y]
5912
- }, Bn = {
4293
+ ActivitiModdleExtension: ["type", X]
4294
+ }, ot = {
5913
4295
  FailedJobRetryTimeCycle: ["bpmn:StartEvent", "bpmn:BoundaryEvent", "bpmn:IntermediateCatchEvent", "bpmn:Activity"],
5914
4296
  Connector: ["bpmn:EndEvent", "bpmn:IntermediateThrowEvent"],
5915
4297
  Field: ["bpmn:EndEvent", "bpmn:IntermediateThrowEvent"]
5916
4298
  };
5917
- function Q(i, e) {
5918
- return i && typeof i.$instanceOf == "function" && i.$instanceOf(e);
4299
+ function K(n, e) {
4300
+ return n && typeof n.$instanceOf == "function" && n.$instanceOf(e);
5919
4301
  }
5920
- function Rn(i) {
5921
- return i && i.length;
4302
+ function lt(n) {
4303
+ return n && n.length;
5922
4304
  }
5923
- function z(i, e) {
5924
- return Rn(i) && _(i, function(t) {
5925
- return Q(t, e);
4305
+ function V(n, e) {
4306
+ return lt(n) && T(n, function(t) {
4307
+ return K(t, e);
5926
4308
  });
5927
4309
  }
5928
- function Vn(i, e) {
5929
- return _(e, function(t) {
5930
- return Q(i, t);
4310
+ function pt(n, e) {
4311
+ return T(e, function(t) {
4312
+ return K(n, t);
5931
4313
  });
5932
4314
  }
5933
- function K(i, e, t) {
5934
- const n = e.name, s = Bn[n.replace(/flowable:/, "")];
5935
- return n === i && Vn(t, s);
4315
+ function G(n, e, t) {
4316
+ const i = e.name, r = ot[i.replace(/flowable:/, "")];
4317
+ return i === n && pt(t, r);
5936
4318
  }
5937
- function ee(i) {
5938
- i.on(
4319
+ function Y(n) {
4320
+ n.on(
5939
4321
  "property.clone",
5940
4322
  function(e) {
5941
- const t = e.newElement, n = e.propertyDescriptor;
5942
- this.canCloneProperty(t, n);
4323
+ const t = e.newElement, i = e.propertyDescriptor;
4324
+ this.canCloneProperty(t, i);
5943
4325
  },
5944
4326
  this
5945
4327
  );
5946
4328
  }
5947
- ee.$inject = ["eventBus"];
5948
- ee.prototype.canCloneProperty = function(i, e) {
5949
- if (K("flowable:FailedJobRetryTimeCycle", e, i))
5950
- return z(i.eventDefinitions, "bpmn:TimerEventDefinition") || z(i.eventDefinitions, "bpmn:SignalEventDefinition") || Q(i.loopCharacteristics, "bpmn:MultiInstanceLoopCharacteristics");
5951
- if (K("flowable:Connector", e, i) || K("flowable:Field", e, i))
5952
- return z(i.eventDefinitions, "bpmn:MessageEventDefinition");
4329
+ Y.$inject = ["eventBus"];
4330
+ Y.prototype.canCloneProperty = function(n, e) {
4331
+ if (G("flowable:FailedJobRetryTimeCycle", e, n))
4332
+ return V(n.eventDefinitions, "bpmn:TimerEventDefinition") || V(n.eventDefinitions, "bpmn:SignalEventDefinition") || K(n.loopCharacteristics, "bpmn:MultiInstanceLoopCharacteristics");
4333
+ if (G("flowable:Connector", e, n) || G("flowable:Field", e, n))
4334
+ return V(n.eventDefinitions, "bpmn:MessageEventDefinition");
5953
4335
  };
5954
- const jn = {
4336
+ const mt = {
5955
4337
  __init__: ["FlowableModdleExtension"],
5956
- FlowableModdleExtension: ["type", ee]
4338
+ FlowableModdleExtension: ["type", Y]
5957
4339
  };
5958
- de.registerLanguage("xml", Ue);
5959
- de.registerLanguage("json", Ge);
5960
- const zn = {
4340
+ pe.registerLanguage("xml", De);
4341
+ pe.registerLanguage("json", Be);
4342
+ const ut = {
5961
4343
  name: "ProcessDesigner",
5962
4344
  components: {
5963
- HighlightJS: qe
4345
+ HighlightJS: Oe
5964
4346
  },
5965
4347
  componentName: "MyProcessDesigner",
5966
4348
  props: {
@@ -6006,12 +4388,12 @@ const zn = {
6006
4388
  headerButtonSize: {
6007
4389
  type: String,
6008
4390
  default: "small",
6009
- validator: (i) => ["default", "medium", "small", "mini"].indexOf(i) !== -1
4391
+ validator: (n) => ["default", "medium", "small", "mini"].indexOf(n) !== -1
6010
4392
  },
6011
4393
  headerButtonType: {
6012
4394
  type: String,
6013
4395
  default: "primary",
6014
- validator: (i) => ["default", "primary", "success", "warning", "danger", "info"].indexOf(i) !== -1
4396
+ validator: (n) => ["default", "primary", "success", "warning", "danger", "info"].indexOf(n) !== -1
6015
4397
  },
6016
4398
  extendTypes: Array
6017
4399
  },
@@ -6028,29 +4410,29 @@ const zn = {
6028
4410
  },
6029
4411
  computed: {
6030
4412
  additionalModules() {
6031
- const i = [];
4413
+ const n = [];
6032
4414
  if (this.onlyCustomizeAddi)
6033
- return ie(this.additionalModel) ? this.additionalModel || [] : [this.additionalModel];
6034
- ie(this.additionalModel) ? i.push(...this.additionalModel) : this.additionalModel && i.push(this.additionalModel);
4415
+ return ne(this.additionalModel) ? this.additionalModel || [] : [this.additionalModel];
4416
+ ne(this.additionalModel) ? n.push(...this.additionalModel) : this.additionalModel && n.push(this.additionalModel);
6035
4417
  const e = {
6036
- translate: ["value", kn(this.translations || _n)]
4418
+ translate: ["value", Ke(this.translations || Ye)]
6037
4419
  };
6038
- return i.push(e), this.simulation && i.push(Ne), i.push(ze), this.prefix === "camunda" && i.push(Ln), this.prefix === "flowable" && i.push(jn), this.prefix === "activiti" && i.push(Dn), i;
4420
+ return n.push(e), this.simulation && n.push(Me), n.push(_e), this.prefix === "camunda" && n.push(nt), this.prefix === "flowable" && n.push(mt), this.prefix === "activiti" && n.push(st), n;
6039
4421
  },
6040
4422
  moddleExtensions() {
6041
- const i = {};
4423
+ const n = {};
6042
4424
  if (this.onlyCustomizeModdle)
6043
4425
  return this.moddleExtension || null;
6044
4426
  if (this.moddleExtension)
6045
4427
  for (const e in this.moddleExtension)
6046
- i[e] = this.moddleExtension[e];
6047
- return this.prefix === "activiti" && (i.activiti = T(d({}, me), {
6048
- types: [...me.types, ...this.extendTypes || []]
6049
- })), this.prefix === "flowable" && (i.flowable = T(d({}, ce), {
6050
- types: [...ce.types, ...this.extendTypes || []]
6051
- })), this.prefix === "camunda" && (i.camunda = T(d({}, pe), {
6052
- types: [...pe.types, ...this.extendTypes || []]
6053
- })), i;
4428
+ n[e] = this.moddleExtension[e];
4429
+ return this.prefix === "activiti" && (n.activiti = L(P({}, se), {
4430
+ types: [...se.types, ...this.extendTypes || []]
4431
+ })), this.prefix === "flowable" && (n.flowable = L(P({}, oe), {
4432
+ types: [...oe.types, ...this.extendTypes || []]
4433
+ })), this.prefix === "camunda" && (n.camunda = L(P({}, ae), {
4434
+ types: [...ae.types, ...this.extendTypes || []]
4435
+ })), n;
6054
4436
  }
6055
4437
  },
6056
4438
  mounted() {
@@ -6061,7 +4443,7 @@ const zn = {
6061
4443
  methods: {
6062
4444
  initBpmnModeler() {
6063
4445
  this.bpmnModeler || (this.bpmnModeler = N(
6064
- new je(d({
4446
+ new ke(P({
6065
4447
  container: this.$refs["bpmn-canvas"],
6066
4448
  keyboard: this.keyboard ? { bindTo: document } : null,
6067
4449
  additionalModules: this.additionalModules,
@@ -6070,35 +4452,35 @@ const zn = {
6070
4452
  ), this.$emit("init-finished", this.bpmnModeler), this.initModelListeners());
6071
4453
  },
6072
4454
  initModelListeners() {
6073
- const i = this.bpmnModeler.get("eventBus"), e = this;
4455
+ const n = this.bpmnModeler.get("eventBus"), e = this;
6074
4456
  this.events.forEach((t) => {
6075
- i.on(t, function(n) {
6076
- const s = t.replace(/\./g, "-"), a = n ? n.element : null;
6077
- e.$emit(s, a, n);
4457
+ n.on(t, function(i) {
4458
+ const r = t.replace(/\./g, "-"), a = i ? i.element : null;
4459
+ e.$emit(r, a, i);
6078
4460
  });
6079
- }), i.on("commandStack.changed", (t) => c(this, null, function* () {
4461
+ }), n.on("commandStack.changed", (t) => w(this, null, function* () {
6080
4462
  try {
6081
4463
  this.recoverable = this.bpmnModeler.get("commandStack").canRedo(), this.revocable = this.bpmnModeler.get("commandStack").canUndo();
6082
- const { xml: n } = yield this.bpmnModeler.saveXML({ format: !0 });
6083
- this.$emit("commandStack-changed", t), this.$emit("input", n), this.$emit("change", n);
6084
- } catch (n) {
6085
- console.error(`[Process Designer Warn]: ${n.message || n}`);
4464
+ const { xml: i } = yield this.bpmnModeler.saveXML({ format: !0 });
4465
+ this.$emit("commandStack-changed", t), this.$emit("input", i), this.$emit("change", i);
4466
+ } catch (i) {
4467
+ console.error(`[Process Designer Warn]: ${i.message || i}`);
6086
4468
  }
6087
4469
  })), this.bpmnModeler.on("canvas.viewbox.changed", ({ viewbox: t }) => {
6088
4470
  this.$emit("canvas-viewbox-changed", { viewbox: t });
6089
- const { scale: n } = t;
6090
- this.defaultZoom = Math.floor(n * 100) / 100;
4471
+ const { scale: i } = t;
4472
+ this.defaultZoom = Math.floor(i * 100) / 100;
6091
4473
  });
6092
4474
  },
6093
4475
  /* 创建新的流程图 */
6094
- createNewDiagram(i) {
6095
- return c(this, null, function* () {
6096
- const e = this.processId || `Process_${(/* @__PURE__ */ new Date()).getTime()}`, t = this.processName || `业务流程_${(/* @__PURE__ */ new Date()).getTime()}`, n = i || In(e, t, this.prefix);
4476
+ createNewDiagram(n) {
4477
+ return w(this, null, function* () {
4478
+ const e = this.processId || `Process_${(/* @__PURE__ */ new Date()).getTime()}`, t = this.processName || `业务流程_${(/* @__PURE__ */ new Date()).getTime()}`, i = n || Xe(e, t, this.prefix);
6097
4479
  try {
6098
- const { warnings: s } = yield this.bpmnModeler.importXML(n);
6099
- this.bpmnModeler.get("canvas").zoom("fit-viewport", "center"), s != null && s.length;
6100
- } catch (s) {
6101
- console.error(`[Process Designer Warn]: ${(s == null ? void 0 : s.message) || s}`);
4480
+ const { warnings: r } = yield this.bpmnModeler.importXML(i);
4481
+ this.bpmnModeler.get("canvas").zoom("fit-viewport", "center"), r != null && r.length;
4482
+ } catch (r) {
4483
+ console.error(`[Process Designer Warn]: ${(r == null ? void 0 : r.message) || r}`);
6102
4484
  }
6103
4485
  });
6104
4486
  },
@@ -6107,48 +4489,48 @@ const zn = {
6107
4489
  * @param {string} type
6108
4490
  * @param {*} name
6109
4491
  */
6110
- downloadProcess(i, e = "diagram") {
6111
- return c(this, null, function* () {
4492
+ downloadProcess(n, e = "diagram") {
4493
+ return w(this, null, function* () {
6112
4494
  try {
6113
- const { err: n, xml: s } = yield this.bpmnModeler.saveXML();
6114
- n && console.error(`[Process Designer Warn ]: ${n.message || n}`);
6115
- const a = new se(), { definitions: r } = a.xml2js(s);
6116
- if (e = r.process._name || e, i === "xml" || i === "bpmn") {
6117
- const { href: o, filename: p } = this.setEncoded(i.toUpperCase(), e, s);
6118
- t(o, p);
4495
+ const { err: i, xml: r } = yield this.bpmnModeler.saveXML();
4496
+ i && console.error(`[Process Designer Warn ]: ${i.message || i}`);
4497
+ const a = new te(), { definitions: l } = a.xml2js(r);
4498
+ if (e = l.process._name || e, n === "xml" || n === "bpmn") {
4499
+ const { href: o, filename: m } = this.setEncoded(n.toUpperCase(), e, r);
4500
+ t(o, m);
6119
4501
  } else {
6120
- const { err: o, svg: p } = yield this.bpmnModeler.saveSVG();
4502
+ const { err: o, svg: m } = yield this.bpmnModeler.saveSVG();
6121
4503
  if (o)
6122
4504
  return console.error(o);
6123
- const { href: E, filename: m } = this.setEncoded("SVG", e, p);
6124
- t(E, m);
4505
+ const { href: g, filename: p } = this.setEncoded("SVG", e, m);
4506
+ t(g, p);
6125
4507
  }
6126
- } catch (n) {
6127
- console.error(`[Process Designer Warn ]: ${n.message || n}`);
4508
+ } catch (i) {
4509
+ console.error(`[Process Designer Warn ]: ${i.message || i}`);
6128
4510
  }
6129
- function t(n, s) {
6130
- if (n && s) {
4511
+ function t(i, r) {
4512
+ if (i && r) {
6131
4513
  const a = document.createElement("a");
6132
- a.download = s, a.href = n, a.click(), URL.revokeObjectURL(a.href);
4514
+ a.download = r, a.href = i, a.click(), URL.revokeObjectURL(a.href);
6133
4515
  }
6134
4516
  }
6135
4517
  });
6136
4518
  },
6137
4519
  // 根据所需类型进行转码并返回下载地址
6138
- setEncoded(i, e = "diagram", t) {
6139
- const n = encodeURIComponent(t);
4520
+ setEncoded(n, e = "diagram", t) {
4521
+ const i = encodeURIComponent(t);
6140
4522
  return {
6141
- filename: `${e}.${i}`,
6142
- href: `data:application/${i === "svg" ? "text/xml" : "bpmn20-xml"};charset=UTF-8,${n}`,
4523
+ filename: `${e}.${n}`,
4524
+ href: `data:application/${n === "svg" ? "text/xml" : "bpmn20-xml"};charset=UTF-8,${i}`,
6143
4525
  data: t
6144
4526
  };
6145
4527
  },
6146
4528
  // 加载本地文件
6147
4529
  importLocalFile() {
6148
- const i = this, e = this.$refs.refFile.files[0], t = new FileReader();
4530
+ const n = this, e = this.$refs.refFile.files[0], t = new FileReader();
6149
4531
  t.readAsText(e), t.onload = function() {
6150
- const n = this.result;
6151
- i.createNewDiagram(n);
4532
+ const i = this.result;
4533
+ n.createNewDiagram(i);
6152
4534
  };
6153
4535
  },
6154
4536
  /* ------------------------------------------------ refs methods ------------------------------------------------------ */
@@ -6170,24 +4552,24 @@ const zn = {
6170
4552
  processUndo() {
6171
4553
  this.bpmnModeler.get("commandStack").undo();
6172
4554
  },
6173
- processZoomIn(i = 0.1) {
6174
- const e = Math.floor(this.defaultZoom * 100 + i * 100) / 100;
4555
+ processZoomIn(n = 0.1) {
4556
+ const e = Math.floor(this.defaultZoom * 100 + n * 100) / 100;
6175
4557
  if (e > 4)
6176
4558
  throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");
6177
4559
  this.defaultZoom = e, this.bpmnModeler.get("canvas").zoom(this.defaultZoom);
6178
4560
  },
6179
- processZoomOut(i = 0.1) {
6180
- const e = Math.floor(this.defaultZoom * 100 - i * 100) / 100;
4561
+ processZoomOut(n = 0.1) {
4562
+ const e = Math.floor(this.defaultZoom * 100 - n * 100) / 100;
6181
4563
  if (e < 0.2)
6182
4564
  throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");
6183
4565
  this.defaultZoom = e, this.bpmnModeler.get("canvas").zoom(this.defaultZoom);
6184
4566
  },
6185
- processZoomTo(i = 1) {
6186
- if (i < 0.2)
4567
+ processZoomTo(n = 1) {
4568
+ if (n < 0.2)
6187
4569
  throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");
6188
- if (i > 4)
4570
+ if (n > 4)
6189
4571
  throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");
6190
- this.defaultZoom = i, this.bpmnModeler.get("canvas").zoom(i);
4572
+ this.defaultZoom = n, this.bpmnModeler.get("canvas").zoom(n);
6191
4573
  },
6192
4574
  processReZoom() {
6193
4575
  this.defaultZoom = 1, this.bpmnModeler.get("canvas").zoom("fit-viewport", "auto");
@@ -6195,9 +4577,9 @@ const zn = {
6195
4577
  processRestart() {
6196
4578
  this.recoverable = !1, this.revocable = !1, this.createNewDiagram(null);
6197
4579
  },
6198
- elementsAlign(i) {
6199
- const e = this.bpmnModeler.get("alignElements"), n = this.bpmnModeler.get("selection").get();
6200
- if (!n || n.length <= 1) {
4580
+ elementsAlign(n) {
4581
+ const e = this.bpmnModeler.get("alignElements"), i = this.bpmnModeler.get("selection").get();
4582
+ if (!i || i.length <= 1) {
6201
4583
  this.$message.warning("请按住 Shift 键选择多个元素对齐");
6202
4584
  return;
6203
4585
  }
@@ -6205,77 +4587,77 @@ const zn = {
6205
4587
  confirmButtonText: "确定",
6206
4588
  cancelButtonText: "取消",
6207
4589
  type: "warning"
6208
- }).then(() => e.trigger(n, i));
4590
+ }).then(() => e.trigger(i, n));
6209
4591
  },
6210
4592
  /* ----------------------------- 方法结束 --------------------------------- */
6211
4593
  previewProcessXML() {
6212
- this.bpmnModeler.saveXML({ format: !0 }).then(({ xml: i }) => {
6213
- this.previewResult = i, this.previewType = "xml", this.previewModelVisible = !0;
4594
+ this.bpmnModeler.saveXML({ format: !0 }).then(({ xml: n }) => {
4595
+ this.previewResult = n, this.previewType = "xml", this.previewModelVisible = !0;
6214
4596
  });
6215
4597
  },
6216
4598
  previewProcessJson() {
6217
- const i = new se();
4599
+ const n = new te();
6218
4600
  this.bpmnModeler.saveXML({ format: !0 }).then(({ xml: e }) => {
6219
- const { definitions: t } = i.xml2js(e);
4601
+ const { definitions: t } = n.xml2js(e);
6220
4602
  t ? this.previewResult = JSON.stringify(t, null, 4) : this.previewResult = "", this.previewType = "json", this.previewModelVisible = !0;
6221
4603
  });
6222
4604
  }
6223
4605
  }
6224
4606
  };
6225
- var Nn = function() {
4607
+ var ct = function() {
6226
4608
  var e = this, t = e._self._c;
6227
4609
  return t("div", { staticClass: "my-process-designer" }, [t("div", { staticClass: "my-process-designer__header" }, [e._t("control-header", function() {
6228
- return [t("ElButtonGroup", { key: "file-control" }, [e._t("toolbar-buttons"), e.simulation ? t("ElTooltip", { attrs: { effect: "light", content: "导入流程" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, type: e.headerButtonType, icon: "el-icon-folder-opened" }, on: { click: function(n) {
4610
+ return [t("ElButtonGroup", { key: "file-control" }, [e._t("toolbar-buttons"), e.simulation ? t("ElTooltip", { attrs: { effect: "light", content: "导入流程" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, type: e.headerButtonType, icon: "el-icon-folder-opened" }, on: { click: function(i) {
6229
4611
  return e.$refs.refFile.click();
6230
4612
  } } }, [e._v(" 导入 ")])], 1) : e._e(), t("ElTooltip", { attrs: { effect: "light" }, scopedSlots: e._u([{ key: "content", fn: function() {
6231
- return [t("ElButton", { attrs: { size: e.headerButtonSize, type: "text" }, on: { click: function(n) {
4613
+ return [t("ElButton", { attrs: { size: e.headerButtonSize, type: "text" }, on: { click: function(i) {
6232
4614
  return e.downloadProcessAsXml();
6233
- } } }, [e._v("下载为XML文件")]), t("br"), t("ElButton", { attrs: { size: e.headerButtonSize, type: "text" }, on: { click: function(n) {
4615
+ } } }, [e._v("下载为XML文件")]), t("br"), t("ElButton", { attrs: { size: e.headerButtonSize, type: "text" }, on: { click: function(i) {
6234
4616
  return e.downloadProcessAsSvg();
6235
- } } }, [e._v("下载为SVG文件")]), t("br"), t("ElButton", { attrs: { size: e.headerButtonSize, type: "text" }, on: { click: function(n) {
4617
+ } } }, [e._v("下载为SVG文件")]), t("br"), t("ElButton", { attrs: { size: e.headerButtonSize, type: "text" }, on: { click: function(i) {
6236
4618
  return e.downloadProcessAsBpmn();
6237
4619
  } } }, [e._v("下载为BPMN文件")])];
6238
4620
  }, proxy: !0 }]) }, [t("ElButton", { attrs: { size: e.headerButtonSize, type: e.headerButtonType, icon: "el-icon-download" } }, [e._v("下载")])], 1), t("ElTooltip", { attrs: { effect: "light" }, scopedSlots: e._u([{ key: "content", fn: function() {
6239
4621
  return [t("ElButton", { attrs: { size: e.headerButtonSize, type: "text" }, on: { click: e.previewProcessXML } }, [e._v("预览XML")]), t("br"), t("ElButton", { attrs: { size: e.headerButtonSize, type: "text" }, on: { click: e.previewProcessJson } }, [e._v("预览JSON")])];
6240
- }, proxy: !0 }]) }, [t("ElButton", { attrs: { size: e.headerButtonSize, type: e.headerButtonType, icon: "el-icon-view" } }, [e._v("预览")])], 1), e.simulation ? t("ElTooltip", { attrs: { effect: "light", content: e.simulationStatus ? "退出模拟" : "开启模拟" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, type: e.headerButtonType, icon: "el-icon-cpu" }, on: { click: e.processSimulation } }, [e._v(" 模拟 ")])], 1) : e._e()], 2), t("ElButtonGroup", { key: "align-control" }, [t("ElTooltip", { attrs: { effect: "light", content: "向左对齐" } }, [t("ElButton", { staticClass: "align align-left", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(n) {
4622
+ }, proxy: !0 }]) }, [t("ElButton", { attrs: { size: e.headerButtonSize, type: e.headerButtonType, icon: "el-icon-view" } }, [e._v("预览")])], 1), e.simulation ? t("ElTooltip", { attrs: { effect: "light", content: e.simulationStatus ? "退出模拟" : "开启模拟" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, type: e.headerButtonType, icon: "el-icon-cpu" }, on: { click: e.processSimulation } }, [e._v(" 模拟 ")])], 1) : e._e()], 2), t("ElButtonGroup", { key: "align-control" }, [t("ElTooltip", { attrs: { effect: "light", content: "向左对齐" } }, [t("ElButton", { staticClass: "align align-left", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(i) {
6241
4623
  return e.elementsAlign("left");
6242
- } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "向右对齐" } }, [t("ElButton", { staticClass: "align align-right", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(n) {
4624
+ } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "向右对齐" } }, [t("ElButton", { staticClass: "align align-right", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(i) {
6243
4625
  return e.elementsAlign("right");
6244
- } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "向上对齐" } }, [t("ElButton", { staticClass: "align align-top", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(n) {
4626
+ } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "向上对齐" } }, [t("ElButton", { staticClass: "align align-top", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(i) {
6245
4627
  return e.elementsAlign("top");
6246
- } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "向下对齐" } }, [t("ElButton", { staticClass: "align align-bottom", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(n) {
4628
+ } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "向下对齐" } }, [t("ElButton", { staticClass: "align align-bottom", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(i) {
6247
4629
  return e.elementsAlign("bottom");
6248
- } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "水平居中" } }, [t("ElButton", { staticClass: "align align-center", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(n) {
4630
+ } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "水平居中" } }, [t("ElButton", { staticClass: "align align-center", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(i) {
6249
4631
  return e.elementsAlign("center");
6250
- } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "垂直居中" } }, [t("ElButton", { staticClass: "align align-middle", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(n) {
4632
+ } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "垂直居中" } }, [t("ElButton", { staticClass: "align align-middle", attrs: { size: e.headerButtonSize, icon: "el-icon-s-data" }, on: { click: function(i) {
6251
4633
  return e.elementsAlign("middle");
6252
- } } })], 1)], 1), t("ElButtonGroup", { key: "scale-control" }, [t("ElTooltip", { attrs: { effect: "light", content: "缩小视图" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, disabled: e.defaultZoom < 0.2, icon: "el-icon-zoom-out" }, on: { click: function(n) {
4634
+ } } })], 1)], 1), t("ElButtonGroup", { key: "scale-control" }, [t("ElTooltip", { attrs: { effect: "light", content: "缩小视图" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, disabled: e.defaultZoom < 0.2, icon: "el-icon-zoom-out" }, on: { click: function(i) {
6253
4635
  return e.processZoomOut();
6254
- } } })], 1), t("ElButton", { attrs: { size: e.headerButtonSize } }, [e._v(e._s(`${Math.floor(e.defaultZoom * 10 * 10)}%`))]), t("ElTooltip", { attrs: { effect: "light", content: "放大视图" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, disabled: e.defaultZoom > 4, icon: "el-icon-zoom-in" }, on: { click: function(n) {
4636
+ } } })], 1), t("ElButton", { attrs: { size: e.headerButtonSize } }, [e._v(e._s(`${Math.floor(e.defaultZoom * 10 * 10)}%`))]), t("ElTooltip", { attrs: { effect: "light", content: "放大视图" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, disabled: e.defaultZoom > 4, icon: "el-icon-zoom-in" }, on: { click: function(i) {
6255
4637
  return e.processZoomIn();
6256
- } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "重置视图并居中" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, icon: "el-icon-c-scale-to-original" }, on: { click: function(n) {
4638
+ } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "重置视图并居中" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, icon: "el-icon-c-scale-to-original" }, on: { click: function(i) {
6257
4639
  return e.processReZoom();
6258
- } } })], 1)], 1), t("ElButtonGroup", { key: "stack-control" }, [t("ElTooltip", { attrs: { effect: "light", content: "撤销" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, disabled: !e.revocable, icon: "el-icon-refresh-left" }, on: { click: function(n) {
4640
+ } } })], 1)], 1), t("ElButtonGroup", { key: "stack-control" }, [t("ElTooltip", { attrs: { effect: "light", content: "撤销" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, disabled: !e.revocable, icon: "el-icon-refresh-left" }, on: { click: function(i) {
6259
4641
  return e.processUndo();
6260
- } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "恢复" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, disabled: !e.recoverable, icon: "el-icon-refresh-right" }, on: { click: function(n) {
4642
+ } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "恢复" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, disabled: !e.recoverable, icon: "el-icon-refresh-right" }, on: { click: function(i) {
6261
4643
  return e.processRedo();
6262
4644
  } } })], 1), t("ElTooltip", { attrs: { effect: "light", content: "重新绘制" } }, [t("ElButton", { attrs: { size: e.headerButtonSize, icon: "el-icon-refresh" }, on: { click: e.processRestart } })], 1)], 1)];
6263
- }), t("input", { ref: "refFile", staticStyle: { display: "none" }, attrs: { id: "files", type: "file", accept: ".xml, .bpmn" }, on: { change: e.importLocalFile } })], 2), t("div", { staticClass: "my-process-designer__container" }, [t("div", { ref: "bpmn-canvas", staticClass: "my-process-designer__canvas flow-background-image" })]), t("ElementDialog", { staticClass: "flow-dialog", attrs: { title: "预览", width: "60vw", height: "60vh", visible: e.previewModelVisible, "body-padding": !1, "destroy-on-close": "" }, on: { "update:visible": function(n) {
6264
- e.previewModelVisible = n;
4645
+ }), t("input", { ref: "refFile", staticStyle: { display: "none" }, attrs: { id: "files", type: "file", accept: ".xml, .bpmn" }, on: { change: e.importLocalFile } })], 2), t("div", { staticClass: "my-process-designer__container" }, [t("div", { ref: "bpmn-canvas", staticClass: "my-process-designer__canvas flow-background-image" })]), t("ElementDialog", { staticClass: "flow-dialog", attrs: { title: "预览", width: "60vw", height: "60vh", visible: e.previewModelVisible, "body-padding": !1, "destroy-on-close": "" }, on: { "update:visible": function(i) {
4646
+ e.previewModelVisible = i;
6265
4647
  } } }, [t("HighlightJS", { attrs: { language: e.previewType, code: e.previewResult } })], 1)], 1);
6266
- }, Un = [], Gn = /* @__PURE__ */ h(
6267
- zn,
6268
- Nn,
6269
- Un,
4648
+ }, dt = [], yt = /* @__PURE__ */ J(
4649
+ ut,
4650
+ ct,
4651
+ dt,
6270
4652
  !1,
6271
4653
  null,
6272
4654
  null
6273
4655
  );
6274
- const qn = Gn.exports, Kn = {
4656
+ const bt = yt.exports, gt = {
6275
4657
  name: "FlowDesigner",
6276
4658
  components: {
6277
- PropertiesPanel: Cn,
6278
- ProcessDesigner: qn
4659
+ PropertiesPanel: We,
4660
+ ProcessDesigner: bt
6279
4661
  },
6280
4662
  props: {
6281
4663
  /**
@@ -6300,7 +4682,10 @@ const qn = Gn.exports, Kn = {
6300
4682
  /**
6301
4683
  * 配置上下文信息
6302
4684
  */
6303
- context: Object
4685
+ context: Object,
4686
+ panelType: {
4687
+ type: String
4688
+ }
6304
4689
  },
6305
4690
  data() {
6306
4691
  return {
@@ -6314,44 +4699,44 @@ const qn = Gn.exports, Kn = {
6314
4699
  labelVisible: !1,
6315
4700
  prefix: "flowable",
6316
4701
  headerButtonSize: "mini",
6317
- additionalModel: N([Ke, Je, tt])
4702
+ additionalModel: N([Fe, Le, je])
6318
4703
  }
6319
4704
  };
6320
4705
  },
6321
4706
  methods: {
6322
- initModeler(i) {
6323
- this.modeler = i;
4707
+ initModeler(n) {
4708
+ this.modeler = n;
6324
4709
  },
6325
4710
  refresh() {
6326
- return c(this, null, function* () {
4711
+ return w(this, null, function* () {
6327
4712
  yield this.$nextTick(), yield this.$refs.processDesigner.createNewDiagram(this.value);
6328
4713
  });
6329
4714
  }
6330
4715
  }
6331
4716
  };
6332
- var Jn = function() {
4717
+ var ft = function() {
6333
4718
  var e = this, t = e._self._c;
6334
4719
  return t("div", { staticClass: "flow-designer" }, [t("ProcessDesigner", e._b({ key: `designer-${e.reloadIndex}`, ref: "processDesigner", attrs: { value: e.value, "extend-types": e.extendTypes, options: {
6335
4720
  taskResizingEnabled: !0,
6336
4721
  eventResizingEnabled: !0
6337
- }, keyboard: "" }, on: { input: (n) => e.$emit("input", n), "init-finished": e.initModeler }, scopedSlots: e._u([{ key: "toolbar-buttons", fn: function() {
4722
+ }, keyboard: "" }, on: { input: (i) => e.$emit("input", i), "init-finished": e.initModeler }, scopedSlots: e._u([{ key: "toolbar-buttons", fn: function() {
6338
4723
  return [e._t("toolbar-buttons", null, { modeler: e.modeler })];
6339
- }, proxy: !0 }], null, !0) }, "ProcessDesigner", e.controlForm, !1)), e.usePanel && (e.useTabs === null || e.useTabs === void 0 || e.useTabs.length > 0) ? t("PropertiesPanel", { key: `penal-${e.reloadIndex}`, staticClass: "process-panel", attrs: { "use-tabs": e.useTabs, "bpmn-modeler": e.modeler, context: e.context, prefix: e.controlForm.prefix }, scopedSlots: e._u([{ key: "task", fn: function({ id: n, bpmnInstances: s, element: a, type: r }) {
6340
- return [e._t("task", null, { id: n, bpmnInstances: s, element: a, type: r })];
6341
- } }, { key: "form", fn: function({ id: n, bpmnInstances: s, element: a, type: r }) {
6342
- return [e._t("form", null, { id: n, bpmnInstances: s, element: a, type: r })];
6343
- } }, { key: "extend", fn: function({ id: n, bpmnInstances: s, element: a, type: r }) {
6344
- return [e._t("extend", null, { id: n, bpmnInstances: s, element: a, type: r })];
4724
+ }, proxy: !0 }], null, !0) }, "ProcessDesigner", e.controlForm, !1)), e.usePanel && (e.useTabs === null || e.useTabs === void 0 || e.useTabs.length > 0) ? t("PropertiesPanel", { key: `penal-${e.reloadIndex}`, staticClass: "process-panel", attrs: { "panel-type": e.panelType, "use-tabs": e.useTabs, "bpmn-modeler": e.modeler, context: e.context, prefix: e.controlForm.prefix }, scopedSlots: e._u([{ key: "task", fn: function({ id: i, bpmnInstances: r, element: a, type: l }) {
4725
+ return [e._t("task", null, { id: i, bpmnInstances: r, element: a, type: l })];
4726
+ } }, { key: "form", fn: function({ id: i, bpmnInstances: r, element: a, type: l }) {
4727
+ return [e._t("form", null, { id: i, bpmnInstances: r, element: a, type: l })];
4728
+ } }, { key: "extend", fn: function({ id: i, bpmnInstances: r, element: a, type: l }) {
4729
+ return [e._t("extend", null, { id: i, bpmnInstances: r, element: a, type: l })];
6345
4730
  } }], null, !0) }) : e._e()], 1);
6346
- }, Zn = [], Hn = /* @__PURE__ */ h(
6347
- Kn,
6348
- Jn,
6349
- Zn,
4731
+ }, vt = [], St = /* @__PURE__ */ J(
4732
+ gt,
4733
+ ft,
4734
+ vt,
6350
4735
  !1,
6351
4736
  null,
6352
4737
  null
6353
4738
  );
6354
- const xi = Hn.exports;
4739
+ const Zt = St.exports;
6355
4740
  export {
6356
- xi as default
4741
+ Zt as default
6357
4742
  };