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