ss-component-new 1.1.69 → 1.1.71

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.
@@ -0,0 +1,254 @@
1
+ import { v as M, c as x } from "./array-BtcGNRWC.js";
2
+ import { ref as Y } from "vue";
3
+ import { c as l } from "./cloneDeep-BcUiE4Tq.js";
4
+ const L = Y(0), Z = (e) => {
5
+ let s;
6
+ e.includes(`\r
7
+ `) ? s = e.split(`\r
8
+ `).filter((t) => t.trim() !== "") : s = e.split(`
9
+ `).filter((t) => t.trim() !== "");
10
+ const p = [];
11
+ let r = "";
12
+ for (const t of s)
13
+ t.includes("{") || r.includes("{") || t.includes("[") || r.includes("[") || t.includes("【") || r.includes("【") || t.includes("(") || r.includes("(") || t.includes("(") || r.includes("(") || t.includes("/*") || r.includes("/*") ? (r += t.trim(), l(r).split("{").length - 1 === l(r).split("}").length - 1 && l(r).split("【").length - 1 === l(r).split("】").length - 1 && l(r).split("[").length - 1 === l(r).split("]").length - 1 && l(r).split("(").length - 1 === l(r).split(")").length - 1 && l(r).split("(").length - 1 === l(r).split(")").length - 1 && l(r).split("/*").length - 1 === l(r).split("*/").length - 1 && (p.push(r), r = "")) : p.push(t.trim());
14
+ return p;
15
+ }, _ = (e) => {
16
+ const [s, p] = e.split(/=(.+)/), r = s.replace(/['"]/g, "").trim(), t = p.replace(/^['"]|['"]$/g, "");
17
+ return { key: r, value: t };
18
+ }, V = (e) => {
19
+ try {
20
+ return JSON.parse(e), !0;
21
+ } catch {
22
+ return !1;
23
+ }
24
+ }, R = (e) => {
25
+ try {
26
+ const s = e.replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",").replace(/:/g, ":").replace(/:\s*(?=,|}|$)/g, ': ""');
27
+ if (l(s).split("{").length - 1 > 1) {
28
+ let p = l(s).replace(/^\{(.*)\}$/, "[$1]");
29
+ if (V(p) && !p.includes("$") || (p = p.replace(/"([^"]+)"\$([\w\u4e00-\u9fa5]+\([^)]*\))/g, '"$1$$$2"')), V(p)) {
30
+ const r = JSON.parse(p);
31
+ let t = [];
32
+ return r == null || r.forEach((o) => {
33
+ var y;
34
+ (y = Object.entries(l(o))) == null || y.forEach((i) => {
35
+ L.value++, t.push({
36
+ id: L.value,
37
+ key: (i == null ? void 0 : i[0]) ?? "",
38
+ value: (i == null ? void 0 : i[1]) === "" ? "" : i == null ? void 0 : i[1],
39
+ // 如果值为空,则key设为空字符串,否则保留原值
40
+ width: Object.keys(l(o)).length
41
+ });
42
+ });
43
+ }), t;
44
+ } else
45
+ return console.error("转换类型不正确:"), [];
46
+ } else if (V(s)) {
47
+ const p = JSON.parse(s);
48
+ return Object.entries(p).map(([r, t]) => (L.value++, {
49
+ id: L.value,
50
+ key: r,
51
+ value: t === "" ? "" : t,
52
+ // 如果值为空,则key设为空字符串,否则保留原值
53
+ width: 1
54
+ }));
55
+ } else
56
+ return s;
57
+ } catch (s) {
58
+ return console.error("转换失败:", s), [];
59
+ }
60
+ }, w = (e, s) => {
61
+ var p;
62
+ try {
63
+ if ((p = M) != null && p.find((r) => (r == null ? void 0 : r.key) === s))
64
+ return e.replace(/['"]/g, "").trim();
65
+ if (l(e).split("[").length - 1 > 1) {
66
+ const r = l(e).replace(/[’]|[‘]|[']/g, '"').replaceAll(/,/g, ",").replaceAll("(", "[").replaceAll(")", "]").replaceAll("],]", "]]");
67
+ return JSON.parse(r);
68
+ } else {
69
+ const r = l(e).replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",");
70
+ if (V(r)) {
71
+ const t = JSON.parse(r);
72
+ return Array.isArray(t) ? t.map((o) => ({ label: o })) : t;
73
+ } else
74
+ return R(l(e));
75
+ }
76
+ } catch (r) {
77
+ return console.error("解析失败:", r), e;
78
+ }
79
+ }, S = (e) => ({ [e == null ? void 0 : e.key]: w(e == null ? void 0 : e.value, e == null ? void 0 : e.key) }), v = (e) => {
80
+ try {
81
+ if (l(e).split("[").length - 1 > 1) {
82
+ const s = l(e).replace(/[’]|[‘]|[']/g, '"').replaceAll(/,/g, ",").replaceAll("(", "[").replaceAll(")", "]").replaceAll("],]", "]]");
83
+ return JSON.parse(s);
84
+ } else
85
+ return JSON.parse(l(e).replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",")).map((p) => ({ label: p }));
86
+ } catch (s) {
87
+ return console.error("解析失败:", s), e;
88
+ }
89
+ }, ee = (e) => {
90
+ const s = e.match(/\(([^)]+)\)/);
91
+ return s ? s[1] : "";
92
+ }, re = (e) => {
93
+ const s = e.match(/^([^(]+)\s*\(/);
94
+ return s ? s[1].trim() : e;
95
+ }, Q = (e) => e.replace(/'/g, "").replace(/"/g, "").replace(/{|}/g, "").split(":").map((s) => s.trim()).filter((s) => s).join("/"), te = (e) => {
96
+ var y, i;
97
+ let s = [], p = [];
98
+ const r = (y = l(e)) == null ? void 0 : y.map((d) => d == null ? void 0 : d.key), t = [...new Set((i = l(r)) == null ? void 0 : i.map((d) => ee(d)))];
99
+ t == null || t.forEach((d) => {
100
+ let U = e == null ? void 0 : e.filter((u) => u.key.includes(d));
101
+ U == null || U.forEach((u) => {
102
+ u != null && u.key.includes("Menus") && (s.push({
103
+ key: "GroupName",
104
+ value: Q(u == null ? void 0 : u.value)
105
+ }), p.push(Q(u == null ? void 0 : u.value)));
106
+ });
107
+ let C = e == null ? void 0 : e.filter((u) => u.key.includes(d) && !(u != null && u.key.includes("Menus")));
108
+ C = C == null ? void 0 : C.map((u) => (u.key = re(u.key), u));
109
+ const P = {
110
+ key: "GroupContents",
111
+ value: C
112
+ };
113
+ s.push(P);
114
+ });
115
+ const o = {
116
+ key: "Menus",
117
+ value: p
118
+ };
119
+ return s.unshift(o), s;
120
+ }, X = (e) => {
121
+ var s, p;
122
+ if (Array.isArray(Object.keys(e)) && ((s = Object.keys(e)) == null ? void 0 : s.length) > 0) {
123
+ let r = [];
124
+ return (p = Object.entries(e)) == null || p.forEach(([t, o]) => {
125
+ var i, d;
126
+ let y = [];
127
+ if (y.push(t), ((i = Object.keys(o)) == null ? void 0 : i.length) > 0) {
128
+ let U = [];
129
+ U.push((d = X(o)) == null ? void 0 : d[0]), y.push(U == null ? void 0 : U[0]);
130
+ }
131
+ r.push(y);
132
+ }), r;
133
+ }
134
+ }, se = (e, s) => {
135
+ var r;
136
+ let p = s;
137
+ return Array.isArray(Object.keys(e)) && ((r = Object.entries(e)) == null || r.forEach(([t, o]) => {
138
+ let y = [t];
139
+ if (typeof o == "object" && o !== null) {
140
+ let i = X(o);
141
+ i == null || i.forEach((d) => {
142
+ y.push(d);
143
+ });
144
+ }
145
+ p.push(y);
146
+ })), p;
147
+ }, ce = (e) => {
148
+ const s = {};
149
+ return e.forEach((r) => {
150
+ const t = r.split("/");
151
+ let o = s;
152
+ t.forEach((y) => {
153
+ o[y] || (o[y] = {}), o = o[y];
154
+ });
155
+ }), se(s, []);
156
+ }, le = (e) => ce(e), ue = (e) => {
157
+ var y, i, d, U, C, P, u;
158
+ const s = Z((i = (y = l(e)) == null ? void 0 : y.replace("(", "(")) == null ? void 0 : i.replace(")", ")")), p = (U = (d = l(s)) == null ? void 0 : d.filter((c) => !c.includes("/*"))) == null ? void 0 : U.map((c) => _(c)), r = te(p), t = [];
159
+ (C = l(r)) == null || C.forEach((c) => {
160
+ var D, n, a, $, b, E, g, J, N;
161
+ (D = M) != null && D.find((h) => {
162
+ var m, k;
163
+ return ((m = h == null ? void 0 : h.key) == null ? void 0 : m.toUpperCase()) === ((k = c == null ? void 0 : c.key) == null ? void 0 : k.toUpperCase());
164
+ }) ? t.push({
165
+ comp: ((a = (n = M) == null ? void 0 : n.find((h) => {
166
+ var m, k;
167
+ return ((m = h == null ? void 0 : h.key) == null ? void 0 : m.toUpperCase()) === ((k = c == null ? void 0 : c.key) == null ? void 0 : k.toUpperCase());
168
+ })) == null ? void 0 : a.value) ?? "",
169
+ name: ($ = c == null ? void 0 : c.value) == null ? void 0 : $.replace(/[’]|[‘]|[']/g, ""),
170
+ compData: []
171
+ }) : (b = x) != null && b.find((h) => {
172
+ var m, k;
173
+ return ((m = h == null ? void 0 : h.key) == null ? void 0 : m.toUpperCase()) === ((k = c == null ? void 0 : c.key) == null ? void 0 : k.toUpperCase());
174
+ }) && ((t == null ? void 0 : t.length) === 0 && (E = c.key) != null && E.includes("Menus") && t.push({
175
+ comp: "Menu",
176
+ name: "",
177
+ compData: []
178
+ }), (g = t == null ? void 0 : t[(t == null ? void 0 : t.length) - 1]) != null && g.compData && t[(t == null ? void 0 : t.length) - 1].compData.push({
179
+ key: (N = (J = x) == null ? void 0 : J.find((h) => {
180
+ var m, k;
181
+ return ((m = h == null ? void 0 : h.key) == null ? void 0 : m.toUpperCase()) === ((k = c == null ? void 0 : c.key) == null ? void 0 : k.toUpperCase());
182
+ })) == null ? void 0 : N.value,
183
+ contents: c == null ? void 0 : c.value
184
+ }));
185
+ });
186
+ let o = (P = l(t)) == null ? void 0 : P.map((c) => {
187
+ var D;
188
+ return c != null && c.compData && (c.compData = (D = c == null ? void 0 : c.compData) == null ? void 0 : D.map((n) => {
189
+ var a, $, b, E, g, J, N, h, m, k, T;
190
+ if ((n == null ? void 0 : n.key) === "formFlex")
191
+ n.contents = (($ = (a = n.contents) == null ? void 0 : a.replace(/[’]|[‘]|[']/g, "")) == null ? void 0 : $.toUpperCase()) !== "Vertical".toUpperCase();
192
+ else if ((n == null ? void 0 : n.key) === "groupContents")
193
+ n.contents = (b = l(n.contents)) == null ? void 0 : b.map((G) => S(l(G)));
194
+ else if (Array.isArray(n == null ? void 0 : n.contents))
195
+ n.contents = le(n.contents);
196
+ else if (((g = (E = n == null ? void 0 : n.contents) == null ? void 0 : E.trim()) != null && g.startsWith("[") || (N = (J = n.contents) == null ? void 0 : J.trim()) != null && N.startsWith("【")) && ((m = (h = n.contents) == null ? void 0 : h.trim()) != null && m.endsWith("]") || (T = (k = n.contents) == null ? void 0 : k.trim()) != null && T.endsWith("】")))
197
+ n.contents = v(l(n.contents));
198
+ else {
199
+ if (!n.contents) return;
200
+ n.contents = R(l(n.contents));
201
+ }
202
+ return n;
203
+ })), c;
204
+ });
205
+ return o = (u = l(o)) == null ? void 0 : u.map((c) => {
206
+ var D;
207
+ return (c == null ? void 0 : c.comp) === "Group" && (c.compData = (D = c.compData) == null ? void 0 : D.map((n) => {
208
+ var $;
209
+ let a = [];
210
+ return ($ = n.contents) == null || $.forEach((b) => {
211
+ var E, g, J, N, h, m, k, T, G, W, I, F, H, q, z, B, K;
212
+ if ((E = M) != null && E.find((f) => {
213
+ var O, j, A;
214
+ return ((O = f == null ? void 0 : f.key) == null ? void 0 : O.toUpperCase()) === ((A = (j = Object.keys(b)) == null ? void 0 : j[0]) == null ? void 0 : A.toUpperCase());
215
+ }))
216
+ a.push({
217
+ comp: (J = (g = M) == null ? void 0 : g.find((f) => {
218
+ var O, j, A;
219
+ return ((O = f == null ? void 0 : f.key) == null ? void 0 : O.toUpperCase()) === ((A = (j = Object.keys(b)) == null ? void 0 : j[0]) == null ? void 0 : A.toUpperCase());
220
+ })) == null ? void 0 : J.value,
221
+ name: (h = (N = Object.values(b)) == null ? void 0 : N[0]) == null ? void 0 : h.replace(/[’]|[‘]|[']/g, ""),
222
+ compData: []
223
+ });
224
+ else if ((m = x) != null && m.find((f) => {
225
+ var O, j, A;
226
+ return ((O = f == null ? void 0 : f.key) == null ? void 0 : O.toUpperCase()) === ((A = (j = Object.keys(b)) == null ? void 0 : j[0]) == null ? void 0 : A.toUpperCase());
227
+ })) {
228
+ if ((a == null ? void 0 : a.length) === 0) return;
229
+ (k = a == null ? void 0 : a[(a == null ? void 0 : a.length) - 1]) != null && k.compData && a[(a == null ? void 0 : a.length) - 1].compData.push({
230
+ key: (G = (T = x) == null ? void 0 : T.find((f) => {
231
+ var O, j, A;
232
+ return ((O = f == null ? void 0 : f.key) == null ? void 0 : O.toUpperCase()) === ((A = (j = Object.keys(b)) == null ? void 0 : j[0]) == null ? void 0 : A.toUpperCase());
233
+ })) == null ? void 0 : G.value,
234
+ contents: (W = Object.values(b)) == null ? void 0 : W[0]
235
+ });
236
+ } else if ((F = (I = Object.keys(b)) == null ? void 0 : I[0]) != null && F.includes("$")) {
237
+ const f = (q = (H = Object.keys(l(b))) == null ? void 0 : H[0]) == null ? void 0 : q.split("$");
238
+ a[(a == null ? void 0 : a.length) - 1].compData.push({
239
+ key: (B = (z = x) == null ? void 0 : z.find((O) => {
240
+ var j, A;
241
+ return ((j = O == null ? void 0 : O.key) == null ? void 0 : j.toUpperCase()) === ((A = f == null ? void 0 : f[0]) == null ? void 0 : A.toUpperCase());
242
+ })) == null ? void 0 : B.value,
243
+ contents: (K = Object.values(b)) == null ? void 0 : K[0],
244
+ selectLabel: f == null ? void 0 : f[1]
245
+ });
246
+ }
247
+ return b;
248
+ }), n.contents = a, n;
249
+ })), c;
250
+ }), o;
251
+ };
252
+ export {
253
+ ue as e
254
+ };
@@ -0,0 +1,144 @@
1
+ import { defineAsyncComponent as U, computed as D, onMounted as O, resolveComponent as G, createBlock as v, openBlock as C, withCtx as I, resolveDynamicComponent as N, defineComponent as k, ref as T, watch as q } from "vue";
2
+ import { E as M } from "./index-NvpJBKaz.js";
3
+ import { u as z, s as E } from "./menu-Dez5HOn4.js";
4
+ import { u as H } from "./modelComp-BdUI1DVP.js";
5
+ import { c as f } from "./cloneDeep-BcUiE4Tq.js";
6
+ const g = U(() => import("./index-BQ18EzV6.js"));
7
+ g.install = (u) => {
8
+ u.component("ssMenu", g);
9
+ };
10
+ const J = {
11
+ __name: "index",
12
+ props: {
13
+ name: String
14
+ },
15
+ setup(u) {
16
+ const m = u, p = D(() => M[m.name]);
17
+ return O(() => {
18
+ const c = Object.keys(M);
19
+ console.log("iconComponent", p.value, m.name, M, c);
20
+ }), (c, A) => {
21
+ const d = G("el-icon");
22
+ return C(), v(d, null, {
23
+ default: I(() => [
24
+ (C(), v(N(p.value)))
25
+ ]),
26
+ _: 1
27
+ });
28
+ };
29
+ }
30
+ }, Z = k({
31
+ name: "menu",
32
+ components: {
33
+ ssMenu: g,
34
+ DynamicIcon: J
35
+ },
36
+ setup() {
37
+ const u = z(), m = H(), { rawMenu: p, menuTriggerType: c } = E(u), { itemData: A } = E(m), d = T([]);
38
+ let h;
39
+ ((e) => {
40
+ e[e.Menu = 0] = "Menu", e[e.FolderOpened = 1] = "FolderOpened";
41
+ })(h || (h = {}));
42
+ const S = (e) => {
43
+ let o = [], s = [];
44
+ return e == null || e.forEach((r) => {
45
+ o = y(r, s);
46
+ }), console.log("splitMenu", o), o;
47
+ }, y = (e, o) => {
48
+ const s = o, r = [];
49
+ e == null || e.forEach((n) => {
50
+ Array.isArray(n) ? r.push({ children: y(n, []) }) : r.push({ title: n });
51
+ });
52
+ let i = r.reduce((n, a) => (Object.entries(a).forEach(([t, l]) => {
53
+ n[t] === void 0 ? l != null && l.title ? n[t] = [l] : n[t] = l : (Array.isArray(n[t]) || (n[t] = [{ title: n[t] }]), l != null && l.title || Array.isArray(l) ? n[t].push(l) : n[t].push({ title: l }));
54
+ }), n), {});
55
+ return i = F(f(i)), s.push(i), Array.isArray(s) && (s == null ? void 0 : s.length) > 1 ? s : s == null ? void 0 : s[0];
56
+ }, F = (e) => {
57
+ var o, s, r;
58
+ return Array.isArray(e == null ? void 0 : e.title) && ((o = e == null ? void 0 : e.title) == null ? void 0 : o.length) === ((r = (s = e == null ? void 0 : e.title) == null ? void 0 : s.filter((i) => i.title)) == null ? void 0 : r.length) ? e == null ? void 0 : e.title : Array.isArray(e == null ? void 0 : e.children) ? P(e) : e;
59
+ }, P = (e) => {
60
+ var s;
61
+ const o = e;
62
+ return o.children = (s = o.children) == null ? void 0 : s.map((r) => {
63
+ var i;
64
+ return (i = r == null ? void 0 : r.title) != null && i.children ? r == null ? void 0 : r.title : r;
65
+ }), o;
66
+ }, b = (e, o = "", s = 0) => {
67
+ var n;
68
+ const r = f(A.value), i = (n = r == null ? void 0 : r.filter((a) => {
69
+ var t;
70
+ return ((t = a.comp) == null ? void 0 : t.toUpperCase()) === "GROUP";
71
+ })) == null ? void 0 : n.map((a) => a.name);
72
+ return e == null ? void 0 : e.map((a) => {
73
+ const t = o ? `${o}/${a.title}` : a.title, l = {
74
+ ...a,
75
+ path: t,
76
+ level: s,
77
+ icon: h[`${s}`],
78
+ carryData: i == null ? void 0 : i.includes(t)
79
+ };
80
+ return a.children && a.children.length > 0 && (l.children = b(a.children, t, s + 1)), l;
81
+ });
82
+ }, _ = D(() => {
83
+ const e = b(d.value);
84
+ return console.log("temps", e), u.setMenus(e), e;
85
+ }), $ = (e) => {
86
+ console.log("clickMenu", e), u.setMenuTriggerType("click"), u.setActiveMenuPath(e == null ? void 0 : e.path);
87
+ }, R = (e) => {
88
+ c.value === "click" ? u.setActiveMenuPath(e) : u.setMenuTriggerType("click");
89
+ }, j = (e) => {
90
+ u.setActiveMenuPath(e);
91
+ }, w = T([
92
+ {
93
+ name: "--ssComponent-menu-bg",
94
+ value: "#426ec4"
95
+ },
96
+ {
97
+ name: "--ssComponent-submenu-hover-bg",
98
+ value: "#00000033"
99
+ },
100
+ {
101
+ name: "--ssComponent-submenu-open-bg",
102
+ value: "#2DA0FF"
103
+ },
104
+ {
105
+ name: "--ssComponent-submenu-open-inline-bg",
106
+ value: "#1C4275"
107
+ },
108
+ {
109
+ name: "--ssComponent-menuitem-hover-bg",
110
+ value: "#1d7bef"
111
+ },
112
+ {
113
+ name: "--ssComponent-menuitem-active-bg",
114
+ value: "#1d7bef"
115
+ }
116
+ ]), B = () => {
117
+ var o;
118
+ const e = document.documentElement;
119
+ (o = w.value) == null || o.forEach((s) => {
120
+ e.style.setProperty(s.name, s.value);
121
+ });
122
+ };
123
+ return O(() => {
124
+ }), q(() => p.value, (e) => {
125
+ var o, s, r;
126
+ if (e) {
127
+ const i = (r = (s = (o = f(e)) == null ? void 0 : o.compData) == null ? void 0 : s[0]) == null ? void 0 : r.contents;
128
+ d.value = S(i), console.log("rawMenu", _.value);
129
+ } else
130
+ u.setActiveMenuPath("");
131
+ }, {
132
+ immediate: !0
133
+ }), {
134
+ renderMenuList: _,
135
+ clickMenu: $,
136
+ openMenu: R,
137
+ closeMenu: j,
138
+ changeMenuStyle: B
139
+ };
140
+ }
141
+ });
142
+ export {
143
+ Z as _
144
+ };
@@ -1,8 +1,10 @@
1
1
  import { ref as _, watch as V, createElementBlock as C, createCommentVNode as I, openBlock as f, Fragment as le, renderList as se, createElementVNode as O, createBlock as Z, toDisplayString as v, resolveDynamicComponent as ue, onMounted as ce, createVNode as A } from "vue";
2
- import { p as E, e as ie, g as de, m as me, a as ye, b as fe, c as ge } from "./array-BGMpYX__.js";
3
- import { u as ee } from "./modelComp-Cr1QF6ip.js";
4
- import { s as te, u as he } from "./menu-D6yKPqgS.js";
5
- import { _ as ne, c as k } from "./_plugin-vue_export-helper-B7R8Jogt.js";
2
+ import { m as ie, a as me, b as de } from "./index-CN2pLnQT.js";
3
+ import { p as E, e as ye, g as fe, a as ge } from "./array-BtcGNRWC.js";
4
+ import { u as ee } from "./modelComp-BdUI1DVP.js";
5
+ import { s as te, u as he } from "./menu-Dez5HOn4.js";
6
+ import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ import { c as k } from "./cloneDeep-BcUiE4Tq.js";
6
8
  const x = [
7
9
  {
8
10
  key: "FormName",
@@ -56,20 +58,20 @@ const x = [
56
58
  },
57
59
  emits: ["change"],
58
60
  setup(F, { emit: B }) {
59
- const e = F, $ = B, h = ee(E), { itemData: b } = te(h), p = _([]), w = _([]), L = (l) => {
61
+ const e = F, $ = B, h = ee(E), { itemData: p } = te(h), b = _([]), w = _([]), L = (l) => {
60
62
  $("change", {
61
- wholeValue: p.value,
63
+ wholeValue: b.value,
62
64
  editValue: l
63
65
  });
64
66
  }, D = (l) => {
65
- const g = k(p.value), S = g == null ? void 0 : g.map((c, j) => (j === (l == null ? void 0 : l.index) && (c.compData = l == null ? void 0 : l.contents), c));
66
- p.value = S;
67
+ const g = k(b.value), S = g == null ? void 0 : g.map((c, j) => (j === (l == null ? void 0 : l.index) && (c.compData = l == null ? void 0 : l.contents), c));
68
+ b.value = S;
67
69
  };
68
70
  V(
69
- () => b.value,
71
+ () => p.value,
70
72
  () => {
71
73
  var l;
72
- !b.value || ((l = b.value) == null ? void 0 : l.length) === 0 || (w.value = b.value, p.value = b.value);
74
+ !p.value || ((l = p.value) == null ? void 0 : l.length) === 0 || (w.value = p.value, b.value = p.value);
73
75
  },
74
76
  { deep: !0, immediate: !0 }
75
77
  ), V(
@@ -81,12 +83,12 @@ const x = [
81
83
  return;
82
84
  }
83
85
  if (!(e != null && e.content) || (e == null ? void 0 : e.content) === "") return;
84
- const l = ie(e == null ? void 0 : e.content);
86
+ const l = ye(e == null ? void 0 : e.content);
85
87
  h.setOriginalData(l), h.setItemData(l);
86
88
  },
87
89
  { deep: !0, immediate: !0 }
88
90
  );
89
- const N = (l) => de(l);
91
+ const N = (l) => fe(l);
90
92
  return (l, g) => {
91
93
  var S;
92
94
  return ((S = w.value) == null ? void 0 : S.length) > 0 ? (f(), C("div", ke, [
@@ -107,7 +109,7 @@ const x = [
107
109
  ])) : I("", !0);
108
110
  };
109
111
  }
110
- }, be = /* @__PURE__ */ ne(Ce, [["__scopeId", "data-v-869e6e20"]]), pe = { class: "add-model-content" }, we = {
112
+ }, pe = /* @__PURE__ */ ne(Ce, [["__scopeId", "data-v-869e6e20"]]), be = { class: "add-model-content" }, we = {
111
113
  key: 0,
112
114
  class: "model-import-data"
113
115
  }, je = { class: "import-button" }, Se = { key: 0 }, xe = {
@@ -138,15 +140,15 @@ const x = [
138
140
  },
139
141
  emits: ["change"],
140
142
  setup(F, { emit: B }) {
141
- const e = F, $ = B, h = _(""), b = _([]), p = _(0), w = ee(E);
143
+ const e = F, $ = B, h = _(""), p = _([]), b = _(0), w = ee(E);
142
144
  he(E);
143
145
  const { itemData: L, originalData: D } = te(w), N = _(null), l = _(0), g = _(""), S = () => {
144
- p.value = window.innerWidth;
146
+ b.value = window.innerWidth;
145
147
  }, c = async (o) => {
146
148
  var u;
147
149
  const a = (u = k(o == null ? void 0 : o.wholeValue)) == null ? void 0 : u.map((n) => {
148
- var m;
149
- return (n == null ? void 0 : n.comp) === "Form" && (n.compData = (m = n.compData) == null ? void 0 : m.map((y) => ((y == null ? void 0 : y.key) === "formContent" && (y.contents = ge(y == null ? void 0 : y.contents)), y))), n;
150
+ var d;
151
+ return (n == null ? void 0 : n.comp) === "Form" && (n.compData = (d = n.compData) == null ? void 0 : d.map((y) => ((y == null ? void 0 : y.key) === "formContent" && (y.contents = ge(y == null ? void 0 : y.contents)), y))), n;
150
152
  });
151
153
  $("change", {
152
154
  originalContents: D.value,
@@ -159,8 +161,8 @@ const x = [
159
161
  var u;
160
162
  let a = [];
161
163
  return (u = k(o)) == null || u.forEach((n) => {
162
- var m, y;
163
- x != null && x.find((t) => (t == null ? void 0 : t.value) === (n == null ? void 0 : n.comp)) && a.push(((m = x == null ? void 0 : x.find((t) => (t == null ? void 0 : t.value) === (n == null ? void 0 : n.comp))) == null ? void 0 : m.key) + "=" + n.name + "/r/n"), (y = n == null ? void 0 : n.compData) == null || y.forEach((t) => {
164
+ var d, y;
165
+ x != null && x.find((t) => (t == null ? void 0 : t.value) === (n == null ? void 0 : n.comp)) && a.push(((d = x == null ? void 0 : x.find((t) => (t == null ? void 0 : t.value) === (n == null ? void 0 : n.comp))) == null ? void 0 : d.key) + "=" + n.name + "/r/n"), (y = n == null ? void 0 : n.compData) == null || y.forEach((t) => {
164
166
  var M, R, z, W, q, G, H, K, P, Q, U, X;
165
167
  if (s != null && s.find((i) => (i == null ? void 0 : i.value) === (t == null ? void 0 : t.key)))
166
168
  if (!((M = t == null ? void 0 : t.contents) != null && M.length))
@@ -169,21 +171,21 @@ const x = [
169
171
  let i = (z = t == null ? void 0 : t.contents) == null ? void 0 : z[0];
170
172
  if (!i) return;
171
173
  if (Object.keys(i).includes("label") && Object.keys(i).includes("key") && Object.keys(i).includes("width"))
172
- if (((q = (W = t.contents) == null ? void 0 : W.filter((d) => d.width !== 1)) == null ? void 0 : q.length) === 0) {
173
- const d = (G = k(t == null ? void 0 : t.contents)) == null ? void 0 : G.map((r) => ({ [r.label]: r.value }));
174
- a.push(((H = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : H.key) + "=" + JSON.stringify(d) + "/r/n");
174
+ if (((q = (W = t.contents) == null ? void 0 : W.filter((m) => m.width !== 1)) == null ? void 0 : q.length) === 0) {
175
+ const m = (G = k(t == null ? void 0 : t.contents)) == null ? void 0 : G.map((r) => ({ [r.label]: r.value }));
176
+ a.push(((H = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : H.key) + "=" + JSON.stringify(m) + "/r/n");
175
177
  } else {
176
- let d = [];
178
+ let m = [];
177
179
  (K = k(t == null ? void 0 : t.contents)) == null || K.reduce((r, J) => {
178
180
  var Y;
179
- return r[J.label] = J.key, ((Y = Object.keys(k(r))) == null ? void 0 : Y.length) >= J.width && (d.push(k(r)), r = {}), r;
180
- }, {}), a.push(((P = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : P.key) + "=" + JSON.stringify(d) + "/r/n");
181
+ return r[J.label] = J.key, ((Y = Object.keys(k(r))) == null ? void 0 : Y.length) >= J.width && (m.push(k(r)), r = {}), r;
182
+ }, {}), a.push(((P = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : P.key) + "=" + JSON.stringify(m) + "/r/n");
181
183
  }
182
184
  else if (Object.keys(i).includes("label")) {
183
- const d = (Q = k(t == null ? void 0 : t.contents)) == null ? void 0 : Q.map((r) => r.label);
184
- a.push(((U = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : U.key) + "=" + JSON.stringify(d) + "/r/n");
185
+ const m = (Q = k(t == null ? void 0 : t.contents)) == null ? void 0 : Q.map((r) => r.label);
186
+ a.push(((U = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : U.key) + "=" + JSON.stringify(m) + "/r/n");
185
187
  } else
186
- a.push(((X = s == null ? void 0 : s.find((d) => (d == null ? void 0 : d.value) === (t == null ? void 0 : t.key))) == null ? void 0 : X.key) + "=" + JSON.stringify(t == null ? void 0 : t.contents) + "/r/n");
188
+ a.push(((X = s == null ? void 0 : s.find((m) => (m == null ? void 0 : m.value) === (t == null ? void 0 : t.key))) == null ? void 0 : X.key) + "=" + JSON.stringify(t == null ? void 0 : t.contents) + "/r/n");
187
189
  }
188
190
  });
189
191
  }), JSON.stringify(a);
@@ -196,8 +198,8 @@ const x = [
196
198
  u.onload = (n) => {
197
199
  try {
198
200
  h.value = n.target.result, T.value = re(n.target.result), l.value++;
199
- } catch (m) {
200
- console.error("解析失败:", m);
201
+ } catch (d) {
202
+ console.error("解析失败:", d);
201
203
  }
202
204
  }, u.onerror = (n) => {
203
205
  console.error("文件读取错误:", n);
@@ -208,7 +210,7 @@ const x = [
208
210
  }), V(
209
211
  () => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
210
212
  () => {
211
- h.value = e == null ? void 0 : e.content, b.value = e == null ? void 0 : e.jsonContents;
213
+ h.value = e == null ? void 0 : e.content, p.value = e == null ? void 0 : e.jsonContents;
212
214
  },
213
215
  { deep: !0, immediate: !0 }
214
216
  ), V(
@@ -226,9 +228,9 @@ const x = [
226
228
  return JSON.parse(a);
227
229
  } catch (u) {
228
230
  try {
229
- const m = new Function(`return ${a}`)();
230
- if (Array.isArray(m) || typeof m == "object")
231
- return m;
231
+ const d = new Function(`return ${a}`)();
232
+ if (Array.isArray(d) || typeof d == "object")
233
+ return d;
232
234
  throw new Error(`解析结果不是有效的数组或对象: ${u}`);
233
235
  } catch (n) {
234
236
  throw new Error(`无法解析JSON: ${n.message}`);
@@ -237,7 +239,7 @@ const x = [
237
239
  };
238
240
  return (o, a) => {
239
241
  var u;
240
- return f(), C("div", pe, [
242
+ return f(), C("div", be, [
241
243
  ((u = e == null ? void 0 : e.jsonContents) == null ? void 0 : u.length) === 0 ? (f(), C("div", we, [
242
244
  O("div", je, [
243
245
  O("input", {
@@ -257,30 +259,30 @@ const x = [
257
259
  ])) : I("", !0),
258
260
  (e == null ? void 0 : e.mode) === "edit" ? (f(), C("div", xe, [
259
261
  O("div", Oe, [
260
- A(me)
262
+ A(ie)
261
263
  ]),
262
264
  (f(), C("div", {
263
265
  class: "model-show",
264
- key: p.value
266
+ key: b.value
265
267
  }, [
266
- A(ye)
268
+ A(me)
267
269
  ])),
268
270
  O("div", Ie, [
269
- A(fe)
271
+ A(de)
270
272
  ])
271
273
  ])) : I("", !0),
272
274
  (e == null ? void 0 : e.mode) === "view" ? (f(), C("div", Ne, [
273
- (f(), Z(be, {
275
+ (f(), Z(pe, {
274
276
  content: h.value,
275
277
  onChange: c,
276
- jsonContents: b.value,
277
- key: p.value
278
+ jsonContents: p.value,
279
+ key: b.value
278
280
  }, null, 8, ["content", "jsonContents"]))
279
281
  ])) : I("", !0)
280
282
  ]);
281
283
  };
282
284
  }
283
- }, Je = /* @__PURE__ */ ne(Te, [["__scopeId", "data-v-b25bde75"]]);
285
+ }, Ee = /* @__PURE__ */ ne(Te, [["__scopeId", "data-v-b25bde75"]]);
284
286
  export {
285
- Je as default
287
+ Ee as default
286
288
  };