ss-component-new 1.1.95 → 1.1.97

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,790 @@
1
+ import { ref as U, onMounted as ye, createElementBlock as v, openBlock as N, Fragment as ue, renderList as pe, createElementVNode as K, createCommentVNode as R, toDisplayString as te, watch as q, createVNode as V, unref as H, createBlock as se, resolveDynamicComponent as ge } from "vue";
2
+ import { v as Q, d as z, p as X, u as Ce, f as ke, i as be, e as Ae, g as $e, m as _e, a as De, b as Te, c as je } from "./array-D_h0zy8t.js";
3
+ import { u as me } from "./modelComp-B3sxj_Kp.js";
4
+ import { u as he, s as Z } from "./menu-BIINB-0Y.js";
5
+ import xe from "./index-ZB1vhOqY.js";
6
+ import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ import { c as r } from "./cloneDeep-Dy0swtEJ.js";
8
+ const Oe = { class: "bread-content" }, we = ["onClick"], Me = { key: 0 }, Ee = {
9
+ __name: "index",
10
+ props: {
11
+ breadArray: {
12
+ type: Array,
13
+ default: () => []
14
+ }
15
+ },
16
+ emits: ["click"],
17
+ setup(l, { emit: s }) {
18
+ const t = l, e = U([]), n = s;
19
+ ye(() => {
20
+ e.value = t == null ? void 0 : t.breadArray;
21
+ });
22
+ const c = (u) => {
23
+ n("click", u);
24
+ };
25
+ return (u, f) => (N(), v("div", Oe, [
26
+ (N(!0), v(ue, null, pe(e.value, (h, o) => (N(), v("div", {
27
+ key: o,
28
+ class: "bread-item"
29
+ }, [
30
+ K("div", {
31
+ class: "bread-title",
32
+ onClick: (a) => c(h)
33
+ }, te(h.value), 9, we),
34
+ o !== e.value.length - 1 ? (N(), v("div", Me, te("/"))) : R("", !0)
35
+ ]))), 128))
36
+ ]));
37
+ }
38
+ }, Ie = /* @__PURE__ */ re(Ee, [["__scopeId", "data-v-d55d3ede"]]);
39
+ function Se(l) {
40
+ var e, n, c, u;
41
+ const s = (n = (e = l[0]) == null ? void 0 : e.compData) == null ? void 0 : n.filter((f) => f.key !== "formContent"), t = (u = (c = l[0]) == null ? void 0 : c.compData) == null ? void 0 : u.filter((f) => f.key === "formContent");
42
+ console.log("handleFormModel:", s, t, l);
43
+ }
44
+ const Y = U(0), Ne = (l) => {
45
+ let s;
46
+ l.includes(`\r
47
+ `) ? s = l.split(`\r
48
+ `).filter((n) => n.trim() !== "") : s = l.split(`
49
+ `).filter((n) => n.trim() !== "");
50
+ const t = [];
51
+ let e = "";
52
+ for (const n of s)
53
+ n.includes("{") || e.includes("{") || n.includes("[") || e.includes("[") || n.includes("【") || e.includes("【") || n.includes("(") || e.includes("(") || n.includes("(") || e.includes("(") || n.includes("/*") || e.includes("/*") ? (e += n.trim(), r(e).split("{").length - 1 === r(e).split("}").length - 1 && r(e).split("【").length - 1 === r(e).split("】").length - 1 && r(e).split("[").length - 1 === r(e).split("]").length - 1 && r(e).split("(").length - 1 === r(e).split(")").length - 1 && r(e).split("(").length - 1 === r(e).split(")").length - 1 && r(e).split("/*").length - 1 === r(e).split("*/").length - 1 && (t.push(e), e = "")) : t.push(n.trim());
54
+ return t;
55
+ }, Ue = (l) => {
56
+ const [s, t] = l.split(/=(.+)/), e = s.replace(/['"]/g, "").trim(), n = t.replace(/^['"]|['"]$/g, "");
57
+ return { key: e, value: n };
58
+ }, ee = (l) => {
59
+ try {
60
+ return JSON.parse(l), !0;
61
+ } catch {
62
+ return !1;
63
+ }
64
+ }, ve = (l) => l.includes("$") && l.trim().endsWith("(") ? l + ")" : l, Pe = (l) => {
65
+ let s = l;
66
+ const t = [];
67
+ let e = "";
68
+ for (const n of s)
69
+ n.includes("{") || e.includes("{") || n.includes("[") || e.includes("[") || n.includes("【") || e.includes("【") || n.includes("(") || e.includes("(") || n.includes("(") || e.includes("(") || n.includes("/*") || e.includes("/*") ? (e += n.trim(), r(e).split("{").length - 1 === r(e).split("}").length - 1 && r(e).split("【").length - 1 === r(e).split("】").length - 1 && r(e).split("[").length - 1 === r(e).split("]").length - 1 && r(e).split("(").length - 1 === r(e).split(")").length - 1 && r(e).split("(").length - 1 === r(e).split(")").length - 1 && r(e).split("/*").length - 1 === r(e).split("*/").length - 1 && (t.push(e), e = "")) : t.push(n.trim());
70
+ return t == null ? void 0 : t.filter((n) => n.includes("{"));
71
+ }, Je = (l) => {
72
+ var t;
73
+ let s = [];
74
+ return (t = Pe(l.slice(1, -1))) == null || t.forEach((e) => {
75
+ var c, u, f, h;
76
+ let n = ((u = (c = e.slice(1, -1)) == null ? void 0 : c.split(",")) == null ? void 0 : u.length) ?? 1;
77
+ (h = (f = e.slice(1, -1)) == null ? void 0 : f.split(",")) == null || h.forEach((o) => {
78
+ var E, y, T, C, A, w, x, I, S, i, g, m, d;
79
+ let a = o == null ? void 0 : o.split(":"), j = a != null && a[0] ? (a == null ? void 0 : a[1].split("$").length) - 1 === 1 ? ((E = a == null ? void 0 : a[0]) == null ? void 0 : E.replace(/^"(.*)"$/, "$1")) + ((y = a == null ? void 0 : a[1]) == null ? void 0 : y.replace(/^"(.*)"$/, "$1")) : Array.isArray((C = (T = a == null ? void 0 : a[1]) == null ? void 0 : T.replace(/^"(.*)"$/, "$1")) == null ? void 0 : C.split("(")) && ((x = (w = (A = a == null ? void 0 : a[1]) == null ? void 0 : A.replace(/^"(.*)"$/, "$1")) == null ? void 0 : w.split("(")) == null ? void 0 : x.length) > 1 ? ((I = a == null ? void 0 : a[0]) == null ? void 0 : I.replace(/^"(.*)"$/, "$1")) + ((g = (i = (S = a == null ? void 0 : a[1]) == null ? void 0 : S.replace(/^"(.*)"$/, "$1")) == null ? void 0 : i.split("(")) == null ? void 0 : g[0]) + "()" : (m = a == null ? void 0 : a[0]) == null ? void 0 : m.replace(/^"(.*)"$/, "$1") : "", b = (a == null ? void 0 : a[1].split("$").length) - 1 === 0 ? (d = a == null ? void 0 : a[1]) == null ? void 0 : d.replace(/^"(.*)"$/, "$1") : "";
80
+ Y.value++, s.push({
81
+ id: Y.value,
82
+ key: j,
83
+ value: b,
84
+ // 如果值为空,则key设为空字符串,否则保留原值
85
+ width: n,
86
+ extraContent: a == null ? void 0 : a[1]
87
+ });
88
+ });
89
+ }), s;
90
+ }, de = (l) => {
91
+ var s, t;
92
+ try {
93
+ const e = l.replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",").replace(/:/g, ":").replace(/:\s*(?=,|}|$)/g, ': ""');
94
+ if (r(e).split("{").length - 1 > 1) {
95
+ let n = r(e).replace(/^\{(.*)\}$/, "[$1]");
96
+ if (ee(n) && !n.includes("$") || (n = n.replace(/"([^"]+)"\$([\w\u4e00-\u9fa5]+\([^)]*\))/g, '"$1$$$2"')), ee(n)) {
97
+ const c = JSON.parse(n);
98
+ let u = [];
99
+ return c == null || c.forEach((f) => {
100
+ var h;
101
+ (h = Object.entries(r(f))) == null || h.forEach((o) => {
102
+ Y.value++, u.push({
103
+ id: Y.value,
104
+ key: (o == null ? void 0 : o[0]) ?? "",
105
+ value: (o == null ? void 0 : o[1]) === "" ? "" : o == null ? void 0 : o[1],
106
+ // 如果值为空,则key设为空字符串,否则保留原值
107
+ width: Object.keys(r(f)).length
108
+ });
109
+ });
110
+ }), u;
111
+ } else
112
+ return e.trim().startsWith("{{") ? Je(e.trim()) : ne(n);
113
+ } else if (ee(e)) {
114
+ const n = JSON.parse(e);
115
+ return Object.entries(n).map(([c, u]) => (Y.value++, {
116
+ id: Y.value,
117
+ key: c,
118
+ value: u === "" ? "" : u,
119
+ // 如果值为空,则key设为空字符串,否则保留原值
120
+ width: 1
121
+ }));
122
+ } else
123
+ return ((s = ne(e)) == null ? void 0 : s.length) === 0 ? e : (t = ne(e)) == null ? void 0 : t.map((n) => ({
124
+ label: n.label,
125
+ method: ve(n.method)
126
+ }));
127
+ } catch (e) {
128
+ return console.error("转换失败:", e), [];
129
+ }
130
+ }, ne = (l) => {
131
+ l = l.trim().replace(/^\{|\}$/g, "").trim();
132
+ const s = [];
133
+ let t = 0;
134
+ for (; t < l.length; ) {
135
+ const e = l.slice(t).match(/^\s*"([^"]+)"\s*:\s*/);
136
+ if (!e) break;
137
+ const n = e[1];
138
+ t += e[0].length;
139
+ let c = "", u = 0, f = !1, h = "";
140
+ for (let o = t; o < l.length; o++) {
141
+ const a = l[o];
142
+ if ((a === '"' || a === "'") && !f ? (f = !0, h = a) : a === h && f && (f = !1, h = ""), !f && ((a === "{" || a === "(" || a === "[") && u++, (a === "}" || a === ")" || a === "]") && u--, a === "," && u === 0 || o === l.length - 1)) {
143
+ c = l.slice(t, o + 1).trim(), t = o + 1;
144
+ break;
145
+ }
146
+ }
147
+ s.push({
148
+ label: n,
149
+ method: c
150
+ });
151
+ }
152
+ return s;
153
+ }, Fe = (l, s) => {
154
+ var t;
155
+ try {
156
+ if ((t = Q) != null && t.find((e) => (e == null ? void 0 : e.key) === s))
157
+ return l.replace(/['"]/g, "").trim();
158
+ if (r(l).split("[").length - 1 > 1) {
159
+ const e = r(l).replace(/[’]|[‘]|[']/g, '"').replaceAll(/,/g, ",").replaceAll("(", "[").replaceAll(")", "]").replaceAll("],]", "]]");
160
+ return JSON.parse(e);
161
+ } else {
162
+ const e = r(l).replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",");
163
+ if (ee(e)) {
164
+ const n = JSON.parse(e);
165
+ return Array.isArray(n) ? n.map((c) => ({ label: c })) : n;
166
+ } else
167
+ return de(r(l));
168
+ }
169
+ } catch (e) {
170
+ return console.error("解析失败:", e), l;
171
+ }
172
+ }, Le = (l) => ({ [l == null ? void 0 : l.key]: Fe(l == null ? void 0 : l.value, l == null ? void 0 : l.key) }), Be = (l) => {
173
+ try {
174
+ if (r(l).split("[").length - 1 > 1) {
175
+ const s = r(l).replace(/[’]|[‘]|[']/g, '"').replaceAll(/,/g, ",").replaceAll("(", "[").replaceAll(")", "]").replaceAll("],]", "]]");
176
+ return JSON.parse(s);
177
+ } else
178
+ return JSON.parse(r(l).replace(/[’]|[‘]|[']/g, '"').replace(/,/g, ",")).map((t) => ({ label: t }));
179
+ } catch (s) {
180
+ return console.error("解析失败:", s), l;
181
+ }
182
+ }, Ge = (l) => {
183
+ const s = l.match(/\(([^)]+)\)/);
184
+ return s ? s[1] : "";
185
+ }, We = (l) => {
186
+ const s = l.match(/^([^(]+)\s*\(/);
187
+ return s ? s[1].trim() : l;
188
+ }, oe = (l) => l.replace(/'/g, "").replace(/"/g, "").replace(/{|}/g, "").split(":").map((s) => s.trim()).filter((s) => s).join("/"), Re = (l) => {
189
+ var u, f;
190
+ let s = [], t = [];
191
+ const e = (u = r(l)) == null ? void 0 : u.map((h) => h == null ? void 0 : h.key), n = [...new Set((f = r(e)) == null ? void 0 : f.map((h) => Ge(h)))];
192
+ n == null || n.forEach((h) => {
193
+ let o = l == null ? void 0 : l.filter((b) => b.key.includes(h));
194
+ o == null || o.forEach((b) => {
195
+ b != null && b.key.includes("Menus") && (s.push({
196
+ key: "GroupName",
197
+ value: oe(b == null ? void 0 : b.value)
198
+ }), t.push(oe(b == null ? void 0 : b.value)));
199
+ });
200
+ let a = l == null ? void 0 : l.filter((b) => b.key.includes(h) && !(b != null && b.key.includes("Menus")));
201
+ a = a == null ? void 0 : a.map((b) => (b.key = We(b.key), b));
202
+ const j = {
203
+ key: "GroupContents",
204
+ value: a
205
+ };
206
+ s.push(j);
207
+ });
208
+ const c = {
209
+ key: "Menus",
210
+ value: t
211
+ };
212
+ return s.unshift(c), s;
213
+ }, fe = (l) => {
214
+ var s, t;
215
+ if (Array.isArray(Object.keys(l)) && ((s = Object.keys(l)) == null ? void 0 : s.length) > 0) {
216
+ let e = [];
217
+ return (t = Object.entries(l)) == null || t.forEach(([n, c]) => {
218
+ var f, h;
219
+ let u = [];
220
+ if (u.push(n), ((f = Object.keys(c)) == null ? void 0 : f.length) > 0) {
221
+ let o = [];
222
+ o.push((h = fe(c)) == null ? void 0 : h[0]), u.push(o == null ? void 0 : o[0]);
223
+ }
224
+ e.push(u);
225
+ }), e;
226
+ }
227
+ }, He = (l, s) => {
228
+ var e;
229
+ let t = s;
230
+ return Array.isArray(Object.keys(l)) && ((e = Object.entries(l)) == null || e.forEach(([n, c]) => {
231
+ let u = [n];
232
+ if (typeof c == "object" && c !== null) {
233
+ let f = fe(c);
234
+ f == null || f.forEach((h) => {
235
+ u.push(h);
236
+ });
237
+ }
238
+ t.push(u);
239
+ })), t;
240
+ }, Ke = (l) => {
241
+ const s = {};
242
+ return l.forEach((e) => {
243
+ const n = e.split("/");
244
+ let c = s;
245
+ n.forEach((u) => {
246
+ c[u] || (c[u] = {}), c = c[u];
247
+ });
248
+ }), He(s, []);
249
+ }, Ye = (l) => Ke(l), ie = (l) => {
250
+ var s, t, e, n, c, u, f, h;
251
+ try {
252
+ const o = Ne((t = (s = r(l)) == null ? void 0 : s.replace("(", "(")) == null ? void 0 : t.replace(")", ")")), a = (n = (e = r(o)) == null ? void 0 : e.filter((y) => !y.includes("/*"))) == null ? void 0 : n.map((y) => Ue(y)), j = Re(a), b = [];
253
+ if (((c = j == null ? void 0 : j.find((y) => (y == null ? void 0 : y.key) === "Menus")) == null ? void 0 : c.value.length) === 0)
254
+ return !1;
255
+ (u = r(j)) == null || u.forEach((y) => {
256
+ var T, C, A, w, x, I, S, i, g;
257
+ (T = Q) != null && T.find((m) => {
258
+ var d, p;
259
+ return ((d = m == null ? void 0 : m.key) == null ? void 0 : d.toUpperCase()) === ((p = y == null ? void 0 : y.key) == null ? void 0 : p.toUpperCase());
260
+ }) ? b.push({
261
+ comp: ((A = (C = Q) == null ? void 0 : C.find((m) => {
262
+ var d, p;
263
+ return ((d = m == null ? void 0 : m.key) == null ? void 0 : d.toUpperCase()) === ((p = y == null ? void 0 : y.key) == null ? void 0 : p.toUpperCase());
264
+ })) == null ? void 0 : A.value) ?? "",
265
+ name: (w = y == null ? void 0 : y.value) == null ? void 0 : w.replace(/[’]|[‘]|[']/g, ""),
266
+ compData: []
267
+ }) : (x = z) != null && x.find((m) => {
268
+ var d, p;
269
+ return ((d = m == null ? void 0 : m.key) == null ? void 0 : d.toUpperCase()) === ((p = y == null ? void 0 : y.key) == null ? void 0 : p.toUpperCase());
270
+ }) && ((b == null ? void 0 : b.length) === 0 && (I = y.key) != null && I.includes("Menus") && b.push({
271
+ comp: "Menu",
272
+ name: "",
273
+ compData: []
274
+ }), (S = b == null ? void 0 : b[(b == null ? void 0 : b.length) - 1]) != null && S.compData && b[(b == null ? void 0 : b.length) - 1].compData.push({
275
+ key: (g = (i = z) == null ? void 0 : i.find((m) => {
276
+ var d, p;
277
+ return ((d = m == null ? void 0 : m.key) == null ? void 0 : d.toUpperCase()) === ((p = y == null ? void 0 : y.key) == null ? void 0 : p.toUpperCase());
278
+ })) == null ? void 0 : g.value,
279
+ contents: y == null ? void 0 : y.value
280
+ }));
281
+ });
282
+ let E = (f = r(b)) == null ? void 0 : f.map((y) => {
283
+ var T;
284
+ return y != null && y.compData && (y.compData = (T = y == null ? void 0 : y.compData) == null ? void 0 : T.map((C) => {
285
+ var A, w, x, I, S, i, g, m, d, p, k;
286
+ if ((C == null ? void 0 : C.key) === "formFlex")
287
+ C.contents = ((w = (A = C.contents) == null ? void 0 : A.replace(/[’]|[‘]|[']/g, "")) == null ? void 0 : w.toUpperCase()) !== "Vertical".toUpperCase();
288
+ else if ((C == null ? void 0 : C.key) === "groupContents")
289
+ C.contents = (x = r(C.contents)) == null ? void 0 : x.map(($) => Le(r($)));
290
+ else if (Array.isArray(C == null ? void 0 : C.contents))
291
+ C.contents = Ye(C.contents);
292
+ else if (((S = (I = C == null ? void 0 : C.contents) == null ? void 0 : I.trim()) != null && S.startsWith("[") || (g = (i = C.contents) == null ? void 0 : i.trim()) != null && g.startsWith("【")) && ((d = (m = C.contents) == null ? void 0 : m.trim()) != null && d.endsWith("]") || (k = (p = C.contents) == null ? void 0 : p.trim()) != null && k.endsWith("】")))
293
+ C.contents = Be(r(C.contents));
294
+ else {
295
+ if (!C.contents) return;
296
+ C.contents = de(r(C.contents));
297
+ }
298
+ return C;
299
+ })), y;
300
+ });
301
+ return E = (h = r(E)) == null ? void 0 : h.map((y) => {
302
+ var T;
303
+ return (y == null ? void 0 : y.comp) === "Group" && (y.compData = (T = y.compData) == null ? void 0 : T.map((C) => {
304
+ var w;
305
+ let A = [];
306
+ return (w = C.contents) == null || w.forEach((x) => {
307
+ var I, S, i, g, m, d, p, k, $, D, O, _, J, B, G, W, ce;
308
+ if ((I = Q) != null && I.find((M) => {
309
+ var P, F, L;
310
+ return ((P = M == null ? void 0 : M.key) == null ? void 0 : P.toUpperCase()) === ((L = (F = Object.keys(x)) == null ? void 0 : F[0]) == null ? void 0 : L.toUpperCase());
311
+ }))
312
+ A.push({
313
+ comp: (i = (S = Q) == null ? void 0 : S.find((M) => {
314
+ var P, F, L;
315
+ return ((P = M == null ? void 0 : M.key) == null ? void 0 : P.toUpperCase()) === ((L = (F = Object.keys(x)) == null ? void 0 : F[0]) == null ? void 0 : L.toUpperCase());
316
+ })) == null ? void 0 : i.value,
317
+ name: (m = (g = Object.values(x)) == null ? void 0 : g[0]) == null ? void 0 : m.replace(/[’]|[‘]|[']/g, ""),
318
+ compData: []
319
+ });
320
+ else if ((d = z) != null && d.find((M) => {
321
+ var P, F, L;
322
+ return ((P = M == null ? void 0 : M.key) == null ? void 0 : P.toUpperCase()) === ((L = (F = Object.keys(x)) == null ? void 0 : F[0]) == null ? void 0 : L.toUpperCase());
323
+ })) {
324
+ if ((A == null ? void 0 : A.length) === 0) return;
325
+ (p = A == null ? void 0 : A[(A == null ? void 0 : A.length) - 1]) != null && p.compData && A[(A == null ? void 0 : A.length) - 1].compData.push({
326
+ key: ($ = (k = z) == null ? void 0 : k.find((M) => {
327
+ var P, F, L;
328
+ return ((P = M == null ? void 0 : M.key) == null ? void 0 : P.toUpperCase()) === ((L = (F = Object.keys(x)) == null ? void 0 : F[0]) == null ? void 0 : L.toUpperCase());
329
+ })) == null ? void 0 : $.value,
330
+ contents: (D = Object.values(x)) == null ? void 0 : D[0]
331
+ });
332
+ } else if ((_ = (O = Object.keys(x)) == null ? void 0 : O[0]) != null && _.includes("$")) {
333
+ const M = (B = (J = Object.keys(r(x))) == null ? void 0 : J[0]) == null ? void 0 : B.split("$");
334
+ A[(A == null ? void 0 : A.length) - 1].compData.push({
335
+ key: (W = (G = z) == null ? void 0 : G.find((P) => {
336
+ var F, L;
337
+ return ((F = P == null ? void 0 : P.key) == null ? void 0 : F.toUpperCase()) === ((L = M == null ? void 0 : M[0]) == null ? void 0 : L.toUpperCase());
338
+ })) == null ? void 0 : W.value,
339
+ contents: (ce = Object.values(x)) == null ? void 0 : ce[0],
340
+ selectLabel: M == null ? void 0 : M[1]
341
+ });
342
+ }
343
+ return x;
344
+ }), C.contents = A, C;
345
+ })), y;
346
+ }), E;
347
+ } catch {
348
+ return !1;
349
+ }
350
+ }, le = [
351
+ {
352
+ key: "Method",
353
+ value: "method"
354
+ },
355
+ {
356
+ key: "Procedure",
357
+ value: "procedure"
358
+ }
359
+ ], qe = (l) => {
360
+ let s;
361
+ l.includes(`\r
362
+ `) ? s = l.split(`\r
363
+ `).filter((n) => n.trim() !== "") : s = l.split(`
364
+ `).filter((n) => n.trim() !== "");
365
+ const t = [];
366
+ let e = "";
367
+ for (const n of s)
368
+ n.includes("{") || e.includes("{") || n.includes("[") || e.includes("[") || n.includes("【") || e.includes("【") || n.includes("(") || e.includes("(") || n.includes("(") || e.includes("(") || n.includes("/*") || e.includes("/*") ? (e += n.trim(), r(e).split("{").length - 1 === r(e).split("}").length - 1 && r(e).split("【").length - 1 === r(e).split("】").length - 1 && r(e).split("[").length - 1 === r(e).split("]").length - 1 && r(e).split("(").length - 1 === r(e).split(")").length - 1 && r(e).split("(").length - 1 === r(e).split(")").length - 1 && r(e).split("/*").length - 1 === r(e).split("*/").length - 1 && (t.push(e.replace(/\/\*[\s\S]*?\*\//g, "")), e = "")) : t.push(n.trim().replace(/\/\*[\s\S]*?\*\//g, ""));
369
+ return t;
370
+ }, ze = (l) => {
371
+ const [s, t] = l.split(/=(.+)/), e = s.replace(/['"]/g, "").trim(), n = t.replace(/^['"]|['"]$/g, "");
372
+ return { key: e, value: n };
373
+ }, Qe = (l) => {
374
+ const s = l.indexOf("("), t = l.lastIndexOf(")");
375
+ return s === -1 || t === -1 || s > t ? null : l.slice(s + 1, t);
376
+ }, Xe = (l) => {
377
+ var n, c, u, f, h, o;
378
+ const t = l.trim().split(":").slice(0, -1).join(":").trim(), e = t.slice(1, t.length).replaceAll(":", ":");
379
+ return ((n = e == null ? void 0 : e.split(":")) == null ? void 0 : n.length) <= 2 ? e.includes("[") ? (f = (u = e.replaceAll(",", ":").replaceAll("[", ":").replaceAll("]", ":").slice(1, e.length - 1).split(":")) == null ? void 0 : u.map((j) => j.trim().replace(/^'|'$/g, ""))) == null ? void 0 : f.filter((j) => j !== "") : (c = e.slice(1, e.length - 1).split(":")) == null ? void 0 : c.map((a) => a.trim().replace(/^'|'$/g, "")) : (o = (h = e.replace(/[,{}()\[\]!&]/g, ":").slice(1, e.length - 1).split(":")) == null ? void 0 : h.map((j) => j.trim().replace(/^'|'$/g, ""))) == null ? void 0 : o.filter((j) => j !== "");
380
+ }, Ze = (l) => {
381
+ const s = r(l);
382
+ let t = [];
383
+ return s == null || s.map((e) => {
384
+ var c, u;
385
+ const n = (u = (c = e.trim().slice(1, e.trim().length - 1).split("}")) == null ? void 0 : c.filter((f) => f !== "")) == null ? void 0 : u.map((f) => f.replaceAll(",{", "").replaceAll("{", ""));
386
+ n == null || n.map((f) => {
387
+ var o;
388
+ let h = [];
389
+ (o = f.replaceAll(":", ",").replaceAll("[", ",").replaceAll("]", ",").replaceAll(":", ",").split(",").filter((a) => a !== "")) == null || o.forEach((a) => {
390
+ a.trim() !== "" && h.push(a.trim().replace(/^'|'$/g, ""));
391
+ }), t.push(h);
392
+ });
393
+ }), t;
394
+ }, Ve = (l) => {
395
+ var u, f, h, o, a, j, b, E, y, T, C, A, w, x, I, S, i, g, m, d, p;
396
+ const s = (o = (h = (f = (u = r(l)) == null ? void 0 : u[0]) == null ? void 0 : f.key.split("(")) == null ? void 0 : h[0]) == null ? void 0 : o.trim();
397
+ let t = "", e = "";
398
+ if (!((b = (j = (a = r(l)) == null ? void 0 : a[0]) == null ? void 0 : j.key) != null && b.includes("{")))
399
+ t = ((T = (y = (E = r(l)) == null ? void 0 : E[0]) == null ? void 0 : y.key.match(/\(([^)]+)\)/)) == null ? void 0 : T[1]) ?? "", e = "";
400
+ else {
401
+ const k = ((w = (A = (C = r(l)) == null ? void 0 : C[0]) == null ? void 0 : A.key.match(/\{([^{}]*)\}/)) == null ? void 0 : w[1]) ?? "", $ = Qe((I = (x = r(l)) == null ? void 0 : x[0]) == null ? void 0 : I.key);
402
+ t = (((S = k.match(/\(([^)]+)\)/)) == null ? void 0 : S[1]) ?? "").trim() + "(" + ((i = k.split(":")) == null ? void 0 : i[1].trim()) + ")", e = $.replace(k, "").replace(/^(\{\}|\[.*?\]):\s*/, "").replace(/(:\s*|>\s*)/g, "/");
403
+ }
404
+ const n = Xe((d = (m = (g = r(l)) == null ? void 0 : g.filter((k) => !k.key.includes("["))) == null ? void 0 : m[0]) == null ? void 0 : d.value), c = Ze((p = r(l)) == null ? void 0 : p.filter((k) => k.key.includes("[")).map((k) => k.value));
405
+ return {
406
+ type: s,
407
+ systemName: t,
408
+ tablePath: e,
409
+ tableColumn: n,
410
+ tableContents: c
411
+ };
412
+ }, et = (l) => {
413
+ let s = l == null ? void 0 : l.map((n) => {
414
+ var u, f;
415
+ return (f = (u = n == null ? void 0 : n.key.split("(")) == null ? void 0 : u[0]) == null ? void 0 : f.trim();
416
+ }), t = [...new Set(s)], e = [];
417
+ return t == null || t.forEach((n) => {
418
+ var c;
419
+ if (!(le != null && le.find((u) => (u == null ? void 0 : u.key) === n))) {
420
+ const u = (c = r(l)) == null ? void 0 : c.filter((f) => {
421
+ var h, o;
422
+ return (o = (h = f.key.split("(")) == null ? void 0 : h[0]) == null ? void 0 : o.trim().includes(n);
423
+ });
424
+ e.push(Ve(u));
425
+ }
426
+ }), e;
427
+ }, tt = (l) => {
428
+ var s, t, e, n, c;
429
+ try {
430
+ const u = (e = qe((t = (s = r(l)) == null ? void 0 : s.replace("(", "(")) == null ? void 0 : t.replace(")", ")"))) == null ? void 0 : e.filter((o) => o !== ""), f = (c = (n = r(u)) == null ? void 0 : n.filter((o) => !o.includes("/*"))) == null ? void 0 : c.map((o) => ze(o));
431
+ return et(f);
432
+ } catch {
433
+ return !1;
434
+ }
435
+ }, ae = U([]), nt = (l) => {
436
+ var s, t;
437
+ if (l.length === 1)
438
+ return (s = r(l)) != null && s[0].find((e) => (e == null ? void 0 : e.comp) === "Menu") ? l[0] : [];
439
+ {
440
+ let e = [];
441
+ return (t = r(l)) == null || t.forEach((n) => {
442
+ n != null && n.find((c) => (c == null ? void 0 : c.comp) === "Menu") ? e = n : ae.value = n;
443
+ }), e == null || e.map((n) => (n.comp === "Group" && (n.compData = lt(n.compData)), n)), e;
444
+ }
445
+ }, lt = (l) => l == null ? void 0 : l.map((t) => {
446
+ var e;
447
+ return t.contents = (e = t.contents) == null ? void 0 : e.map((n) => (n.comp === "Form" ? n.compData = rt(n.compData) : n.comp === "Table" && (n.compData = st(n.compData)), n)), t;
448
+ }), st = (l) => {
449
+ var t;
450
+ const s = [];
451
+ return (t = r(l)) == null || t.forEach((e) => {
452
+ var n, c, u, f, h;
453
+ if ((e == null ? void 0 : e.key) === "tableContents")
454
+ if (e.contents.includes("$")) {
455
+ const o = (n = r(e.contents).trim().replaceAll("$", "").split("(")) == null ? void 0 : n[0], a = (u = (c = r(e.contents).trim().replaceAll("$", "").split("(")) == null ? void 0 : c[1].split(")")) == null ? void 0 : u[0].replace(/^"|"$/g, ""), j = (f = ae.value) == null ? void 0 : f.find((E) => E.type === o && E.systemName === a), b = (h = j.tableColumn) == null ? void 0 : h.map((E) => ({
456
+ label: E
457
+ }));
458
+ s.push({
459
+ key: "header",
460
+ contents: b
461
+ }), s.push({
462
+ key: "tableContents",
463
+ contents: j.tableContents
464
+ });
465
+ } else
466
+ s.push(e);
467
+ else
468
+ s.push(e);
469
+ }), s;
470
+ }, rt = (l) => {
471
+ var t;
472
+ return (t = r(l)) == null ? void 0 : t.map((e) => {
473
+ var n;
474
+ return e.key === "formContent" && (e.contents = (n = e.contents) == null ? void 0 : n.map((c) => {
475
+ var u, f, h, o, a, j, b, E, y, T, C, A;
476
+ if (c.extraContent.includes("($")) {
477
+ const w = (f = (u = c.extraContent) == null ? void 0 : u.split("($")) == null ? void 0 : f[1], x = (h = w.split("(")) == null ? void 0 : h[0], I = (j = (a = (o = w.split("(")) == null ? void 0 : o[1]) == null ? void 0 : a.split(")")) == null ? void 0 : j[0].replace(/^"|"$/g, ""), S = (b = w.match(/\["([^"]+)"\]/)) == null ? void 0 : b[1], i = (E = ae.value) == null ? void 0 : E.find((D) => D.type === x && D.systemName === I), g = (y = i.tableColumn) == null ? void 0 : y.findIndex((D) => D === S), m = (T = i.tableContents) == null ? void 0 : T.map((D) => D[g]);
478
+ let d = "";
479
+ const p = [...new Set(m)];
480
+ (C = r(p)) == null || C.forEach((D) => {
481
+ d = d === "" ? d + D : d + "," + D;
482
+ });
483
+ let k = r(c.key);
484
+ c.key = ((A = k == null ? void 0 : k.split("(")) == null ? void 0 : A[0]) + "(" + d + ")";
485
+ let $ = p[0];
486
+ c.value = $;
487
+ }
488
+ return c;
489
+ })), e;
490
+ });
491
+ }, at = { class: "system-wrap" }, ct = {
492
+ key: 0,
493
+ class: "show-content"
494
+ }, ot = {
495
+ key: 0,
496
+ class: "item-menu-content"
497
+ }, it = {
498
+ key: 0,
499
+ class: "item-view-group"
500
+ }, ut = {
501
+ __name: "index",
502
+ props: {
503
+ content: String,
504
+ jsonContents: Array
505
+ },
506
+ emits: ["change", "contentChange"],
507
+ setup(l, { emit: s }) {
508
+ const t = l, e = s, n = me(X);
509
+ Ce(X);
510
+ const c = U(!0), u = he(), f = U(!0), { itemData: h } = Z(n), o = ke(X), { activeMenuPath: a, activeMenuOpenPaths: j, menuTriggerType: b, menus: E } = Z(u), { selectIndex: y, selectTitle: T } = Z(o), C = U([]), A = U([]), w = (i) => {
511
+ var m, d, p;
512
+ const g = (m = h.value) == null ? void 0 : m.find((k) => k.name === a.value);
513
+ A.value = (p = (d = g == null ? void 0 : g.compData) == null ? void 0 : d[0]) == null ? void 0 : p.contents, f.value = !0, f.value && (f.value = !1), e("change", {
514
+ wholeValue: C.value,
515
+ editValue: i
516
+ });
517
+ }, x = (i) => {
518
+ var $, D, O;
519
+ const g = r(C.value), m = g == null ? void 0 : g.map((_, J) => (J === (i == null ? void 0 : i.index) && (_.compData = i == null ? void 0 : i.contents), _));
520
+ let d = "";
521
+ (D = ($ = r(m)) == null ? void 0 : $.filter((_) => (_ == null ? void 0 : _.comp) === "Form")) == null || D.forEach((_) => {
522
+ var J;
523
+ (J = _ == null ? void 0 : _.compData) == null || J.forEach((B) => {
524
+ var G;
525
+ (B == null ? void 0 : B.key) === "formContent" && ((G = B == null ? void 0 : B.contents) == null || G.forEach((W) => {
526
+ W.value !== "" && (d = d === "" ? W == null ? void 0 : W.value : d + "-" + (W == null ? void 0 : W.value));
527
+ }));
528
+ });
529
+ });
530
+ let p = T == null ? void 0 : T.value;
531
+ (p == null ? void 0 : p.length) > 0 ? p[0] = { key: "main", value: d } : (Array.isArray(p) || (p = []), p.push({ key: "main", value: d })), o.setSelectTitle(p), c.value = !1, C.value = m;
532
+ const k = (O = h.value) == null ? void 0 : O.map((_, J) => {
533
+ var B;
534
+ return _.name === a.value && (_.compData = (B = _.compData) == null ? void 0 : B.map((G) => ((G == null ? void 0 : G.key) === "groupContents" && (G.contents = C.value), G))), _;
535
+ });
536
+ n.setItemData(k), f.value && (f.value = !1), e("contentChange", {
537
+ wholeContent: h.value
538
+ });
539
+ }, I = (i) => {
540
+ var g, m;
541
+ if ((i == null ? void 0 : i.key) === "main")
542
+ o.setSelectIndex(""), o.setSelectMenu(""), o.setSelectTitle((g = T.value) == null ? void 0 : g[0]);
543
+ else {
544
+ const d = [];
545
+ let p = -1;
546
+ (m = T.value) == null || m.forEach((k, $) => {
547
+ (k == null ? void 0 : k.key) === (i == null ? void 0 : i.key) && (p = $), (p === -1 || p >= $) && d.push(k);
548
+ }), o.setSelectTitle(d), o.setSelectMenu(i == null ? void 0 : i.key);
549
+ }
550
+ };
551
+ q(
552
+ () => h.value,
553
+ () => {
554
+ var g, m, d, p, k, $, D, O;
555
+ if (!h.value || ((g = h.value) == null ? void 0 : g.length) === 0 || !c.value) return;
556
+ let i = null;
557
+ if (!a.value && Array.isArray(h.value))
558
+ i = (d = (m = r(h.value)) == null ? void 0 : m.filter((_) => (_ == null ? void 0 : _.comp) === "Group")) == null ? void 0 : d[0], u.setActiveMenuPath(i == null ? void 0 : i.name);
559
+ else if (Array.isArray(h.value)) {
560
+ const _ = (p = r(h.value)) == null ? void 0 : p.filter((J) => (J == null ? void 0 : J.comp) === "Group");
561
+ i = _ == null ? void 0 : _.find((J) => J.name === a.value);
562
+ }
563
+ A.value = ($ = (k = i == null ? void 0 : i.compData) == null ? void 0 : k[0]) == null ? void 0 : $.contents, C.value = (O = (D = i == null ? void 0 : i.compData) == null ? void 0 : D[0]) == null ? void 0 : O.contents, console.log("itemData监听", i, a.value, h.value);
564
+ },
565
+ { deep: !0, immediate: !0 }
566
+ ), q(() => a.value, (i) => {
567
+ var g, m, d, p, k, $;
568
+ if (i) {
569
+ const D = (g = r(h.value)) == null ? void 0 : g.find((O) => O.name === i);
570
+ if (i && D) {
571
+ A.value = (d = (m = D == null ? void 0 : D.compData) == null ? void 0 : m[0]) == null ? void 0 : d.contents, C.value = (k = (p = D == null ? void 0 : D.compData) == null ? void 0 : p[0]) == null ? void 0 : k.contents, console.log("点击-新-data:", i, A.value);
572
+ const O = ($ = A.value) == null ? void 0 : $.filter((_) => _.comp === "Form");
573
+ Se(O);
574
+ } else
575
+ A.value = [], C.value = [];
576
+ o.setSelectTitle([]), o.setSelectIndex(""), o.setSelectMenu("");
577
+ }
578
+ }, {
579
+ immediate: !0
580
+ }), q(
581
+ () => [t == null ? void 0 : t.content, t == null ? void 0 : t.jsonContents],
582
+ () => {
583
+ var p, k, $, D;
584
+ if (((p = t == null ? void 0 : t.jsonContents) == null ? void 0 : p.length) > 0) {
585
+ n.setOriginalData(t == null ? void 0 : t.jsonContents), n.setItemData(t == null ? void 0 : t.jsonContents);
586
+ return;
587
+ }
588
+ if (!(t != null && t.content) || ((k = t == null ? void 0 : t.content) == null ? void 0 : k.length) === 0) return;
589
+ c.value = !0;
590
+ let i, g = [];
591
+ (D = ($ = t == null ? void 0 : t.content) == null ? void 0 : $.filter((O) => O !== "")) == null || D.forEach((O) => {
592
+ be(O) ? g.push(Ae(O)) : ie(O) ? g.push(ie(O)) : g.push(tt(O));
593
+ }), i = nt(g);
594
+ const m = Array.isArray(i) && (i == null ? void 0 : i.find((O) => {
595
+ var _;
596
+ return ((_ = O.comp) == null ? void 0 : _.toUpperCase()) === "MENU";
597
+ }));
598
+ u.setRawMenu(m ?? {});
599
+ const d = Array.isArray(i) && (i == null ? void 0 : i.find((O) => {
600
+ var _;
601
+ return ((_ = O.comp) == null ? void 0 : _.toUpperCase()) === "SYSTEM";
602
+ }));
603
+ u.setSystemKey((d == null ? void 0 : d.name) ?? ""), n.setOriginalData(i), n.setItemData(i);
604
+ },
605
+ { deep: !0, immediate: !0 }
606
+ );
607
+ const S = (i) => $e(i);
608
+ return (i, g) => {
609
+ var m, d;
610
+ return N(), v("div", at, [
611
+ V(xe, { class: "sys-aside" }),
612
+ ((m = A.value) == null ? void 0 : m.length) > 0 ? (N(), v("div", ct, [
613
+ ((d = H(T)) == null ? void 0 : d.length) > 1 ? (N(), v("div", ot, [
614
+ (N(), se(Ie, {
615
+ key: H(T),
616
+ breadArray: H(T),
617
+ onClick: I
618
+ }, null, 8, ["breadArray"]))
619
+ ])) : R("", !0),
620
+ (N(!0), v(ue, null, pe(A.value, (p, k) => (N(), v("div", {
621
+ class: "item-content",
622
+ key: k
623
+ }, [
624
+ H(y) === "" || k.toString() === H(y) ? (N(), v("div", it, te(p.name), 1)) : R("", !0),
625
+ H(y) === "" || k.toString() === H(y) ? (N(), se(ge(S(p.comp)), {
626
+ itemData: p == null ? void 0 : p.compData,
627
+ childItemData: p == null ? void 0 : p.itemChildData,
628
+ key: k,
629
+ onChange: w,
630
+ index: k,
631
+ onContentChange: x
632
+ }, null, 40, ["itemData", "childItemData", "index"])) : R("", !0)
633
+ ]))), 128))
634
+ ])) : R("", !0)
635
+ ]);
636
+ };
637
+ }
638
+ }, pt = /* @__PURE__ */ re(ut, [["__scopeId", "data-v-a5b0b3eb"]]), mt = { class: "add-model-content" }, ht = {
639
+ key: 0,
640
+ class: "model-import-data"
641
+ }, dt = { class: "import-button" }, ft = { key: 0 }, yt = {
642
+ key: 1,
643
+ class: "model-operate"
644
+ }, gt = { class: "model-select" }, Ct = { class: "model-fill" }, kt = {
645
+ key: 2,
646
+ class: "model-view"
647
+ }, bt = {
648
+ __name: "index",
649
+ props: {
650
+ mode: {
651
+ type: String,
652
+ default: "view"
653
+ },
654
+ content: {
655
+ type: String,
656
+ default: ""
657
+ },
658
+ jsonContents: {
659
+ type: Array,
660
+ default: () => []
661
+ },
662
+ showButton: {
663
+ type: Boolean,
664
+ default: !0
665
+ }
666
+ },
667
+ emits: ["change", "contentChange"],
668
+ setup(l, { emit: s }) {
669
+ const t = l, e = s, n = U([]), c = U([]), u = U([]), f = U(0), h = me(X), o = he(X), { itemData: a, originalData: j } = Z(h), { activeMenuPath: b } = Z(o), E = U(null), y = U(0), T = U([]), C = U(""), A = U(0), w = (g) => {
670
+ e("contentChange", g);
671
+ }, x = (g) => {
672
+ var d;
673
+ const m = (d = r(g == null ? void 0 : g.wholeValue)) == null ? void 0 : d.map((p) => {
674
+ var k;
675
+ return (p == null ? void 0 : p.comp) === "Form" && (p.compData = (k = p.compData) == null ? void 0 : k.map(($) => (($ == null ? void 0 : $.key) === "formContent" && ($.contents = je($ == null ? void 0 : $.contents)), $))), p;
676
+ });
677
+ e("change", {
678
+ originalContents: j.value,
679
+ currentContents: g == null ? void 0 : g.wholeValue,
680
+ editContent: g == null ? void 0 : g.editValue,
681
+ arrayToContents: m
682
+ });
683
+ };
684
+ q(
685
+ () => c.value,
686
+ () => {
687
+ A.value === c.value.length && c.value.length !== 0 && (n.value = c.value);
688
+ },
689
+ { deep: !0, immediate: !0 }
690
+ );
691
+ const I = () => {
692
+ E.value.click();
693
+ }, S = async (g) => {
694
+ const m = g.target.files;
695
+ if (!m) return;
696
+ new FileReader(), n.value = [], c.value = [], A.value = m.length;
697
+ const d = Array.from(m).map(async (p) => await new Promise((k) => {
698
+ const $ = new FileReader();
699
+ $.onload = (D) => {
700
+ try {
701
+ c.value.push(D.target.result), T.value = i(D.target.result), y.value++;
702
+ } catch (O) {
703
+ console.error("解析失败:", O);
704
+ return;
705
+ }
706
+ }, $.onerror = () => k(`读取 ${p.name} 失败`), $.readAsText(p);
707
+ }));
708
+ await Promise.all(d);
709
+ };
710
+ q(
711
+ () => [t == null ? void 0 : t.content, t == null ? void 0 : t.jsonContents],
712
+ () => {
713
+ n.value = t.content, u.value = t == null ? void 0 : t.jsonContents;
714
+ },
715
+ { deep: !0, immediate: !0 }
716
+ ), q(
717
+ () => y.value,
718
+ () => {
719
+ var g;
720
+ ((g = T.value) == null ? void 0 : g.length) !== 0 && (h.setOriginalData(T.value), h.setItemData(T.value));
721
+ },
722
+ { deep: !0, immediate: !0 }
723
+ );
724
+ const i = (g) => {
725
+ let m = g.replace(/,/g, ",").replace(/;/g, ";").replace(/:/g, ":");
726
+ m = m.replace(/(\w+)\s*:/g, "$1:"), m = m.replace(/\r\n/g, "").replace(/\n/g, "").replace(/\t/g, "").replace(/\s+/g, " ").trim(), m = m.replace(/,\s*([}\]])/g, "$1"), m = m.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g, ": $2$4");
727
+ try {
728
+ return JSON.parse(m);
729
+ } catch (d) {
730
+ try {
731
+ const k = new Function(`return ${m}`)();
732
+ if (Array.isArray(k) || typeof k == "object")
733
+ return k;
734
+ throw new Error(`解析结果不是有效的数组或对象: ${d}`);
735
+ } catch (p) {
736
+ throw new Error(`无法解析JSON: ${p.message}`);
737
+ }
738
+ }
739
+ };
740
+ return (g, m) => {
741
+ var d;
742
+ return N(), v("div", mt, [
743
+ ((d = t == null ? void 0 : t.jsonContents) == null ? void 0 : d.length) === 0 && (t != null && t.showButton) ? (N(), v("div", ht, [
744
+ K("div", dt, [
745
+ K("input", {
746
+ type: "file",
747
+ ref_key: "fileInput",
748
+ ref: E,
749
+ accept: ".txt, .inm",
750
+ onChange: S,
751
+ style: { display: "none" },
752
+ multiple: ""
753
+ }, null, 544),
754
+ K("button", {
755
+ onClick: I,
756
+ class: "import-button-content"
757
+ }, "导入文件"),
758
+ C.value ? (N(), v("span", ft, te(C.value), 1)) : R("", !0)
759
+ ])
760
+ ])) : R("", !0),
761
+ (t == null ? void 0 : t.mode) === "edit" ? (N(), v("div", yt, [
762
+ K("div", gt, [
763
+ V(_e)
764
+ ]),
765
+ (N(), v("div", {
766
+ class: "model-show",
767
+ key: f.value
768
+ }, [
769
+ V(De)
770
+ ])),
771
+ K("div", Ct, [
772
+ V(Te)
773
+ ])
774
+ ])) : R("", !0),
775
+ (t == null ? void 0 : t.mode) === "view" ? (N(), v("div", kt, [
776
+ (N(), se(pt, {
777
+ content: n.value,
778
+ onChange: x,
779
+ jsonContents: u.value,
780
+ onContentChange: w,
781
+ key: f.value
782
+ }, null, 8, ["content", "jsonContents"]))
783
+ ])) : R("", !0)
784
+ ]);
785
+ };
786
+ }
787
+ }, Ot = /* @__PURE__ */ re(bt, [["__scopeId", "data-v-00748fcb"]]);
788
+ export {
789
+ Ot as default
790
+ };