@web-utils/component 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/ElementBaseInfo.jv89Vjy1.mjs +118 -0
- package/chunks/ElementForm.4QQYs5uq.mjs +241 -0
- package/chunks/ElementListeners.vfHHHAOL.mjs +255 -0
- package/chunks/ElementMultiInstance.3Z28ewuh.mjs +191 -0
- package/chunks/ElementOtherConfig.B1NfMTYh.mjs +60 -0
- package/chunks/ElementProperties.CRIQaaPc.mjs +112 -0
- package/chunks/ElementTaskConfig.MBbkLrth.mjs +326 -0
- package/chunks/FlowCondition.BfU9kw6h.mjs +132 -0
- package/chunks/SignalAndMessage.CH6L7cYu.mjs +96 -0
- package/chunks/UserTaskListeners.XXe5dC5I.mjs +210 -0
- package/chunks/{json-beautifier.j1-U5g4P.mjs → json-beautifier.Bp3GslGm.mjs} +2 -0
- package/chunks/utilSelf.CRqpl0Cz.mjs +56 -0
- package/chunks/utils.DRcxC1Fb.mjs +60 -0
- package/element-listeners/style.css +1 -0
- package/element-multi-instance/style.css +1 -0
- package/ellipsis/index.mjs +148 -0
- package/ellipsis/style.css +1 -0
- package/flow-designer/index.mjs +519 -2134
- package/flow-designer/style.css +1 -1
- package/fy-form-design/index.mjs +1 -1
- package/index.mjs +455 -451
- package/monaco-editor/index.mjs +1 -1
- package/package.json +4 -4
- package/vue-tree-select/index.mjs +354 -347
- package/web-types.json +79 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { fastClone as l } from "@web-utils/core";
|
|
2
|
+
import { a, g as r } from "./utils.DRcxC1Fb.mjs";
|
|
3
|
+
import { n as o } from "./_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
4
|
+
const c = {
|
|
5
|
+
name: "ElementBaseInfo",
|
|
6
|
+
inject: {
|
|
7
|
+
prefix: "prefix",
|
|
8
|
+
width: "width"
|
|
9
|
+
},
|
|
10
|
+
props: {
|
|
11
|
+
id: String,
|
|
12
|
+
idEditDisabled: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !0
|
|
15
|
+
},
|
|
16
|
+
element: Object,
|
|
17
|
+
bpmnInstances: Object
|
|
18
|
+
},
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
skipExpression: "",
|
|
22
|
+
businessObject: {},
|
|
23
|
+
attrs: {
|
|
24
|
+
commentInForm: null,
|
|
25
|
+
commentOrder: null,
|
|
26
|
+
commentNodeIds: null,
|
|
27
|
+
commentLabel: null
|
|
28
|
+
},
|
|
29
|
+
nodes: []
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
watch: {
|
|
33
|
+
id: "init"
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
init(n) {
|
|
37
|
+
const e = this.bpmnInstances.elementRegistry.filter((t) => t.type === "bpmn:UserTask");
|
|
38
|
+
this.nodes = e.map(({ businessObject: { id: t, name: i } }) => ({ label: i, value: t }));
|
|
39
|
+
const { businessObject: s } = this.element;
|
|
40
|
+
if (n ? (this.businessObject = l(s), this.businessObject.$type === "bpmn:SubProcess" && this.$set(this.businessObject, "isExpanded", this.element.di.isExpanded)) : this.businessObject = {}, this.businessObject.$type === "bpmn:UserTask")
|
|
41
|
+
for (const t in this.attrs) {
|
|
42
|
+
let i = r(s, `${this.prefix}:${t}`);
|
|
43
|
+
t === "commentNodeIds" && (i = i ? i.split(",") : []), this.attrs[t] = i;
|
|
44
|
+
}
|
|
45
|
+
this.skipExpression = r(s, `${this.prefix}:skipExpression`);
|
|
46
|
+
},
|
|
47
|
+
updateBaseInfo(n) {
|
|
48
|
+
const { modeling: e } = this.bpmnInstances;
|
|
49
|
+
if (n === "id") {
|
|
50
|
+
e.updateProperties(this.element, {
|
|
51
|
+
id: this.businessObject[n],
|
|
52
|
+
di: { id: `${this.businessObject[n]}_di` }
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (n === "isExpanded") {
|
|
57
|
+
e.toggleCollapse(this.element);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
e.updateProperties(this.element, { [n]: this.businessObject[n] });
|
|
61
|
+
},
|
|
62
|
+
updateProp(n, e) {
|
|
63
|
+
if (n === "commentInForm" && !e)
|
|
64
|
+
for (const s in this.attrs)
|
|
65
|
+
s !== "commentInForm" && (this.attrs[s] = null, a(this.bpmnInstances, this.element, `${this.prefix}:${s}`, this.attrs[s]));
|
|
66
|
+
n === "commentNodeIds" ? e = e != null && e.length ? e.join(",") : null : e = e || null, a(this.bpmnInstances, this.element, `${this.prefix}:${n}`, e);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var m = function() {
|
|
71
|
+
var e = this, s = e._self._c;
|
|
72
|
+
return s("div", { staticClass: "panel-tab__content" }, [s("ElForm", { attrs: { size: "mini", "label-width": "90px" }, nativeOn: { submit: function(t) {
|
|
73
|
+
t.preventDefault();
|
|
74
|
+
} } }, [s("ElFormItem", { attrs: { label: "ID" } }, [s("ElInput", { attrs: { disabled: e.idEditDisabled, clearable: "" }, on: { input: function(t) {
|
|
75
|
+
return e.updateBaseInfo("id");
|
|
76
|
+
} }, model: { value: e.businessObject.id, callback: function(t) {
|
|
77
|
+
e.$set(e.businessObject, "id", t);
|
|
78
|
+
}, expression: "businessObject.id" } })], 1), s("ElFormItem", { attrs: { label: "名称" } }, [s("ElInput", { attrs: { clearable: "" }, on: { input: function(t) {
|
|
79
|
+
return e.updateBaseInfo("name");
|
|
80
|
+
} }, model: { value: e.businessObject.name, callback: function(t) {
|
|
81
|
+
e.$set(e.businessObject, "name", t);
|
|
82
|
+
}, expression: "businessObject.name" } })], 1), e.businessObject.$type === "bpmn:UserTask" ? [s("ElFormItem", { attrs: { label: "跳过表达式" } }, [s("ElInput", { attrs: { clearable: "" }, on: { input: (t) => e.updateProp("skipExpression", t) }, model: { value: e.skipExpression, callback: function(t) {
|
|
83
|
+
e.skipExpression = t;
|
|
84
|
+
}, expression: "skipExpression" } })], 1), s("ElFormItem", { attrs: { label: "意见在表单" } }, [s("ElSwitch", { attrs: { "active-text": "是", "inactive-text": "否" }, on: { input: (t) => e.updateProp("commentInForm", t) }, model: { value: e.attrs.commentInForm, callback: function(t) {
|
|
85
|
+
e.$set(e.attrs, "commentInForm", t);
|
|
86
|
+
}, expression: "attrs.commentInForm" } })], 1), e.attrs.commentInForm ? [s("ElFormItem", { attrs: { label: "意见名称" } }, [s("ElInput", { attrs: { clearable: "" }, on: { input: (t) => e.updateProp("commentLabel", t) }, model: { value: e.attrs.commentLabel, callback: function(t) {
|
|
87
|
+
e.$set(e.attrs, "commentLabel", t);
|
|
88
|
+
}, expression: "attrs.commentLabel" } })], 1), s("ElFormItem", { attrs: { label: "意见聚合" } }, [s("ElSelect", { attrs: { multiple: "", clearable: "" }, on: { input: (t) => e.updateProp("commentNodeIds", t) }, model: { value: e.attrs.commentNodeIds, callback: function(t) {
|
|
89
|
+
e.$set(e.attrs, "commentNodeIds", t);
|
|
90
|
+
}, expression: "attrs.commentNodeIds" } }, e._l(e.nodes, function(t) {
|
|
91
|
+
return s("ElOption", { key: t.value, attrs: { label: t.label, value: t.value } });
|
|
92
|
+
}), 1)], 1), s("ElFormItem", { attrs: { label: "意见排序号" } }, [s("ElInput", { attrs: { clearable: "" }, on: { input: (t) => e.updateProp("commentOrder", t) }, model: { value: e.attrs.commentOrder, callback: function(t) {
|
|
93
|
+
e.$set(e.attrs, "commentOrder", t);
|
|
94
|
+
}, expression: "attrs.commentOrder" } })], 1)] : e._e()] : e._e(), e.businessObject.$type === "bpmn:Process" ? [s("ElFormItem", { attrs: { label: "版本标签" } }, [s("ElInput", { attrs: { clearable: "" }, on: { input: function(t) {
|
|
95
|
+
return e.updateBaseInfo("versionTag");
|
|
96
|
+
} }, model: { value: e.businessObject.versionTag, callback: function(t) {
|
|
97
|
+
e.$set(e.businessObject, "versionTag", t);
|
|
98
|
+
}, expression: "businessObject.versionTag" } })], 1), s("ElFormItem", { attrs: { label: "可执行" } }, [s("ElSwitch", { attrs: { "active-text": "是", "inactive-text": "否" }, on: { input: function(t) {
|
|
99
|
+
return e.updateBaseInfo("isExecutable");
|
|
100
|
+
} }, model: { value: e.businessObject.isExecutable, callback: function(t) {
|
|
101
|
+
e.$set(e.businessObject, "isExecutable", t);
|
|
102
|
+
}, expression: "businessObject.isExecutable" } })], 1)] : e._e(), e.businessObject.$type === "bpmn:SubProcess" ? s("ElFormItem", { attrs: { label: "状态" } }, [s("ElSwitch", { attrs: { "active-text": "展开", "inactive-text": "折叠" }, on: { input: function(t) {
|
|
103
|
+
return e.updateBaseInfo("isExpanded");
|
|
104
|
+
} }, model: { value: e.businessObject.isExpanded, callback: function(t) {
|
|
105
|
+
e.$set(e.businessObject, "isExpanded", t);
|
|
106
|
+
}, expression: "businessObject.isExpanded" } })], 1) : e._e()], 2)], 1);
|
|
107
|
+
}, b = [], u = /* @__PURE__ */ o(
|
|
108
|
+
c,
|
|
109
|
+
m,
|
|
110
|
+
b,
|
|
111
|
+
!1,
|
|
112
|
+
null,
|
|
113
|
+
null
|
|
114
|
+
);
|
|
115
|
+
const E = u.exports;
|
|
116
|
+
export {
|
|
117
|
+
E as default
|
|
118
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
var p = (n, e, t) => new Promise((i, l) => {
|
|
2
|
+
var o = (m) => {
|
|
3
|
+
try {
|
|
4
|
+
s(t.next(m));
|
|
5
|
+
} catch (d) {
|
|
6
|
+
l(d);
|
|
7
|
+
}
|
|
8
|
+
}, r = (m) => {
|
|
9
|
+
try {
|
|
10
|
+
s(t.throw(m));
|
|
11
|
+
} catch (d) {
|
|
12
|
+
l(d);
|
|
13
|
+
}
|
|
14
|
+
}, s = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(o, r);
|
|
15
|
+
s((t = t.apply(n, e)).next());
|
|
16
|
+
});
|
|
17
|
+
import { fastClone as a } from "@web-utils/core";
|
|
18
|
+
import { n as f } from "./_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
19
|
+
const u = {
|
|
20
|
+
name: "ElementForm",
|
|
21
|
+
inject: {
|
|
22
|
+
prefix: "prefix",
|
|
23
|
+
width: "width"
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
id: String,
|
|
27
|
+
element: Object,
|
|
28
|
+
bpmnInstances: Object
|
|
29
|
+
},
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
formKey: "",
|
|
33
|
+
businessKey: "",
|
|
34
|
+
optionModelTitle: "",
|
|
35
|
+
fieldList: [],
|
|
36
|
+
formFieldForm: {},
|
|
37
|
+
fieldType: {
|
|
38
|
+
long: "长整型",
|
|
39
|
+
string: "字符串",
|
|
40
|
+
boolean: "布尔类",
|
|
41
|
+
date: "日期类",
|
|
42
|
+
enum: "枚举类",
|
|
43
|
+
custom: "自定义类型"
|
|
44
|
+
},
|
|
45
|
+
formFieldIndex: -1,
|
|
46
|
+
// 编辑中的字段, -1 为新增
|
|
47
|
+
formFieldOptionIndex: -1,
|
|
48
|
+
// 编辑中的字段配置项, -1 为新增
|
|
49
|
+
fieldModelVisible: !1,
|
|
50
|
+
fieldOptionModelVisible: !1,
|
|
51
|
+
fieldOptionForm: {},
|
|
52
|
+
// 当前激活的字段配置项数据
|
|
53
|
+
fieldOptionType: "",
|
|
54
|
+
// 当前激活的字段配置项弹窗 类型
|
|
55
|
+
fieldEnumList: [],
|
|
56
|
+
// 枚举值列表
|
|
57
|
+
fieldConstraintsList: [],
|
|
58
|
+
// 约束条件列表
|
|
59
|
+
fieldPropertiesList: []
|
|
60
|
+
// 绑定属性列表
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
watch: {
|
|
64
|
+
id: {
|
|
65
|
+
immediate: !0,
|
|
66
|
+
handler(n) {
|
|
67
|
+
return p(this, null, function* () {
|
|
68
|
+
n && (yield this.$nextTick(), this.resetFormList());
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
resetFormList() {
|
|
75
|
+
var n;
|
|
76
|
+
this.formKey = this.element.businessObject.formKey, this.elExtensionElements = this.element.businessObject.get("extensionElements") || this.bpmnInstances.moddle.create("bpmn:ExtensionElements", { values: [] }), this.formData = ((n = this.elExtensionElements.values.filter((e) => e.$type === `${this.prefix}:FormData`)) == null ? void 0 : n[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 = a(this.formData.fields || []), this.updateElementExtensions();
|
|
77
|
+
},
|
|
78
|
+
updateElementFormKey() {
|
|
79
|
+
this.bpmnInstances.modeling.updateProperties(this.element, { formKey: this.formKey });
|
|
80
|
+
},
|
|
81
|
+
updateElementBusinessKey() {
|
|
82
|
+
this.bpmnInstances.modeling.updateModdleProperties(this.element, this.formData, {
|
|
83
|
+
businessKey: this.businessKey
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
// 根据类型调整字段type
|
|
87
|
+
changeFieldTypeType(n) {
|
|
88
|
+
this.$set(this.formFieldForm, "type", n === "custom" ? "" : n);
|
|
89
|
+
},
|
|
90
|
+
// 打开字段详情侧边栏
|
|
91
|
+
openFieldForm(n, e) {
|
|
92
|
+
var t, i;
|
|
93
|
+
if (this.formFieldIndex = e, e !== -1) {
|
|
94
|
+
const l = this.formData.fields[e];
|
|
95
|
+
this.formFieldForm = a(n), this.$set(this.formFieldForm, "typeType", this.fieldType[n.type] ? n.type : "custom"), n.type === "enum" && (this.fieldEnumList = a((l == null ? void 0 : l.values) || [])), this.fieldConstraintsList = a(((t = l == null ? void 0 : l.validation) == null ? void 0 : t.constraints) || []), this.fieldPropertiesList = a(((i = l == null ? void 0 : l.properties) == null ? void 0 : i.values) || []);
|
|
96
|
+
} else
|
|
97
|
+
this.formFieldForm = {}, this.fieldEnumList = [], this.fieldConstraintsList = [], this.fieldPropertiesList = [];
|
|
98
|
+
this.fieldModelVisible = !0;
|
|
99
|
+
},
|
|
100
|
+
// 打开字段 某个 配置项 弹窗
|
|
101
|
+
openFieldOptionForm(n, e, t) {
|
|
102
|
+
return this.fieldOptionModelVisible = !0, this.fieldOptionType = t, this.formFieldOptionIndex = e, t === "property" ? (this.fieldOptionForm = n ? a(n) : {}, this.optionModelTitle = "属性配置") : t === "enum" ? (this.fieldOptionForm = n ? a(n) : {}, this.optionModelTitle = "枚举值配置") : (this.fieldOptionForm = n ? a(n) : {}, this.optionModelTitle = "约束条件配置");
|
|
103
|
+
},
|
|
104
|
+
// 保存字段 某个 配置项
|
|
105
|
+
saveFieldOption() {
|
|
106
|
+
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 = {};
|
|
107
|
+
},
|
|
108
|
+
// 保存字段配置
|
|
109
|
+
saveField() {
|
|
110
|
+
const { id: n, type: e, label: t, defaultValue: i, datePattern: l } = this.formFieldForm, o = this.bpmnInstances.moddle.create(`${this.prefix}:FormField`, { id: n, type: e, label: t });
|
|
111
|
+
if (i && (o.defaultValue = i), l && (o.datePattern = l), this.fieldPropertiesList && this.fieldPropertiesList.length) {
|
|
112
|
+
const r = this.fieldPropertiesList.map((s) => this.bpmnInstances.moddle.create(`${this.prefix}:Property`, { id: s.id, value: s.value }));
|
|
113
|
+
o.properties = this.bpmnInstances.moddle.create(`${this.prefix}:Properties`, {
|
|
114
|
+
values: r
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (this.fieldConstraintsList && this.fieldConstraintsList.length) {
|
|
118
|
+
const r = this.fieldConstraintsList.map((s) => this.bpmnInstances.moddle.create(`${this.prefix}:Constraint`, { name: s.name, config: s.config }));
|
|
119
|
+
o.validation = this.bpmnInstances.moddle.create(`${this.prefix}:Validation`, {
|
|
120
|
+
constraints: r
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
this.fieldEnumList && this.fieldEnumList.length && (o.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(o)) : (this.fieldList.splice(this.formFieldIndex, 1, this.formFieldForm), this.formData.fields.splice(this.formFieldIndex, 1, o)), this.updateElementExtensions(), this.fieldModelVisible = !1;
|
|
124
|
+
},
|
|
125
|
+
// 移除某个 字段的 配置项
|
|
126
|
+
removeFieldOptionItem(n, e, t) {
|
|
127
|
+
if (t === "property") {
|
|
128
|
+
this.fieldPropertiesList.splice(e, 1);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (t === "enum") {
|
|
132
|
+
this.fieldEnumList.splice(e, 1);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this.fieldConstraintsList.splice(e, 1);
|
|
136
|
+
},
|
|
137
|
+
// 移除 字段
|
|
138
|
+
removeField(n, e) {
|
|
139
|
+
this.fieldList.splice(e, 1), this.formData.fields.splice(e, 1), this.updateElementExtensions();
|
|
140
|
+
},
|
|
141
|
+
updateElementExtensions() {
|
|
142
|
+
const n = this.bpmnInstances.moddle.create("bpmn:ExtensionElements", {
|
|
143
|
+
values: this.otherExtensions.concat(this.formData)
|
|
144
|
+
});
|
|
145
|
+
this.bpmnInstances.modeling.updateProperties(this.element, {
|
|
146
|
+
extensionElements: n
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
var c = function() {
|
|
152
|
+
var e = this, t = e._self._c;
|
|
153
|
+
return t("div", { staticClass: "panel-tab__content" }, [t("ElForm", { attrs: { size: "mini", "label-width": "80px" }, nativeOn: { submit: function(i) {
|
|
154
|
+
i.preventDefault();
|
|
155
|
+
} } }, [t("ElFormItem", { attrs: { label: "表单标识" } }, [t("ElInput", { attrs: { clearable: "" }, on: { change: e.updateElementFormKey }, model: { value: e.formKey, callback: function(i) {
|
|
156
|
+
e.formKey = i;
|
|
157
|
+
}, expression: "formKey" } })], 1), t("ElFormItem", { attrs: { label: "业务标识" } }, [t("ElSelect", { on: { change: e.updateElementBusinessKey }, model: { value: e.businessKey, callback: function(i) {
|
|
158
|
+
e.businessKey = i;
|
|
159
|
+
}, expression: "businessKey" } }, [e._l(e.fieldList, function(i) {
|
|
160
|
+
return t("ElOption", { key: i.id, attrs: { value: i.id, label: i.label } });
|
|
161
|
+
}), 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: (i) => e.fieldType[i.type] || i.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: i, $index: l }) {
|
|
162
|
+
return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(o) {
|
|
163
|
+
return e.openFieldForm(i, l);
|
|
164
|
+
} } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(o) {
|
|
165
|
+
return e.removeField(i, l);
|
|
166
|
+
} } }, [e._v("移除")])];
|
|
167
|
+
} }]) })], 1)], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(i) {
|
|
168
|
+
return e.openFieldForm(null, -1);
|
|
169
|
+
} } }, [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(i) {
|
|
170
|
+
e.fieldModelVisible = i;
|
|
171
|
+
} } }, [t("ElForm", { attrs: { model: e.formFieldForm, "label-width": "90px", size: "mini" }, nativeOn: { submit: function(i) {
|
|
172
|
+
i.preventDefault();
|
|
173
|
+
} } }, [t("ElFormItem", { attrs: { label: "字段ID" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.id, callback: function(i) {
|
|
174
|
+
e.$set(e.formFieldForm, "id", i);
|
|
175
|
+
}, expression: "formFieldForm.id" } })], 1), t("ElFormItem", { attrs: { label: "类型" } }, [t("ElSelect", { attrs: { placeholder: "请选择字段类型", clearable: "" }, on: { change: e.changeFieldTypeType }, model: { value: e.formFieldForm.typeType, callback: function(i) {
|
|
176
|
+
e.$set(e.formFieldForm, "typeType", i);
|
|
177
|
+
}, expression: "formFieldForm.typeType" } }, e._l(e.fieldType, function(i, l) {
|
|
178
|
+
return t("ElOption", { key: l, attrs: { label: i, value: l } });
|
|
179
|
+
}), 1)], 1), e.formFieldForm.typeType === "custom" ? t("ElFormItem", { attrs: { label: "类型名称" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.type, callback: function(i) {
|
|
180
|
+
e.$set(e.formFieldForm, "type", i);
|
|
181
|
+
}, expression: "formFieldForm.type" } })], 1) : e._e(), t("ElFormItem", { attrs: { label: "名称" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.label, callback: function(i) {
|
|
182
|
+
e.$set(e.formFieldForm, "label", i);
|
|
183
|
+
}, expression: "formFieldForm.label" } })], 1), e.formFieldForm.typeType === "date" ? t("ElFormItem", { attrs: { label: "时间格式" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.datePattern, callback: function(i) {
|
|
184
|
+
e.$set(e.formFieldForm, "datePattern", i);
|
|
185
|
+
}, expression: "formFieldForm.datePattern" } })], 1) : e._e(), t("ElFormItem", { attrs: { label: "默认值" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.formFieldForm.defaultValue, callback: function(i) {
|
|
186
|
+
e.$set(e.formFieldForm, "defaultValue", i);
|
|
187
|
+
}, 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(i) {
|
|
188
|
+
return e.openFieldOptionForm(null, -1, "enum");
|
|
189
|
+
} } }, [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: i, $index: l }) {
|
|
190
|
+
return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(o) {
|
|
191
|
+
return e.openFieldOptionForm(i, l, "enum");
|
|
192
|
+
} } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(o) {
|
|
193
|
+
return e.removeFieldOptionItem(i, l, "enum");
|
|
194
|
+
} } }, [e._v("移除")])];
|
|
195
|
+
} }], 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(i) {
|
|
196
|
+
return e.openFieldOptionForm(null, -1, "constraint");
|
|
197
|
+
} } }, [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: i, $index: l }) {
|
|
198
|
+
return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(o) {
|
|
199
|
+
return e.openFieldOptionForm(i, l, "constraint");
|
|
200
|
+
} } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(o) {
|
|
201
|
+
return e.removeFieldOptionItem(i, l, "constraint");
|
|
202
|
+
} } }, [e._v("移除")])];
|
|
203
|
+
} }]) })], 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(i) {
|
|
204
|
+
return e.openFieldOptionForm(null, -1, "property");
|
|
205
|
+
} } }, [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: i, $index: l }) {
|
|
206
|
+
return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(o) {
|
|
207
|
+
return e.openFieldOptionForm(i, l, "property");
|
|
208
|
+
} } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(o) {
|
|
209
|
+
return e.removeFieldOptionItem(i, l, "property");
|
|
210
|
+
} } }, [e._v("移除")])];
|
|
211
|
+
} }]) })], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini" }, on: { click: function(i) {
|
|
212
|
+
e.fieldModelVisible = !1;
|
|
213
|
+
} } }, [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(i) {
|
|
214
|
+
e.fieldOptionModelVisible = i;
|
|
215
|
+
} }, scopedSlots: e._u([{ key: "footer", fn: function() {
|
|
216
|
+
return [t("ElButton", { attrs: { size: "mini" }, on: { click: function(i) {
|
|
217
|
+
e.fieldOptionModelVisible = !1;
|
|
218
|
+
} } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.saveFieldOption } }, [e._v("确 定")])];
|
|
219
|
+
}, proxy: !0 }]) }, [t("ElForm", { attrs: { model: e.fieldOptionForm, size: "mini", "label-width": "96px" }, nativeOn: { submit: function(i) {
|
|
220
|
+
i.preventDefault();
|
|
221
|
+
} } }, [e.fieldOptionType !== "constraint" ? t("ElFormItem", { key: "option-id", attrs: { label: "编号/ID" } }, [t("ElInput", { attrs: { clearable: "" }, model: { value: e.fieldOptionForm.id, callback: function(i) {
|
|
222
|
+
e.$set(e.fieldOptionForm, "id", i);
|
|
223
|
+
}, 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(i) {
|
|
224
|
+
e.$set(e.fieldOptionForm, "name", i);
|
|
225
|
+
}, 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(i) {
|
|
226
|
+
e.$set(e.fieldOptionForm, "config", i);
|
|
227
|
+
}, 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(i) {
|
|
228
|
+
e.$set(e.fieldOptionForm, "value", i);
|
|
229
|
+
}, expression: "fieldOptionForm.value" } })], 1) : e._e()], 1)], 1)], 1);
|
|
230
|
+
}, h = [], F = /* @__PURE__ */ f(
|
|
231
|
+
u,
|
|
232
|
+
c,
|
|
233
|
+
h,
|
|
234
|
+
!1,
|
|
235
|
+
null,
|
|
236
|
+
null
|
|
237
|
+
);
|
|
238
|
+
const E = F.exports;
|
|
239
|
+
export {
|
|
240
|
+
E as default
|
|
241
|
+
};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
var F = Object.defineProperty;
|
|
2
|
+
var p = Object.getOwnPropertySymbols;
|
|
3
|
+
var b = Object.prototype.hasOwnProperty, h = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var d = (s, e, t) => e in s ? F(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, u = (s, e) => {
|
|
5
|
+
for (var t in e || (e = {}))
|
|
6
|
+
b.call(e, t) && d(s, t, e[t]);
|
|
7
|
+
if (p)
|
|
8
|
+
for (var t of p(e))
|
|
9
|
+
h.call(e, t) && d(s, t, e[t]);
|
|
10
|
+
return s;
|
|
11
|
+
};
|
|
12
|
+
var c = (s, e, t) => new Promise((r, l) => {
|
|
13
|
+
var o = (n) => {
|
|
14
|
+
try {
|
|
15
|
+
a(t.next(n));
|
|
16
|
+
} catch (m) {
|
|
17
|
+
l(m);
|
|
18
|
+
}
|
|
19
|
+
}, i = (n) => {
|
|
20
|
+
try {
|
|
21
|
+
a(t.throw(n));
|
|
22
|
+
} catch (m) {
|
|
23
|
+
l(m);
|
|
24
|
+
}
|
|
25
|
+
}, a = (n) => n.done ? r(n.value) : Promise.resolve(n.value).then(o, i);
|
|
26
|
+
a((t = t.apply(s, e)).next());
|
|
27
|
+
});
|
|
28
|
+
import { c as v, u as f } from "./utils.DRcxC1Fb.mjs";
|
|
29
|
+
import { i as y, a as g, f as E, l as x } from "./utilSelf.CRqpl0Cz.mjs";
|
|
30
|
+
import { fastClone as L, capitalize as _ } from "@web-utils/core";
|
|
31
|
+
import { n as T } from "./_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
32
|
+
const $ = (s) => ({
|
|
33
|
+
$type: "flowable:ExecutionListener",
|
|
34
|
+
event: s === "draft" ? "start" : s,
|
|
35
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
36
|
+
delegateExpression: "${httpInvokeExecutionListener}",
|
|
37
|
+
fields: [],
|
|
38
|
+
listenerType: "delegateExpressionListener"
|
|
39
|
+
}), k = (s, e) => [
|
|
40
|
+
{ $type: "flowable:Field", name: "serviceId", string: e.serviceId, fieldType: "string" },
|
|
41
|
+
{
|
|
42
|
+
$type: "flowable:Field",
|
|
43
|
+
name: "url",
|
|
44
|
+
string: `${e != null && e.url ? `/${e.url}` : ""}/flow${_(s)}`,
|
|
45
|
+
fieldType: "string"
|
|
46
|
+
}
|
|
47
|
+
], w = {
|
|
48
|
+
name: "ElementListeners",
|
|
49
|
+
inject: {
|
|
50
|
+
prefix: "prefix",
|
|
51
|
+
width: "width",
|
|
52
|
+
context: "context"
|
|
53
|
+
},
|
|
54
|
+
props: {
|
|
55
|
+
id: String,
|
|
56
|
+
element: Object,
|
|
57
|
+
bpmnInstances: Object
|
|
58
|
+
},
|
|
59
|
+
data() {
|
|
60
|
+
return {
|
|
61
|
+
elementListenersList: [],
|
|
62
|
+
// 监听器列表
|
|
63
|
+
listenerForm: {},
|
|
64
|
+
// 监听器详情表单
|
|
65
|
+
listenerFormModelVisible: !1,
|
|
66
|
+
// 监听器 编辑 侧边栏显示状态
|
|
67
|
+
fieldsListOfListener: [],
|
|
68
|
+
listenerFieldForm: {},
|
|
69
|
+
// 监听器 注入字段 详情表单
|
|
70
|
+
listenerFieldFormModelVisible: !1,
|
|
71
|
+
// 监听器 注入字段表单弹窗 显示状态
|
|
72
|
+
editingListenerIndex: -1,
|
|
73
|
+
// 监听器所在下标,-1 为新增
|
|
74
|
+
editingListenerFieldIndex: -1,
|
|
75
|
+
// 字段所在下标,-1 为新增
|
|
76
|
+
listenerTypeObject: x,
|
|
77
|
+
fieldTypeObject: E
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
apis() {
|
|
82
|
+
var e;
|
|
83
|
+
return (((e = this.context) == null ? void 0 : e.apis) || ["flowDraft", "flowStart", "flowEnd"]).map((t) => {
|
|
84
|
+
var r;
|
|
85
|
+
return `${(r = this.context) != null && r.url ? `/${this.context.url}/` : ""}${t}`;
|
|
86
|
+
}) || [];
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
watch: {
|
|
90
|
+
id: {
|
|
91
|
+
immediate: !0,
|
|
92
|
+
handler(s) {
|
|
93
|
+
return c(this, null, function* () {
|
|
94
|
+
s && (yield this.$nextTick(), this.resetListenersList());
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
resetListenersList() {
|
|
101
|
+
var s, e, t, r;
|
|
102
|
+
this.otherExtensionList = [], this.bpmnElementListeners = (r = (t = (e = (s = this.element.businessObject) == null ? void 0 : s.extensionElements) == null ? void 0 : e.values) == null ? void 0 : t.filter((l) => l.$type === `${this.prefix}:ExecutionListener`)) != null ? r : [], this.elementListenersList = this.bpmnElementListeners.map((l) => g(l));
|
|
103
|
+
},
|
|
104
|
+
changeFiledType(s) {
|
|
105
|
+
s === "string" ? (delete this.listenerFieldForm.expression, this.$set(this.listenerFieldForm, "string", "")) : (delete this.listenerFieldForm.string, this.$set(this.listenerFieldForm, "expression", ""));
|
|
106
|
+
},
|
|
107
|
+
assignListener(s) {
|
|
108
|
+
const e = $(s, this.context);
|
|
109
|
+
e.fields = k(s, this.context), this.listenerForm = e, this.fieldsListOfListener = e.fields;
|
|
110
|
+
},
|
|
111
|
+
setDefaultFieldValue(s) {
|
|
112
|
+
s !== "url" ? this.$set(this.listenerFieldForm, "string", this.context[s] || "") : this.$set(this.listenerFieldForm, "string", "");
|
|
113
|
+
},
|
|
114
|
+
// 打开 监听器详情 侧边栏
|
|
115
|
+
openListenerForm(s, e) {
|
|
116
|
+
return c(this, null, function* () {
|
|
117
|
+
var t;
|
|
118
|
+
s ? (this.listenerForm = y(s), this.fieldsListOfListener = s.fields ? s.fields.map((r) => u({}, r)) : [], this.editingListenerIndex = e) : (this.listenerForm = { fields: [] }, this.fieldsListOfListener = [], this.editingListenerIndex = -1), this.listenerFormModelVisible = !0, yield this.$nextTick(), (t = this.$refs.listenerFormRef) == null || t.clearValidate();
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
// 打开监听器字段编辑弹窗
|
|
122
|
+
openListenerFieldForm(s, e) {
|
|
123
|
+
this.listenerFieldForm = s ? L(s) : { fieldType: "string" }, this.editingListenerFieldIndex = s ? e : -1, this.listenerFieldFormModelVisible = !0, this.$nextTick(() => {
|
|
124
|
+
this.$refs.listenerFieldFormRef && this.$refs.listenerFieldFormRef.clearValidate();
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
// 保存监听器注入字段
|
|
128
|
+
saveListenerFiled() {
|
|
129
|
+
return c(this, null, function* () {
|
|
130
|
+
(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 = {});
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
// 移除监听器字段
|
|
134
|
+
removeListenerField(s, e) {
|
|
135
|
+
return c(this, null, function* () {
|
|
136
|
+
try {
|
|
137
|
+
yield this.$confirm("确认移除该字段吗?", "提示"), this.fieldsListOfListener.splice(e, 1), this.listenerForm.fields.splice(e, 1);
|
|
138
|
+
} catch (t) {
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
// 移除监听器
|
|
143
|
+
removeListener(s, e) {
|
|
144
|
+
return c(this, null, function* () {
|
|
145
|
+
try {
|
|
146
|
+
yield this.$confirm("确认移除该监听器吗?", "提示"), this.bpmnElementListeners.splice(e, 1), this.elementListenersList.splice(e, 1), f(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners));
|
|
147
|
+
} catch (t) {
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
// 保存监听器配置
|
|
152
|
+
saveListenerConfig() {
|
|
153
|
+
return c(this, null, function* () {
|
|
154
|
+
var t, r, l, o;
|
|
155
|
+
if (!(yield this.$refs.listenerFormRef.validate())) return;
|
|
156
|
+
const e = v(this.bpmnInstances, this.listenerForm, !1, this.prefix);
|
|
157
|
+
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 = (o = (l = (r = (t = this.element.businessObject) == null ? void 0 : t.extensionElements) == null ? void 0 : r.values) == null ? void 0 : l.filter((i) => i.$type !== `${this.prefix}:ExecutionListener`)) != null ? o : [], f(this.bpmnInstances, this.element, this.otherExtensionList.concat(this.bpmnElementListeners)), this.listenerFormModelVisible = !1, this.listenerForm = {};
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
var I = function() {
|
|
163
|
+
var r, l, o;
|
|
164
|
+
var e = this, t = e._self._c;
|
|
165
|
+
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: (i) => e.listenerTypeObject[i.listenerType] } }), t("ElTableColumn", { attrs: { label: "操作", width: "90px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: i, $index: a }) {
|
|
166
|
+
return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(n) {
|
|
167
|
+
return e.openListenerForm(i, a);
|
|
168
|
+
} } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(n) {
|
|
169
|
+
return e.removeListener(i, a);
|
|
170
|
+
} } }, [e._v("移除")])];
|
|
171
|
+
} }]) })], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini", type: "primary", icon: "el-icon-plus" }, on: { click: function(i) {
|
|
172
|
+
return e.openListenerForm(null);
|
|
173
|
+
} } }, [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(i) {
|
|
174
|
+
e.listenerFormModelVisible = i;
|
|
175
|
+
} } }, [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(i) {
|
|
176
|
+
return e.assignListener("start");
|
|
177
|
+
} } }, [e._v("开始")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: function(i) {
|
|
178
|
+
return e.assignListener("end");
|
|
179
|
+
} } }, [e._v("结束")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: function(i) {
|
|
180
|
+
return e.assignListener("draft");
|
|
181
|
+
} } }, [e._v("草稿")])], 1), t("ElForm", { ref: "listenerFormRef", attrs: { size: "mini", model: e.listenerForm, "label-width": "96px" }, nativeOn: { submit: function(i) {
|
|
182
|
+
i.preventDefault();
|
|
183
|
+
} } }, [t("ElFormItem", { attrs: { label: "事件类型", prop: "event", rules: { required: !0, trigger: ["blur", "change"] } } }, [t("ElSelect", { model: { value: e.listenerForm.event, callback: function(i) {
|
|
184
|
+
e.$set(e.listenerForm, "event", i);
|
|
185
|
+
}, 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(i) {
|
|
186
|
+
e.$set(e.listenerForm, "listenerType", i);
|
|
187
|
+
}, expression: "listenerForm.listenerType" } }, e._l(Object.keys(e.listenerTypeObject), function(i) {
|
|
188
|
+
return t("ElOption", { key: i, attrs: { label: e.listenerTypeObject[i], value: i } });
|
|
189
|
+
}), 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(i) {
|
|
190
|
+
e.$set(e.listenerForm, "class", i);
|
|
191
|
+
}, 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(i) {
|
|
192
|
+
e.$set(e.listenerForm, "expression", i);
|
|
193
|
+
}, 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(i) {
|
|
194
|
+
e.$set(e.listenerForm, "delegateExpression", i);
|
|
195
|
+
}, expression: "listenerForm.delegateExpression" } }, e._l(((r = e.context) == null ? void 0 : r.delegateExpressions) || [], function(i) {
|
|
196
|
+
return t("ElOption", { key: i, attrs: { value: i, label: i } });
|
|
197
|
+
}), 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(i) {
|
|
198
|
+
e.$set(e.listenerForm, "scriptFormat", i);
|
|
199
|
+
}, 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(i) {
|
|
200
|
+
e.$set(e.listenerForm, "scriptType", i);
|
|
201
|
+
}, 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(i) {
|
|
202
|
+
e.$set(e.listenerForm, "value", i);
|
|
203
|
+
}, 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(i) {
|
|
204
|
+
e.$set(e.listenerForm, "resource", i);
|
|
205
|
+
}, 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(i) {
|
|
206
|
+
return e.openListenerFieldForm(null);
|
|
207
|
+
} } }, [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: (i) => e.fieldTypeObject[i.fieldType] } }), t("ElTableColumn", { attrs: { label: "字段值/表达式", "min-width": "100px", "show-overflow-tooltip": "", formatter: (i) => i.string || i.expression } }), t("ElTableColumn", { attrs: { label: "操作", width: "100px" }, scopedSlots: e._u([{ key: "default", fn: function({ row: i, $index: a }) {
|
|
208
|
+
return [t("ElButton", { attrs: { size: "mini", type: "text" }, on: { click: function(n) {
|
|
209
|
+
return e.openListenerFieldForm(i, a);
|
|
210
|
+
} } }, [e._v("编辑")]), t("ElDivider", { attrs: { direction: "vertical" } }), t("ElButton", { staticStyle: { color: "#ff4d4f" }, attrs: { size: "mini", type: "text" }, on: { click: function(n) {
|
|
211
|
+
return e.removeListenerField(i, a);
|
|
212
|
+
} } }, [e._v(" 移除 ")])];
|
|
213
|
+
} }]) })], 1), t("div", { staticClass: "element-drawer__button" }, [t("ElButton", { attrs: { size: "mini" }, on: { click: function(i) {
|
|
214
|
+
e.listenerFormModelVisible = !1;
|
|
215
|
+
} } }, [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(i) {
|
|
216
|
+
e.listenerFieldFormModelVisible = i;
|
|
217
|
+
} }, scopedSlots: e._u([{ key: "footer", fn: function() {
|
|
218
|
+
return [t("ElButton", { attrs: { size: "mini" }, on: { click: function(i) {
|
|
219
|
+
e.listenerFieldFormModelVisible = !1;
|
|
220
|
+
} } }, [e._v("取 消")]), t("ElButton", { attrs: { size: "mini", type: "primary" }, on: { click: e.saveListenerFiled } }, [e._v("确 定")])];
|
|
221
|
+
}, proxy: !0 }]) }, [t("ElForm", { ref: "listenerFieldFormRef", staticStyle: { height: "136px" }, attrs: { model: e.listenerFieldForm, size: "mini", "label-width": "96px" }, nativeOn: { submit: function(i) {
|
|
222
|
+
i.preventDefault();
|
|
223
|
+
} } }, [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(i) {
|
|
224
|
+
e.$set(e.listenerFieldForm, "name", i);
|
|
225
|
+
}, expression: "listenerFieldForm.name" } }, e._l(((l = e.context) == null ? void 0 : l.fields) || [], function(i) {
|
|
226
|
+
return t("ElOption", { key: i, attrs: { value: i, label: i } });
|
|
227
|
+
}), 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(i) {
|
|
228
|
+
e.$set(e.listenerFieldForm, "fieldType", i);
|
|
229
|
+
}, expression: "listenerFieldForm.fieldType" } }, e._l(Object.keys(e.fieldTypeObject), function(i) {
|
|
230
|
+
return t("ElOption", { key: i, attrs: { label: e.fieldTypeObject[i], value: i } });
|
|
231
|
+
}), 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(i) {
|
|
232
|
+
e.$set(e.listenerFieldForm, "string", i);
|
|
233
|
+
}, expression: "listenerFieldForm.string" } }, e._l(e.apis, function(i) {
|
|
234
|
+
return t("ElOption", { key: i, attrs: { value: i, label: i } });
|
|
235
|
+
}), 1) : e.listenerFieldForm.name === "serviceId" ? t("ElSelect", { attrs: { "default-first-option": "", "allow-create": "", filterable: "", clearable: "" }, model: { value: e.listenerFieldForm.string, callback: function(i) {
|
|
236
|
+
e.$set(e.listenerFieldForm, "string", i);
|
|
237
|
+
}, expression: "listenerFieldForm.string" } }, e._l(((o = e.context) == null ? void 0 : o.services) || [], function(i) {
|
|
238
|
+
return t("ElOption", { key: i, attrs: { value: i, label: i } });
|
|
239
|
+
}), 1) : t("ElInput", { attrs: { clearable: "" }, model: { value: e.listenerFieldForm.string, callback: function(i) {
|
|
240
|
+
e.$set(e.listenerFieldForm, "string", i);
|
|
241
|
+
}, 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(i) {
|
|
242
|
+
e.$set(e.listenerFieldForm, "expression", i);
|
|
243
|
+
}, expression: "listenerFieldForm.expression" } })], 1) : e._e()], 1)], 1)], 1);
|
|
244
|
+
}, O = [], S = /* @__PURE__ */ T(
|
|
245
|
+
w,
|
|
246
|
+
I,
|
|
247
|
+
O,
|
|
248
|
+
!1,
|
|
249
|
+
null,
|
|
250
|
+
null
|
|
251
|
+
);
|
|
252
|
+
const B = S.exports;
|
|
253
|
+
export {
|
|
254
|
+
B as default
|
|
255
|
+
};
|