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,351 @@
1
+ import { ref as D, onMounted as ee, createElementBlock as m, openBlock as i, Fragment as z, renderList as H, createElementVNode as N, createCommentVNode as $, toDisplayString as U, watch as O, createVNode as R, unref as F, createBlock as Y, resolveDynamicComponent as te } from "vue";
2
+ import { m as ae, a as ne, b as oe } from "./index-CN2pLnQT.js";
3
+ import { p as J, u as se, b as le, i as re, e as ce, g as ue, a as ie } from "./array-BtcGNRWC.js";
4
+ import { u as Q } from "./modelComp-BdUI1DVP.js";
5
+ import { u as X, s as P } from "./menu-Dez5HOn4.js";
6
+ import de from "./index-btKSK4k7.js";
7
+ import { e as me } from "./index.vue_vue_type_style_index_0_scoped_876d48c6_lang-CeS9mECH.js";
8
+ import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
+ import { c as B } from "./cloneDeep-BcUiE4Tq.js";
10
+ const fe = { class: "bread-content" }, he = ["onClick"], ve = { key: 0 }, ge = {
11
+ __name: "index",
12
+ props: {
13
+ breadArray: {
14
+ type: Array,
15
+ default: () => []
16
+ }
17
+ },
18
+ emits: ["click"],
19
+ setup(p, { emit: k }) {
20
+ const t = p, d = D([]), u = k;
21
+ ee(() => {
22
+ d.value = t == null ? void 0 : t.breadArray;
23
+ });
24
+ const f = (y) => {
25
+ u("click", y);
26
+ };
27
+ return (y, v) => (i(), m("div", fe, [
28
+ (i(!0), m(z, null, H(d.value, (h, g) => (i(), m("div", {
29
+ key: g,
30
+ class: "bread-item"
31
+ }, [
32
+ N("div", {
33
+ class: "bread-title",
34
+ onClick: (A) => f(h)
35
+ }, U(h.value), 9, he),
36
+ g !== d.value.length - 1 ? (i(), m("div", ve, U("/"))) : $("", !0)
37
+ ]))), 128))
38
+ ]));
39
+ }
40
+ }, ye = /* @__PURE__ */ q(ge, [["__scopeId", "data-v-d55d3ede"]]);
41
+ function _e(p) {
42
+ const k = [], t = {
43
+ "(": ")",
44
+ "{": "}",
45
+ "[": "]"
46
+ };
47
+ for (let d = 0; d < p.length; d++) {
48
+ const u = p[d];
49
+ if (t[u])
50
+ k.push(u);
51
+ else if (Object.values(t).includes(u)) {
52
+ const f = k.pop();
53
+ if (console.log("stack", k, f, t[f]), t[f] !== u)
54
+ return !1;
55
+ }
56
+ }
57
+ return k.length === 0;
58
+ }
59
+ function Ce(p) {
60
+ var d, u, f, y;
61
+ const k = (u = (d = p[0]) == null ? void 0 : d.compData) == null ? void 0 : u.filter((v) => v.key !== "formContent"), t = (y = (f = p[0]) == null ? void 0 : f.compData) == null ? void 0 : y.filter((v) => v.key === "formContent");
62
+ console.log("handleFormModel:", k, t, p);
63
+ }
64
+ const pe = { class: "system-wrap" }, ke = {
65
+ key: 0,
66
+ class: "show-content"
67
+ }, De = {
68
+ key: 0,
69
+ class: "item-menu-content"
70
+ }, Se = {
71
+ key: 0,
72
+ class: "item-view-group"
73
+ }, Ie = {
74
+ __name: "index",
75
+ props: {
76
+ content: String,
77
+ jsonContents: Array
78
+ },
79
+ emits: ["change", "contentChange"],
80
+ setup(p, { emit: k }) {
81
+ const t = p, d = k, u = Q(J);
82
+ se(J);
83
+ const f = D(!0), y = X(), v = D(!0), { itemData: h } = P(u), g = le(J), { activeMenuPath: A, activeMenuOpenPaths: Z, menuTriggerType: G, menus: V } = P(y), { selectIndex: w, selectTitle: M } = P(g), b = D([]), _ = D([]), K = (e) => {
84
+ var n, o, a;
85
+ const s = (n = h.value) == null ? void 0 : n.find((l) => l.name === A.value);
86
+ _.value = (a = (o = s == null ? void 0 : s.compData) == null ? void 0 : o[0]) == null ? void 0 : a.contents, v.value = !0, v.value && (v.value = !1), d("change", {
87
+ wholeValue: b.value,
88
+ editValue: e
89
+ });
90
+ }, L = (e) => {
91
+ var S, C, T;
92
+ const s = B(b.value), n = s == null ? void 0 : s.map((r, I) => (I === (e == null ? void 0 : e.index) && (r.compData = e == null ? void 0 : e.contents), r));
93
+ let o = "";
94
+ (C = (S = B(n)) == null ? void 0 : S.filter((r) => (r == null ? void 0 : r.comp) === "Form")) == null || C.forEach((r) => {
95
+ var I;
96
+ (I = r == null ? void 0 : r.compData) == null || I.forEach((x) => {
97
+ var j;
98
+ (x == null ? void 0 : x.key) === "formContent" && ((j = x == null ? void 0 : x.contents) == null || j.forEach((E) => {
99
+ E.value !== "" && (o = o === "" ? E == null ? void 0 : E.value : o + "-" + (E == null ? void 0 : E.value));
100
+ }));
101
+ });
102
+ });
103
+ let a = M == null ? void 0 : M.value;
104
+ (a == null ? void 0 : a.length) > 0 ? a[0] = { key: "main", value: o } : (Array.isArray(a) || (a = []), a.push({ key: "main", value: o })), g.setSelectTitle(a), f.value = !1, b.value = n;
105
+ const l = (T = h.value) == null ? void 0 : T.map((r, I) => {
106
+ var x;
107
+ return r.name === A.value && (r.compData = (x = r.compData) == null ? void 0 : x.map((j) => ((j == null ? void 0 : j.key) === "groupContents" && (j.contents = b.value), j))), r;
108
+ });
109
+ u.setItemData(l), v.value && (v.value = !1), d("contentChange", {
110
+ wholeContent: h.value
111
+ });
112
+ }, W = (e) => {
113
+ var s, n;
114
+ if ((e == null ? void 0 : e.key) === "main")
115
+ g.setSelectIndex(""), g.setSelectMenu(""), g.setSelectTitle((s = M.value) == null ? void 0 : s[0]);
116
+ else {
117
+ const o = [];
118
+ let a = -1;
119
+ (n = M.value) == null || n.forEach((l, S) => {
120
+ (l == null ? void 0 : l.key) === (e == null ? void 0 : e.key) && (a = S), (a === -1 || a >= S) && o.push(l);
121
+ }), g.setSelectTitle(o), g.setSelectMenu(e == null ? void 0 : e.key);
122
+ }
123
+ };
124
+ O(
125
+ () => h.value,
126
+ () => {
127
+ var s, n, o, a, l, S, C, T;
128
+ if (!h.value || ((s = h.value) == null ? void 0 : s.length) === 0 || !f.value) return;
129
+ let e = null;
130
+ if (!A.value)
131
+ e = (o = (n = B(h.value)) == null ? void 0 : n.filter((r) => (r == null ? void 0 : r.comp) === "Group")) == null ? void 0 : o[0], y.setActiveMenuPath(e == null ? void 0 : e.name);
132
+ else {
133
+ const r = (a = B(h.value)) == null ? void 0 : a.filter((I) => (I == null ? void 0 : I.comp) === "Group");
134
+ e = r == null ? void 0 : r.find((I) => I.name === A.value);
135
+ }
136
+ _.value = (S = (l = e == null ? void 0 : e.compData) == null ? void 0 : l[0]) == null ? void 0 : S.contents, b.value = (T = (C = e == null ? void 0 : e.compData) == null ? void 0 : C[0]) == null ? void 0 : T.contents, console.log("itemData监听", e, A.value, h.value);
137
+ },
138
+ { deep: !0, immediate: !0 }
139
+ ), O(() => A.value, (e) => {
140
+ var s, n, o, a, l, S;
141
+ if (e) {
142
+ const C = (s = B(h.value)) == null ? void 0 : s.find((T) => T.name === e);
143
+ if (e && C) {
144
+ _.value = (o = (n = C == null ? void 0 : C.compData) == null ? void 0 : n[0]) == null ? void 0 : o.contents, b.value = (l = (a = C == null ? void 0 : C.compData) == null ? void 0 : a[0]) == null ? void 0 : l.contents, console.log("点击-新-data:", e, _.value);
145
+ const T = (S = _.value) == null ? void 0 : S.filter((r) => r.comp === "Form");
146
+ Ce(T);
147
+ } else
148
+ _.value = [], b.value = [];
149
+ g.setSelectTitle([]), g.setSelectIndex(""), g.setSelectMenu("");
150
+ }
151
+ }, {
152
+ immediate: !0
153
+ }), O(
154
+ () => [t == null ? void 0 : t.content, t == null ? void 0 : t.jsonContents],
155
+ () => {
156
+ var o;
157
+ if (((o = t == null ? void 0 : t.jsonContents) == null ? void 0 : o.length) > 0) {
158
+ u.setOriginalData(t == null ? void 0 : t.jsonContents), u.setItemData(t == null ? void 0 : t.jsonContents);
159
+ return;
160
+ }
161
+ if (!(t != null && t.content) || (t == null ? void 0 : t.content) === "") return;
162
+ f.value = !0;
163
+ let e;
164
+ re(t == null ? void 0 : t.content) ? e = ce(t == null ? void 0 : t.content) : e = me(t == null ? void 0 : t.content);
165
+ const s = Array.isArray(e) && (e == null ? void 0 : e.find((a) => {
166
+ var l;
167
+ return ((l = a.comp) == null ? void 0 : l.toUpperCase()) === "MENU";
168
+ }));
169
+ y.setRawMenu(s ?? {});
170
+ const n = Array.isArray(e) && (e == null ? void 0 : e.find((a) => {
171
+ var l;
172
+ return ((l = a.comp) == null ? void 0 : l.toUpperCase()) === "SYSTEM";
173
+ }));
174
+ y.setSystemKey((n == null ? void 0 : n.name) ?? ""), u.setOriginalData(e), u.setItemData(e);
175
+ },
176
+ { deep: !0, immediate: !0 }
177
+ );
178
+ const c = (e) => ue(e);
179
+ return (e, s) => {
180
+ var n, o;
181
+ return i(), m("div", pe, [
182
+ R(de, { class: "sys-aside" }),
183
+ ((n = _.value) == null ? void 0 : n.length) > 0 ? (i(), m("div", ke, [
184
+ ((o = F(M)) == null ? void 0 : o.length) > 1 ? (i(), m("div", De, [
185
+ (i(), Y(ye, {
186
+ key: F(M),
187
+ breadArray: F(M),
188
+ onClick: W
189
+ }, null, 8, ["breadArray"]))
190
+ ])) : $("", !0),
191
+ (i(!0), m(z, null, H(_.value, (a, l) => (i(), m("div", {
192
+ class: "item-content",
193
+ key: l
194
+ }, [
195
+ F(w) === "" || l.toString() === F(w) ? (i(), m("div", Se, U(a.name), 1)) : $("", !0),
196
+ F(w) === "" || l.toString() === F(w) ? (i(), Y(te(c(a.comp)), {
197
+ itemData: a == null ? void 0 : a.compData,
198
+ childItemData: a == null ? void 0 : a.itemChildData,
199
+ key: l,
200
+ onChange: K,
201
+ index: l,
202
+ onContentChange: L
203
+ }, null, 40, ["itemData", "childItemData", "index"])) : $("", !0)
204
+ ]))), 128))
205
+ ])) : $("", !0)
206
+ ]);
207
+ };
208
+ }
209
+ }, Me = /* @__PURE__ */ q(Ie, [["__scopeId", "data-v-38117cb6"]]), Ae = { class: "add-model-content" }, be = {
210
+ key: 0,
211
+ class: "model-import-data"
212
+ }, Te = { class: "import-button" }, xe = { key: 0 }, $e = {
213
+ key: 1,
214
+ class: "model-operate"
215
+ }, je = { class: "model-select" }, we = { class: "model-fill" }, Ee = {
216
+ key: 2,
217
+ class: "model-view"
218
+ }, Fe = {
219
+ __name: "index",
220
+ props: {
221
+ mode: {
222
+ type: String,
223
+ default: "view"
224
+ },
225
+ content: {
226
+ type: String,
227
+ default: ""
228
+ },
229
+ jsonContents: {
230
+ type: Array,
231
+ default: () => []
232
+ },
233
+ showButton: {
234
+ type: Boolean,
235
+ default: !0
236
+ }
237
+ },
238
+ emits: ["change", "contentChange"],
239
+ setup(p, { emit: k }) {
240
+ const t = p, d = k, u = D(""), f = D([]), y = D(0), v = Q(J), h = X(J), { itemData: g, originalData: A } = P(v), { activeMenuPath: Z } = P(h), G = D(null), V = D(0), w = D(""), M = (c) => {
241
+ d("contentChange", c);
242
+ }, b = (c) => {
243
+ var s;
244
+ const e = (s = B(c == null ? void 0 : c.wholeValue)) == null ? void 0 : s.map((n) => {
245
+ var o;
246
+ return (n == null ? void 0 : n.comp) === "Form" && (n.compData = (o = n.compData) == null ? void 0 : o.map((a) => ((a == null ? void 0 : a.key) === "formContent" && (a.contents = ie(a == null ? void 0 : a.contents)), a))), n;
247
+ });
248
+ d("change", {
249
+ originalContents: A.value,
250
+ currentContents: c == null ? void 0 : c.wholeValue,
251
+ editContent: c == null ? void 0 : c.editValue,
252
+ arrayToContents: e
253
+ });
254
+ }, _ = D([]), K = () => {
255
+ G.value.click();
256
+ }, L = (c) => {
257
+ const e = c.target.files[0];
258
+ if (!e) return;
259
+ const s = new FileReader();
260
+ s.onload = (n) => {
261
+ try {
262
+ u.value = n.target.result;
263
+ const o = _e(n.target.result);
264
+ console.log("handleFileChange-isValid", o), _.value = W(n.target.result), V.value++;
265
+ } catch (o) {
266
+ console.error("解析失败:", o);
267
+ }
268
+ }, s.onerror = (n) => {
269
+ console.error("文件读取错误:", n);
270
+ }, s.readAsText(e);
271
+ };
272
+ O(
273
+ () => [t == null ? void 0 : t.content, t == null ? void 0 : t.jsonContents],
274
+ () => {
275
+ u.value = t == null ? void 0 : t.content, f.value = t == null ? void 0 : t.jsonContents;
276
+ },
277
+ { deep: !0, immediate: !0 }
278
+ ), O(
279
+ () => V.value,
280
+ () => {
281
+ var c;
282
+ ((c = _.value) == null ? void 0 : c.length) !== 0 && (v.setOriginalData(_.value), v.setItemData(_.value));
283
+ },
284
+ { deep: !0, immediate: !0 }
285
+ );
286
+ const W = (c) => {
287
+ let e = c.replace(/,/g, ",").replace(/;/g, ";").replace(/:/g, ":");
288
+ e = e.replace(/(\w+)\s*:/g, "$1:"), e = e.replace(/\r\n/g, "").replace(/\n/g, "").replace(/\t/g, "").replace(/\s+/g, " ").trim(), e = e.replace(/,\s*([}\]])/g, "$1"), e = e.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g, ": $2$4");
289
+ try {
290
+ return JSON.parse(e);
291
+ } catch (s) {
292
+ try {
293
+ const o = new Function(`return ${e}`)();
294
+ if (Array.isArray(o) || typeof o == "object")
295
+ return o;
296
+ throw new Error(`解析结果不是有效的数组或对象: ${s}`);
297
+ } catch (n) {
298
+ throw new Error(`无法解析JSON: ${n.message}`);
299
+ }
300
+ }
301
+ };
302
+ return (c, e) => {
303
+ var s;
304
+ return i(), m("div", Ae, [
305
+ ((s = t == null ? void 0 : t.jsonContents) == null ? void 0 : s.length) === 0 && (t != null && t.showButton) ? (i(), m("div", be, [
306
+ N("div", Te, [
307
+ N("input", {
308
+ type: "file",
309
+ ref_key: "fileInput",
310
+ ref: G,
311
+ accept: ".txt",
312
+ onChange: L,
313
+ style: { display: "none" }
314
+ }, null, 544),
315
+ N("button", {
316
+ onClick: K,
317
+ class: "import-button-content"
318
+ }, "导入文件"),
319
+ w.value ? (i(), m("span", xe, U(w.value), 1)) : $("", !0)
320
+ ])
321
+ ])) : $("", !0),
322
+ (t == null ? void 0 : t.mode) === "edit" ? (i(), m("div", $e, [
323
+ N("div", je, [
324
+ R(ae)
325
+ ]),
326
+ (i(), m("div", {
327
+ class: "model-show",
328
+ key: y.value
329
+ }, [
330
+ R(ne)
331
+ ])),
332
+ N("div", we, [
333
+ R(oe)
334
+ ])
335
+ ])) : $("", !0),
336
+ (t == null ? void 0 : t.mode) === "view" ? (i(), m("div", Ee, [
337
+ (i(), Y(Me, {
338
+ content: u.value,
339
+ onChange: b,
340
+ jsonContents: f.value,
341
+ onContentChange: M,
342
+ key: y.value
343
+ }, null, 8, ["content", "jsonContents"]))
344
+ ])) : $("", !0)
345
+ ]);
346
+ };
347
+ }
348
+ }, Ke = /* @__PURE__ */ q(Fe, [["__scopeId", "data-v-876d48c6"]]);
349
+ export {
350
+ Ke as default
351
+ };
@@ -0,0 +1,26 @@
1
+ import { _ as c } from "./index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-KVrulMLC.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
+ };