@opentiny/tiny-engine-setting-events 2.6.1 → 2.7.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1761 -657
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,35 +1,72 @@
|
|
|
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 Ve, reactive as we, provide as tt, nextTick as rt, resolveComponent as M, createBlock as te, openBlock as B, withCtx as I, createElementVNode as v, createVNode as b, resolveDynamicComponent as Ge, createTextVNode as ke, unref as S, createElementBlock as J, Fragment as Oe, withDirectives as qe, renderList as ze, normalizeClass as Ne, toDisplayString as Y, createCommentVNode as Se, vShow as Ye, computed as Me, watchEffect as nt, watch as Ze, inject as ot } from "vue";
|
|
3
|
+
import { callEntry as h, META_APP as C, getMetaApi as k, getOptions as X, useLayout as V, useHistory as K, useCanvas as y, getMergeMeta as P, useBlock as ue, useMaterial as fe, useModal as _e, useMessage as he, useProperties as z } from "@opentiny/tiny-engine-meta-register";
|
|
4
|
+
import { TinyAlert as mt, DialogBox as it, Button as Te, Form as gt, FormItem as We, Input as Fe, Popover as pt, Tooltip as vt, Collapse as ut, CollapseItem as Qe, Checkbox as ft, Search as _t } from "@opentiny/vue";
|
|
5
|
+
import be from "@opentiny/tiny-engine-common/js/i18n";
|
|
6
|
+
import { SvgButton as Ee, BlockLinkEvent as ye, PluginPanel as ht, VueMonaco as Ae } from "@opentiny/tiny-engine-common";
|
|
7
|
+
import { iconChevronDown as xe } from "@opentiny/vue-icon";
|
|
8
|
+
import { string2Ast as R, ast2String as H } from "@opentiny/tiny-engine-common/js/ast";
|
|
9
|
+
import { CodeConfigurator as ae, InputConfigurator as se, VariableConfigurator as le, SwitchConfigurator as de } 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 me, utils as ge } from "@opentiny/tiny-engine-utils";
|
|
12
|
+
const U = {
|
|
13
13
|
id: "engine.setting.event",
|
|
14
14
|
title: "高级",
|
|
15
|
-
type: "
|
|
16
|
-
align: "rightTop",
|
|
15
|
+
type: "plugins",
|
|
17
16
|
name: "event",
|
|
18
17
|
icon: "target"
|
|
19
|
-
},
|
|
20
|
-
const
|
|
21
|
-
for (const [e,
|
|
22
|
-
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
}, Ie = (d, n) => {
|
|
19
|
+
const o = d.__vccOpts || d;
|
|
20
|
+
for (const [e, i] of n)
|
|
21
|
+
o[e] = i;
|
|
22
|
+
return o;
|
|
23
|
+
}, j = Ve(!1), L = h(() => {
|
|
24
|
+
j.value = !0;
|
|
25
|
+
}, {
|
|
26
|
+
metaData: {
|
|
27
|
+
id: "engine.setting.event.BindEventsDialog.open"
|
|
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 = {
|
|
29
66
|
components: {
|
|
30
|
-
TinyButton:
|
|
31
|
-
TinyDialogBox:
|
|
32
|
-
TinyAlert:
|
|
67
|
+
TinyButton: Te,
|
|
68
|
+
TinyDialogBox: it,
|
|
69
|
+
TinyAlert: mt
|
|
33
70
|
},
|
|
34
71
|
inheritAttrs: !1,
|
|
35
72
|
props: {
|
|
@@ -38,8 +75,20 @@ const de = {
|
|
|
38
75
|
default: () => ({})
|
|
39
76
|
}
|
|
40
77
|
},
|
|
41
|
-
setup(
|
|
42
|
-
const {
|
|
78
|
+
setup(d) {
|
|
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({
|
|
43
92
|
editorContent: "",
|
|
44
93
|
bindMethodInfo: {},
|
|
45
94
|
tip: "",
|
|
@@ -47,95 +96,502 @@ const de = {
|
|
|
47
96
|
enableExtraParams: !1,
|
|
48
97
|
isValidParams: !0
|
|
49
98
|
});
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
s.bindMethodInfo =
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
99
|
+
tt("context", s);
|
|
100
|
+
const u = h((E) => {
|
|
101
|
+
s.bindMethodInfo = E;
|
|
102
|
+
}, {
|
|
103
|
+
metaData: {
|
|
104
|
+
id: "engine.setting.event.BindEventsDialog.selectMethod"
|
|
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)
|
|
56
144
|
return;
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
145
|
+
const _ = (Z = d.eventBinding) == null ? void 0 : Z.eventName;
|
|
146
|
+
if (!_)
|
|
59
147
|
return;
|
|
60
|
-
const
|
|
61
|
-
if (!
|
|
148
|
+
const A = (q = g == null ? void 0 : g.currentSchema) == null ? void 0 : q.props;
|
|
149
|
+
if (!A)
|
|
62
150
|
return;
|
|
63
|
-
const {
|
|
64
|
-
|
|
151
|
+
const {
|
|
152
|
+
name: O,
|
|
153
|
+
extra: W
|
|
154
|
+
} = E;
|
|
155
|
+
d[_] || (A[_] = {
|
|
65
156
|
type: "JSExpression",
|
|
66
157
|
value: ""
|
|
67
|
-
}),
|
|
68
|
-
},
|
|
158
|
+
}), W && s.enableExtraParams && (A[_].params = W), A[_].value = `this.${O}`, K().addHistory();
|
|
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(() => {
|
|
69
199
|
s.tipError = !1, s.tip = "", s.isValidParams = !0;
|
|
70
|
-
},
|
|
71
|
-
|
|
200
|
+
}, {
|
|
201
|
+
metaData: {
|
|
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 = "";
|
|
72
241
|
if (s.enableExtraParams)
|
|
73
242
|
try {
|
|
74
|
-
|
|
243
|
+
E = JSON.parse(s.editorContent), s.isValidParams = Array.isArray(E);
|
|
75
244
|
} catch {
|
|
76
245
|
s.isValidParams = !1;
|
|
77
246
|
}
|
|
78
|
-
return
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
247
|
+
return E;
|
|
248
|
+
}, {
|
|
249
|
+
metaData: {
|
|
250
|
+
id: "engine.setting.event.BindEventsDialog.getExtraParams"
|
|
251
|
+
},
|
|
252
|
+
ctx: () => ({
|
|
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 = {};
|
|
84
333
|
try {
|
|
85
|
-
|
|
334
|
+
T = R(E);
|
|
86
335
|
} catch {
|
|
87
|
-
|
|
336
|
+
E = E.replace("function", `function ${s.bindMethodInfo.name}`), T = R(E);
|
|
88
337
|
}
|
|
89
|
-
(
|
|
338
|
+
(ne = (q = T == null ? void 0 : T.program) == null ? void 0 : q.body[0]) != null && ne.body && (_ = H(T.program.body[0].body)), (ie = (oe = T == null ? void 0 : T.program) == null ? void 0 : oe.body[0]) != null && ie.async && (A = !0), (Le = (Q = T == null ? void 0 : T.program) == null ? void 0 : Q.body[0]) != null && Le.generator && (O = !0);
|
|
90
339
|
}
|
|
91
340
|
return {
|
|
92
|
-
preBody:
|
|
341
|
+
preBody: _ || `{
|
|
93
342
|
}`,
|
|
94
|
-
isAsync:
|
|
95
|
-
isGenerator:
|
|
343
|
+
isAsync: A,
|
|
344
|
+
isGenerator: O
|
|
96
345
|
};
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
346
|
+
}, {
|
|
347
|
+
metaData: {
|
|
348
|
+
id: "engine.setting.event.BindEventsDialog.getFunctionBody"
|
|
349
|
+
},
|
|
350
|
+
ctx: () => ({
|
|
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);
|
|
102
390
|
});
|
|
103
391
|
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
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();
|
|
392
|
+
}, {
|
|
393
|
+
metaData: {
|
|
394
|
+
id: "engine.setting.event.BindEventsDialog.activePagePlugin"
|
|
124
395
|
},
|
|
125
|
-
|
|
126
|
-
|
|
396
|
+
ctx: () => ({
|
|
397
|
+
props: d,
|
|
398
|
+
BindEventsDialogSidebar: n,
|
|
399
|
+
BindEventsDialogContent: o,
|
|
400
|
+
PLUGIN_NAME: e,
|
|
401
|
+
activePlugin: i,
|
|
402
|
+
pageState: g,
|
|
403
|
+
getMethods: p,
|
|
404
|
+
saveMethod: a,
|
|
405
|
+
highlightMethod: l,
|
|
406
|
+
state: s,
|
|
407
|
+
selectMethod: u,
|
|
408
|
+
bindMethod: t,
|
|
409
|
+
resetTipError: r,
|
|
410
|
+
getExtraParams: c,
|
|
411
|
+
getFormatParams: m,
|
|
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"
|
|
460
|
+
},
|
|
461
|
+
ctx: () => ({
|
|
462
|
+
props: d,
|
|
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"
|
|
127
502
|
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
503
|
+
ctx: () => ({
|
|
504
|
+
props: d,
|
|
505
|
+
BindEventsDialogSidebar: n,
|
|
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"
|
|
131
543
|
},
|
|
132
|
-
|
|
544
|
+
ctx: () => ({
|
|
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
|
|
133
589
|
};
|
|
134
590
|
}
|
|
135
|
-
},
|
|
136
|
-
function
|
|
137
|
-
const
|
|
138
|
-
return
|
|
591
|
+
}, Et = { class: "bind-event-dialog-tip" }, yt = { class: "bind-event-dialog-content" }, xt = { class: "bind-dialog-footer" };
|
|
592
|
+
function Dt(d, n, o, e, i, g) {
|
|
593
|
+
const p = M("tiny-alert"), a = M("tiny-button"), l = M("tiny-dialog-box");
|
|
594
|
+
return B(), te(l, {
|
|
139
595
|
visible: e.dialogVisible,
|
|
140
596
|
title: "事件绑定",
|
|
141
597
|
width: "50%",
|
|
@@ -145,48 +601,48 @@ function vn(f, o, a, e, r, _) {
|
|
|
145
601
|
onClose: e.closeDialog,
|
|
146
602
|
onOpened: e.openedDialog
|
|
147
603
|
}, {
|
|
148
|
-
footer:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
default:
|
|
152
|
-
|
|
604
|
+
footer: I(() => [
|
|
605
|
+
v("div", xt, [
|
|
606
|
+
b(a, { onClick: e.closeDialog }, {
|
|
607
|
+
default: I(() => n[0] || (n[0] = [
|
|
608
|
+
ke("取 消")
|
|
153
609
|
])),
|
|
154
610
|
_: 1,
|
|
155
611
|
__: [0]
|
|
156
612
|
}, 8, ["onClick"]),
|
|
157
|
-
|
|
613
|
+
b(a, {
|
|
158
614
|
type: "info",
|
|
159
615
|
onClick: e.confirm
|
|
160
616
|
}, {
|
|
161
|
-
default:
|
|
162
|
-
|
|
617
|
+
default: I(() => n[1] || (n[1] = [
|
|
618
|
+
ke("确 定")
|
|
163
619
|
])),
|
|
164
620
|
_: 1,
|
|
165
621
|
__: [1]
|
|
166
622
|
}, 8, ["onClick"])
|
|
167
623
|
])
|
|
168
624
|
]),
|
|
169
|
-
default:
|
|
170
|
-
|
|
171
|
-
|
|
625
|
+
default: I(() => [
|
|
626
|
+
v("div", Et, [
|
|
627
|
+
b(p, {
|
|
172
628
|
type: "info",
|
|
173
629
|
description: "选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)。",
|
|
174
630
|
class: "header-alert",
|
|
175
631
|
closable: !1
|
|
176
632
|
})
|
|
177
633
|
]),
|
|
178
|
-
|
|
179
|
-
(
|
|
634
|
+
v("div", yt, [
|
|
635
|
+
(B(), te(Ge(e.BindEventsDialogSidebar), {
|
|
180
636
|
dialogVisible: e.dialogVisible,
|
|
181
|
-
eventBinding:
|
|
637
|
+
eventBinding: o.eventBinding
|
|
182
638
|
}, null, 8, ["dialogVisible", "eventBinding"])),
|
|
183
|
-
(
|
|
639
|
+
(B(), te(Ge(e.BindEventsDialogContent), { dialogVisible: e.dialogVisible }, null, 8, ["dialogVisible"]))
|
|
184
640
|
])
|
|
185
641
|
]),
|
|
186
642
|
_: 1
|
|
187
643
|
}, 8, ["visible", "onClose", "onOpened"]);
|
|
188
644
|
}
|
|
189
|
-
const
|
|
645
|
+
const De = /* @__PURE__ */ Ie(bt, [["render", Dt], ["__scopeId", "data-v-03166656"]]), at = {
|
|
190
646
|
onClick: {
|
|
191
647
|
label: {
|
|
192
648
|
zh_CN: "点击事件"
|
|
@@ -243,120 +699,19 @@ const gn = /* @__PURE__ */ H(mn, [["render", vn], ["__scopeId", "data-v-070f73c9
|
|
|
243
699
|
},
|
|
244
700
|
defaultValue: ""
|
|
245
701
|
}
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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 = {
|
|
702
|
+
}, et = ["onabort", "onafterprint", "onanimationend", "onanimationiteration", "onanimationstart", "onappinstalled", "onauxclick", "onbeforeinstallprompt", "onbeforeprint", "onbeforeunload", "onbeforexrselect", "onblur", "oncancel", "oncanplay", "oncanplaythrough", "onchange", "onclick", "onclose", "oncontextlost", "oncontextmenu", "oncontextrestored", "oncuechange", "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied", "onended", "onerror", "onfocus", "onformdata", "ongotpointercapture", "onhashchange", "oninput", "oninvalid", "onkeydown", "onkeypress", "onkeyup", "onlanguagechange", "onload", "onloadeddata", "onloadedmetadata", "onloadstart", "onlostpointercapture", "onmessage", "onmessageerror", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onoffline", "ononline", "onpagehide", "onpageshow", "onpause", "onplay", "onplaying", "onpointercancel", "onpointerdown", "onpointerenter", "onpointerleave", "onpointermove", "onpointerout", "onpointerover", "onpointerrawupdate", "onpointerup", "onpopstate", "onprogress", "onratechange", "onrejectionhandled", "onreset", "onresize", "onscroll", "onsearch", "onsecuritypolicyviolation", "onseeked", "onseeking", "onselect", "onselectionchange", "onselectstart", "onslotchange", "onstalled", "onstorage", "onsubmit", "onsuspend", "ontimeupdate", "ontoggle", "ontransitioncancel", "ontransitionend", "ontransitionrun", "ontransitionstart", "onunhandledrejection", "onunload", "onvolumechange", "onwaiting", "onwebkitanimationend", "onwebkitanimationiteration", "onwebkitanimationstart", "onwebkittransitionend", "onwheel"], Pe = h((d) => !!et.map((o) => {
|
|
703
|
+
const e = o[2].toUpperCase();
|
|
704
|
+
return `${o.substring(0, 2)}${e}${o.substring(3)}`;
|
|
705
|
+
}).includes(d), {
|
|
706
|
+
metaData: {
|
|
707
|
+
id: "engine.setting.event.commonjs-events.checkEvent"
|
|
708
|
+
},
|
|
709
|
+
ctx: () => ({
|
|
710
|
+
commonEvents: at,
|
|
711
|
+
allEvents: et,
|
|
712
|
+
checkEvent: Pe
|
|
713
|
+
})
|
|
714
|
+
}), Ct = { class: "footer" }, kt = {
|
|
360
715
|
__name: "AddEventsDialog",
|
|
361
716
|
props: {
|
|
362
717
|
visible: {
|
|
@@ -369,108 +724,157 @@ const gn = /* @__PURE__ */ H(mn, [["render", vn], ["__scopeId", "data-v-070f73c9
|
|
|
369
724
|
}
|
|
370
725
|
},
|
|
371
726
|
emits: ["closeDialog", "addEvent"],
|
|
372
|
-
setup(
|
|
373
|
-
const
|
|
727
|
+
setup(d, { emit: n }) {
|
|
728
|
+
const o = d, e = n, i = we({
|
|
374
729
|
eventDescription: "",
|
|
375
730
|
eventName: ""
|
|
376
|
-
}),
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
731
|
+
}), g = Ve(null), p = h((u, t, r) => {
|
|
732
|
+
if (o.componentEvents[i.eventName]) {
|
|
733
|
+
r(new Error("事件名已存在"));
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
if (!Pe(i.eventName)) {
|
|
737
|
+
r(new Error("请输入正确的浏览器事件名"));
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
r();
|
|
741
|
+
}, {
|
|
742
|
+
metaData: {
|
|
743
|
+
id: "engine.setting.event.AddEventsDialog.eventNameValidator"
|
|
744
|
+
},
|
|
745
|
+
ctx: () => ({
|
|
746
|
+
checkEvent: Pe,
|
|
747
|
+
props: o,
|
|
748
|
+
emits: e,
|
|
749
|
+
formData: i,
|
|
750
|
+
ruleForm: g,
|
|
751
|
+
eventNameValidator: p,
|
|
752
|
+
rules: a,
|
|
753
|
+
closeDialog: l,
|
|
754
|
+
addMethod: s
|
|
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(() => {
|
|
400
768
|
e("closeDialog");
|
|
401
|
-
},
|
|
402
|
-
|
|
403
|
-
|
|
769
|
+
}, {
|
|
770
|
+
metaData: {
|
|
771
|
+
id: "engine.setting.event.AddEventsDialog.closeDialog"
|
|
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)
|
|
404
787
|
return;
|
|
405
|
-
const {
|
|
406
|
-
|
|
788
|
+
const {
|
|
789
|
+
eventName: t,
|
|
790
|
+
eventDescription: r
|
|
791
|
+
} = i;
|
|
792
|
+
e("addEvent", {
|
|
793
|
+
eventName: t,
|
|
794
|
+
eventDescription: r
|
|
795
|
+
});
|
|
407
796
|
});
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
797
|
+
}, {
|
|
798
|
+
metaData: {
|
|
799
|
+
id: "engine.setting.event.AddEventsDialog.addMethod"
|
|
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,
|
|
411
815
|
title: "添加新事件",
|
|
412
816
|
width: "400px",
|
|
413
817
|
"append-to-body": !0,
|
|
414
818
|
"close-on-click-modal": !1,
|
|
415
|
-
onClose:
|
|
819
|
+
onClose: S(l)
|
|
416
820
|
}, {
|
|
417
|
-
footer:
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
default:
|
|
421
|
-
|
|
821
|
+
footer: I(() => [
|
|
822
|
+
v("div", Ct, [
|
|
823
|
+
b(S(Te), { onClick: S(l) }, {
|
|
824
|
+
default: I(() => t[2] || (t[2] = [
|
|
825
|
+
ke(" 取消")
|
|
422
826
|
])),
|
|
423
827
|
_: 1,
|
|
424
828
|
__: [2]
|
|
425
|
-
}),
|
|
426
|
-
|
|
829
|
+
}, 8, ["onClick"]),
|
|
830
|
+
b(S(Te), {
|
|
427
831
|
type: "primary",
|
|
428
|
-
onClick: s
|
|
832
|
+
onClick: S(s)
|
|
429
833
|
}, {
|
|
430
|
-
default:
|
|
431
|
-
|
|
834
|
+
default: I(() => t[3] || (t[3] = [
|
|
835
|
+
ke(" 确定")
|
|
432
836
|
])),
|
|
433
837
|
_: 1,
|
|
434
838
|
__: [3]
|
|
435
|
-
})
|
|
839
|
+
}, 8, ["onClick"])
|
|
436
840
|
])
|
|
437
841
|
]),
|
|
438
|
-
default:
|
|
439
|
-
|
|
842
|
+
default: I(() => [
|
|
843
|
+
b(S(gt), {
|
|
440
844
|
ref_key: "ruleForm",
|
|
441
|
-
ref:
|
|
442
|
-
model:
|
|
443
|
-
rules:
|
|
845
|
+
ref: g,
|
|
846
|
+
model: i,
|
|
847
|
+
rules: a,
|
|
444
848
|
"label-width": "80px",
|
|
445
849
|
"inline-message": !0,
|
|
446
850
|
"validate-type": "text",
|
|
447
851
|
"label-position": "left",
|
|
448
852
|
class: "add-custom-event-form"
|
|
449
853
|
}, {
|
|
450
|
-
default:
|
|
451
|
-
|
|
854
|
+
default: I(() => [
|
|
855
|
+
b(S(We), {
|
|
452
856
|
label: "事件函数名",
|
|
453
857
|
prop: "eventName",
|
|
454
858
|
required: ""
|
|
455
859
|
}, {
|
|
456
|
-
default:
|
|
457
|
-
|
|
458
|
-
modelValue:
|
|
459
|
-
"onUpdate:modelValue":
|
|
860
|
+
default: I(() => [
|
|
861
|
+
b(S(Fe), {
|
|
862
|
+
modelValue: i.eventName,
|
|
863
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => i.eventName = r),
|
|
460
864
|
placeholder: "小驼峰格式,如:onDrag"
|
|
461
865
|
}, null, 8, ["modelValue"])
|
|
462
866
|
]),
|
|
463
867
|
_: 1
|
|
464
868
|
}),
|
|
465
|
-
|
|
869
|
+
b(S(We), {
|
|
466
870
|
label: "事件描述",
|
|
467
871
|
prop: "eventDescription",
|
|
468
872
|
required: ""
|
|
469
873
|
}, {
|
|
470
|
-
default:
|
|
471
|
-
|
|
472
|
-
modelValue:
|
|
473
|
-
"onUpdate:modelValue":
|
|
874
|
+
default: I(() => [
|
|
875
|
+
b(S(Fe), {
|
|
876
|
+
modelValue: i.eventDescription,
|
|
877
|
+
"onUpdate:modelValue": t[1] || (t[1] = (r) => i.eventDescription = r)
|
|
474
878
|
}, null, 8, ["modelValue"])
|
|
475
879
|
]),
|
|
476
880
|
_: 1
|
|
@@ -480,114 +884,405 @@ const gn = /* @__PURE__ */ H(mn, [["render", vn], ["__scopeId", "data-v-070f73c9
|
|
|
480
884
|
}, 8, ["model"])
|
|
481
885
|
]),
|
|
482
886
|
_: 1
|
|
483
|
-
}, 8, ["visible"]));
|
|
887
|
+
}, 8, ["visible", "onClose"]));
|
|
484
888
|
}
|
|
485
|
-
},
|
|
889
|
+
}, Ce = /* @__PURE__ */ Ie(kt, [["__scopeId", "data-v-2ed7fac6"]]), At = {
|
|
486
890
|
components: {
|
|
487
|
-
BlockLinkEvent:
|
|
488
|
-
BindEventsDialog:
|
|
489
|
-
TinyPopover:
|
|
490
|
-
TinyButton:
|
|
491
|
-
IconChevronDown:
|
|
492
|
-
SvgButton:
|
|
493
|
-
AddEventsDialog:
|
|
891
|
+
BlockLinkEvent: ye,
|
|
892
|
+
BindEventsDialog: De,
|
|
893
|
+
TinyPopover: pt,
|
|
894
|
+
TinyButton: Te,
|
|
895
|
+
IconChevronDown: xe(),
|
|
896
|
+
SvgButton: Ee,
|
|
897
|
+
AddEventsDialog: Ce
|
|
494
898
|
},
|
|
495
899
|
inheritAttrs: !1,
|
|
496
900
|
setup() {
|
|
497
|
-
const {
|
|
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({
|
|
498
919
|
eventName: "",
|
|
499
920
|
// 事件名称
|
|
500
921
|
eventBinding: null,
|
|
501
922
|
// 事件绑定的处理方法对象
|
|
502
923
|
componentEvent: {},
|
|
503
|
-
customEvents:
|
|
924
|
+
customEvents: u,
|
|
504
925
|
bindActions: {},
|
|
505
926
|
showBindEventDialog: !1
|
|
506
|
-
}),
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
927
|
+
}), r = Me(() => !!o.isBlock), c = Me(() => Object.keys(t.bindActions).length === 0), m = Me(() => ({
|
|
928
|
+
...t.componentEvent,
|
|
929
|
+
...t.customEvents
|
|
930
|
+
}));
|
|
931
|
+
nt(() => {
|
|
932
|
+
var Z, q, ne, oe, ie;
|
|
933
|
+
const _ = (Z = o == null ? void 0 : o.currentSchema) == null ? void 0 : Z.componentName, A = p(_);
|
|
934
|
+
t.componentEvent = ((ne = (q = A == null ? void 0 : A.content) == null ? void 0 : q.schema) == null ? void 0 : ne.events) || ((oe = A == null ? void 0 : A.schema) == null ? void 0 : oe.events) || {};
|
|
935
|
+
const O = ((ie = o == null ? void 0 : o.currentSchema) == null ? void 0 : ie.props) || {}, W = Object.keys(O);
|
|
936
|
+
t.bindActions = {}, Object.entries(m.value).forEach(([Q, Le]) => {
|
|
937
|
+
var T, Ue, Re;
|
|
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,
|
|
517
944
|
ref: "",
|
|
518
|
-
event:
|
|
519
|
-
params:
|
|
945
|
+
event: O[Q],
|
|
946
|
+
params: dt
|
|
520
947
|
};
|
|
521
|
-
if (
|
|
522
|
-
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
var
|
|
526
|
-
|
|
948
|
+
if (pe.event.type === "JSExpression" && (pe.ref = pe.event.value.replace("this.", "").replace(/\(.*\)$/, "")), o.isBlock) {
|
|
949
|
+
pe.metaEvent = Le;
|
|
950
|
+
const Je = e(i()), Xe = (Re = o == null ? void 0 : o.currentSchema) == null ? void 0 : Re.id;
|
|
951
|
+
Xe && Je && Object.entries(Je).forEach(([ct, ve]) => {
|
|
952
|
+
var Ke, He;
|
|
953
|
+
Xe === ((Ke = ve == null ? void 0 : ve.linked) == null ? void 0 : Ke.id) && Q === ((He = ve == null ? void 0 : ve.linked) == null ? void 0 : He.event) && (pe.linked = ve.linked, pe.linkedEventName = ct);
|
|
527
954
|
});
|
|
528
955
|
}
|
|
529
|
-
|
|
956
|
+
t.bindActions[Q] = pe;
|
|
530
957
|
}
|
|
531
958
|
});
|
|
532
959
|
});
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
},
|
|
536
|
-
|
|
537
|
-
|
|
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
|
-
});
|
|
960
|
+
const f = h((_, A) => {
|
|
961
|
+
A && t.bindActions[_.eventName] || (t.eventBinding = _, L());
|
|
962
|
+
}, {
|
|
963
|
+
metaData: {
|
|
964
|
+
id: "engine.setting.event.BindEvents.openActionDialog"
|
|
551
965
|
},
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
966
|
+
ctx: () => ({
|
|
967
|
+
PLUGIN_NAME: d,
|
|
968
|
+
activePlugin: n,
|
|
969
|
+
pageState: o,
|
|
970
|
+
getBlockEvents: e,
|
|
971
|
+
getCurrentBlock: i,
|
|
972
|
+
removeEventLink: g,
|
|
973
|
+
getMaterial: p,
|
|
974
|
+
confirm: a,
|
|
975
|
+
locale: l,
|
|
976
|
+
highlightMethod: s,
|
|
977
|
+
commonEvents: u,
|
|
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"
|
|
556
1016
|
},
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
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"
|
|
1069
|
+
},
|
|
1070
|
+
ctx: () => ({
|
|
1071
|
+
PLUGIN_NAME: d,
|
|
1072
|
+
activePlugin: n,
|
|
1073
|
+
pageState: o,
|
|
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"
|
|
576
1116
|
},
|
|
577
|
-
|
|
578
|
-
|
|
1117
|
+
ctx: () => ({
|
|
1118
|
+
PLUGIN_NAME: d,
|
|
1119
|
+
activePlugin: n,
|
|
1120
|
+
pageState: o,
|
|
1121
|
+
getBlockEvents: e,
|
|
1122
|
+
getCurrentBlock: i,
|
|
1123
|
+
removeEventLink: g,
|
|
1124
|
+
getMaterial: p,
|
|
1125
|
+
confirm: a,
|
|
1126
|
+
locale: l,
|
|
1127
|
+
highlightMethod: s,
|
|
1128
|
+
commonEvents: u,
|
|
1129
|
+
state: t,
|
|
1130
|
+
isBlock: r,
|
|
1131
|
+
isEmpty: c,
|
|
1132
|
+
renderEventList: m,
|
|
1133
|
+
openActionDialog: f,
|
|
1134
|
+
deleteAction: x,
|
|
1135
|
+
delEvent: D,
|
|
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"
|
|
1161
|
+
},
|
|
1162
|
+
ctx: () => ({
|
|
1163
|
+
PLUGIN_NAME: d,
|
|
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"
|
|
579
1225
|
},
|
|
580
|
-
|
|
581
|
-
|
|
1226
|
+
ctx: () => ({
|
|
1227
|
+
PLUGIN_NAME: d,
|
|
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
|
|
582
1277
|
};
|
|
583
1278
|
}
|
|
584
|
-
},
|
|
585
|
-
function
|
|
586
|
-
const
|
|
587
|
-
return
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
1279
|
+
}, Bt = { class: "bind-action-list" }, Nt = { class: "popover-head" }, Vt = { class: "bind-event-list" }, It = ["onClick"], Pt = { class: "bind-actions" }, Mt = { class: "action-item bind-action-item" }, wt = ["onClick"], Lt = { class: "event-bind" }, Ot = { class: "action-buttons" }, St = { class: "empty-action" }, Tt = { class: "icon" };
|
|
1280
|
+
function Ut(d, n, o, e, i, g) {
|
|
1281
|
+
const p = M("icon-chevron-down"), a = M("tiny-button"), l = M("tiny-popover"), s = M("svg-icon"), u = M("block-link-event"), t = M("svg-button"), r = M("bind-events-dialog"), c = M("add-events-dialog");
|
|
1282
|
+
return B(), J(Oe, null, [
|
|
1283
|
+
v("div", Bt, [
|
|
1284
|
+
v("div", Nt, [
|
|
1285
|
+
b(l, {
|
|
591
1286
|
popperClass: "option-popper setting-advanced-bind-event-list",
|
|
592
1287
|
placement: "bottom-start",
|
|
593
1288
|
trigger: "hover",
|
|
@@ -595,318 +1290,577 @@ function On(f, o, a, e, r, _) {
|
|
|
595
1290
|
width: "256",
|
|
596
1291
|
"visible-arrow": !1
|
|
597
1292
|
}, {
|
|
598
|
-
reference:
|
|
599
|
-
|
|
600
|
-
default:
|
|
601
|
-
|
|
602
|
-
|
|
1293
|
+
reference: I(() => [
|
|
1294
|
+
b(a, { class: "bind-event-btn" }, {
|
|
1295
|
+
default: I(() => [
|
|
1296
|
+
n[2] || (n[2] = v("span", null, "绑定事件", -1)),
|
|
1297
|
+
b(p, { class: "icon-chevron-down bind-event-btn-icon" })
|
|
603
1298
|
]),
|
|
604
1299
|
_: 1,
|
|
605
1300
|
__: [2]
|
|
606
1301
|
})
|
|
607
1302
|
]),
|
|
608
|
-
default:
|
|
609
|
-
|
|
610
|
-
(
|
|
611
|
-
var
|
|
612
|
-
return
|
|
613
|
-
key:
|
|
614
|
-
class:
|
|
615
|
-
onClick: (
|
|
1303
|
+
default: I(() => [
|
|
1304
|
+
v("ul", Vt, [
|
|
1305
|
+
(B(!0), J(Oe, null, ze(e.renderEventList, (m, f) => {
|
|
1306
|
+
var x;
|
|
1307
|
+
return B(), J("li", {
|
|
1308
|
+
key: f,
|
|
1309
|
+
class: Ne(["bind-event-list-item", { "bind-event-list-item-notallow": e.state.bindActions[f] }]),
|
|
1310
|
+
onClick: (D) => e.openActionDialog({ eventName: f }, !0)
|
|
616
1311
|
}, [
|
|
617
|
-
|
|
618
|
-
], 10,
|
|
1312
|
+
v("div", null, Y(f) + " | " + Y(((x = m == null ? void 0 : m.label) == null ? void 0 : x[e.locale]) || f), 1)
|
|
1313
|
+
], 10, It);
|
|
619
1314
|
}), 128))
|
|
620
1315
|
])
|
|
621
1316
|
]),
|
|
622
1317
|
_: 1
|
|
623
1318
|
}),
|
|
624
|
-
|
|
1319
|
+
b(a, {
|
|
625
1320
|
class: "title add-custom-event-button bind-action-button-item",
|
|
626
|
-
onClick:
|
|
1321
|
+
onClick: n[0] || (n[0] = (m) => e.handleToggleAddEventDialog(!0))
|
|
627
1322
|
}, {
|
|
628
|
-
default:
|
|
629
|
-
|
|
1323
|
+
default: I(() => [
|
|
1324
|
+
b(s, {
|
|
630
1325
|
name: "add",
|
|
631
1326
|
class: "custom-event-button-icon"
|
|
632
1327
|
}),
|
|
633
|
-
|
|
1328
|
+
n[3] || (n[3] = v("span", { class: "custom-event-button-text" }, "添加新事件", -1))
|
|
634
1329
|
]),
|
|
635
1330
|
_: 1,
|
|
636
1331
|
__: [3]
|
|
637
1332
|
})
|
|
638
1333
|
]),
|
|
639
|
-
|
|
640
|
-
(
|
|
641
|
-
var
|
|
642
|
-
return
|
|
643
|
-
key:
|
|
1334
|
+
qe(v("ul", Pt, [
|
|
1335
|
+
(B(!0), J(Oe, null, ze(e.state.bindActions, (m) => {
|
|
1336
|
+
var f, x;
|
|
1337
|
+
return B(), J("li", {
|
|
1338
|
+
key: m.eventName
|
|
644
1339
|
}, [
|
|
645
|
-
|
|
646
|
-
|
|
1340
|
+
v("div", Mt, [
|
|
1341
|
+
v("div", {
|
|
647
1342
|
class: "binding-name",
|
|
648
|
-
onClick: (
|
|
1343
|
+
onClick: (D) => e.openActionDialog(m)
|
|
649
1344
|
}, [
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
1345
|
+
v("div", null, [
|
|
1346
|
+
ke(Y(m.eventName), 1),
|
|
1347
|
+
v("span", null, Y((x = (f = e.renderEventList[m.eventName]) == null ? void 0 : f.label) == null ? void 0 : x[e.locale]), 1)
|
|
653
1348
|
]),
|
|
654
|
-
|
|
655
|
-
class:
|
|
656
|
-
},
|
|
657
|
-
|
|
658
|
-
], 8,
|
|
659
|
-
|
|
660
|
-
e.isBlock ? (
|
|
1349
|
+
v("div", {
|
|
1350
|
+
class: Ne({ linked: m.linked })
|
|
1351
|
+
}, Y(m.linkedEventName), 3),
|
|
1352
|
+
v("span", Lt, Y(m.ref), 1)
|
|
1353
|
+
], 8, wt),
|
|
1354
|
+
v("div", Ot, [
|
|
1355
|
+
e.isBlock ? (B(), te(u, {
|
|
661
1356
|
key: 0,
|
|
662
|
-
data:
|
|
663
|
-
}, null, 8, ["data"])) :
|
|
664
|
-
|
|
1357
|
+
data: m
|
|
1358
|
+
}, null, 8, ["data"])) : Se("", !0),
|
|
1359
|
+
b(t, {
|
|
665
1360
|
name: "plugin-icon-page-schema",
|
|
666
1361
|
tips: "定位到代码",
|
|
667
1362
|
placement: "top",
|
|
668
1363
|
hoverBgColor: !1,
|
|
669
|
-
onClick: (
|
|
1364
|
+
onClick: (D) => e.openCodePanel(m)
|
|
670
1365
|
}, null, 8, ["onClick"]),
|
|
671
|
-
|
|
1366
|
+
b(t, {
|
|
672
1367
|
name: "setting",
|
|
673
1368
|
hoverBgColor: !1,
|
|
674
|
-
onClick: (
|
|
1369
|
+
onClick: (D) => e.openActionDialog(m, !1)
|
|
675
1370
|
}, null, 8, ["onClick"]),
|
|
676
|
-
|
|
1371
|
+
b(t, {
|
|
677
1372
|
name: "delete",
|
|
678
1373
|
hoverBgColor: !1,
|
|
679
|
-
onClick: (
|
|
1374
|
+
onClick: (D) => e.delEvent(m)
|
|
680
1375
|
}, null, 8, ["onClick"])
|
|
681
1376
|
])
|
|
682
1377
|
])
|
|
683
1378
|
]);
|
|
684
1379
|
}), 128))
|
|
685
1380
|
], 512), [
|
|
686
|
-
[
|
|
1381
|
+
[Ye, !e.isEmpty]
|
|
687
1382
|
]),
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
1383
|
+
qe(v("div", St, [
|
|
1384
|
+
v("div", Tt, [
|
|
1385
|
+
b(s, {
|
|
691
1386
|
name: "empty-action",
|
|
692
1387
|
class: "empty-action-icon"
|
|
693
1388
|
})
|
|
694
1389
|
]),
|
|
695
|
-
|
|
1390
|
+
n[4] || (n[4] = v("div", { class: "center" }, "支持添加原生DOM事件,然后点击 绑定事件 为画布所选元素增加事件", -1))
|
|
696
1391
|
], 512), [
|
|
697
|
-
[
|
|
1392
|
+
[Ye, e.isEmpty]
|
|
698
1393
|
])
|
|
699
1394
|
]),
|
|
700
|
-
|
|
1395
|
+
b(r, {
|
|
701
1396
|
eventBinding: e.state.eventBinding
|
|
702
1397
|
}, null, 8, ["eventBinding"]),
|
|
703
|
-
|
|
1398
|
+
b(c, {
|
|
704
1399
|
visible: e.state.showBindEventDialog,
|
|
705
1400
|
componentEvents: e.renderEventList,
|
|
706
|
-
onCloseDialog:
|
|
1401
|
+
onCloseDialog: n[1] || (n[1] = (m) => e.handleToggleAddEventDialog(!1)),
|
|
707
1402
|
onAddEvent: e.handleAddEvent
|
|
708
1403
|
}, null, 8, ["visible", "componentEvents", "onAddEvent"])
|
|
709
1404
|
], 64);
|
|
710
1405
|
}
|
|
711
|
-
const
|
|
1406
|
+
const jt = /* @__PURE__ */ Ie(At, [["render", Ut], ["__scopeId", "data-v-64f96b67"]]), {
|
|
1407
|
+
DEFAULT_LOOP_NAME: F
|
|
1408
|
+
} = me, {
|
|
1409
|
+
string2Obj: ce
|
|
1410
|
+
} = ge, zt = {
|
|
712
1411
|
components: {
|
|
713
|
-
SwitchConfigurator:
|
|
714
|
-
TinyTooltip:
|
|
715
|
-
VariableConfigurator:
|
|
716
|
-
InputConfigurator:
|
|
717
|
-
CodeConfigurator:
|
|
1412
|
+
SwitchConfigurator: de,
|
|
1413
|
+
TinyTooltip: vt,
|
|
1414
|
+
VariableConfigurator: le,
|
|
1415
|
+
InputConfigurator: se,
|
|
1416
|
+
CodeConfigurator: ae
|
|
718
1417
|
},
|
|
719
1418
|
inheritAttrs: !1,
|
|
720
1419
|
setup() {
|
|
721
|
-
const {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
1420
|
+
const {
|
|
1421
|
+
pageState: d
|
|
1422
|
+
} = y(), n = Ve(!1), o = Me(() => {
|
|
1423
|
+
var t;
|
|
1424
|
+
return ((t = n.value) == null ? void 0 : t.type) === G.JSEXPRESSION;
|
|
1425
|
+
}), e = h(() => {
|
|
1426
|
+
var t, r;
|
|
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({
|
|
728
1457
|
loopData: {
|
|
729
1458
|
type: G.JSEXPRESSION,
|
|
730
1459
|
value: "[]"
|
|
731
1460
|
},
|
|
732
1461
|
loopItem: "item",
|
|
733
1462
|
loopIndex: "index",
|
|
734
|
-
isLoop:
|
|
735
|
-
var
|
|
736
|
-
return ((
|
|
1463
|
+
isLoop: Me(() => {
|
|
1464
|
+
var t;
|
|
1465
|
+
return ((t = i.loopData) == null ? void 0 : t.type) === G.JSEXPRESSION;
|
|
737
1466
|
}),
|
|
738
1467
|
loopKey: "",
|
|
739
1468
|
shouldUpdate: !1
|
|
740
1469
|
});
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
([
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
if (!
|
|
1470
|
+
Ze(() => [d == null ? void 0 : d.currentSchema, i.shouldUpdate], ([t]) => {
|
|
1471
|
+
var r, c, m, f;
|
|
1472
|
+
n.value = (t == null ? void 0 : t.condition) === void 0 ? !0 : t == null ? void 0 : t.condition, i.loopData = t == null ? void 0 : t.loop, i.loopItem = ((r = t == null ? void 0 : t.loopArgs) == null ? void 0 : r[0]) || "", i.loopIndex = ((c = t == null ? void 0 : t.loopArgs) == null ? void 0 : c[1]) || "", i.loopKey = ((f = (m = t == null ? void 0 : t.props) == null ? void 0 : m.key) == null ? void 0 : f.value) || "";
|
|
1473
|
+
});
|
|
1474
|
+
const g = h((t = "") => {
|
|
1475
|
+
var D;
|
|
1476
|
+
t = t.replace(/\s*/g, "");
|
|
1477
|
+
const {
|
|
1478
|
+
getSchema: r,
|
|
1479
|
+
setProp: c
|
|
1480
|
+
} = z(), m = r();
|
|
1481
|
+
if (!m)
|
|
753
1482
|
return;
|
|
754
|
-
const
|
|
755
|
-
let
|
|
756
|
-
|
|
1483
|
+
const f = Number(t).toString() !== "NaN";
|
|
1484
|
+
let x = (D = m.props) == null ? void 0 : D.key;
|
|
1485
|
+
t && !f && (x = {
|
|
757
1486
|
type: G.JSEXPRESSION,
|
|
758
|
-
value:
|
|
759
|
-
}),
|
|
1487
|
+
value: t
|
|
1488
|
+
}), t || (i.isLoop ? x = {
|
|
760
1489
|
type: G.JSEXPRESSION,
|
|
761
1490
|
value: e()
|
|
762
|
-
} :
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
1491
|
+
} : x = ""), c("key", x);
|
|
1492
|
+
}, {
|
|
1493
|
+
metaData: {
|
|
1494
|
+
id: "engine.setting.event.AdvanceConfig.setLoopKey"
|
|
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
|
+
})
|
|
766
1520
|
});
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
1521
|
+
Ze([() => i.isLoop, () => i.loopIndex], () => {
|
|
1522
|
+
!i.loopKey && i.isLoop && g(e()), i.isLoop || g("");
|
|
1523
|
+
});
|
|
1524
|
+
const p = h(() => {
|
|
1525
|
+
var t;
|
|
1526
|
+
i.loopData = (t = z().getSchema()) == null ? void 0 : t.loop;
|
|
1527
|
+
}, {
|
|
1528
|
+
metaData: {
|
|
1529
|
+
id: "engine.setting.event.AdvanceConfig.openEditor"
|
|
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)
|
|
773
1560
|
return;
|
|
774
|
-
const {
|
|
775
|
-
|
|
776
|
-
|
|
1561
|
+
const {
|
|
1562
|
+
operateNode: m
|
|
1563
|
+
} = y();
|
|
1564
|
+
if (t === !1 || t != null && t.type)
|
|
1565
|
+
m({
|
|
1566
|
+
type: "updateAttributes",
|
|
1567
|
+
id: c.id,
|
|
1568
|
+
value: {
|
|
1569
|
+
condition: t
|
|
1570
|
+
}
|
|
1571
|
+
});
|
|
777
1572
|
else {
|
|
778
|
-
const {
|
|
779
|
-
|
|
1573
|
+
const {
|
|
1574
|
+
condition: f,
|
|
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
|
+
});
|
|
780
1586
|
}
|
|
781
|
-
|
|
782
|
-
},
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
1587
|
+
y().canvasApi.value.updateRect(), n.value = t;
|
|
1588
|
+
}, {
|
|
1589
|
+
metaData: {
|
|
1590
|
+
id: "engine.setting.event.AdvanceConfig.setConfig"
|
|
1591
|
+
},
|
|
1592
|
+
ctx: () => ({
|
|
1593
|
+
pageState: d,
|
|
1594
|
+
condition: n,
|
|
1595
|
+
isBind: o,
|
|
1596
|
+
getIndexName: e,
|
|
1597
|
+
state: i,
|
|
1598
|
+
setLoopKey: g,
|
|
1599
|
+
openEditor: p,
|
|
1600
|
+
setConfig: a,
|
|
1601
|
+
setLoopIndex: l,
|
|
1602
|
+
setLoop: s,
|
|
1603
|
+
setLoopItem: u,
|
|
1604
|
+
CodeConfigurator: ae,
|
|
1605
|
+
InputConfigurator: se,
|
|
1606
|
+
SwitchConfigurator: de,
|
|
1607
|
+
VariableConfigurator: le,
|
|
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
|
|
802
1627
|
}
|
|
803
|
-
|
|
1628
|
+
});
|
|
1629
|
+
}, {
|
|
1630
|
+
metaData: {
|
|
1631
|
+
id: "engine.setting.event.AdvanceConfig.setLoopIndex"
|
|
804
1632
|
},
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
1633
|
+
ctx: () => ({
|
|
1634
|
+
pageState: d,
|
|
1635
|
+
condition: n,
|
|
1636
|
+
isBind: o,
|
|
1637
|
+
getIndexName: e,
|
|
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"
|
|
810
1732
|
},
|
|
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,
|
|
811
1765
|
DEFAULT_LOOP_NAME: F,
|
|
812
|
-
openEditor:
|
|
813
|
-
setLoopIndex:
|
|
814
|
-
setLoopKey:
|
|
1766
|
+
openEditor: p,
|
|
1767
|
+
setLoopIndex: l,
|
|
1768
|
+
setLoopKey: g,
|
|
815
1769
|
getIndexName: e
|
|
816
1770
|
};
|
|
817
1771
|
}
|
|
818
|
-
},
|
|
819
|
-
function
|
|
820
|
-
var
|
|
821
|
-
const
|
|
822
|
-
return
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
e.isBind ? (
|
|
1772
|
+
}, Ft = { class: "advanced-config-container" }, Rt = { class: "advnce-config" }, $t = { class: "advanced-config-form-item" }, Jt = ["title"], Xt = { class: "advnce-config loop-data-item" }, Kt = { class: "advanced-config-form-item" }, Ht = ["title"], Gt = { class: "advnce-config" }, qt = { class: "advanced-config-form-item" }, Yt = { class: "advnce-config" }, Zt = { class: "advanced-config-form-item" }, Wt = { class: "advnce-config" }, Qt = { class: "advanced-config-form-item" };
|
|
1773
|
+
function en(d, n, o, e, i, g) {
|
|
1774
|
+
var t, r;
|
|
1775
|
+
const p = M("switch-configurator"), a = M("variable-configurator"), l = M("code-configurator"), s = M("input-configurator"), u = M("tiny-tooltip");
|
|
1776
|
+
return B(), J("div", Ft, [
|
|
1777
|
+
v("div", Rt, [
|
|
1778
|
+
n[6] || (n[6] = v("label", { class: "text-ellipsis-multiple" }, "是否渲染", -1)),
|
|
1779
|
+
v("div", $t, [
|
|
1780
|
+
e.isBind ? (B(), J("div", {
|
|
827
1781
|
key: 1,
|
|
828
1782
|
class: "binding-state text-ellipsis-multiple",
|
|
829
1783
|
title: e.condition.value
|
|
830
|
-
}, " 已绑定:" +
|
|
1784
|
+
}, " 已绑定:" + Y(e.condition.value), 9, Jt)) : (B(), te(p, {
|
|
831
1785
|
key: 0,
|
|
832
1786
|
modelValue: e.condition,
|
|
833
1787
|
"onUpdate:modelValue": e.setConfig
|
|
834
1788
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])),
|
|
835
|
-
|
|
1789
|
+
b(a, {
|
|
836
1790
|
modelValue: e.condition,
|
|
837
1791
|
"onUpdate:modelValue": [
|
|
838
|
-
|
|
1792
|
+
n[0] || (n[0] = (c) => e.condition = c),
|
|
839
1793
|
e.setConfig
|
|
840
1794
|
],
|
|
841
1795
|
name: "advance"
|
|
842
1796
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
843
1797
|
])
|
|
844
1798
|
]),
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
e.state.isLoop ? (
|
|
1799
|
+
v("div", Xt, [
|
|
1800
|
+
n[7] || (n[7] = v("label", { class: "text-ellipsis-multiple" }, "循环数据", -1)),
|
|
1801
|
+
v("div", Kt, [
|
|
1802
|
+
e.state.isLoop ? (B(), J("div", {
|
|
849
1803
|
key: 1,
|
|
850
1804
|
class: "binding-state text-ellipsis-multiple",
|
|
851
|
-
title: (
|
|
852
|
-
}, " 已绑定:" +
|
|
1805
|
+
title: (t = e.state.loopData) == null ? void 0 : t.value
|
|
1806
|
+
}, " 已绑定:" + Y((r = e.state.loopData) == null ? void 0 : r.value), 9, Ht)) : (B(), te(l, {
|
|
853
1807
|
key: 0,
|
|
854
1808
|
modelValue: e.state.loopData,
|
|
855
1809
|
"onUpdate:modelValue": [
|
|
856
|
-
|
|
1810
|
+
n[1] || (n[1] = (c) => e.state.loopData = c),
|
|
857
1811
|
e.setLoop
|
|
858
1812
|
],
|
|
859
1813
|
"data-type": "JSExpression",
|
|
860
1814
|
onOpen: e.openEditor
|
|
861
1815
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onOpen"])),
|
|
862
|
-
|
|
1816
|
+
b(a, {
|
|
863
1817
|
modelValue: e.state.loopData,
|
|
864
1818
|
"onUpdate:modelValue": [
|
|
865
|
-
|
|
1819
|
+
n[2] || (n[2] = (c) => e.state.loopData = c),
|
|
866
1820
|
e.setLoop
|
|
867
1821
|
],
|
|
868
1822
|
name: "advance"
|
|
869
1823
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
870
1824
|
])
|
|
871
1825
|
]),
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
1826
|
+
v("div", Gt, [
|
|
1827
|
+
n[8] || (n[8] = v("label", { class: "text-ellipsis-multiple" }, "迭代变量名", -1)),
|
|
1828
|
+
v("div", qt, [
|
|
1829
|
+
b(s, {
|
|
876
1830
|
modelValue: e.state.loopItem,
|
|
877
1831
|
"onUpdate:modelValue": [
|
|
878
|
-
|
|
1832
|
+
n[3] || (n[3] = (c) => e.state.loopItem = c),
|
|
879
1833
|
e.setLoopItem
|
|
880
1834
|
],
|
|
881
1835
|
placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.ITEM}`
|
|
882
1836
|
}, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
|
|
883
1837
|
])
|
|
884
1838
|
]),
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
1839
|
+
v("div", Yt, [
|
|
1840
|
+
n[9] || (n[9] = v("label", { class: "text-ellipsis-multiple" }, "索引变量名", -1)),
|
|
1841
|
+
v("div", Zt, [
|
|
1842
|
+
b(s, {
|
|
889
1843
|
modelValue: e.state.loopIndex,
|
|
890
1844
|
"onUpdate:modelValue": [
|
|
891
|
-
|
|
1845
|
+
n[4] || (n[4] = (c) => e.state.loopIndex = c),
|
|
892
1846
|
e.setLoopIndex
|
|
893
1847
|
],
|
|
894
1848
|
placeholder: `默认值为:${e.DEFAULT_LOOP_NAME.INDEX}`
|
|
895
1849
|
}, null, 8, ["modelValue", "placeholder", "onUpdate:modelValue"])
|
|
896
1850
|
])
|
|
897
1851
|
]),
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
u
|
|
1852
|
+
v("div", Wt, [
|
|
1853
|
+
n[10] || (n[10] = v("label", { class: "text-ellipsis-multiple" }, "key", -1)),
|
|
1854
|
+
v("div", Qt, [
|
|
1855
|
+
b(u, {
|
|
902
1856
|
content: "建议填写循环项中的唯一值(如item.id),如果填写为数字将不保存",
|
|
903
1857
|
effect: "light"
|
|
904
1858
|
}, {
|
|
905
|
-
default:
|
|
906
|
-
|
|
1859
|
+
default: I(() => [
|
|
1860
|
+
b(s, {
|
|
907
1861
|
modelValue: e.state.loopKey,
|
|
908
1862
|
"onUpdate:modelValue": [
|
|
909
|
-
|
|
1863
|
+
n[5] || (n[5] = (c) => e.state.loopKey = c),
|
|
910
1864
|
e.setLoopKey
|
|
911
1865
|
],
|
|
912
1866
|
placeholder: `默认为索引名:${e.getIndexName()}`
|
|
@@ -918,44 +1872,46 @@ function Wn(f, o, a, e, r, _) {
|
|
|
918
1872
|
])
|
|
919
1873
|
]);
|
|
920
1874
|
}
|
|
921
|
-
const
|
|
1875
|
+
const tn = /* @__PURE__ */ Ie(zt, [["render", en], ["__scopeId", "data-v-275ffc6c"]]), nn = {
|
|
922
1876
|
__name: "Main",
|
|
923
1877
|
props: {
|
|
924
1878
|
fixedPanels: Array
|
|
925
1879
|
},
|
|
926
1880
|
emits: [],
|
|
927
|
-
setup(
|
|
928
|
-
const
|
|
929
|
-
|
|
1881
|
+
setup(d, { emit: n }) {
|
|
1882
|
+
const o = Ve(["bindEvent", "advancedConfig"]), {
|
|
1883
|
+
PLUGIN_NAME: e
|
|
1884
|
+
} = V(), g = we({
|
|
1885
|
+
emitEvent: n
|
|
930
1886
|
});
|
|
931
|
-
return
|
|
1887
|
+
return tt("panelState", g), (p, a) => (B(), te(S(ht), {
|
|
932
1888
|
title: "高级",
|
|
933
|
-
"fixed-panels":
|
|
934
|
-
"fixed-name":
|
|
1889
|
+
"fixed-panels": d.fixedPanels,
|
|
1890
|
+
"fixed-name": S(e).Event,
|
|
935
1891
|
"header-margin-bottom": 0,
|
|
936
|
-
onClose:
|
|
1892
|
+
onClose: a[1] || (a[1] = (l) => p.$emit("close"))
|
|
937
1893
|
}, {
|
|
938
|
-
content:
|
|
939
|
-
|
|
940
|
-
modelValue:
|
|
941
|
-
"onUpdate:modelValue":
|
|
1894
|
+
content: I(() => [
|
|
1895
|
+
b(S(ut), {
|
|
1896
|
+
modelValue: o.value,
|
|
1897
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => o.value = l)
|
|
942
1898
|
}, {
|
|
943
|
-
default:
|
|
944
|
-
|
|
1899
|
+
default: I(() => [
|
|
1900
|
+
b(S(Qe), {
|
|
945
1901
|
title: "事件绑定",
|
|
946
1902
|
name: "bindEvent"
|
|
947
1903
|
}, {
|
|
948
|
-
default:
|
|
949
|
-
|
|
1904
|
+
default: I(() => [
|
|
1905
|
+
b(jt)
|
|
950
1906
|
]),
|
|
951
1907
|
_: 1
|
|
952
1908
|
}),
|
|
953
|
-
|
|
1909
|
+
b(S(Qe), {
|
|
954
1910
|
title: "高级配置",
|
|
955
1911
|
name: "advancedConfig"
|
|
956
1912
|
}, {
|
|
957
|
-
default:
|
|
958
|
-
|
|
1913
|
+
default: I(() => [
|
|
1914
|
+
b(tn)
|
|
959
1915
|
]),
|
|
960
1916
|
_: 1
|
|
961
1917
|
})
|
|
@@ -966,114 +1922,222 @@ const Qn = /* @__PURE__ */ H(Un, [["render", Wn], ["__scopeId", "data-v-40bd3762
|
|
|
966
1922
|
_: 1
|
|
967
1923
|
}, 8, ["fixed-panels", "fixed-name"]));
|
|
968
1924
|
}
|
|
969
|
-
},
|
|
1925
|
+
}, ee = "newMethod", je = /[^0-9a-zA-Z_$]/, Be = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/, re = {
|
|
1926
|
+
default: "选择已有方法或者添加新方法(点击 确定 之后将在JS面板中创建一个该名称的新方法)",
|
|
970
1927
|
exist: "方法名称已存在",
|
|
971
1928
|
ruleInvalid: "请输入有效的方法名,可以由字母、数字、下划线、$ 符号组成,不能以数字开头",
|
|
972
1929
|
empty: "方法名称不能为空"
|
|
973
|
-
},
|
|
1930
|
+
}, on = {
|
|
974
1931
|
components: {
|
|
975
|
-
MonacoEditor:
|
|
976
|
-
TinyInput:
|
|
977
|
-
TinyCheckbox:
|
|
1932
|
+
MonacoEditor: Ae,
|
|
1933
|
+
TinyInput: Fe,
|
|
1934
|
+
TinyCheckbox: ft
|
|
978
1935
|
},
|
|
979
1936
|
props: {
|
|
980
1937
|
dialogVisible: Boolean
|
|
981
1938
|
},
|
|
982
1939
|
setup() {
|
|
983
|
-
const {
|
|
1940
|
+
const {
|
|
1941
|
+
getMethodNameList: d
|
|
1942
|
+
} = k(C.Page), n = ot("context"), o = {
|
|
984
1943
|
language: "json",
|
|
985
1944
|
lineNumbers: !1,
|
|
986
1945
|
minimap: {
|
|
987
1946
|
enabled: !1
|
|
988
1947
|
}
|
|
989
|
-
}, e = (
|
|
990
|
-
|
|
991
|
-
},
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1948
|
+
}, e = h((l) => {
|
|
1949
|
+
n.editorContent = l;
|
|
1950
|
+
}, {
|
|
1951
|
+
metaData: {
|
|
1952
|
+
id: "engine.setting.event.BindEventsDialogContent.editorContentChange"
|
|
1953
|
+
},
|
|
1954
|
+
ctx: () => ({
|
|
1955
|
+
getMethodNameList: d,
|
|
1956
|
+
context: n,
|
|
1957
|
+
editorOptions: o,
|
|
1958
|
+
editorContentChange: e,
|
|
1959
|
+
validMethodNameEmpty: i,
|
|
1960
|
+
validMethodNameExist: g,
|
|
1961
|
+
invalidMethodName: p,
|
|
1962
|
+
change: a,
|
|
1963
|
+
VueMonaco: Ae,
|
|
1964
|
+
getMetaApi: k,
|
|
1965
|
+
META_APP: C,
|
|
1966
|
+
METHOD_TIPS_MAP: re,
|
|
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;
|
|
1008
2046
|
}
|
|
1009
|
-
|
|
2047
|
+
}
|
|
2048
|
+
n.tipError = !1, n.tip = "";
|
|
2049
|
+
}, {
|
|
2050
|
+
metaData: {
|
|
2051
|
+
id: "engine.setting.event.BindEventsDialogContent.change"
|
|
1010
2052
|
},
|
|
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,
|
|
1011
2075
|
editorContentChange: e
|
|
1012
2076
|
};
|
|
1013
2077
|
}
|
|
1014
|
-
},
|
|
2078
|
+
}, an = { class: "content-right" }, sn = { class: "new-action-tip" }, ln = { class: "content-right-title" }, dn = { class: "set-params-tip" }, cn = { class: "content-right-monaco" }, rn = {
|
|
1015
2079
|
key: 1,
|
|
1016
2080
|
class: "mark"
|
|
1017
|
-
},
|
|
2081
|
+
}, mn = {
|
|
1018
2082
|
key: 0,
|
|
1019
2083
|
class: "params-tip"
|
|
1020
2084
|
};
|
|
1021
|
-
function
|
|
1022
|
-
const
|
|
1023
|
-
return
|
|
1024
|
-
|
|
1025
|
-
class:
|
|
2085
|
+
function gn(d, n, o, e, i, g) {
|
|
2086
|
+
const p = M("tiny-input"), a = M("tiny-checkbox"), l = M("monaco-editor");
|
|
2087
|
+
return B(), J("div", an, [
|
|
2088
|
+
v("div", {
|
|
2089
|
+
class: Ne(["content-right-top", { "tip-error": e.context.tipError }])
|
|
1026
2090
|
}, [
|
|
1027
|
-
|
|
1028
|
-
|
|
2091
|
+
n[2] || (n[2] = v("div", { class: "content-right-title" }, "方法名称", -1)),
|
|
2092
|
+
b(p, {
|
|
1029
2093
|
modelValue: e.context.bindMethodInfo.name,
|
|
1030
2094
|
"onUpdate:modelValue": [
|
|
1031
|
-
|
|
2095
|
+
n[0] || (n[0] = (s) => e.context.bindMethodInfo.name = s),
|
|
1032
2096
|
e.change
|
|
1033
2097
|
],
|
|
1034
2098
|
disabled: e.context.bindMethodInfo.type !== e.NEW_METHOD_TYPE,
|
|
1035
|
-
class:
|
|
2099
|
+
class: Ne([{ "status-error": e.context.tipError }]),
|
|
1036
2100
|
placeholder: "请从左侧选择一个方法进行绑定,或者选择添加新方法,输入自定义方法名称。"
|
|
1037
2101
|
}, null, 8, ["modelValue", "disabled", "class", "onUpdate:modelValue"]),
|
|
1038
|
-
|
|
2102
|
+
v("div", sn, Y(e.context.tip), 1)
|
|
1039
2103
|
], 2),
|
|
1040
|
-
|
|
1041
|
-
class:
|
|
2104
|
+
v("div", {
|
|
2105
|
+
class: Ne(["content-right-bottom", { "tip-error": !e.context.isValidParams }])
|
|
1042
2106
|
}, [
|
|
1043
|
-
|
|
1044
|
-
|
|
2107
|
+
v("div", ln, [
|
|
2108
|
+
b(a, {
|
|
1045
2109
|
modelValue: e.context.enableExtraParams,
|
|
1046
|
-
"onUpdate:modelValue":
|
|
2110
|
+
"onUpdate:modelValue": n[1] || (n[1] = (s) => e.context.enableExtraParams = s),
|
|
1047
2111
|
name: "tiny-checkbox"
|
|
1048
2112
|
}, {
|
|
1049
|
-
default:
|
|
1050
|
-
|
|
2113
|
+
default: I(() => n[3] || (n[3] = [
|
|
2114
|
+
ke("扩展参数设置")
|
|
1051
2115
|
])),
|
|
1052
2116
|
_: 1,
|
|
1053
2117
|
__: [3]
|
|
1054
2118
|
}, 8, ["modelValue"]),
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
2119
|
+
v("div", dn, [
|
|
2120
|
+
n[4] || (n[4] = v("div", null, "扩展参数:调用当前事件传入的真实参数,数组格式,追加在原有事件参数之后", -1)),
|
|
2121
|
+
ke(" 如: " + Y(e.context.bindMethodInfo.name) + "(eventArgs, extParam1, extParam2, ...) ", 1)
|
|
1058
2122
|
])
|
|
1059
2123
|
]),
|
|
1060
|
-
|
|
1061
|
-
|
|
2124
|
+
v("div", cn, [
|
|
2125
|
+
o.dialogVisible ? (B(), te(l, {
|
|
1062
2126
|
key: 0,
|
|
1063
2127
|
value: e.context.editorContent,
|
|
1064
2128
|
options: e.editorOptions,
|
|
1065
2129
|
onChange: e.editorContentChange,
|
|
1066
2130
|
class: "monaco-editor"
|
|
1067
|
-
}, null, 8, ["value", "options", "onChange"])) :
|
|
1068
|
-
e.context.enableExtraParams ?
|
|
2131
|
+
}, null, 8, ["value", "options", "onChange"])) : Se("", !0),
|
|
2132
|
+
e.context.enableExtraParams ? Se("", !0) : (B(), J("div", rn))
|
|
1069
2133
|
]),
|
|
1070
|
-
!e.context.isValidParams && e.context.enableExtraParams ? (
|
|
2134
|
+
!e.context.isValidParams && e.context.enableExtraParams ? (B(), J("div", mn, ' 请输入数组格式的参数,参数可以为表达式。例如:["extParam1", "item.status", 1, "getNames()"] ')) : Se("", !0)
|
|
1071
2135
|
], 2)
|
|
1072
2136
|
]);
|
|
1073
2137
|
}
|
|
1074
|
-
const
|
|
2138
|
+
const pn = /* @__PURE__ */ Ie(on, [["render", gn], ["__scopeId", "data-v-fc0b367d"]]), vn = {
|
|
1075
2139
|
components: {
|
|
1076
|
-
TinySearch:
|
|
2140
|
+
TinySearch: _t
|
|
1077
2141
|
},
|
|
1078
2142
|
props: {
|
|
1079
2143
|
eventBinding: {
|
|
@@ -1081,70 +2145,110 @@ const uo = /* @__PURE__ */ H(to, [["render", po], ["__scopeId", "data-v-f2c9b5af
|
|
|
1081
2145
|
default: () => ({})
|
|
1082
2146
|
}
|
|
1083
2147
|
},
|
|
1084
|
-
setup(
|
|
1085
|
-
const {
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
2148
|
+
setup(d) {
|
|
2149
|
+
const {
|
|
2150
|
+
getMethodNameList: n
|
|
2151
|
+
} = k(C.Page), o = Ve(""), e = Ve([]), i = ot("context"), g = h((a, l) => {
|
|
2152
|
+
const s = a.map((r) => {
|
|
2153
|
+
var c;
|
|
2154
|
+
return Number.parseInt((c = r.match(/\d+$/)) == null ? void 0 : c[0]) || 0;
|
|
2155
|
+
}).sort((r, c) => r - c).pop();
|
|
2156
|
+
let t = `${(l == null ? void 0 : l.replace(je, "_")) || ""}New`;
|
|
2157
|
+
return s > -1 && (t += `${s + 1}`), t;
|
|
2158
|
+
}, {
|
|
2159
|
+
metaData: {
|
|
2160
|
+
id: "engine.setting.event.BindEventsDialogSidebar.generateMethodName"
|
|
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 = {
|
|
1098
2198
|
title: "添加新方法",
|
|
1099
|
-
name:
|
|
1100
|
-
type:
|
|
2199
|
+
name: g(l, a),
|
|
2200
|
+
type: ee
|
|
1101
2201
|
};
|
|
1102
|
-
(
|
|
1103
|
-
|
|
1104
|
-
|
|
2202
|
+
(c = d.eventBinding) != null && c.ref ? p({
|
|
2203
|
+
name: d.eventBinding.ref
|
|
2204
|
+
}) : p(u);
|
|
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];
|
|
1105
2209
|
}), {
|
|
1106
|
-
context:
|
|
1107
|
-
searchValue:
|
|
2210
|
+
context: i,
|
|
2211
|
+
searchValue: o,
|
|
1108
2212
|
filteredMethodList: e,
|
|
1109
|
-
selectMethod:
|
|
2213
|
+
selectMethod: p
|
|
1110
2214
|
};
|
|
1111
2215
|
}
|
|
1112
|
-
},
|
|
1113
|
-
function
|
|
1114
|
-
const
|
|
1115
|
-
return
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
2216
|
+
}, un = { class: "dialog-content-left" }, fn = { class: "left-list-wrap" }, _n = { class: "left-action-list" }, hn = { class: "action-list-wrap" }, bn = ["onClick"];
|
|
2217
|
+
function En(d, n, o, e, i, g) {
|
|
2218
|
+
const p = M("tiny-search");
|
|
2219
|
+
return B(), J("div", un, [
|
|
2220
|
+
n[1] || (n[1] = v("div", { class: "left-title" }, "响应方法", -1)),
|
|
2221
|
+
v("div", fn, [
|
|
2222
|
+
v("div", _n, [
|
|
2223
|
+
b(p, {
|
|
1120
2224
|
modelValue: e.searchValue,
|
|
1121
|
-
"onUpdate:modelValue":
|
|
2225
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => e.searchValue = a),
|
|
1122
2226
|
placeholder: "搜索"
|
|
1123
2227
|
}, null, 8, ["modelValue"]),
|
|
1124
|
-
|
|
1125
|
-
(
|
|
1126
|
-
key:
|
|
1127
|
-
onClick: (
|
|
2228
|
+
v("ul", hn, [
|
|
2229
|
+
(B(!0), J(Oe, null, ze(e.filteredMethodList, (a) => (B(), J("li", {
|
|
2230
|
+
key: a.name,
|
|
2231
|
+
onClick: (l) => e.selectMethod(a)
|
|
1128
2232
|
}, [
|
|
1129
|
-
|
|
1130
|
-
class:
|
|
1131
|
-
},
|
|
1132
|
-
], 8,
|
|
2233
|
+
v("div", {
|
|
2234
|
+
class: Ne(["action-name", { active: a.name === e.context.bindMethodInfo.name }])
|
|
2235
|
+
}, Y(a.title || a.name), 3)
|
|
2236
|
+
], 8, bn))), 128))
|
|
1133
2237
|
])
|
|
1134
2238
|
])
|
|
1135
2239
|
])
|
|
1136
2240
|
]);
|
|
1137
2241
|
}
|
|
1138
|
-
const
|
|
1139
|
-
...
|
|
1140
|
-
entry:
|
|
1141
|
-
options: { commonEvents:
|
|
2242
|
+
const yn = /* @__PURE__ */ Ie(vn, [["render", En], ["__scopeId", "data-v-9bcc2645"]]), wn = {
|
|
2243
|
+
...U,
|
|
2244
|
+
entry: nn,
|
|
2245
|
+
options: { commonEvents: at },
|
|
1142
2246
|
components: {
|
|
1143
|
-
BindEventsDialogSidebar:
|
|
1144
|
-
BindEventsDialogContent:
|
|
2247
|
+
BindEventsDialogSidebar: yn,
|
|
2248
|
+
BindEventsDialogContent: pn
|
|
1145
2249
|
}
|
|
1146
2250
|
};
|
|
1147
2251
|
export {
|
|
1148
|
-
|
|
2252
|
+
wn as default
|
|
1149
2253
|
};
|
|
1150
2254
|
//# sourceMappingURL=index.js.map
|