ss-component-new 1.1.87 → 1.1.89

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.
Files changed (41) hide show
  1. package/dist/array-DMmwiVeP.cjs +9 -0
  2. package/dist/array-XoXyYHwT.js +3354 -0
  3. package/dist/{cloneDeep-BpK0E_ef.js → cloneDeep-BNmbDv00.js} +1 -1
  4. package/dist/{cloneDeep-B3VC5L8Z.cjs → cloneDeep-DPVvcaHp.cjs} +1 -1
  5. package/dist/index-4EVOV-QJ.cjs +7 -0
  6. package/dist/{index-CQuV8YFa.js → index-B5Rq3XMZ.js} +2 -2
  7. package/dist/index-BCat-xG7.js +165 -0
  8. package/dist/{index-C6UYDisz.cjs → index-Bf_v25jY.cjs} +1 -1
  9. package/dist/{index-Dakgk1fr.js → index-C05xMHsm.js} +2 -2
  10. package/dist/index-CTpfNPrd.cjs +1 -0
  11. package/dist/index-CUhSPuUp.cjs +1 -0
  12. package/dist/index-CoC1Qlco.cjs +1 -0
  13. package/dist/{index-DZAs9vSe.cjs → index-CozHldDr.cjs} +1 -1
  14. package/dist/{index-CdxjVh-X.cjs → index-Ctx2gfUg.cjs} +1 -1
  15. package/dist/{index-nChhWjuh.js → index-TEDi8PFd.js} +7 -12
  16. package/dist/{index-CQvBB7B8.js → index-W1360Du0.js} +4 -5
  17. package/dist/{index-DtoLslf_.js → index-emAMfqsw.js} +1 -1
  18. package/dist/index-m5EvpgPM.js +953 -0
  19. package/dist/{main-BIsSHE8k.js → main-3srQVh7O.js} +27 -28
  20. package/dist/main-Do3EuI59.cjs +1 -0
  21. package/dist/ss-component.cjs +1 -1
  22. package/dist/ss-component.css +1 -1
  23. package/dist/ss-component.js +6 -6
  24. package/dist/ss-component2.cjs +1 -1
  25. package/dist/ss-component2.js +1 -1
  26. package/package.json +1 -1
  27. package/dist/array-C8gxudwq.js +0 -3233
  28. package/dist/array-q8pUBU30.cjs +0 -9
  29. package/dist/index-B-jDNH2e.cjs +0 -1
  30. package/dist/index-B7LUAJqu.cjs +0 -1
  31. package/dist/index-BLoamlbm.cjs +0 -1
  32. package/dist/index-BW-bmuq0.cjs +0 -1
  33. package/dist/index-Dc21Fkf9.js +0 -345
  34. package/dist/index-gsysGhDn.js +0 -26
  35. package/dist/index-iaj5xJUJ.js +0 -131
  36. package/dist/index-wRmYoZQa.cjs +0 -1
  37. package/dist/index.vue_vue_type_style_index_0_scoped_0d13cfeb_lang-Ce-Paygw.js +0 -618
  38. package/dist/index.vue_vue_type_style_index_0_scoped_0d13cfeb_lang-CwZAxgWm.cjs +0 -7
  39. package/dist/index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-B67eMpk2.js +0 -144
  40. package/dist/index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-CL3yi2CW.cjs +0 -1
  41. package/dist/main-C_3s_51_.cjs +0 -1
