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