@opentiny/tiny-engine-setting-events 2.6.0-rc.0 → 2.6.0-rc.2
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 +657 -1761
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,72 +1,35 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { ref as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { SvgButton as
|
|
7
|
-
import { iconChevronDown as
|
|
8
|
-
import { string2Ast as
|
|
9
|
-
import { CodeConfigurator as
|
|
2
|
+
import { ref as K, reactive as Y, provide as Ve, resolveComponent as k, createBlock as O, openBlock as b, withCtx as E, createElementVNode as t, createVNode as u, resolveDynamicComponent as _e, createTextVNode as J, nextTick as Se, unref as D, createElementBlock as N, Fragment as W, withDirectives as he, renderList as ae, normalizeClass as X, toDisplayString as B, createCommentVNode as Q, vShow as be, computed as q, watchEffect as Ae, watch as ye, inject as Ne } from "vue";
|
|
3
|
+
import { TinyAlert as Te, DialogBox as De, Button as ee, Form as Ue, FormItem as Ee, Input as le, Popover as je, Tooltip as ze, Collapse as Re, CollapseItem as xe, Checkbox as $e, Search as Fe } from "@opentiny/vue";
|
|
4
|
+
import { getMergeMeta as Ie, useLayout as re, useCanvas as j, getMetaApi as ne, META_APP as oe, getOptions as Je, useHistory as Xe, useBlock as Ke, useMaterial as He, useModal as Ge, useMessage as qe, useProperties as $ } from "@opentiny/tiny-engine-meta-register";
|
|
5
|
+
import Ye from "@opentiny/tiny-engine-common/js/i18n";
|
|
6
|
+
import { SvgButton as Ze, BlockLinkEvent as We, PluginPanel as Qe, VueMonaco as en } from "@opentiny/tiny-engine-common";
|
|
7
|
+
import { iconChevronDown as nn } from "@opentiny/vue-icon";
|
|
8
|
+
import { string2Ast as ke, ast2String as on } from "@opentiny/tiny-engine-common/js/ast";
|
|
9
|
+
import { CodeConfigurator as tn, InputConfigurator as sn, VariableConfigurator as an, SwitchConfigurator as ln } from "@opentiny/tiny-engine-configurator";
|
|
10
10
|
import { PROP_DATA_TYPE as G } from "@opentiny/tiny-engine-common/js/constants";
|
|
11
|
-
import { constants as
|
|
12
|
-
const
|
|
11
|
+
import { constants as dn, utils as rn } from "@opentiny/tiny-engine-utils";
|
|
12
|
+
const de = {
|
|
13
13
|
id: "engine.setting.event",
|
|
14
14
|
title: "高级",
|
|
15
|
-
type: "
|
|
15
|
+
type: "setting",
|
|
16
|
+
align: "rightTop",
|
|
16
17
|
name: "event",
|
|
17
18
|
icon: "target"
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
for (const [e,
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
}, {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
ctx: () => ({
|
|
30
|
-
ast2String: H,
|
|
31
|
-
string2Ast: R,
|
|
32
|
-
getMergeMeta: P,
|
|
33
|
-
useCanvas: y,
|
|
34
|
-
useHistory: K,
|
|
35
|
-
useLayout: V,
|
|
36
|
-
getOptions: X,
|
|
37
|
-
getMetaApi: k,
|
|
38
|
-
META_APP: C,
|
|
39
|
-
meta: U,
|
|
40
|
-
dialogVisible: j,
|
|
41
|
-
open: L,
|
|
42
|
-
close: $
|
|
43
|
-
})
|
|
44
|
-
}), $ = h(() => {
|
|
45
|
-
j.value = !1;
|
|
46
|
-
}, {
|
|
47
|
-
metaData: {
|
|
48
|
-
id: "engine.setting.event.BindEventsDialog.close"
|
|
49
|
-
},
|
|
50
|
-
ctx: () => ({
|
|
51
|
-
ast2String: H,
|
|
52
|
-
string2Ast: R,
|
|
53
|
-
getMergeMeta: P,
|
|
54
|
-
useCanvas: y,
|
|
55
|
-
useHistory: K,
|
|
56
|
-
useLayout: V,
|
|
57
|
-
getOptions: X,
|
|
58
|
-
getMetaApi: k,
|
|
59
|
-
META_APP: C,
|
|
60
|
-
meta: U,
|
|
61
|
-
dialogVisible: j,
|
|
62
|
-
open: L,
|
|
63
|
-
close: $
|
|
64
|
-
})
|
|
65
|
-
}), bt = {
|
|
19
|
+
}, H = (f, o) => {
|
|
20
|
+
const a = f.__vccOpts || f;
|
|
21
|
+
for (const [e, r] of o)
|
|
22
|
+
a[e] = r;
|
|
23
|
+
return a;
|
|
24
|
+
}, ce = K(!1), cn = () => {
|
|
25
|
+
ce.value = !0;
|
|
26
|
+
}, Ce = () => {
|
|
27
|
+
ce.value = !1;
|
|
28
|
+
}, mn = {
|
|
66
29
|
components: {
|
|
67
|
-
TinyButton:
|
|
68
|
-
TinyDialogBox:
|
|
69
|
-
TinyAlert:
|
|
30
|
+
TinyButton: ee,
|
|
31
|
+
TinyDialogBox: De,
|
|
32
|
+
TinyAlert: Te
|
|
70
33
|
},
|
|
71
34
|
inheritAttrs: !1,
|
|
72
35
|
props: {
|
|
@@ -75,20 +38,8 @@ const U = {
|
|
|
75
38
|
default: () => ({})
|
|
76
39
|
}
|
|
77
40
|
},
|
|
78
|
-
setup(
|
|
79
|
-
const {
|
|
80
|
-
BindEventsDialogSidebar: n,
|
|
81
|
-
BindEventsDialogContent: o
|
|
82
|
-
} = P(U.id).components, {
|
|
83
|
-
PLUGIN_NAME: e,
|
|
84
|
-
activePlugin: i
|
|
85
|
-
} = V(), {
|
|
86
|
-
pageState: g
|
|
87
|
-
} = y(), {
|
|
88
|
-
getMethods: p,
|
|
89
|
-
saveMethod: a,
|
|
90
|
-
highlightMethod: l
|
|
91
|
-
} = k(C.Page), s = we({
|
|
41
|
+
setup(f) {
|
|
42
|
+
const { BindEventsDialogSidebar: o, BindEventsDialogContent: a } = Ie(de.id).components, { PLUGIN_NAME: e, activePlugin: r } = re(), { pageState: _ } = j(), { getMethods: h, saveMethod: c, highlightMethod: m } = ne(oe.Page), s = Y({
|
|
92
43
|
editorContent: "",
|
|
93
44
|
bindMethodInfo: {},
|
|
94
45
|
tip: "",
|
|
@@ -96,502 +47,95 @@ const U = {
|
|
|
96
47
|
enableExtraParams: !1,
|
|
97
48
|
isValidParams: !0
|
|
98
49
|
});
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
s.bindMethodInfo =
|
|
102
|
-
}, {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
ctx: () => ({
|
|
107
|
-
props: d,
|
|
108
|
-
BindEventsDialogSidebar: n,
|
|
109
|
-
BindEventsDialogContent: o,
|
|
110
|
-
PLUGIN_NAME: e,
|
|
111
|
-
activePlugin: i,
|
|
112
|
-
pageState: g,
|
|
113
|
-
getMethods: p,
|
|
114
|
-
saveMethod: a,
|
|
115
|
-
highlightMethod: l,
|
|
116
|
-
state: s,
|
|
117
|
-
selectMethod: u,
|
|
118
|
-
bindMethod: t,
|
|
119
|
-
resetTipError: r,
|
|
120
|
-
getExtraParams: c,
|
|
121
|
-
getFormatParams: m,
|
|
122
|
-
getFunctionBody: f,
|
|
123
|
-
activePagePlugin: x,
|
|
124
|
-
confirm: D,
|
|
125
|
-
openedDialog: N,
|
|
126
|
-
closeDialog: w,
|
|
127
|
-
ast2String: H,
|
|
128
|
-
string2Ast: R,
|
|
129
|
-
getMergeMeta: P,
|
|
130
|
-
useCanvas: y,
|
|
131
|
-
useHistory: K,
|
|
132
|
-
useLayout: V,
|
|
133
|
-
getOptions: X,
|
|
134
|
-
getMetaApi: k,
|
|
135
|
-
META_APP: C,
|
|
136
|
-
meta: U,
|
|
137
|
-
dialogVisible: j,
|
|
138
|
-
open: L,
|
|
139
|
-
close: $
|
|
140
|
-
})
|
|
141
|
-
}), t = h((E) => {
|
|
142
|
-
var Z, q;
|
|
143
|
-
if (!E)
|
|
50
|
+
Ve("context", s);
|
|
51
|
+
const x = (g) => {
|
|
52
|
+
s.bindMethodInfo = g;
|
|
53
|
+
}, n = (g) => {
|
|
54
|
+
var M, P;
|
|
55
|
+
if (!g)
|
|
144
56
|
return;
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
57
|
+
const p = (M = f.eventBinding) == null ? void 0 : M.eventName;
|
|
58
|
+
if (!p)
|
|
147
59
|
return;
|
|
148
|
-
const
|
|
149
|
-
if (!
|
|
60
|
+
const v = (P = _ == null ? void 0 : _.currentSchema) == null ? void 0 : P.props;
|
|
61
|
+
if (!v)
|
|
150
62
|
return;
|
|
151
|
-
const {
|
|
152
|
-
|
|
153
|
-
extra: W
|
|
154
|
-
} = E;
|
|
155
|
-
d[_] || (A[_] = {
|
|
63
|
+
const { name: C, extra: w } = g;
|
|
64
|
+
f[p] || (v[p] = {
|
|
156
65
|
type: "JSExpression",
|
|
157
66
|
value: ""
|
|
158
|
-
}),
|
|
159
|
-
}, {
|
|
160
|
-
metaData: {
|
|
161
|
-
id: "engine.setting.event.BindEventsDialog.bindMethod"
|
|
162
|
-
},
|
|
163
|
-
ctx: () => ({
|
|
164
|
-
props: d,
|
|
165
|
-
BindEventsDialogSidebar: n,
|
|
166
|
-
BindEventsDialogContent: o,
|
|
167
|
-
PLUGIN_NAME: e,
|
|
168
|
-
activePlugin: i,
|
|
169
|
-
pageState: g,
|
|
170
|
-
getMethods: p,
|
|
171
|
-
saveMethod: a,
|
|
172
|
-
highlightMethod: l,
|
|
173
|
-
state: s,
|
|
174
|
-
selectMethod: u,
|
|
175
|
-
bindMethod: t,
|
|
176
|
-
resetTipError: r,
|
|
177
|
-
getExtraParams: c,
|
|
178
|
-
getFormatParams: m,
|
|
179
|
-
getFunctionBody: f,
|
|
180
|
-
activePagePlugin: x,
|
|
181
|
-
confirm: D,
|
|
182
|
-
openedDialog: N,
|
|
183
|
-
closeDialog: w,
|
|
184
|
-
ast2String: H,
|
|
185
|
-
string2Ast: R,
|
|
186
|
-
getMergeMeta: P,
|
|
187
|
-
useCanvas: y,
|
|
188
|
-
useHistory: K,
|
|
189
|
-
useLayout: V,
|
|
190
|
-
getOptions: X,
|
|
191
|
-
getMetaApi: k,
|
|
192
|
-
META_APP: C,
|
|
193
|
-
meta: U,
|
|
194
|
-
dialogVisible: j,
|
|
195
|
-
open: L,
|
|
196
|
-
close: $
|
|
197
|
-
})
|
|
198
|
-
}), r = h(() => {
|
|
67
|
+
}), w && s.enableExtraParams && (v[p].params = w), v[p].value = `this.${C}`, Xe().addHistory();
|
|
68
|
+
}, l = () => {
|
|
199
69
|
s.tipError = !1, s.tip = "", s.isValidParams = !0;
|
|
200
|
-
}, {
|
|
201
|
-
|
|
202
|
-
id: "engine.setting.event.BindEventsDialog.resetTipError"
|
|
203
|
-
},
|
|
204
|
-
ctx: () => ({
|
|
205
|
-
props: d,
|
|
206
|
-
BindEventsDialogSidebar: n,
|
|
207
|
-
BindEventsDialogContent: o,
|
|
208
|
-
PLUGIN_NAME: e,
|
|
209
|
-
activePlugin: i,
|
|
210
|
-
pageState: g,
|
|
211
|
-
getMethods: p,
|
|
212
|
-
saveMethod: a,
|
|
213
|
-
highlightMethod: l,
|
|
214
|
-
state: s,
|
|
215
|
-
selectMethod: u,
|
|
216
|
-
bindMethod: t,
|
|
217
|
-
resetTipError: r,
|
|
218
|
-
getExtraParams: c,
|
|
219
|
-
getFormatParams: m,
|
|
220
|
-
getFunctionBody: f,
|
|
221
|
-
activePagePlugin: x,
|
|
222
|
-
confirm: D,
|
|
223
|
-
openedDialog: N,
|
|
224
|
-
closeDialog: w,
|
|
225
|
-
ast2String: H,
|
|
226
|
-
string2Ast: R,
|
|
227
|
-
getMergeMeta: P,
|
|
228
|
-
useCanvas: y,
|
|
229
|
-
useHistory: K,
|
|
230
|
-
useLayout: V,
|
|
231
|
-
getOptions: X,
|
|
232
|
-
getMetaApi: k,
|
|
233
|
-
META_APP: C,
|
|
234
|
-
meta: U,
|
|
235
|
-
dialogVisible: j,
|
|
236
|
-
open: L,
|
|
237
|
-
close: $
|
|
238
|
-
})
|
|
239
|
-
}), c = h(() => {
|
|
240
|
-
let E = "";
|
|
70
|
+
}, i = () => {
|
|
71
|
+
let g = "";
|
|
241
72
|
if (s.enableExtraParams)
|
|
242
73
|
try {
|
|
243
|
-
|
|
74
|
+
g = JSON.parse(s.editorContent), s.isValidParams = Array.isArray(g);
|
|
244
75
|
} catch {
|
|
245
76
|
s.isValidParams = !1;
|
|
246
77
|
}
|
|
247
|
-
return
|
|
248
|
-
}, {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
props: d,
|
|
254
|
-
BindEventsDialogSidebar: n,
|
|
255
|
-
BindEventsDialogContent: o,
|
|
256
|
-
PLUGIN_NAME: e,
|
|
257
|
-
activePlugin: i,
|
|
258
|
-
pageState: g,
|
|
259
|
-
getMethods: p,
|
|
260
|
-
saveMethod: a,
|
|
261
|
-
highlightMethod: l,
|
|
262
|
-
state: s,
|
|
263
|
-
selectMethod: u,
|
|
264
|
-
bindMethod: t,
|
|
265
|
-
resetTipError: r,
|
|
266
|
-
getExtraParams: c,
|
|
267
|
-
getFormatParams: m,
|
|
268
|
-
getFunctionBody: f,
|
|
269
|
-
activePagePlugin: x,
|
|
270
|
-
confirm: D,
|
|
271
|
-
openedDialog: N,
|
|
272
|
-
closeDialog: w,
|
|
273
|
-
ast2String: H,
|
|
274
|
-
string2Ast: R,
|
|
275
|
-
getMergeMeta: P,
|
|
276
|
-
useCanvas: y,
|
|
277
|
-
useHistory: K,
|
|
278
|
-
useLayout: V,
|
|
279
|
-
getOptions: X,
|
|
280
|
-
getMetaApi: k,
|
|
281
|
-
META_APP: C,
|
|
282
|
-
meta: U,
|
|
283
|
-
dialogVisible: j,
|
|
284
|
-
open: L,
|
|
285
|
-
close: $
|
|
286
|
-
})
|
|
287
|
-
}), m = h((E) => Array.from({
|
|
288
|
-
length: E.length
|
|
289
|
-
}, (_, A) => `args${A}`).join(","), {
|
|
290
|
-
metaData: {
|
|
291
|
-
id: "engine.setting.event.BindEventsDialog.getFormatParams"
|
|
292
|
-
},
|
|
293
|
-
ctx: () => ({
|
|
294
|
-
props: d,
|
|
295
|
-
BindEventsDialogSidebar: n,
|
|
296
|
-
BindEventsDialogContent: o,
|
|
297
|
-
PLUGIN_NAME: e,
|
|
298
|
-
activePlugin: i,
|
|
299
|
-
pageState: g,
|
|
300
|
-
getMethods: p,
|
|
301
|
-
saveMethod: a,
|
|
302
|
-
highlightMethod: l,
|
|
303
|
-
state: s,
|
|
304
|
-
selectMethod: u,
|
|
305
|
-
bindMethod: t,
|
|
306
|
-
resetTipError: r,
|
|
307
|
-
getExtraParams: c,
|
|
308
|
-
getFormatParams: m,
|
|
309
|
-
getFunctionBody: f,
|
|
310
|
-
activePagePlugin: x,
|
|
311
|
-
confirm: D,
|
|
312
|
-
openedDialog: N,
|
|
313
|
-
closeDialog: w,
|
|
314
|
-
ast2String: H,
|
|
315
|
-
string2Ast: R,
|
|
316
|
-
getMergeMeta: P,
|
|
317
|
-
useCanvas: y,
|
|
318
|
-
useHistory: K,
|
|
319
|
-
useLayout: V,
|
|
320
|
-
getOptions: X,
|
|
321
|
-
getMetaApi: k,
|
|
322
|
-
META_APP: C,
|
|
323
|
-
meta: U,
|
|
324
|
-
dialogVisible: j,
|
|
325
|
-
open: L,
|
|
326
|
-
close: $
|
|
327
|
-
})
|
|
328
|
-
}), f = h(() => {
|
|
329
|
-
var W, Z, q, ne, oe, ie, Q, Le;
|
|
330
|
-
let E = (Z = (W = p()) == null ? void 0 : W[s.bindMethodInfo.name]) == null ? void 0 : Z.value, _ = "{}", A = !1, O = !1;
|
|
331
|
-
if (E) {
|
|
332
|
-
let T = {};
|
|
78
|
+
return g;
|
|
79
|
+
}, d = (g) => Array.from({ length: g.length }, (p, v) => `args${v}`).join(","), y = () => {
|
|
80
|
+
var w, M, P, S, T, U, L, Z;
|
|
81
|
+
let g = (M = (w = h()) == null ? void 0 : w[s.bindMethodInfo.name]) == null ? void 0 : M.value, p = "{}", v = !1, C = !1;
|
|
82
|
+
if (g) {
|
|
83
|
+
let A = {};
|
|
333
84
|
try {
|
|
334
|
-
|
|
85
|
+
A = ke(g);
|
|
335
86
|
} catch {
|
|
336
|
-
|
|
87
|
+
g = g.replace("function", `function ${s.bindMethodInfo.name}`), A = ke(g);
|
|
337
88
|
}
|
|
338
|
-
(
|
|
89
|
+
(S = (P = A == null ? void 0 : A.program) == null ? void 0 : P.body[0]) != null && S.body && (p = on(A.program.body[0].body)), (U = (T = A == null ? void 0 : A.program) == null ? void 0 : T.body[0]) != null && U.async && (v = !0), (Z = (L = A == null ? void 0 : A.program) == null ? void 0 : L.body[0]) != null && Z.generator && (C = !0);
|
|
339
90
|
}
|
|
340
91
|
return {
|
|
341
|
-
preBody:
|
|
92
|
+
preBody: p || `{
|
|
342
93
|
}`,
|
|
343
|
-
isAsync:
|
|
344
|
-
isGenerator:
|
|
94
|
+
isAsync: v,
|
|
95
|
+
isGenerator: C
|
|
345
96
|
};
|
|
346
|
-
}, {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
props: d,
|
|
352
|
-
BindEventsDialogSidebar: n,
|
|
353
|
-
BindEventsDialogContent: o,
|
|
354
|
-
PLUGIN_NAME: e,
|
|
355
|
-
activePlugin: i,
|
|
356
|
-
pageState: g,
|
|
357
|
-
getMethods: p,
|
|
358
|
-
saveMethod: a,
|
|
359
|
-
highlightMethod: l,
|
|
360
|
-
state: s,
|
|
361
|
-
selectMethod: u,
|
|
362
|
-
bindMethod: t,
|
|
363
|
-
resetTipError: r,
|
|
364
|
-
getExtraParams: c,
|
|
365
|
-
getFormatParams: m,
|
|
366
|
-
getFunctionBody: f,
|
|
367
|
-
activePagePlugin: x,
|
|
368
|
-
confirm: D,
|
|
369
|
-
openedDialog: N,
|
|
370
|
-
closeDialog: w,
|
|
371
|
-
ast2String: H,
|
|
372
|
-
string2Ast: R,
|
|
373
|
-
getMergeMeta: P,
|
|
374
|
-
useCanvas: y,
|
|
375
|
-
useHistory: K,
|
|
376
|
-
useLayout: V,
|
|
377
|
-
getOptions: X,
|
|
378
|
-
getMetaApi: k,
|
|
379
|
-
META_APP: C,
|
|
380
|
-
meta: U,
|
|
381
|
-
dialogVisible: j,
|
|
382
|
-
open: L,
|
|
383
|
-
close: $
|
|
384
|
-
})
|
|
385
|
-
}), x = h(() => {
|
|
386
|
-
i(e.Page).then(() => {
|
|
387
|
-
rt(() => {
|
|
388
|
-
var E;
|
|
389
|
-
l && l((E = s.bindMethodInfo) == null ? void 0 : E.name);
|
|
97
|
+
}, V = () => {
|
|
98
|
+
r(e.Page).then(() => {
|
|
99
|
+
Se(() => {
|
|
100
|
+
var g;
|
|
101
|
+
m && m((g = s.bindMethodInfo) == null ? void 0 : g.name);
|
|
390
102
|
});
|
|
391
103
|
});
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
getFunctionBody: f,
|
|
413
|
-
activePagePlugin: x,
|
|
414
|
-
confirm: D,
|
|
415
|
-
openedDialog: N,
|
|
416
|
-
closeDialog: w,
|
|
417
|
-
ast2String: H,
|
|
418
|
-
string2Ast: R,
|
|
419
|
-
getMergeMeta: P,
|
|
420
|
-
useCanvas: y,
|
|
421
|
-
useHistory: K,
|
|
422
|
-
useLayout: V,
|
|
423
|
-
getOptions: X,
|
|
424
|
-
getMetaApi: k,
|
|
425
|
-
META_APP: C,
|
|
426
|
-
meta: U,
|
|
427
|
-
dialogVisible: j,
|
|
428
|
-
open: L,
|
|
429
|
-
close: $
|
|
430
|
-
})
|
|
431
|
-
}), D = h(async () => {
|
|
432
|
-
if (s.tipError)
|
|
433
|
-
return;
|
|
434
|
-
let E = "event";
|
|
435
|
-
const _ = c();
|
|
436
|
-
let A = E;
|
|
437
|
-
if (!s.isValidParams)
|
|
438
|
-
return;
|
|
439
|
-
_ && (E = _.join(","), A = m(_)), t({
|
|
440
|
-
...s.bindMethodInfo,
|
|
441
|
-
params: E,
|
|
442
|
-
extra: _
|
|
443
|
-
});
|
|
444
|
-
const {
|
|
445
|
-
preBody: O,
|
|
446
|
-
isAsync: W,
|
|
447
|
-
isGenerator: Z
|
|
448
|
-
} = f(), {
|
|
449
|
-
name: q
|
|
450
|
-
} = s.bindMethodInfo, ne = `${W ? "async" : ""} function${Z ? "*" : ""} ${q}`, oe = {
|
|
451
|
-
name: q,
|
|
452
|
-
content: s.enableExtraParams ? `${ne}(eventArgs,${A}) ${O}` : `${ne}(${A}) ${O}`
|
|
453
|
-
}, {
|
|
454
|
-
beforeSaveMethod: ie
|
|
455
|
-
} = X(U.id);
|
|
456
|
-
typeof ie == "function" && await ie(oe, s.bindMethodInfo), a == null || a(oe), x(), $();
|
|
457
|
-
}, {
|
|
458
|
-
metaData: {
|
|
459
|
-
id: "engine.setting.event.BindEventsDialog.confirm"
|
|
104
|
+
};
|
|
105
|
+
return {
|
|
106
|
+
BindEventsDialogSidebar: o,
|
|
107
|
+
BindEventsDialogContent: a,
|
|
108
|
+
state: s,
|
|
109
|
+
dialogVisible: ce,
|
|
110
|
+
confirm: async () => {
|
|
111
|
+
if (s.tipError)
|
|
112
|
+
return;
|
|
113
|
+
let g = "event";
|
|
114
|
+
const p = i();
|
|
115
|
+
let v = g;
|
|
116
|
+
if (!s.isValidParams)
|
|
117
|
+
return;
|
|
118
|
+
p && (g = p.join(","), v = d(p)), n({ ...s.bindMethodInfo, extra: p });
|
|
119
|
+
const { preBody: C, isAsync: w, isGenerator: M } = y(), { name: P } = s.bindMethodInfo, S = `${w ? "async" : ""} function${M ? "*" : ""} ${P}`, T = {
|
|
120
|
+
name: P,
|
|
121
|
+
content: s.enableExtraParams ? `${S}(eventArgs,${v}) ${C}` : `${S}(${v}) ${C}`
|
|
122
|
+
}, { beforeSaveMethod: U } = Je(de.id);
|
|
123
|
+
typeof U == "function" && await U(T, s.bindMethodInfo), c == null || c(T), V(), Ce();
|
|
460
124
|
},
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
BindEventsDialogSidebar: n,
|
|
464
|
-
BindEventsDialogContent: o,
|
|
465
|
-
PLUGIN_NAME: e,
|
|
466
|
-
activePlugin: i,
|
|
467
|
-
pageState: g,
|
|
468
|
-
getMethods: p,
|
|
469
|
-
saveMethod: a,
|
|
470
|
-
highlightMethod: l,
|
|
471
|
-
state: s,
|
|
472
|
-
selectMethod: u,
|
|
473
|
-
bindMethod: t,
|
|
474
|
-
resetTipError: r,
|
|
475
|
-
getExtraParams: c,
|
|
476
|
-
getFormatParams: m,
|
|
477
|
-
getFunctionBody: f,
|
|
478
|
-
activePagePlugin: x,
|
|
479
|
-
confirm: D,
|
|
480
|
-
openedDialog: N,
|
|
481
|
-
closeDialog: w,
|
|
482
|
-
ast2String: H,
|
|
483
|
-
string2Ast: R,
|
|
484
|
-
getMergeMeta: P,
|
|
485
|
-
useCanvas: y,
|
|
486
|
-
useHistory: K,
|
|
487
|
-
useLayout: V,
|
|
488
|
-
getOptions: X,
|
|
489
|
-
getMetaApi: k,
|
|
490
|
-
META_APP: C,
|
|
491
|
-
meta: U,
|
|
492
|
-
dialogVisible: j,
|
|
493
|
-
open: L,
|
|
494
|
-
close: $
|
|
495
|
-
})
|
|
496
|
-
}), N = h(() => {
|
|
497
|
-
var E, _, A;
|
|
498
|
-
s.enableExtraParams = !!((_ = (E = d.eventBinding) == null ? void 0 : E.params) != null && _.length), s.editorContent = JSON.stringify(((A = d.eventBinding) == null ? void 0 : A.params) || [], null, 2), r();
|
|
499
|
-
}, {
|
|
500
|
-
metaData: {
|
|
501
|
-
id: "engine.setting.event.BindEventsDialog.openedDialog"
|
|
125
|
+
closeDialog: () => {
|
|
126
|
+
l(), Ce();
|
|
502
127
|
},
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
BindEventsDialogContent: o,
|
|
507
|
-
PLUGIN_NAME: e,
|
|
508
|
-
activePlugin: i,
|
|
509
|
-
pageState: g,
|
|
510
|
-
getMethods: p,
|
|
511
|
-
saveMethod: a,
|
|
512
|
-
highlightMethod: l,
|
|
513
|
-
state: s,
|
|
514
|
-
selectMethod: u,
|
|
515
|
-
bindMethod: t,
|
|
516
|
-
resetTipError: r,
|
|
517
|
-
getExtraParams: c,
|
|
518
|
-
getFormatParams: m,
|
|
519
|
-
getFunctionBody: f,
|
|
520
|
-
activePagePlugin: x,
|
|
521
|
-
confirm: D,
|
|
522
|
-
openedDialog: N,
|
|
523
|
-
closeDialog: w,
|
|
524
|
-
ast2String: H,
|
|
525
|
-
string2Ast: R,
|
|
526
|
-
getMergeMeta: P,
|
|
527
|
-
useCanvas: y,
|
|
528
|
-
useHistory: K,
|
|
529
|
-
useLayout: V,
|
|
530
|
-
getOptions: X,
|
|
531
|
-
getMetaApi: k,
|
|
532
|
-
META_APP: C,
|
|
533
|
-
meta: U,
|
|
534
|
-
dialogVisible: j,
|
|
535
|
-
open: L,
|
|
536
|
-
close: $
|
|
537
|
-
})
|
|
538
|
-
}), w = h(() => {
|
|
539
|
-
r(), $();
|
|
540
|
-
}, {
|
|
541
|
-
metaData: {
|
|
542
|
-
id: "engine.setting.event.BindEventsDialog.closeDialog"
|
|
128
|
+
openedDialog: () => {
|
|
129
|
+
var g, p, v;
|
|
130
|
+
s.enableExtraParams = !!((p = (g = f.eventBinding) == null ? void 0 : g.params) != null && p.length), s.editorContent = JSON.stringify(((v = f.eventBinding) == null ? void 0 : v.params) || [], null, 2), l();
|
|
543
131
|
},
|
|
544
|
-
|
|
545
|
-
props: d,
|
|
546
|
-
BindEventsDialogSidebar: n,
|
|
547
|
-
BindEventsDialogContent: o,
|
|
548
|
-
PLUGIN_NAME: e,
|
|
549
|
-
activePlugin: i,
|
|
550
|
-
pageState: g,
|
|
551
|
-
getMethods: p,
|
|
552
|
-
saveMethod: a,
|
|
553
|
-
highlightMethod: l,
|
|
554
|
-
state: s,
|
|
555
|
-
selectMethod: u,
|
|
556
|
-
bindMethod: t,
|
|
557
|
-
resetTipError: r,
|
|
558
|
-
getExtraParams: c,
|
|
559
|
-
getFormatParams: m,
|
|
560
|
-
getFunctionBody: f,
|
|
561
|
-
activePagePlugin: x,
|
|
562
|
-
confirm: D,
|
|
563
|
-
openedDialog: N,
|
|
564
|
-
closeDialog: w,
|
|
565
|
-
ast2String: H,
|
|
566
|
-
string2Ast: R,
|
|
567
|
-
getMergeMeta: P,
|
|
568
|
-
useCanvas: y,
|
|
569
|
-
useHistory: K,
|
|
570
|
-
useLayout: V,
|
|
571
|
-
getOptions: X,
|
|
572
|
-
getMetaApi: k,
|
|
573
|
-
META_APP: C,
|
|
574
|
-
meta: U,
|
|
575
|
-
dialogVisible: j,
|
|
576
|
-
open: L,
|
|
577
|
-
close: $
|
|
578
|
-
})
|
|
579
|
-
});
|
|
580
|
-
return {
|
|
581
|
-
BindEventsDialogSidebar: n,
|
|
582
|
-
BindEventsDialogContent: o,
|
|
583
|
-
state: s,
|
|
584
|
-
dialogVisible: j,
|
|
585
|
-
confirm: D,
|
|
586
|
-
closeDialog: w,
|
|
587
|
-
openedDialog: N,
|
|
588
|
-
selectMethod: u
|
|
132
|
+
selectMethod: x
|
|
589
133
|
};
|
|
590
134
|
}
|
|
591
|
-
},
|
|
592
|
-
function
|
|
593
|
-
const
|
|
594
|
-
return
|
|
135
|
+
}, pn = { class: "bind-event-dialog-tip" }, un = { class: "bind-event-dialog-content" }, fn = { class: "bind-dialog-footer" };
|
|
136
|
+
function vn(f, o, a, e, r, _) {
|
|
137
|
+
const h = k("tiny-alert"), c = k("tiny-button"), m = k("tiny-dialog-box");
|
|
138
|
+
return b(), O(m, {
|
|
595
139
|
visible: e.dialogVisible,
|
|
596
140
|
title: "事件绑定",
|
|
597
141
|
width: "50%",
|
|
@@ -601,48 +145,48 @@ function Dt(d, n, o, e, i, g) {
|
|
|
601
145
|
onClose: e.closeDialog,
|
|
602
146
|
onOpened: e.openedDialog
|
|
603
147
|
}, {
|
|
604
|
-
footer:
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
default:
|
|
608
|
-
|
|
148
|
+
footer: E(() => [
|
|
149
|
+
t("div", fn, [
|
|
150
|
+
u(c, { onClick: e.closeDialog }, {
|
|
151
|
+
default: E(() => o[0] || (o[0] = [
|
|
152
|
+
J("取 消")
|
|
609
153
|
])),
|
|
610
154
|
_: 1,
|
|
611
155
|
__: [0]
|
|
612
156
|
}, 8, ["onClick"]),
|
|
613
|
-
|
|
157
|
+
u(c, {
|
|
614
158
|
type: "info",
|
|
615
159
|
onClick: e.confirm
|
|
616
160
|
}, {
|
|
617
|
-
default:
|
|
618
|
-
|
|
161
|
+
default: E(() => o[1] || (o[1] = [
|
|
162
|
+
J("确 定")
|
|
619
163
|
])),
|
|
620
164
|
_: 1,
|
|
621
165
|
__: [1]
|
|
622
166
|
}, 8, ["onClick"])
|
|
623
167
|
])
|
|
624
168
|
]),
|
|
625
|
-
default:
|
|
626
|
-
|
|
627
|
-
|
|
169
|
+
default: E(() => [
|
|
170
|
+
t("div", pn, [
|
|
171
|
+
u(h, {
|
|
628
172
|
type: "info",
|
|
629
173
|
description: "选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)。",
|
|
630
174
|
class: "header-alert",
|
|
631
175
|
closable: !1
|
|
632
176
|
})
|
|
633
177
|
]),
|
|
634
|
-
|
|
635
|
-
(
|
|
178
|
+
t("div", un, [
|
|
179
|
+
(b(), O(_e(e.BindEventsDialogSidebar), {
|
|
636
180
|
dialogVisible: e.dialogVisible,
|
|
637
|
-
eventBinding:
|
|
181
|
+
eventBinding: a.eventBinding
|
|
638
182
|
}, null, 8, ["dialogVisible", "eventBinding"])),
|
|
639
|
-
(
|
|
183
|
+
(b(), O(_e(e.BindEventsDialogContent), { dialogVisible: e.dialogVisible }, null, 8, ["dialogVisible"]))
|
|
640
184
|
])
|
|
641
185
|
]),
|
|
642
186
|
_: 1
|
|
643
187
|
}, 8, ["visible", "onClose", "onOpened"]);
|
|
644
188
|
}
|
|
645
|
-
const
|
|
189
|
+
const gn = /* @__PURE__ */ H(mn, [["render", vn], ["__scopeId", "data-v-070f73c9"]]), _n = {
|
|
646
190
|
onClick: {
|
|
647
191
|
label: {
|
|
648
192
|
zh_CN: "点击事件"
|
|
@@ -699,19 +243,120 @@ const De = /* @__PURE__ */ Ie(bt, [["render", Dt], ["__scopeId", "data-v-0316665
|
|
|
699
243
|
},
|
|
700
244
|
defaultValue: ""
|
|
701
245
|
}
|
|
702
|
-
},
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
246
|
+
}, hn = [
|
|
247
|
+
"onabort",
|
|
248
|
+
"onafterprint",
|
|
249
|
+
"onanimationend",
|
|
250
|
+
"onanimationiteration",
|
|
251
|
+
"onanimationstart",
|
|
252
|
+
"onappinstalled",
|
|
253
|
+
"onauxclick",
|
|
254
|
+
"onbeforeinstallprompt",
|
|
255
|
+
"onbeforeprint",
|
|
256
|
+
"onbeforeunload",
|
|
257
|
+
"onbeforexrselect",
|
|
258
|
+
"onblur",
|
|
259
|
+
"oncancel",
|
|
260
|
+
"oncanplay",
|
|
261
|
+
"oncanplaythrough",
|
|
262
|
+
"onchange",
|
|
263
|
+
"onclick",
|
|
264
|
+
"onclose",
|
|
265
|
+
"oncontextlost",
|
|
266
|
+
"oncontextmenu",
|
|
267
|
+
"oncontextrestored",
|
|
268
|
+
"oncuechange",
|
|
269
|
+
"ondblclick",
|
|
270
|
+
"ondrag",
|
|
271
|
+
"ondragend",
|
|
272
|
+
"ondragenter",
|
|
273
|
+
"ondragleave",
|
|
274
|
+
"ondragover",
|
|
275
|
+
"ondragstart",
|
|
276
|
+
"ondrop",
|
|
277
|
+
"ondurationchange",
|
|
278
|
+
"onemptied",
|
|
279
|
+
"onended",
|
|
280
|
+
"onerror",
|
|
281
|
+
"onfocus",
|
|
282
|
+
"onformdata",
|
|
283
|
+
"ongotpointercapture",
|
|
284
|
+
"onhashchange",
|
|
285
|
+
"oninput",
|
|
286
|
+
"oninvalid",
|
|
287
|
+
"onkeydown",
|
|
288
|
+
"onkeypress",
|
|
289
|
+
"onkeyup",
|
|
290
|
+
"onlanguagechange",
|
|
291
|
+
"onload",
|
|
292
|
+
"onloadeddata",
|
|
293
|
+
"onloadedmetadata",
|
|
294
|
+
"onloadstart",
|
|
295
|
+
"onlostpointercapture",
|
|
296
|
+
"onmessage",
|
|
297
|
+
"onmessageerror",
|
|
298
|
+
"onmousedown",
|
|
299
|
+
"onmouseenter",
|
|
300
|
+
"onmouseleave",
|
|
301
|
+
"onmousemove",
|
|
302
|
+
"onmouseout",
|
|
303
|
+
"onmouseover",
|
|
304
|
+
"onmouseup",
|
|
305
|
+
"onmousewheel",
|
|
306
|
+
"onoffline",
|
|
307
|
+
"ononline",
|
|
308
|
+
"onpagehide",
|
|
309
|
+
"onpageshow",
|
|
310
|
+
"onpause",
|
|
311
|
+
"onplay",
|
|
312
|
+
"onplaying",
|
|
313
|
+
"onpointercancel",
|
|
314
|
+
"onpointerdown",
|
|
315
|
+
"onpointerenter",
|
|
316
|
+
"onpointerleave",
|
|
317
|
+
"onpointermove",
|
|
318
|
+
"onpointerout",
|
|
319
|
+
"onpointerover",
|
|
320
|
+
"onpointerrawupdate",
|
|
321
|
+
"onpointerup",
|
|
322
|
+
"onpopstate",
|
|
323
|
+
"onprogress",
|
|
324
|
+
"onratechange",
|
|
325
|
+
"onrejectionhandled",
|
|
326
|
+
"onreset",
|
|
327
|
+
"onresize",
|
|
328
|
+
"onscroll",
|
|
329
|
+
"onsearch",
|
|
330
|
+
"onsecuritypolicyviolation",
|
|
331
|
+
"onseeked",
|
|
332
|
+
"onseeking",
|
|
333
|
+
"onselect",
|
|
334
|
+
"onselectionchange",
|
|
335
|
+
"onselectstart",
|
|
336
|
+
"onslotchange",
|
|
337
|
+
"onstalled",
|
|
338
|
+
"onstorage",
|
|
339
|
+
"onsubmit",
|
|
340
|
+
"onsuspend",
|
|
341
|
+
"ontimeupdate",
|
|
342
|
+
"ontoggle",
|
|
343
|
+
"ontransitioncancel",
|
|
344
|
+
"ontransitionend",
|
|
345
|
+
"ontransitionrun",
|
|
346
|
+
"ontransitionstart",
|
|
347
|
+
"onunhandledrejection",
|
|
348
|
+
"onunload",
|
|
349
|
+
"onvolumechange",
|
|
350
|
+
"onwaiting",
|
|
351
|
+
"onwebkitanimationend",
|
|
352
|
+
"onwebkitanimationiteration",
|
|
353
|
+
"onwebkitanimationstart",
|
|
354
|
+
"onwebkittransitionend",
|
|
355
|
+
"onwheel"
|
|
356
|
+
], bn = (f) => !!hn.map((a) => {
|
|
357
|
+
const e = a[2].toUpperCase();
|
|
358
|
+
return `${a.substring(0, 2)}${e}${a.substring(3)}`;
|
|
359
|
+
}).includes(f), yn = { class: "footer" }, En = {
|
|
715
360
|
__name: "AddEventsDialog",
|
|
716
361
|
props: {
|
|
717
362
|
visible: {
|
|
@@ -724,157 +369,108 @@ const De = /* @__PURE__ */ Ie(bt, [["render", Dt], ["__scopeId", "data-v-0316665
|
|
|
724
369
|
}
|
|
725
370
|
},
|
|
726
371
|
emits: ["closeDialog", "addEvent"],
|
|
727
|
-
setup(
|
|
728
|
-
const
|
|
372
|
+
setup(f, { emit: o }) {
|
|
373
|
+
const a = f, e = o, r = Y({
|
|
729
374
|
eventDescription: "",
|
|
730
375
|
eventName: ""
|
|
731
|
-
}),
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
})
|
|
756
|
-
}), a = {
|
|
757
|
-
eventDescription: [{
|
|
758
|
-
required: !0,
|
|
759
|
-
message: "必填"
|
|
760
|
-
}],
|
|
761
|
-
eventName: [{
|
|
762
|
-
required: !0,
|
|
763
|
-
message: "必填"
|
|
764
|
-
}, {
|
|
765
|
-
validator: p
|
|
766
|
-
}]
|
|
767
|
-
}, l = h(() => {
|
|
376
|
+
}), _ = K(null), c = {
|
|
377
|
+
eventDescription: [
|
|
378
|
+
{
|
|
379
|
+
required: !0,
|
|
380
|
+
message: "必填"
|
|
381
|
+
}
|
|
382
|
+
],
|
|
383
|
+
eventName: [
|
|
384
|
+
{ required: !0, message: "必填" },
|
|
385
|
+
{
|
|
386
|
+
validator: (x, n, l) => {
|
|
387
|
+
if (a.componentEvents[r.eventName]) {
|
|
388
|
+
l(new Error("事件名已存在"));
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
if (!bn(r.eventName)) {
|
|
392
|
+
l(new Error("请输入正确的浏览器事件名"));
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
l();
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
}, m = () => {
|
|
768
400
|
e("closeDialog");
|
|
769
|
-
}, {
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
},
|
|
773
|
-
ctx: () => ({
|
|
774
|
-
checkEvent: Pe,
|
|
775
|
-
props: o,
|
|
776
|
-
emits: e,
|
|
777
|
-
formData: i,
|
|
778
|
-
ruleForm: g,
|
|
779
|
-
eventNameValidator: p,
|
|
780
|
-
rules: a,
|
|
781
|
-
closeDialog: l,
|
|
782
|
-
addMethod: s
|
|
783
|
-
})
|
|
784
|
-
}), s = h(() => {
|
|
785
|
-
g.value && g.value.validate((u) => {
|
|
786
|
-
if (!u)
|
|
401
|
+
}, s = () => {
|
|
402
|
+
_.value && _.value.validate((x) => {
|
|
403
|
+
if (!x)
|
|
787
404
|
return;
|
|
788
|
-
const {
|
|
789
|
-
|
|
790
|
-
eventDescription: r
|
|
791
|
-
} = i;
|
|
792
|
-
e("addEvent", {
|
|
793
|
-
eventName: t,
|
|
794
|
-
eventDescription: r
|
|
795
|
-
});
|
|
405
|
+
const { eventName: n, eventDescription: l } = r;
|
|
406
|
+
e("addEvent", { eventName: n, eventDescription: l });
|
|
796
407
|
});
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
},
|
|
801
|
-
ctx: () => ({
|
|
802
|
-
checkEvent: Pe,
|
|
803
|
-
props: o,
|
|
804
|
-
emits: e,
|
|
805
|
-
formData: i,
|
|
806
|
-
ruleForm: g,
|
|
807
|
-
eventNameValidator: p,
|
|
808
|
-
rules: a,
|
|
809
|
-
closeDialog: l,
|
|
810
|
-
addMethod: s
|
|
811
|
-
})
|
|
812
|
-
});
|
|
813
|
-
return (u, t) => (B(), te(S(it), {
|
|
814
|
-
visible: d.visible,
|
|
408
|
+
};
|
|
409
|
+
return (x, n) => (b(), O(D(De), {
|
|
410
|
+
visible: f.visible,
|
|
815
411
|
title: "添加新事件",
|
|
816
412
|
width: "400px",
|
|
817
413
|
"append-to-body": !0,
|
|
818
414
|
"close-on-click-modal": !1,
|
|
819
|
-
onClose:
|
|
415
|
+
onClose: m
|
|
820
416
|
}, {
|
|
821
|
-
footer:
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
default:
|
|
825
|
-
|
|
417
|
+
footer: E(() => [
|
|
418
|
+
t("div", yn, [
|
|
419
|
+
u(D(ee), { onClick: m }, {
|
|
420
|
+
default: E(() => n[2] || (n[2] = [
|
|
421
|
+
J(" 取消")
|
|
826
422
|
])),
|
|
827
423
|
_: 1,
|
|
828
424
|
__: [2]
|
|
829
|
-
}
|
|
830
|
-
|
|
425
|
+
}),
|
|
426
|
+
u(D(ee), {
|
|
831
427
|
type: "primary",
|
|
832
|
-
onClick:
|
|
428
|
+
onClick: s
|
|
833
429
|
}, {
|
|
834
|
-
default:
|
|
835
|
-
|
|
430
|
+
default: E(() => n[3] || (n[3] = [
|
|
431
|
+
J(" 确定")
|
|
836
432
|
])),
|
|
837
433
|
_: 1,
|
|
838
434
|
__: [3]
|
|
839
|
-
}
|
|
435
|
+
})
|
|
840
436
|
])
|
|
841
437
|
]),
|
|
842
|
-
default:
|
|
843
|
-
|
|
438
|
+
default: E(() => [
|
|
439
|
+
u(D(Ue), {
|
|
844
440
|
ref_key: "ruleForm",
|
|
845
|
-
ref:
|
|
846
|
-
model:
|
|
847
|
-
rules:
|
|
441
|
+
ref: _,
|
|
442
|
+
model: r,
|
|
443
|
+
rules: c,
|
|
848
444
|
"label-width": "80px",
|
|
849
445
|
"inline-message": !0,
|
|
850
446
|
"validate-type": "text",
|
|
851
447
|
"label-position": "left",
|
|
852
448
|
class: "add-custom-event-form"
|
|
853
449
|
}, {
|
|
854
|
-
default:
|
|
855
|
-
|
|
450
|
+
default: E(() => [
|
|
451
|
+
u(D(Ee), {
|
|
856
452
|
label: "事件函数名",
|
|
857
453
|
prop: "eventName",
|
|
858
454
|
required: ""
|
|
859
455
|
}, {
|
|
860
|
-
default:
|
|
861
|
-
|
|
862
|
-
modelValue:
|
|
863
|
-
"onUpdate:modelValue":
|
|
456
|
+
default: E(() => [
|
|
457
|
+
u(D(le), {
|
|
458
|
+
modelValue: r.eventName,
|
|
459
|
+
"onUpdate:modelValue": n[0] || (n[0] = (l) => r.eventName = l),
|
|
864
460
|
placeholder: "小驼峰格式,如:onDrag"
|
|
865
461
|
}, null, 8, ["modelValue"])
|
|
866
462
|
]),
|
|
867
463
|
_: 1
|
|
868
464
|
}),
|
|
869
|
-
|
|
465
|
+
u(D(Ee), {
|
|
870
466
|
label: "事件描述",
|
|
871
467
|
prop: "eventDescription",
|
|
872
468
|
required: ""
|
|
873
469
|
}, {
|
|
874
|
-
default:
|
|
875
|
-
|
|
876
|
-
modelValue:
|
|
877
|
-
"onUpdate:modelValue":
|
|
470
|
+
default: E(() => [
|
|
471
|
+
u(D(le), {
|
|
472
|
+
modelValue: r.eventDescription,
|
|
473
|
+
"onUpdate:modelValue": n[1] || (n[1] = (l) => r.eventDescription = l)
|
|
878
474
|
}, null, 8, ["modelValue"])
|
|
879
475
|
]),
|
|
880
476
|
_: 1
|
|
@@ -884,405 +480,114 @@ const De = /* @__PURE__ */ Ie(bt, [["render", Dt], ["__scopeId", "data-v-0316665
|
|
|
884
480
|
}, 8, ["model"])
|
|
885
481
|
]),
|
|
886
482
|
_: 1
|
|
887
|
-
}, 8, ["visible"
|
|
483
|
+
}, 8, ["visible"]));
|
|
888
484
|
}
|
|
889
|
-
},
|
|
485
|
+
}, xn = /* @__PURE__ */ H(En, [["__scopeId", "data-v-5033228a"]]), kn = {
|
|
890
486
|
components: {
|
|
891
|
-
BlockLinkEvent:
|
|
892
|
-
BindEventsDialog:
|
|
893
|
-
TinyPopover:
|
|
894
|
-
TinyButton:
|
|
895
|
-
IconChevronDown:
|
|
896
|
-
SvgButton:
|
|
897
|
-
AddEventsDialog:
|
|
487
|
+
BlockLinkEvent: We,
|
|
488
|
+
BindEventsDialog: gn,
|
|
489
|
+
TinyPopover: je,
|
|
490
|
+
TinyButton: ee,
|
|
491
|
+
IconChevronDown: nn(),
|
|
492
|
+
SvgButton: Ze,
|
|
493
|
+
AddEventsDialog: xn
|
|
898
494
|
},
|
|
899
495
|
inheritAttrs: !1,
|
|
900
496
|
setup() {
|
|
901
|
-
const {
|
|
902
|
-
PLUGIN_NAME: d,
|
|
903
|
-
activePlugin: n
|
|
904
|
-
} = V(), {
|
|
905
|
-
pageState: o
|
|
906
|
-
} = y(), {
|
|
907
|
-
getBlockEvents: e,
|
|
908
|
-
getCurrentBlock: i,
|
|
909
|
-
removeEventLink: g
|
|
910
|
-
} = ue(), {
|
|
911
|
-
getMaterial: p
|
|
912
|
-
} = fe(), {
|
|
913
|
-
confirm: a
|
|
914
|
-
} = _e(), l = be.global.locale.value, {
|
|
915
|
-
highlightMethod: s
|
|
916
|
-
} = k(C.Page), {
|
|
917
|
-
commonEvents: u = {}
|
|
918
|
-
} = P("engine.setting.event").options, t = we({
|
|
497
|
+
const { PLUGIN_NAME: f, activePlugin: o } = re(), { pageState: a } = j(), { getBlockEvents: e, getCurrentBlock: r, removeEventLink: _ } = Ke(), { getMaterial: h } = He(), { confirm: c } = Ge(), m = Ye.global.locale.value, { highlightMethod: s } = ne(oe.Page), { commonEvents: x = {} } = Ie("engine.setting.event").options, n = Y({
|
|
919
498
|
eventName: "",
|
|
920
499
|
// 事件名称
|
|
921
500
|
eventBinding: null,
|
|
922
501
|
// 事件绑定的处理方法对象
|
|
923
502
|
componentEvent: {},
|
|
924
|
-
customEvents:
|
|
503
|
+
customEvents: x,
|
|
925
504
|
bindActions: {},
|
|
926
505
|
showBindEventDialog: !1
|
|
927
|
-
}),
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
if (W.indexOf(Q) > -1) {
|
|
939
|
-
const st = O[Q], {
|
|
940
|
-
value: lt,
|
|
941
|
-
params: $e
|
|
942
|
-
} = st, dt = !$e && ((Ue = (T = lt.match(/\((.+)\)$/)) == null ? void 0 : T[1]) == null ? void 0 : Ue.split(",")) || $e, pe = {
|
|
943
|
-
eventName: Q,
|
|
506
|
+
}), l = q(() => !!a.isBlock), i = q(() => Object.keys(n.bindActions).length === 0), d = q(() => ({ ...n.componentEvent, ...n.customEvents }));
|
|
507
|
+
Ae(() => {
|
|
508
|
+
var M, P, S, T, U;
|
|
509
|
+
const p = (M = a == null ? void 0 : a.currentSchema) == null ? void 0 : M.componentName, v = h(p);
|
|
510
|
+
n.componentEvent = ((S = (P = v == null ? void 0 : v.content) == null ? void 0 : P.schema) == null ? void 0 : S.events) || ((T = v == null ? void 0 : v.schema) == null ? void 0 : T.events) || {};
|
|
511
|
+
const C = ((U = a == null ? void 0 : a.currentSchema) == null ? void 0 : U.props) || {}, w = Object.keys(C);
|
|
512
|
+
n.bindActions = {}, Object.entries(d.value).forEach(([L, Z]) => {
|
|
513
|
+
var A, ie, me;
|
|
514
|
+
if (w.indexOf(L) > -1) {
|
|
515
|
+
const Me = C[L], { value: we, params: pe } = Me, Le = !pe && ((ie = (A = we.match(/\((.+)\)$/)) == null ? void 0 : A[1]) == null ? void 0 : ie.split(",")) || pe, z = {
|
|
516
|
+
eventName: L,
|
|
944
517
|
ref: "",
|
|
945
|
-
event:
|
|
946
|
-
params:
|
|
518
|
+
event: C[L],
|
|
519
|
+
params: Le
|
|
947
520
|
};
|
|
948
|
-
if (
|
|
949
|
-
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
var
|
|
953
|
-
|
|
521
|
+
if (z.event.type === "JSExpression" && (z.ref = z.event.value.replace("this.", "").replace(/\(.*\)$/, "")), a.isBlock) {
|
|
522
|
+
z.metaEvent = Z;
|
|
523
|
+
const ue = e(r()), fe = (me = a == null ? void 0 : a.currentSchema) == null ? void 0 : me.id;
|
|
524
|
+
fe && ue && Object.entries(ue).forEach(([Oe, R]) => {
|
|
525
|
+
var ve, ge;
|
|
526
|
+
fe === ((ve = R == null ? void 0 : R.linked) == null ? void 0 : ve.id) && L === ((ge = R == null ? void 0 : R.linked) == null ? void 0 : ge.event) && (z.linked = R.linked, z.linkedEventName = Oe);
|
|
954
527
|
});
|
|
955
528
|
}
|
|
956
|
-
|
|
529
|
+
n.bindActions[L] = z;
|
|
957
530
|
}
|
|
958
531
|
});
|
|
959
532
|
});
|
|
960
|
-
const
|
|
961
|
-
|
|
962
|
-
}, {
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
state: t,
|
|
979
|
-
isBlock: r,
|
|
980
|
-
isEmpty: c,
|
|
981
|
-
renderEventList: m,
|
|
982
|
-
openActionDialog: f,
|
|
983
|
-
deleteAction: x,
|
|
984
|
-
delEvent: D,
|
|
985
|
-
openCodePanel: N,
|
|
986
|
-
handleToggleAddEventDialog: w,
|
|
987
|
-
handleAddEvent: E,
|
|
988
|
-
useModal: _e,
|
|
989
|
-
getMergeMeta: P,
|
|
990
|
-
useCanvas: y,
|
|
991
|
-
useLayout: V,
|
|
992
|
-
useBlock: ue,
|
|
993
|
-
useMaterial: fe,
|
|
994
|
-
getMetaApi: k,
|
|
995
|
-
META_APP: C,
|
|
996
|
-
useMessage: he,
|
|
997
|
-
i18n: be,
|
|
998
|
-
BlockLinkEvent: ye,
|
|
999
|
-
SvgButton: Ee,
|
|
1000
|
-
iconChevronDown: xe,
|
|
1001
|
-
BindEventsDialog: De,
|
|
1002
|
-
openDialog: L,
|
|
1003
|
-
AddEventsDialog: Ce
|
|
1004
|
-
})
|
|
1005
|
-
}), x = h((_) => {
|
|
1006
|
-
var O;
|
|
1007
|
-
Object.keys(((O = o == null ? void 0 : o.currentSchema) == null ? void 0 : O.props) || {}).indexOf(_.eventName) > -1 && (delete o.currentSchema.props[_.eventName], he().publish({
|
|
1008
|
-
topic: "schemaChange",
|
|
1009
|
-
data: {
|
|
1010
|
-
props: o.currentSchema.props
|
|
1011
|
-
}
|
|
1012
|
-
}));
|
|
1013
|
-
}, {
|
|
1014
|
-
metaData: {
|
|
1015
|
-
id: "engine.setting.event.BindEvents.deleteAction"
|
|
1016
|
-
},
|
|
1017
|
-
ctx: () => ({
|
|
1018
|
-
PLUGIN_NAME: d,
|
|
1019
|
-
activePlugin: n,
|
|
1020
|
-
pageState: o,
|
|
1021
|
-
getBlockEvents: e,
|
|
1022
|
-
getCurrentBlock: i,
|
|
1023
|
-
removeEventLink: g,
|
|
1024
|
-
getMaterial: p,
|
|
1025
|
-
confirm: a,
|
|
1026
|
-
locale: l,
|
|
1027
|
-
highlightMethod: s,
|
|
1028
|
-
commonEvents: u,
|
|
1029
|
-
state: t,
|
|
1030
|
-
isBlock: r,
|
|
1031
|
-
isEmpty: c,
|
|
1032
|
-
renderEventList: m,
|
|
1033
|
-
openActionDialog: f,
|
|
1034
|
-
deleteAction: x,
|
|
1035
|
-
delEvent: D,
|
|
1036
|
-
openCodePanel: N,
|
|
1037
|
-
handleToggleAddEventDialog: w,
|
|
1038
|
-
handleAddEvent: E,
|
|
1039
|
-
useModal: _e,
|
|
1040
|
-
getMergeMeta: P,
|
|
1041
|
-
useCanvas: y,
|
|
1042
|
-
useLayout: V,
|
|
1043
|
-
useBlock: ue,
|
|
1044
|
-
useMaterial: fe,
|
|
1045
|
-
getMetaApi: k,
|
|
1046
|
-
META_APP: C,
|
|
1047
|
-
useMessage: he,
|
|
1048
|
-
i18n: be,
|
|
1049
|
-
BlockLinkEvent: ye,
|
|
1050
|
-
SvgButton: Ee,
|
|
1051
|
-
iconChevronDown: xe,
|
|
1052
|
-
BindEventsDialog: De,
|
|
1053
|
-
openDialog: L,
|
|
1054
|
-
AddEventsDialog: Ce
|
|
1055
|
-
})
|
|
1056
|
-
}), D = h((_) => {
|
|
1057
|
-
a({
|
|
1058
|
-
title: "提示",
|
|
1059
|
-
message: `您确定要删除事件 ${_.eventName} 吗?`,
|
|
1060
|
-
exec() {
|
|
1061
|
-
o.isBlock && g({
|
|
1062
|
-
linked: _.linked
|
|
1063
|
-
}), x(_);
|
|
1064
|
-
}
|
|
1065
|
-
});
|
|
1066
|
-
}, {
|
|
1067
|
-
metaData: {
|
|
1068
|
-
id: "engine.setting.event.BindEvents.delEvent"
|
|
533
|
+
const y = (p, v) => {
|
|
534
|
+
v && n.bindActions[p.eventName] || (n.eventBinding = p, cn());
|
|
535
|
+
}, V = (p) => {
|
|
536
|
+
var C;
|
|
537
|
+
Object.keys(((C = a == null ? void 0 : a.currentSchema) == null ? void 0 : C.props) || {}).indexOf(p.eventName) > -1 && (delete a.currentSchema.props[p.eventName], qe().publish({ topic: "schemaChange", data: { props: a.currentSchema.props } }));
|
|
538
|
+
};
|
|
539
|
+
return {
|
|
540
|
+
state: n,
|
|
541
|
+
isBlock: l,
|
|
542
|
+
isEmpty: i,
|
|
543
|
+
delEvent: (p) => {
|
|
544
|
+
c({
|
|
545
|
+
title: "提示",
|
|
546
|
+
message: `您确定要删除事件 ${p.eventName} 吗?`,
|
|
547
|
+
exec() {
|
|
548
|
+
a.isBlock && _({ linked: p.linked }), V(p);
|
|
549
|
+
}
|
|
550
|
+
});
|
|
1069
551
|
},
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
getBlockEvents: e,
|
|
1075
|
-
getCurrentBlock: i,
|
|
1076
|
-
removeEventLink: g,
|
|
1077
|
-
getMaterial: p,
|
|
1078
|
-
confirm: a,
|
|
1079
|
-
locale: l,
|
|
1080
|
-
highlightMethod: s,
|
|
1081
|
-
commonEvents: u,
|
|
1082
|
-
state: t,
|
|
1083
|
-
isBlock: r,
|
|
1084
|
-
isEmpty: c,
|
|
1085
|
-
renderEventList: m,
|
|
1086
|
-
openActionDialog: f,
|
|
1087
|
-
deleteAction: x,
|
|
1088
|
-
delEvent: D,
|
|
1089
|
-
openCodePanel: N,
|
|
1090
|
-
handleToggleAddEventDialog: w,
|
|
1091
|
-
handleAddEvent: E,
|
|
1092
|
-
useModal: _e,
|
|
1093
|
-
getMergeMeta: P,
|
|
1094
|
-
useCanvas: y,
|
|
1095
|
-
useLayout: V,
|
|
1096
|
-
useBlock: ue,
|
|
1097
|
-
useMaterial: fe,
|
|
1098
|
-
getMetaApi: k,
|
|
1099
|
-
META_APP: C,
|
|
1100
|
-
useMessage: he,
|
|
1101
|
-
i18n: be,
|
|
1102
|
-
BlockLinkEvent: ye,
|
|
1103
|
-
SvgButton: Ee,
|
|
1104
|
-
iconChevronDown: xe,
|
|
1105
|
-
BindEventsDialog: De,
|
|
1106
|
-
openDialog: L,
|
|
1107
|
-
AddEventsDialog: Ce
|
|
1108
|
-
})
|
|
1109
|
-
}), N = h((_) => {
|
|
1110
|
-
_ && n(d.Page).then(() => {
|
|
1111
|
-
s && s(_.ref);
|
|
1112
|
-
});
|
|
1113
|
-
}, {
|
|
1114
|
-
metaData: {
|
|
1115
|
-
id: "engine.setting.event.BindEvents.openCodePanel"
|
|
552
|
+
openCodePanel: (p) => {
|
|
553
|
+
p && o(f.Page).then(() => {
|
|
554
|
+
s && s(p.ref);
|
|
555
|
+
});
|
|
1116
556
|
},
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
openCodePanel: N,
|
|
1137
|
-
handleToggleAddEventDialog: w,
|
|
1138
|
-
handleAddEvent: E,
|
|
1139
|
-
useModal: _e,
|
|
1140
|
-
getMergeMeta: P,
|
|
1141
|
-
useCanvas: y,
|
|
1142
|
-
useLayout: V,
|
|
1143
|
-
useBlock: ue,
|
|
1144
|
-
useMaterial: fe,
|
|
1145
|
-
getMetaApi: k,
|
|
1146
|
-
META_APP: C,
|
|
1147
|
-
useMessage: he,
|
|
1148
|
-
i18n: be,
|
|
1149
|
-
BlockLinkEvent: ye,
|
|
1150
|
-
SvgButton: Ee,
|
|
1151
|
-
iconChevronDown: xe,
|
|
1152
|
-
BindEventsDialog: De,
|
|
1153
|
-
openDialog: L,
|
|
1154
|
-
AddEventsDialog: Ce
|
|
1155
|
-
})
|
|
1156
|
-
}), w = h((_) => {
|
|
1157
|
-
t.showBindEventDialog = _;
|
|
1158
|
-
}, {
|
|
1159
|
-
metaData: {
|
|
1160
|
-
id: "engine.setting.event.BindEvents.handleToggleAddEventDialog"
|
|
557
|
+
openActionDialog: y,
|
|
558
|
+
handleAddEvent: (p) => {
|
|
559
|
+
const { eventName: v, eventDescription: C } = p;
|
|
560
|
+
Object.assign(n.customEvents, {
|
|
561
|
+
[v]: {
|
|
562
|
+
label: {
|
|
563
|
+
zh_CN: C
|
|
564
|
+
},
|
|
565
|
+
description: {
|
|
566
|
+
zh_CN: `${C}的回调函数`
|
|
567
|
+
},
|
|
568
|
+
type: "event",
|
|
569
|
+
functionInfo: {
|
|
570
|
+
params: [],
|
|
571
|
+
returns: {}
|
|
572
|
+
},
|
|
573
|
+
defaultValue: ""
|
|
574
|
+
}
|
|
575
|
+
}), n.showBindEventDialog = !1;
|
|
1161
576
|
},
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
activePlugin: n,
|
|
1165
|
-
pageState: o,
|
|
1166
|
-
getBlockEvents: e,
|
|
1167
|
-
getCurrentBlock: i,
|
|
1168
|
-
removeEventLink: g,
|
|
1169
|
-
getMaterial: p,
|
|
1170
|
-
confirm: a,
|
|
1171
|
-
locale: l,
|
|
1172
|
-
highlightMethod: s,
|
|
1173
|
-
commonEvents: u,
|
|
1174
|
-
state: t,
|
|
1175
|
-
isBlock: r,
|
|
1176
|
-
isEmpty: c,
|
|
1177
|
-
renderEventList: m,
|
|
1178
|
-
openActionDialog: f,
|
|
1179
|
-
deleteAction: x,
|
|
1180
|
-
delEvent: D,
|
|
1181
|
-
openCodePanel: N,
|
|
1182
|
-
handleToggleAddEventDialog: w,
|
|
1183
|
-
handleAddEvent: E,
|
|
1184
|
-
useModal: _e,
|
|
1185
|
-
getMergeMeta: P,
|
|
1186
|
-
useCanvas: y,
|
|
1187
|
-
useLayout: V,
|
|
1188
|
-
useBlock: ue,
|
|
1189
|
-
useMaterial: fe,
|
|
1190
|
-
getMetaApi: k,
|
|
1191
|
-
META_APP: C,
|
|
1192
|
-
useMessage: he,
|
|
1193
|
-
i18n: be,
|
|
1194
|
-
BlockLinkEvent: ye,
|
|
1195
|
-
SvgButton: Ee,
|
|
1196
|
-
iconChevronDown: xe,
|
|
1197
|
-
BindEventsDialog: De,
|
|
1198
|
-
openDialog: L,
|
|
1199
|
-
AddEventsDialog: Ce
|
|
1200
|
-
})
|
|
1201
|
-
}), E = h((_) => {
|
|
1202
|
-
const {
|
|
1203
|
-
eventName: A,
|
|
1204
|
-
eventDescription: O
|
|
1205
|
-
} = _;
|
|
1206
|
-
Object.assign(t.customEvents, {
|
|
1207
|
-
[A]: {
|
|
1208
|
-
label: {
|
|
1209
|
-
zh_CN: O
|
|
1210
|
-
},
|
|
1211
|
-
description: {
|
|
1212
|
-
zh_CN: `${O}的回调函数`
|
|
1213
|
-
},
|
|
1214
|
-
type: "event",
|
|
1215
|
-
functionInfo: {
|
|
1216
|
-
params: [],
|
|
1217
|
-
returns: {}
|
|
1218
|
-
},
|
|
1219
|
-
defaultValue: ""
|
|
1220
|
-
}
|
|
1221
|
-
}), t.showBindEventDialog = !1;
|
|
1222
|
-
}, {
|
|
1223
|
-
metaData: {
|
|
1224
|
-
id: "engine.setting.event.BindEvents.handleAddEvent"
|
|
577
|
+
handleToggleAddEventDialog: (p) => {
|
|
578
|
+
n.showBindEventDialog = p;
|
|
1225
579
|
},
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
activePlugin: n,
|
|
1229
|
-
pageState: o,
|
|
1230
|
-
getBlockEvents: e,
|
|
1231
|
-
getCurrentBlock: i,
|
|
1232
|
-
removeEventLink: g,
|
|
1233
|
-
getMaterial: p,
|
|
1234
|
-
confirm: a,
|
|
1235
|
-
locale: l,
|
|
1236
|
-
highlightMethod: s,
|
|
1237
|
-
commonEvents: u,
|
|
1238
|
-
state: t,
|
|
1239
|
-
isBlock: r,
|
|
1240
|
-
isEmpty: c,
|
|
1241
|
-
renderEventList: m,
|
|
1242
|
-
openActionDialog: f,
|
|
1243
|
-
deleteAction: x,
|
|
1244
|
-
delEvent: D,
|
|
1245
|
-
openCodePanel: N,
|
|
1246
|
-
handleToggleAddEventDialog: w,
|
|
1247
|
-
handleAddEvent: E,
|
|
1248
|
-
useModal: _e,
|
|
1249
|
-
getMergeMeta: P,
|
|
1250
|
-
useCanvas: y,
|
|
1251
|
-
useLayout: V,
|
|
1252
|
-
useBlock: ue,
|
|
1253
|
-
useMaterial: fe,
|
|
1254
|
-
getMetaApi: k,
|
|
1255
|
-
META_APP: C,
|
|
1256
|
-
useMessage: he,
|
|
1257
|
-
i18n: be,
|
|
1258
|
-
BlockLinkEvent: ye,
|
|
1259
|
-
SvgButton: Ee,
|
|
1260
|
-
iconChevronDown: xe,
|
|
1261
|
-
BindEventsDialog: De,
|
|
1262
|
-
openDialog: L,
|
|
1263
|
-
AddEventsDialog: Ce
|
|
1264
|
-
})
|
|
1265
|
-
});
|
|
1266
|
-
return {
|
|
1267
|
-
state: t,
|
|
1268
|
-
isBlock: r,
|
|
1269
|
-
isEmpty: c,
|
|
1270
|
-
delEvent: D,
|
|
1271
|
-
openCodePanel: N,
|
|
1272
|
-
openActionDialog: f,
|
|
1273
|
-
handleAddEvent: E,
|
|
1274
|
-
handleToggleAddEventDialog: w,
|
|
1275
|
-
renderEventList: m,
|
|
1276
|
-
locale: l
|
|
580
|
+
renderEventList: d,
|
|
581
|
+
locale: m
|
|
1277
582
|
};
|
|
1278
583
|
}
|
|
1279
|
-
},
|
|
1280
|
-
function
|
|
1281
|
-
const
|
|
1282
|
-
return
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
584
|
+
}, Cn = { class: "bind-action-list" }, Vn = { class: "popover-head" }, An = { class: "bind-event-list" }, Nn = ["onClick"], Dn = { class: "bind-actions" }, In = { class: "action-item bind-action-item" }, Pn = ["onClick"], Bn = { class: "event-bind" }, Mn = { class: "action-buttons" }, wn = { class: "empty-action" }, Ln = { class: "icon" };
|
|
585
|
+
function On(f, o, a, e, r, _) {
|
|
586
|
+
const h = k("icon-chevron-down"), c = k("tiny-button"), m = k("tiny-popover"), s = k("svg-icon"), x = k("block-link-event"), n = k("svg-button"), l = k("bind-events-dialog"), i = k("add-events-dialog");
|
|
587
|
+
return b(), N(W, null, [
|
|
588
|
+
t("div", Cn, [
|
|
589
|
+
t("div", Vn, [
|
|
590
|
+
u(m, {
|
|
1286
591
|
popperClass: "option-popper setting-advanced-bind-event-list",
|
|
1287
592
|
placement: "bottom-start",
|
|
1288
593
|
trigger: "hover",
|
|
@@ -1290,577 +595,318 @@ function Ut(d, n, o, e, i, g) {
|
|
|
1290
595
|
width: "256",
|
|
1291
596
|
"visible-arrow": !1
|
|
1292
597
|
}, {
|
|
1293
|
-
reference:
|
|
1294
|
-
|
|
1295
|
-
default:
|
|
1296
|
-
|
|
1297
|
-
|
|
598
|
+
reference: E(() => [
|
|
599
|
+
u(c, { class: "bind-event-btn" }, {
|
|
600
|
+
default: E(() => [
|
|
601
|
+
o[2] || (o[2] = t("span", null, "绑定事件", -1)),
|
|
602
|
+
u(h, { class: "icon-chevron-down bind-event-btn-icon" })
|
|
1298
603
|
]),
|
|
1299
604
|
_: 1,
|
|
1300
605
|
__: [2]
|
|
1301
606
|
})
|
|
1302
607
|
]),
|
|
1303
|
-
default:
|
|
1304
|
-
|
|
1305
|
-
(
|
|
1306
|
-
var
|
|
1307
|
-
return
|
|
1308
|
-
key:
|
|
1309
|
-
class:
|
|
1310
|
-
onClick: (
|
|
608
|
+
default: E(() => [
|
|
609
|
+
t("ul", An, [
|
|
610
|
+
(b(!0), N(W, null, ae(e.renderEventList, (d, y) => {
|
|
611
|
+
var V;
|
|
612
|
+
return b(), N("li", {
|
|
613
|
+
key: y,
|
|
614
|
+
class: X(["bind-event-list-item", { "bind-event-list-item-notallow": e.state.bindActions[y] }]),
|
|
615
|
+
onClick: (I) => e.openActionDialog({ eventName: y }, !0)
|
|
1311
616
|
}, [
|
|
1312
|
-
|
|
1313
|
-
], 10,
|
|
617
|
+
t("div", null, B(y) + " | " + B(((V = d == null ? void 0 : d.label) == null ? void 0 : V[e.locale]) || y), 1)
|
|
618
|
+
], 10, Nn);
|
|
1314
619
|
}), 128))
|
|
1315
620
|
])
|
|
1316
621
|
]),
|
|
1317
622
|
_: 1
|
|
1318
623
|
}),
|
|
1319
|
-
|
|
624
|
+
u(c, {
|
|
1320
625
|
class: "title add-custom-event-button bind-action-button-item",
|
|
1321
|
-
onClick:
|
|
626
|
+
onClick: o[0] || (o[0] = (d) => e.handleToggleAddEventDialog(!0))
|
|
1322
627
|
}, {
|
|
1323
|
-
default:
|
|
1324
|
-
|
|
628
|
+
default: E(() => [
|
|
629
|
+
u(s, {
|
|
1325
630
|
name: "add",
|
|
1326
631
|
class: "custom-event-button-icon"
|
|
1327
632
|
}),
|
|
1328
|
-
|
|
633
|
+
o[3] || (o[3] = t("span", { class: "custom-event-button-text" }, "添加新事件", -1))
|
|
1329
634
|
]),
|
|
1330
635
|
_: 1,
|
|
1331
636
|
__: [3]
|
|
1332
637
|
})
|
|
1333
638
|
]),
|
|
1334
|
-
|
|
1335
|
-
(
|
|
1336
|
-
var
|
|
1337
|
-
return
|
|
1338
|
-
key:
|
|
639
|
+
he(t("ul", Dn, [
|
|
640
|
+
(b(!0), N(W, null, ae(e.state.bindActions, (d) => {
|
|
641
|
+
var y, V;
|
|
642
|
+
return b(), N("li", {
|
|
643
|
+
key: d.eventName
|
|
1339
644
|
}, [
|
|
1340
|
-
|
|
1341
|
-
|
|
645
|
+
t("div", In, [
|
|
646
|
+
t("div", {
|
|
1342
647
|
class: "binding-name",
|
|
1343
|
-
onClick: (
|
|
648
|
+
onClick: (I) => e.openActionDialog(d)
|
|
1344
649
|
}, [
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
650
|
+
t("div", null, [
|
|
651
|
+
J(B(d.eventName), 1),
|
|
652
|
+
t("span", null, B((V = (y = e.renderEventList[d.eventName]) == null ? void 0 : y.label) == null ? void 0 : V[e.locale]), 1)
|
|
1348
653
|
]),
|
|
1349
|
-
|
|
1350
|
-
class:
|
|
1351
|
-
},
|
|
1352
|
-
|
|
1353
|
-
], 8,
|
|
1354
|
-
|
|
1355
|
-
e.isBlock ? (
|
|
654
|
+
t("div", {
|
|
655
|
+
class: X({ linked: d.linked })
|
|
656
|
+
}, B(d.linkedEventName), 3),
|
|
657
|
+
t("span", Bn, B(d.ref), 1)
|
|
658
|
+
], 8, Pn),
|
|
659
|
+
t("div", Mn, [
|
|
660
|
+
e.isBlock ? (b(), O(x, {
|
|
1356
661
|
key: 0,
|
|
1357
|
-
data:
|
|
1358
|
-
}, null, 8, ["data"])) :
|
|
1359
|
-
|
|
662
|
+
data: d
|
|
663
|
+
}, null, 8, ["data"])) : Q("", !0),
|
|
664
|
+
u(n, {
|
|
1360
665
|
name: "plugin-icon-page-schema",
|
|
1361
666
|
tips: "定位到代码",
|
|
1362
667
|
placement: "top",
|
|
1363
668
|
hoverBgColor: !1,
|
|
1364
|
-
onClick: (
|
|
669
|
+
onClick: (I) => e.openCodePanel(d)
|
|
1365
670
|
}, null, 8, ["onClick"]),
|
|
1366
|
-
|
|
671
|
+
u(n, {
|
|
1367
672
|
name: "setting",
|
|
1368
673
|
hoverBgColor: !1,
|
|
1369
|
-
onClick: (
|
|
674
|
+
onClick: (I) => e.openActionDialog(d, !1)
|
|
1370
675
|
}, null, 8, ["onClick"]),
|
|
1371
|
-
|
|
676
|
+
u(n, {
|
|
1372
677
|
name: "delete",
|
|
1373
678
|
hoverBgColor: !1,
|
|
1374
|
-
onClick: (
|
|
679
|
+
onClick: (I) => e.delEvent(d)
|
|
1375
680
|
}, null, 8, ["onClick"])
|
|
1376
681
|
])
|
|
1377
682
|
])
|
|
1378
683
|
]);
|
|
1379
684
|
}), 128))
|
|
1380
685
|
], 512), [
|
|
1381
|
-
[
|
|
686
|
+
[be, !e.isEmpty]
|
|
1382
687
|
]),
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
688
|
+
he(t("div", wn, [
|
|
689
|
+
t("div", Ln, [
|
|
690
|
+
u(s, {
|
|
1386
691
|
name: "empty-action",
|
|
1387
692
|
class: "empty-action-icon"
|
|
1388
693
|
})
|
|
1389
694
|
]),
|
|
1390
|
-
|
|
695
|
+
o[4] || (o[4] = t("div", { class: "center" }, "支持添加原生DOM事件,然后点击 绑定事件 为画布所选元素增加事件", -1))
|
|
1391
696
|
], 512), [
|
|
1392
|
-
[
|
|
697
|
+
[be, e.isEmpty]
|
|
1393
698
|
])
|
|
1394
699
|
]),
|
|
1395
|
-
|
|
700
|
+
u(l, {
|
|
1396
701
|
eventBinding: e.state.eventBinding
|
|
1397
702
|
}, null, 8, ["eventBinding"]),
|
|
1398
|
-
|
|
703
|
+
u(i, {
|
|
1399
704
|
visible: e.state.showBindEventDialog,
|
|
1400
705
|
componentEvents: e.renderEventList,
|
|
1401
|
-
onCloseDialog:
|
|
706
|
+
onCloseDialog: o[1] || (o[1] = (d) => e.handleToggleAddEventDialog(!1)),
|
|
1402
707
|
onAddEvent: e.handleAddEvent
|
|
1403
708
|
}, null, 8, ["visible", "componentEvents", "onAddEvent"])
|
|
1404
709
|
], 64);
|
|
1405
710
|
}
|
|
1406
|
-
const
|
|
1407
|
-
DEFAULT_LOOP_NAME: F
|
|
1408
|
-
} = me, {
|
|
1409
|
-
string2Obj: ce
|
|
1410
|
-
} = ge, zt = {
|
|
711
|
+
const Sn = /* @__PURE__ */ H(kn, [["render", On], ["__scopeId", "data-v-3bfab6f4"]]), { DEFAULT_LOOP_NAME: F } = dn, { string2Obj: Tn } = rn, Un = {
|
|
1411
712
|
components: {
|
|
1412
|
-
SwitchConfigurator:
|
|
1413
|
-
TinyTooltip:
|
|
1414
|
-
VariableConfigurator:
|
|
1415
|
-
InputConfigurator:
|
|
1416
|
-
CodeConfigurator:
|
|
713
|
+
SwitchConfigurator: ln,
|
|
714
|
+
TinyTooltip: ze,
|
|
715
|
+
VariableConfigurator: an,
|
|
716
|
+
InputConfigurator: sn,
|
|
717
|
+
CodeConfigurator: tn
|
|
1417
718
|
},
|
|
1418
719
|
inheritAttrs: !1,
|
|
1419
720
|
setup() {
|
|
1420
|
-
const {
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
return ((r = (t = z().getSchema()) == null ? void 0 : t.loopArgs) == null ? void 0 : r[1]) || F.INDEX;
|
|
1428
|
-
}, {
|
|
1429
|
-
metaData: {
|
|
1430
|
-
id: "engine.setting.event.AdvanceConfig.getIndexName"
|
|
1431
|
-
},
|
|
1432
|
-
ctx: () => ({
|
|
1433
|
-
pageState: d,
|
|
1434
|
-
condition: n,
|
|
1435
|
-
isBind: o,
|
|
1436
|
-
getIndexName: e,
|
|
1437
|
-
state: i,
|
|
1438
|
-
setLoopKey: g,
|
|
1439
|
-
openEditor: p,
|
|
1440
|
-
setConfig: a,
|
|
1441
|
-
setLoopIndex: l,
|
|
1442
|
-
setLoop: s,
|
|
1443
|
-
setLoopItem: u,
|
|
1444
|
-
CodeConfigurator: ae,
|
|
1445
|
-
InputConfigurator: se,
|
|
1446
|
-
SwitchConfigurator: de,
|
|
1447
|
-
VariableConfigurator: le,
|
|
1448
|
-
useProperties: z,
|
|
1449
|
-
useCanvas: y,
|
|
1450
|
-
PROP_DATA_TYPE: G,
|
|
1451
|
-
constants: me,
|
|
1452
|
-
utils: ge,
|
|
1453
|
-
DEFAULT_LOOP_NAME: F,
|
|
1454
|
-
string2Obj: ce
|
|
1455
|
-
})
|
|
1456
|
-
}), i = we({
|
|
721
|
+
const { pageState: f } = j(), o = K(!1), a = q(() => {
|
|
722
|
+
var n;
|
|
723
|
+
return ((n = o.value) == null ? void 0 : n.type) === G.JSEXPRESSION;
|
|
724
|
+
}), e = () => {
|
|
725
|
+
var n, l;
|
|
726
|
+
return ((l = (n = $().getSchema()) == null ? void 0 : n.loopArgs) == null ? void 0 : l[1]) || F.INDEX;
|
|
727
|
+
}, r = Y({
|
|
1457
728
|
loopData: {
|
|
1458
729
|
type: G.JSEXPRESSION,
|
|
1459
730
|
value: "[]"
|
|
1460
731
|
},
|
|
1461
732
|
loopItem: "item",
|
|
1462
733
|
loopIndex: "index",
|
|
1463
|
-
isLoop:
|
|
1464
|
-
var
|
|
1465
|
-
return ((
|
|
734
|
+
isLoop: q(() => {
|
|
735
|
+
var n;
|
|
736
|
+
return ((n = r.loopData) == null ? void 0 : n.type) === G.JSEXPRESSION;
|
|
1466
737
|
}),
|
|
1467
738
|
loopKey: "",
|
|
1468
739
|
shouldUpdate: !1
|
|
1469
740
|
});
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
} =
|
|
1481
|
-
if (!
|
|
741
|
+
ye(
|
|
742
|
+
() => [f == null ? void 0 : f.currentSchema, r.shouldUpdate],
|
|
743
|
+
([n]) => {
|
|
744
|
+
var l, i, d, y;
|
|
745
|
+
o.value = (n == null ? void 0 : n.condition) === void 0 ? !0 : n == null ? void 0 : n.condition, r.loopData = n == null ? void 0 : n.loop, r.loopItem = ((l = n == null ? void 0 : n.loopArgs) == null ? void 0 : l[0]) || "", r.loopIndex = ((i = n == null ? void 0 : n.loopArgs) == null ? void 0 : i[1]) || "", r.loopKey = ((y = (d = n == null ? void 0 : n.props) == null ? void 0 : d.key) == null ? void 0 : y.value) || "";
|
|
746
|
+
}
|
|
747
|
+
);
|
|
748
|
+
const _ = (n = "") => {
|
|
749
|
+
var I;
|
|
750
|
+
n = n.replace(/\s*/g, "");
|
|
751
|
+
const { getSchema: l, setProp: i } = $(), d = l();
|
|
752
|
+
if (!d)
|
|
1482
753
|
return;
|
|
1483
|
-
const
|
|
1484
|
-
let
|
|
1485
|
-
|
|
754
|
+
const y = Number(n).toString() !== "NaN";
|
|
755
|
+
let V = (I = d.props) == null ? void 0 : I.key;
|
|
756
|
+
n && !y && (V = {
|
|
1486
757
|
type: G.JSEXPRESSION,
|
|
1487
|
-
value:
|
|
1488
|
-
}),
|
|
758
|
+
value: n
|
|
759
|
+
}), n || (r.isLoop ? V = {
|
|
1489
760
|
type: G.JSEXPRESSION,
|
|
1490
761
|
value: e()
|
|
1491
|
-
} :
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
},
|
|
1496
|
-
ctx: () => ({
|
|
1497
|
-
pageState: d,
|
|
1498
|
-
condition: n,
|
|
1499
|
-
isBind: o,
|
|
1500
|
-
getIndexName: e,
|
|
1501
|
-
state: i,
|
|
1502
|
-
setLoopKey: g,
|
|
1503
|
-
openEditor: p,
|
|
1504
|
-
setConfig: a,
|
|
1505
|
-
setLoopIndex: l,
|
|
1506
|
-
setLoop: s,
|
|
1507
|
-
setLoopItem: u,
|
|
1508
|
-
CodeConfigurator: ae,
|
|
1509
|
-
InputConfigurator: se,
|
|
1510
|
-
SwitchConfigurator: de,
|
|
1511
|
-
VariableConfigurator: le,
|
|
1512
|
-
useProperties: z,
|
|
1513
|
-
useCanvas: y,
|
|
1514
|
-
PROP_DATA_TYPE: G,
|
|
1515
|
-
constants: me,
|
|
1516
|
-
utils: ge,
|
|
1517
|
-
DEFAULT_LOOP_NAME: F,
|
|
1518
|
-
string2Obj: ce
|
|
1519
|
-
})
|
|
1520
|
-
});
|
|
1521
|
-
Ze([() => i.isLoop, () => i.loopIndex], () => {
|
|
1522
|
-
!i.loopKey && i.isLoop && g(e()), i.isLoop || g("");
|
|
762
|
+
} : V = ""), i("key", V);
|
|
763
|
+
};
|
|
764
|
+
ye([() => r.isLoop, () => r.loopIndex], () => {
|
|
765
|
+
!r.loopKey && r.isLoop && _(e()), r.isLoop || _("");
|
|
1523
766
|
});
|
|
1524
|
-
const
|
|
1525
|
-
var
|
|
1526
|
-
|
|
1527
|
-
}, {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
},
|
|
1531
|
-
ctx: () => ({
|
|
1532
|
-
pageState: d,
|
|
1533
|
-
condition: n,
|
|
1534
|
-
isBind: o,
|
|
1535
|
-
getIndexName: e,
|
|
1536
|
-
state: i,
|
|
1537
|
-
setLoopKey: g,
|
|
1538
|
-
openEditor: p,
|
|
1539
|
-
setConfig: a,
|
|
1540
|
-
setLoopIndex: l,
|
|
1541
|
-
setLoop: s,
|
|
1542
|
-
setLoopItem: u,
|
|
1543
|
-
CodeConfigurator: ae,
|
|
1544
|
-
InputConfigurator: se,
|
|
1545
|
-
SwitchConfigurator: de,
|
|
1546
|
-
VariableConfigurator: le,
|
|
1547
|
-
useProperties: z,
|
|
1548
|
-
useCanvas: y,
|
|
1549
|
-
PROP_DATA_TYPE: G,
|
|
1550
|
-
constants: me,
|
|
1551
|
-
utils: ge,
|
|
1552
|
-
DEFAULT_LOOP_NAME: F,
|
|
1553
|
-
string2Obj: ce
|
|
1554
|
-
})
|
|
1555
|
-
}), a = h((t) => {
|
|
1556
|
-
const {
|
|
1557
|
-
getSchema: r
|
|
1558
|
-
} = z(), c = r();
|
|
1559
|
-
if (!c)
|
|
767
|
+
const h = () => {
|
|
768
|
+
var n;
|
|
769
|
+
r.loopData = (n = $().getSchema()) == null ? void 0 : n.loop;
|
|
770
|
+
}, c = (n) => {
|
|
771
|
+
const { getSchema: l } = $(), i = l();
|
|
772
|
+
if (!i)
|
|
1560
773
|
return;
|
|
1561
|
-
const {
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
if (t === !1 || t != null && t.type)
|
|
1565
|
-
m({
|
|
1566
|
-
type: "updateAttributes",
|
|
1567
|
-
id: c.id,
|
|
1568
|
-
value: {
|
|
1569
|
-
condition: t
|
|
1570
|
-
}
|
|
1571
|
-
});
|
|
774
|
+
const { operateNode: d } = j();
|
|
775
|
+
if (n === !1 || n != null && n.type)
|
|
776
|
+
d({ type: "updateAttributes", id: i.id, value: { condition: n } });
|
|
1572
777
|
else {
|
|
1573
|
-
const {
|
|
1574
|
-
|
|
1575
|
-
children: x,
|
|
1576
|
-
...D
|
|
1577
|
-
} = c;
|
|
1578
|
-
m({
|
|
1579
|
-
type: "updateAttributes",
|
|
1580
|
-
id: c.id,
|
|
1581
|
-
value: {
|
|
1582
|
-
...D
|
|
1583
|
-
},
|
|
1584
|
-
overwrite: !0
|
|
1585
|
-
});
|
|
778
|
+
const { condition: y, children: V, ...I } = i;
|
|
779
|
+
d({ type: "updateAttributes", id: i.id, value: { ...I }, overwrite: !0 });
|
|
1586
780
|
}
|
|
1587
|
-
|
|
1588
|
-
}, {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
useProperties: z,
|
|
1609
|
-
useCanvas: y,
|
|
1610
|
-
PROP_DATA_TYPE: G,
|
|
1611
|
-
constants: me,
|
|
1612
|
-
utils: ge,
|
|
1613
|
-
DEFAULT_LOOP_NAME: F,
|
|
1614
|
-
string2Obj: ce
|
|
1615
|
-
})
|
|
1616
|
-
}), l = h((t) => {
|
|
1617
|
-
const r = z().getSchema();
|
|
1618
|
-
let c = r.loopArgs;
|
|
1619
|
-
const {
|
|
1620
|
-
operateNode: m
|
|
1621
|
-
} = y();
|
|
1622
|
-
c ? c[1] = t || F.INDEX : c = [F.ITEM, t], m({
|
|
1623
|
-
type: "updateAttributes",
|
|
1624
|
-
id: r.id,
|
|
1625
|
-
value: {
|
|
1626
|
-
loopArgs: c
|
|
781
|
+
j().canvasApi.value.updateRect(), o.value = n;
|
|
782
|
+
}, m = (n) => {
|
|
783
|
+
const l = $().getSchema();
|
|
784
|
+
let i = l.loopArgs;
|
|
785
|
+
const { operateNode: d } = j();
|
|
786
|
+
i ? i[1] = n || F.INDEX : i = [F.ITEM, n], d({ type: "updateAttributes", id: l.id, value: { loopArgs: i } });
|
|
787
|
+
};
|
|
788
|
+
return {
|
|
789
|
+
condition: o,
|
|
790
|
+
setConfig: c,
|
|
791
|
+
isBind: a,
|
|
792
|
+
state: r,
|
|
793
|
+
setLoop: (n) => {
|
|
794
|
+
const { operateNode: l } = j(), { getSchema: i } = $(), d = i();
|
|
795
|
+
if (n) {
|
|
796
|
+
const y = n != null && n.type ? n : Tn(n);
|
|
797
|
+
l({ type: "updateAttributes", id: d.id, value: { loop: y } }), m(F.INDEX);
|
|
798
|
+
} else {
|
|
799
|
+
_();
|
|
800
|
+
const { loop: y, loopArgs: V, children: I, ...te } = d;
|
|
801
|
+
l({ type: "updateAttributes", id: d.id, value: te, overwrite: !0 });
|
|
1627
802
|
}
|
|
1628
|
-
|
|
1629
|
-
}, {
|
|
1630
|
-
metaData: {
|
|
1631
|
-
id: "engine.setting.event.AdvanceConfig.setLoopIndex"
|
|
803
|
+
r.shouldUpdate = !r.shouldUpdate;
|
|
1632
804
|
},
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
state: i,
|
|
1639
|
-
setLoopKey: g,
|
|
1640
|
-
openEditor: p,
|
|
1641
|
-
setConfig: a,
|
|
1642
|
-
setLoopIndex: l,
|
|
1643
|
-
setLoop: s,
|
|
1644
|
-
setLoopItem: u,
|
|
1645
|
-
CodeConfigurator: ae,
|
|
1646
|
-
InputConfigurator: se,
|
|
1647
|
-
SwitchConfigurator: de,
|
|
1648
|
-
VariableConfigurator: le,
|
|
1649
|
-
useProperties: z,
|
|
1650
|
-
useCanvas: y,
|
|
1651
|
-
PROP_DATA_TYPE: G,
|
|
1652
|
-
constants: me,
|
|
1653
|
-
utils: ge,
|
|
1654
|
-
DEFAULT_LOOP_NAME: F,
|
|
1655
|
-
string2Obj: ce
|
|
1656
|
-
})
|
|
1657
|
-
}), s = h((t) => {
|
|
1658
|
-
const {
|
|
1659
|
-
operateNode: r
|
|
1660
|
-
} = y(), {
|
|
1661
|
-
getSchema: c
|
|
1662
|
-
} = z(), m = c();
|
|
1663
|
-
if (t) {
|
|
1664
|
-
const f = t != null && t.type ? t : ce(t);
|
|
1665
|
-
r({
|
|
1666
|
-
type: "updateAttributes",
|
|
1667
|
-
id: m.id,
|
|
1668
|
-
value: {
|
|
1669
|
-
loop: f
|
|
1670
|
-
}
|
|
1671
|
-
}), l(F.INDEX);
|
|
1672
|
-
} else {
|
|
1673
|
-
g();
|
|
1674
|
-
const {
|
|
1675
|
-
loop: f,
|
|
1676
|
-
loopArgs: x,
|
|
1677
|
-
children: D,
|
|
1678
|
-
...N
|
|
1679
|
-
} = m;
|
|
1680
|
-
r({
|
|
1681
|
-
type: "updateAttributes",
|
|
1682
|
-
id: m.id,
|
|
1683
|
-
value: N,
|
|
1684
|
-
overwrite: !0
|
|
1685
|
-
});
|
|
1686
|
-
}
|
|
1687
|
-
i.shouldUpdate = !i.shouldUpdate;
|
|
1688
|
-
}, {
|
|
1689
|
-
metaData: {
|
|
1690
|
-
id: "engine.setting.event.AdvanceConfig.setLoop"
|
|
1691
|
-
},
|
|
1692
|
-
ctx: () => ({
|
|
1693
|
-
pageState: d,
|
|
1694
|
-
condition: n,
|
|
1695
|
-
isBind: o,
|
|
1696
|
-
getIndexName: e,
|
|
1697
|
-
state: i,
|
|
1698
|
-
setLoopKey: g,
|
|
1699
|
-
openEditor: p,
|
|
1700
|
-
setConfig: a,
|
|
1701
|
-
setLoopIndex: l,
|
|
1702
|
-
setLoop: s,
|
|
1703
|
-
setLoopItem: u,
|
|
1704
|
-
CodeConfigurator: ae,
|
|
1705
|
-
InputConfigurator: se,
|
|
1706
|
-
SwitchConfigurator: de,
|
|
1707
|
-
VariableConfigurator: le,
|
|
1708
|
-
useProperties: z,
|
|
1709
|
-
useCanvas: y,
|
|
1710
|
-
PROP_DATA_TYPE: G,
|
|
1711
|
-
constants: me,
|
|
1712
|
-
utils: ge,
|
|
1713
|
-
DEFAULT_LOOP_NAME: F,
|
|
1714
|
-
string2Obj: ce
|
|
1715
|
-
})
|
|
1716
|
-
}), u = h((t) => {
|
|
1717
|
-
const r = z().getSchema();
|
|
1718
|
-
let c = r.loopArgs;
|
|
1719
|
-
const {
|
|
1720
|
-
operateNode: m
|
|
1721
|
-
} = y();
|
|
1722
|
-
c ? c[0] = t || F.ITEM : c = [t, F.INDEX], m({
|
|
1723
|
-
type: "updateAttributes",
|
|
1724
|
-
id: r.id,
|
|
1725
|
-
value: {
|
|
1726
|
-
loopArgs: c
|
|
1727
|
-
}
|
|
1728
|
-
});
|
|
1729
|
-
}, {
|
|
1730
|
-
metaData: {
|
|
1731
|
-
id: "engine.setting.event.AdvanceConfig.setLoopItem"
|
|
805
|
+
setLoopItem: (n) => {
|
|
806
|
+
const l = $().getSchema();
|
|
807
|
+
let i = l.loopArgs;
|
|
808
|
+
const { operateNode: d } = j();
|
|
809
|
+
i ? i[0] = n || F.ITEM : i = [n, F.INDEX], d({ type: "updateAttributes", id: l.id, value: { loopArgs: i } });
|
|
1732
810
|
},
|
|
1733
|
-
ctx: () => ({
|
|
1734
|
-
pageState: d,
|
|
1735
|
-
condition: n,
|
|
1736
|
-
isBind: o,
|
|
1737
|
-
getIndexName: e,
|
|
1738
|
-
state: i,
|
|
1739
|
-
setLoopKey: g,
|
|
1740
|
-
openEditor: p,
|
|
1741
|
-
setConfig: a,
|
|
1742
|
-
setLoopIndex: l,
|
|
1743
|
-
setLoop: s,
|
|
1744
|
-
setLoopItem: u,
|
|
1745
|
-
CodeConfigurator: ae,
|
|
1746
|
-
InputConfigurator: se,
|
|
1747
|
-
SwitchConfigurator: de,
|
|
1748
|
-
VariableConfigurator: le,
|
|
1749
|
-
useProperties: z,
|
|
1750
|
-
useCanvas: y,
|
|
1751
|
-
PROP_DATA_TYPE: G,
|
|
1752
|
-
constants: me,
|
|
1753
|
-
utils: ge,
|
|
1754
|
-
DEFAULT_LOOP_NAME: F,
|
|
1755
|
-
string2Obj: ce
|
|
1756
|
-
})
|
|
1757
|
-
});
|
|
1758
|
-
return {
|
|
1759
|
-
condition: n,
|
|
1760
|
-
setConfig: a,
|
|
1761
|
-
isBind: o,
|
|
1762
|
-
state: i,
|
|
1763
|
-
setLoop: s,
|
|
1764
|
-
setLoopItem: u,
|
|
1765
811
|
DEFAULT_LOOP_NAME: F,
|
|
1766
|
-
openEditor:
|
|
1767
|
-
setLoopIndex:
|
|
1768
|
-
setLoopKey:
|
|
812
|
+
openEditor: h,
|
|
813
|
+
setLoopIndex: m,
|
|
814
|
+
setLoopKey: _,
|
|
1769
815
|
getIndexName: e
|
|
1770
816
|
};
|
|
1771
817
|
}
|
|
1772
|
-
},
|
|
1773
|
-
function
|
|
1774
|
-
var
|
|
1775
|
-
const
|
|
1776
|
-
return
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
e.isBind ? (
|
|
818
|
+
}, jn = { class: "advanced-config-container" }, zn = { class: "advnce-config" }, Rn = { class: "advanced-config-form-item" }, $n = ["title"], Fn = { class: "advnce-config loop-data-item" }, Jn = { class: "advanced-config-form-item" }, Xn = ["title"], Kn = { class: "advnce-config" }, Hn = { class: "advanced-config-form-item" }, Gn = { class: "advnce-config" }, qn = { class: "advanced-config-form-item" }, Yn = { class: "advnce-config" }, Zn = { class: "advanced-config-form-item" };
|
|
819
|
+
function Wn(f, o, a, e, r, _) {
|
|
820
|
+
var n, l;
|
|
821
|
+
const h = k("switch-configurator"), c = k("variable-configurator"), m = k("code-configurator"), s = k("input-configurator"), x = k("tiny-tooltip");
|
|
822
|
+
return b(), N("div", jn, [
|
|
823
|
+
t("div", zn, [
|
|
824
|
+
o[6] || (o[6] = t("label", { class: "text-ellipsis-multiple" }, "是否渲染", -1)),
|
|
825
|
+
t("div", Rn, [
|
|
826
|
+
e.isBind ? (b(), N("div", {
|
|
1781
827
|
key: 1,
|
|
1782
828
|
class: "binding-state text-ellipsis-multiple",
|
|
1783
829
|
title: e.condition.value
|
|
1784
|
-
}, " 已绑定:" +
|
|
830
|
+
}, " 已绑定:" + B(e.condition.value), 9, $n)) : (b(), O(h, {
|
|
1785
831
|
key: 0,
|
|
1786
832
|
modelValue: e.condition,
|
|
1787
833
|
"onUpdate:modelValue": e.setConfig
|
|
1788
834
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])),
|
|
1789
|
-
|
|
835
|
+
u(c, {
|
|
1790
836
|
modelValue: e.condition,
|
|
1791
837
|
"onUpdate:modelValue": [
|
|
1792
|
-
|
|
838
|
+
o[0] || (o[0] = (i) => e.condition = i),
|
|
1793
839
|
e.setConfig
|
|
1794
840
|
],
|
|
1795
841
|
name: "advance"
|
|
1796
842
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
1797
843
|
])
|
|
1798
844
|
]),
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
e.state.isLoop ? (
|
|
845
|
+
t("div", Fn, [
|
|
846
|
+
o[7] || (o[7] = t("label", { class: "text-ellipsis-multiple" }, "循环数据", -1)),
|
|
847
|
+
t("div", Jn, [
|
|
848
|
+
e.state.isLoop ? (b(), N("div", {
|
|
1803
849
|
key: 1,
|
|
1804
850
|
class: "binding-state text-ellipsis-multiple",
|
|
1805
|
-
title: (
|
|
1806
|
-
}, " 已绑定:" +
|
|
851
|
+
title: (n = e.state.loopData) == null ? void 0 : n.value
|
|
852
|
+
}, " 已绑定:" + B((l = e.state.loopData) == null ? void 0 : l.value), 9, Xn)) : (b(), O(m, {
|
|
1807
853
|
key: 0,
|
|
1808
854
|
modelValue: e.state.loopData,
|
|
1809
855
|
"onUpdate:modelValue": [
|
|
1810
|
-
|
|
856
|
+
o[1] || (o[1] = (i) => e.state.loopData = i),
|
|
1811
857
|
e.setLoop
|
|
1812
858
|
],
|
|
1813
859
|
"data-type": "JSExpression",
|
|
1814
860
|
onOpen: e.openEditor
|
|
1815
861
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onOpen"])),
|
|
1816
|
-
|
|
862
|
+
u(c, {
|
|
1817
863
|
modelValue: e.state.loopData,
|
|
1818
864
|
"onUpdate:modelValue": [
|
|
1819
|
-
|
|
865
|
+
o[2] || (o[2] = (i) => e.state.loopData = i),
|
|
1820
866
|
e.setLoop
|
|
1821
867
|
],
|
|
1822
868
|
name: "advance"
|
|
1823
869
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
1824
870
|
])
|
|
1825
871
|
]),
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
872
|
+
t("div", Kn, [
|
|
873
|
+
o[8] || (o[8] = t("label", { class: "text-ellipsis-multiple" }, "迭代变量名", -1)),
|
|
874
|
+
t("div", Hn, [
|
|
875
|
+
u(s, {
|
|
1830
876
|
modelValue: e.state.loopItem,
|
|
1831
877
|
"onUpdate:modelValue": [
|
|
1832
|
-
|
|
878
|
+
o[3] || (o[3] = (i) => e.state.loopItem = i),
|
|
1833
879
|
e.setLoopItem
|
|
1834
880
|
],
|
|
1835
881
|
placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.ITEM}`
|
|
1836
882
|
}, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
|
|
1837
883
|
])
|
|
1838
884
|
]),
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
885
|
+
t("div", Gn, [
|
|
886
|
+
o[9] || (o[9] = t("label", { class: "text-ellipsis-multiple" }, "索引变量名", -1)),
|
|
887
|
+
t("div", qn, [
|
|
888
|
+
u(s, {
|
|
1843
889
|
modelValue: e.state.loopIndex,
|
|
1844
890
|
"onUpdate:modelValue": [
|
|
1845
|
-
|
|
891
|
+
o[4] || (o[4] = (i) => e.state.loopIndex = i),
|
|
1846
892
|
e.setLoopIndex
|
|
1847
893
|
],
|
|
1848
894
|
placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.INDEX}`
|
|
1849
895
|
}, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
|
|
1850
896
|
])
|
|
1851
897
|
]),
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
898
|
+
t("div", Yn, [
|
|
899
|
+
o[10] || (o[10] = t("label", { class: "text-ellipsis-multiple" }, "key", -1)),
|
|
900
|
+
t("div", Zn, [
|
|
901
|
+
u(x, {
|
|
1856
902
|
content: "建议填写循环项中的唯一值(如item.id),如果填写为数字将不保存",
|
|
1857
903
|
effect: "light"
|
|
1858
904
|
}, {
|
|
1859
|
-
default:
|
|
1860
|
-
|
|
905
|
+
default: E(() => [
|
|
906
|
+
u(s, {
|
|
1861
907
|
modelValue: e.state.loopKey,
|
|
1862
908
|
"onUpdate:modelValue": [
|
|
1863
|
-
|
|
909
|
+
o[5] || (o[5] = (i) => e.state.loopKey = i),
|
|
1864
910
|
e.setLoopKey
|
|
1865
911
|
],
|
|
1866
912
|
placeholder: `默认为索引名:${e.getIndexName()}`
|
|
@@ -1872,46 +918,44 @@ function en(d, n, o, e, i, g) {
|
|
|
1872
918
|
])
|
|
1873
919
|
]);
|
|
1874
920
|
}
|
|
1875
|
-
const
|
|
921
|
+
const Qn = /* @__PURE__ */ H(Un, [["render", Wn], ["__scopeId", "data-v-40bd3762"]]), eo = {
|
|
1876
922
|
__name: "Main",
|
|
1877
923
|
props: {
|
|
1878
924
|
fixedPanels: Array
|
|
1879
925
|
},
|
|
1880
926
|
emits: [],
|
|
1881
|
-
setup(
|
|
1882
|
-
const
|
|
1883
|
-
|
|
1884
|
-
} = V(), g = we({
|
|
1885
|
-
emitEvent: n
|
|
927
|
+
setup(f, { emit: o }) {
|
|
928
|
+
const a = K(["bindEvent", "advancedConfig"]), { PLUGIN_NAME: e } = re(), _ = Y({
|
|
929
|
+
emitEvent: o
|
|
1886
930
|
});
|
|
1887
|
-
return
|
|
931
|
+
return Ve("panelState", _), (h, c) => (b(), O(D(Qe), {
|
|
1888
932
|
title: "高级",
|
|
1889
|
-
"fixed-panels":
|
|
1890
|
-
"fixed-name":
|
|
933
|
+
"fixed-panels": f.fixedPanels,
|
|
934
|
+
"fixed-name": D(e).Event,
|
|
1891
935
|
"header-margin-bottom": 0,
|
|
1892
|
-
onClose:
|
|
936
|
+
onClose: c[1] || (c[1] = (m) => h.$emit("close"))
|
|
1893
937
|
}, {
|
|
1894
|
-
content:
|
|
1895
|
-
|
|
1896
|
-
modelValue:
|
|
1897
|
-
"onUpdate:modelValue":
|
|
938
|
+
content: E(() => [
|
|
939
|
+
u(D(Re), {
|
|
940
|
+
modelValue: a.value,
|
|
941
|
+
"onUpdate:modelValue": c[0] || (c[0] = (m) => a.value = m)
|
|
1898
942
|
}, {
|
|
1899
|
-
default:
|
|
1900
|
-
|
|
943
|
+
default: E(() => [
|
|
944
|
+
u(D(xe), {
|
|
1901
945
|
title: "事件绑定",
|
|
1902
946
|
name: "bindEvent"
|
|
1903
947
|
}, {
|
|
1904
|
-
default:
|
|
1905
|
-
|
|
948
|
+
default: E(() => [
|
|
949
|
+
u(Sn)
|
|
1906
950
|
]),
|
|
1907
951
|
_: 1
|
|
1908
952
|
}),
|
|
1909
|
-
|
|
953
|
+
u(D(xe), {
|
|
1910
954
|
title: "高级配置",
|
|
1911
955
|
name: "advancedConfig"
|
|
1912
956
|
}, {
|
|
1913
|
-
default:
|
|
1914
|
-
|
|
957
|
+
default: E(() => [
|
|
958
|
+
u(Qn)
|
|
1915
959
|
]),
|
|
1916
960
|
_: 1
|
|
1917
961
|
})
|
|
@@ -1922,222 +966,114 @@ const tn = /* @__PURE__ */ Ie(zt, [["render", en], ["__scopeId", "data-v-275ffc6
|
|
|
1922
966
|
_: 1
|
|
1923
967
|
}, 8, ["fixed-panels", "fixed-name"]));
|
|
1924
968
|
}
|
|
1925
|
-
},
|
|
1926
|
-
default: "选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)",
|
|
969
|
+
}, Pe = "newMethod", no = /[^0-9a-zA-Z_$]/, oo = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, se = {
|
|
1927
970
|
exist: "方法名称已存在",
|
|
1928
971
|
ruleInvalid: "请输入有效的方法名,可以由字母、数字、下划线、$ 符号组成,不能以数字开头",
|
|
1929
972
|
empty: "方法名称不能为空"
|
|
1930
|
-
},
|
|
973
|
+
}, to = {
|
|
1931
974
|
components: {
|
|
1932
|
-
MonacoEditor:
|
|
1933
|
-
TinyInput:
|
|
1934
|
-
TinyCheckbox:
|
|
975
|
+
MonacoEditor: en,
|
|
976
|
+
TinyInput: le,
|
|
977
|
+
TinyCheckbox: $e
|
|
1935
978
|
},
|
|
1936
979
|
props: {
|
|
1937
980
|
dialogVisible: Boolean
|
|
1938
981
|
},
|
|
1939
982
|
setup() {
|
|
1940
|
-
const {
|
|
1941
|
-
getMethodNameList: d
|
|
1942
|
-
} = k(C.Page), n = ot("context"), o = {
|
|
983
|
+
const { getMethodNameList: f } = ne(oe.Page), o = Ne("context"), a = {
|
|
1943
984
|
language: "json",
|
|
1944
985
|
lineNumbers: !1,
|
|
1945
986
|
minimap: {
|
|
1946
987
|
enabled: !1
|
|
1947
988
|
}
|
|
1948
|
-
}, e =
|
|
1949
|
-
|
|
1950
|
-
},
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
NEW_METHOD_TYPE: ee,
|
|
1968
|
-
VALID_VARNAME_RE: Be
|
|
1969
|
-
})
|
|
1970
|
-
}), i = h((l) => !l, {
|
|
1971
|
-
metaData: {
|
|
1972
|
-
id: "engine.setting.event.BindEventsDialogContent.validMethodNameEmpty"
|
|
1973
|
-
},
|
|
1974
|
-
ctx: () => ({
|
|
1975
|
-
getMethodNameList: d,
|
|
1976
|
-
context: n,
|
|
1977
|
-
editorOptions: o,
|
|
1978
|
-
editorContentChange: e,
|
|
1979
|
-
validMethodNameEmpty: i,
|
|
1980
|
-
validMethodNameExist: g,
|
|
1981
|
-
invalidMethodName: p,
|
|
1982
|
-
change: a,
|
|
1983
|
-
VueMonaco: Ae,
|
|
1984
|
-
getMetaApi: k,
|
|
1985
|
-
META_APP: C,
|
|
1986
|
-
METHOD_TIPS_MAP: re,
|
|
1987
|
-
NEW_METHOD_TYPE: ee,
|
|
1988
|
-
VALID_VARNAME_RE: Be
|
|
1989
|
-
})
|
|
1990
|
-
}), g = h((l) => d == null ? void 0 : d().includes(l), {
|
|
1991
|
-
metaData: {
|
|
1992
|
-
id: "engine.setting.event.BindEventsDialogContent.validMethodNameExist"
|
|
1993
|
-
},
|
|
1994
|
-
ctx: () => ({
|
|
1995
|
-
getMethodNameList: d,
|
|
1996
|
-
context: n,
|
|
1997
|
-
editorOptions: o,
|
|
1998
|
-
editorContentChange: e,
|
|
1999
|
-
validMethodNameEmpty: i,
|
|
2000
|
-
validMethodNameExist: g,
|
|
2001
|
-
invalidMethodName: p,
|
|
2002
|
-
change: a,
|
|
2003
|
-
VueMonaco: Ae,
|
|
2004
|
-
getMetaApi: k,
|
|
2005
|
-
META_APP: C,
|
|
2006
|
-
METHOD_TIPS_MAP: re,
|
|
2007
|
-
NEW_METHOD_TYPE: ee,
|
|
2008
|
-
VALID_VARNAME_RE: Be
|
|
2009
|
-
})
|
|
2010
|
-
}), p = h((l) => !Be.test(l), {
|
|
2011
|
-
metaData: {
|
|
2012
|
-
id: "engine.setting.event.BindEventsDialogContent.invalidMethodName"
|
|
2013
|
-
},
|
|
2014
|
-
ctx: () => ({
|
|
2015
|
-
getMethodNameList: d,
|
|
2016
|
-
context: n,
|
|
2017
|
-
editorOptions: o,
|
|
2018
|
-
editorContentChange: e,
|
|
2019
|
-
validMethodNameEmpty: i,
|
|
2020
|
-
validMethodNameExist: g,
|
|
2021
|
-
invalidMethodName: p,
|
|
2022
|
-
change: a,
|
|
2023
|
-
VueMonaco: Ae,
|
|
2024
|
-
getMetaApi: k,
|
|
2025
|
-
META_APP: C,
|
|
2026
|
-
METHOD_TIPS_MAP: re,
|
|
2027
|
-
NEW_METHOD_TYPE: ee,
|
|
2028
|
-
VALID_VARNAME_RE: Be
|
|
2029
|
-
})
|
|
2030
|
-
}), a = h((l) => {
|
|
2031
|
-
const s = [{
|
|
2032
|
-
validator: i,
|
|
2033
|
-
tip: re.empty
|
|
2034
|
-
}, {
|
|
2035
|
-
validator: g,
|
|
2036
|
-
tip: re.exist
|
|
2037
|
-
}, {
|
|
2038
|
-
validator: p,
|
|
2039
|
-
tip: re.ruleInvalid
|
|
2040
|
-
}];
|
|
2041
|
-
for (let u = 0; u < s.length; u++) {
|
|
2042
|
-
const t = s[u];
|
|
2043
|
-
if (t.validator(l)) {
|
|
2044
|
-
n.tipError = !0, n.tip = t.tip;
|
|
2045
|
-
return;
|
|
989
|
+
}, e = (m) => {
|
|
990
|
+
o.editorContent = m;
|
|
991
|
+
}, r = (m) => !m, _ = (m) => f == null ? void 0 : f().includes(m), h = (m) => !oo.test(m);
|
|
992
|
+
return {
|
|
993
|
+
NEW_METHOD_TYPE: Pe,
|
|
994
|
+
context: o,
|
|
995
|
+
editorOptions: a,
|
|
996
|
+
change: (m) => {
|
|
997
|
+
const s = [
|
|
998
|
+
{ validator: r, tip: se.empty },
|
|
999
|
+
{ validator: _, tip: se.exist },
|
|
1000
|
+
{ validator: h, tip: se.ruleInvalid }
|
|
1001
|
+
];
|
|
1002
|
+
for (let x = 0; x < s.length; x++) {
|
|
1003
|
+
const n = s[x];
|
|
1004
|
+
if (n.validator(m)) {
|
|
1005
|
+
o.tipError = !0, o.tip = n.tip;
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
2046
1008
|
}
|
|
2047
|
-
|
|
2048
|
-
n.tipError = !1, n.tip = "";
|
|
2049
|
-
}, {
|
|
2050
|
-
metaData: {
|
|
2051
|
-
id: "engine.setting.event.BindEventsDialogContent.change"
|
|
1009
|
+
o.tipError = !1, o.tip = "";
|
|
2052
1010
|
},
|
|
2053
|
-
ctx: () => ({
|
|
2054
|
-
getMethodNameList: d,
|
|
2055
|
-
context: n,
|
|
2056
|
-
editorOptions: o,
|
|
2057
|
-
editorContentChange: e,
|
|
2058
|
-
validMethodNameEmpty: i,
|
|
2059
|
-
validMethodNameExist: g,
|
|
2060
|
-
invalidMethodName: p,
|
|
2061
|
-
change: a,
|
|
2062
|
-
VueMonaco: Ae,
|
|
2063
|
-
getMetaApi: k,
|
|
2064
|
-
META_APP: C,
|
|
2065
|
-
METHOD_TIPS_MAP: re,
|
|
2066
|
-
NEW_METHOD_TYPE: ee,
|
|
2067
|
-
VALID_VARNAME_RE: Be
|
|
2068
|
-
})
|
|
2069
|
-
});
|
|
2070
|
-
return {
|
|
2071
|
-
NEW_METHOD_TYPE: ee,
|
|
2072
|
-
context: n,
|
|
2073
|
-
editorOptions: o,
|
|
2074
|
-
change: a,
|
|
2075
1011
|
editorContentChange: e
|
|
2076
1012
|
};
|
|
2077
1013
|
}
|
|
2078
|
-
},
|
|
1014
|
+
}, io = { class: "content-right" }, so = { class: "new-action-tip" }, ao = { class: "content-right-title" }, lo = { class: "set-params-tip" }, ro = { class: "content-right-monaco" }, co = {
|
|
2079
1015
|
key: 1,
|
|
2080
1016
|
class: "mark"
|
|
2081
|
-
},
|
|
1017
|
+
}, mo = {
|
|
2082
1018
|
key: 0,
|
|
2083
1019
|
class: "params-tip"
|
|
2084
1020
|
};
|
|
2085
|
-
function
|
|
2086
|
-
const
|
|
2087
|
-
return
|
|
2088
|
-
|
|
2089
|
-
class:
|
|
1021
|
+
function po(f, o, a, e, r, _) {
|
|
1022
|
+
const h = k("tiny-input"), c = k("tiny-checkbox"), m = k("monaco-editor");
|
|
1023
|
+
return b(), N("div", io, [
|
|
1024
|
+
t("div", {
|
|
1025
|
+
class: X(["content-right-top", { "tip-error": e.context.tipError }])
|
|
2090
1026
|
}, [
|
|
2091
|
-
|
|
2092
|
-
|
|
1027
|
+
o[2] || (o[2] = t("div", { class: "content-right-title" }, "方法名称", -1)),
|
|
1028
|
+
u(h, {
|
|
2093
1029
|
modelValue: e.context.bindMethodInfo.name,
|
|
2094
1030
|
"onUpdate:modelValue": [
|
|
2095
|
-
|
|
1031
|
+
o[0] || (o[0] = (s) => e.context.bindMethodInfo.name = s),
|
|
2096
1032
|
e.change
|
|
2097
1033
|
],
|
|
2098
1034
|
disabled: e.context.bindMethodInfo.type !== e.NEW_METHOD_TYPE,
|
|
2099
|
-
class:
|
|
1035
|
+
class: X([{ "status-error": e.context.tipError }]),
|
|
2100
1036
|
placeholder: "请从左侧选择一个方法进行绑定,或者选择添加新方法,输入自定义方法名称。"
|
|
2101
1037
|
}, null, 8, ["modelValue", "disabled", "class", "onUpdate:modelValue"]),
|
|
2102
|
-
|
|
1038
|
+
t("div", so, B(e.context.tip), 1)
|
|
2103
1039
|
], 2),
|
|
2104
|
-
|
|
2105
|
-
class:
|
|
1040
|
+
t("div", {
|
|
1041
|
+
class: X(["content-right-bottom", { "tip-error": !e.context.isValidParams }])
|
|
2106
1042
|
}, [
|
|
2107
|
-
|
|
2108
|
-
|
|
1043
|
+
t("div", ao, [
|
|
1044
|
+
u(c, {
|
|
2109
1045
|
modelValue: e.context.enableExtraParams,
|
|
2110
|
-
"onUpdate:modelValue":
|
|
1046
|
+
"onUpdate:modelValue": o[1] || (o[1] = (s) => e.context.enableExtraParams = s),
|
|
2111
1047
|
name: "tiny-checkbox"
|
|
2112
1048
|
}, {
|
|
2113
|
-
default:
|
|
2114
|
-
|
|
1049
|
+
default: E(() => o[3] || (o[3] = [
|
|
1050
|
+
J("扩展参数设置")
|
|
2115
1051
|
])),
|
|
2116
1052
|
_: 1,
|
|
2117
1053
|
__: [3]
|
|
2118
1054
|
}, 8, ["modelValue"]),
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
1055
|
+
t("div", lo, [
|
|
1056
|
+
o[4] || (o[4] = t("div", null, "扩展参数:调用当前事件传入的真实参数,数组格式,追加在原有事件参数之后", -1)),
|
|
1057
|
+
J(" 如: " + B(e.context.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
|
|
2122
1058
|
])
|
|
2123
1059
|
]),
|
|
2124
|
-
|
|
2125
|
-
|
|
1060
|
+
t("div", ro, [
|
|
1061
|
+
a.dialogVisible ? (b(), O(m, {
|
|
2126
1062
|
key: 0,
|
|
2127
1063
|
value: e.context.editorContent,
|
|
2128
1064
|
options: e.editorOptions,
|
|
2129
1065
|
onChange: e.editorContentChange,
|
|
2130
1066
|
class: "monaco-editor"
|
|
2131
|
-
}, null, 8, ["value", "options", "onChange"])) :
|
|
2132
|
-
e.context.enableExtraParams ?
|
|
1067
|
+
}, null, 8, ["value", "options", "onChange"])) : Q("", !0),
|
|
1068
|
+
e.context.enableExtraParams ? Q("", !0) : (b(), N("div", co))
|
|
2133
1069
|
]),
|
|
2134
|
-
!e.context.isValidParams && e.context.enableExtraParams ? (
|
|
1070
|
+
!e.context.isValidParams && e.context.enableExtraParams ? (b(), N("div", mo, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : Q("", !0)
|
|
2135
1071
|
], 2)
|
|
2136
1072
|
]);
|
|
2137
1073
|
}
|
|
2138
|
-
const
|
|
1074
|
+
const uo = /* @__PURE__ */ H(to, [["render", po], ["__scopeId", "data-v-f2c9b5af"]]), fo = {
|
|
2139
1075
|
components: {
|
|
2140
|
-
TinySearch:
|
|
1076
|
+
TinySearch: Fe
|
|
2141
1077
|
},
|
|
2142
1078
|
props: {
|
|
2143
1079
|
eventBinding: {
|
|
@@ -2145,110 +1081,70 @@ const pn = /* @__PURE__ */ Ie(on, [["render", gn], ["__scopeId", "data-v-fc0b367
|
|
|
2145
1081
|
default: () => ({})
|
|
2146
1082
|
}
|
|
2147
1083
|
},
|
|
2148
|
-
setup(
|
|
2149
|
-
const {
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
ctx: () => ({
|
|
2163
|
-
props: d,
|
|
2164
|
-
getMethodNameList: n,
|
|
2165
|
-
searchValue: o,
|
|
2166
|
-
filteredMethodList: e,
|
|
2167
|
-
context: i,
|
|
2168
|
-
generateMethodName: g,
|
|
2169
|
-
selectMethod: p,
|
|
2170
|
-
getMetaApi: k,
|
|
2171
|
-
META_APP: C,
|
|
2172
|
-
INVALID_VARNAME_CHAR_RE: je,
|
|
2173
|
-
NEW_METHOD_TYPE: ee
|
|
2174
|
-
})
|
|
2175
|
-
}), p = h((a) => {
|
|
2176
|
-
i.bindMethodInfo = a;
|
|
2177
|
-
}, {
|
|
2178
|
-
metaData: {
|
|
2179
|
-
id: "engine.setting.event.BindEventsDialogSidebar.selectMethod"
|
|
2180
|
-
},
|
|
2181
|
-
ctx: () => ({
|
|
2182
|
-
props: d,
|
|
2183
|
-
getMethodNameList: n,
|
|
2184
|
-
searchValue: o,
|
|
2185
|
-
filteredMethodList: e,
|
|
2186
|
-
context: i,
|
|
2187
|
-
generateMethodName: g,
|
|
2188
|
-
selectMethod: p,
|
|
2189
|
-
getMetaApi: k,
|
|
2190
|
-
META_APP: C,
|
|
2191
|
-
INVALID_VARNAME_CHAR_RE: je,
|
|
2192
|
-
NEW_METHOD_TYPE: ee
|
|
2193
|
-
})
|
|
2194
|
-
});
|
|
2195
|
-
return nt(() => {
|
|
2196
|
-
var r, c;
|
|
2197
|
-
const a = (r = d.eventBinding) == null ? void 0 : r.eventName, l = (n == null ? void 0 : n().filter((m) => m.includes(a))) || [], u = {
|
|
1084
|
+
setup(f) {
|
|
1085
|
+
const { getMethodNameList: o } = ne(oe.Page), a = K(""), e = K([]), r = Ne("context"), _ = (c, m) => {
|
|
1086
|
+
const s = c.map((l) => {
|
|
1087
|
+
var i;
|
|
1088
|
+
return Number.parseInt((i = l.match(/\d+$/)) == null ? void 0 : i[0]) || 0;
|
|
1089
|
+
}).sort((l, i) => l - i).pop();
|
|
1090
|
+
let n = `${(m == null ? void 0 : m.replace(no, "_")) || ""}New`;
|
|
1091
|
+
return s > -1 && (n += `${s + 1}`), n;
|
|
1092
|
+
}, h = (c) => {
|
|
1093
|
+
r.bindMethodInfo = c;
|
|
1094
|
+
};
|
|
1095
|
+
return Ae(() => {
|
|
1096
|
+
var l, i;
|
|
1097
|
+
const c = (l = f.eventBinding) == null ? void 0 : l.eventName, m = (o == null ? void 0 : o().filter((d) => d.includes(c))) || [], x = {
|
|
2198
1098
|
title: "添加新方法",
|
|
2199
|
-
name:
|
|
2200
|
-
type:
|
|
1099
|
+
name: _(m, c),
|
|
1100
|
+
type: Pe
|
|
2201
1101
|
};
|
|
2202
|
-
(
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
const t = (n == null ? void 0 : n().filter((m) => m.includes(o.value)).map((m) => ({
|
|
2206
|
-
name: m
|
|
2207
|
-
}))) || [];
|
|
2208
|
-
e.value = [u, ...t];
|
|
1102
|
+
(i = f.eventBinding) != null && i.ref ? h({ name: f.eventBinding.ref }) : h(x);
|
|
1103
|
+
const n = (o == null ? void 0 : o().filter((d) => d.includes(a.value)).map((d) => ({ name: d }))) || [];
|
|
1104
|
+
e.value = [x, ...n];
|
|
2209
1105
|
}), {
|
|
2210
|
-
context:
|
|
2211
|
-
searchValue:
|
|
1106
|
+
context: r,
|
|
1107
|
+
searchValue: a,
|
|
2212
1108
|
filteredMethodList: e,
|
|
2213
|
-
selectMethod:
|
|
1109
|
+
selectMethod: h
|
|
2214
1110
|
};
|
|
2215
1111
|
}
|
|
2216
|
-
},
|
|
2217
|
-
function
|
|
2218
|
-
const
|
|
2219
|
-
return
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
1112
|
+
}, vo = { class: "dialog-content-left" }, go = { class: "left-list-wrap" }, _o = { class: "left-action-list" }, ho = { class: "action-list-wrap" }, bo = ["onClick"];
|
|
1113
|
+
function yo(f, o, a, e, r, _) {
|
|
1114
|
+
const h = k("tiny-search");
|
|
1115
|
+
return b(), N("div", vo, [
|
|
1116
|
+
o[1] || (o[1] = t("div", { class: "left-title" }, "响应方法", -1)),
|
|
1117
|
+
t("div", go, [
|
|
1118
|
+
t("div", _o, [
|
|
1119
|
+
u(h, {
|
|
2224
1120
|
modelValue: e.searchValue,
|
|
2225
|
-
"onUpdate:modelValue":
|
|
1121
|
+
"onUpdate:modelValue": o[0] || (o[0] = (c) => e.searchValue = c),
|
|
2226
1122
|
placeholder: "搜索"
|
|
2227
1123
|
}, null, 8, ["modelValue"]),
|
|
2228
|
-
|
|
2229
|
-
(
|
|
2230
|
-
key:
|
|
2231
|
-
onClick: (
|
|
1124
|
+
t("ul", ho, [
|
|
1125
|
+
(b(!0), N(W, null, ae(e.filteredMethodList, (c) => (b(), N("li", {
|
|
1126
|
+
key: c.name,
|
|
1127
|
+
onClick: (m) => e.selectMethod(c)
|
|
2232
1128
|
}, [
|
|
2233
|
-
|
|
2234
|
-
class:
|
|
2235
|
-
},
|
|
2236
|
-
], 8,
|
|
1129
|
+
t("div", {
|
|
1130
|
+
class: X(["action-name", { active: c.name === e.context.bindMethodInfo.name }])
|
|
1131
|
+
}, B(c.title || c.name), 3)
|
|
1132
|
+
], 8, bo))), 128))
|
|
2237
1133
|
])
|
|
2238
1134
|
])
|
|
2239
1135
|
])
|
|
2240
1136
|
]);
|
|
2241
1137
|
}
|
|
2242
|
-
const
|
|
2243
|
-
...
|
|
2244
|
-
entry:
|
|
2245
|
-
options: { commonEvents:
|
|
1138
|
+
const Eo = /* @__PURE__ */ H(fo, [["render", yo], ["__scopeId", "data-v-0859add1"]]), wo = {
|
|
1139
|
+
...de,
|
|
1140
|
+
entry: eo,
|
|
1141
|
+
options: { commonEvents: _n },
|
|
2246
1142
|
components: {
|
|
2247
|
-
BindEventsDialogSidebar:
|
|
2248
|
-
BindEventsDialogContent:
|
|
1143
|
+
BindEventsDialogSidebar: Eo,
|
|
1144
|
+
BindEventsDialogContent: uo
|
|
2249
1145
|
}
|
|
2250
1146
|
};
|
|
2251
1147
|
export {
|
|
2252
|
-
|
|
1148
|
+
wo as default
|
|
2253
1149
|
};
|
|
2254
1150
|
//# sourceMappingURL=index.js.map
|