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