@opentiny/tiny-engine-setting-events 1.0.3 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +583 -535
- package/dist/style.css +1 -1
- package/package.json +10 -9
package/dist/index.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { ref as
|
|
3
|
-
import {
|
|
4
|
-
import { useLayout as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { PROP_DATA_TYPE as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
const oe = (l, i) => {
|
|
13
|
-
const b = l.__vccOpts || l;
|
|
14
|
-
for (const [e, c] of i)
|
|
15
|
-
b[e] = c;
|
|
16
|
-
return b;
|
|
17
|
-
}, ve = K(!1), st = () => {
|
|
18
|
-
ve.value = !0;
|
|
19
|
-
}, Ie = () => {
|
|
20
|
-
ve.value = !1;
|
|
21
|
-
}, Ne = "newMethod", at = /[^0-9a-zA-Z_$]/, lt = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, F = {
|
|
2
|
+
import { ref as F, reactive as Z, provide as Oe, resolveComponent as E, withDirectives as ne, openBlock as f, createBlock as w, withCtx as _, createElementVNode as t, createVNode as c, createTextVNode as A, resolveDynamicComponent as ge, vShow as oe, nextTick as Le, unref as P, computed as K, watchEffect as Ee, createElementBlock as D, Fragment as q, withModifiers as Te, renderList as te, normalizeClass as R, toDisplayString as B, createCommentVNode as H, watch as _e, inject as xe } from "vue";
|
|
3
|
+
import { Button as Y, DialogBox as ke, Form as Ue, FormItem as fe, Input as ie, Popover as Ce, Tooltip as ze, Collapse as je, CollapseItem as he, Switch as Re, Search as Fe } from "@opentiny/vue";
|
|
4
|
+
import { getMergeMeta as Ve, useLayout as De, useCanvas as Q, getMetaApi as G, META_APP as W, useHistory as Je, useBlock as Xe, useMaterial as He, useModal as $e, useProperties as V } from "@opentiny/tiny-engine-meta-register";
|
|
5
|
+
import { BlockLinkEvent as qe, SvgButton as Ke, VueMonaco as Ye } from "@opentiny/tiny-engine-common";
|
|
6
|
+
import { iconHelpQuery as Ie, iconChevronDown as Qe, iconYes as Ze } from "@opentiny/vue-icon";
|
|
7
|
+
import { string2Ast as be, ast2String as Ge } from "@opentiny/tiny-engine-common/js/ast";
|
|
8
|
+
import { SwitchConfigurator as We, VariableConfigurator as en, InputConfigurator as nn, CodeConfigurator as on } from "@opentiny/tiny-engine-configurator";
|
|
9
|
+
import { PROP_DATA_TYPE as X } from "@opentiny/tiny-engine-common/js/constants";
|
|
10
|
+
import { constants as tn, utils as sn } from "@opentiny/tiny-engine-utils";
|
|
11
|
+
const Ne = "newMethod", an = /[^0-9a-zA-Z_$]/, ln = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, j = {
|
|
22
12
|
default: "选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)",
|
|
23
13
|
exist: "方法名称已存在",
|
|
24
14
|
ruleInvalid: "请输入有效的方法名,可以由字母、数字、下划线、$ 符号组成,不能以数字开头",
|
|
25
15
|
empty: "方法名称不能为空"
|
|
26
|
-
},
|
|
16
|
+
}, Ae = {
|
|
17
|
+
id: "engine.setting.event",
|
|
18
|
+
title: "高级",
|
|
19
|
+
type: "setting",
|
|
20
|
+
align: "left",
|
|
21
|
+
name: "event",
|
|
22
|
+
icon: ""
|
|
23
|
+
};
|
|
24
|
+
const J = (m, n) => {
|
|
25
|
+
const l = m.__vccOpts || m;
|
|
26
|
+
for (const [e, s] of n)
|
|
27
|
+
l[e] = s;
|
|
28
|
+
return l;
|
|
29
|
+
}, se = F(!1), dn = () => {
|
|
30
|
+
se.value = !0;
|
|
31
|
+
}, ye = () => {
|
|
32
|
+
se.value = !1;
|
|
33
|
+
}, rn = {
|
|
27
34
|
components: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
TinyButton: ee,
|
|
31
|
-
TinySearch: Le,
|
|
32
|
-
TinyPopover: De,
|
|
33
|
-
TinyDialogBox: Ae,
|
|
34
|
-
IconYes: Ge(),
|
|
35
|
-
IconHelpQuery: we(),
|
|
36
|
-
TinySwitch: Te
|
|
35
|
+
TinyButton: Y,
|
|
36
|
+
TinyDialogBox: ke
|
|
37
37
|
},
|
|
38
38
|
inheritAttrs: !1,
|
|
39
39
|
props: {
|
|
@@ -42,155 +42,98 @@ const oe = (l, i) => {
|
|
|
42
42
|
default: () => ({})
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
setup(
|
|
46
|
-
const {
|
|
47
|
-
searchValue: "",
|
|
45
|
+
setup(m) {
|
|
46
|
+
const { BindEventsDialogSidebar: n, BindEventsDialogContent: l } = Ve(Ae.id).components, { PLUGIN_NAME: e, activePlugin: s } = De(), { pageState: h } = Q(), { getMethods: b, saveMethod: v, highlightMethod: a } = G(W.Page), i = Z({
|
|
48
47
|
editorContent: "",
|
|
49
48
|
bindMethodInfo: {},
|
|
50
|
-
|
|
51
|
-
tip: F.default,
|
|
49
|
+
tip: j.default,
|
|
52
50
|
tipError: !1,
|
|
53
51
|
enableExtraParams: !1,
|
|
54
52
|
isValidParams: !0
|
|
55
|
-
}), t = {
|
|
56
|
-
roundedSelection: !0,
|
|
57
|
-
automaticLayout: !0,
|
|
58
|
-
autoIndent: !0,
|
|
59
|
-
language: "json",
|
|
60
|
-
formatOnPaste: !0,
|
|
61
|
-
tabSize: 2,
|
|
62
|
-
theme: et(),
|
|
63
|
-
lineNumbers: !1,
|
|
64
|
-
minimap: {
|
|
65
|
-
enabled: !1
|
|
66
|
-
}
|
|
67
|
-
}, a = (s, r) => {
|
|
68
|
-
const m = s.map((V) => {
|
|
69
|
-
var g;
|
|
70
|
-
return Number.parseInt((g = V.match(/\d+$/)) == null ? void 0 : g[0]) || 0;
|
|
71
|
-
}).sort((V, g) => V - g).pop();
|
|
72
|
-
let P = `${(r == null ? void 0 : r.replace(at, "_")) || ""}New`;
|
|
73
|
-
return m > -1 && (P += `${m + 1}`), P;
|
|
74
|
-
};
|
|
75
|
-
Ce(() => {
|
|
76
|
-
var V, g;
|
|
77
|
-
const s = (V = l.eventBinding) == null ? void 0 : V.eventName, r = (u == null ? void 0 : u().filter((T) => T.indexOf(s) > -1)) || [], k = {
|
|
78
|
-
title: "添加新方法",
|
|
79
|
-
name: a(r, s),
|
|
80
|
-
type: Ne
|
|
81
|
-
};
|
|
82
|
-
(g = l.eventBinding) != null && g.ref ? n.bindMethodInfo = {
|
|
83
|
-
name: l.eventBinding.ref
|
|
84
|
-
} : n.bindMethodInfo = k;
|
|
85
|
-
const P = (u == null ? void 0 : u().filter((T) => T.indexOf(n.searchValue) > -1).map((T) => ({ name: T }))) || [];
|
|
86
|
-
n.filterMethodList = [k, ...P];
|
|
87
53
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
54
|
+
Oe("context", i);
|
|
55
|
+
const p = (d) => {
|
|
56
|
+
i.bindMethodInfo = d;
|
|
57
|
+
}, o = (d) => {
|
|
58
|
+
var O, N;
|
|
59
|
+
if (!d)
|
|
93
60
|
return;
|
|
94
|
-
const
|
|
95
|
-
if (!
|
|
61
|
+
const g = (O = m.eventBinding) == null ? void 0 : O.eventName;
|
|
62
|
+
if (!g)
|
|
96
63
|
return;
|
|
97
|
-
const
|
|
98
|
-
if (!
|
|
64
|
+
const C = (N = h == null ? void 0 : h.currentSchema) == null ? void 0 : N.props;
|
|
65
|
+
if (!C)
|
|
99
66
|
return;
|
|
100
|
-
const { name:
|
|
101
|
-
|
|
67
|
+
const { name: M, extra: S } = d;
|
|
68
|
+
m[g] || (C[g] = {
|
|
102
69
|
type: "JSExpression",
|
|
103
70
|
value: ""
|
|
104
|
-
}),
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
{ validator: X, tip: F.exist },
|
|
111
|
-
{ validator: ne, tip: F.ruleInvalid }
|
|
112
|
-
];
|
|
113
|
-
for (let m = 0; m < r.length; m++) {
|
|
114
|
-
const k = r[m];
|
|
115
|
-
if (k.validator(s)) {
|
|
116
|
-
n.tipError = !0, n.tip = k.tip;
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
n.tipError = !1, n.tip = F.default;
|
|
121
|
-
}, A = () => {
|
|
122
|
-
var r;
|
|
123
|
-
let s = "";
|
|
124
|
-
if (n.enableExtraParams)
|
|
71
|
+
}), S && i.enableExtraParams && (C[g].params = S), C[g].value = `this.${M}`, Je().addHistory();
|
|
72
|
+
}, r = () => {
|
|
73
|
+
i.tipError = !1, i.tip = j.default, i.isValidParams = !0;
|
|
74
|
+
}, u = () => {
|
|
75
|
+
let d = "";
|
|
76
|
+
if (i.enableExtraParams)
|
|
125
77
|
try {
|
|
126
|
-
|
|
127
|
-
s = JSON.parse(m), n.isValidParams = Array.isArray(s);
|
|
78
|
+
d = JSON.parse(i.editorContent), i.isValidParams = Array.isArray(d);
|
|
128
79
|
} catch {
|
|
129
|
-
|
|
80
|
+
i.isValidParams = !1;
|
|
130
81
|
}
|
|
131
|
-
return
|
|
132
|
-
},
|
|
133
|
-
var
|
|
134
|
-
let
|
|
135
|
-
if (
|
|
136
|
-
let
|
|
82
|
+
return d;
|
|
83
|
+
}, k = (d) => Array.from({ length: d.length }, (g, C) => `args${C}`).join(","), y = () => {
|
|
84
|
+
var C, M, S, O;
|
|
85
|
+
let d = (M = (C = b()) == null ? void 0 : C[i.bindMethodInfo.name]) == null ? void 0 : M.value, g = "{}";
|
|
86
|
+
if (d) {
|
|
87
|
+
let N = {};
|
|
137
88
|
try {
|
|
138
|
-
|
|
89
|
+
N = be(d);
|
|
139
90
|
} catch {
|
|
140
|
-
|
|
91
|
+
d = d.replace("function", `function ${i.bindMethodInfo.name}`), N = be(d);
|
|
141
92
|
}
|
|
142
|
-
(
|
|
93
|
+
(O = (S = N == null ? void 0 : N.program) == null ? void 0 : S.body[0]) != null && O.body && (g = Ge(N.program.body[0].body));
|
|
143
94
|
}
|
|
144
|
-
return
|
|
95
|
+
return g || `{
|
|
145
96
|
}`;
|
|
146
|
-
},
|
|
147
|
-
e
|
|
148
|
-
|
|
149
|
-
var
|
|
150
|
-
|
|
97
|
+
}, I = () => {
|
|
98
|
+
s(e.Page).then(() => {
|
|
99
|
+
Le(() => {
|
|
100
|
+
var d;
|
|
101
|
+
a && a((d = i.bindMethodInfo) == null ? void 0 : d.name);
|
|
151
102
|
});
|
|
152
103
|
});
|
|
153
104
|
};
|
|
154
105
|
return {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
dialogVisible: ve,
|
|
160
|
-
change: f,
|
|
106
|
+
BindEventsDialogSidebar: n,
|
|
107
|
+
BindEventsDialogContent: l,
|
|
108
|
+
state: i,
|
|
109
|
+
dialogVisible: se,
|
|
161
110
|
confirm: () => {
|
|
162
|
-
if (
|
|
111
|
+
if (i.tipError)
|
|
163
112
|
return;
|
|
164
|
-
let
|
|
165
|
-
if (!
|
|
113
|
+
let d = "event", g = u(), C = d;
|
|
114
|
+
if (!i.isValidParams)
|
|
166
115
|
return;
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
name:
|
|
171
|
-
content:
|
|
172
|
-
}),
|
|
116
|
+
g && (d = g.join(","), C = k(g)), o({ ...i.bindMethodInfo, params: d, extra: g });
|
|
117
|
+
const M = y();
|
|
118
|
+
v == null || v({
|
|
119
|
+
name: i.bindMethodInfo.name,
|
|
120
|
+
content: i.enableExtraParams ? `function ${i.bindMethodInfo.name}(eventArgs,${C}) ${M}` : `function ${i.bindMethodInfo.name}(${C}) ${M}`
|
|
121
|
+
}), I(), ye();
|
|
173
122
|
},
|
|
174
123
|
closeDialog: () => {
|
|
175
|
-
|
|
124
|
+
r(), ye();
|
|
176
125
|
},
|
|
177
126
|
openedDialog: () => {
|
|
178
|
-
var
|
|
179
|
-
|
|
127
|
+
var d, g, C;
|
|
128
|
+
i.enableExtraParams = !!((g = (d = m.eventBinding) == null ? void 0 : d.params) != null && g.length), i.editorContent = JSON.stringify(((C = m.eventBinding) == null ? void 0 : C.params) || [], null, 2), r();
|
|
180
129
|
},
|
|
181
|
-
selectMethod:
|
|
130
|
+
selectMethod: p
|
|
182
131
|
};
|
|
183
132
|
}
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
key: 0,
|
|
189
|
-
class: "params-tip"
|
|
190
|
-
}, Ct = { class: "bind-dialog-footer" };
|
|
191
|
-
function Dt(l, i, b, e, c, u) {
|
|
192
|
-
const w = v("tiny-search"), y = v("icon-yes"), E = v("tiny-input"), x = v("icon-help-query"), n = v("tiny-popover"), t = v("tiny-switch"), a = v("monaco-editor"), C = v("tiny-button"), N = v("tiny-dialog-box");
|
|
193
|
-
return ce((h(), U(N, {
|
|
133
|
+
}, cn = { class: "bind-event-dialog-content" }, pn = { class: "bind-dialog-footer" };
|
|
134
|
+
function mn(m, n, l, e, s, h) {
|
|
135
|
+
const b = E("tiny-button"), v = E("tiny-dialog-box");
|
|
136
|
+
return ne((f(), w(v, {
|
|
194
137
|
title: "事件绑定",
|
|
195
138
|
width: "50%",
|
|
196
139
|
"append-to-body": !0,
|
|
@@ -198,129 +141,36 @@ function Dt(l, i, b, e, c, u) {
|
|
|
198
141
|
onOpened: e.openedDialog
|
|
199
142
|
}, {
|
|
200
143
|
footer: _(() => [
|
|
201
|
-
|
|
202
|
-
|
|
144
|
+
t("div", pn, [
|
|
145
|
+
c(b, {
|
|
203
146
|
type: "info",
|
|
204
147
|
onClick: e.confirm
|
|
205
148
|
}, {
|
|
206
|
-
default: _(() => [
|
|
207
|
-
|
|
208
|
-
]),
|
|
149
|
+
default: _(() => n[0] || (n[0] = [
|
|
150
|
+
A("确 定")
|
|
151
|
+
])),
|
|
209
152
|
_: 1
|
|
210
153
|
}, 8, ["onClick"]),
|
|
211
|
-
|
|
212
|
-
default: _(() => [
|
|
213
|
-
|
|
214
|
-
]),
|
|
154
|
+
c(b, { onClick: e.closeDialog }, {
|
|
155
|
+
default: _(() => n[1] || (n[1] = [
|
|
156
|
+
A("取 消")
|
|
157
|
+
])),
|
|
215
158
|
_: 1
|
|
216
159
|
}, 8, ["onClick"])
|
|
217
160
|
])
|
|
218
161
|
]),
|
|
219
162
|
default: _(() => [
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
o("div", mt, [
|
|
224
|
-
o("div", _t, [
|
|
225
|
-
p(w, {
|
|
226
|
-
modelValue: e.state.searchValue,
|
|
227
|
-
"onUpdate:modelValue": i[0] || (i[0] = (d) => e.state.searchValue = d),
|
|
228
|
-
placeholder: "搜索"
|
|
229
|
-
}, null, 8, ["modelValue"]),
|
|
230
|
-
o("ul", ut, [
|
|
231
|
-
(h(!0), S(G, null, de(e.state.filterMethodList, (d) => (h(), S("li", {
|
|
232
|
-
key: d.name,
|
|
233
|
-
onClick: (D) => e.selectMethod(d)
|
|
234
|
-
}, [
|
|
235
|
-
o("div", {
|
|
236
|
-
class: J(["action-name", { active: d.name === e.state.bindMethodInfo.name }])
|
|
237
|
-
}, [
|
|
238
|
-
M(L(d.title || d.name) + " ", 1),
|
|
239
|
-
d.name === e.state.bindMethodInfo.name ? (h(), U(y, {
|
|
240
|
-
key: 0,
|
|
241
|
-
class: "action-selected-icon"
|
|
242
|
-
})) : H("", !0)
|
|
243
|
-
], 2)
|
|
244
|
-
], 8, vt))), 128))
|
|
245
|
-
])
|
|
246
|
-
])
|
|
247
|
-
])
|
|
248
|
-
]),
|
|
249
|
-
o("div", ft, [
|
|
250
|
-
o("div", {
|
|
251
|
-
class: J(["content-right-top", { "tip-error": e.state.tipError }])
|
|
252
|
-
}, [
|
|
253
|
-
ht,
|
|
254
|
-
p(E, {
|
|
255
|
-
modelValue: e.state.bindMethodInfo.name,
|
|
256
|
-
"onUpdate:modelValue": [
|
|
257
|
-
i[1] || (i[1] = (d) => e.state.bindMethodInfo.name = d),
|
|
258
|
-
e.change
|
|
259
|
-
],
|
|
260
|
-
disabled: e.state.bindMethodInfo.type !== e.NEW_METHOD_TYPE,
|
|
261
|
-
class: J([{ "status-error": e.state.tipError }]),
|
|
262
|
-
placeholder: "请从左侧选择一个方法进行绑定,或者选择添加新方法,输入自定义方法名称。"
|
|
263
|
-
}, null, 8, ["modelValue", "disabled", "class", "onUpdate:modelValue"]),
|
|
264
|
-
o("div", gt, L(e.state.tip), 1)
|
|
265
|
-
], 2),
|
|
266
|
-
o("div", {
|
|
267
|
-
class: J(["content-right-bottom", { "tip-error": !e.state.isValidParams }])
|
|
268
|
-
}, [
|
|
269
|
-
o("div", bt, [
|
|
270
|
-
yt,
|
|
271
|
-
p(n, {
|
|
272
|
-
placement: "top-start",
|
|
273
|
-
width: "350",
|
|
274
|
-
trigger: "hover"
|
|
275
|
-
}, {
|
|
276
|
-
reference: _(() => [
|
|
277
|
-
p(x)
|
|
278
|
-
]),
|
|
279
|
-
default: _(() => [
|
|
280
|
-
o("p", null, [
|
|
281
|
-
M(" 扩展参数:调用当前事件传入的真实参数,数组格式,追加在原有事件参数之后"),
|
|
282
|
-
Et,
|
|
283
|
-
M(" 如: " + L(e.state.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
|
|
284
|
-
])
|
|
285
|
-
]),
|
|
286
|
-
_: 1
|
|
287
|
-
}),
|
|
288
|
-
p(t, {
|
|
289
|
-
modelValue: e.state.enableExtraParams,
|
|
290
|
-
"onUpdate:modelValue": i[2] || (i[2] = (d) => e.state.enableExtraParams = d),
|
|
291
|
-
class: "set-switch",
|
|
292
|
-
"show-text": !0
|
|
293
|
-
}, {
|
|
294
|
-
open: _(() => [
|
|
295
|
-
kt
|
|
296
|
-
]),
|
|
297
|
-
close: _(() => [
|
|
298
|
-
xt
|
|
299
|
-
]),
|
|
300
|
-
_: 1
|
|
301
|
-
}, 8, ["modelValue"])
|
|
302
|
-
]),
|
|
303
|
-
o("div", Vt, [
|
|
304
|
-
e.dialogVisible ? (h(), U(a, {
|
|
305
|
-
key: 0,
|
|
306
|
-
ref: "editor",
|
|
307
|
-
value: e.state.editorContent,
|
|
308
|
-
options: e.editorOptions,
|
|
309
|
-
class: "monaco-editor"
|
|
310
|
-
}, null, 8, ["value", "options"])) : H("", !0),
|
|
311
|
-
e.state.enableExtraParams ? H("", !0) : (h(), S("div", It))
|
|
312
|
-
]),
|
|
313
|
-
!e.state.isValidParams && e.state.enableExtraParams ? (h(), S("div", Nt, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : H("", !0)
|
|
314
|
-
], 2)
|
|
315
|
-
])
|
|
163
|
+
t("div", cn, [
|
|
164
|
+
(f(), w(ge(e.BindEventsDialogSidebar), { eventBinding: l.eventBinding }, null, 8, ["eventBinding"])),
|
|
165
|
+
(f(), w(ge(e.BindEventsDialogContent), { dialogVisible: e.dialogVisible }, null, 8, ["dialogVisible"]))
|
|
316
166
|
])
|
|
317
167
|
]),
|
|
318
168
|
_: 1
|
|
319
169
|
}, 8, ["onClose", "onOpened"])), [
|
|
320
|
-
[
|
|
170
|
+
[oe, e.dialogVisible]
|
|
321
171
|
]);
|
|
322
172
|
}
|
|
323
|
-
const
|
|
173
|
+
const un = /* @__PURE__ */ J(rn, [["render", mn], ["__scopeId", "data-v-4b0930ec"]]), vn = {
|
|
324
174
|
onClick: {
|
|
325
175
|
label: {
|
|
326
176
|
zh_CN: "鼠标单击时触发"
|
|
@@ -377,7 +227,7 @@ const At = /* @__PURE__ */ oe(ct, [["render", Dt], ["__scopeId", "data-v-6a54279
|
|
|
377
227
|
},
|
|
378
228
|
defaultValue: ""
|
|
379
229
|
}
|
|
380
|
-
},
|
|
230
|
+
}, gn = [
|
|
381
231
|
"onabort",
|
|
382
232
|
"onafterprint",
|
|
383
233
|
"onanimationend",
|
|
@@ -487,11 +337,11 @@ const At = /* @__PURE__ */ oe(ct, [["render", Dt], ["__scopeId", "data-v-6a54279
|
|
|
487
337
|
"onwebkitanimationstart",
|
|
488
338
|
"onwebkittransitionend",
|
|
489
339
|
"onwheel"
|
|
490
|
-
],
|
|
491
|
-
let e =
|
|
492
|
-
return `${
|
|
493
|
-
}).includes(
|
|
494
|
-
const
|
|
340
|
+
], _n = (m) => !!gn.map((l) => {
|
|
341
|
+
let e = l[2].toUpperCase();
|
|
342
|
+
return `${l.substring(0, 2)}${e}${l.substring(3)}`;
|
|
343
|
+
}).includes(m);
|
|
344
|
+
const fn = { class: "footer" }, hn = {
|
|
495
345
|
__name: "AddEventsDialog",
|
|
496
346
|
props: {
|
|
497
347
|
visible: {
|
|
@@ -504,11 +354,11 @@ const St = { class: "footer" }, Bt = {
|
|
|
504
354
|
}
|
|
505
355
|
},
|
|
506
356
|
emits: ["closeDialog", "addEvent"],
|
|
507
|
-
setup(
|
|
508
|
-
const
|
|
357
|
+
setup(m, { emit: n }) {
|
|
358
|
+
const l = m, e = n, s = Z({
|
|
509
359
|
eventDescription: "",
|
|
510
360
|
eventName: ""
|
|
511
|
-
}),
|
|
361
|
+
}), h = F(null), v = {
|
|
512
362
|
eventDescription: [
|
|
513
363
|
{
|
|
514
364
|
required: !0,
|
|
@@ -518,62 +368,62 @@ const St = { class: "footer" }, Bt = {
|
|
|
518
368
|
eventName: [
|
|
519
369
|
{ required: !0, message: "必填" },
|
|
520
370
|
{
|
|
521
|
-
validator: (
|
|
522
|
-
if (
|
|
523
|
-
|
|
371
|
+
validator: (p, o, r) => {
|
|
372
|
+
if (l.componentEvents[s.eventName]) {
|
|
373
|
+
r(new Error("事件名已存在"));
|
|
524
374
|
return;
|
|
525
375
|
}
|
|
526
|
-
if (!
|
|
527
|
-
|
|
376
|
+
if (!_n(s.eventName)) {
|
|
377
|
+
r(new Error("请输入正确的浏览器事件名"));
|
|
528
378
|
return;
|
|
529
379
|
}
|
|
530
|
-
|
|
380
|
+
r();
|
|
531
381
|
}
|
|
532
382
|
}
|
|
533
383
|
]
|
|
534
|
-
},
|
|
384
|
+
}, a = () => {
|
|
535
385
|
e("closeDialog");
|
|
536
|
-
},
|
|
537
|
-
|
|
538
|
-
if (!
|
|
386
|
+
}, i = () => {
|
|
387
|
+
h.value && h.value.validate((p) => {
|
|
388
|
+
if (!p)
|
|
539
389
|
return;
|
|
540
|
-
const { eventName:
|
|
541
|
-
e("addEvent", { eventName:
|
|
390
|
+
const { eventName: o, eventDescription: r } = s;
|
|
391
|
+
e("addEvent", { eventName: o, eventDescription: r });
|
|
542
392
|
});
|
|
543
393
|
};
|
|
544
|
-
return (
|
|
545
|
-
visible:
|
|
394
|
+
return (p, o) => (f(), w(P(ke), {
|
|
395
|
+
visible: m.visible,
|
|
546
396
|
title: "添加自定义事件",
|
|
547
397
|
width: "400px",
|
|
548
398
|
"append-to-body": !0,
|
|
549
399
|
"close-on-click-modal": !1,
|
|
550
|
-
onClose:
|
|
400
|
+
onClose: a
|
|
551
401
|
}, {
|
|
552
402
|
footer: _(() => [
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
default: _(() => [
|
|
556
|
-
|
|
557
|
-
]),
|
|
403
|
+
t("div", fn, [
|
|
404
|
+
c(P(Y), { onClick: a }, {
|
|
405
|
+
default: _(() => o[2] || (o[2] = [
|
|
406
|
+
A(" 取消")
|
|
407
|
+
])),
|
|
558
408
|
_: 1
|
|
559
409
|
}),
|
|
560
|
-
|
|
410
|
+
c(P(Y), {
|
|
561
411
|
type: "primary",
|
|
562
|
-
onClick:
|
|
412
|
+
onClick: i
|
|
563
413
|
}, {
|
|
564
|
-
default: _(() => [
|
|
565
|
-
|
|
566
|
-
]),
|
|
414
|
+
default: _(() => o[3] || (o[3] = [
|
|
415
|
+
A(" 确定")
|
|
416
|
+
])),
|
|
567
417
|
_: 1
|
|
568
418
|
})
|
|
569
419
|
])
|
|
570
420
|
]),
|
|
571
421
|
default: _(() => [
|
|
572
|
-
|
|
422
|
+
c(P(Ue), {
|
|
573
423
|
ref_key: "ruleForm",
|
|
574
|
-
ref:
|
|
575
|
-
model:
|
|
576
|
-
rules:
|
|
424
|
+
ref: h,
|
|
425
|
+
model: s,
|
|
426
|
+
rules: v,
|
|
577
427
|
"label-width": "100px",
|
|
578
428
|
"inline-message": !0,
|
|
579
429
|
"validate-type": "text",
|
|
@@ -581,29 +431,29 @@ const St = { class: "footer" }, Bt = {
|
|
|
581
431
|
class: "add-custom-event-form"
|
|
582
432
|
}, {
|
|
583
433
|
default: _(() => [
|
|
584
|
-
|
|
434
|
+
c(P(fe), {
|
|
585
435
|
label: "事件函数名",
|
|
586
436
|
prop: "eventName",
|
|
587
437
|
required: ""
|
|
588
438
|
}, {
|
|
589
439
|
default: _(() => [
|
|
590
|
-
|
|
591
|
-
modelValue:
|
|
592
|
-
"onUpdate:modelValue":
|
|
440
|
+
c(P(ie), {
|
|
441
|
+
modelValue: s.eventName,
|
|
442
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => s.eventName = r),
|
|
593
443
|
placeholder: "小驼峰格式,如:onDrag"
|
|
594
444
|
}, null, 8, ["modelValue"])
|
|
595
445
|
]),
|
|
596
446
|
_: 1
|
|
597
447
|
}),
|
|
598
|
-
|
|
448
|
+
c(P(fe), {
|
|
599
449
|
label: "事件描述",
|
|
600
450
|
prop: "eventDescription",
|
|
601
451
|
required: ""
|
|
602
452
|
}, {
|
|
603
453
|
default: _(() => [
|
|
604
|
-
|
|
605
|
-
modelValue:
|
|
606
|
-
"onUpdate:modelValue":
|
|
454
|
+
c(P(ie), {
|
|
455
|
+
modelValue: s.eventDescription,
|
|
456
|
+
"onUpdate:modelValue": o[1] || (o[1] = (r) => s.eventDescription = r)
|
|
607
457
|
}, null, 8, ["modelValue"])
|
|
608
458
|
]),
|
|
609
459
|
_: 1
|
|
@@ -615,90 +465,90 @@ const St = { class: "footer" }, Bt = {
|
|
|
615
465
|
_: 1
|
|
616
466
|
}, 8, ["visible"]));
|
|
617
467
|
}
|
|
618
|
-
},
|
|
619
|
-
const
|
|
468
|
+
}, bn = /* @__PURE__ */ J(hn, [["__scopeId", "data-v-932b189c"]]);
|
|
469
|
+
const yn = {
|
|
620
470
|
components: {
|
|
621
471
|
BlockLinkEvent: qe,
|
|
622
|
-
BindEventsDialog:
|
|
623
|
-
TinyPopover:
|
|
624
|
-
TinyButton:
|
|
625
|
-
IconHelpQuery:
|
|
626
|
-
IconChevronDown:
|
|
627
|
-
SvgButton:
|
|
628
|
-
AddEventsDialog:
|
|
472
|
+
BindEventsDialog: un,
|
|
473
|
+
TinyPopover: Ce,
|
|
474
|
+
TinyButton: Y,
|
|
475
|
+
IconHelpQuery: Ie(),
|
|
476
|
+
IconChevronDown: Qe(),
|
|
477
|
+
SvgButton: Ke,
|
|
478
|
+
AddEventsDialog: bn
|
|
629
479
|
},
|
|
630
480
|
inheritAttrs: !1,
|
|
631
481
|
setup() {
|
|
632
|
-
const { PLUGIN_NAME:
|
|
482
|
+
const { PLUGIN_NAME: m, activePlugin: n } = De(), { pageState: l } = Q(), { getBlockEvents: e, getCurrentBlock: s, removeEventLink: h } = Xe(), { getMaterial: b } = He(), { confirm: v } = $e(), { highlightMethod: a } = G(W.Page), { commonEvents: i = {} } = Ve("engine.setting.event").options, p = Z({
|
|
633
483
|
eventName: "",
|
|
634
484
|
// 事件名称
|
|
635
485
|
eventBinding: null,
|
|
636
486
|
// 事件绑定的处理方法对象
|
|
637
487
|
componentEvent: {},
|
|
638
|
-
componentEvents:
|
|
488
|
+
componentEvents: i,
|
|
639
489
|
bindActions: {},
|
|
640
490
|
showBindEventDialog: !1
|
|
641
|
-
}),
|
|
642
|
-
|
|
643
|
-
var
|
|
644
|
-
const
|
|
645
|
-
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
var
|
|
649
|
-
if (
|
|
650
|
-
const
|
|
651
|
-
eventName:
|
|
491
|
+
}), o = K(() => !!l.isBlock), r = K(() => Object.keys(p.bindActions).length === 0);
|
|
492
|
+
Ee(() => {
|
|
493
|
+
var M, S, O, N, ee;
|
|
494
|
+
const x = (M = l == null ? void 0 : l.currentSchema) == null ? void 0 : M.componentName, d = b(x);
|
|
495
|
+
p.componentEvent = ((O = (S = d == null ? void 0 : d.content) == null ? void 0 : S.schema) == null ? void 0 : O.events) || ((N = d == null ? void 0 : d.schema) == null ? void 0 : N.events) || {}, p.componentEvents = { ...i, ...p.componentEvent };
|
|
496
|
+
const g = ((ee = l == null ? void 0 : l.currentSchema) == null ? void 0 : ee.props) || {}, C = Object.keys(g);
|
|
497
|
+
p.bindActions = {}, Object.entries(p.componentEvents).forEach(([z, Pe]) => {
|
|
498
|
+
var le, de, re;
|
|
499
|
+
if (C.indexOf(z) > -1) {
|
|
500
|
+
const Be = g[z], { value: Me, params: ce } = Be, we = !ce && ((de = (le = Me.match(/\((.+)\)$/)) == null ? void 0 : le[1]) == null ? void 0 : de.split(",")) || ce, L = {
|
|
501
|
+
eventName: z,
|
|
652
502
|
ref: "",
|
|
653
|
-
event:
|
|
654
|
-
params:
|
|
503
|
+
event: g[z],
|
|
504
|
+
params: we
|
|
655
505
|
};
|
|
656
|
-
if (
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
var
|
|
661
|
-
|
|
506
|
+
if (L.event.type === "JSExpression" && (L.ref = L.event.value.replace("this.", "").replace(/\(.*\)$/, "")), l.isBlock) {
|
|
507
|
+
L.metaEvent = Pe;
|
|
508
|
+
const pe = e(s()), me = (re = l == null ? void 0 : l.currentSchema) == null ? void 0 : re.id;
|
|
509
|
+
me && pe && Object.entries(pe).forEach(([Se, T]) => {
|
|
510
|
+
var ue, ve;
|
|
511
|
+
me === ((ue = T == null ? void 0 : T.linked) == null ? void 0 : ue.id) && z === ((ve = T == null ? void 0 : T.linked) == null ? void 0 : ve.event) && (L.linked = T.linked, L.linkedEventName = Se);
|
|
662
512
|
});
|
|
663
513
|
}
|
|
664
|
-
|
|
514
|
+
p.bindActions[z] = L;
|
|
665
515
|
}
|
|
666
516
|
});
|
|
667
517
|
});
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
},
|
|
671
|
-
var
|
|
672
|
-
Object.keys(((
|
|
518
|
+
const u = (x, d) => {
|
|
519
|
+
d && p.bindActions[x.eventName] || (p.eventBinding = x, dn());
|
|
520
|
+
}, k = (x) => {
|
|
521
|
+
var g;
|
|
522
|
+
Object.keys(((g = l == null ? void 0 : l.currentSchema) == null ? void 0 : g.props) || {}).indexOf(x.eventName) > -1 && delete l.currentSchema.props[x.eventName];
|
|
673
523
|
};
|
|
674
524
|
return {
|
|
675
|
-
state:
|
|
676
|
-
isBlock:
|
|
677
|
-
isEmpty:
|
|
678
|
-
delEvent: (
|
|
679
|
-
|
|
525
|
+
state: p,
|
|
526
|
+
isBlock: o,
|
|
527
|
+
isEmpty: r,
|
|
528
|
+
delEvent: (x) => {
|
|
529
|
+
v({
|
|
680
530
|
title: "提示",
|
|
681
|
-
message: `您确定要删除事件 ${
|
|
531
|
+
message: `您确定要删除事件 ${x.eventName} 吗?`,
|
|
682
532
|
exec() {
|
|
683
|
-
|
|
533
|
+
l.isBlock && h({ linked: x.linked }), k(x);
|
|
684
534
|
}
|
|
685
535
|
});
|
|
686
536
|
},
|
|
687
|
-
openCodePanel: (
|
|
688
|
-
|
|
689
|
-
|
|
537
|
+
openCodePanel: (x) => {
|
|
538
|
+
x && n(m.Page).then(() => {
|
|
539
|
+
a && a(x.ref);
|
|
690
540
|
});
|
|
691
541
|
},
|
|
692
|
-
openActionDialog:
|
|
693
|
-
handleAddEvent: (
|
|
694
|
-
const { eventName:
|
|
695
|
-
Object.assign(
|
|
696
|
-
[
|
|
542
|
+
openActionDialog: u,
|
|
543
|
+
handleAddEvent: (x) => {
|
|
544
|
+
const { eventName: d, eventDescription: g } = x;
|
|
545
|
+
Object.assign(p.componentEvents, {
|
|
546
|
+
[d]: {
|
|
697
547
|
label: {
|
|
698
|
-
zh_CN:
|
|
548
|
+
zh_CN: g
|
|
699
549
|
},
|
|
700
550
|
description: {
|
|
701
|
-
zh_CN: `${
|
|
551
|
+
zh_CN: `${g}的回调函数`
|
|
702
552
|
},
|
|
703
553
|
type: "event",
|
|
704
554
|
functionInfo: {
|
|
@@ -707,45 +557,41 @@ const Lt = {
|
|
|
707
557
|
},
|
|
708
558
|
defaultValue: ""
|
|
709
559
|
}
|
|
710
|
-
}),
|
|
560
|
+
}), p.showBindEventDialog = !1;
|
|
711
561
|
},
|
|
712
|
-
handleToggleAddEventDialog: (
|
|
713
|
-
|
|
562
|
+
handleToggleAddEventDialog: (x) => {
|
|
563
|
+
p.showBindEventDialog = x;
|
|
714
564
|
}
|
|
715
565
|
};
|
|
716
566
|
}
|
|
717
|
-
},
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
], -1));
|
|
726
|
-
function eo(l, i, b, e, c, u) {
|
|
727
|
-
const w = v("icon-help-query"), y = v("tiny-popover"), E = v("tiny-button"), x = v("icon-chevron-down"), n = v("block-link-event"), t = v("svg-button"), a = v("svg-icon"), C = v("bind-events-dialog"), N = v("add-events-dialog");
|
|
728
|
-
return h(), S(G, null, [
|
|
729
|
-
o("div", Tt, [
|
|
730
|
-
o("div", Ut, [
|
|
731
|
-
o("span", zt, [
|
|
732
|
-
p(E, {
|
|
567
|
+
}, En = { class: "bind-action-list" }, xn = { class: "popover-head" }, kn = { class: "head-left" }, Cn = { class: "bind-event-list" }, Vn = ["onClick"], Dn = { class: "bind-actions" }, In = { class: "action-item bind-action-item" }, Nn = ["onClick"], An = { class: "event-bind" }, Pn = { class: "action-buttons" }, Bn = { class: "empty-action" }, Mn = { class: "icon" };
|
|
568
|
+
function wn(m, n, l, e, s, h) {
|
|
569
|
+
const b = E("icon-help-query"), v = E("tiny-popover"), a = E("tiny-button"), i = E("icon-chevron-down"), p = E("block-link-event"), o = E("svg-button"), r = E("svg-icon"), u = E("bind-events-dialog"), k = E("add-events-dialog");
|
|
570
|
+
return f(), D(q, null, [
|
|
571
|
+
t("div", En, [
|
|
572
|
+
t("div", xn, [
|
|
573
|
+
t("span", kn, [
|
|
574
|
+
c(a, {
|
|
733
575
|
class: "title add-custom-event-button",
|
|
734
576
|
"reset-time": 0,
|
|
735
|
-
onClick:
|
|
577
|
+
onClick: n[0] || (n[0] = Te((y) => e.handleToggleAddEventDialog(!0), ["stop"]))
|
|
736
578
|
}, {
|
|
737
579
|
default: _(() => [
|
|
738
|
-
|
|
739
|
-
|
|
580
|
+
n[3] || (n[3] = t("span", { class: "custom-event-button-text" }, "添加自定义事件", -1)),
|
|
581
|
+
c(v, {
|
|
740
582
|
placement: "bottom-start",
|
|
741
583
|
trigger: "hover",
|
|
742
584
|
popperClass: "setting-advanced-add-custom-event-tip"
|
|
743
585
|
}, {
|
|
744
586
|
reference: _(() => [
|
|
745
|
-
|
|
587
|
+
c(b, { class: "icon-help" })
|
|
746
588
|
]),
|
|
747
589
|
default: _(() => [
|
|
748
|
-
|
|
590
|
+
n[2] || (n[2] = t("div", { class: "add-custom-event-tip" }, [
|
|
591
|
+
A(" 支持添加原生 DOM 事件,添加后点击 "),
|
|
592
|
+
t("span", { class: "event-tip-highlight" }, " 绑定事件 "),
|
|
593
|
+
A(" 为画布中所选元素增加事件 ")
|
|
594
|
+
], -1))
|
|
749
595
|
]),
|
|
750
596
|
_: 1
|
|
751
597
|
})
|
|
@@ -753,278 +599,284 @@ function eo(l, i, b, e, c, u) {
|
|
|
753
599
|
_: 1
|
|
754
600
|
})
|
|
755
601
|
]),
|
|
756
|
-
|
|
602
|
+
c(v, {
|
|
757
603
|
popperClass: "option-popper setting-advanced-bind-event-list",
|
|
758
604
|
placement: "bottom-end",
|
|
759
605
|
trigger: "hover"
|
|
760
606
|
}, {
|
|
761
607
|
reference: _(() => [
|
|
762
|
-
|
|
608
|
+
c(a, { class: "bind-event-btn" }, {
|
|
763
609
|
default: _(() => [
|
|
764
|
-
|
|
765
|
-
|
|
610
|
+
n[4] || (n[4] = t("span", null, "绑定事件", -1)),
|
|
611
|
+
c(i, { class: "icon-chevron-down" })
|
|
766
612
|
]),
|
|
767
613
|
_: 1
|
|
768
614
|
})
|
|
769
615
|
]),
|
|
770
616
|
default: _(() => [
|
|
771
|
-
|
|
772
|
-
(
|
|
773
|
-
var
|
|
774
|
-
return
|
|
775
|
-
key:
|
|
776
|
-
class:
|
|
777
|
-
onClick: (
|
|
617
|
+
t("ul", Cn, [
|
|
618
|
+
(f(!0), D(q, null, te(e.state.componentEvents, (y, I) => {
|
|
619
|
+
var $;
|
|
620
|
+
return f(), D("li", {
|
|
621
|
+
key: I,
|
|
622
|
+
class: R(["bind-event-list-item", { "bind-event-list-item-notallow": e.state.bindActions[I] }]),
|
|
623
|
+
onClick: (ae) => e.openActionDialog({ eventName: I }, !0)
|
|
778
624
|
}, [
|
|
779
|
-
|
|
780
|
-
], 10,
|
|
625
|
+
t("div", null, B(I) + " " + B((($ = y == null ? void 0 : y.label) == null ? void 0 : $.zh_CN) || I), 1)
|
|
626
|
+
], 10, Vn);
|
|
781
627
|
}), 128))
|
|
782
628
|
])
|
|
783
629
|
]),
|
|
784
630
|
_: 1
|
|
785
631
|
})
|
|
786
632
|
]),
|
|
787
|
-
|
|
788
|
-
(
|
|
789
|
-
key:
|
|
633
|
+
ne(t("ul", Dn, [
|
|
634
|
+
(f(!0), D(q, null, te(e.state.bindActions, (y) => (f(), D("li", {
|
|
635
|
+
key: y.eventName
|
|
790
636
|
}, [
|
|
791
|
-
|
|
792
|
-
|
|
637
|
+
t("div", In, [
|
|
638
|
+
t("div", {
|
|
793
639
|
class: "binding-name",
|
|
794
|
-
onClick: (
|
|
640
|
+
onClick: (I) => e.openActionDialog(y)
|
|
795
641
|
}, [
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
642
|
+
t("div", null, [
|
|
643
|
+
A(B(y.eventName), 1),
|
|
644
|
+
t("span", null, B(e.state.componentEvents[y.eventName].label.zh_CN), 1)
|
|
799
645
|
]),
|
|
800
|
-
|
|
801
|
-
class:
|
|
802
|
-
},
|
|
803
|
-
|
|
804
|
-
], 8,
|
|
805
|
-
|
|
806
|
-
e.isBlock ? (
|
|
646
|
+
t("div", {
|
|
647
|
+
class: R({ linked: y.linked })
|
|
648
|
+
}, B(y.linkedEventName), 3),
|
|
649
|
+
t("span", An, B(y.ref), 1)
|
|
650
|
+
], 8, Nn),
|
|
651
|
+
t("div", Pn, [
|
|
652
|
+
e.isBlock ? (f(), w(p, {
|
|
807
653
|
key: 0,
|
|
808
|
-
data:
|
|
654
|
+
data: y
|
|
809
655
|
}, null, 8, ["data"])) : H("", !0),
|
|
810
|
-
|
|
656
|
+
c(o, {
|
|
811
657
|
name: "plugin-icon-page-schema",
|
|
812
658
|
tips: "定位到代码",
|
|
813
659
|
placement: "top",
|
|
814
|
-
onClick: (
|
|
660
|
+
onClick: (I) => e.openCodePanel(y)
|
|
815
661
|
}, null, 8, ["onClick"]),
|
|
816
|
-
|
|
662
|
+
c(o, {
|
|
817
663
|
name: "setting",
|
|
818
664
|
tips: "设置",
|
|
819
665
|
placement: "top",
|
|
820
|
-
onClick: (
|
|
666
|
+
onClick: (I) => e.openActionDialog(y, !1)
|
|
821
667
|
}, null, 8, ["onClick"]),
|
|
822
|
-
|
|
668
|
+
c(o, {
|
|
823
669
|
name: "delete",
|
|
824
670
|
tips: "删除",
|
|
825
671
|
placement: "top",
|
|
826
|
-
onClick: (
|
|
672
|
+
onClick: (I) => e.delEvent(y)
|
|
827
673
|
}, null, 8, ["onClick"])
|
|
828
674
|
])
|
|
829
675
|
])
|
|
830
676
|
]))), 128))
|
|
831
677
|
], 512), [
|
|
832
|
-
[
|
|
678
|
+
[oe, !e.isEmpty]
|
|
833
679
|
]),
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
680
|
+
ne(t("div", Bn, [
|
|
681
|
+
t("div", Mn, [
|
|
682
|
+
c(r, {
|
|
837
683
|
name: "empty-action",
|
|
838
684
|
class: "empty-action-icon"
|
|
839
685
|
})
|
|
840
686
|
]),
|
|
841
|
-
|
|
842
|
-
|
|
687
|
+
n[5] || (n[5] = t("div", { class: "center" }, "元素事件绑定", -1)),
|
|
688
|
+
n[6] || (n[6] = t("span", { class: "text" }, [
|
|
689
|
+
A(" 点击 "),
|
|
690
|
+
t("span", { class: "empty-bind-event-tip" }, "绑定事件"),
|
|
691
|
+
A("为画布中所选元素增加事件")
|
|
692
|
+
], -1))
|
|
843
693
|
], 512), [
|
|
844
|
-
[
|
|
694
|
+
[oe, e.isEmpty]
|
|
845
695
|
])
|
|
846
696
|
]),
|
|
847
|
-
|
|
697
|
+
c(u, {
|
|
848
698
|
eventBinding: e.state.eventBinding
|
|
849
699
|
}, null, 8, ["eventBinding"]),
|
|
850
|
-
|
|
700
|
+
c(k, {
|
|
851
701
|
visible: e.state.showBindEventDialog,
|
|
852
702
|
componentEvents: e.state.componentEvents,
|
|
853
|
-
onCloseDialog:
|
|
703
|
+
onCloseDialog: n[1] || (n[1] = (y) => e.handleToggleAddEventDialog(!1)),
|
|
854
704
|
onAddEvent: e.handleAddEvent
|
|
855
705
|
}, null, 8, ["visible", "componentEvents", "onAddEvent"])
|
|
856
706
|
], 64);
|
|
857
707
|
}
|
|
858
|
-
const
|
|
859
|
-
const { DEFAULT_LOOP_NAME:
|
|
708
|
+
const Sn = /* @__PURE__ */ J(yn, [["render", wn], ["__scopeId", "data-v-3b65f9b0"]]);
|
|
709
|
+
const { DEFAULT_LOOP_NAME: U } = tn, { string2Obj: On } = sn, Ln = {
|
|
860
710
|
components: {
|
|
861
|
-
|
|
711
|
+
SwitchConfigurator: We,
|
|
862
712
|
TinyTooltip: ze,
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
713
|
+
VariableConfigurator: en,
|
|
714
|
+
InputConfigurator: nn,
|
|
715
|
+
CodeConfigurator: on
|
|
866
716
|
},
|
|
867
717
|
inheritAttrs: !1,
|
|
868
718
|
setup() {
|
|
869
|
-
const { pageState:
|
|
870
|
-
var
|
|
871
|
-
return ((
|
|
719
|
+
const { pageState: m } = Q(), n = F(!1), l = K(() => {
|
|
720
|
+
var o;
|
|
721
|
+
return ((o = n.value) == null ? void 0 : o.type) === X.JSEXPRESSION;
|
|
872
722
|
}), e = () => {
|
|
873
|
-
var
|
|
874
|
-
return ((
|
|
875
|
-
},
|
|
723
|
+
var o, r;
|
|
724
|
+
return ((r = (o = V().getSchema()) == null ? void 0 : o.loopArgs) == null ? void 0 : r[1]) || U.INDEX;
|
|
725
|
+
}, s = Z({
|
|
876
726
|
loopData: {
|
|
877
|
-
type:
|
|
727
|
+
type: X.JSEXPRESSION,
|
|
878
728
|
value: "[]"
|
|
879
729
|
},
|
|
880
730
|
loopItem: "item",
|
|
881
731
|
loopIndex: "index",
|
|
882
|
-
isLoop:
|
|
883
|
-
var
|
|
884
|
-
return ((
|
|
732
|
+
isLoop: K(() => {
|
|
733
|
+
var o;
|
|
734
|
+
return ((o = s.loopData) == null ? void 0 : o.type) === X.JSEXPRESSION;
|
|
885
735
|
}),
|
|
886
736
|
loopKey: "",
|
|
887
737
|
shouldUpdate: !1
|
|
888
738
|
});
|
|
889
|
-
|
|
890
|
-
() => [
|
|
891
|
-
([
|
|
892
|
-
var
|
|
893
|
-
|
|
739
|
+
_e(
|
|
740
|
+
() => [m == null ? void 0 : m.currentSchema, s.shouldUpdate],
|
|
741
|
+
([o]) => {
|
|
742
|
+
var r, u, k, y;
|
|
743
|
+
n.value = (o == null ? void 0 : o.condition) === void 0 ? !0 : o == null ? void 0 : o.condition, s.loopData = o == null ? void 0 : o.loop, s.loopItem = ((r = o == null ? void 0 : o.loopArgs) == null ? void 0 : r[0]) || "", s.loopIndex = ((u = o == null ? void 0 : o.loopArgs) == null ? void 0 : u[1]) || "", s.loopKey = ((y = (k = o == null ? void 0 : o.props) == null ? void 0 : k.key) == null ? void 0 : y.value) || "";
|
|
894
744
|
}
|
|
895
745
|
);
|
|
896
|
-
const
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
if (!
|
|
746
|
+
const h = (o = "") => {
|
|
747
|
+
o = o.replace(/\s*/g, "");
|
|
748
|
+
const r = V().getSchema();
|
|
749
|
+
if (!r)
|
|
900
750
|
return;
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
type:
|
|
906
|
-
value:
|
|
907
|
-
}),
|
|
908
|
-
type:
|
|
751
|
+
const u = Number(o).toString() !== "NaN";
|
|
752
|
+
r.props = r.props || {};
|
|
753
|
+
const k = r.props;
|
|
754
|
+
o && !u && (k.key = {
|
|
755
|
+
type: X.JSEXPRESSION,
|
|
756
|
+
value: o
|
|
757
|
+
}), o || (s.isLoop ? k.key = {
|
|
758
|
+
type: X.JSEXPRESSION,
|
|
909
759
|
value: e()
|
|
910
|
-
} : delete
|
|
760
|
+
} : delete k.key);
|
|
911
761
|
};
|
|
912
|
-
|
|
913
|
-
!
|
|
762
|
+
_e([() => s.isLoop, () => s.loopIndex], () => {
|
|
763
|
+
!s.loopKey && s.isLoop && h(e()), s.isLoop || h("");
|
|
914
764
|
});
|
|
915
|
-
const
|
|
916
|
-
var
|
|
917
|
-
|
|
918
|
-
},
|
|
919
|
-
|
|
920
|
-
},
|
|
921
|
-
|
|
765
|
+
const b = () => {
|
|
766
|
+
var o;
|
|
767
|
+
s.loopData = (o = V().getSchema()) == null ? void 0 : o.loop;
|
|
768
|
+
}, v = (o) => {
|
|
769
|
+
V().getSchema() && (o === !1 || o != null && o.type ? V().getSchema().condition = o : delete V().getSchema().condition, Q().canvasApi.value.updateRect(), n.value = o);
|
|
770
|
+
}, a = (o) => {
|
|
771
|
+
V().getSchema().loopArgs ? V().getSchema().loopArgs[1] = o || U.INDEX : V().getSchema().loopArgs = [U.ITEM, o];
|
|
922
772
|
};
|
|
923
773
|
return {
|
|
924
|
-
condition:
|
|
925
|
-
setConfig:
|
|
926
|
-
isBind:
|
|
927
|
-
state:
|
|
928
|
-
setLoop: (
|
|
929
|
-
|
|
774
|
+
condition: n,
|
|
775
|
+
setConfig: v,
|
|
776
|
+
isBind: l,
|
|
777
|
+
state: s,
|
|
778
|
+
setLoop: (o) => {
|
|
779
|
+
o ? (V().getSchema().loop = o != null && o.type ? o : On(o), a(U.INDEX)) : (h(), delete V().getSchema().loop, delete V().getSchema().loopArgs), s.shouldUpdate = !s.shouldUpdate;
|
|
930
780
|
},
|
|
931
|
-
setLoopItem: (
|
|
932
|
-
|
|
781
|
+
setLoopItem: (o) => {
|
|
782
|
+
V().getSchema().loopArgs ? V().getSchema().loopArgs[0] = o || U.ITEM : V().getSchema().loopArgs = [o, U.INDEX];
|
|
933
783
|
},
|
|
934
|
-
DEFAULT_LOOP_NAME:
|
|
935
|
-
openEditor:
|
|
936
|
-
setLoopIndex:
|
|
937
|
-
setLoopKey:
|
|
784
|
+
DEFAULT_LOOP_NAME: U,
|
|
785
|
+
openEditor: b,
|
|
786
|
+
setLoopIndex: a,
|
|
787
|
+
setLoopKey: h,
|
|
938
788
|
getIndexName: e
|
|
939
789
|
};
|
|
940
790
|
}
|
|
941
|
-
},
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
o("div", ao, [
|
|
955
|
-
e.isBind ? (h(), S("div", lo, "已绑定:" + L(e.condition.value), 1)) : (h(), U(w, {
|
|
791
|
+
}, Tn = { class: "advanced-config-container" }, Un = { class: "advnce-config" }, zn = { class: "advanced-config-form-item" }, jn = ["title"], Rn = { class: "advnce-config" }, Fn = { class: "advanced-config-form-item" }, Jn = ["title"], Xn = { class: "advnce-config" }, Hn = { class: "advanced-config-form-item" }, $n = { class: "advnce-config" }, qn = { class: "advanced-config-form-item" }, Kn = { class: "advnce-config" }, Yn = { class: "advanced-config-form-item" };
|
|
792
|
+
function Qn(m, n, l, e, s, h) {
|
|
793
|
+
var o, r;
|
|
794
|
+
const b = E("switch-configurator"), v = E("variable-configurator"), a = E("code-configurator"), i = E("input-configurator"), p = E("tiny-tooltip");
|
|
795
|
+
return f(), D("div", Tn, [
|
|
796
|
+
t("div", Un, [
|
|
797
|
+
n[6] || (n[6] = t("label", { class: "text-ellipsis-multiple" }, "是否渲染", -1)),
|
|
798
|
+
t("div", zn, [
|
|
799
|
+
e.isBind ? (f(), D("div", {
|
|
800
|
+
key: 1,
|
|
801
|
+
class: "binding-state text-ellipsis-multiple",
|
|
802
|
+
title: e.condition.value
|
|
803
|
+
}, " 已绑定:" + B(e.condition.value), 9, jn)) : (f(), w(b, {
|
|
956
804
|
key: 0,
|
|
957
805
|
modelValue: e.condition,
|
|
958
806
|
"onUpdate:modelValue": e.setConfig
|
|
959
807
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])),
|
|
960
|
-
|
|
808
|
+
c(v, {
|
|
961
809
|
modelValue: e.condition,
|
|
962
810
|
"onUpdate:modelValue": [
|
|
963
|
-
|
|
811
|
+
n[0] || (n[0] = (u) => e.condition = u),
|
|
964
812
|
e.setConfig
|
|
965
813
|
],
|
|
966
814
|
name: "advance"
|
|
967
815
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
968
816
|
])
|
|
969
817
|
]),
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
e.state.isLoop ? (
|
|
818
|
+
t("div", Rn, [
|
|
819
|
+
n[7] || (n[7] = t("label", { class: "text-ellipsis-multiple" }, "循环数据", -1)),
|
|
820
|
+
t("div", Fn, [
|
|
821
|
+
e.state.isLoop ? (f(), D("div", {
|
|
822
|
+
key: 1,
|
|
823
|
+
class: "binding-state text-ellipsis-multiple",
|
|
824
|
+
title: (o = e.state.loopData) == null ? void 0 : o.value
|
|
825
|
+
}, " 已绑定:" + B((r = e.state.loopData) == null ? void 0 : r.value), 9, Jn)) : (f(), w(a, {
|
|
974
826
|
key: 0,
|
|
975
827
|
modelValue: e.state.loopData,
|
|
976
828
|
"onUpdate:modelValue": [
|
|
977
|
-
|
|
829
|
+
n[1] || (n[1] = (u) => e.state.loopData = u),
|
|
978
830
|
e.setLoop
|
|
979
831
|
],
|
|
980
832
|
"data-type": "JSExpression",
|
|
981
833
|
onOpen: e.openEditor
|
|
982
834
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onOpen"])),
|
|
983
|
-
|
|
835
|
+
c(v, {
|
|
984
836
|
modelValue: e.state.loopData,
|
|
985
837
|
"onUpdate:modelValue": [
|
|
986
|
-
|
|
838
|
+
n[2] || (n[2] = (u) => e.state.loopData = u),
|
|
987
839
|
e.setLoop
|
|
988
840
|
],
|
|
989
841
|
name: "advance"
|
|
990
842
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
991
843
|
])
|
|
992
844
|
]),
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
845
|
+
t("div", Xn, [
|
|
846
|
+
n[8] || (n[8] = t("label", { class: "text-ellipsis-multiple" }, "迭代变量名", -1)),
|
|
847
|
+
t("div", Hn, [
|
|
848
|
+
c(i, {
|
|
997
849
|
modelValue: e.state.loopItem,
|
|
998
850
|
"onUpdate:modelValue": [
|
|
999
|
-
|
|
851
|
+
n[3] || (n[3] = (u) => e.state.loopItem = u),
|
|
1000
852
|
e.setLoopItem
|
|
1001
853
|
],
|
|
1002
854
|
placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.ITEM}`
|
|
1003
855
|
}, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
|
|
1004
856
|
])
|
|
1005
857
|
]),
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
858
|
+
t("div", $n, [
|
|
859
|
+
n[9] || (n[9] = t("label", { class: "text-ellipsis-multiple" }, "索引变量名", -1)),
|
|
860
|
+
t("div", qn, [
|
|
861
|
+
c(i, {
|
|
1010
862
|
modelValue: e.state.loopIndex,
|
|
1011
863
|
"onUpdate:modelValue": [
|
|
1012
|
-
|
|
864
|
+
n[4] || (n[4] = (u) => e.state.loopIndex = u),
|
|
1013
865
|
e.setLoopIndex
|
|
1014
866
|
],
|
|
1015
867
|
placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.INDEX}`
|
|
1016
868
|
}, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
|
|
1017
869
|
])
|
|
1018
870
|
]),
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
p
|
|
871
|
+
t("div", Kn, [
|
|
872
|
+
n[10] || (n[10] = t("label", { class: "text-ellipsis-multiple" }, "key", -1)),
|
|
873
|
+
t("div", Yn, [
|
|
874
|
+
c(p, { content: "建议填写循环项中的唯一值(如item.id),如果填写为数字将不保存" }, {
|
|
1023
875
|
default: _(() => [
|
|
1024
|
-
|
|
876
|
+
c(i, {
|
|
1025
877
|
modelValue: e.state.loopKey,
|
|
1026
878
|
"onUpdate:modelValue": [
|
|
1027
|
-
|
|
879
|
+
n[5] || (n[5] = (u) => e.state.loopKey = u),
|
|
1028
880
|
e.setLoopKey
|
|
1029
881
|
],
|
|
1030
882
|
placeholder: `默认为索引名:${e.getIndexName()}`
|
|
@@ -1036,30 +888,30 @@ function ko(l, i, b, e, c, u) {
|
|
|
1036
888
|
])
|
|
1037
889
|
]);
|
|
1038
890
|
}
|
|
1039
|
-
const
|
|
891
|
+
const Zn = /* @__PURE__ */ J(Ln, [["render", Qn], ["__scopeId", "data-v-d8b5ad1a"]]), Gn = {
|
|
1040
892
|
__name: "Main",
|
|
1041
|
-
setup(
|
|
1042
|
-
const
|
|
1043
|
-
return (
|
|
1044
|
-
modelValue:
|
|
1045
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
893
|
+
setup(m) {
|
|
894
|
+
const n = F(["bindEvent", "advancedConfig"]);
|
|
895
|
+
return (l, e) => (f(), w(P(je), {
|
|
896
|
+
modelValue: n.value,
|
|
897
|
+
"onUpdate:modelValue": e[0] || (e[0] = (s) => n.value = s)
|
|
1046
898
|
}, {
|
|
1047
899
|
default: _(() => [
|
|
1048
|
-
|
|
900
|
+
c(P(he), {
|
|
1049
901
|
title: "事件绑定",
|
|
1050
902
|
name: "bindEvent"
|
|
1051
903
|
}, {
|
|
1052
904
|
default: _(() => [
|
|
1053
|
-
|
|
905
|
+
c(Sn)
|
|
1054
906
|
]),
|
|
1055
907
|
_: 1
|
|
1056
908
|
}),
|
|
1057
|
-
|
|
909
|
+
c(P(he), {
|
|
1058
910
|
title: "高级配置",
|
|
1059
911
|
name: "advancedConfig"
|
|
1060
912
|
}, {
|
|
1061
913
|
default: _(() => [
|
|
1062
|
-
|
|
914
|
+
c(Zn)
|
|
1063
915
|
]),
|
|
1064
916
|
_: 1
|
|
1065
917
|
})
|
|
@@ -1067,14 +919,210 @@ const xo = /* @__PURE__ */ oe(oo, [["render", ko], ["__scopeId", "data-v-ef405cb
|
|
|
1067
919
|
_: 1
|
|
1068
920
|
}, 8, ["modelValue"]));
|
|
1069
921
|
}
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
922
|
+
};
|
|
923
|
+
const Wn = {
|
|
924
|
+
components: {
|
|
925
|
+
MonacoEditor: Ye,
|
|
926
|
+
TinyInput: ie,
|
|
927
|
+
TinyPopover: Ce,
|
|
928
|
+
IconHelpQuery: Ie(),
|
|
929
|
+
TinySwitch: Re
|
|
930
|
+
},
|
|
931
|
+
props: {
|
|
932
|
+
dialogVisible: Boolean
|
|
933
|
+
},
|
|
934
|
+
setup() {
|
|
935
|
+
const { getMethodNameList: m } = G(W.Page), n = xe("context"), l = {
|
|
936
|
+
language: "json",
|
|
937
|
+
lineNumbers: !1,
|
|
938
|
+
minimap: {
|
|
939
|
+
enabled: !1
|
|
940
|
+
}
|
|
941
|
+
}, e = (a) => {
|
|
942
|
+
n.editorContent = a;
|
|
943
|
+
}, s = (a) => !a, h = (a) => m == null ? void 0 : m().includes(a), b = (a) => !ln.test(a);
|
|
944
|
+
return {
|
|
945
|
+
NEW_METHOD_TYPE: Ne,
|
|
946
|
+
context: n,
|
|
947
|
+
editorOptions: l,
|
|
948
|
+
change: (a) => {
|
|
949
|
+
const i = [
|
|
950
|
+
{ validator: s, tip: j.empty },
|
|
951
|
+
{ validator: h, tip: j.exist },
|
|
952
|
+
{ validator: b, tip: j.ruleInvalid }
|
|
953
|
+
];
|
|
954
|
+
for (let p = 0; p < i.length; p++) {
|
|
955
|
+
const o = i[p];
|
|
956
|
+
if (o.validator(a)) {
|
|
957
|
+
n.tipError = !0, n.tip = o.tip;
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
n.tipError = !1, n.tip = j.default;
|
|
962
|
+
},
|
|
963
|
+
editorContentChange: e
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
}, eo = { class: "content-right" }, no = { class: "new-action-tip" }, oo = { class: "content-right-title" }, to = { class: "content-right-monaco" }, io = {
|
|
967
|
+
key: 1,
|
|
968
|
+
class: "mark"
|
|
969
|
+
}, so = {
|
|
970
|
+
key: 0,
|
|
971
|
+
class: "params-tip"
|
|
972
|
+
};
|
|
973
|
+
function ao(m, n, l, e, s, h) {
|
|
974
|
+
const b = E("tiny-input"), v = E("icon-help-query"), a = E("tiny-popover"), i = E("tiny-switch"), p = E("monaco-editor");
|
|
975
|
+
return f(), D("div", eo, [
|
|
976
|
+
t("div", {
|
|
977
|
+
class: R(["content-right-top", { "tip-error": e.context.tipError }])
|
|
978
|
+
}, [
|
|
979
|
+
n[2] || (n[2] = t("div", { class: "content-right-title" }, "方法名称", -1)),
|
|
980
|
+
c(b, {
|
|
981
|
+
modelValue: e.context.bindMethodInfo.name,
|
|
982
|
+
"onUpdate:modelValue": [
|
|
983
|
+
n[0] || (n[0] = (o) => e.context.bindMethodInfo.name = o),
|
|
984
|
+
e.change
|
|
985
|
+
],
|
|
986
|
+
disabled: e.context.bindMethodInfo.type !== e.NEW_METHOD_TYPE,
|
|
987
|
+
class: R([{ "status-error": e.context.tipError }]),
|
|
988
|
+
placeholder: "请从左侧选择一个方法进行绑定,或者选择添加新方法,输入自定义方法名称。"
|
|
989
|
+
}, null, 8, ["modelValue", "disabled", "class", "onUpdate:modelValue"]),
|
|
990
|
+
t("div", no, B(e.context.tip), 1)
|
|
991
|
+
], 2),
|
|
992
|
+
t("div", {
|
|
993
|
+
class: R(["content-right-bottom", { "tip-error": !e.context.isValidParams }])
|
|
994
|
+
}, [
|
|
995
|
+
t("div", oo, [
|
|
996
|
+
n[7] || (n[7] = t("span", { class: "set-params-tip" }, "扩展参数设置", -1)),
|
|
997
|
+
c(a, {
|
|
998
|
+
placement: "top-start",
|
|
999
|
+
width: "350",
|
|
1000
|
+
trigger: "hover"
|
|
1001
|
+
}, {
|
|
1002
|
+
reference: _(() => [
|
|
1003
|
+
c(v)
|
|
1004
|
+
]),
|
|
1005
|
+
default: _(() => [
|
|
1006
|
+
t("p", null, [
|
|
1007
|
+
n[3] || (n[3] = A(" 扩展参数:调用当前事件传入的真实参数,数组格式,追加在原有事件参数之后")),
|
|
1008
|
+
n[4] || (n[4] = t("br", null, null, -1)),
|
|
1009
|
+
A(" 如: " + B(e.context.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
|
|
1010
|
+
])
|
|
1011
|
+
]),
|
|
1012
|
+
_: 1
|
|
1013
|
+
}),
|
|
1014
|
+
c(i, {
|
|
1015
|
+
modelValue: e.context.enableExtraParams,
|
|
1016
|
+
"onUpdate:modelValue": n[1] || (n[1] = (o) => e.context.enableExtraParams = o),
|
|
1017
|
+
class: "set-switch",
|
|
1018
|
+
"show-text": !0
|
|
1019
|
+
}, {
|
|
1020
|
+
open: _(() => n[5] || (n[5] = [
|
|
1021
|
+
t("span", null, "开启", -1)
|
|
1022
|
+
])),
|
|
1023
|
+
close: _(() => n[6] || (n[6] = [
|
|
1024
|
+
t("span", null, "关闭", -1)
|
|
1025
|
+
])),
|
|
1026
|
+
_: 1
|
|
1027
|
+
}, 8, ["modelValue"])
|
|
1028
|
+
]),
|
|
1029
|
+
t("div", to, [
|
|
1030
|
+
l.dialogVisible ? (f(), w(p, {
|
|
1031
|
+
key: 0,
|
|
1032
|
+
value: e.context.editorContent,
|
|
1033
|
+
options: e.editorOptions,
|
|
1034
|
+
onChange: e.editorContentChange,
|
|
1035
|
+
class: "monaco-editor"
|
|
1036
|
+
}, null, 8, ["value", "options", "onChange"])) : H("", !0),
|
|
1037
|
+
e.context.enableExtraParams ? H("", !0) : (f(), D("div", io))
|
|
1038
|
+
]),
|
|
1039
|
+
!e.context.isValidParams && e.context.enableExtraParams ? (f(), D("div", so, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : H("", !0)
|
|
1040
|
+
], 2)
|
|
1041
|
+
]);
|
|
1042
|
+
}
|
|
1043
|
+
const lo = /* @__PURE__ */ J(Wn, [["render", ao], ["__scopeId", "data-v-771b2387"]]);
|
|
1044
|
+
const ro = {
|
|
1045
|
+
components: {
|
|
1046
|
+
TinySearch: Fe,
|
|
1047
|
+
IconYes: Ze()
|
|
1048
|
+
},
|
|
1049
|
+
props: {
|
|
1050
|
+
eventBinding: {
|
|
1051
|
+
type: Object,
|
|
1052
|
+
default: () => ({})
|
|
1053
|
+
}
|
|
1054
|
+
},
|
|
1055
|
+
setup(m) {
|
|
1056
|
+
const { getMethodNameList: n } = G(W.Page), l = F(""), e = F([]), s = xe("context"), h = (v, a) => {
|
|
1057
|
+
const i = v.map((r) => {
|
|
1058
|
+
var u;
|
|
1059
|
+
return Number.parseInt((u = r.match(/\d+$/)) == null ? void 0 : u[0]) || 0;
|
|
1060
|
+
}).sort((r, u) => r - u).pop();
|
|
1061
|
+
let o = `${(a == null ? void 0 : a.replace(an, "_")) || ""}New`;
|
|
1062
|
+
return i > -1 && (o += `${i + 1}`), o;
|
|
1063
|
+
}, b = (v) => {
|
|
1064
|
+
s.bindMethodInfo = v;
|
|
1065
|
+
};
|
|
1066
|
+
return Ee(() => {
|
|
1067
|
+
var r, u;
|
|
1068
|
+
const v = (r = m.eventBinding) == null ? void 0 : r.eventName, a = (n == null ? void 0 : n().filter((k) => k.includes(v))) || [], p = {
|
|
1069
|
+
title: "添加新方法",
|
|
1070
|
+
name: h(a, v),
|
|
1071
|
+
type: Ne
|
|
1072
|
+
};
|
|
1073
|
+
(u = m.eventBinding) != null && u.ref ? b({ name: m.eventBinding.ref }) : b(p);
|
|
1074
|
+
const o = (n == null ? void 0 : n().filter((k) => k.includes(l.value)).map((k) => ({ name: k }))) || [];
|
|
1075
|
+
e.value = [p, ...o];
|
|
1076
|
+
}), {
|
|
1077
|
+
context: s,
|
|
1078
|
+
searchValue: l,
|
|
1079
|
+
filteredMethodList: e,
|
|
1080
|
+
selectMethod: b
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
}, co = { class: "dialog-content-left" }, po = { class: "left-list-wrap" }, mo = { class: "left-action-list" }, uo = { class: "action-list-wrap" }, vo = ["onClick"];
|
|
1084
|
+
function go(m, n, l, e, s, h) {
|
|
1085
|
+
const b = E("tiny-search"), v = E("icon-yes");
|
|
1086
|
+
return f(), D("div", co, [
|
|
1087
|
+
n[1] || (n[1] = t("div", { class: "left-title" }, "响应方法", -1)),
|
|
1088
|
+
t("div", po, [
|
|
1089
|
+
t("div", mo, [
|
|
1090
|
+
c(b, {
|
|
1091
|
+
modelValue: e.searchValue,
|
|
1092
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => e.searchValue = a),
|
|
1093
|
+
placeholder: "搜索"
|
|
1094
|
+
}, null, 8, ["modelValue"]),
|
|
1095
|
+
t("ul", uo, [
|
|
1096
|
+
(f(!0), D(q, null, te(e.filteredMethodList, (a) => (f(), D("li", {
|
|
1097
|
+
key: a.name,
|
|
1098
|
+
onClick: (i) => e.selectMethod(a)
|
|
1099
|
+
}, [
|
|
1100
|
+
t("div", {
|
|
1101
|
+
class: R(["action-name", { active: a.name === e.context.bindMethodInfo.name }])
|
|
1102
|
+
}, [
|
|
1103
|
+
A(B(a.title || a.name) + " ", 1),
|
|
1104
|
+
a.name === e.context.bindMethodInfo.name ? (f(), w(v, {
|
|
1105
|
+
key: 0,
|
|
1106
|
+
class: "action-selected-icon"
|
|
1107
|
+
})) : H("", !0)
|
|
1108
|
+
], 2)
|
|
1109
|
+
], 8, vo))), 128))
|
|
1110
|
+
])
|
|
1111
|
+
])
|
|
1112
|
+
])
|
|
1113
|
+
]);
|
|
1114
|
+
}
|
|
1115
|
+
const _o = /* @__PURE__ */ J(ro, [["render", go], ["__scopeId", "data-v-b9da83b9"]]), Io = {
|
|
1116
|
+
...Ae,
|
|
1117
|
+
entry: Gn,
|
|
1118
|
+
options: {
|
|
1119
|
+
commonEvents: vn
|
|
1120
|
+
},
|
|
1121
|
+
components: {
|
|
1122
|
+
BindEventsDialogSidebar: _o,
|
|
1123
|
+
BindEventsDialogContent: lo
|
|
1124
|
+
}
|
|
1077
1125
|
};
|
|
1078
1126
|
export {
|
|
1079
|
-
|
|
1127
|
+
Io as default
|
|
1080
1128
|
};
|