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