@@ -1,345 +0,0 @@
1
- import { ref as g, onMounted as te, createElementBlock as v, openBlock as m, Fragment as H, renderList as Q, createElementVNode as F, createCommentVNode as M, toDisplayString as R, watch as B, createVNode as O, unref as E, createBlock as W, resolveDynamicComponent as ae } from "vue";
2
- import { m as ne, a as oe, b as se } from "./index-iaj5xJUJ.js";
3
- import { p as J, u as le, b as re, i as ce, e as ue, g as ie, a as me } from "./array-C8gxudwq.js";
4
- import { u as X } from "./modelComp-B3sxj_Kp.js";
5
- import { u as Z, s as P } from "./menu-BIINB-0Y.js";
6
- import de from "./index-gsysGhDn.js";
7
- import { e as z, a as he } from "./index.vue_vue_type_style_index_0_scoped_0d13cfeb_lang-Ce-Paygw.js";
8
- import { _ as Y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
- import { c as N } from "./cloneDeep-BpK0E_ef.js";
10
- const ve = { class: "bread-content" }, fe = ["onClick"], ye = { key: 0 }, ge = {
11
- __name: "index",
12
- props: {
13
- breadArray: {
14
- type: Array,
15
- default: () => []
16
- }
17
- },
18
- emits: ["click"],
19
- setup(w, { emit: T }) {
20
- const e = w, k = g([]), h = T;
21
- te(() => {
22
- k.value = e == null ? void 0 : e.breadArray;
23
- });
24
- const f = (_) => {
25
- h("click", _);
26
- };
27
- return (_, p) => (m(), v("div", ve, [
28
- (m(!0), v(H, null, Q(k.value, (i, y) => (m(), v("div", {
29
- key: y,
30
- class: "bread-item"
31
- }, [
32
- F("div", {
33
- class: "bread-title",
34
- onClick: (x) => f(i)
35
- }, R(i.value), 9, fe),
36
- y !== k.value.length - 1 ? (m(), v("div", ye, R("/"))) : M("", !0)
37
- ]))), 128))
38
- ]));
39
- }
40
- }, _e = /* @__PURE__ */ Y(ge, [["__scopeId", "data-v-d55d3ede"]]);
41
- function pe(w) {
42
- var k, h, f, _;
43
- const T = (h = (k = w[0]) == null ? void 0 : k.compData) == null ? void 0 : h.filter((p) => p.key !== "formContent"), e = (_ = (f = w[0]) == null ? void 0 : f.compData) == null ? void 0 : _.filter((p) => p.key === "formContent");
44
- console.log("handleFormModel:", T, e, w);
45
- }
46
- const Ce = { class: "system-wrap" }, ke = {
47
- key: 0,
48
- class: "show-content"
49
- }, De = {
50
- key: 0,
51
- class: "item-menu-content"
52
- }, Se = {
53
- key: 0,
54
- class: "item-view-group"
55
- }, Ae = {
56
- __name: "index",
57
- props: {
58
- content: String,
59
- jsonContents: Array
60
- },
61
- emits: ["change", "contentChange"],
62
- setup(w, { emit: T }) {
63
- const e = w, k = T, h = X(J);
64
- le(J);
65
- const f = g(!0), _ = Z(), p = g(!0), { itemData: i } = P(h), y = re(J), { activeMenuPath: x, activeMenuOpenPaths: q, menuTriggerType: ee, menus: U } = P(_), { selectIndex: $, selectTitle: C } = P(y), A = g([]), D = g([]), G = (t) => {
66
- var o, s, a;
67
- const n = (o = i.value) == null ? void 0 : o.find((l) => l.name === x.value);
68
- D.value = (a = (s = n == null ? void 0 : n.compData) == null ? void 0 : s[0]) == null ? void 0 : a.contents, p.value = !0, p.value && (p.value = !1), k("change", {
69
- wholeValue: A.value,
70
- editValue: t
71
- });
72
- }, K = (t) => {
73
- var r, c, d;
74
- const n = N(A.value), o = n == null ? void 0 : n.map((u, S) => (S === (t == null ? void 0 : t.index) && (u.compData = t == null ? void 0 : t.contents), u));
75
- let s = "";
76
- (c = (r = N(o)) == null ? void 0 : r.filter((u) => (u == null ? void 0 : u.comp) === "Form")) == null || c.forEach((u) => {
77
- var S;
78
- (S = u == null ? void 0 : u.compData) == null || S.forEach((I) => {
79
- var b;
80
- (I == null ? void 0 : I.key) === "formContent" && ((b = I == null ? void 0 : I.contents) == null || b.forEach((j) => {
81
- j.value !== "" && (s = s === "" ? j == null ? void 0 : j.value : s + "-" + (j == null ? void 0 : j.value));
82
- }));
83
- });
84
- });
85
- let a = C == null ? void 0 : C.value;
86
- (a == null ? void 0 : a.length) > 0 ? a[0] = { key: "main", value: s } : (Array.isArray(a) || (a = []), a.push({ key: "main", value: s })), y.setSelectTitle(a), f.value = !1, A.value = o;
87
- const l = (d = i.value) == null ? void 0 : d.map((u, S) => {
88
- var I;
89
- return u.name === x.value && (u.compData = (I = u.compData) == null ? void 0 : I.map((b) => ((b == null ? void 0 : b.key) === "groupContents" && (b.contents = A.value), b))), u;
90
- });
91
- h.setItemData(l), p.value && (p.value = !1), k("contentChange", {
92
- wholeContent: i.value
93
- });
94
- }, L = (t) => {
95
- var n, o;
96
- if ((t == null ? void 0 : t.key) === "main")
97
- y.setSelectIndex(""), y.setSelectMenu(""), y.setSelectTitle((n = C.value) == null ? void 0 : n[0]);
98
- else {
99
- const s = [];
100
- let a = -1;
101
- (o = C.value) == null || o.forEach((l, r) => {
102
- (l == null ? void 0 : l.key) === (t == null ? void 0 : t.key) && (a = r), (a === -1 || a >= r) && s.push(l);
103
- }), y.setSelectTitle(s), y.setSelectMenu(t == null ? void 0 : t.key);
104
- }
105
- };
106
- B(
107
- () => i.value,
108
- () => {
109
- var n, o, s, a, l, r, c, d;
110
- if (!i.value || ((n = i.value) == null ? void 0 : n.length) === 0 || !f.value) return;
111
- let t = null;
112
- if (!x.value && Array.isArray(i.value))
113
- t = (s = (o = N(i.value)) == null ? void 0 : o.filter((u) => (u == null ? void 0 : u.comp) === "Group")) == null ? void 0 : s[0], _.setActiveMenuPath(t == null ? void 0 : t.name);
114
- else if (Array.isArray(i.value)) {
115
- const u = (a = N(i.value)) == null ? void 0 : a.filter((S) => (S == null ? void 0 : S.comp) === "Group");
116
- t = u == null ? void 0 : u.find((S) => S.name === x.value);
117
- }
118
- D.value = (r = (l = t == null ? void 0 : t.compData) == null ? void 0 : l[0]) == null ? void 0 : r.contents, A.value = (d = (c = t == null ? void 0 : t.compData) == null ? void 0 : c[0]) == null ? void 0 : d.contents, console.log("itemData监听", t, x.value, i.value);
119
- },
120
- { deep: !0, immediate: !0 }
121
- ), B(() => x.value, (t) => {
122
- var n, o, s, a, l, r;
123
- if (t) {
124
- const c = (n = N(i.value)) == null ? void 0 : n.find((d) => d.name === t);
125
- if (t && c) {
126
- D.value = (s = (o = c == null ? void 0 : c.compData) == null ? void 0 : o[0]) == null ? void 0 : s.contents, A.value = (l = (a = c == null ? void 0 : c.compData) == null ? void 0 : a[0]) == null ? void 0 : l.contents, console.log("点击-新-data:", t, D.value);
127
- const d = (r = D.value) == null ? void 0 : r.filter((u) => u.comp === "Form");
128
- pe(d);
129
- } else
130
- D.value = [], A.value = [];
131
- y.setSelectTitle([]), y.setSelectIndex(""), y.setSelectMenu("");
132
- }
133
- }, {
134
- immediate: !0
135
- }), B(
136
- () => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
137
- () => {
138
- var a, l, r;
139
- if (((a = e == null ? void 0 : e.jsonContents) == null ? void 0 : a.length) > 0) {
140
- h.setOriginalData(e == null ? void 0 : e.jsonContents), h.setItemData(e == null ? void 0 : e.jsonContents);
141
- return;
142
- }
143
- if (!(e != null && e.content) || ((l = e == null ? void 0 : e.content) == null ? void 0 : l.length) === 0) return;
144
- f.value = !0;
145
- let t, n = [];
146
- (r = e == null ? void 0 : e.content) == null || r.forEach((c) => {
147
- ce(c) ? n.push(ue(c)) : z(c) ? n.push(z(c)) : n.push(he(c));
148
- }), t = n[0];
149
- const o = Array.isArray(t) && (t == null ? void 0 : t.find((c) => {
150
- var d;
151
- return ((d = c.comp) == null ? void 0 : d.toUpperCase()) === "MENU";
152
- }));
153
- _.setRawMenu(o ?? {});
154
- const s = Array.isArray(t) && (t == null ? void 0 : t.find((c) => {
155
- var d;
156
- return ((d = c.comp) == null ? void 0 : d.toUpperCase()) === "SYSTEM";
157
- }));
158
- _.setSystemKey((s == null ? void 0 : s.name) ?? ""), h.setOriginalData(t), h.setItemData(t);
159
- },
160
- { deep: !0, immediate: !0 }
161
- );
162
- const V = (t) => ie(t);
163
- return (t, n) => {
164
- var o, s;
165
- return m(), v("div", Ce, [
166
- O(de, { class: "sys-aside" }),
167
- ((o = D.value) == null ? void 0 : o.length) > 0 ? (m(), v("div", ke, [
168
- ((s = E(C)) == null ? void 0 : s.length) > 1 ? (m(), v("div", De, [
169
- (m(), W(_e, {
170
- key: E(C),
171
- breadArray: E(C),
172
- onClick: L
173
- }, null, 8, ["breadArray"]))
174
- ])) : M("", !0),
175
- (m(!0), v(H, null, Q(D.value, (a, l) => (m(), v("div", {
176
- class: "item-content",
177
- key: l
178
- }, [
179
- E($) === "" || l.toString() === E($) ? (m(), v("div", Se, R(a.name), 1)) : M("", !0),
180
- E($) === "" || l.toString() === E($) ? (m(), W(ae(V(a.comp)), {
181
- itemData: a == null ? void 0 : a.compData,
182
- childItemData: a == null ? void 0 : a.itemChildData,
183
- key: l,
184
- onChange: G,
185
- index: l,
186
- onContentChange: K
187
- }, null, 40, ["itemData", "childItemData", "index"])) : M("", !0)
188
- ]))), 128))
189
- ])) : M("", !0)
190
- ]);
191
- };
192
- }
193
- }, we = /* @__PURE__ */ Y(Ae, [["__scopeId", "data-v-c89dc4ab"]]), Ie = { class: "add-model-content" }, Me = {
194
- key: 0,
195
- class: "model-import-data"
196
- }, xe = { class: "import-button" }, be = { key: 0 }, Te = {
197
- key: 1,
198
- class: "model-operate"
199
- }, $e = { class: "model-select" }, je = { class: "model-fill" }, Ee = {
200
- key: 2,
201
- class: "model-view"
202
- }, Fe = {
203
- __name: "index",
204
- props: {
205
- mode: {
206
- type: String,
207
- default: "view"
208
- },
209
- content: {
210
- type: String,
211
- default: ""
212
- },
213
- jsonContents: {
214
- type: Array,
215
- default: () => []
216
- },
217
- showButton: {
218
- type: Boolean,
219
- default: !0
220
- }
221
- },
222
- emits: ["change", "contentChange"],
223
- setup(w, { emit: T }) {
224
- const e = w, k = T, h = g([]), f = g([]), _ = g([]), p = g(0), i = X(J), y = Z(J), { itemData: x, originalData: q } = P(i), { activeMenuPath: ee } = P(y), U = g(null), $ = g(0), C = g([]), A = g(""), D = g(0), G = (n) => {
225
- k("contentChange", n);
226
- }, K = (n) => {
227
- var s;
228
- const o = (s = N(n == null ? void 0 : n.wholeValue)) == null ? void 0 : s.map((a) => {
229
- var l;
230
- return (a == null ? void 0 : a.comp) === "Form" && (a.compData = (l = a.compData) == null ? void 0 : l.map((r) => ((r == null ? void 0 : r.key) === "formContent" && (r.contents = me(r == null ? void 0 : r.contents)), r))), a;
231
- });
232
- k("change", {
233
- originalContents: q.value,
234
- currentContents: n == null ? void 0 : n.wholeValue,
235
- editContent: n == null ? void 0 : n.editValue,
236
- arrayToContents: o
237
- });
238
- };
239
- B(
240
- () => f.value,
241
- () => {
242
- D.value === f.value.length && f.value.length !== 0 && (h.value = f.value);
243
- },
244
- { deep: !0, immediate: !0 }
245
- );
246
- const L = () => {
247
- U.value.click();
248
- }, V = async (n) => {
249
- const o = n.target.files;
250
- if (!o) return;
251
- new FileReader(), h.value = [], f.value = [], D.value = o.length;
252
- const s = Array.from(o).map(async (a) => await new Promise((l) => {
253
- const r = new FileReader();
254
- r.onload = (c) => {
255
- try {
256
- f.value.push(c.target.result), C.value = t(c.target.result), $.value++;
257
- } catch (d) {
258
- console.error("解析失败:", d);
259
- return;
260
- }
261
- }, r.onerror = () => l(`读取 ${a.name} 失败`), r.readAsText(a);
262
- }));
263
- await Promise.all(s);
264
- };
265
- B(
266
- () => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
267
- () => {
268
- h.value = e == null ? void 0 : e.content, _.value = e == null ? void 0 : e.jsonContents;
269
- },
270
- { deep: !0, immediate: !0 }
271
- ), B(
272
- () => $.value,
273
- () => {
274
- var n;
275
- ((n = C.value) == null ? void 0 : n.length) !== 0 && (i.setOriginalData(C.value), i.setItemData(C.value));
276
- },
277
- { deep: !0, immediate: !0 }
278
- );
279
- const t = (n) => {
280
- let o = n.replace(/,/g, ",").replace(/;/g, ";").replace(/:/g, ":");
281
- o = o.replace(/(\w+)\s*:/g, "$1:"), o = o.replace(/\r\n/g, "").replace(/\n/g, "").replace(/\t/g, "").replace(/\s+/g, " ").trim(), o = o.replace(/,\s*([}\]])/g, "$1"), o = o.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g, ": $2$4");
282
- try {
283
- return JSON.parse(o);
284
- } catch (s) {
285
- try {
286
- const l = new Function(`return ${o}`)();
287
- if (Array.isArray(l) || typeof l == "object")
288
- return l;
289
- throw new Error(`解析结果不是有效的数组或对象: ${s}`);
290
- } catch (a) {
291
- throw new Error(`无法解析JSON: ${a.message}`);
292
- }
293
- }
294
- };
295
- return (n, o) => {
296
- var s;
297
- return m(), v("div", Ie, [
298
- ((s = e == null ? void 0 : e.jsonContents) == null ? void 0 : s.length) === 0 && (e != null && e.showButton) ? (m(), v("div", Me, [
299
- F("div", xe, [
300
- F("input", {
301
- type: "file",
302
- ref_key: "fileInput",
303
- ref: U,
304
- accept: ".txt, .inm",
305
- onChange: V,
306
- style: { display: "none" },
307
- multiple: ""
308
- }, null, 544),
309
- F("button", {
310
- onClick: L,
311
- class: "import-button-content"
312
- }, "导入文件"),
313
- A.value ? (m(), v("span", be, R(A.value), 1)) : M("", !0)
314
- ])
315
- ])) : M("", !0),
316
- (e == null ? void 0 : e.mode) === "edit" ? (m(), v("div", Te, [
317
- F("div", $e, [
318
- O(ne)
319
- ]),
320
- (m(), v("div", {
321
- class: "model-show",
322
- key: p.value
323
- }, [
324
- O(oe)
325
- ])),
326
- F("div", je, [
327
- O(se)
328
- ])
329
- ])) : M("", !0),
330
- (e == null ? void 0 : e.mode) === "view" ? (m(), v("div", Ee, [
331
- (m(), W(we, {
332
- content: h.value,
333
- onChange: K,
334
- jsonContents: _.value,
335
- onContentChange: G,
336
- key: p.value
337
- }, null, 8, ["content", "jsonContents"]))
338
- ])) : M("", !0)
339
- ]);
340
- };
341
- }
342
- }, Le = /* @__PURE__ */ Y(Fe, [["__scopeId", "data-v-0d13cfeb"]]);
343
- export {
344
- Le as default
345
- };
@@ -1,26 +0,0 @@
1
- import { _ as c } from "./index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-B67eMpk2.js";
2
- import { resolveComponent as o, createBlock as a, openBlock as u, withCtx as r, createVNode as l, createElementVNode as i, toDisplayString as p } from "vue";
3
- import { _ as m } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- function M(e, _, d, f, C, y) {
5
- const t = o("DynamicIcon"), s = o("ssMenu");
6
- return u(), a(s, {
7
- menuList: e.renderMenuList,
8
- onClickMenu: e.clickMenu,
9
- onOpenMenu: e.openMenu,
10
- onCloseMenu: e.closeMenu,
11
- onChangeMenuStyle: e.changeMenuStyle,
12
- class: "menuList-wrap"
13
- }, {
14
- title: r(({ menu: n }) => [
15
- l(t, {
16
- name: n.icon ?? ""
17
- }, null, 8, ["name"]),
18
- i("span", null, p(n.title ?? ""), 1)
19
- ]),
20
- _: 1
21
- }, 8, ["menuList", "onClickMenu", "onOpenMenu", "onCloseMenu", "onChangeMenuStyle"]);
22
- }
23
- const L = /* @__PURE__ */ m(c, [["render", M], ["__scopeId", "data-v-dc84a8f7"]]);
24
- export {
25
- L as default
26
- };
@@ -1,131 +0,0 @@
1
- import { createElementBlock as r, openBlock as n, Fragment as k, renderList as y, unref as F, createElementVNode as c, createBlock as f, resolveDynamicComponent as $, toDisplayString as C, ref as I, watch as L, resolveComponent as b, createVNode as R, withCtx as g, createCommentVNode as T } from "vue";
2
- import { p as V, s as U, g as M } from "./array-C8gxudwq.js";
3
- import { E as j } from "./index-CQuV8YFa.js";
4
- import { u as w } from "./modelComp-B3sxj_Kp.js";
5
- import { s as x } from "./menu-BIINB-0Y.js";
6
- import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- import { c as v } from "./cloneDeep-BpK0E_ef.js";
8
- const q = { class: "type-select" }, z = ["onClick"], A = { class: "list-icon" }, G = {
9
- __name: "index",
10
- setup(N) {
11
- const m = w(V), { itemData: o } = x(m), p = (t) => j[t], _ = (t) => {
12
- const d = v(o.value);
13
- d.push({
14
- comp: t.comp,
15
- name: t.name,
16
- compData: []
17
- }), m.setItemData(d);
18
- };
19
- return (t, d) => (n(), r("div", q, [
20
- (n(!0), r(k, null, y(F(U), (l, e) => (n(), r("div", {
21
- class: "type-list",
22
- key: e
23
- }, [
24
- c("div", {
25
- class: "list-content",
26
- onClick: (s) => _(l)
27
- }, [
28
- c("div", A, [
29
- (n(), f($(p(l.icon))))
30
- ]),
31
- c("div", null, C(l.name), 1)
32
- ], 8, z)
33
- ]))), 128))
34
- ]));
35
- }
36
- }, se = /* @__PURE__ */ E(G, [["__scopeId", "data-v-fe4aecc8"]]), H = { class: "fill-content" }, J = { class: "operate-content" }, K = { class: "collapse-title" }, P = { class: "comp-child" }, Q = {
37
- __name: "index",
38
- setup(N) {
39
- const m = w(V), { itemData: o, originalData: p } = x(m), _ = I([]), t = I([]);
40
- L(
41
- () => o.value,
42
- () => {
43
- var e;
44
- !o.value || ((e = o.value) == null ? void 0 : e.length) === 0 || (_.value = v(o.value));
45
- },
46
- { deep: !0, immediate: !0 }
47
- );
48
- const d = (e) => M(e), l = (e, s, D) => {
49
- if (!e || e.length === 0) return;
50
- let i = v(o.value);
51
- const a = v(s);
52
- a.compData = e, i = i == null ? void 0 : i.map((u, h) => (h === D && (u = a), u)), m.setItemData(i);
53
- };
54
- return (e, s) => {
55
- const D = b("el-collapse-item"), i = b("el-collapse");
56
- return n(), r("div", H, [
57
- s[1] || (s[1] = c("div", { class: "fill-operate" }, C("操作栏"), -1)),
58
- c("div", J, [
59
- R(i, {
60
- modelValue: t.value,
61
- "onUpdate:modelValue": s[0] || (s[0] = (a) => t.value = a),
62
- class: "collapse-content"
63
- }, {
64
- default: g(() => [
65
- (n(!0), r(k, null, y(_.value, (a, u) => (n(), f(D, {
66
- key: u,
67
- name: u
68
- }, {
69
- title: g(() => [
70
- c("div", K, C(a.name), 1)
71
- ]),
72
- default: g(() => {
73
- var h, B;
74
- return [
75
- c("div", P, [
76
- (n(), f($(d(a.comp + "Operate")), {
77
- itemContents: a == null ? void 0 : a.compData,
78
- originalItemContents: (B = (h = F(p)) == null ? void 0 : h.find((S, O) => O === u)) == null ? void 0 : B.compData,
79
- onChange: (S) => l(S, a, u)
80
- }, null, 40, ["itemContents", "originalItemContents", "onChange"]))
81
- ])
82
- ];
83
- }),
84
- _: 2
85
- }, 1032, ["name"]))), 128))
86
- ]),
87
- _: 1
88
- }, 8, ["modelValue"])
89
- ])
90
- ]);
91
- };
92
- }
93
- }, le = /* @__PURE__ */ E(Q, [["__scopeId", "data-v-a216b035"]]), W = {
94
- key: 0,
95
- class: "show-content"
96
- }, X = {
97
- __name: "index",
98
- setup(N) {
99
- const m = w(V), { itemData: o } = x(m), p = I([]);
100
- L(
101
- () => o.value,
102
- () => {
103
- var t;
104
- !o.value || ((t = o.value) == null ? void 0 : t.length) === 0 || (p.value = v(o.value));
105
- },
106
- { deep: !0, immediate: !0 }
107
- );
108
- const _ = (t) => M(t);
109
- return (t, d) => {
110
- var l;
111
- return ((l = p.value) == null ? void 0 : l.length) > 0 ? (n(), r("div", W, [
112
- (n(!0), r(k, null, y(p.value, (e, s) => (n(), r("div", {
113
- class: "item-content",
114
- key: s
115
- }, [
116
- c("div", null, C(e.name), 1),
117
- (n(), f($(_(e.comp)), {
118
- itemData: e == null ? void 0 : e.compData,
119
- childItemData: e == null ? void 0 : e.itemChildData,
120
- key: s
121
- }, null, 8, ["itemData", "childItemData"]))
122
- ]))), 128))
123
- ])) : T("", !0);
124
- };
125
- }
126
- }, ce = /* @__PURE__ */ E(X, [["__scopeId", "data-v-79320497"]]);
127
- export {
128
- ce as a,
129
- le as b,
130
- se as m
131
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),q=require("./index-BLoamlbm.cjs"),B=require("./array-q8pUBU30.cjs"),O=require("./modelComp-DAsVXKA0.cjs"),M=require("./menu-B_Az9K_F.cjs"),G=require("./index-BW-bmuq0.cjs"),R=require("./index.vue_vue_type_style_index_0_scoped_0d13cfeb_lang-CwZAxgWm.cjs"),J=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),I=require("./cloneDeep-B3VC5L8Z.cjs"),L={class:"bread-content"},H=["onClick"],K={key:0},W={__name:"index",props:{breadArray:{type:Array,default:()=>[]}},emits:["click"],setup(S,{emit:N}){const t=S,k=e.ref([]),f=N;e.onMounted(()=>{k.value=t==null?void 0:t.breadArray});const h=p=>{f("click",p)};return(p,y)=>(e.openBlock(),e.createElementBlock("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(d,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:w=>h(d)},e.toDisplayString(d.value),9,H),v!==k.value.length-1?(e.openBlock(),e.createElementBlock("div",K,e.toDisplayString("/"))):e.createCommentVNode("",!0)]))),128))]))}},Y=J._export_sfc(W,[["__scopeId","data-v-d55d3ede"]]);function z(S){var k,f,h,p;const N=(f=(k=S[0])==null?void 0:k.compData)==null?void 0:f.filter(y=>y.key!=="formContent"),t=(p=(h=S[0])==null?void 0:h.compData)==null?void 0:p.filter(y=>y.key==="formContent");console.log("handleFormModel:",N,t,S)}const Q={class:"system-wrap"},X={key:0,class:"show-content"},Z={key:0,class:"item-menu-content"},ee={key:0,class:"item-view-group"},te={__name:"index",props:{content:String,jsonContents:Array},emits:["change","contentChange"],setup(S,{emit:N}){const t=S,k=N,f=O.useModelComp(B.pinia);B.useFormToTableComp(B.pinia);const h=e.ref(!0),p=M.useMenuState(),y=e.ref(!0),{itemData:d}=M.storeToRefs(f),v=B.useUnit(B.pinia),{activeMenuPath:w,activeMenuOpenPaths:P,menuTriggerType:U,menus:$}=M.storeToRefs(p),{selectIndex:A,selectTitle:g}=M.storeToRefs(v),D=e.ref([]),_=e.ref([]),b=n=>{var l,r,a;const o=(l=d.value)==null?void 0:l.find(c=>c.name===w.value);_.value=(a=(r=o==null?void 0:o.compData)==null?void 0:r[0])==null?void 0:a.contents,y.value=!0,y.value&&(y.value=!1),k("change",{wholeValue:D.value,editValue:n})},V=n=>{var s,u,m;const o=I.cloneDeep(D.value),l=o==null?void 0:o.map((i,C)=>(C===(n==null?void 0:n.index)&&(i.compData=n==null?void 0:n.contents),i));let r="";(u=(s=I.cloneDeep(l))==null?void 0:s.filter(i=>(i==null?void 0:i.comp)==="Form"))==null||u.forEach(i=>{var C;(C=i==null?void 0:i.compData)==null||C.forEach(E=>{var x;(E==null?void 0:E.key)==="formContent"&&((x=E==null?void 0:E.contents)==null||x.forEach(T=>{T.value!==""&&(r=r===""?T==null?void 0:T.value:r+"-"+(T==null?void 0:T.value))}))})});let a=g==null?void 0:g.value;(a==null?void 0:a.length)>0?a[0]={key:"main",value:r}:(Array.isArray(a)||(a=[]),a.push({key:"main",value:r})),v.setSelectTitle(a),h.value=!1,D.value=l;const c=(m=d.value)==null?void 0:m.map((i,C)=>{var E;return i.name===w.value&&(i.compData=(E=i.compData)==null?void 0:E.map(x=>((x==null?void 0:x.key)==="groupContents"&&(x.contents=D.value),x))),i});f.setItemData(c),y.value&&(y.value=!1),k("contentChange",{wholeContent:d.value})},j=n=>{var o,l;if((n==null?void 0:n.key)==="main")v.setSelectIndex(""),v.setSelectMenu(""),v.setSelectTitle((o=g.value)==null?void 0:o[0]);else{const r=[];let a=-1;(l=g.value)==null||l.forEach((c,s)=>{(c==null?void 0:c.key)===(n==null?void 0:n.key)&&(a=s),(a===-1||a>=s)&&r.push(c)}),v.setSelectTitle(r),v.setSelectMenu(n==null?void 0:n.key)}};e.watch(()=>d.value,()=>{var o,l,r,a,c,s,u,m;if(!d.value||((o=d.value)==null?void 0:o.length)===0||!h.value)return;let n=null;if(!w.value&&Array.isArray(d.value))n=(r=(l=I.cloneDeep(d.value))==null?void 0:l.filter(i=>(i==null?void 0:i.comp)==="Group"))==null?void 0:r[0],p.setActiveMenuPath(n==null?void 0:n.name);else if(Array.isArray(d.value)){const i=(a=I.cloneDeep(d.value))==null?void 0:a.filter(C=>(C==null?void 0:C.comp)==="Group");n=i==null?void 0:i.find(C=>C.name===w.value)}_.value=(s=(c=n==null?void 0:n.compData)==null?void 0:c[0])==null?void 0:s.contents,D.value=(m=(u=n==null?void 0:n.compData)==null?void 0:u[0])==null?void 0:m.contents,console.log("itemData监听",n,w.value,d.value)},{deep:!0,immediate:!0}),e.watch(()=>w.value,n=>{var o,l,r,a,c,s;if(n){const u=(o=I.cloneDeep(d.value))==null?void 0:o.find(m=>m.name===n);if(n&&u){_.value=(r=(l=u==null?void 0:u.compData)==null?void 0:l[0])==null?void 0:r.contents,D.value=(c=(a=u==null?void 0:u.compData)==null?void 0:a[0])==null?void 0:c.contents,console.log("点击-新-data:",n,_.value);const m=(s=_.value)==null?void 0:s.filter(i=>i.comp==="Form");z(m)}else _.value=[],D.value=[];v.setSelectTitle([]),v.setSelectIndex(""),v.setSelectMenu("")}},{immediate:!0}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{var a,c,s;if(((a=t==null?void 0:t.jsonContents)==null?void 0:a.length)>0){f.setOriginalData(t==null?void 0:t.jsonContents),f.setItemData(t==null?void 0:t.jsonContents);return}if(!(t!=null&&t.content)||((c=t==null?void 0:t.content)==null?void 0:c.length)===0)return;h.value=!0;let n,o=[];(s=t==null?void 0:t.content)==null||s.forEach(u=>{B.isExpandStringToJson(u)?o.push(B.expandStringToJson(u)):R.expandNewStringToJson(u)?o.push(R.expandNewStringToJson(u)):o.push(R.expandContentStringToJson(u))}),n=o[0];const l=Array.isArray(n)&&(n==null?void 0:n.find(u=>{var m;return((m=u.comp)==null?void 0:m.toUpperCase())==="MENU"}));p.setRawMenu(l??{});const r=Array.isArray(n)&&(n==null?void 0:n.find(u=>{var m;return((m=u.comp)==null?void 0:m.toUpperCase())==="SYSTEM"}));p.setSystemKey((r==null?void 0:r.name)??""),f.setOriginalData(n),f.setItemData(n)},{deep:!0,immediate:!0});const F=n=>B.getComponent(n);return(n,o)=>{var l,r;return e.openBlock(),e.createElementBlock("div",Q,[e.createVNode(G.default,{class:"sys-aside"}),((l=_.value)==null?void 0:l.length)>0?(e.openBlock(),e.createElementBlock("div",X,[((r=e.unref(g))==null?void 0:r.length)>1?(e.openBlock(),e.createElementBlock("div",Z,[(e.openBlock(),e.createBlock(Y,{key:e.unref(g),breadArray:e.unref(g),onClick:j},null,8,["breadArray"]))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,c)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:c},[e.unref(A)===""||c.toString()===e.unref(A)?(e.openBlock(),e.createElementBlock("div",ee,e.toDisplayString(a.name),1)):e.createCommentVNode("",!0),e.unref(A)===""||c.toString()===e.unref(A)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(F(a.comp)),{itemData:a==null?void 0:a.compData,childItemData:a==null?void 0:a.itemChildData,key:c,onChange:b,index:c,onContentChange:V},null,40,["itemData","childItemData","index"])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)])}}},ne=J._export_sfc(te,[["__scopeId","data-v-c89dc4ab"]]),ae={class:"add-model-content"},oe={key:0,class:"model-import-data"},le={class:"import-button"},re={key:0},ce={key:1,class:"model-operate"},se={class:"model-select"},ue={class:"model-fill"},ie={key:2,class:"model-view"},de={__name:"index",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change","contentChange"],setup(S,{emit:N}){const t=S,k=N,f=e.ref([]),h=e.ref([]),p=e.ref([]),y=e.ref(0),d=O.useModelComp(B.pinia),v=M.useMenuState(B.pinia),{itemData:w,originalData:P}=M.storeToRefs(d),{activeMenuPath:U}=M.storeToRefs(v),$=e.ref(null),A=e.ref(0),g=e.ref([]),D=e.ref(""),_=e.ref(0),b=o=>{k("contentChange",o)},V=o=>{var r;const l=(r=I.cloneDeep(o==null?void 0:o.wholeValue))==null?void 0:r.map(a=>{var c;return(a==null?void 0:a.comp)==="Form"&&(a.compData=(c=a.compData)==null?void 0:c.map(s=>((s==null?void 0:s.key)==="formContent"&&(s.contents=B.arrayToNumberArray(s==null?void 0:s.contents)),s))),a});k("change",{originalContents:P.value,currentContents:o==null?void 0:o.wholeValue,editContent:o==null?void 0:o.editValue,arrayToContents:l})};e.watch(()=>h.value,()=>{_.value===h.value.length&&h.value.length!==0&&(f.value=h.value)},{deep:!0,immediate:!0});const j=()=>{$.value.click()},F=async o=>{const l=o.target.files;if(!l)return;new FileReader,f.value=[],h.value=[],_.value=l.length;const r=Array.from(l).map(async a=>await new Promise(c=>{const s=new FileReader;s.onload=u=>{try{h.value.push(u.target.result),g.value=n(u.target.result),A.value++}catch(m){console.error("解析失败:",m);return}},s.onerror=()=>c(`读取 ${a.name} 失败`),s.readAsText(a)}));await Promise.all(r)};e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{f.value=t==null?void 0:t.content,p.value=t==null?void 0:t.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>A.value,()=>{var o;((o=g.value)==null?void 0:o.length)!==0&&(d.setOriginalData(g.value),d.setItemData(g.value))},{deep:!0,immediate:!0});const n=o=>{let l=o.replace(/,/g,",").replace(/;/g,";").replace(/:/g,":");l=l.replace(/(\w+)\s*:/g,"$1:"),l=l.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\t/g,"").replace(/\s+/g," ").trim(),l=l.replace(/,\s*([}\]])/g,"$1"),l=l.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g,": $2$4");try{return JSON.parse(l)}catch(r){try{const c=new Function(`return ${l}`)();if(Array.isArray(c)||typeof c=="object")return c;throw new Error(`解析结果不是有效的数组或对象: ${r}`)}catch(a){throw new Error(`无法解析JSON: ${a.message}`)}}};return(o,l)=>{var r;return e.openBlock(),e.createElementBlock("div",ae,[((r=t==null?void 0:t.jsonContents)==null?void 0:r.length)===0&&(t!=null&&t.showButton)?(e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("div",le,[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:$,accept:".txt, .inm",onChange:F,style:{display:"none"},multiple:""},null,544),e.createElementVNode("button",{onClick:j,class:"import-button-content"},"导入文件"),D.value?(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(D.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",se,[e.createVNode(q.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:y.value},[e.createVNode(q.modelShow)])),e.createElementVNode("div",ue,[e.createVNode(q.modelFill)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="view"?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(ne,{content:f.value,onChange:V,jsonContents:p.value,onContentChange:b,key:y.value},null,8,["content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},me=J._export_sfc(de,[["__scopeId","data-v-0d13cfeb"]]);exports.default=me;