yswk-editor 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +521 -491
- package/dist/utils/propertyHelper.d.ts +1 -1
- package/package.json +3 -2
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as K, toRefs as
|
|
2
|
-
import { InfoFilled as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as K, toRefs as ge, ref as N, createElementBlock as _, openBlock as d, normalizeClass as ee, createElementVNode as v, createCommentVNode as M, renderSlot as Q, Fragment as Y, withModifiers as X, computed as E, renderList as G, shallowRef as fe, toDisplayString as T, normalizeStyle as oe, createVNode as w, createBlock as R, withCtx as U, resolveDynamicComponent as ye, mergeProps as be, resolveComponent as I, createTextVNode as H, unref as B, reactive as re, watch as te, onMounted as ke, normalizeProps as ae, guardReactiveProps as ie } from "vue";
|
|
2
|
+
import { InfoFilled as _e, Grid as we, QuestionFilled as j } from "@element-plus/icons-vue";
|
|
3
|
+
const $e = { class: "wkc-component-content" }, Ce = { class: "wkc-component-actions" }, Se = ["disabled"], Ve = ["disabled"], ze = /* @__PURE__ */ K({
|
|
4
4
|
__name: "ComponentWrapper",
|
|
5
5
|
props: {
|
|
6
6
|
isActive: { type: Boolean },
|
|
@@ -12,13 +12,13 @@ const we = { class: "wkc-component-content" }, $e = { class: "wkc-component-acti
|
|
|
12
12
|
designWidth: {}
|
|
13
13
|
},
|
|
14
14
|
emits: ["click", "move-up", "move-down", "delete", "cancel-select", "update-position", "update-size"],
|
|
15
|
-
setup(e, { emit:
|
|
16
|
-
const t = e, { designHeight: l, designWidth: o } =
|
|
15
|
+
setup(e, { emit: r }) {
|
|
16
|
+
const t = e, { designHeight: l, designWidth: o } = ge(t), p = r, c = N(!1), g = N({
|
|
17
17
|
startX: 0,
|
|
18
18
|
startY: 0,
|
|
19
19
|
originalX: 0,
|
|
20
20
|
originalY: 0
|
|
21
|
-
}),
|
|
21
|
+
}), C = N(!1), z = N({
|
|
22
22
|
direction: "",
|
|
23
23
|
startX: 0,
|
|
24
24
|
startY: 0,
|
|
@@ -26,120 +26,120 @@ const we = { class: "wkc-component-content" }, $e = { class: "wkc-component-acti
|
|
|
26
26
|
originalHeight: 0,
|
|
27
27
|
originalLeft: 0,
|
|
28
28
|
originalTop: 0
|
|
29
|
-
}), $ = (
|
|
30
|
-
|
|
31
|
-
}, i = (
|
|
29
|
+
}), $ = (S) => {
|
|
30
|
+
p("click", S);
|
|
31
|
+
}, i = (S) => {
|
|
32
32
|
if (!t.isActive)
|
|
33
33
|
return;
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
34
|
+
const b = S.target;
|
|
35
|
+
if (b.closest(".wkc-component-actions") || b.closest(".wkc-resizer") || !t.position)
|
|
36
36
|
return;
|
|
37
|
-
c.value = !0,
|
|
38
|
-
startX:
|
|
39
|
-
startY:
|
|
37
|
+
c.value = !0, g.value = {
|
|
38
|
+
startX: S.clientX,
|
|
39
|
+
startY: S.clientY,
|
|
40
40
|
originalX: t.position.left,
|
|
41
41
|
originalY: t.position.top
|
|
42
42
|
};
|
|
43
|
-
const h = (
|
|
43
|
+
const h = (k) => {
|
|
44
44
|
if (!c.value) return;
|
|
45
|
-
const
|
|
46
|
-
let s =
|
|
45
|
+
const y = k.clientX - g.value.startX, m = k.clientY - g.value.startY;
|
|
46
|
+
let s = g.value.originalX + y, x = g.value.originalY + m;
|
|
47
47
|
if (o != null && o.value && (l != null && l.value) && t.position) {
|
|
48
|
-
const L = t.position.width || 0,
|
|
49
|
-
s = Math.max(0, s), L > 0 && (s = Math.min(o.value - L, s)), x = Math.max(0, x),
|
|
48
|
+
const L = t.position.width || 0, P = t.position.height || 0;
|
|
49
|
+
s = Math.max(0, s), L > 0 && (s = Math.min(o.value - L, s)), x = Math.max(0, x), P > 0 && (x = Math.min(l.value - P, x));
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
p("update-position", s, x);
|
|
52
52
|
}, u = () => {
|
|
53
53
|
c.value && (c.value = !1), document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", u);
|
|
54
54
|
};
|
|
55
55
|
document.addEventListener("mousemove", h), document.addEventListener("mouseup", u);
|
|
56
|
-
},
|
|
56
|
+
}, f = (S, b) => {
|
|
57
57
|
if (!t.position) return;
|
|
58
|
-
|
|
59
|
-
direction:
|
|
60
|
-
startX:
|
|
61
|
-
startY:
|
|
58
|
+
C.value = !0, z.value = {
|
|
59
|
+
direction: S,
|
|
60
|
+
startX: b.clientX,
|
|
61
|
+
startY: b.clientY,
|
|
62
62
|
originalWidth: t.position.width || 0,
|
|
63
63
|
originalHeight: t.position.height || 0,
|
|
64
64
|
originalLeft: t.position.left,
|
|
65
65
|
originalTop: t.position.top
|
|
66
66
|
};
|
|
67
|
-
const h = (
|
|
68
|
-
if (!
|
|
69
|
-
const
|
|
70
|
-
let s = z.value.originalWidth, x = z.value.originalHeight, L = z.value.originalLeft,
|
|
71
|
-
switch (
|
|
67
|
+
const h = (k) => {
|
|
68
|
+
if (!C.value) return;
|
|
69
|
+
const y = k.clientX - z.value.startX, m = k.clientY - z.value.startY;
|
|
70
|
+
let s = z.value.originalWidth, x = z.value.originalHeight, L = z.value.originalLeft, P = z.value.originalTop;
|
|
71
|
+
switch (S) {
|
|
72
72
|
case "left-top":
|
|
73
|
-
L = z.value.originalLeft +
|
|
73
|
+
L = z.value.originalLeft + y, P = z.value.originalTop + m, s = z.value.originalWidth - y, x = z.value.originalHeight - m;
|
|
74
74
|
break;
|
|
75
75
|
case "left-bottom":
|
|
76
|
-
L = z.value.originalLeft +
|
|
76
|
+
L = z.value.originalLeft + y, s = z.value.originalWidth - y, x = z.value.originalHeight + m;
|
|
77
77
|
break;
|
|
78
78
|
case "right-top":
|
|
79
|
-
|
|
79
|
+
P = z.value.originalTop + m, s = z.value.originalWidth + y, x = z.value.originalHeight - m;
|
|
80
80
|
break;
|
|
81
81
|
case "right-bottom":
|
|
82
|
-
s = z.value.originalWidth +
|
|
82
|
+
s = z.value.originalWidth + y, x = z.value.originalHeight + m;
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
85
|
-
s = Math.max(10, s), x = Math.max(10, x), o != null && o.value && (l != null && l.value) && (L = Math.max(0, L),
|
|
85
|
+
s = Math.max(10, s), x = Math.max(10, x), o != null && o.value && (l != null && l.value) && (L = Math.max(0, L), P = Math.max(0, P), L + s > o.value && ((S === "left-top" || S === "left-bottom") && (L = Math.max(0, o.value - s)), s = o.value - L), P + x > l.value && ((S === "left-top" || S === "right-top") && (P = Math.max(0, l.value - x)), x = l.value - P)), p("update-size", s, x, L, P);
|
|
86
86
|
}, u = () => {
|
|
87
|
-
|
|
87
|
+
C.value && (C.value = !1), document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", u);
|
|
88
88
|
};
|
|
89
89
|
document.addEventListener("mousemove", h), document.addEventListener("mouseup", u);
|
|
90
90
|
};
|
|
91
|
-
return (
|
|
91
|
+
return (S, b) => (d(), _("div", {
|
|
92
92
|
class: ee(["wkc-component-wrapper", { active: e.isActive, dragging: c.value && e.isActive && !e.ignoreDrag }]),
|
|
93
|
-
onClick:
|
|
93
|
+
onClick: b[8] || (b[8] = () => $(!1)),
|
|
94
94
|
onMousedown: i
|
|
95
95
|
}, [
|
|
96
|
-
v("div",
|
|
97
|
-
Q(
|
|
96
|
+
v("div", $e, [
|
|
97
|
+
Q(S.$slots, "default")
|
|
98
98
|
]),
|
|
99
|
-
e.isActive && !e.ignoreDrag ? (
|
|
99
|
+
e.isActive && !e.ignoreDrag ? (d(), _(Y, { key: 0 }, [
|
|
100
100
|
v("div", {
|
|
101
101
|
class: "wkc-resizer corner-left-top",
|
|
102
|
-
onMousedown:
|
|
102
|
+
onMousedown: b[0] || (b[0] = X((h) => f("left-top", h), ["stop"]))
|
|
103
103
|
}, null, 32),
|
|
104
104
|
v("div", {
|
|
105
105
|
class: "wkc-resizer corner-left-bottom",
|
|
106
|
-
onMousedown:
|
|
106
|
+
onMousedown: b[1] || (b[1] = X((h) => f("left-bottom", h), ["stop"]))
|
|
107
107
|
}, null, 32),
|
|
108
108
|
v("div", {
|
|
109
109
|
class: "wkc-resizer corner-right-top",
|
|
110
|
-
onMousedown:
|
|
110
|
+
onMousedown: b[2] || (b[2] = X((h) => f("right-top", h), ["stop"]))
|
|
111
111
|
}, null, 32),
|
|
112
112
|
v("div", {
|
|
113
113
|
class: "wkc-resizer corner-right-bottom",
|
|
114
|
-
onMousedown:
|
|
114
|
+
onMousedown: b[3] || (b[3] = X((h) => f("right-bottom", h), ["stop"]))
|
|
115
115
|
}, null, 32)
|
|
116
116
|
], 64)) : M("", !0),
|
|
117
|
-
v("div",
|
|
117
|
+
v("div", Ce, [
|
|
118
118
|
v("button", {
|
|
119
119
|
disabled: !e.canMoveUp,
|
|
120
|
-
onClick:
|
|
120
|
+
onClick: b[4] || (b[4] = X((h) => S.$emit("move-up"), ["stop"])),
|
|
121
121
|
title: "上移层级"
|
|
122
|
-
}, "↑", 8,
|
|
122
|
+
}, "↑", 8, Se),
|
|
123
123
|
v("button", {
|
|
124
124
|
disabled: !e.canMoveDown,
|
|
125
|
-
onClick:
|
|
125
|
+
onClick: b[5] || (b[5] = X((h) => S.$emit("move-down"), ["stop"])),
|
|
126
126
|
title: "下移层级"
|
|
127
|
-
}, "↓", 8,
|
|
127
|
+
}, "↓", 8, Ve),
|
|
128
128
|
v("button", {
|
|
129
|
-
onClick:
|
|
129
|
+
onClick: b[6] || (b[6] = X(() => $(!0), ["stop"])),
|
|
130
130
|
title: "取消选中"
|
|
131
131
|
}, "✕"),
|
|
132
132
|
v("button", {
|
|
133
|
-
onClick:
|
|
133
|
+
onClick: b[7] || (b[7] = X((h) => S.$emit("delete"), ["stop"])),
|
|
134
134
|
title: "删除组件"
|
|
135
135
|
}, "🗑️")
|
|
136
136
|
])
|
|
137
137
|
], 34));
|
|
138
138
|
}
|
|
139
|
-
}),
|
|
139
|
+
}), xe = {
|
|
140
140
|
key: 0,
|
|
141
141
|
class: "wkc-grid-overlay"
|
|
142
|
-
},
|
|
142
|
+
}, Ue = ["width", "height"], Le = ["x1", "x2", "y2"], Me = ["y1", "x2", "y2"], Ie = /* @__PURE__ */ K({
|
|
143
143
|
__name: "GridOverlay",
|
|
144
144
|
props: {
|
|
145
145
|
visible: { type: Boolean },
|
|
@@ -148,59 +148,59 @@ const we = { class: "wkc-component-content" }, $e = { class: "wkc-component-acti
|
|
|
148
148
|
gridSize: { default: 10 }
|
|
149
149
|
},
|
|
150
150
|
setup(e) {
|
|
151
|
-
const
|
|
152
|
-
half:
|
|
153
|
-
quarter:
|
|
154
|
-
threeQuarter:
|
|
155
|
-
})), l =
|
|
156
|
-
const c = [],
|
|
157
|
-
for (let $ =
|
|
151
|
+
const r = e, t = E(() => ({
|
|
152
|
+
half: r.width / 2,
|
|
153
|
+
quarter: r.width / 4,
|
|
154
|
+
threeQuarter: r.width * 3 / 4
|
|
155
|
+
})), l = E(() => {
|
|
156
|
+
const c = [], g = t.value;
|
|
157
|
+
for (let $ = r.gridSize; $ < r.width; $ += r.gridSize)
|
|
158
158
|
c.push($);
|
|
159
|
-
const
|
|
160
|
-
c.some((
|
|
159
|
+
const C = 1, z = ($) => {
|
|
160
|
+
c.some((f) => Math.abs(f - $) < C) || c.push($);
|
|
161
161
|
};
|
|
162
|
-
return z(
|
|
163
|
-
}), o =
|
|
162
|
+
return z(g.half), z(g.quarter), z(g.threeQuarter), c.sort(($, i) => $ - i);
|
|
163
|
+
}), o = E(() => {
|
|
164
164
|
const c = [];
|
|
165
|
-
for (let
|
|
166
|
-
c.push(
|
|
165
|
+
for (let g = r.gridSize; g < r.height; g += r.gridSize)
|
|
166
|
+
c.push(g);
|
|
167
167
|
return c;
|
|
168
|
-
}),
|
|
169
|
-
const
|
|
170
|
-
return Math.abs(c -
|
|
168
|
+
}), p = (c) => {
|
|
169
|
+
const g = t.value, C = 1;
|
|
170
|
+
return Math.abs(c - g.half) < C ? "wkc-grid-line wkc-grid-line-half" : Math.abs(c - g.quarter) < C ? "wkc-grid-line wkc-grid-line-quarter" : Math.abs(c - g.threeQuarter) < C ? "wkc-grid-line wkc-grid-line-three-quarter" : "wkc-grid-line";
|
|
171
171
|
};
|
|
172
|
-
return (c,
|
|
173
|
-
(
|
|
172
|
+
return (c, g) => e.visible ? (d(), _("div", xe, [
|
|
173
|
+
(d(), _("svg", {
|
|
174
174
|
class: "wkc-grid-svg",
|
|
175
175
|
width: e.width,
|
|
176
176
|
height: e.height
|
|
177
177
|
}, [
|
|
178
|
-
(
|
|
179
|
-
key: `v-${
|
|
180
|
-
x1:
|
|
178
|
+
(d(!0), _(Y, null, G(l.value, (C) => (d(), _("line", {
|
|
179
|
+
key: `v-${C}`,
|
|
180
|
+
x1: C,
|
|
181
181
|
y1: 0,
|
|
182
|
-
x2:
|
|
182
|
+
x2: C,
|
|
183
183
|
y2: e.height,
|
|
184
|
-
class: ee(
|
|
185
|
-
}, null, 10,
|
|
186
|
-
(
|
|
187
|
-
key: `h-${
|
|
184
|
+
class: ee(p(C))
|
|
185
|
+
}, null, 10, Le))), 128)),
|
|
186
|
+
(d(!0), _(Y, null, G(o.value, (C) => (d(), _("line", {
|
|
187
|
+
key: `h-${C}`,
|
|
188
188
|
x1: 0,
|
|
189
|
-
y1:
|
|
189
|
+
y1: C,
|
|
190
190
|
x2: e.width,
|
|
191
|
-
y2:
|
|
191
|
+
y2: C,
|
|
192
192
|
class: "wkc-grid-line"
|
|
193
|
-
}, null, 8,
|
|
194
|
-
], 8,
|
|
193
|
+
}, null, 8, Me))), 128))
|
|
194
|
+
], 8, Ue))
|
|
195
195
|
])) : M("", !0);
|
|
196
196
|
}
|
|
197
|
-
}),
|
|
197
|
+
}), Ae = { class: "wkc-h5-mobile-render" }, Pe = {
|
|
198
198
|
key: 0,
|
|
199
199
|
class: "wkc-control-buttons"
|
|
200
|
-
}, Re = { class: "wkc-button-row" }, Ee = { class: "wkc-button-label" },
|
|
200
|
+
}, Re = { class: "wkc-button-row" }, Ee = { class: "wkc-button-label" }, Te = { class: "wkc-button-row" }, Be = {
|
|
201
201
|
class: "wkc-mobile-content",
|
|
202
202
|
id: "wkc-mobile-render-mock"
|
|
203
|
-
},
|
|
203
|
+
}, Ne = ["id"], Oe = {
|
|
204
204
|
key: 0,
|
|
205
205
|
class: "wkc-empty-placeholder"
|
|
206
206
|
}, So = /* @__PURE__ */ K({
|
|
@@ -223,26 +223,26 @@ const we = { class: "wkc-component-content" }, $e = { class: "wkc-component-acti
|
|
|
223
223
|
] }
|
|
224
224
|
},
|
|
225
225
|
emits: ["update:selectedIndex", "update:showGrid", "delete-component", "move-up", "move-down", "update-position", "update-size"],
|
|
226
|
-
setup(e, { emit:
|
|
227
|
-
const t = e, l =
|
|
228
|
-
const
|
|
229
|
-
return
|
|
230
|
-
width: `${
|
|
231
|
-
height: `${
|
|
226
|
+
setup(e, { emit: r }) {
|
|
227
|
+
const t = e, l = r, o = N("medium"), p = N(t.showGrid), c = E(() => {
|
|
228
|
+
const m = t.mobileSizes.find((s) => s.name === o.value);
|
|
229
|
+
return m ? {
|
|
230
|
+
width: `${m.width}px`,
|
|
231
|
+
height: `${m.height}px`
|
|
232
232
|
} : {};
|
|
233
|
-
}),
|
|
234
|
-
const
|
|
235
|
-
return
|
|
236
|
-
}),
|
|
237
|
-
const
|
|
238
|
-
return
|
|
233
|
+
}), g = E(() => {
|
|
234
|
+
const m = t.mobileSizes.find((s) => s.name === o.value);
|
|
235
|
+
return m ? m.width : t.designWidth;
|
|
236
|
+
}), C = E(() => {
|
|
237
|
+
const m = t.mobileSizes.find((s) => s.name === o.value);
|
|
238
|
+
return m ? m.height : t.designHeight;
|
|
239
239
|
}), z = () => {
|
|
240
|
-
|
|
241
|
-
}, $ = (
|
|
242
|
-
l("update:selectedIndex",
|
|
243
|
-
}, i = (
|
|
244
|
-
var L,
|
|
245
|
-
const s = (
|
|
240
|
+
p.value = !p.value, l("update:showGrid", p.value);
|
|
241
|
+
}, $ = (m) => {
|
|
242
|
+
l("update:selectedIndex", m > -1 ? m : null);
|
|
243
|
+
}, i = (m) => typeof m == "number" ? `${m}px` : /\d+$/g.test(m) ? `${m}px` : m, f = (m) => {
|
|
244
|
+
var L, P;
|
|
245
|
+
const s = (P = (L = m.props) == null ? void 0 : L.styleSchema) == null ? void 0 : P.position;
|
|
246
246
|
if (!s) return {};
|
|
247
247
|
const x = {
|
|
248
248
|
position: "absolute",
|
|
@@ -253,66 +253,66 @@ const we = { class: "wkc-component-content" }, $e = { class: "wkc-component-acti
|
|
|
253
253
|
};
|
|
254
254
|
return s.centerHorizontal ? (x.left = "50%", x.transform = "translateX(-50%)") : x.left = `${i(s.left || 0)}`, x;
|
|
255
255
|
};
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
l("delete-component",
|
|
259
|
-
},
|
|
260
|
-
l("move-up",
|
|
261
|
-
}, h = (
|
|
262
|
-
l("move-down",
|
|
256
|
+
fe(0);
|
|
257
|
+
const S = (m) => {
|
|
258
|
+
l("delete-component", m);
|
|
259
|
+
}, b = (m) => {
|
|
260
|
+
l("move-up", m);
|
|
261
|
+
}, h = (m) => {
|
|
262
|
+
l("move-down", m);
|
|
263
263
|
}, u = () => {
|
|
264
264
|
l("update:selectedIndex", null);
|
|
265
|
-
},
|
|
266
|
-
l("update-position",
|
|
267
|
-
},
|
|
268
|
-
l("update-size",
|
|
265
|
+
}, k = (m, s, x) => {
|
|
266
|
+
l("update-position", m, s, x);
|
|
267
|
+
}, y = (m, s) => {
|
|
268
|
+
l("update-size", m, s);
|
|
269
269
|
};
|
|
270
|
-
return (
|
|
271
|
-
e.showControls ? (
|
|
270
|
+
return (m, s) => (d(), _("section", Ae, [
|
|
271
|
+
e.showControls ? (d(), _("div", Pe, [
|
|
272
272
|
v("div", Re, [
|
|
273
273
|
v("span", Ee, "设计:" + T(e.designWidth) + "*" + T(e.designHeight), 1)
|
|
274
274
|
]),
|
|
275
|
-
v("div",
|
|
275
|
+
v("div", Te, [
|
|
276
276
|
s[1] || (s[1] = v("span", { class: "wkc-button-label" }, "辅助工具:", -1)),
|
|
277
277
|
v("button", {
|
|
278
|
-
class: ee(["wkc-size-btn", { active:
|
|
278
|
+
class: ee(["wkc-size-btn", { active: p.value }]),
|
|
279
279
|
onClick: z
|
|
280
|
-
}, T(
|
|
280
|
+
}, T(p.value ? "隐藏网格" : "显示网格"), 3)
|
|
281
281
|
])
|
|
282
282
|
])) : M("", !0),
|
|
283
283
|
v("div", {
|
|
284
284
|
class: "wkc-mobile-simulator",
|
|
285
285
|
style: oe(c.value)
|
|
286
286
|
}, [
|
|
287
|
-
v("div",
|
|
288
|
-
w(
|
|
289
|
-
visible:
|
|
290
|
-
width:
|
|
291
|
-
height:
|
|
287
|
+
v("div", Be, [
|
|
288
|
+
w(Ie, {
|
|
289
|
+
visible: p.value,
|
|
290
|
+
width: g.value,
|
|
291
|
+
height: C.value,
|
|
292
292
|
"grid-size": e.gridSize
|
|
293
293
|
}, null, 8, ["visible", "width", "height", "grid-size"]),
|
|
294
|
-
(
|
|
295
|
-
var
|
|
296
|
-
return
|
|
294
|
+
(d(!0), _(Y, null, G(e.pageComponents, (x, L) => {
|
|
295
|
+
var P, F, J;
|
|
296
|
+
return d(), R(ze, {
|
|
297
297
|
key: L,
|
|
298
298
|
"is-active": e.selectedIndex === L,
|
|
299
299
|
"can-move-up": L > 0,
|
|
300
300
|
"can-move-down": L < e.pageComponents.length - 1,
|
|
301
|
-
position: (F = (
|
|
301
|
+
position: (F = (P = x.props) == null ? void 0 : P.styleSchema) == null ? void 0 : F.position,
|
|
302
302
|
designWidth: e.designWidth,
|
|
303
303
|
designHeight: e.designHeight,
|
|
304
|
-
style: oe(
|
|
304
|
+
style: oe(f(x)),
|
|
305
305
|
"ignore-drag": !!((J = x.config) != null && J.isFullScreen),
|
|
306
306
|
onClick: (W) => $(W ? -1 : L),
|
|
307
|
-
onMoveUp: (W) =>
|
|
307
|
+
onMoveUp: (W) => b(L),
|
|
308
308
|
onMoveDown: (W) => h(L),
|
|
309
309
|
onCancelSelect: u,
|
|
310
|
-
onDelete: (W) =>
|
|
311
|
-
onUpdatePosition: (W, Z) =>
|
|
312
|
-
onUpdateSize: (W, Z, a, V) =>
|
|
310
|
+
onDelete: (W) => S(L),
|
|
311
|
+
onUpdatePosition: (W, Z) => k(L, W, Z),
|
|
312
|
+
onUpdateSize: (W, Z, a, V) => y(L, { width: W, height: Z, left: a, top: V })
|
|
313
313
|
}, {
|
|
314
314
|
default: U(() => [
|
|
315
|
-
(
|
|
315
|
+
(d(), R(ye(x.component), be({ ref_for: !0 }, x.props), null, 16))
|
|
316
316
|
]),
|
|
317
317
|
_: 2
|
|
318
318
|
}, 1032, ["is-active", "can-move-up", "can-move-down", "position", "designWidth", "designHeight", "style", "ignore-drag", "onClick", "onMoveUp", "onMoveDown", "onDelete", "onUpdatePosition", "onUpdateSize"]);
|
|
@@ -322,69 +322,69 @@ const we = { class: "wkc-component-content" }, $e = { class: "wkc-component-acti
|
|
|
322
322
|
class: "wkc-popup-port",
|
|
323
323
|
onClick: s[0] || (s[0] = X(() => {
|
|
324
324
|
}, ["stop"]))
|
|
325
|
-
}, null, 8,
|
|
326
|
-
e.pageComponents.length === 0 ? (
|
|
325
|
+
}, null, 8, Ne),
|
|
326
|
+
e.pageComponents.length === 0 ? (d(), _("div", Oe, T(e.emptyText), 1)) : M("", !0)
|
|
327
327
|
])
|
|
328
328
|
], 4)
|
|
329
329
|
]));
|
|
330
330
|
}
|
|
331
331
|
});
|
|
332
332
|
var de = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.SELECT = "select", e.RADIO = "radio", e.CHECKBOX = "checkbox", e.SWITCH = "switch", e.COLOR = "color", e.NUMBER = "number", e.SLIDER = "slider", e.TEXTAREA = "textarea", e.MATERIAL = "material", e.GOODS = "goods", e.READONLY = "readonly", e))(de || {}), D = /* @__PURE__ */ ((e) => (e.PREVIEW = "preview", e.STYLE = "style", e.BUSINESS = "business", e.SUB_COMPONENT = "subComponent", e))(D || {});
|
|
333
|
-
const
|
|
333
|
+
const He = { class: "wkc-preview-config" }, We = {
|
|
334
334
|
key: 0,
|
|
335
335
|
class: "empty-state"
|
|
336
|
-
},
|
|
336
|
+
}, De = {
|
|
337
337
|
key: 1,
|
|
338
338
|
class: "preview-list"
|
|
339
|
-
},
|
|
339
|
+
}, Ye = { class: "preview-header" }, Xe = { class: "preview-title" }, Ge = { class: "preview-body" }, Ke = { class: "form-item editable" }, Ze = { class: "form-label" }, qe = { class: "form-item" }, Fe = {
|
|
340
340
|
key: 0,
|
|
341
341
|
class: "error-message"
|
|
342
|
-
},
|
|
342
|
+
}, Je = { class: "mock-preview" }, Qe = /* @__PURE__ */ K({
|
|
343
343
|
__name: "PreviewConfig",
|
|
344
344
|
props: {
|
|
345
345
|
previewConfig: {}
|
|
346
346
|
},
|
|
347
347
|
emits: ["update-config"],
|
|
348
|
-
setup(e, { emit:
|
|
349
|
-
const t = e, l =
|
|
350
|
-
get: () => new Proxy(
|
|
351
|
-
get(i,
|
|
352
|
-
const
|
|
353
|
-
return i[
|
|
348
|
+
setup(e, { emit: r }) {
|
|
349
|
+
const t = e, l = r, o = N({}), p = N({}), c = E({
|
|
350
|
+
get: () => new Proxy(p.value, {
|
|
351
|
+
get(i, f) {
|
|
352
|
+
const S = Number(f);
|
|
353
|
+
return i[S] || (i[S] = "edit"), i[S];
|
|
354
354
|
}
|
|
355
355
|
}),
|
|
356
356
|
set: (i) => {
|
|
357
|
-
|
|
357
|
+
p.value = i;
|
|
358
358
|
}
|
|
359
|
-
}),
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
},
|
|
363
|
-
|
|
364
|
-
}, z = (i,
|
|
359
|
+
}), g = (i) => {
|
|
360
|
+
const f = t.previewConfig.find((S) => S.key === i);
|
|
361
|
+
f && l("update-config", i, f);
|
|
362
|
+
}, C = (i) => {
|
|
363
|
+
g(i);
|
|
364
|
+
}, z = (i, f, S) => {
|
|
365
365
|
try {
|
|
366
|
-
const
|
|
367
|
-
i.response.data =
|
|
366
|
+
const b = JSON.parse(S);
|
|
367
|
+
i.response.data = b, delete o.value[f], g(i.key);
|
|
368
368
|
} catch {
|
|
369
|
-
o.value[
|
|
369
|
+
o.value[f] = "JSON 格式错误,请检查语法";
|
|
370
370
|
}
|
|
371
371
|
}, $ = (i) => JSON.stringify(i.response, null, 2);
|
|
372
|
-
return (i,
|
|
373
|
-
const
|
|
374
|
-
return
|
|
375
|
-
e.previewConfig.length === 0 ? (
|
|
376
|
-
w(
|
|
372
|
+
return (i, f) => {
|
|
373
|
+
const S = I("el-empty"), b = I("el-tag"), h = I("el-icon"), u = I("el-tooltip"), k = I("el-input"), y = I("el-tab-pane"), m = I("el-tabs");
|
|
374
|
+
return d(), _("div", He, [
|
|
375
|
+
e.previewConfig.length === 0 ? (d(), _("div", We, [
|
|
376
|
+
w(S, {
|
|
377
377
|
description: "暂无预览配置",
|
|
378
378
|
"image-size": 80
|
|
379
379
|
})
|
|
380
|
-
])) : (
|
|
381
|
-
(
|
|
380
|
+
])) : (d(), _("div", De, [
|
|
381
|
+
(d(!0), _(Y, null, G(e.previewConfig, (s, x) => (d(), _("div", {
|
|
382
382
|
key: x,
|
|
383
383
|
class: "preview-item"
|
|
384
384
|
}, [
|
|
385
|
-
v("div",
|
|
386
|
-
v("span",
|
|
387
|
-
w(
|
|
385
|
+
v("div", Ye, [
|
|
386
|
+
v("span", Xe, T(s.name), 1),
|
|
387
|
+
w(b, {
|
|
388
388
|
size: "small",
|
|
389
389
|
type: s.method === "POST" ? "success" : "primary"
|
|
390
390
|
}, {
|
|
@@ -394,10 +394,10 @@ const Oe = { class: "wkc-preview-config" }, He = {
|
|
|
394
394
|
_: 2
|
|
395
395
|
}, 1032, ["type"])
|
|
396
396
|
]),
|
|
397
|
-
v("div",
|
|
398
|
-
v("div",
|
|
399
|
-
v("label",
|
|
400
|
-
|
|
397
|
+
v("div", Ge, [
|
|
398
|
+
v("div", Ke, [
|
|
399
|
+
v("label", Ze, [
|
|
400
|
+
f[0] || (f[0] = H(" 接口地址 ", -1)),
|
|
401
401
|
w(u, {
|
|
402
402
|
content: "修改接口地址",
|
|
403
403
|
placement: "top"
|
|
@@ -405,7 +405,7 @@ const Oe = { class: "wkc-preview-config" }, He = {
|
|
|
405
405
|
default: U(() => [
|
|
406
406
|
w(h, { class: "info-icon" }, {
|
|
407
407
|
default: U(() => [
|
|
408
|
-
w(B(
|
|
408
|
+
w(B(_e))
|
|
409
409
|
]),
|
|
410
410
|
_: 1
|
|
411
411
|
})
|
|
@@ -413,42 +413,42 @@ const Oe = { class: "wkc-preview-config" }, He = {
|
|
|
413
413
|
_: 1
|
|
414
414
|
})
|
|
415
415
|
]),
|
|
416
|
-
w(
|
|
416
|
+
w(k, {
|
|
417
417
|
modelValue: s.url,
|
|
418
418
|
"onUpdate:modelValue": (L) => s.url = L,
|
|
419
419
|
placeholder: "请输入接口地址",
|
|
420
|
-
onBlur: (L) =>
|
|
420
|
+
onBlur: (L) => C(s.key)
|
|
421
421
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onBlur"])
|
|
422
422
|
]),
|
|
423
|
-
v("div",
|
|
424
|
-
w(
|
|
423
|
+
v("div", qe, [
|
|
424
|
+
w(m, {
|
|
425
425
|
modelValue: c.value[x],
|
|
426
426
|
"onUpdate:modelValue": (L) => c.value[x] = L,
|
|
427
427
|
class: "preview-tabs"
|
|
428
428
|
}, {
|
|
429
429
|
default: U(() => [
|
|
430
|
-
w(
|
|
430
|
+
w(y, {
|
|
431
431
|
label: "Mock 数据",
|
|
432
432
|
name: "edit"
|
|
433
433
|
}, {
|
|
434
434
|
default: U(() => [
|
|
435
|
-
w(
|
|
435
|
+
w(k, {
|
|
436
436
|
"model-value": JSON.stringify(s.response.data, null, 2),
|
|
437
437
|
type: "textarea",
|
|
438
438
|
rows: 8,
|
|
439
439
|
placeholder: "请输入 JSON 格式的 Mock 数据",
|
|
440
440
|
onInput: (L) => z(s, x, L)
|
|
441
441
|
}, null, 8, ["model-value", "onInput"]),
|
|
442
|
-
o.value[x] ? (
|
|
442
|
+
o.value[x] ? (d(), _("div", Fe, T(o.value[x]), 1)) : M("", !0)
|
|
443
443
|
]),
|
|
444
444
|
_: 2
|
|
445
445
|
}, 1024),
|
|
446
|
-
w(
|
|
446
|
+
w(y, {
|
|
447
447
|
label: "完整响应预览",
|
|
448
448
|
name: "preview"
|
|
449
449
|
}, {
|
|
450
450
|
default: U(() => [
|
|
451
|
-
v("div",
|
|
451
|
+
v("div", Je, [
|
|
452
452
|
v("pre", null, T($(s)), 1)
|
|
453
453
|
])
|
|
454
454
|
]),
|
|
@@ -465,97 +465,97 @@ const Oe = { class: "wkc-preview-config" }, He = {
|
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
467
|
});
|
|
468
|
-
function
|
|
469
|
-
var
|
|
470
|
-
if (!((c = (
|
|
471
|
-
const l = Math.round(
|
|
472
|
-
if (e.props.styleSchema.position.left = l, e.props.styleSchema.position.top = o, (
|
|
473
|
-
const
|
|
468
|
+
function je(e, r, t) {
|
|
469
|
+
var p, c, g;
|
|
470
|
+
if (!((c = (p = e == null ? void 0 : e.props) == null ? void 0 : p.styleSchema) != null && c.position)) return;
|
|
471
|
+
const l = Math.round(r), o = Math.round(t);
|
|
472
|
+
if (e.props.styleSchema.position.left = l, e.props.styleSchema.position.top = o, (g = e.config) != null && g.styleSchema) {
|
|
473
|
+
const C = e.config.styleSchema.find(
|
|
474
474
|
($) => $.key === "position"
|
|
475
|
-
), z = (
|
|
475
|
+
), z = (C == null ? void 0 : C.children) || [];
|
|
476
476
|
if (z.length) {
|
|
477
|
-
const $ = z.find((
|
|
477
|
+
const $ = z.find((f) => f.key === "top"), i = z.find((f) => f.key === "left");
|
|
478
478
|
$ && ($.value = o), i && (i.value = l);
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
function
|
|
483
|
-
var $, i,
|
|
482
|
+
function et(e, r) {
|
|
483
|
+
var $, i, f;
|
|
484
484
|
if (!((i = ($ = e == null ? void 0 : e.props) == null ? void 0 : $.styleSchema) != null && i.position)) return;
|
|
485
|
-
const { width: t, height: l, left: o, top:
|
|
486
|
-
if (e.props.styleSchema.position.left =
|
|
487
|
-
const
|
|
485
|
+
const { width: t, height: l, left: o, top: p } = r, c = Math.round(t), g = Math.round(l), C = Math.round(o), z = Math.round(p);
|
|
486
|
+
if (e.props.styleSchema.position.left = C, e.props.styleSchema.position.top = z, e.props.styleSchema.position.width = c, e.props.styleSchema.position.height = g, (f = e.config) != null && f.styleSchema) {
|
|
487
|
+
const S = e.config.styleSchema.find(
|
|
488
488
|
(h) => h.key === "position"
|
|
489
|
-
),
|
|
490
|
-
if (
|
|
491
|
-
const h =
|
|
492
|
-
h && (h.value = z), u && (u.value =
|
|
489
|
+
), b = (S == null ? void 0 : S.children) || [];
|
|
490
|
+
if (b.length) {
|
|
491
|
+
const h = b.find((m) => m.key === "top"), u = b.find((m) => m.key === "left"), k = b.find((m) => m.key === "width"), y = b.find((m) => m.key === "height");
|
|
492
|
+
h && (h.value = z), u && (u.value = C), k && (k.value = c), y && (y.value = g);
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
const ce = (e,
|
|
496
|
+
const ce = (e, r) => {
|
|
497
497
|
if (!e.showWhen) return !0;
|
|
498
|
-
const { key: t, value: l } = e.showWhen, o = se(
|
|
498
|
+
const { key: t, value: l } = e.showWhen, o = se(r, t);
|
|
499
499
|
return o ? Array.isArray(l) ? l.includes(o.value) : o.value === l : !1;
|
|
500
|
-
}, se = (e,
|
|
500
|
+
}, se = (e, r) => {
|
|
501
501
|
for (const t of e) {
|
|
502
|
-
if (t.key ===
|
|
502
|
+
if (t.key === r)
|
|
503
503
|
return t;
|
|
504
504
|
if (t.children) {
|
|
505
|
-
const l = se(t.children,
|
|
505
|
+
const l = se(t.children, r);
|
|
506
506
|
if (l) return l;
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
509
|
return null;
|
|
510
510
|
};
|
|
511
|
-
function
|
|
511
|
+
function tt(e, r, t) {
|
|
512
512
|
if (e)
|
|
513
|
-
if (
|
|
514
|
-
const l =
|
|
513
|
+
if (r.includes(".")) {
|
|
514
|
+
const l = r.split(".");
|
|
515
515
|
let o = e;
|
|
516
516
|
for (let c = 0; c < l.length - 1; c++) {
|
|
517
|
-
const
|
|
518
|
-
o[
|
|
517
|
+
const g = l[c];
|
|
518
|
+
o[g] || (o[g] = {}), o = o[g];
|
|
519
519
|
}
|
|
520
|
-
const
|
|
521
|
-
o[
|
|
520
|
+
const p = l[l.length - 1];
|
|
521
|
+
o[p] = t;
|
|
522
522
|
} else
|
|
523
|
-
e[
|
|
523
|
+
e[r] = t;
|
|
524
524
|
}
|
|
525
525
|
function pe(e) {
|
|
526
|
-
var
|
|
526
|
+
var r, t, l, o;
|
|
527
527
|
try {
|
|
528
|
-
const
|
|
528
|
+
const p = ((r = e.config) == null ? void 0 : r.styleSchema) || [];
|
|
529
529
|
let c = null;
|
|
530
|
-
for (const
|
|
531
|
-
if (
|
|
530
|
+
for (const C of p)
|
|
531
|
+
if (C.key === "position" && C.children && (c = C.children.find((z) => z.key === "zIndex"), c))
|
|
532
532
|
break;
|
|
533
533
|
return {
|
|
534
534
|
min: 10,
|
|
535
535
|
max: 99,
|
|
536
536
|
current: ((o = (l = (t = e.props) == null ? void 0 : t.styleSchema) == null ? void 0 : l.position) == null ? void 0 : o.zIndex) || 10
|
|
537
537
|
};
|
|
538
|
-
} catch (
|
|
539
|
-
return console.error("获取 zIndex 配置失败:",
|
|
538
|
+
} catch (p) {
|
|
539
|
+
return console.error("获取 zIndex 配置失败:", p), { min: 10, max: 99, current: 10 };
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function ot(e) {
|
|
543
543
|
var l;
|
|
544
544
|
if (!e)
|
|
545
545
|
return { success: !1, message: "组件不存在" };
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
546
|
+
const r = pe(e);
|
|
547
|
+
if (r.current >= r.max)
|
|
548
548
|
return {
|
|
549
549
|
success: !1,
|
|
550
|
-
message: `层级已达到最大值 ${
|
|
550
|
+
message: `层级已达到最大值 ${r.max}`
|
|
551
551
|
};
|
|
552
|
-
const t = Math.min(
|
|
552
|
+
const t = Math.min(r.current + 1, r.max);
|
|
553
553
|
if (e.props.styleSchema || (e.props.styleSchema = {}), e.props.styleSchema.position || (e.props.styleSchema.position = {}), e.props.styleSchema.position.zIndex = t, (l = e.config) != null && l.styleSchema) {
|
|
554
554
|
const o = e.config.styleSchema.find(
|
|
555
555
|
(c) => c.key === "position"
|
|
556
|
-
),
|
|
557
|
-
if (
|
|
558
|
-
const c =
|
|
556
|
+
), p = (o == null ? void 0 : o.children) || [];
|
|
557
|
+
if (p.length) {
|
|
558
|
+
const c = p.find((g) => g.key === "zIndex");
|
|
559
559
|
c && (c.value = t);
|
|
560
560
|
}
|
|
561
561
|
}
|
|
@@ -565,23 +565,23 @@ function tt(e) {
|
|
|
565
565
|
newZIndex: t
|
|
566
566
|
};
|
|
567
567
|
}
|
|
568
|
-
function
|
|
568
|
+
function lt(e) {
|
|
569
569
|
var l;
|
|
570
570
|
if (!e)
|
|
571
571
|
return { success: !1, message: "组件不存在" };
|
|
572
|
-
const
|
|
573
|
-
if (
|
|
572
|
+
const r = pe(e);
|
|
573
|
+
if (r.current <= r.min)
|
|
574
574
|
return {
|
|
575
575
|
success: !1,
|
|
576
|
-
message: `层级已达到最小值 ${
|
|
576
|
+
message: `层级已达到最小值 ${r.min}`
|
|
577
577
|
};
|
|
578
|
-
const t = Math.max(
|
|
578
|
+
const t = Math.max(r.current - 1, r.min);
|
|
579
579
|
if (e.props.styleSchema || (e.props.styleSchema = {}), e.props.styleSchema.position || (e.props.styleSchema.position = {}), e.props.styleSchema.position.zIndex = t, (l = e.config) != null && l.styleSchema) {
|
|
580
580
|
const o = e.config.styleSchema.find(
|
|
581
581
|
(c) => c.key === "position"
|
|
582
|
-
),
|
|
583
|
-
if (
|
|
584
|
-
const c =
|
|
582
|
+
), p = (o == null ? void 0 : o.children) || [];
|
|
583
|
+
if (p.length) {
|
|
584
|
+
const c = p.find((g) => g.key === "zIndex");
|
|
585
585
|
c && (c.value = t);
|
|
586
586
|
}
|
|
587
587
|
}
|
|
@@ -591,25 +591,55 @@ function ot(e) {
|
|
|
591
591
|
newZIndex: t
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
|
-
const le = (e,
|
|
595
|
-
const o = t ? `${t}.${l.key}` : l.key,
|
|
596
|
-
return l.children && Array.isArray(l.children) ?
|
|
594
|
+
const le = (e, r, t = "") => !e || !Array.isArray(e) ? [] : e.map((l) => {
|
|
595
|
+
const o = t ? `${t}.${l.key}` : l.key, p = { ...l, parentKey: o };
|
|
596
|
+
return l.children && Array.isArray(l.children) ? p.children = le(
|
|
597
597
|
l.children,
|
|
598
|
-
|
|
598
|
+
r == null ? void 0 : r[l.key],
|
|
599
599
|
o
|
|
600
|
-
) :
|
|
600
|
+
) : r && l.key in r && (p.value = r[l.key]), p;
|
|
601
601
|
});
|
|
602
|
-
function
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
602
|
+
function me(e, r, t = "") {
|
|
603
|
+
var o;
|
|
604
|
+
let l = { ...e };
|
|
605
|
+
if (e != null && e.styleSchema) {
|
|
606
|
+
const p = le(
|
|
607
|
+
(e == null ? void 0 : e.styleSchema) || [],
|
|
608
|
+
r.styleSchema,
|
|
609
|
+
t + "styleSchema"
|
|
610
|
+
);
|
|
611
|
+
l.styleSchema = p;
|
|
612
|
+
}
|
|
613
|
+
if (e.businessSchema) {
|
|
614
|
+
const p = le(
|
|
615
|
+
(e == null ? void 0 : e.businessSchema) || [],
|
|
616
|
+
r.businessSchema,
|
|
617
|
+
t + "businessSchema"
|
|
618
|
+
);
|
|
619
|
+
l.businessSchema = p;
|
|
620
|
+
}
|
|
621
|
+
if (e.subComponents) {
|
|
622
|
+
const p = (o = e == null ? void 0 : e.subComponents) == null ? void 0 : o.map((c) => {
|
|
623
|
+
const g = r[c.id];
|
|
624
|
+
return g && typeof g == "object" ? me(
|
|
625
|
+
c,
|
|
626
|
+
g,
|
|
627
|
+
`${c.id}.`
|
|
628
|
+
) : c;
|
|
629
|
+
});
|
|
630
|
+
l.subComponents = p;
|
|
631
|
+
}
|
|
632
|
+
if (e.previewConfig) {
|
|
633
|
+
const p = r.previewConfig || {}, c = (e.previewConfig || []).map((g) => {
|
|
634
|
+
const C = p[g.key];
|
|
635
|
+
return {
|
|
636
|
+
...g,
|
|
637
|
+
...C || {}
|
|
638
|
+
};
|
|
639
|
+
});
|
|
640
|
+
l.previewConfig = c;
|
|
641
|
+
}
|
|
642
|
+
return l;
|
|
613
643
|
}
|
|
614
644
|
const nt = { class: "animation-form" }, st = {
|
|
615
645
|
key: 0,
|
|
@@ -623,15 +653,15 @@ const nt = { class: "animation-form" }, st = {
|
|
|
623
653
|
modelValue: { default: () => ({}) }
|
|
624
654
|
},
|
|
625
655
|
emits: ["update:modelValue", "update-value"],
|
|
626
|
-
setup(e, { emit:
|
|
627
|
-
var
|
|
628
|
-
const t = e, l =
|
|
629
|
-
enterAnimation: ((
|
|
656
|
+
setup(e, { emit: r }) {
|
|
657
|
+
var C, z;
|
|
658
|
+
const t = e, l = r, o = re({
|
|
659
|
+
enterAnimation: ((C = t.modelValue) == null ? void 0 : C.enterAnimation) || "wkc-fadeIn",
|
|
630
660
|
exitAnimation: ((z = t.modelValue) == null ? void 0 : z.exitAnimation) || "wkc-fadeOut"
|
|
631
|
-
}),
|
|
661
|
+
}), p = E(() => {
|
|
632
662
|
var $;
|
|
633
663
|
return (($ = t.modelValue) == null ? void 0 : $.enterAnimation) !== void 0;
|
|
634
|
-
}), c =
|
|
664
|
+
}), c = E(() => {
|
|
635
665
|
var $;
|
|
636
666
|
return (($ = t.modelValue) == null ? void 0 : $.exitAnimation) !== void 0;
|
|
637
667
|
});
|
|
@@ -642,41 +672,41 @@ const nt = { class: "animation-form" }, st = {
|
|
|
642
672
|
},
|
|
643
673
|
{ deep: !0 }
|
|
644
674
|
);
|
|
645
|
-
const
|
|
675
|
+
const g = ($, i) => {
|
|
646
676
|
o[$] = i, l("update-value", { key: $, value: i }), l("update:modelValue", { ...o });
|
|
647
677
|
};
|
|
648
678
|
return ($, i) => {
|
|
649
|
-
const
|
|
650
|
-
return
|
|
651
|
-
|
|
679
|
+
const f = I("el-radio"), S = I("el-radio-group");
|
|
680
|
+
return d(), _("div", nt, [
|
|
681
|
+
p.value ? (d(), _("div", st, [
|
|
652
682
|
i[8] || (i[8] = v("label", { class: "form-label" }, "入场动画", -1)),
|
|
653
683
|
v("div", at, [
|
|
654
|
-
w(
|
|
684
|
+
w(S, {
|
|
655
685
|
modelValue: o.enterAnimation,
|
|
656
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
686
|
+
"onUpdate:modelValue": i[0] || (i[0] = (b) => o.enterAnimation = b),
|
|
657
687
|
size: "small",
|
|
658
|
-
onChange: i[1] || (i[1] = (
|
|
688
|
+
onChange: i[1] || (i[1] = (b) => g("enterAnimation", b))
|
|
659
689
|
}, {
|
|
660
690
|
default: U(() => [
|
|
661
|
-
w(
|
|
691
|
+
w(f, { label: "wkc-fadeIn" }, {
|
|
662
692
|
default: U(() => [...i[4] || (i[4] = [
|
|
663
693
|
H("淡入", -1)
|
|
664
694
|
])]),
|
|
665
695
|
_: 1
|
|
666
696
|
}),
|
|
667
|
-
w(
|
|
697
|
+
w(f, { label: "wkc-slideIn" }, {
|
|
668
698
|
default: U(() => [...i[5] || (i[5] = [
|
|
669
699
|
H("滑入", -1)
|
|
670
700
|
])]),
|
|
671
701
|
_: 1
|
|
672
702
|
}),
|
|
673
|
-
w(
|
|
703
|
+
w(f, { label: "wkc-zoomIn" }, {
|
|
674
704
|
default: U(() => [...i[6] || (i[6] = [
|
|
675
705
|
H("缩放", -1)
|
|
676
706
|
])]),
|
|
677
707
|
_: 1
|
|
678
708
|
}),
|
|
679
|
-
w(
|
|
709
|
+
w(f, { label: "wkc-bounceIn" }, {
|
|
680
710
|
default: U(() => [...i[7] || (i[7] = [
|
|
681
711
|
H("弹跳", -1)
|
|
682
712
|
])]),
|
|
@@ -687,35 +717,35 @@ const nt = { class: "animation-form" }, st = {
|
|
|
687
717
|
}, 8, ["modelValue"])
|
|
688
718
|
])
|
|
689
719
|
])) : M("", !0),
|
|
690
|
-
c.value ? (
|
|
720
|
+
c.value ? (d(), _("div", it, [
|
|
691
721
|
i[13] || (i[13] = v("label", { class: "form-label" }, "退场动画", -1)),
|
|
692
722
|
v("div", ut, [
|
|
693
|
-
w(
|
|
723
|
+
w(S, {
|
|
694
724
|
modelValue: o.exitAnimation,
|
|
695
|
-
"onUpdate:modelValue": i[2] || (i[2] = (
|
|
725
|
+
"onUpdate:modelValue": i[2] || (i[2] = (b) => o.exitAnimation = b),
|
|
696
726
|
size: "small",
|
|
697
|
-
onChange: i[3] || (i[3] = (
|
|
727
|
+
onChange: i[3] || (i[3] = (b) => g("exitAnimation", b))
|
|
698
728
|
}, {
|
|
699
729
|
default: U(() => [
|
|
700
|
-
w(
|
|
730
|
+
w(f, { label: "wkc-fadeOut" }, {
|
|
701
731
|
default: U(() => [...i[9] || (i[9] = [
|
|
702
732
|
H("淡出", -1)
|
|
703
733
|
])]),
|
|
704
734
|
_: 1
|
|
705
735
|
}),
|
|
706
|
-
w(
|
|
736
|
+
w(f, { label: "wkc-slideOut" }, {
|
|
707
737
|
default: U(() => [...i[10] || (i[10] = [
|
|
708
738
|
H("滑出", -1)
|
|
709
739
|
])]),
|
|
710
740
|
_: 1
|
|
711
741
|
}),
|
|
712
|
-
w(
|
|
742
|
+
w(f, { label: "wkc-zoomOut" }, {
|
|
713
743
|
default: U(() => [...i[11] || (i[11] = [
|
|
714
744
|
H("缩放", -1)
|
|
715
745
|
])]),
|
|
716
746
|
_: 1
|
|
717
747
|
}),
|
|
718
|
-
w(
|
|
748
|
+
w(f, { label: "wkc-bounceOut" }, {
|
|
719
749
|
default: U(() => [...i[12] || (i[12] = [
|
|
720
750
|
H("弹跳", -1)
|
|
721
751
|
])]),
|
|
@@ -729,9 +759,9 @@ const nt = { class: "animation-form" }, st = {
|
|
|
729
759
|
]);
|
|
730
760
|
};
|
|
731
761
|
}
|
|
732
|
-
}), dt = (e,
|
|
762
|
+
}), dt = (e, r) => {
|
|
733
763
|
const t = e.__vccOpts || e;
|
|
734
|
-
for (const [l, o] of
|
|
764
|
+
for (const [l, o] of r)
|
|
735
765
|
t[l] = o;
|
|
736
766
|
return t;
|
|
737
767
|
}, ct = /* @__PURE__ */ dt(rt, [["__scopeId", "data-v-ea77e723"]]), pt = { class: "wkc-form-border-radius" }, mt = { class: "border-radius-visual" }, vt = { class: "visual-container" }, ht = { class: "corner-input top-left" }, gt = { class: "corner-input top-right" }, ft = { class: "corner-input bottom-left" }, yt = { class: "corner-input bottom-right" }, bt = { class: "center-icon" }, kt = { class: "preset-section" }, _t = { class: "preset-buttons" }, wt = /* @__PURE__ */ K({
|
|
@@ -742,25 +772,25 @@ const nt = { class: "animation-form" }, st = {
|
|
|
742
772
|
}) }
|
|
743
773
|
},
|
|
744
774
|
emits: ["update:modelValue", "update-value"],
|
|
745
|
-
setup(e, { emit:
|
|
746
|
-
const t = e, l = N(0), o = N(0),
|
|
747
|
-
var
|
|
748
|
-
const u = (((
|
|
749
|
-
u.length === 1 ? (l.value = u[0] ?? 0, o.value = u[0] ?? 0,
|
|
775
|
+
setup(e, { emit: r }) {
|
|
776
|
+
const t = e, l = N(0), o = N(0), p = N(0), c = N(0), g = r, C = N(""), z = () => {
|
|
777
|
+
var k;
|
|
778
|
+
const u = (((k = t.modelValue) == null ? void 0 : k.borderRadius) ?? "").split(" ").map(Number);
|
|
779
|
+
u.length === 1 ? (l.value = u[0] ?? 0, o.value = u[0] ?? 0, p.value = u[0] ?? 0, c.value = u[0] ?? 0) : u.length === 2 ? (l.value = u[0] ?? 0, o.value = u[1] ?? 0, p.value = u[0] ?? 0, c.value = u[1] ?? 0) : u.length === 3 ? (l.value = u[0] ?? 0, o.value = u[1] ?? 0, c.value = u[2] ?? 0, p.value = u[1] ?? 0) : u.length === 4 ? (l.value = u[0] ?? 0, o.value = u[1] ?? 0, c.value = u[2] ?? 0, p.value = u[3] ?? 0) : (l.value = 0, o.value = 0, p.value = 0, c.value = 0);
|
|
750
780
|
};
|
|
751
781
|
te(
|
|
752
782
|
() => t.modelValue,
|
|
753
783
|
(h) => {
|
|
754
|
-
h && (
|
|
784
|
+
h && (C.value = h.borderRadius ?? "", z());
|
|
755
785
|
},
|
|
756
786
|
{ deep: !0 }
|
|
757
787
|
);
|
|
758
788
|
const $ = () => {
|
|
759
|
-
const h = l.value ?? 0, u = o.value ?? 0,
|
|
789
|
+
const h = l.value ?? 0, u = o.value ?? 0, k = p.value ?? 0, y = c.value ?? 0;
|
|
760
790
|
return {
|
|
761
|
-
borderRadius: `${h}px ${u}px ${
|
|
791
|
+
borderRadius: `${h}px ${u}px ${y}px ${k}px`
|
|
762
792
|
};
|
|
763
|
-
}, i =
|
|
793
|
+
}, i = E(() => $()), f = (h, u) => {
|
|
764
794
|
switch (u) {
|
|
765
795
|
case "topLeft":
|
|
766
796
|
l.value = h ?? 0;
|
|
@@ -769,24 +799,24 @@ const nt = { class: "animation-form" }, st = {
|
|
|
769
799
|
o.value = h ?? 0;
|
|
770
800
|
break;
|
|
771
801
|
case "bottomLeft":
|
|
772
|
-
|
|
802
|
+
p.value = h ?? 0;
|
|
773
803
|
break;
|
|
774
804
|
case "bottomRight":
|
|
775
805
|
c.value = h ?? 0;
|
|
776
806
|
break;
|
|
777
807
|
}
|
|
778
|
-
|
|
779
|
-
},
|
|
780
|
-
const h = l.value ?? 0, u = o.value ?? 0,
|
|
781
|
-
h === u && u ===
|
|
782
|
-
},
|
|
783
|
-
l.value = h, o.value = h,
|
|
808
|
+
S(), g("update-value", { key: u, value: h }), g("update:modelValue", { borderRadius: C.value });
|
|
809
|
+
}, S = () => {
|
|
810
|
+
const h = l.value ?? 0, u = o.value ?? 0, k = p.value ?? 0, y = c.value ?? 0;
|
|
811
|
+
h === u && u === y && y === k ? C.value = h === 0 ? "" : `${h}` : C.value = `${h} ${u} ${y} ${k}`, g("update-value", { key: "borderRadius", value: C.value });
|
|
812
|
+
}, b = (h) => {
|
|
813
|
+
l.value = h, o.value = h, p.value = h, c.value = h, S();
|
|
784
814
|
};
|
|
785
|
-
return
|
|
815
|
+
return ke(() => {
|
|
786
816
|
z();
|
|
787
817
|
}), (h, u) => {
|
|
788
|
-
const
|
|
789
|
-
return
|
|
818
|
+
const k = I("el-input-number"), y = I("el-icon"), m = I("el-button");
|
|
819
|
+
return d(), _("div", pt, [
|
|
790
820
|
v("div", mt, [
|
|
791
821
|
v("div", vt, [
|
|
792
822
|
v("div", {
|
|
@@ -794,53 +824,53 @@ const nt = { class: "animation-form" }, st = {
|
|
|
794
824
|
style: oe(i.value)
|
|
795
825
|
}, [
|
|
796
826
|
v("div", ht, [
|
|
797
|
-
w(
|
|
827
|
+
w(k, {
|
|
798
828
|
modelValue: l.value,
|
|
799
829
|
"onUpdate:modelValue": u[0] || (u[0] = (s) => l.value = s),
|
|
800
830
|
controls: !1,
|
|
801
831
|
size: "small",
|
|
802
832
|
min: 0,
|
|
803
833
|
placeholder: "0",
|
|
804
|
-
onChange: u[1] || (u[1] = (s) =>
|
|
834
|
+
onChange: u[1] || (u[1] = (s) => f(l.value, s))
|
|
805
835
|
}, null, 8, ["modelValue"])
|
|
806
836
|
]),
|
|
807
837
|
v("div", gt, [
|
|
808
|
-
w(
|
|
838
|
+
w(k, {
|
|
809
839
|
modelValue: o.value,
|
|
810
840
|
"onUpdate:modelValue": u[2] || (u[2] = (s) => o.value = s),
|
|
811
841
|
controls: !1,
|
|
812
842
|
size: "small",
|
|
813
843
|
min: 0,
|
|
814
844
|
placeholder: "0",
|
|
815
|
-
onChange: u[3] || (u[3] = (s) =>
|
|
845
|
+
onChange: u[3] || (u[3] = (s) => f(o.value, s))
|
|
816
846
|
}, null, 8, ["modelValue"])
|
|
817
847
|
]),
|
|
818
848
|
v("div", ft, [
|
|
819
|
-
w(
|
|
820
|
-
modelValue:
|
|
821
|
-
"onUpdate:modelValue": u[4] || (u[4] = (s) =>
|
|
849
|
+
w(k, {
|
|
850
|
+
modelValue: p.value,
|
|
851
|
+
"onUpdate:modelValue": u[4] || (u[4] = (s) => p.value = s),
|
|
822
852
|
controls: !1,
|
|
823
853
|
size: "small",
|
|
824
854
|
min: 0,
|
|
825
855
|
placeholder: "0",
|
|
826
|
-
onChange: u[5] || (u[5] = (s) =>
|
|
856
|
+
onChange: u[5] || (u[5] = (s) => f(p.value, s))
|
|
827
857
|
}, null, 8, ["modelValue"])
|
|
828
858
|
]),
|
|
829
859
|
v("div", yt, [
|
|
830
|
-
w(
|
|
860
|
+
w(k, {
|
|
831
861
|
modelValue: c.value,
|
|
832
862
|
"onUpdate:modelValue": u[6] || (u[6] = (s) => c.value = s),
|
|
833
863
|
controls: !1,
|
|
834
864
|
size: "small",
|
|
835
865
|
min: 0,
|
|
836
866
|
placeholder: "0",
|
|
837
|
-
onChange: u[7] || (u[7] = (s) =>
|
|
867
|
+
onChange: u[7] || (u[7] = (s) => f(c.value, s))
|
|
838
868
|
}, null, 8, ["modelValue"])
|
|
839
869
|
]),
|
|
840
870
|
v("div", bt, [
|
|
841
|
-
w(
|
|
871
|
+
w(y, null, {
|
|
842
872
|
default: U(() => [
|
|
843
|
-
w(B(
|
|
873
|
+
w(B(we))
|
|
844
874
|
]),
|
|
845
875
|
_: 1
|
|
846
876
|
})
|
|
@@ -851,27 +881,27 @@ const nt = { class: "animation-form" }, st = {
|
|
|
851
881
|
v("div", kt, [
|
|
852
882
|
u[14] || (u[14] = v("div", { class: "preset-label" }, "快捷预设", -1)),
|
|
853
883
|
v("div", _t, [
|
|
854
|
-
w(
|
|
884
|
+
w(m, {
|
|
855
885
|
size: "small",
|
|
856
|
-
onClick: u[8] || (u[8] = (s) =>
|
|
886
|
+
onClick: u[8] || (u[8] = (s) => b(0))
|
|
857
887
|
}, {
|
|
858
888
|
default: U(() => [...u[11] || (u[11] = [
|
|
859
889
|
H("无圆角", -1)
|
|
860
890
|
])]),
|
|
861
891
|
_: 1
|
|
862
892
|
}),
|
|
863
|
-
w(
|
|
893
|
+
w(m, {
|
|
864
894
|
size: "small",
|
|
865
|
-
onClick: u[9] || (u[9] = (s) =>
|
|
895
|
+
onClick: u[9] || (u[9] = (s) => b(4))
|
|
866
896
|
}, {
|
|
867
897
|
default: U(() => [...u[12] || (u[12] = [
|
|
868
898
|
H("小圆角4", -1)
|
|
869
899
|
])]),
|
|
870
900
|
_: 1
|
|
871
901
|
}),
|
|
872
|
-
w(
|
|
902
|
+
w(m, {
|
|
873
903
|
size: "small",
|
|
874
|
-
onClick: u[10] || (u[10] = (s) =>
|
|
904
|
+
onClick: u[10] || (u[10] = (s) => b(8))
|
|
875
905
|
}, {
|
|
876
906
|
default: U(() => [...u[13] || (u[13] = [
|
|
877
907
|
H("中圆角8", -1)
|
|
@@ -901,7 +931,7 @@ const nt = { class: "animation-form" }, st = {
|
|
|
901
931
|
}, At = {
|
|
902
932
|
key: 3,
|
|
903
933
|
class: "form-row"
|
|
904
|
-
},
|
|
934
|
+
}, Pt = { class: "form-item" }, Rt = { class: "form-row" }, Et = { class: "form-item" }, Tt = { class: "form-item" }, Bt = { class: "form-row" }, Nt = { class: "form-item" }, Ot = { class: "form-item" }, Ht = {
|
|
905
935
|
key: 5,
|
|
906
936
|
class: "form-row"
|
|
907
937
|
}, Wt = { class: "form-item" }, Dt = /* @__PURE__ */ K({
|
|
@@ -910,50 +940,50 @@ const nt = { class: "animation-form" }, st = {
|
|
|
910
940
|
modelValue: { default: () => ({}) }
|
|
911
941
|
},
|
|
912
942
|
emits: ["update:modelValue", "update-value"],
|
|
913
|
-
setup(e, { emit:
|
|
914
|
-
var u,
|
|
915
|
-
const t = e, l =
|
|
943
|
+
setup(e, { emit: r }) {
|
|
944
|
+
var u, k, y, m, s, x, L, P, F, J, W, Z, a;
|
|
945
|
+
const t = e, l = r, o = re({
|
|
916
946
|
top: ((u = t.modelValue) == null ? void 0 : u.top) ?? null,
|
|
917
|
-
marginTop: ((
|
|
918
|
-
width: ((
|
|
919
|
-
height: ((
|
|
947
|
+
marginTop: ((k = t.modelValue) == null ? void 0 : k.marginTop) ?? null,
|
|
948
|
+
width: ((y = t.modelValue) == null ? void 0 : y.width) ?? null,
|
|
949
|
+
height: ((m = t.modelValue) == null ? void 0 : m.height) ?? null,
|
|
920
950
|
left: ((s = t.modelValue) == null ? void 0 : s.left) ?? null,
|
|
921
951
|
marginLeft: ((x = t.modelValue) == null ? void 0 : x.marginLeft) ?? null,
|
|
922
952
|
centerHorizontal: ((L = t.modelValue) == null ? void 0 : L.centerHorizontal) ?? !1,
|
|
923
|
-
bgColor: ((
|
|
953
|
+
bgColor: ((P = t.modelValue) == null ? void 0 : P.bgColor) ?? "",
|
|
924
954
|
paddingTop: ((F = t.modelValue) == null ? void 0 : F.paddingTop) ?? null,
|
|
925
955
|
paddingRight: ((J = t.modelValue) == null ? void 0 : J.paddingRight) ?? null,
|
|
926
956
|
paddingBottom: ((W = t.modelValue) == null ? void 0 : W.paddingBottom) ?? null,
|
|
927
957
|
paddingLeft: ((Z = t.modelValue) == null ? void 0 : Z.paddingLeft) ?? null,
|
|
928
958
|
zIndex: ((a = t.modelValue) == null ? void 0 : a.zIndex) ?? 1
|
|
929
|
-
}),
|
|
959
|
+
}), p = E(() => {
|
|
930
960
|
var V;
|
|
931
961
|
return ((V = t.modelValue) == null ? void 0 : V.left) !== void 0;
|
|
932
|
-
}), c =
|
|
962
|
+
}), c = E(() => {
|
|
933
963
|
var V;
|
|
934
964
|
return ((V = t.modelValue) == null ? void 0 : V.marginLeft) !== void 0;
|
|
935
|
-
}),
|
|
965
|
+
}), g = E(() => {
|
|
936
966
|
var V;
|
|
937
967
|
return ((V = t.modelValue) == null ? void 0 : V.top) !== void 0;
|
|
938
|
-
}),
|
|
968
|
+
}), C = E(() => {
|
|
939
969
|
var V;
|
|
940
970
|
return ((V = t.modelValue) == null ? void 0 : V.marginTop) !== void 0;
|
|
941
|
-
}), z =
|
|
971
|
+
}), z = E(() => {
|
|
942
972
|
var V;
|
|
943
973
|
return ((V = t.modelValue) == null ? void 0 : V.width) !== void 0;
|
|
944
|
-
}), $ =
|
|
974
|
+
}), $ = E(() => {
|
|
945
975
|
var V;
|
|
946
976
|
return ((V = t.modelValue) == null ? void 0 : V.height) !== void 0;
|
|
947
|
-
}), i =
|
|
977
|
+
}), i = E(() => {
|
|
948
978
|
var V;
|
|
949
979
|
return ((V = t.modelValue) == null ? void 0 : V.bgColor) !== void 0;
|
|
950
|
-
}),
|
|
980
|
+
}), f = E(() => {
|
|
951
981
|
var V;
|
|
952
982
|
return ((V = t.modelValue) == null ? void 0 : V.centerHorizontal) !== void 0;
|
|
953
|
-
}),
|
|
983
|
+
}), S = E(() => {
|
|
954
984
|
var V, n, q, O;
|
|
955
985
|
return ((V = t.modelValue) == null ? void 0 : V.paddingTop) !== void 0 || ((n = t.modelValue) == null ? void 0 : n.paddingRight) !== void 0 || ((q = t.modelValue) == null ? void 0 : q.paddingBottom) !== void 0 || ((O = t.modelValue) == null ? void 0 : O.paddingLeft) !== void 0;
|
|
956
|
-
}),
|
|
986
|
+
}), b = E(() => {
|
|
957
987
|
var V;
|
|
958
988
|
return ((V = t.modelValue) == null ? void 0 : V.zIndex) !== void 0;
|
|
959
989
|
});
|
|
@@ -968,13 +998,13 @@ const nt = { class: "animation-form" }, st = {
|
|
|
968
998
|
o[V] = n, l("update-value", { key: V, value: n }), l("update:modelValue", { ...o });
|
|
969
999
|
};
|
|
970
1000
|
return (V, n) => {
|
|
971
|
-
const q = I("el-checkbox"), O = I("el-input-number"),
|
|
972
|
-
return
|
|
973
|
-
|
|
1001
|
+
const q = I("el-checkbox"), O = I("el-input-number"), he = I("el-color-picker");
|
|
1002
|
+
return d(), _("div", $t, [
|
|
1003
|
+
p.value || c.value || f.value ? (d(), _("div", Ct, [
|
|
974
1004
|
v("div", St, [
|
|
975
1005
|
n[14] || (n[14] = v("label", null, "距左侧", -1)),
|
|
976
1006
|
v("div", Vt, [
|
|
977
|
-
|
|
1007
|
+
f.value ? (d(), R(q, {
|
|
978
1008
|
key: 0,
|
|
979
1009
|
"model-value": o.centerHorizontal,
|
|
980
1010
|
onChange: n[0] || (n[0] = (A) => h("centerHorizontal", A)),
|
|
@@ -985,14 +1015,14 @@ const nt = { class: "animation-form" }, st = {
|
|
|
985
1015
|
])]),
|
|
986
1016
|
_: 1
|
|
987
1017
|
}, 8, ["model-value"])) : M("", !0),
|
|
988
|
-
|
|
1018
|
+
p.value ? (d(), R(O, {
|
|
989
1019
|
key: 1,
|
|
990
1020
|
"model-value": o.left,
|
|
991
1021
|
disabled: o.centerHorizontal,
|
|
992
1022
|
size: "small",
|
|
993
1023
|
placeholder: "left",
|
|
994
1024
|
onChange: n[1] || (n[1] = (A) => h("left", A))
|
|
995
|
-
}, null, 8, ["model-value", "disabled"])) : c.value ? (
|
|
1025
|
+
}, null, 8, ["model-value", "disabled"])) : c.value ? (d(), R(O, {
|
|
996
1026
|
key: 2,
|
|
997
1027
|
"model-value": o.marginLeft,
|
|
998
1028
|
disabled: o.centerHorizontal,
|
|
@@ -1001,19 +1031,19 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1001
1031
|
onChange: n[2] || (n[2] = (A) => h("marginLeft", A))
|
|
1002
1032
|
}, null, 8, ["model-value", "disabled"])) : M("", !0)
|
|
1003
1033
|
]),
|
|
1004
|
-
|
|
1034
|
+
p.value || c.value ? (d(), _("span", zt, "px")) : M("", !0)
|
|
1005
1035
|
])
|
|
1006
1036
|
])) : M("", !0),
|
|
1007
|
-
|
|
1037
|
+
g.value || C.value ? (d(), _("div", xt, [
|
|
1008
1038
|
v("div", Ut, [
|
|
1009
|
-
v("label", null, T(
|
|
1010
|
-
|
|
1039
|
+
v("label", null, T(g.value ? "距顶部" : "上间距"), 1),
|
|
1040
|
+
g.value ? (d(), R(O, {
|
|
1011
1041
|
key: 0,
|
|
1012
1042
|
"model-value": o.top,
|
|
1013
1043
|
size: "small",
|
|
1014
1044
|
placeholder: "top",
|
|
1015
1045
|
onChange: n[3] || (n[3] = (A) => h("top", A))
|
|
1016
|
-
}, null, 8, ["model-value"])) :
|
|
1046
|
+
}, null, 8, ["model-value"])) : C.value ? (d(), R(O, {
|
|
1017
1047
|
key: 1,
|
|
1018
1048
|
"model-value": o.marginTop,
|
|
1019
1049
|
size: "small",
|
|
@@ -1023,8 +1053,8 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1023
1053
|
n[15] || (n[15] = H(" px ", -1))
|
|
1024
1054
|
])
|
|
1025
1055
|
])) : M("", !0),
|
|
1026
|
-
z.value || $.value ? (
|
|
1027
|
-
z.value ? (
|
|
1056
|
+
z.value || $.value ? (d(), _("div", Lt, [
|
|
1057
|
+
z.value ? (d(), _("div", Mt, [
|
|
1028
1058
|
n[16] || (n[16] = v("label", null, "宽度", -1)),
|
|
1029
1059
|
w(O, {
|
|
1030
1060
|
"model-value": o.width,
|
|
@@ -1034,7 +1064,7 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1034
1064
|
}, null, 8, ["model-value"]),
|
|
1035
1065
|
n[17] || (n[17] = H("px ", -1))
|
|
1036
1066
|
])) : M("", !0),
|
|
1037
|
-
$.value ? (
|
|
1067
|
+
$.value ? (d(), _("div", It, [
|
|
1038
1068
|
n[18] || (n[18] = v("label", null, "高度", -1)),
|
|
1039
1069
|
w(O, {
|
|
1040
1070
|
"model-value": o.height,
|
|
@@ -1045,19 +1075,19 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1045
1075
|
n[19] || (n[19] = H("px ", -1))
|
|
1046
1076
|
])) : M("", !0)
|
|
1047
1077
|
])) : M("", !0),
|
|
1048
|
-
i.value ? (
|
|
1049
|
-
v("div",
|
|
1078
|
+
i.value ? (d(), _("div", At, [
|
|
1079
|
+
v("div", Pt, [
|
|
1050
1080
|
n[20] || (n[20] = v("label", null, "背景色", -1)),
|
|
1051
|
-
w(
|
|
1081
|
+
w(he, {
|
|
1052
1082
|
"model-value": o.bgColor,
|
|
1053
1083
|
onChange: n[7] || (n[7] = (A) => h("bgColor", A)),
|
|
1054
1084
|
size: "small"
|
|
1055
1085
|
}, null, 8, ["model-value"])
|
|
1056
1086
|
])
|
|
1057
1087
|
])) : M("", !0),
|
|
1058
|
-
|
|
1059
|
-
v("div",
|
|
1060
|
-
v("div",
|
|
1088
|
+
S.value ? (d(), _(Y, { key: 4 }, [
|
|
1089
|
+
v("div", Rt, [
|
|
1090
|
+
v("div", Et, [
|
|
1061
1091
|
n[21] || (n[21] = v("label", null, "内边距上", -1)),
|
|
1062
1092
|
w(O, {
|
|
1063
1093
|
"model-value": o.paddingTop,
|
|
@@ -1097,7 +1127,7 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1097
1127
|
])
|
|
1098
1128
|
])
|
|
1099
1129
|
], 64)) : M("", !0),
|
|
1100
|
-
|
|
1130
|
+
b.value ? (d(), _("div", Ht, [
|
|
1101
1131
|
v("div", Wt, [
|
|
1102
1132
|
n[25] || (n[25] = v("label", null, "层级", -1)),
|
|
1103
1133
|
w(O, {
|
|
@@ -1160,57 +1190,57 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1160
1190
|
configList: {}
|
|
1161
1191
|
},
|
|
1162
1192
|
emits: ["update-value"],
|
|
1163
|
-
setup(e, { emit:
|
|
1164
|
-
const t = de, l = e, o = N([]),
|
|
1193
|
+
setup(e, { emit: r }) {
|
|
1194
|
+
const t = de, l = e, o = N([]), p = r, c = (i) => {
|
|
1165
1195
|
if (!i.children) return {};
|
|
1166
|
-
const
|
|
1167
|
-
return i.children.forEach((
|
|
1168
|
-
|
|
1169
|
-
}),
|
|
1170
|
-
},
|
|
1171
|
-
const { key:
|
|
1196
|
+
const f = {};
|
|
1197
|
+
return i.children.forEach((S) => {
|
|
1198
|
+
f[S.key] = S.value;
|
|
1199
|
+
}), f;
|
|
1200
|
+
}, g = (i) => ce(i, l.configList), C = (i, f) => {
|
|
1201
|
+
const { key: S, value: b } = f;
|
|
1172
1202
|
if (i.children) {
|
|
1173
|
-
const h = i.children.find((u) => u.key ===
|
|
1203
|
+
const h = i.children.find((u) => u.key === S);
|
|
1174
1204
|
if (h) {
|
|
1175
|
-
h.value =
|
|
1176
|
-
const u = i.parentKey ? `${i.parentKey}.${
|
|
1177
|
-
|
|
1205
|
+
h.value = b;
|
|
1206
|
+
const u = i.parentKey ? `${i.parentKey}.${S}` : `${i.key}.${S}`;
|
|
1207
|
+
p("update-value", u, b);
|
|
1178
1208
|
}
|
|
1179
1209
|
}
|
|
1180
|
-
}, z = (i,
|
|
1181
|
-
|
|
1210
|
+
}, z = (i, f) => {
|
|
1211
|
+
p("update-value", i, f);
|
|
1182
1212
|
}, $ = (i) => {
|
|
1183
|
-
const { key:
|
|
1184
|
-
|
|
1213
|
+
const { key: f, parentKey: S, value: b } = i;
|
|
1214
|
+
p("update-value", S || f, b);
|
|
1185
1215
|
};
|
|
1186
1216
|
return te(
|
|
1187
1217
|
() => l.configList,
|
|
1188
1218
|
(i) => {
|
|
1189
|
-
o.value = i.filter((
|
|
1219
|
+
o.value = i.filter((f) => f.type === "group-panel").map((f) => f.key);
|
|
1190
1220
|
},
|
|
1191
1221
|
{
|
|
1192
1222
|
immediate: !0
|
|
1193
1223
|
}
|
|
1194
|
-
), (i,
|
|
1195
|
-
const
|
|
1196
|
-
return
|
|
1197
|
-
(
|
|
1224
|
+
), (i, f) => {
|
|
1225
|
+
const S = I("RenderBlock", !0), b = I("el-collapse-item"), h = I("el-collapse"), u = I("el-input"), k = I("el-icon"), y = I("el-tooltip"), m = I("el-input-number"), s = I("el-slider"), x = I("el-switch"), L = I("el-radio"), P = I("el-radio-group"), F = I("el-option"), J = I("el-select"), W = I("el-color-picker"), Z = I("el-form-item");
|
|
1226
|
+
return d(), _("div", Yt, [
|
|
1227
|
+
(d(!0), _(Y, null, G(e.configList, (a, V) => (d(), _(Y, {
|
|
1198
1228
|
key: `${a.key}-${V}`
|
|
1199
1229
|
}, [
|
|
1200
|
-
a.type === "group-panel" &&
|
|
1230
|
+
a.type === "group-panel" && g(a) ? (d(), R(h, {
|
|
1201
1231
|
key: 0,
|
|
1202
1232
|
modelValue: o.value,
|
|
1203
|
-
"onUpdate:modelValue":
|
|
1233
|
+
"onUpdate:modelValue": f[0] || (f[0] = (n) => o.value = n),
|
|
1204
1234
|
class: "group-panel"
|
|
1205
1235
|
}, {
|
|
1206
1236
|
default: U(() => [
|
|
1207
|
-
w(
|
|
1237
|
+
w(b, {
|
|
1208
1238
|
name: a.key
|
|
1209
1239
|
}, {
|
|
1210
1240
|
title: U(() => [
|
|
1211
1241
|
v("div", Xt, [
|
|
1212
1242
|
v("span", Gt, T(a.label || a.key), 1),
|
|
1213
|
-
a.desc ? (
|
|
1243
|
+
a.desc ? (d(), _("span", {
|
|
1214
1244
|
key: 0,
|
|
1215
1245
|
class: "panel-desc",
|
|
1216
1246
|
title: a.desc
|
|
@@ -1218,19 +1248,19 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1218
1248
|
])
|
|
1219
1249
|
]),
|
|
1220
1250
|
default: U(() => [
|
|
1221
|
-
a.renderForm === "position" ? (
|
|
1251
|
+
a.renderForm === "position" ? (d(), R(Dt, {
|
|
1222
1252
|
key: 0,
|
|
1223
1253
|
"model-value": c(a),
|
|
1224
|
-
onUpdateValue: (n) =>
|
|
1225
|
-
}, null, 8, ["model-value", "onUpdateValue"])) : a.renderForm === "animation" ? (
|
|
1254
|
+
onUpdateValue: (n) => C(a, n)
|
|
1255
|
+
}, null, 8, ["model-value", "onUpdateValue"])) : a.renderForm === "animation" ? (d(), R(ct, {
|
|
1226
1256
|
key: 1,
|
|
1227
1257
|
"model-value": c(a),
|
|
1228
|
-
onUpdateValue: (n) =>
|
|
1229
|
-
}, null, 8, ["model-value", "onUpdateValue"])) : a.renderForm === "border-radius" ? (
|
|
1258
|
+
onUpdateValue: (n) => C(a, n)
|
|
1259
|
+
}, null, 8, ["model-value", "onUpdateValue"])) : a.renderForm === "border-radius" ? (d(), R(wt, {
|
|
1230
1260
|
key: 2,
|
|
1231
1261
|
"model-value": c(a),
|
|
1232
|
-
onUpdateValue: (n) =>
|
|
1233
|
-
}, null, 8, ["model-value", "onUpdateValue"])) : a.children && a.children.length ? (
|
|
1262
|
+
onUpdateValue: (n) => C(a, n)
|
|
1263
|
+
}, null, 8, ["model-value", "onUpdateValue"])) : a.children && a.children.length ? (d(), R(S, {
|
|
1234
1264
|
key: 3,
|
|
1235
1265
|
"config-list": a.children,
|
|
1236
1266
|
onUpdateValue: z
|
|
@@ -1256,7 +1286,7 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1256
1286
|
}, 1032, ["name"])
|
|
1257
1287
|
]),
|
|
1258
1288
|
_: 2
|
|
1259
|
-
}, 1032, ["modelValue"])) :
|
|
1289
|
+
}, 1032, ["modelValue"])) : g(a) ? (d(), R(Z, {
|
|
1260
1290
|
key: 1,
|
|
1261
1291
|
label: a.label
|
|
1262
1292
|
}, {
|
|
@@ -1271,7 +1301,7 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1271
1301
|
field: a,
|
|
1272
1302
|
value: a.value,
|
|
1273
1303
|
update: (n) => $({ ...a, value: n })
|
|
1274
|
-
}) : a.type === B(t).INPUT ? (
|
|
1304
|
+
}) : a.type === B(t).INPUT ? (d(), _("div", Zt, [
|
|
1275
1305
|
w(u, {
|
|
1276
1306
|
modelValue: a.value,
|
|
1277
1307
|
"onUpdate:modelValue": (n) => a.value = n,
|
|
@@ -1279,14 +1309,14 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1279
1309
|
size: "small",
|
|
1280
1310
|
onInput: (n) => $(a)
|
|
1281
1311
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onInput"]),
|
|
1282
|
-
a.desc ? (
|
|
1312
|
+
a.desc ? (d(), R(y, {
|
|
1283
1313
|
key: 0,
|
|
1284
1314
|
content: a.desc,
|
|
1285
1315
|
placement: "top",
|
|
1286
1316
|
effect: "dark"
|
|
1287
1317
|
}, {
|
|
1288
1318
|
default: U(() => [
|
|
1289
|
-
w(
|
|
1319
|
+
w(k, { class: "field-desc-icon" }, {
|
|
1290
1320
|
default: U(() => [
|
|
1291
1321
|
w(B(j))
|
|
1292
1322
|
]),
|
|
@@ -1295,7 +1325,7 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1295
1325
|
]),
|
|
1296
1326
|
_: 1
|
|
1297
1327
|
}, 8, ["content"])) : M("", !0)
|
|
1298
|
-
])) : a.type === B(t).TEXTAREA ? (
|
|
1328
|
+
])) : a.type === B(t).TEXTAREA ? (d(), _("div", qt, [
|
|
1299
1329
|
w(u, {
|
|
1300
1330
|
modelValue: a.value,
|
|
1301
1331
|
"onUpdate:modelValue": (n) => a.value = n,
|
|
@@ -1306,14 +1336,14 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1306
1336
|
class: "textarea-item",
|
|
1307
1337
|
onInput: (n) => $(a)
|
|
1308
1338
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onInput"]),
|
|
1309
|
-
a.desc ? (
|
|
1339
|
+
a.desc ? (d(), R(y, {
|
|
1310
1340
|
key: 0,
|
|
1311
1341
|
content: a.desc,
|
|
1312
1342
|
placement: "top",
|
|
1313
1343
|
effect: "dark"
|
|
1314
1344
|
}, {
|
|
1315
1345
|
default: U(() => [
|
|
1316
|
-
w(
|
|
1346
|
+
w(k, { class: "field-desc-icon" }, {
|
|
1317
1347
|
default: U(() => [
|
|
1318
1348
|
w(B(j))
|
|
1319
1349
|
]),
|
|
@@ -1322,8 +1352,8 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1322
1352
|
]),
|
|
1323
1353
|
_: 1
|
|
1324
1354
|
}, 8, ["content"])) : M("", !0)
|
|
1325
|
-
])) : a.type === B(t).NUMBER ? (
|
|
1326
|
-
w(
|
|
1355
|
+
])) : a.type === B(t).NUMBER ? (d(), _("div", Ft, [
|
|
1356
|
+
w(m, {
|
|
1327
1357
|
modelValue: a.value,
|
|
1328
1358
|
"onUpdate:modelValue": (n) => a.value = n,
|
|
1329
1359
|
placeholder: "请输入",
|
|
@@ -1331,8 +1361,8 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1331
1361
|
"controls-position": "right",
|
|
1332
1362
|
onChange: (n) => $(a)
|
|
1333
1363
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"]),
|
|
1334
|
-
a.desc ? (
|
|
1335
|
-
])) : a.type === B(t).SLIDER ? (
|
|
1364
|
+
a.desc ? (d(), _("span", Jt, T(a.desc), 1)) : M("", !0)
|
|
1365
|
+
])) : a.type === B(t).SLIDER ? (d(), _("div", Qt, [
|
|
1336
1366
|
w(s, {
|
|
1337
1367
|
modelValue: a.value,
|
|
1338
1368
|
"onUpdate:modelValue": (n) => a.value = n,
|
|
@@ -1343,14 +1373,14 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1343
1373
|
"show-input": "",
|
|
1344
1374
|
onChange: (n) => $(a)
|
|
1345
1375
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "min", "max", "step", "onChange"]),
|
|
1346
|
-
a.desc ? (
|
|
1376
|
+
a.desc ? (d(), R(y, {
|
|
1347
1377
|
key: 0,
|
|
1348
1378
|
content: a.desc,
|
|
1349
1379
|
placement: "top",
|
|
1350
1380
|
effect: "dark"
|
|
1351
1381
|
}, {
|
|
1352
1382
|
default: U(() => [
|
|
1353
|
-
w(
|
|
1383
|
+
w(k, { class: "field-desc-icon" }, {
|
|
1354
1384
|
default: U(() => [
|
|
1355
1385
|
w(B(j))
|
|
1356
1386
|
]),
|
|
@@ -1359,23 +1389,23 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1359
1389
|
]),
|
|
1360
1390
|
_: 1
|
|
1361
1391
|
}, 8, ["content"])) : M("", !0)
|
|
1362
|
-
])) : a.type === B(t).SWITCH ? (
|
|
1392
|
+
])) : a.type === B(t).SWITCH ? (d(), _("div", jt, [
|
|
1363
1393
|
w(x, {
|
|
1364
1394
|
modelValue: a.value,
|
|
1365
1395
|
"onUpdate:modelValue": (n) => a.value = n,
|
|
1366
1396
|
size: "small",
|
|
1367
1397
|
onChange: (n) => $(a)
|
|
1368
1398
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"]),
|
|
1369
|
-
a.desc ? (
|
|
1370
|
-
])) : a.type === B(t).RADIO ? (
|
|
1371
|
-
w(
|
|
1399
|
+
a.desc ? (d(), _("span", eo, T(a.desc), 1)) : M("", !0)
|
|
1400
|
+
])) : a.type === B(t).RADIO ? (d(), _("div", to, [
|
|
1401
|
+
w(P, {
|
|
1372
1402
|
modelValue: a.value,
|
|
1373
1403
|
"onUpdate:modelValue": (n) => a.value = n,
|
|
1374
1404
|
size: "small",
|
|
1375
1405
|
onChange: (n) => $(a)
|
|
1376
1406
|
}, {
|
|
1377
1407
|
default: U(() => [
|
|
1378
|
-
(
|
|
1408
|
+
(d(!0), _(Y, null, G(a.options || [], (n) => (d(), R(L, {
|
|
1379
1409
|
key: String(n.value),
|
|
1380
1410
|
label: n.value
|
|
1381
1411
|
}, {
|
|
@@ -1387,14 +1417,14 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1387
1417
|
]),
|
|
1388
1418
|
_: 2
|
|
1389
1419
|
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]),
|
|
1390
|
-
a.desc ? (
|
|
1420
|
+
a.desc ? (d(), R(y, {
|
|
1391
1421
|
key: 0,
|
|
1392
1422
|
content: a.desc,
|
|
1393
1423
|
placement: "top",
|
|
1394
1424
|
effect: "dark"
|
|
1395
1425
|
}, {
|
|
1396
1426
|
default: U(() => [
|
|
1397
|
-
w(
|
|
1427
|
+
w(k, { class: "field-desc-icon" }, {
|
|
1398
1428
|
default: U(() => [
|
|
1399
1429
|
w(B(j))
|
|
1400
1430
|
]),
|
|
@@ -1403,7 +1433,7 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1403
1433
|
]),
|
|
1404
1434
|
_: 1
|
|
1405
1435
|
}, 8, ["content"])) : M("", !0)
|
|
1406
|
-
])) : a.type === B(t).SELECT ? (
|
|
1436
|
+
])) : a.type === B(t).SELECT ? (d(), _("div", oo, [
|
|
1407
1437
|
w(J, {
|
|
1408
1438
|
modelValue: a.value,
|
|
1409
1439
|
"onUpdate:modelValue": (n) => a.value = n,
|
|
@@ -1412,7 +1442,7 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1412
1442
|
filterable: ""
|
|
1413
1443
|
}, {
|
|
1414
1444
|
default: U(() => [
|
|
1415
|
-
(
|
|
1445
|
+
(d(!0), _(Y, null, G(a.options || [], (n) => (d(), R(F, {
|
|
1416
1446
|
key: String(n.value),
|
|
1417
1447
|
label: n.label,
|
|
1418
1448
|
value: n.value
|
|
@@ -1420,14 +1450,14 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1420
1450
|
]),
|
|
1421
1451
|
_: 2
|
|
1422
1452
|
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]),
|
|
1423
|
-
a.desc ? (
|
|
1453
|
+
a.desc ? (d(), R(y, {
|
|
1424
1454
|
key: 0,
|
|
1425
1455
|
content: a.desc,
|
|
1426
1456
|
placement: "top",
|
|
1427
1457
|
effect: "dark"
|
|
1428
1458
|
}, {
|
|
1429
1459
|
default: U(() => [
|
|
1430
|
-
w(
|
|
1460
|
+
w(k, { class: "field-desc-icon" }, {
|
|
1431
1461
|
default: U(() => [
|
|
1432
1462
|
w(B(j))
|
|
1433
1463
|
]),
|
|
@@ -1436,7 +1466,7 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1436
1466
|
]),
|
|
1437
1467
|
_: 1
|
|
1438
1468
|
}, 8, ["content"])) : M("", !0)
|
|
1439
|
-
])) : a.type === B(t).COLOR ? (
|
|
1469
|
+
])) : a.type === B(t).COLOR ? (d(), _("div", lo, [
|
|
1440
1470
|
w(W, {
|
|
1441
1471
|
modelValue: a.value,
|
|
1442
1472
|
"onUpdate:modelValue": (n) => a.value = n,
|
|
@@ -1444,8 +1474,8 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1444
1474
|
"show-alpha": "",
|
|
1445
1475
|
onChange: (n) => $(a)
|
|
1446
1476
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"]),
|
|
1447
|
-
a.desc ? (
|
|
1448
|
-
])) : a.type === B(t).READONLY ? (
|
|
1477
|
+
a.desc ? (d(), _("span", no, T(a.desc), 1)) : M("", !0)
|
|
1478
|
+
])) : a.type === B(t).READONLY ? (d(), _("div", so, T(a.value), 1)) : (d(), _("div", ao, "未指定类型: " + T(a.type), 1))
|
|
1449
1479
|
]),
|
|
1450
1480
|
_: 2
|
|
1451
1481
|
}, 1032, ["label"])) : M("", !0)
|
|
@@ -1472,81 +1502,81 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1472
1502
|
componentConfig: {}
|
|
1473
1503
|
},
|
|
1474
1504
|
emits: ["update-prop", "update-preview"],
|
|
1475
|
-
setup(e, { emit:
|
|
1476
|
-
const t = e, l = N("style"), o = N("style"),
|
|
1505
|
+
setup(e, { emit: r }) {
|
|
1506
|
+
const t = e, l = N("style"), o = N("style"), p = N([]), c = N([]), g = N([]), C = E(() => l.value.startsWith(D.SUB_COMPONENT)), z = E(() => {
|
|
1477
1507
|
var s;
|
|
1478
|
-
if (!
|
|
1479
|
-
const
|
|
1480
|
-
if (!
|
|
1481
|
-
const
|
|
1482
|
-
return
|
|
1483
|
-
}), $ = (
|
|
1484
|
-
var
|
|
1485
|
-
l.value =
|
|
1486
|
-
}, i = (
|
|
1487
|
-
o.value =
|
|
1488
|
-
},
|
|
1489
|
-
var
|
|
1508
|
+
if (!C.value || !t.componentConfig) return [];
|
|
1509
|
+
const k = Number(l.value.split("-")[1]), y = (s = t.componentConfig.subComponents) == null ? void 0 : s[k];
|
|
1510
|
+
if (!y) return [];
|
|
1511
|
+
const m = [];
|
|
1512
|
+
return y.styleSchema && y.styleSchema.length > 0 && m.push({ key: "style", label: "样式配置" }), y.businessSchema && y.businessSchema.length > 0 && m.push({ key: "business", label: "业务配置" }), m;
|
|
1513
|
+
}), $ = (k) => {
|
|
1514
|
+
var y;
|
|
1515
|
+
l.value = k, k.startsWith(D.SUB_COMPONENT) && (o.value = ((y = z.value[0]) == null ? void 0 : y.key) || "style"), f();
|
|
1516
|
+
}, i = (k) => {
|
|
1517
|
+
o.value = k, f();
|
|
1518
|
+
}, f = () => {
|
|
1519
|
+
var k;
|
|
1490
1520
|
if (!t.componentConfig) {
|
|
1491
|
-
|
|
1521
|
+
p.value = [];
|
|
1492
1522
|
return;
|
|
1493
1523
|
}
|
|
1494
1524
|
if (l.value.startsWith(D.SUB_COMPONENT)) {
|
|
1495
|
-
const
|
|
1496
|
-
if (!
|
|
1497
|
-
|
|
1525
|
+
const y = Number(l.value.split("-")[1]), m = (k = t.componentConfig.subComponents) == null ? void 0 : k[y];
|
|
1526
|
+
if (!m) {
|
|
1527
|
+
p.value = [];
|
|
1498
1528
|
return;
|
|
1499
1529
|
}
|
|
1500
|
-
o.value === "style" ?
|
|
1530
|
+
o.value === "style" ? p.value = m.styleSchema || [] : p.value = m.businessSchema || [];
|
|
1501
1531
|
return;
|
|
1502
1532
|
}
|
|
1503
|
-
switch (c.value = [],
|
|
1533
|
+
switch (c.value = [], p.value = [], l.value) {
|
|
1504
1534
|
case D.STYLE:
|
|
1505
|
-
|
|
1535
|
+
p.value = t.componentConfig.styleSchema || [];
|
|
1506
1536
|
break;
|
|
1507
1537
|
case D.BUSINESS:
|
|
1508
|
-
|
|
1538
|
+
p.value = t.componentConfig.businessSchema || [];
|
|
1509
1539
|
break;
|
|
1510
1540
|
case D.PREVIEW:
|
|
1511
1541
|
c.value = t.componentConfig.previewConfig || [];
|
|
1512
1542
|
break;
|
|
1513
1543
|
}
|
|
1514
|
-
|
|
1515
|
-
},
|
|
1516
|
-
if (
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1519
|
-
|
|
1544
|
+
p.value = p.value.filter((y) => !y.hidden);
|
|
1545
|
+
}, S = () => {
|
|
1546
|
+
if (g.value = [], !t.componentConfig) return;
|
|
1547
|
+
const k = [], y = t.componentConfig;
|
|
1548
|
+
y.styleSchema && y.styleSchema.length > 0 && k.push({ key: D.STYLE, label: "样式配置", icon: "🎨" }), y.businessSchema && y.businessSchema.length > 0 && k.push({ key: D.BUSINESS, label: "业务配置", icon: "⚙️" }), y.subComponents && y.subComponents.length > 0 && y.subComponents.forEach((m, s) => {
|
|
1549
|
+
k.push({
|
|
1520
1550
|
key: `${D.SUB_COMPONENT}-${s}`,
|
|
1521
|
-
label:
|
|
1551
|
+
label: m.name,
|
|
1522
1552
|
icon: "📦"
|
|
1523
1553
|
});
|
|
1524
|
-
}),
|
|
1554
|
+
}), y.previewConfig && k.push({ key: D.PREVIEW, label: "接口预览", icon: "" }), g.value = k;
|
|
1525
1555
|
};
|
|
1526
1556
|
te(
|
|
1527
1557
|
() => t.componentConfig,
|
|
1528
|
-
(
|
|
1529
|
-
|
|
1558
|
+
(k) => {
|
|
1559
|
+
S(), g.value.length > 0 ? l.value = g.value[0].key : l.value = "style", k ? f() : p.value = [];
|
|
1530
1560
|
},
|
|
1531
1561
|
{ immediate: !0 }
|
|
1532
1562
|
);
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1535
|
-
}, u = (
|
|
1536
|
-
if (!
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1563
|
+
const b = r, h = (k, y) => {
|
|
1564
|
+
b("update-prop", k, y);
|
|
1565
|
+
}, u = (k, y) => {
|
|
1566
|
+
if (!y) return;
|
|
1567
|
+
const m = `previewConfig.${k}`;
|
|
1568
|
+
b("update-prop", m, y);
|
|
1539
1569
|
};
|
|
1540
|
-
return (
|
|
1541
|
-
const
|
|
1542
|
-
return
|
|
1570
|
+
return (k, y) => {
|
|
1571
|
+
const m = I("el-empty");
|
|
1572
|
+
return d(), _("aside", uo, [
|
|
1543
1573
|
v("div", ro, [
|
|
1544
|
-
|
|
1545
|
-
e.componentName ? (
|
|
1574
|
+
y[0] || (y[0] = v("h3", null, "属性编辑", -1)),
|
|
1575
|
+
e.componentName ? (d(), _("div", co, T(e.componentName), 1)) : M("", !0)
|
|
1546
1576
|
]),
|
|
1547
|
-
e.componentConfig ? (
|
|
1577
|
+
e.componentConfig ? (d(), _("div", po, [
|
|
1548
1578
|
v("div", mo, [
|
|
1549
|
-
(
|
|
1579
|
+
(d(!0), _(Y, null, G(g.value, (s) => (d(), _("div", {
|
|
1550
1580
|
key: s.key,
|
|
1551
1581
|
class: ee(["tab-item", { active: l.value === s.key }]),
|
|
1552
1582
|
onClick: (x) => $(s.key)
|
|
@@ -1556,39 +1586,39 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1556
1586
|
], 10, vo))), 128))
|
|
1557
1587
|
]),
|
|
1558
1588
|
v("div", fo, [
|
|
1559
|
-
|
|
1560
|
-
(
|
|
1589
|
+
C.value && z.value.length > 0 ? (d(), _("div", yo, [
|
|
1590
|
+
(d(!0), _(Y, null, G(z.value, (s) => (d(), _("div", {
|
|
1561
1591
|
key: s.key,
|
|
1562
1592
|
class: ee(["sub-tab-item", { active: o.value === s.key }]),
|
|
1563
1593
|
onClick: (x) => i(s.key)
|
|
1564
1594
|
}, T(s.label), 11, bo))), 128))
|
|
1565
1595
|
])) : M("", !0),
|
|
1566
1596
|
v("div", ko, [
|
|
1567
|
-
l.value === B(D).PREVIEW && c.value.length ? (
|
|
1597
|
+
l.value === B(D).PREVIEW && c.value.length ? (d(), R(Qe, {
|
|
1568
1598
|
key: 0,
|
|
1569
1599
|
"preview-config": c.value,
|
|
1570
1600
|
onUpdateConfig: u
|
|
1571
|
-
}, null, 8, ["preview-config"])) : l.value !== B(D).PREVIEW &&
|
|
1601
|
+
}, null, 8, ["preview-config"])) : l.value !== B(D).PREVIEW && p.value.length ? (d(), R(io, {
|
|
1572
1602
|
key: 1,
|
|
1573
|
-
"config-list":
|
|
1603
|
+
"config-list": p.value,
|
|
1574
1604
|
onUpdateValue: h
|
|
1575
1605
|
}, {
|
|
1576
1606
|
"select-material": U((s) => [
|
|
1577
|
-
Q(
|
|
1607
|
+
Q(k.$slots, "select-material", ae(ie(s)))
|
|
1578
1608
|
]),
|
|
1579
1609
|
"select-goods": U((s) => [
|
|
1580
|
-
Q(
|
|
1610
|
+
Q(k.$slots, "select-goods", ae(ie(s)))
|
|
1581
1611
|
]),
|
|
1582
1612
|
_: 3
|
|
1583
|
-
}, 8, ["config-list"])) : (
|
|
1613
|
+
}, 8, ["config-list"])) : (d(), R(m, {
|
|
1584
1614
|
key: 2,
|
|
1585
1615
|
description: "暂无配置",
|
|
1586
1616
|
"image-size": 100
|
|
1587
1617
|
}))
|
|
1588
1618
|
])
|
|
1589
1619
|
])
|
|
1590
|
-
])) : (
|
|
1591
|
-
w(
|
|
1620
|
+
])) : (d(), _("div", _o, [
|
|
1621
|
+
w(m, {
|
|
1592
1622
|
description: "暂无配置1",
|
|
1593
1623
|
"image-size": 100
|
|
1594
1624
|
})
|
|
@@ -1597,54 +1627,54 @@ const nt = { class: "animation-form" }, st = {
|
|
|
1597
1627
|
};
|
|
1598
1628
|
}
|
|
1599
1629
|
});
|
|
1600
|
-
function ne(e,
|
|
1630
|
+
function ne(e, r = {}, t = "") {
|
|
1601
1631
|
!e || !e.length || e.forEach((l) => {
|
|
1602
1632
|
const o = t ? `${t}.${l.key}` : l.key;
|
|
1603
|
-
l.parentKey = o, l.type === "group-panel" && l.children ? (
|
|
1633
|
+
l.parentKey = o, l.type === "group-panel" && l.children ? (r[l.key] || (r[l.key] = {}), ne(
|
|
1604
1634
|
l.children,
|
|
1605
|
-
|
|
1635
|
+
r[l.key],
|
|
1606
1636
|
o
|
|
1607
|
-
)) : l.value !== void 0 && (
|
|
1637
|
+
)) : l.value !== void 0 && (r[l.key] = l.value);
|
|
1608
1638
|
});
|
|
1609
1639
|
}
|
|
1610
|
-
const ue = (e,
|
|
1640
|
+
const ue = (e, r, t) => {
|
|
1611
1641
|
const l = t || "";
|
|
1612
1642
|
if (e.styleSchema) {
|
|
1613
1643
|
const o = {};
|
|
1614
|
-
ne(e.styleSchema, o, l + "styleSchema"),
|
|
1644
|
+
ne(e.styleSchema, o, l + "styleSchema"), r.styleSchema = o;
|
|
1615
1645
|
}
|
|
1616
1646
|
if (e.businessSchema) {
|
|
1617
1647
|
const o = {};
|
|
1618
|
-
ne(e.businessSchema, o, l + "businessSchema"),
|
|
1648
|
+
ne(e.businessSchema, o, l + "businessSchema"), r.businessSchema = o;
|
|
1619
1649
|
}
|
|
1620
|
-
},
|
|
1621
|
-
const
|
|
1622
|
-
if (ue(e,
|
|
1650
|
+
}, ve = (e) => {
|
|
1651
|
+
const r = {};
|
|
1652
|
+
if (ue(e, r), e.subComponents)
|
|
1623
1653
|
for (const t of e.subComponents) {
|
|
1624
1654
|
const l = {}, o = t.id;
|
|
1625
|
-
ue(t, l, `${o}.`),
|
|
1655
|
+
ue(t, l, `${o}.`), r[o] = l;
|
|
1626
1656
|
}
|
|
1627
1657
|
if (e.previewConfig) {
|
|
1628
1658
|
const t = {};
|
|
1629
1659
|
e.previewConfig.forEach((l) => {
|
|
1630
1660
|
t[l.key] = l;
|
|
1631
|
-
}),
|
|
1661
|
+
}), r.previewConfig = t;
|
|
1632
1662
|
}
|
|
1633
|
-
return
|
|
1663
|
+
return r;
|
|
1634
1664
|
};
|
|
1635
|
-
async function wo(e,
|
|
1665
|
+
async function wo(e, r, t) {
|
|
1636
1666
|
try {
|
|
1637
|
-
if (!
|
|
1667
|
+
if (!r)
|
|
1638
1668
|
throw new Error("未正确传入组件的配置数据");
|
|
1639
1669
|
if (t !== "npm") {
|
|
1640
1670
|
if (t === "onLine")
|
|
1641
1671
|
throw new Error("暂不支持线上路径格式");
|
|
1642
1672
|
}
|
|
1643
|
-
const l =
|
|
1673
|
+
const l = ve(r);
|
|
1644
1674
|
return {
|
|
1645
1675
|
component: e,
|
|
1646
1676
|
props: l,
|
|
1647
|
-
config:
|
|
1677
|
+
config: r
|
|
1648
1678
|
};
|
|
1649
1679
|
} catch (l) {
|
|
1650
1680
|
throw console.error("加载组件失败:", l), new Error(`加载组件失败:${l}`);
|
|
@@ -1652,19 +1682,19 @@ async function wo(e, d, t) {
|
|
|
1652
1682
|
}
|
|
1653
1683
|
const zo = {
|
|
1654
1684
|
// 构建组件属性
|
|
1655
|
-
buildProps:
|
|
1685
|
+
buildProps: ve,
|
|
1656
1686
|
// 加载组件
|
|
1657
1687
|
load: wo
|
|
1658
1688
|
}, xo = {
|
|
1659
1689
|
// 位置和尺寸
|
|
1660
|
-
updatePosition:
|
|
1661
|
-
updateSize:
|
|
1690
|
+
updatePosition: je,
|
|
1691
|
+
updateSize: et,
|
|
1662
1692
|
// 层级管理
|
|
1663
|
-
moveComponentUp:
|
|
1664
|
-
moveComponentDown:
|
|
1693
|
+
moveComponentUp: ot,
|
|
1694
|
+
moveComponentDown: lt,
|
|
1665
1695
|
// 属性更新
|
|
1666
|
-
updateProp:
|
|
1667
|
-
updateDefaultVal:
|
|
1696
|
+
updateProp: tt,
|
|
1697
|
+
updateDefaultVal: me,
|
|
1668
1698
|
// 字段查找和条件渲染
|
|
1669
1699
|
findField: se,
|
|
1670
1700
|
shouldShow: ce
|