epic-designer-gold 0.0.18 → 0.0.20
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/{attributeView-xFHazPhU.cjs → attributeView-CBU2cmHF.cjs} +1 -1
- package/dist/{attributeView-B9F_UkWB.js → attributeView-ukvra0JR.js} +1 -1
- package/dist/{eventView-B17FncUM.js → eventView-CxT-MCmM.js} +1 -1
- package/dist/{eventView-DcUUt0wC.cjs → eventView-DPBh2jJb.cjs} +1 -1
- package/dist/{index-LveNbnCD.js → index-Boh9Xc_a.js} +1 -1
- package/dist/{index-D7JjJy3L.cjs → index-Bp5jwkKr.cjs} +1 -1
- package/dist/index-C7VIh0HN.js +4 -0
- package/dist/{index-BPJ67Apd.js → index-CGN7CLXA.js} +1 -1
- package/dist/{index-QM5lUp_E.cjs → index-CYS9fPUv.cjs} +1 -1
- package/dist/index-CgHkcwzW.cjs +10 -0
- package/dist/{index-DJ9FhHey.js → index-CrK_IhiA.js} +1 -1
- package/dist/{index-CILvmkry.cjs → index-D3mt_EWz.cjs} +1 -1
- package/dist/{index-h3vbgf9-.cjs → index-DCLSI4pq.cjs} +1 -1
- package/dist/{index-5T_iXdMV.cjs → index-DK8A_Wv1.cjs} +1 -1
- package/dist/{index-Cm3Jcpcv.cjs → index-DL78CTyg.cjs} +1 -1
- package/dist/{index-Z9miUEWt.js → index-DMYNC73J.js} +1 -1
- package/dist/{index-D38KoL_8.js → index-Dz7IFRkI.js} +1 -1
- package/dist/{index-Cn31n9Ni.js → index-O79tvUa3.js} +1 -1
- package/dist/{index-CBD1g29V.js → index-YMEmD-hy.js} +1 -1
- package/dist/{index-Cs7FieAs.js → index-Z9U61tAn.js} +485 -515
- package/dist/{index-CqegmH7K.js → index-aHQ5toGq.js} +1 -1
- package/dist/{index-BvgsMQ0r.cjs → index-bo3mlsNv.cjs} +1 -1
- package/dist/{index-X5HbU9iP.cjs → index-c0bxi-CF.cjs} +1 -1
- package/dist/{index-BmnjsvG9.cjs → index-jOD8Jnq_.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{styleView-CGX70aZc.cjs → styleView-CCzd_7fc.cjs} +1 -1
- package/dist/{styleView-B_GTo5jT.js → styleView-OSZZjuEF.js} +1 -1
- package/package.json +1 -1
- package/dist/index-Cy_xP_CE.js +0 -4
- package/dist/index-w0VNJWNM.cjs +0 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { p as F, a as
|
|
3
|
-
function
|
|
1
|
+
import { ref as A, reactive as Q, defineComponent as Y, openBlock as R, createBlock as z, unref as C, mergeProps as he, withCtx as P, renderSlot as $, getCurrentInstance as ae, inject as K, watch as O, useAttrs as _e, provide as N, shallowRef as Pe, computed as T, watchEffect as se, onUnmounted as Se, resolveComponent as Oe, resolveDynamicComponent as Ve, createVNode as L, createCommentVNode as Ae, useSlots as Fe, createElementBlock as ve, Suspense as De, createElementVNode as J, Fragment as Me, renderList as Re, nextTick as j, effectScope as $e, isRef as Ne, getCurrentScope as Be, onScopeDispose as Ue, onMounted as ye, normalizeClass as Te, toRaw as we } from "vue";
|
|
2
|
+
import { p as F, a as be, l as G, E as fe } from "./axios-ITY6Uw7A.js";
|
|
3
|
+
function le(e = 10) {
|
|
4
4
|
const a = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
5
5
|
let n = "";
|
|
6
6
|
for (let o = 0; o < e; o++) {
|
|
@@ -9,44 +9,44 @@ function ce(e = 10) {
|
|
|
9
9
|
}
|
|
10
10
|
return n;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Le(e) {
|
|
13
13
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function B(e, a = /* @__PURE__ */ new WeakMap()) {
|
|
16
16
|
if (typeof e != "object" || e === null)
|
|
17
17
|
return e;
|
|
18
18
|
if (a.has(e))
|
|
19
19
|
return a.get(e);
|
|
20
20
|
if (Array.isArray(e)) {
|
|
21
|
-
const o = e.map((t) =>
|
|
21
|
+
const o = e.map((t) => B(t, a));
|
|
22
22
|
return a.set(e, o), o;
|
|
23
23
|
}
|
|
24
24
|
const n = {};
|
|
25
25
|
return a.set(e, n), Object.keys(e).forEach((o) => {
|
|
26
|
-
n[o] =
|
|
26
|
+
n[o] = B(e[o], a);
|
|
27
27
|
}), n;
|
|
28
28
|
}
|
|
29
29
|
function Ot(e) {
|
|
30
|
-
const [a] = We([
|
|
30
|
+
const [a] = We([B(e)], (n) => {
|
|
31
31
|
var t, r;
|
|
32
32
|
const o = {
|
|
33
33
|
...n,
|
|
34
|
-
id: `${n.type}_${
|
|
34
|
+
id: `${n.type}_${le(8)}`
|
|
35
35
|
};
|
|
36
36
|
return (o.field || o.input) && !((r = (t = F.getComponentConfingByType(o.type)) == null ? void 0 : t.editConstraints) != null && r.fixedField) && (o.field = o.id), o;
|
|
37
37
|
});
|
|
38
38
|
return a;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function W(e, a, n = !0) {
|
|
41
41
|
for (const [o, t] of Object.entries(a)) {
|
|
42
42
|
let r = e == null ? void 0 : e[o];
|
|
43
|
-
r && t && typeof r == "object" && typeof t == "object" ? (Array.isArray(r) && !Array.isArray(t) ? r = e[o] = {} : !Array.isArray(r) && Array.isArray(t) && (r = e[o] = []),
|
|
43
|
+
r && t && typeof r == "object" && typeof t == "object" ? (Array.isArray(r) && !Array.isArray(t) ? r = e[o] = {} : !Array.isArray(r) && Array.isArray(t) && (r = e[o] = []), W(r, t, n)) : e[o] = t;
|
|
44
44
|
}
|
|
45
45
|
n && Object.keys(e).reverse().forEach((o) => {
|
|
46
46
|
a.hasOwnProperty(o) || (Array.isArray(e) ? e.splice(Number(o), 1) : delete e[o]);
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Ee(e, a, n = [], o = /* @__PURE__ */ new WeakMap()) {
|
|
50
50
|
const t = (r) => {
|
|
51
51
|
if (Array.isArray(r))
|
|
52
52
|
return r.map(t);
|
|
@@ -54,16 +54,16 @@ function Ie(e, a, n = [], o = /* @__PURE__ */ new WeakMap()) {
|
|
|
54
54
|
if (o.has(r))
|
|
55
55
|
return "[Circular]";
|
|
56
56
|
o.set(r, !0);
|
|
57
|
-
const l = Object.keys(r).sort(),
|
|
57
|
+
const l = Object.keys(r).sort(), i = {};
|
|
58
58
|
return l.forEach((u) => {
|
|
59
|
-
n.includes(u) || (
|
|
60
|
-
}), o.delete(r),
|
|
59
|
+
n.includes(u) || (i[u] = t(r[u]));
|
|
60
|
+
}), o.delete(r), i;
|
|
61
61
|
} else
|
|
62
62
|
return r;
|
|
63
63
|
};
|
|
64
64
|
return JSON.stringify(t(e)) === JSON.stringify(t(a));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ze(e, a) {
|
|
67
67
|
const n = [];
|
|
68
68
|
let o = !1;
|
|
69
69
|
function t(r) {
|
|
@@ -72,7 +72,7 @@ function Le(e, a) {
|
|
|
72
72
|
;
|
|
73
73
|
if (!o && r.slots)
|
|
74
74
|
for (let l in r.slots)
|
|
75
|
-
for (let
|
|
75
|
+
for (let i = 0; i < r.slots[l].length && (t(r.slots[l][i]), !o); i++)
|
|
76
76
|
;
|
|
77
77
|
o || n.pop();
|
|
78
78
|
}
|
|
@@ -121,8 +121,8 @@ function oe(e, a, n = !1, o) {
|
|
|
121
121
|
for (; r.length; ) {
|
|
122
122
|
const l = r.pop();
|
|
123
123
|
if (l != null && l.children && (!o || o(l)) && r.push(...l.children), l != null && l.slots && (!o || o(l)))
|
|
124
|
-
for (let
|
|
125
|
-
r.push(...l.slots[
|
|
124
|
+
for (let i in l.slots)
|
|
125
|
+
r.push(...l.slots[i]);
|
|
126
126
|
if (a(l) && (t.push(l), n))
|
|
127
127
|
return l;
|
|
128
128
|
}
|
|
@@ -135,7 +135,7 @@ function We(e, a, n) {
|
|
|
135
135
|
if (t != null && t.children && (!n || n(t)) && o.push(...t.children), t != null && t.slots && (!n || n(t)))
|
|
136
136
|
for (let r in t.slots)
|
|
137
137
|
o.push(...t.slots[r]);
|
|
138
|
-
|
|
138
|
+
W(t, a(t));
|
|
139
139
|
}
|
|
140
140
|
return e;
|
|
141
141
|
}
|
|
@@ -159,9 +159,9 @@ function $t(e, a) {
|
|
|
159
159
|
if (r != null && r.slots)
|
|
160
160
|
for (let l in r.slots) {
|
|
161
161
|
t = r.slots[l];
|
|
162
|
-
for (let
|
|
163
|
-
if (t[
|
|
164
|
-
return o =
|
|
162
|
+
for (let i = 0; i < t.length; i++)
|
|
163
|
+
if (t[i].id === a)
|
|
164
|
+
return o = i, !0;
|
|
165
165
|
}
|
|
166
166
|
return !1;
|
|
167
167
|
}
|
|
@@ -205,7 +205,7 @@ function Nt(e) {
|
|
|
205
205
|
size: e.config.size || "middle"
|
|
206
206
|
},
|
|
207
207
|
children: [],
|
|
208
|
-
id: "form_" +
|
|
208
|
+
id: "form_" + le()
|
|
209
209
|
}
|
|
210
210
|
],
|
|
211
211
|
componentProps: {
|
|
@@ -221,7 +221,7 @@ function Nt(e) {
|
|
|
221
221
|
}
|
|
222
222
|
function ne(e, a) {
|
|
223
223
|
return e.map((n) => {
|
|
224
|
-
var u, w,
|
|
224
|
+
var u, w, d;
|
|
225
225
|
let o = n.type ?? "";
|
|
226
226
|
const t = n.options ?? {}, r = (s, b) => {
|
|
227
227
|
o === s && (o = b, t.defaultValue && (t.defaultValue = JSON.parse(t.defaultValue)));
|
|
@@ -230,7 +230,7 @@ function ne(e, a) {
|
|
|
230
230
|
const { minRows: s, maxRows: b } = t;
|
|
231
231
|
t.autoSize = { minRows: s, maxRows: b }, delete t.minRows, delete t.maxRows;
|
|
232
232
|
}
|
|
233
|
-
o === "number" && !t.precision && delete t.precision, t.width && (t.style = { width: t.width }, delete t.width), o === "grid" && (o = "row"), a && a.type === "grid" && (o = "col", t.span = n.span, n.key =
|
|
233
|
+
o === "number" && !t.precision && delete t.precision, t.width && (t.style = { width: t.width }, delete t.width), o === "grid" && (o = "row"), a && a.type === "grid" && (o = "col", t.span = n.span, n.key = le());
|
|
234
234
|
const l = {
|
|
235
235
|
label: n.label,
|
|
236
236
|
type: o,
|
|
@@ -255,7 +255,7 @@ function ne(e, a) {
|
|
|
255
255
|
"color-picker",
|
|
256
256
|
"upload-file",
|
|
257
257
|
"upload-image"
|
|
258
|
-
].includes(o) && (l.input = !0, ((w = (u = n.rules) == null ? void 0 : u[0]) == null ? void 0 : w.required) === !1 && n.rules.shift(), ((
|
|
258
|
+
].includes(o) && (l.input = !0, ((w = (u = n.rules) == null ? void 0 : u[0]) == null ? void 0 : w.required) === !1 && n.rules.shift(), ((d = n.rules) == null ? void 0 : d.length) > 0 && (l.rules = n.rules)), n.list && (l.children = ne(n.list, n)), n.columns && (l.children = ne(n.columns, n)), n.trs && (l.children = ne(n.trs, n)), n.tds && (l.children = ne(n.tds, n)), l;
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
261
|
function Bt(e, a) {
|
|
@@ -266,106 +266,106 @@ function Bt(e, a) {
|
|
|
266
266
|
}, a);
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
const e =
|
|
269
|
+
function ke() {
|
|
270
|
+
const e = A({}), a = A({}), n = A(!1), o = A([]), t = Q({});
|
|
271
271
|
function r(m) {
|
|
272
272
|
return e.value[m];
|
|
273
273
|
}
|
|
274
274
|
function l(m, g) {
|
|
275
275
|
e.value[m] = g;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function i(m) {
|
|
278
278
|
delete e.value[m];
|
|
279
279
|
}
|
|
280
280
|
function u(m, g = !1) {
|
|
281
|
-
const
|
|
282
|
-
(
|
|
281
|
+
const y = Object.entries(F.publicMethods).reduce(
|
|
282
|
+
(E, [V, U]) => (E[V] = U.handler, E),
|
|
283
283
|
{}
|
|
284
284
|
);
|
|
285
285
|
try {
|
|
286
286
|
new Function(`const epic = this;${m}`).bind({
|
|
287
|
-
...
|
|
287
|
+
...y,
|
|
288
288
|
getComponent: r,
|
|
289
289
|
find: r,
|
|
290
290
|
defineExpose: w,
|
|
291
|
-
publicMethods:
|
|
291
|
+
publicMethods: y,
|
|
292
292
|
pluginManager: F
|
|
293
293
|
})();
|
|
294
|
-
} catch (
|
|
295
|
-
g && console.error("[epic:自定义函数]异常:",
|
|
294
|
+
} catch (E) {
|
|
295
|
+
g && console.error("[epic:自定义函数]异常:", E);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
function w(m) {
|
|
299
299
|
m != null && (a.value = m);
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function d(m, ...g) {
|
|
302
302
|
if (!m || m.length === 0) {
|
|
303
303
|
console.warn("未提供任何动作");
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
|
-
m.forEach((
|
|
307
|
-
const
|
|
308
|
-
switch (
|
|
306
|
+
m.forEach((y) => {
|
|
307
|
+
const E = y.args ? JSON.parse(y.args) : g;
|
|
308
|
+
switch (y.type) {
|
|
309
309
|
case "public":
|
|
310
|
-
s(
|
|
310
|
+
s(y, E);
|
|
311
311
|
break;
|
|
312
312
|
case "custom":
|
|
313
|
-
b(
|
|
313
|
+
b(y, E);
|
|
314
314
|
break;
|
|
315
315
|
case "component":
|
|
316
|
-
|
|
316
|
+
c(y, E);
|
|
317
317
|
break;
|
|
318
318
|
default:
|
|
319
|
-
console.warn(`未知的动作类型: ${
|
|
319
|
+
console.warn(`未知的动作类型: ${y.type}`);
|
|
320
320
|
break;
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
function s(m, g) {
|
|
325
|
-
var
|
|
325
|
+
var y;
|
|
326
326
|
try {
|
|
327
|
-
(
|
|
328
|
-
} catch (
|
|
329
|
-
console.error(`[Epic:公共函数(${m.methodName})]执行异常:`,
|
|
327
|
+
(y = F.publicMethods[m.methodName]) == null || y.handler(...g);
|
|
328
|
+
} catch (E) {
|
|
329
|
+
console.error(`[Epic:公共函数(${m.methodName})]执行异常:`, E);
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
function b(m, g) {
|
|
333
|
-
var
|
|
333
|
+
var y, E;
|
|
334
334
|
try {
|
|
335
|
-
(
|
|
335
|
+
(E = (y = a.value)[m.methodName]) == null || E.call(y, ...g);
|
|
336
336
|
} catch (V) {
|
|
337
337
|
console.error(`[Epic:自定义函数(${m.methodName})]执行异常:`, V);
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
const
|
|
342
|
-
if (!
|
|
340
|
+
function c(m, g) {
|
|
341
|
+
const y = m.componentId != null && r(m.componentId);
|
|
342
|
+
if (!y) {
|
|
343
343
|
console.warn(`[Epic:组件${m.componentId}]未找到`);
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
346
346
|
try {
|
|
347
|
-
|
|
348
|
-
} catch (
|
|
349
|
-
console.error(`[Epic:组件${m.componentId}函数(${m.methodName})]执行异常:`,
|
|
347
|
+
y[m.methodName](...g);
|
|
348
|
+
} catch (E) {
|
|
349
|
+
console.error(`[Epic:组件${m.componentId}函数(${m.methodName})]执行异常:`, E);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function v(m = !0) {
|
|
353
353
|
n.value = m;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function p(m) {
|
|
356
356
|
const g = oe(m, () => !0);
|
|
357
|
-
o.value = g.map((
|
|
357
|
+
o.value = g.map((y) => y.id);
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function h(m, g = "default") {
|
|
360
360
|
if (t[g]) {
|
|
361
|
-
const
|
|
362
|
-
|
|
361
|
+
const y = t[g];
|
|
362
|
+
W(m, y);
|
|
363
363
|
}
|
|
364
364
|
t[g] = m;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function x(m, g = "default") {
|
|
367
367
|
if (t[g]) {
|
|
368
|
-
|
|
368
|
+
W(t[g], m, !1);
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
t[g] = m;
|
|
@@ -376,25 +376,25 @@ function Ee() {
|
|
|
376
376
|
isDesignMode: n,
|
|
377
377
|
defaultComponentIds: o,
|
|
378
378
|
forms: t,
|
|
379
|
-
addFormData:
|
|
380
|
-
setFormData:
|
|
379
|
+
addFormData: h,
|
|
380
|
+
setFormData: x,
|
|
381
381
|
getComponentInstance: r,
|
|
382
382
|
// 简化查询函数, 推荐使用
|
|
383
383
|
find: r,
|
|
384
384
|
addComponentInstance: l,
|
|
385
|
-
removeComponentInstance:
|
|
385
|
+
removeComponentInstance: i,
|
|
386
386
|
setMethods: u,
|
|
387
|
-
doActions:
|
|
388
|
-
setDesignMode:
|
|
389
|
-
setDefaultComponentIds:
|
|
387
|
+
doActions: d,
|
|
388
|
+
setDesignMode: v,
|
|
389
|
+
setDefaultComponentIds: p
|
|
390
390
|
};
|
|
391
391
|
}
|
|
392
392
|
function He() {
|
|
393
|
-
const e =
|
|
393
|
+
const e = A([]), a = A([]), n = A(null);
|
|
394
394
|
let o = 0;
|
|
395
395
|
function t(u, w = "插入组件") {
|
|
396
|
-
const
|
|
397
|
-
o + 150 >
|
|
396
|
+
const d = Date.now();
|
|
397
|
+
o + 150 > d || (o = d, n.value != null && (e.value.push(n.value), a.value.splice(0, a.value.length)), n.value = {
|
|
398
398
|
type: w,
|
|
399
399
|
componentSchema: JSON.stringify(u)
|
|
400
400
|
}, e.value.length > 60 && e.value.unshift());
|
|
@@ -411,7 +411,7 @@ function He() {
|
|
|
411
411
|
const u = a.value.pop();
|
|
412
412
|
return n.value != null && e.value.push(n.value), n.value = u, JSON.parse(u.componentSchema);
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function i() {
|
|
415
415
|
e.value = [], a.value = [], n.value = null;
|
|
416
416
|
}
|
|
417
417
|
return {
|
|
@@ -421,10 +421,10 @@ function He() {
|
|
|
421
421
|
push: t,
|
|
422
422
|
undo: r,
|
|
423
423
|
redo: l,
|
|
424
|
-
reset:
|
|
424
|
+
reset: i
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
|
-
const Ke = /* @__PURE__ */
|
|
427
|
+
const Ke = /* @__PURE__ */ Y({
|
|
428
428
|
__name: "dynamicFormItem",
|
|
429
429
|
props: {
|
|
430
430
|
hasFormItem: { type: Boolean },
|
|
@@ -432,22 +432,22 @@ const Ke = /* @__PURE__ */ j({
|
|
|
432
432
|
},
|
|
433
433
|
emits: ["updateFormItemRef"],
|
|
434
434
|
setup(e, { emit: a }) {
|
|
435
|
-
const n = F.getComponent("form-item"), o = e, t = a, r =
|
|
435
|
+
const n = F.getComponent("form-item"), o = e, t = a, r = A(), l = () => {
|
|
436
436
|
t("updateFormItemRef", r.value);
|
|
437
437
|
};
|
|
438
|
-
return (
|
|
438
|
+
return (i, u) => o.hasFormItem ? (R(), z(C(n), he({
|
|
439
439
|
key: 0,
|
|
440
440
|
ref_key: "formItemRef",
|
|
441
441
|
ref: r,
|
|
442
442
|
onVnodeMounted: l
|
|
443
443
|
}, o.formItemProps), {
|
|
444
444
|
default: P(() => [
|
|
445
|
-
|
|
445
|
+
$(i.$slots, "default")
|
|
446
446
|
]),
|
|
447
447
|
_: 3
|
|
448
|
-
}, 16, ["onVnodeMounted"])) :
|
|
448
|
+
}, 16, ["onVnodeMounted"])) : $(i.$slots, "default", { key: 1 });
|
|
449
449
|
}
|
|
450
|
-
}), qe = /* @__PURE__ */
|
|
450
|
+
}), qe = /* @__PURE__ */ Y({
|
|
451
451
|
name: "ENode",
|
|
452
452
|
__name: "node",
|
|
453
453
|
props: {
|
|
@@ -461,130 +461,130 @@ const Ke = /* @__PURE__ */ j({
|
|
|
461
461
|
},
|
|
462
462
|
emits: ["update:modelValue", "change", "update:dynamicId"],
|
|
463
463
|
setup(e, { emit: a }) {
|
|
464
|
-
const { proxy: n } = ae(), o = e, t =
|
|
465
|
-
let r =
|
|
466
|
-
const l =
|
|
467
|
-
let s =
|
|
468
|
-
|
|
469
|
-
async function b(
|
|
470
|
-
if (["cascader", "checkbox", "select", "radio"].includes(
|
|
471
|
-
const
|
|
464
|
+
const { proxy: n } = ae(), o = e, t = A(null);
|
|
465
|
+
let r = K("formData", Q({}));
|
|
466
|
+
const l = K("slots", {}), i = K("pageManager", {}), u = K("disabled", { value: !1 }), w = K("ruleFieldPrefix", null), d = K("resetFormData", !1);
|
|
467
|
+
let s = Q(B(o.componentSchema));
|
|
468
|
+
v();
|
|
469
|
+
async function b(f) {
|
|
470
|
+
if (["cascader", "checkbox", "select", "radio"].includes(f.type) && f.componentProps.dynamicId && o.sourceDateUrl) {
|
|
471
|
+
const D = (await be({
|
|
472
472
|
// || "http://192.168.28.205:3000/dev-api/data-source
|
|
473
473
|
url: o.sourceDateUrl,
|
|
474
474
|
method: "get",
|
|
475
475
|
params: {
|
|
476
|
-
id:
|
|
476
|
+
id: f.componentProps.dynamicId
|
|
477
477
|
}
|
|
478
478
|
})).data.data;
|
|
479
|
-
let
|
|
480
|
-
url:
|
|
481
|
-
method:
|
|
482
|
-
data: JSON.parse(
|
|
483
|
-
params: JSON.parse(
|
|
484
|
-
headers: JSON.parse(
|
|
479
|
+
let I = await be({
|
|
480
|
+
url: D.url,
|
|
481
|
+
method: D.method,
|
|
482
|
+
data: JSON.parse(D.body),
|
|
483
|
+
params: JSON.parse(D.params),
|
|
484
|
+
headers: JSON.parse(D.headers)
|
|
485
485
|
});
|
|
486
|
-
if (
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
label:
|
|
490
|
-
value:
|
|
486
|
+
if (D && (D != null && D.dataPath)) {
|
|
487
|
+
const xe = D.dataPath.split(".").reduce((re, Ce) => re[Ce], I.data);
|
|
488
|
+
f.componentProps.options = c(xe).map((re) => ({
|
|
489
|
+
label: re[D.dataKey],
|
|
490
|
+
value: re[D.dataValue]
|
|
491
491
|
}));
|
|
492
492
|
} else
|
|
493
|
-
|
|
494
|
-
label:
|
|
495
|
-
value:
|
|
493
|
+
f.componentProps.options = c(I.data).map((te) => ({
|
|
494
|
+
label: te[D.dataKey],
|
|
495
|
+
value: te[D.dataValue]
|
|
496
496
|
}));
|
|
497
|
-
return
|
|
497
|
+
return f;
|
|
498
498
|
}
|
|
499
|
-
return
|
|
499
|
+
return f;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
return
|
|
501
|
+
function c(f) {
|
|
502
|
+
return f && Object.prototype.toString.call(f) === "[object Array]" ? f : [];
|
|
503
503
|
}
|
|
504
504
|
O(
|
|
505
505
|
() => o.componentSchema,
|
|
506
|
-
(
|
|
507
|
-
|
|
506
|
+
(f) => {
|
|
507
|
+
Ee(s, f, ["children"]) || (W(s, B(f)), v());
|
|
508
508
|
},
|
|
509
509
|
{
|
|
510
510
|
deep: !0
|
|
511
511
|
}
|
|
512
512
|
);
|
|
513
|
-
function
|
|
514
|
-
|
|
513
|
+
function v() {
|
|
514
|
+
i.isDesignMode.value && typeof s.field == "string" && (s.field += "-design-mode");
|
|
515
515
|
}
|
|
516
|
-
(o.resetFormData ||
|
|
517
|
-
const
|
|
518
|
-
|
|
516
|
+
(o.resetFormData || d) && (r = {});
|
|
517
|
+
const p = a, h = A(), x = A(), m = (f) => {
|
|
518
|
+
x.value = f;
|
|
519
519
|
}, g = _e();
|
|
520
|
-
Object.keys(g).length &&
|
|
521
|
-
const
|
|
522
|
-
var
|
|
523
|
-
return (
|
|
524
|
-
}), V =
|
|
525
|
-
var
|
|
526
|
-
const
|
|
527
|
-
...
|
|
528
|
-
validator:
|
|
520
|
+
Object.keys(g).length && N("nodeAttrs", g);
|
|
521
|
+
const y = Pe(null), E = T(() => {
|
|
522
|
+
var f, k;
|
|
523
|
+
return (f = s.componentProps) != null && f.hidden ? !1 : typeof s.show == "boolean" ? s.show : ((k = s.show) == null ? void 0 : k.call(s, { values: r })) ?? !0;
|
|
524
|
+
}), V = T(() => {
|
|
525
|
+
var D;
|
|
526
|
+
const f = E.value && ((D = s.rules) == null ? void 0 : D.map((I) => ({
|
|
527
|
+
...I,
|
|
528
|
+
validator: I.validator && i.funcs.value[I.validator]
|
|
529
529
|
// 自定义校验函数
|
|
530
530
|
})));
|
|
531
|
-
let
|
|
532
|
-
o.ruleField ?
|
|
533
|
-
const
|
|
531
|
+
let k = s.field;
|
|
532
|
+
o.ruleField ? k = o.ruleField : w && s.field && (k = B(w), k.push(s.field));
|
|
533
|
+
const _ = {
|
|
534
534
|
...s,
|
|
535
|
-
rules:
|
|
536
|
-
rule:
|
|
537
|
-
field:
|
|
535
|
+
rules: f,
|
|
536
|
+
rule: f,
|
|
537
|
+
field: k
|
|
538
538
|
};
|
|
539
|
-
return
|
|
540
|
-
}),
|
|
541
|
-
var
|
|
542
|
-
const
|
|
543
|
-
return s.on && Object.keys(s.on).forEach((
|
|
544
|
-
|
|
539
|
+
return _.children && delete _.children, _;
|
|
540
|
+
}), U = T(() => {
|
|
541
|
+
var _, D;
|
|
542
|
+
const f = ((_ = Z.value) == null ? void 0 : _.bindModel) ?? "modelValue", k = {};
|
|
543
|
+
return s.on && Object.keys(s.on).forEach((I) => {
|
|
544
|
+
k[`on${Le(I)}`] = (...te) => i.doActions(s.on[I], ...te);
|
|
545
545
|
}), {
|
|
546
546
|
...o,
|
|
547
547
|
...s.componentProps,
|
|
548
|
-
disabled: (u == null ? void 0 : u.value) || ((
|
|
549
|
-
bindModel:
|
|
550
|
-
...
|
|
548
|
+
disabled: (u == null ? void 0 : u.value) || ((D = s.componentProps) == null ? void 0 : D.disabled),
|
|
549
|
+
bindModel: f,
|
|
550
|
+
...k
|
|
551
551
|
};
|
|
552
|
-
}),
|
|
553
|
-
|
|
552
|
+
}), Z = T(() => F.getComponentConfingByType(s.type) ?? null);
|
|
553
|
+
se(() => {
|
|
554
554
|
t.value = o.modelValue ?? r[s.field ?? ""];
|
|
555
555
|
}), O(
|
|
556
556
|
() => t.value,
|
|
557
557
|
() => {
|
|
558
|
-
t.value !== (o.modelValue ?? r[s.field ?? ""]) &&
|
|
558
|
+
t.value !== (o.modelValue ?? r[s.field ?? ""]) && H(t.value);
|
|
559
559
|
}
|
|
560
560
|
), O(
|
|
561
|
-
() =>
|
|
561
|
+
() => h.value,
|
|
562
562
|
() => {
|
|
563
|
-
|
|
563
|
+
ee();
|
|
564
564
|
},
|
|
565
565
|
{ immediate: !0 }
|
|
566
566
|
);
|
|
567
|
-
function
|
|
568
|
-
var
|
|
569
|
-
const
|
|
570
|
-
s.id &&
|
|
567
|
+
function ee() {
|
|
568
|
+
var k;
|
|
569
|
+
const f = h.value || n;
|
|
570
|
+
s.id && f && (s.input && (f.setValue = H, f.getValue = () => r[s.field] || o.modelValue), f.setAttr = (_, D) => (s.componentProps || (s.componentProps = {}), s.componentProps[_] = D), f.getAttr = (_) => s.componentProps[_], i.addComponentInstance(s.id, f), (k = Z.value) != null && k.defaultSchema.input && s.noFormItem !== !0 && x.value && i.addComponentInstance(s.id + "formItem", x.value));
|
|
571
571
|
}
|
|
572
|
-
function
|
|
573
|
-
var
|
|
574
|
-
s.id && (
|
|
572
|
+
function ue() {
|
|
573
|
+
var f;
|
|
574
|
+
s.id && (i.removeComponentInstance(s.id), (f = Z.value) != null && f.defaultSchema.input && s.noFormItem !== !0 && i.removeComponentInstance(s.id + "formItem"));
|
|
575
575
|
}
|
|
576
|
-
async function
|
|
577
|
-
var
|
|
578
|
-
if (s = await b(s), typeof ((
|
|
579
|
-
const
|
|
580
|
-
|
|
576
|
+
async function de() {
|
|
577
|
+
var k, _, D;
|
|
578
|
+
if (s = await b(s), typeof ((k = s.componentProps) == null ? void 0 : k.defaultValue) < "u") {
|
|
579
|
+
const I = i.isDesignMode.value ? (_ = s.componentProps) == null ? void 0 : _.defaultValue : r[s.field] ?? ((D = s.componentProps) == null ? void 0 : D.defaultValue);
|
|
580
|
+
H(B(I));
|
|
581
581
|
}
|
|
582
582
|
if (s.type === "slot") {
|
|
583
|
-
const
|
|
584
|
-
if (!
|
|
585
|
-
|
|
583
|
+
const I = s.slotName;
|
|
584
|
+
if (!I) return;
|
|
585
|
+
y.value = Y({
|
|
586
586
|
setup() {
|
|
587
|
-
return () =>
|
|
587
|
+
return () => $(l, I, {
|
|
588
588
|
componentSchema: s,
|
|
589
589
|
model: r
|
|
590
590
|
});
|
|
@@ -592,143 +592,143 @@ const Ke = /* @__PURE__ */ j({
|
|
|
592
592
|
});
|
|
593
593
|
return;
|
|
594
594
|
}
|
|
595
|
-
const
|
|
596
|
-
if (!
|
|
595
|
+
const f = F.getComponent(s.type);
|
|
596
|
+
if (!f) {
|
|
597
597
|
console.error(`组件${s.type}未注册`);
|
|
598
598
|
return;
|
|
599
599
|
}
|
|
600
|
-
if (typeof
|
|
601
|
-
const
|
|
602
|
-
|
|
600
|
+
if (typeof f == "function") {
|
|
601
|
+
const I = await f();
|
|
602
|
+
y.value = I.default ?? I;
|
|
603
603
|
} else
|
|
604
|
-
|
|
604
|
+
y.value = f;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
|
|
606
|
+
function H(f) {
|
|
607
|
+
p("update:modelValue", f), p("change", f), s.field && (r[s.field] = f);
|
|
608
608
|
}
|
|
609
|
-
function
|
|
610
|
-
|
|
609
|
+
function S(f) {
|
|
610
|
+
p("update:dynamicId", f);
|
|
611
611
|
}
|
|
612
|
-
let
|
|
612
|
+
let M = null;
|
|
613
613
|
return O(
|
|
614
614
|
() => s,
|
|
615
|
-
async (
|
|
616
|
-
const
|
|
617
|
-
...
|
|
615
|
+
async (f) => {
|
|
616
|
+
const k = JSON.stringify({
|
|
617
|
+
...f,
|
|
618
618
|
children: void 0,
|
|
619
619
|
componentProps: {
|
|
620
|
-
...
|
|
620
|
+
...f.componentProps,
|
|
621
621
|
options: null
|
|
622
622
|
}
|
|
623
623
|
});
|
|
624
|
-
if (
|
|
624
|
+
if (k === M)
|
|
625
625
|
return !1;
|
|
626
|
-
|
|
626
|
+
M = k, de();
|
|
627
627
|
},
|
|
628
628
|
{
|
|
629
629
|
immediate: !0,
|
|
630
630
|
deep: !0
|
|
631
631
|
}
|
|
632
|
-
),
|
|
633
|
-
var
|
|
634
|
-
const
|
|
635
|
-
return
|
|
632
|
+
), Se(ue), (f, k) => {
|
|
633
|
+
var D;
|
|
634
|
+
const _ = Oe("ENode");
|
|
635
|
+
return y.value && E.value ? (R(), z(Ke, {
|
|
636
636
|
key: 0,
|
|
637
|
-
hasFormItem:
|
|
637
|
+
hasFormItem: C(s).noFormItem !== !0 && ((D = Z.value) == null ? void 0 : D.defaultSchema.input),
|
|
638
638
|
formItemProps: V.value,
|
|
639
639
|
onUpdateFormItemRef: m
|
|
640
640
|
}, {
|
|
641
641
|
default: P(() => [
|
|
642
|
-
(
|
|
642
|
+
(R(), z(Ve(y.value), he({
|
|
643
643
|
ref_key: "componentInstance",
|
|
644
|
-
ref:
|
|
645
|
-
onVnodeMounted:
|
|
646
|
-
model:
|
|
647
|
-
}, { ...
|
|
648
|
-
[
|
|
649
|
-
["onUpdate:" +
|
|
650
|
-
[`onUpdate:${
|
|
651
|
-
"onUpdate:dynamicId":
|
|
644
|
+
ref: h,
|
|
645
|
+
onVnodeMounted: ee,
|
|
646
|
+
model: C(r)
|
|
647
|
+
}, { ...U.value }, {
|
|
648
|
+
[U.value.bindModel]: t.value,
|
|
649
|
+
["onUpdate:" + U.value.bindModel]: k[0] || (k[0] = (I) => t.value = I),
|
|
650
|
+
[`onUpdate:${U.value.bindModel}` || ""]: H,
|
|
651
|
+
"onUpdate:dynamicId": S
|
|
652
652
|
}), {
|
|
653
|
-
node: P((
|
|
654
|
-
|
|
653
|
+
node: P((I) => [
|
|
654
|
+
L(_, he(I, {
|
|
655
655
|
sourceDateUrl: o.sourceDateUrl
|
|
656
656
|
}), null, 16, ["sourceDateUrl"])
|
|
657
657
|
]),
|
|
658
658
|
"edit-node": P(() => [
|
|
659
|
-
|
|
659
|
+
$(f.$slots, "edit-node")
|
|
660
660
|
]),
|
|
661
661
|
_: 3
|
|
662
662
|
}, 16, ["model"]))
|
|
663
663
|
]),
|
|
664
664
|
_: 3
|
|
665
|
-
}, 8, ["hasFormItem", "formItemProps"])) :
|
|
665
|
+
}, 8, ["hasFormItem", "formItemProps"])) : Ae("", !0);
|
|
666
666
|
};
|
|
667
667
|
}
|
|
668
668
|
});
|
|
669
669
|
function Ze() {
|
|
670
|
-
const e =
|
|
670
|
+
const e = A(!1), a = ke(), n = A({});
|
|
671
671
|
function o() {
|
|
672
|
-
return new Promise((
|
|
672
|
+
return new Promise((c) => {
|
|
673
673
|
if (e.value)
|
|
674
|
-
|
|
674
|
+
c();
|
|
675
675
|
else {
|
|
676
|
-
const
|
|
677
|
-
|
|
676
|
+
const v = O(e, () => {
|
|
677
|
+
v(), c();
|
|
678
678
|
});
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
|
-
async function t(
|
|
683
|
-
var
|
|
682
|
+
async function t(c = "default") {
|
|
683
|
+
var p;
|
|
684
684
|
await o();
|
|
685
|
-
const
|
|
686
|
-
if (!
|
|
687
|
-
return
|
|
685
|
+
const v = (p = n.value) == null ? void 0 : p[c];
|
|
686
|
+
if (!v) throw new Error(`表单 [name=${c}] 不存在`);
|
|
687
|
+
return v;
|
|
688
688
|
}
|
|
689
|
-
async function r(
|
|
690
|
-
const
|
|
691
|
-
return
|
|
689
|
+
async function r(c, v) {
|
|
690
|
+
const p = await t(c);
|
|
691
|
+
return B(await v(p));
|
|
692
692
|
}
|
|
693
|
-
async function l(
|
|
694
|
-
return await r(
|
|
693
|
+
async function l(c = "default") {
|
|
694
|
+
return await r(c, (v) => v.getData());
|
|
695
695
|
}
|
|
696
|
-
function c
|
|
697
|
-
var
|
|
698
|
-
a.setFormData(
|
|
699
|
-
const
|
|
700
|
-
|
|
696
|
+
function i(c, v = "default") {
|
|
697
|
+
var h;
|
|
698
|
+
a.setFormData(c, v);
|
|
699
|
+
const p = (h = n.value) == null ? void 0 : h[v];
|
|
700
|
+
p == null || p.clearValidate();
|
|
701
701
|
}
|
|
702
|
-
async function u(
|
|
703
|
-
return await r(
|
|
702
|
+
async function u(c = "default") {
|
|
703
|
+
return await r(c, async (v) => (await v.validate(), await v.getData()));
|
|
704
704
|
}
|
|
705
|
-
async function w(
|
|
705
|
+
async function w(c) {
|
|
706
706
|
await o();
|
|
707
|
-
const
|
|
708
|
-
for (const
|
|
709
|
-
const
|
|
710
|
-
|
|
707
|
+
const v = {};
|
|
708
|
+
for (const p in n.value) {
|
|
709
|
+
const h = n.value[p];
|
|
710
|
+
h && (v[p] = B(await c(h)));
|
|
711
711
|
}
|
|
712
|
-
return
|
|
712
|
+
return v;
|
|
713
713
|
}
|
|
714
|
-
async function
|
|
715
|
-
return await w((
|
|
714
|
+
async function d() {
|
|
715
|
+
return await w((c) => c.getData());
|
|
716
716
|
}
|
|
717
|
-
function s(
|
|
718
|
-
for (const
|
|
719
|
-
c
|
|
717
|
+
function s(c) {
|
|
718
|
+
for (const v in c)
|
|
719
|
+
i(c[v], v);
|
|
720
720
|
}
|
|
721
721
|
async function b() {
|
|
722
|
-
return await w(async (
|
|
722
|
+
return await w(async (c) => (await c.validate(), await c.getData()));
|
|
723
723
|
}
|
|
724
724
|
return {
|
|
725
725
|
ready: e,
|
|
726
726
|
pageManager: a,
|
|
727
727
|
forms: n,
|
|
728
728
|
getData: l,
|
|
729
|
-
setData:
|
|
729
|
+
setData: i,
|
|
730
730
|
validate: u,
|
|
731
|
-
getForms:
|
|
731
|
+
getForms: d,
|
|
732
732
|
setForms: s,
|
|
733
733
|
validateAll: b,
|
|
734
734
|
getFormInstance: t
|
|
@@ -737,7 +737,7 @@ function Ze() {
|
|
|
737
737
|
const Ge = {
|
|
738
738
|
key: 0,
|
|
739
739
|
class: "epic-loading-box"
|
|
740
|
-
}, Qe = { class: "epic-builder-main" }, Ye = { class: "epic-loading-box" }, Xe = /* @__PURE__ */
|
|
740
|
+
}, Qe = { class: "epic-builder-main" }, Ye = { class: "epic-loading-box" }, Xe = /* @__PURE__ */ Y({
|
|
741
741
|
__name: "builder",
|
|
742
742
|
props: {
|
|
743
743
|
pageSchema: {},
|
|
@@ -747,42 +747,42 @@ const Ge = {
|
|
|
747
747
|
},
|
|
748
748
|
emits: ["ready"],
|
|
749
749
|
setup(e, { expose: a, emit: n }) {
|
|
750
|
-
const o =
|
|
750
|
+
const o = G(() => import("./index-DgcFxYFp.js")), t = n, { ready: r, pageManager: l, forms: i, getData: u, setData: w, validate: d, getForms: s, setForms: b, validateAll: c, getFormInstance: v } = Ze(), p = e, h = Q({
|
|
751
751
|
schemas: []
|
|
752
752
|
});
|
|
753
753
|
O(
|
|
754
|
-
() =>
|
|
755
|
-
(
|
|
756
|
-
|
|
754
|
+
() => p.pageSchema,
|
|
755
|
+
(y) => {
|
|
756
|
+
W(h, y);
|
|
757
757
|
},
|
|
758
758
|
{
|
|
759
759
|
immediate: !0,
|
|
760
760
|
deep: !0
|
|
761
761
|
}
|
|
762
762
|
), O(
|
|
763
|
-
() =>
|
|
764
|
-
(
|
|
765
|
-
|
|
763
|
+
() => p.formData,
|
|
764
|
+
(y) => {
|
|
765
|
+
y && w(y);
|
|
766
766
|
},
|
|
767
767
|
{
|
|
768
768
|
immediate: !0,
|
|
769
769
|
deep: !0
|
|
770
770
|
}
|
|
771
771
|
), O(
|
|
772
|
-
() =>
|
|
773
|
-
(
|
|
774
|
-
|
|
772
|
+
() => h.script,
|
|
773
|
+
(y) => {
|
|
774
|
+
y && l.setMethods(y, !0);
|
|
775
775
|
},
|
|
776
776
|
{
|
|
777
777
|
immediate: !0
|
|
778
778
|
}
|
|
779
|
-
),
|
|
779
|
+
), N("slots", Fe()), N("pageManager", l), N("forms", i), N("pageSchema", h), N(
|
|
780
780
|
"disabled",
|
|
781
|
-
|
|
781
|
+
T(() => p.disabled)
|
|
782
782
|
);
|
|
783
|
-
const
|
|
783
|
+
const x = ae(), m = x == null ? void 0 : x.proxy;
|
|
784
784
|
function g() {
|
|
785
|
-
|
|
785
|
+
j(() => {
|
|
786
786
|
r.value = !0, t("ready", l), m && l.addComponentInstance("builder", m);
|
|
787
787
|
});
|
|
788
788
|
}
|
|
@@ -791,34 +791,34 @@ const Ge = {
|
|
|
791
791
|
pageManager: l,
|
|
792
792
|
getData: u,
|
|
793
793
|
setData: w,
|
|
794
|
-
validate:
|
|
794
|
+
validate: d,
|
|
795
795
|
getForms: s,
|
|
796
796
|
setForms: b,
|
|
797
|
-
validateAll:
|
|
798
|
-
getFormInstance:
|
|
799
|
-
}), (
|
|
797
|
+
validateAll: c,
|
|
798
|
+
getFormInstance: v
|
|
799
|
+
}), (y, E) => C(F).initialized.value ? (R(), z(De, {
|
|
800
800
|
key: 1,
|
|
801
801
|
onResolve: g
|
|
802
802
|
}, {
|
|
803
803
|
default: P(() => [
|
|
804
|
-
|
|
805
|
-
(
|
|
806
|
-
key:
|
|
807
|
-
sourceDateUrl:
|
|
804
|
+
J("div", Qe, [
|
|
805
|
+
(R(!0), ve(Me, null, Re(h.schemas, (V, U) => (R(), z(C(qe), {
|
|
806
|
+
key: U,
|
|
807
|
+
sourceDateUrl: p.sourceDateUrl,
|
|
808
808
|
componentSchema: V
|
|
809
809
|
}, null, 8, ["sourceDateUrl", "componentSchema"]))), 128))
|
|
810
810
|
])
|
|
811
811
|
]),
|
|
812
812
|
fallback: P(() => [
|
|
813
|
-
|
|
814
|
-
|
|
813
|
+
J("div", Ye, [
|
|
814
|
+
L(C(o))
|
|
815
815
|
])
|
|
816
816
|
]),
|
|
817
817
|
_: 1
|
|
818
|
-
})) : (
|
|
818
|
+
})) : (R(), ve("div", Ge));
|
|
819
819
|
}
|
|
820
820
|
});
|
|
821
|
-
function
|
|
821
|
+
function ge(e) {
|
|
822
822
|
return Be() ? (Ue(e), !0) : !1;
|
|
823
823
|
}
|
|
824
824
|
function je(e) {
|
|
@@ -826,10 +826,10 @@ function je(e) {
|
|
|
826
826
|
const t = () => {
|
|
827
827
|
a -= 1, o && a <= 0 && (o.stop(), n = void 0, o = void 0);
|
|
828
828
|
};
|
|
829
|
-
return (...r) => (a += 1, o || (o = $e(!0), n = o.run(() => e(...r))),
|
|
829
|
+
return (...r) => (a += 1, o || (o = $e(!0), n = o.run(() => e(...r))), ge(t), n);
|
|
830
830
|
}
|
|
831
|
-
function
|
|
832
|
-
return typeof e == "function" ? e() :
|
|
831
|
+
function X(e) {
|
|
832
|
+
return typeof e == "function" ? e() : C(e);
|
|
833
833
|
}
|
|
834
834
|
const et = typeof window < "u" && typeof document < "u";
|
|
835
835
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
@@ -839,208 +839,208 @@ function rt(e) {
|
|
|
839
839
|
return ae();
|
|
840
840
|
}
|
|
841
841
|
function st(e, a = !0, n) {
|
|
842
|
-
rt() ?
|
|
842
|
+
rt() ? ye(e, n) : a ? e() : j(e);
|
|
843
843
|
}
|
|
844
844
|
function lt(e = !1, a = {}) {
|
|
845
845
|
const {
|
|
846
846
|
truthyValue: n = !0,
|
|
847
847
|
falsyValue: o = !1
|
|
848
|
-
} = a, t = Ne(e), r =
|
|
849
|
-
function l(
|
|
848
|
+
} = a, t = Ne(e), r = A(e);
|
|
849
|
+
function l(i) {
|
|
850
850
|
if (arguments.length)
|
|
851
|
-
return r.value =
|
|
851
|
+
return r.value = i, r.value;
|
|
852
852
|
{
|
|
853
|
-
const u =
|
|
854
|
-
return r.value = r.value === u ?
|
|
853
|
+
const u = X(n);
|
|
854
|
+
return r.value = r.value === u ? X(o) : u, r.value;
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
857
|
return t ? l : [r, l];
|
|
858
858
|
}
|
|
859
859
|
function Ut(e, a, n) {
|
|
860
|
-
const o = O(e, (...t) => (
|
|
860
|
+
const o = O(e, (...t) => (j(() => o()), a(...t)), n);
|
|
861
861
|
return o;
|
|
862
862
|
}
|
|
863
|
-
const
|
|
864
|
-
function
|
|
863
|
+
const ie = et ? window : void 0;
|
|
864
|
+
function q(e) {
|
|
865
865
|
var a;
|
|
866
|
-
const n =
|
|
866
|
+
const n = X(e);
|
|
867
867
|
return (a = n == null ? void 0 : n.$el) != null ? a : n;
|
|
868
868
|
}
|
|
869
869
|
function it(...e) {
|
|
870
870
|
let a, n, o, t;
|
|
871
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, t] = e, a =
|
|
871
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, t] = e, a = ie) : [a, n, o, t] = e, !a)
|
|
872
872
|
return at;
|
|
873
873
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
874
874
|
const r = [], l = () => {
|
|
875
|
-
r.forEach((
|
|
876
|
-
},
|
|
877
|
-
() => [
|
|
878
|
-
([
|
|
879
|
-
if (l(), !
|
|
875
|
+
r.forEach((d) => d()), r.length = 0;
|
|
876
|
+
}, i = (d, s, b, c) => (d.addEventListener(s, b, c), () => d.removeEventListener(s, b, c)), u = O(
|
|
877
|
+
() => [q(a), X(t)],
|
|
878
|
+
([d, s]) => {
|
|
879
|
+
if (l(), !d)
|
|
880
880
|
return;
|
|
881
881
|
const b = ot(s) ? { ...s } : s;
|
|
882
882
|
r.push(
|
|
883
|
-
...n.flatMap((
|
|
883
|
+
...n.flatMap((c) => o.map((v) => i(d, c, v, b)))
|
|
884
884
|
);
|
|
885
885
|
},
|
|
886
886
|
{ immediate: !0, flush: "post" }
|
|
887
887
|
), w = () => {
|
|
888
888
|
u(), l();
|
|
889
889
|
};
|
|
890
|
-
return
|
|
890
|
+
return ge(w), w;
|
|
891
891
|
}
|
|
892
892
|
function ct(e) {
|
|
893
893
|
return typeof e == "function" ? e : typeof e == "string" ? (a) => a.key === e : Array.isArray(e) ? (a) => e.includes(a.key) : () => !0;
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function Ie(...e) {
|
|
896
896
|
let a, n, o = {};
|
|
897
897
|
e.length === 3 ? (a = e[0], n = e[1], o = e[2]) : e.length === 2 ? typeof e[1] == "object" ? (a = !0, n = e[0], o = e[1]) : (a = e[0], n = e[1]) : (a = !0, n = e[0]);
|
|
898
898
|
const {
|
|
899
|
-
target: t =
|
|
899
|
+
target: t = ie,
|
|
900
900
|
eventName: r = "keydown",
|
|
901
901
|
passive: l = !1,
|
|
902
|
-
dedupe:
|
|
902
|
+
dedupe: i = !1
|
|
903
903
|
} = o, u = ct(a);
|
|
904
|
-
return it(t, r, (
|
|
905
|
-
|
|
904
|
+
return it(t, r, (d) => {
|
|
905
|
+
d.repeat && X(i) || u(d) && n(d);
|
|
906
906
|
}, l);
|
|
907
907
|
}
|
|
908
|
-
function
|
|
909
|
-
return
|
|
908
|
+
function pe(e, a, n = {}) {
|
|
909
|
+
return Ie(e, a, { ...n, eventName: "keydown" });
|
|
910
910
|
}
|
|
911
|
-
function
|
|
912
|
-
return
|
|
911
|
+
function me(e, a, n = {}) {
|
|
912
|
+
return Ie(e, a, { ...n, eventName: "keyup" });
|
|
913
913
|
}
|
|
914
914
|
function ut() {
|
|
915
|
-
const e =
|
|
916
|
-
return a &&
|
|
915
|
+
const e = A(!1), a = ae();
|
|
916
|
+
return a && ye(() => {
|
|
917
917
|
e.value = !0;
|
|
918
918
|
}, a), e;
|
|
919
919
|
}
|
|
920
920
|
function dt(e) {
|
|
921
921
|
const a = ut();
|
|
922
|
-
return
|
|
922
|
+
return T(() => (a.value, !!e()));
|
|
923
923
|
}
|
|
924
924
|
function ft(e) {
|
|
925
925
|
return JSON.parse(JSON.stringify(e));
|
|
926
926
|
}
|
|
927
927
|
function pt(e, a, n = {}) {
|
|
928
|
-
const { window: o =
|
|
928
|
+
const { window: o = ie, ...t } = n;
|
|
929
929
|
let r;
|
|
930
|
-
const l = dt(() => o && "ResizeObserver" in o),
|
|
930
|
+
const l = dt(() => o && "ResizeObserver" in o), i = () => {
|
|
931
931
|
r && (r.disconnect(), r = void 0);
|
|
932
|
-
}, u =
|
|
933
|
-
const s =
|
|
934
|
-
return Array.isArray(s) ? s.map((b) =>
|
|
932
|
+
}, u = T(() => {
|
|
933
|
+
const s = X(e);
|
|
934
|
+
return Array.isArray(s) ? s.map((b) => q(b)) : [q(s)];
|
|
935
935
|
}), w = O(
|
|
936
936
|
u,
|
|
937
937
|
(s) => {
|
|
938
|
-
if (
|
|
938
|
+
if (i(), l.value && o) {
|
|
939
939
|
r = new ResizeObserver(a);
|
|
940
940
|
for (const b of s)
|
|
941
941
|
b && r.observe(b, t);
|
|
942
942
|
}
|
|
943
943
|
},
|
|
944
944
|
{ immediate: !0, flush: "post" }
|
|
945
|
-
),
|
|
946
|
-
|
|
945
|
+
), d = () => {
|
|
946
|
+
i(), w();
|
|
947
947
|
};
|
|
948
|
-
return
|
|
948
|
+
return ge(d), {
|
|
949
949
|
isSupported: l,
|
|
950
|
-
stop:
|
|
950
|
+
stop: d
|
|
951
951
|
};
|
|
952
952
|
}
|
|
953
953
|
function Tt(e, a = { width: 0, height: 0 }, n = {}) {
|
|
954
|
-
const { window: o =
|
|
954
|
+
const { window: o = ie, box: t = "content-box" } = n, r = T(() => {
|
|
955
955
|
var s, b;
|
|
956
|
-
return (b = (s =
|
|
957
|
-
}), l =
|
|
956
|
+
return (b = (s = q(e)) == null ? void 0 : s.namespaceURI) == null ? void 0 : b.includes("svg");
|
|
957
|
+
}), l = A(a.width), i = A(a.height), { stop: u } = pt(
|
|
958
958
|
e,
|
|
959
959
|
([s]) => {
|
|
960
960
|
const b = t === "border-box" ? s.borderBoxSize : t === "content-box" ? s.contentBoxSize : s.devicePixelContentBoxSize;
|
|
961
961
|
if (o && r.value) {
|
|
962
|
-
const
|
|
963
|
-
if (
|
|
964
|
-
const
|
|
965
|
-
l.value =
|
|
962
|
+
const c = q(e);
|
|
963
|
+
if (c) {
|
|
964
|
+
const v = c.getBoundingClientRect();
|
|
965
|
+
l.value = v.width, i.value = v.height;
|
|
966
966
|
}
|
|
967
967
|
} else if (b) {
|
|
968
|
-
const
|
|
969
|
-
l.value =
|
|
968
|
+
const c = Array.isArray(b) ? b : [b];
|
|
969
|
+
l.value = c.reduce((v, { inlineSize: p }) => v + p, 0), i.value = c.reduce((v, { blockSize: p }) => v + p, 0);
|
|
970
970
|
} else
|
|
971
|
-
l.value = s.contentRect.width,
|
|
971
|
+
l.value = s.contentRect.width, i.value = s.contentRect.height;
|
|
972
972
|
},
|
|
973
973
|
n
|
|
974
974
|
);
|
|
975
975
|
st(() => {
|
|
976
|
-
const s =
|
|
977
|
-
s && (l.value = "offsetWidth" in s ? s.offsetWidth : a.width,
|
|
976
|
+
const s = q(e);
|
|
977
|
+
s && (l.value = "offsetWidth" in s ? s.offsetWidth : a.width, i.value = "offsetHeight" in s ? s.offsetHeight : a.height);
|
|
978
978
|
});
|
|
979
979
|
const w = O(
|
|
980
|
-
() =>
|
|
980
|
+
() => q(e),
|
|
981
981
|
(s) => {
|
|
982
|
-
l.value = s ? a.width : 0,
|
|
982
|
+
l.value = s ? a.width : 0, i.value = s ? a.height : 0;
|
|
983
983
|
}
|
|
984
984
|
);
|
|
985
|
-
function
|
|
985
|
+
function d() {
|
|
986
986
|
u(), w();
|
|
987
987
|
}
|
|
988
988
|
return {
|
|
989
989
|
width: l,
|
|
990
|
-
height:
|
|
991
|
-
stop:
|
|
990
|
+
height: i,
|
|
991
|
+
stop: d
|
|
992
992
|
};
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function Lt(e, a, n, o = {}) {
|
|
995
995
|
var t, r, l;
|
|
996
996
|
const {
|
|
997
|
-
clone:
|
|
997
|
+
clone: i = !1,
|
|
998
998
|
passive: u = !1,
|
|
999
999
|
eventName: w,
|
|
1000
|
-
deep:
|
|
1000
|
+
deep: d = !1,
|
|
1001
1001
|
defaultValue: s,
|
|
1002
1002
|
shouldEmit: b
|
|
1003
|
-
} = o,
|
|
1004
|
-
let
|
|
1005
|
-
a || (a = "modelValue"),
|
|
1006
|
-
const
|
|
1007
|
-
b ? b(g) && p
|
|
1003
|
+
} = o, c = ae(), v = n || (c == null ? void 0 : c.emit) || ((t = c == null ? void 0 : c.$emit) == null ? void 0 : t.bind(c)) || ((l = (r = c == null ? void 0 : c.proxy) == null ? void 0 : r.$emit) == null ? void 0 : l.bind(c == null ? void 0 : c.proxy));
|
|
1004
|
+
let p = w;
|
|
1005
|
+
a || (a = "modelValue"), p = p || `update:${a.toString()}`;
|
|
1006
|
+
const h = (g) => i ? typeof i == "function" ? i(g) : ft(g) : g, x = () => tt(e[a]) ? h(e[a]) : s, m = (g) => {
|
|
1007
|
+
b ? b(g) && v(p, g) : v(p, g);
|
|
1008
1008
|
};
|
|
1009
1009
|
if (u) {
|
|
1010
|
-
const g =
|
|
1011
|
-
let
|
|
1010
|
+
const g = x(), y = A(g);
|
|
1011
|
+
let E = !1;
|
|
1012
1012
|
return O(
|
|
1013
1013
|
() => e[a],
|
|
1014
1014
|
(V) => {
|
|
1015
|
-
|
|
1015
|
+
E || (E = !0, y.value = h(V), j(() => E = !1));
|
|
1016
1016
|
}
|
|
1017
1017
|
), O(
|
|
1018
|
-
|
|
1018
|
+
y,
|
|
1019
1019
|
(V) => {
|
|
1020
|
-
!
|
|
1020
|
+
!E && (V !== e[a] || d) && m(V);
|
|
1021
1021
|
},
|
|
1022
|
-
{ deep:
|
|
1023
|
-
),
|
|
1022
|
+
{ deep: d }
|
|
1023
|
+
), y;
|
|
1024
1024
|
} else
|
|
1025
|
-
return
|
|
1025
|
+
return T({
|
|
1026
1026
|
get() {
|
|
1027
|
-
return
|
|
1027
|
+
return x();
|
|
1028
1028
|
},
|
|
1029
1029
|
set(g) {
|
|
1030
1030
|
m(g);
|
|
1031
1031
|
}
|
|
1032
1032
|
});
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1035
|
-
const { isDark: e } =
|
|
1034
|
+
function zt() {
|
|
1035
|
+
const { isDark: e } = ce(), a = lt(e);
|
|
1036
1036
|
return {
|
|
1037
1037
|
isDark: e,
|
|
1038
1038
|
toggleDark: a
|
|
1039
1039
|
};
|
|
1040
1040
|
}
|
|
1041
1041
|
function mt() {
|
|
1042
|
-
const e =
|
|
1043
|
-
return
|
|
1042
|
+
const e = A(!1);
|
|
1043
|
+
return ye(() => {
|
|
1044
1044
|
ht(e), vt(e);
|
|
1045
1045
|
}), O(
|
|
1046
1046
|
() => e.value,
|
|
@@ -1066,12 +1066,12 @@ function vt(e) {
|
|
|
1066
1066
|
n.observe(a, {
|
|
1067
1067
|
attributes: !0,
|
|
1068
1068
|
attributeFilter: ["class"]
|
|
1069
|
-
}),
|
|
1069
|
+
}), Se(() => {
|
|
1070
1070
|
n.disconnect();
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
1073
|
function yt() {
|
|
1074
|
-
const e =
|
|
1074
|
+
const e = A(1), a = A(!1), { isDark: n } = mt(), { pressSpace: o, pressShift: t, pressCtrl: r } = gt();
|
|
1075
1075
|
return {
|
|
1076
1076
|
canvasScale: e,
|
|
1077
1077
|
pressSpace: o,
|
|
@@ -1081,25 +1081,25 @@ function yt() {
|
|
|
1081
1081
|
isDark: n
|
|
1082
1082
|
};
|
|
1083
1083
|
}
|
|
1084
|
-
const
|
|
1084
|
+
const ce = je(yt);
|
|
1085
1085
|
function gt() {
|
|
1086
|
-
const e =
|
|
1087
|
-
return
|
|
1086
|
+
const e = A(!1), a = A(!1), n = A(!1);
|
|
1087
|
+
return pe(" ", () => {
|
|
1088
1088
|
e.value = !0;
|
|
1089
|
-
}),
|
|
1089
|
+
}), me(" ", () => {
|
|
1090
1090
|
e.value = !1;
|
|
1091
|
-
}),
|
|
1091
|
+
}), pe("Shift", (o) => {
|
|
1092
1092
|
o.preventDefault(), a.value = !0;
|
|
1093
|
-
}),
|
|
1093
|
+
}), me("Shift", () => {
|
|
1094
1094
|
a.value = !1;
|
|
1095
|
-
}),
|
|
1095
|
+
}), pe("Control", (o) => {
|
|
1096
1096
|
o.preventDefault(), n.value = !0;
|
|
1097
|
-
}),
|
|
1097
|
+
}), me("Control", () => {
|
|
1098
1098
|
n.value = !1;
|
|
1099
1099
|
}), { pressSpace: e, pressShift: a, pressCtrl: n };
|
|
1100
1100
|
}
|
|
1101
1101
|
function Jt(e) {
|
|
1102
|
-
const { pressSpace: a } =
|
|
1102
|
+
const { pressSpace: a } = ce(), n = new Image(1, 1);
|
|
1103
1103
|
n.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
|
|
1104
1104
|
let o = 0, t = 0;
|
|
1105
1105
|
function r(u) {
|
|
@@ -1109,16 +1109,16 @@ function Jt(e) {
|
|
|
1109
1109
|
function l(u) {
|
|
1110
1110
|
if (u.preventDefault(), !u.x || !u.y || !a.value)
|
|
1111
1111
|
return;
|
|
1112
|
-
const w = u.x - o,
|
|
1113
|
-
o = u.x, t = u.y, e.value && (e.value.scrollTop -=
|
|
1112
|
+
const w = u.x - o, d = u.y - t;
|
|
1113
|
+
o = u.x, t = u.y, e.value && (e.value.scrollTop -= d, e.value.scrollLeft -= w);
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function i() {
|
|
1116
1116
|
a.value = !1;
|
|
1117
1117
|
}
|
|
1118
|
-
return { handleElementDragStart: r, handleElementDrag: l, handleElementDragEnd:
|
|
1118
|
+
return { handleElementDragStart: r, handleElementDrag: l, handleElementDragEnd: i };
|
|
1119
1119
|
}
|
|
1120
1120
|
function Wt(e) {
|
|
1121
|
-
const { pressCtrl: a, canvasScale: n, disabledZoom: o } =
|
|
1121
|
+
const { pressCtrl: a, canvasScale: n, disabledZoom: o } = ce();
|
|
1122
1122
|
function t(r) {
|
|
1123
1123
|
if (!a.value || o.value)
|
|
1124
1124
|
return;
|
|
@@ -1146,57 +1146,57 @@ function Ht(e, a = 16.66) {
|
|
|
1146
1146
|
stopTimedQuery: t
|
|
1147
1147
|
};
|
|
1148
1148
|
}
|
|
1149
|
-
const wt = { class: "min-w-750px rounded" }, bt = { class: "h-full rounded" }, St = /* @__PURE__ */
|
|
1149
|
+
const wt = { class: "min-w-750px rounded" }, bt = { class: "h-full rounded" }, St = /* @__PURE__ */ Y({
|
|
1150
1150
|
__name: "index",
|
|
1151
1151
|
setup(e, { expose: a }) {
|
|
1152
|
-
const n = F.getComponent("monacoEditor"), o = F.getComponent("modal"), t =
|
|
1152
|
+
const n = F.getComponent("monacoEditor"), o = F.getComponent("modal"), t = A(null), r = A(!1), l = A(!1), i = A({}), u = K("pageSchema"), w = A(null), d = A("");
|
|
1153
1153
|
function s() {
|
|
1154
1154
|
l.value = !1;
|
|
1155
1155
|
}
|
|
1156
1156
|
function b() {
|
|
1157
1157
|
r.value = !1;
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1160
|
-
r.value = !0,
|
|
1159
|
+
function c() {
|
|
1160
|
+
r.value = !0, d.value = le();
|
|
1161
1161
|
}
|
|
1162
|
-
async function
|
|
1162
|
+
async function v() {
|
|
1163
1163
|
try {
|
|
1164
|
-
let
|
|
1165
|
-
if (!Object.keys(
|
|
1164
|
+
let p = await w.value.validateAll();
|
|
1165
|
+
if (!Object.keys(p).length) {
|
|
1166
1166
|
alert("请添加表单组件后再尝试!");
|
|
1167
1167
|
return;
|
|
1168
1168
|
}
|
|
1169
|
-
Object.keys(
|
|
1170
|
-
var
|
|
1171
|
-
(
|
|
1169
|
+
Object.keys(p).length === 1 && (p = p.default), i.value = JSON.stringify(p, null, 2), j(() => {
|
|
1170
|
+
var h;
|
|
1171
|
+
(h = t.value) == null || h.setValue(i.value);
|
|
1172
1172
|
}), l.value = !0;
|
|
1173
|
-
} catch (
|
|
1174
|
-
console.error(
|
|
1173
|
+
} catch (p) {
|
|
1174
|
+
console.error(p);
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
1177
|
return a({
|
|
1178
|
-
handleOpen:
|
|
1179
|
-
}), (
|
|
1178
|
+
handleOpen: c
|
|
1179
|
+
}), (p, h) => (R(), z(C(o), {
|
|
1180
1180
|
modelValue: r.value,
|
|
1181
|
-
"onUpdate:modelValue":
|
|
1181
|
+
"onUpdate:modelValue": h[1] || (h[1] = (x) => r.value = x),
|
|
1182
1182
|
title: "预览",
|
|
1183
1183
|
class: "w-900px",
|
|
1184
1184
|
width: "900px",
|
|
1185
1185
|
onClose: b,
|
|
1186
|
-
onOk:
|
|
1186
|
+
onOk: v,
|
|
1187
1187
|
okText: "表单数据"
|
|
1188
1188
|
}, {
|
|
1189
1189
|
default: P(() => [
|
|
1190
|
-
|
|
1191
|
-
(
|
|
1192
|
-
key:
|
|
1190
|
+
J("div", wt, [
|
|
1191
|
+
(R(), z(C(Xe), {
|
|
1192
|
+
key: d.value,
|
|
1193
1193
|
ref_key: "kb",
|
|
1194
1194
|
ref: w,
|
|
1195
|
-
"page-schema":
|
|
1195
|
+
"page-schema": C(u)
|
|
1196
1196
|
}, null, 8, ["page-schema"])),
|
|
1197
|
-
|
|
1197
|
+
L(C(o), {
|
|
1198
1198
|
modelValue: l.value,
|
|
1199
|
-
"onUpdate:modelValue":
|
|
1199
|
+
"onUpdate:modelValue": h[0] || (h[0] = (x) => l.value = x),
|
|
1200
1200
|
title: "表单数据",
|
|
1201
1201
|
class: "w-860px",
|
|
1202
1202
|
width: "860px",
|
|
@@ -1204,14 +1204,14 @@ const wt = { class: "min-w-750px rounded" }, bt = { class: "h-full rounded" }, S
|
|
|
1204
1204
|
onOk: s
|
|
1205
1205
|
}, {
|
|
1206
1206
|
default: P(() => [
|
|
1207
|
-
|
|
1208
|
-
|
|
1207
|
+
J("div", bt, [
|
|
1208
|
+
L(C(n), {
|
|
1209
1209
|
ref_key: "monacoEditorRef",
|
|
1210
1210
|
ref: t,
|
|
1211
1211
|
autoToggleTheme: "",
|
|
1212
1212
|
readOnly: "",
|
|
1213
1213
|
class: "h-full editor",
|
|
1214
|
-
"model-value":
|
|
1214
|
+
"model-value": i.value
|
|
1215
1215
|
}, null, 8, ["model-value"])
|
|
1216
1216
|
])
|
|
1217
1217
|
]),
|
|
@@ -1225,7 +1225,7 @@ const wt = { class: "min-w-750px rounded" }, bt = { class: "h-full rounded" }, S
|
|
|
1225
1225
|
}), At = {
|
|
1226
1226
|
key: 0,
|
|
1227
1227
|
class: "epic-loading-box"
|
|
1228
|
-
}, Dt = { class: "epic-designer-main" },
|
|
1228
|
+
}, Dt = { class: "epic-designer-main" }, Et = { class: "epic-header-container" }, kt = { class: "epic-loading-box" }, Kt = /* @__PURE__ */ Y({
|
|
1229
1229
|
__name: "designer",
|
|
1230
1230
|
props: {
|
|
1231
1231
|
disabledZoom: { type: Boolean, default: !1 },
|
|
@@ -1248,7 +1248,7 @@ const wt = { class: "min-w-750px rounded" }, bt = { class: "h-full rounded" }, S
|
|
|
1248
1248
|
"updateSourceData"
|
|
1249
1249
|
],
|
|
1250
1250
|
setup(e, { expose: a, emit: n }) {
|
|
1251
|
-
const o =
|
|
1251
|
+
const o = G(() => import("./index-C-XUgjda.js")), t = G(() => import("./index-ASoFJnMl.js")), r = G(() => import("./index-CGN7CLXA.js")), l = G(() => import("./index-ooVzYa5L.js")), i = G(() => import("./index-DgcFxYFp.js")), u = ke(), w = He(), d = e;
|
|
1252
1252
|
let s = {
|
|
1253
1253
|
schemas: [
|
|
1254
1254
|
{
|
|
@@ -1295,182 +1295,152 @@ defineExpose({
|
|
|
1295
1295
|
test
|
|
1296
1296
|
})`
|
|
1297
1297
|
};
|
|
1298
|
-
|
|
1299
|
-
if (
|
|
1300
|
-
s =
|
|
1298
|
+
se(async () => {
|
|
1299
|
+
if (d.defaultSchema) {
|
|
1300
|
+
s = d.defaultSchema;
|
|
1301
1301
|
return;
|
|
1302
1302
|
}
|
|
1303
|
-
console.log("%c [ updateSourceId ]-141", "font-size:13px; background:pink; color:#bf2c9f;",
|
|
1304
|
-
"%c [ innerDefaultSchema.schemas ]-155",
|
|
1305
|
-
"font-size:13px; background:pink; color:#bf2c9f;",
|
|
1306
|
-
s.schemas
|
|
1307
|
-
));
|
|
1303
|
+
console.log("%c [ updateSourceId ]-141", "font-size:13px; background:pink; color:#bf2c9f;", d.updateSourceId), console.log("%c [ source ]-141", "font-size:13px; background:pink; color:#bf2c9f;", d.source), d.source && F.setSourceData(d.source), d.formMode && (s.schemas = F.formSchemas), d.updateSourceId && (s.schemas = await b(s.schemas));
|
|
1308
1304
|
});
|
|
1309
|
-
async function b(
|
|
1310
|
-
return
|
|
1311
|
-
if (console.log("%c [ el ]-165", "font-size:13px; background:pink; color:#bf2c9f;", i), i && i.children && i.children.length && b(i.children), ["cascader", "checkbox", "select", "radio"].includes(i.type) && i.componentProps.dynamicId && f.updateSourceId === i.componentProps.dynamicId) {
|
|
1312
|
-
const D = f.source.find((E) => E.id === f.updateSourceId);
|
|
1313
|
-
let k = await ge({
|
|
1314
|
-
url: D.url,
|
|
1315
|
-
method: D.method,
|
|
1316
|
-
data: JSON.parse(D.body),
|
|
1317
|
-
params: JSON.parse(D.params),
|
|
1318
|
-
headers: JSON.parse(D.headers)
|
|
1319
|
-
});
|
|
1320
|
-
if (D && (D != null && D.dataPath)) {
|
|
1321
|
-
const W = D.dataPath.split(".").reduce((G, Q) => G[Q], k.data);
|
|
1322
|
-
i.componentProps.options = d(W).map((G) => ({
|
|
1323
|
-
label: G[D.dataKey],
|
|
1324
|
-
value: G[D.dataValue]
|
|
1325
|
-
}));
|
|
1326
|
-
} else
|
|
1327
|
-
i.componentProps.options = d(k.data).map((E) => ({
|
|
1328
|
-
label: E[D.dataKey],
|
|
1329
|
-
value: E[D.dataValue]
|
|
1330
|
-
}));
|
|
1331
|
-
}
|
|
1332
|
-
return i;
|
|
1333
|
-
});
|
|
1334
|
-
}
|
|
1335
|
-
function d(y) {
|
|
1336
|
-
return y && Object.prototype.toString.call(y) === "[object Array]" ? y : [];
|
|
1305
|
+
async function b(S) {
|
|
1306
|
+
return S.map(async (M) => (console.log("%c [ el ]-158", "font-size:13px; background:pink; color:#bf2c9f;", M), M && M.children && M.children.length && b(M.children), M));
|
|
1337
1307
|
}
|
|
1338
1308
|
u.setDesignMode(), u.setDefaultComponentIds(s.schemas);
|
|
1339
|
-
const
|
|
1309
|
+
const c = n, v = A(null), p = Q({
|
|
1340
1310
|
checkedNode: null,
|
|
1341
1311
|
hoverNode: null,
|
|
1342
1312
|
disableHover: !1,
|
|
1343
1313
|
matched: []
|
|
1344
|
-
}),
|
|
1314
|
+
}), h = Q({
|
|
1345
1315
|
schemas: [],
|
|
1346
1316
|
script: s.script
|
|
1347
|
-
}), { disabledZoom:
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
}),
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1353
|
-
}),
|
|
1317
|
+
}), { disabledZoom: x } = ce();
|
|
1318
|
+
se(() => {
|
|
1319
|
+
x.value = d.disabledZoom;
|
|
1320
|
+
}), se(() => {
|
|
1321
|
+
const S = h.script;
|
|
1322
|
+
S && S !== "" && u.setMethods(S);
|
|
1323
|
+
}), N("pageSchema", h), N("revoke", w), N("pageManager", u), N(
|
|
1354
1324
|
"designerProps",
|
|
1355
|
-
|
|
1356
|
-
),
|
|
1357
|
-
setCheckedNode:
|
|
1358
|
-
setHoverNode:
|
|
1359
|
-
setDisableHover:
|
|
1360
|
-
handleToggleDeviceMode:
|
|
1361
|
-
reset:
|
|
1362
|
-
state:
|
|
1363
|
-
}),
|
|
1364
|
-
|
|
1365
|
-
}),
|
|
1366
|
-
|
|
1367
|
-
}),
|
|
1368
|
-
|
|
1325
|
+
T(() => d)
|
|
1326
|
+
), N("designer", {
|
|
1327
|
+
setCheckedNode: g,
|
|
1328
|
+
setHoverNode: y,
|
|
1329
|
+
setDisableHover: V,
|
|
1330
|
+
handleToggleDeviceMode: de,
|
|
1331
|
+
reset: ee,
|
|
1332
|
+
state: p
|
|
1333
|
+
}), fe.on("saveSourceData", (S) => {
|
|
1334
|
+
c("saveSourceData", S);
|
|
1335
|
+
}), fe.on("deleteSourceData", (S) => {
|
|
1336
|
+
c("deleteSourceData", S);
|
|
1337
|
+
}), fe.on("updateSourceData", (S) => {
|
|
1338
|
+
c("updateSourceData", S);
|
|
1369
1339
|
});
|
|
1370
|
-
function
|
|
1371
|
-
|
|
1340
|
+
function m() {
|
|
1341
|
+
h.schemas = B(s.schemas), g(h.schemas[0]), w.push(h.schemas, "初始化撤销功能");
|
|
1372
1342
|
}
|
|
1373
|
-
async function
|
|
1374
|
-
|
|
1343
|
+
async function g(S = h.schemas[0]) {
|
|
1344
|
+
p.checkedNode = S, p.matched = ze(h.schemas, S.id);
|
|
1375
1345
|
}
|
|
1376
|
-
async function
|
|
1377
|
-
var
|
|
1378
|
-
if (!
|
|
1379
|
-
return
|
|
1380
|
-
if ((
|
|
1346
|
+
async function y(S = null) {
|
|
1347
|
+
var M;
|
|
1348
|
+
if (!S || p.disableHover)
|
|
1349
|
+
return p.hoverNode = null, !1;
|
|
1350
|
+
if ((S == null ? void 0 : S.id) === ((M = p.hoverNode) == null ? void 0 : M.id))
|
|
1381
1351
|
return !1;
|
|
1382
|
-
|
|
1352
|
+
p.hoverNode = S;
|
|
1383
1353
|
}
|
|
1384
|
-
function
|
|
1385
|
-
|
|
1386
|
-
|
|
1354
|
+
function E() {
|
|
1355
|
+
j(() => {
|
|
1356
|
+
c("ready", { pageManager: u });
|
|
1387
1357
|
});
|
|
1388
1358
|
}
|
|
1389
|
-
async function
|
|
1390
|
-
|
|
1359
|
+
async function V(S = !1) {
|
|
1360
|
+
p.disableHover = S;
|
|
1391
1361
|
}
|
|
1392
|
-
function
|
|
1393
|
-
|
|
1362
|
+
function U(S) {
|
|
1363
|
+
W(h, B(S));
|
|
1394
1364
|
}
|
|
1395
|
-
function
|
|
1396
|
-
return
|
|
1365
|
+
function Z() {
|
|
1366
|
+
return we(h);
|
|
1397
1367
|
}
|
|
1398
|
-
function
|
|
1399
|
-
|
|
1368
|
+
function ee() {
|
|
1369
|
+
Ee(h.schemas, s.schemas) && h.script === s.script || (W(h.schemas, s.schemas), h.script = s.script, g(h.schemas[0]), w.push(h.schemas, "重置操作"), c("reset", h));
|
|
1400
1370
|
}
|
|
1401
|
-
function
|
|
1402
|
-
|
|
1371
|
+
function ue() {
|
|
1372
|
+
c("save", we(h));
|
|
1403
1373
|
}
|
|
1404
|
-
function
|
|
1405
|
-
|
|
1374
|
+
function de(S) {
|
|
1375
|
+
c("toggleDeviceMode", S);
|
|
1406
1376
|
}
|
|
1407
|
-
function
|
|
1408
|
-
console.log("%c [ ]-385", "font-size:13px; background:pink; color:#bf2c9f;",
|
|
1377
|
+
function H() {
|
|
1378
|
+
console.log("%c [ ]-385", "font-size:13px; background:pink; color:#bf2c9f;", d), v.value.handleOpen();
|
|
1409
1379
|
}
|
|
1410
|
-
return
|
|
1380
|
+
return m(), a({
|
|
1411
1381
|
revoke: w,
|
|
1412
|
-
setData:
|
|
1413
|
-
getData:
|
|
1414
|
-
reset:
|
|
1415
|
-
preview:
|
|
1416
|
-
}), (
|
|
1382
|
+
setData: U,
|
|
1383
|
+
getData: Z,
|
|
1384
|
+
reset: ee,
|
|
1385
|
+
preview: H
|
|
1386
|
+
}), (S, M) => C(F).initialized.value ? (R(), z(De, {
|
|
1417
1387
|
key: 1,
|
|
1418
|
-
onResolve:
|
|
1388
|
+
onResolve: E
|
|
1419
1389
|
}, {
|
|
1420
1390
|
default: P(() => [
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1391
|
+
J("div", Dt, [
|
|
1392
|
+
J("div", Et, [
|
|
1393
|
+
$(S.$slots, "header", {}, () => [
|
|
1394
|
+
d.hiddenHeader ? Ae("", !0) : (R(), z(C(o), {
|
|
1425
1395
|
key: 0,
|
|
1426
|
-
onPreview:
|
|
1427
|
-
onSave:
|
|
1396
|
+
onPreview: H,
|
|
1397
|
+
onSave: ue
|
|
1428
1398
|
}, {
|
|
1429
1399
|
header: P(() => [
|
|
1430
|
-
|
|
1400
|
+
$(S.$slots, "header-prefix")
|
|
1431
1401
|
]),
|
|
1432
1402
|
prefix: P(() => [
|
|
1433
|
-
|
|
1403
|
+
$(S.$slots, "header-prefix")
|
|
1434
1404
|
]),
|
|
1435
1405
|
title: P(() => [
|
|
1436
|
-
|
|
1406
|
+
$(S.$slots, "header-title")
|
|
1437
1407
|
]),
|
|
1438
1408
|
"right-prefix": P(() => [
|
|
1439
|
-
|
|
1409
|
+
$(S.$slots, "header-right-prefix")
|
|
1440
1410
|
]),
|
|
1441
1411
|
"right-action": P(() => [
|
|
1442
|
-
|
|
1412
|
+
$(S.$slots, "header-right-action")
|
|
1443
1413
|
]),
|
|
1444
1414
|
"right-suffix": P(() => [
|
|
1445
|
-
|
|
1415
|
+
$(S.$slots, "header-right-suffix")
|
|
1446
1416
|
]),
|
|
1447
1417
|
_: 3
|
|
1448
1418
|
}))
|
|
1449
1419
|
])
|
|
1450
1420
|
]),
|
|
1451
|
-
|
|
1452
|
-
class: Te(["epic-split-view-container", { "hidden-header":
|
|
1421
|
+
J("div", {
|
|
1422
|
+
class: Te(["epic-split-view-container", { "hidden-header": S.hiddenHeader }])
|
|
1453
1423
|
}, [
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1424
|
+
L(C(t)),
|
|
1425
|
+
L(C(r)),
|
|
1426
|
+
L(C(l))
|
|
1457
1427
|
], 2),
|
|
1458
|
-
|
|
1428
|
+
L(St, {
|
|
1459
1429
|
ref_key: "previewRef",
|
|
1460
1430
|
ref: v
|
|
1461
1431
|
}, null, 512)
|
|
1462
1432
|
])
|
|
1463
1433
|
]),
|
|
1464
1434
|
fallback: P(() => [
|
|
1465
|
-
|
|
1466
|
-
|
|
1435
|
+
J("div", kt, [
|
|
1436
|
+
L(C(i))
|
|
1467
1437
|
])
|
|
1468
1438
|
]),
|
|
1469
1439
|
_: 3
|
|
1470
|
-
})) : (
|
|
1440
|
+
})) : (R(), ve("div", At));
|
|
1471
1441
|
}
|
|
1472
|
-
}),
|
|
1473
|
-
component: async () => await import("./index-
|
|
1442
|
+
}), It = {
|
|
1443
|
+
component: async () => await import("./index-O79tvUa3.js"),
|
|
1474
1444
|
defaultSchema: {
|
|
1475
1445
|
label: "代码编辑器",
|
|
1476
1446
|
type: "monacoEditor",
|
|
@@ -1520,16 +1490,16 @@ defineExpose({
|
|
|
1520
1490
|
}
|
|
1521
1491
|
};
|
|
1522
1492
|
function Ct(e) {
|
|
1523
|
-
e.component("EInputSize", async () => await import("./index-C4sdhgF2.js")), e.component("EColEditor", async () => await import("./index-
|
|
1493
|
+
e.component("EInputSize", async () => await import("./index-C4sdhgF2.js")), e.component("EColEditor", async () => await import("./index-DMYNC73J.js")), e.component("EActionEditor", async () => await import("./index-Dz7IFRkI.js")), e.component("ERuleEditor", async () => await import("./index-Boh9Xc_a.js")), e.component("EOptionsEditor", async () => await import("./index-CrK_IhiA.js")), e.component("ENode", async () => await import("./index-C7VIh0HN.js")), e.component("EDataSource", async () => await import("./index-CCTMCqiz.js")), e.registerActivitybar({
|
|
1524
1494
|
id: "component_view",
|
|
1525
1495
|
title: "组件",
|
|
1526
1496
|
icon: "icon--epic--extension-outline",
|
|
1527
|
-
component: async () => await import("./index-
|
|
1497
|
+
component: async () => await import("./index-aHQ5toGq.js")
|
|
1528
1498
|
}), e.registerActivitybar({
|
|
1529
1499
|
id: "sound_code_view",
|
|
1530
1500
|
title: "源码",
|
|
1531
1501
|
icon: "icon--epic--sdk-outline-rounded",
|
|
1532
|
-
component: async () => await import("./index-
|
|
1502
|
+
component: async () => await import("./index-YMEmD-hy.js")
|
|
1533
1503
|
}), e.registerActivitybar({
|
|
1534
1504
|
id: "outline_view",
|
|
1535
1505
|
title: "大纲",
|
|
@@ -1538,16 +1508,16 @@ function Ct(e) {
|
|
|
1538
1508
|
}), e.registerRightSidebar({
|
|
1539
1509
|
id: "attribute_view",
|
|
1540
1510
|
title: "属性",
|
|
1541
|
-
component: async () => await import("./attributeView-
|
|
1511
|
+
component: async () => await import("./attributeView-ukvra0JR.js")
|
|
1542
1512
|
}), e.registerRightSidebar({
|
|
1543
1513
|
id: "style_view",
|
|
1544
1514
|
title: "样式",
|
|
1545
|
-
component: async () => await import("./styleView-
|
|
1515
|
+
component: async () => await import("./styleView-OSZZjuEF.js")
|
|
1546
1516
|
}), e.registerRightSidebar({
|
|
1547
1517
|
id: "event_view",
|
|
1548
1518
|
title: "事件",
|
|
1549
|
-
component: async () => await import("./eventView-
|
|
1550
|
-
}), [
|
|
1519
|
+
component: async () => await import("./eventView-CxT-MCmM.js")
|
|
1520
|
+
}), [It, xt].forEach((n) => {
|
|
1551
1521
|
e.registerComponent(n);
|
|
1552
1522
|
});
|
|
1553
1523
|
}
|
|
@@ -1557,7 +1527,7 @@ export {
|
|
|
1557
1527
|
oe as B,
|
|
1558
1528
|
We as C,
|
|
1559
1529
|
ne as D,
|
|
1560
|
-
|
|
1530
|
+
Le as E,
|
|
1561
1531
|
gt as F,
|
|
1562
1532
|
mt as G,
|
|
1563
1533
|
ht as H,
|
|
@@ -1566,27 +1536,27 @@ export {
|
|
|
1566
1536
|
Ht as a,
|
|
1567
1537
|
pt as b,
|
|
1568
1538
|
Nt as c,
|
|
1569
|
-
|
|
1539
|
+
W as d,
|
|
1570
1540
|
Jt as e,
|
|
1571
1541
|
$t as f,
|
|
1572
1542
|
Ot as g,
|
|
1573
1543
|
Tt as h,
|
|
1574
1544
|
Wt as i,
|
|
1575
1545
|
Bt as j,
|
|
1576
|
-
|
|
1546
|
+
le as k,
|
|
1577
1547
|
Rt as l,
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1548
|
+
B as m,
|
|
1549
|
+
Lt as n,
|
|
1550
|
+
Ee as o,
|
|
1581
1551
|
Vt as p,
|
|
1582
|
-
|
|
1552
|
+
zt as q,
|
|
1583
1553
|
Xe as r,
|
|
1584
1554
|
Ft as s,
|
|
1585
1555
|
Kt as t,
|
|
1586
|
-
|
|
1587
|
-
|
|
1556
|
+
ce as u,
|
|
1557
|
+
ke as v,
|
|
1588
1558
|
Ut as w,
|
|
1589
1559
|
He as x,
|
|
1590
|
-
|
|
1560
|
+
ze as y,
|
|
1591
1561
|
Mt as z
|
|
1592
1562
|
};
|