ss-component-new 1.1.17 → 1.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array-DskNZ4Qi.js +3397 -0
- package/dist/{index-hjkvqVVf.js → index-BFdnTJMh.js} +1 -1
- package/dist/index-CHUtj0kp.js +305 -0
- package/dist/index-Ctndv9Ij.js +3282 -0
- package/dist/{index-CeOZHsL0.js → index-DM0qZDHo.js} +3 -3
- package/dist/{main-C8laWp6v.js → main-DI8y-VvV.js} +20 -20
- package/dist/{menu-3a4UTvU1.js → menu-hS9inuNL.js} +1 -0
- package/dist/{modelComp-CFwQm9Yp.js → modelComp-Eh2O6nl8.js} +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +4 -4
- package/dist/ss-component.umd.cjs +16 -16
- package/package.json +3 -1
- package/dist/array-BeEcIEzJ.js +0 -3434
- package/dist/index-CKbmw71j.js +0 -3102
- package/dist/index-DWMH22gL.js +0 -238
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as S, onMounted as A, resolveComponent as l, createElementBlock as d, openBlock as o, Fragment as m, renderList as M, createBlock as r, withCtx as s, createVNode as b, createSlots as g, renderSlot as u, mergeProps as O, computed as I } from "vue";
|
|
2
|
-
import { u as R, s as q, _ as E } from "./menu-
|
|
2
|
+
import { u as R, s as q, _ as E } from "./menu-hS9inuNL.js";
|
|
3
3
|
const F = /* @__PURE__ */ S({
|
|
4
4
|
__name: "menuItem",
|
|
5
5
|
props: {
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { ref as y, onMounted as z, createElementBlock as d, openBlock as c, Fragment as K, renderList as L, createElementVNode as T, createCommentVNode as D, toDisplayString as O, watch as E, createVNode as B, unref as M, createBlock as V, resolveDynamicComponent as H } from "vue";
|
|
2
|
+
import { p as N, u as Q, d as X, e as Z, g as ee, m as ae, a as te, b as se, c as ne, s as oe } from "./array-DskNZ4Qi.js";
|
|
3
|
+
import { u as W } from "./modelComp-Eh2O6nl8.js";
|
|
4
|
+
import { _ as J, u as Y, s as F, c as j } from "./menu-hS9inuNL.js";
|
|
5
|
+
import le from "./index-DM0qZDHo.js";
|
|
6
|
+
const re = { class: "bread-content" }, ce = ["onClick"], ue = { key: 0 }, ie = {
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
breadArray: {
|
|
10
|
+
type: Array,
|
|
11
|
+
default: () => []
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
emits: ["click"],
|
|
15
|
+
setup($, { emit: x }) {
|
|
16
|
+
const e = $, A = y([]), f = x;
|
|
17
|
+
z(() => {
|
|
18
|
+
A.value = e == null ? void 0 : e.breadArray;
|
|
19
|
+
});
|
|
20
|
+
const g = (_) => {
|
|
21
|
+
f("click", _);
|
|
22
|
+
};
|
|
23
|
+
return (_, m) => (c(), d("div", re, [
|
|
24
|
+
(c(!0), d(K, null, L(A.value, (C, v) => (c(), d("div", {
|
|
25
|
+
key: v,
|
|
26
|
+
class: "bread-item"
|
|
27
|
+
}, [
|
|
28
|
+
T("div", {
|
|
29
|
+
class: "bread-title",
|
|
30
|
+
onClick: (b) => g(C)
|
|
31
|
+
}, O(C.value), 9, ce),
|
|
32
|
+
v !== A.value.length - 1 ? (c(), d("div", ue, O("/"))) : D("", !0)
|
|
33
|
+
]))), 128))
|
|
34
|
+
]));
|
|
35
|
+
}
|
|
36
|
+
}, de = /* @__PURE__ */ J(ie, [["__scopeId", "data-v-d55d3ede"]]), me = { class: "system-wrap" }, he = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "show-content"
|
|
39
|
+
}, _e = {
|
|
40
|
+
key: 0,
|
|
41
|
+
class: "item-menu-content"
|
|
42
|
+
}, ve = {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "item-view-group"
|
|
45
|
+
}, fe = {
|
|
46
|
+
__name: "index",
|
|
47
|
+
props: {
|
|
48
|
+
content: String,
|
|
49
|
+
jsonContents: Array
|
|
50
|
+
},
|
|
51
|
+
emits: ["change"],
|
|
52
|
+
setup($, { emit: x }) {
|
|
53
|
+
const e = $, A = x, f = W(N);
|
|
54
|
+
Q(N);
|
|
55
|
+
const g = Y(), { itemData: _ } = F(f), m = X(N), { selectIndex: C, selectTitle: v } = F(m), { activeMenuPath: b, activeMenuOpenPaths: q, menuTriggerType: P } = F(g), p = y([]), k = y([]), U = (a) => {
|
|
56
|
+
A("change", {
|
|
57
|
+
wholeValue: p.value,
|
|
58
|
+
editValue: a
|
|
59
|
+
});
|
|
60
|
+
}, w = (a) => {
|
|
61
|
+
var o, r;
|
|
62
|
+
const t = j(p.value), n = t == null ? void 0 : t.map((u, i) => (i === (a == null ? void 0 : a.index) && (u.compData = a == null ? void 0 : a.contents), u));
|
|
63
|
+
let l = "";
|
|
64
|
+
(r = (o = j(n)) == null ? void 0 : o.filter((u) => (u == null ? void 0 : u.comp) === "Form")) == null || r.forEach((u) => {
|
|
65
|
+
var i;
|
|
66
|
+
(i = u == null ? void 0 : u.compData) == null || i.forEach((h) => {
|
|
67
|
+
var S;
|
|
68
|
+
(h == null ? void 0 : h.key) === "formContent" && ((S = h == null ? void 0 : h.contents) == null || S.forEach((I) => {
|
|
69
|
+
I.value !== "" && (l = l === "" ? I == null ? void 0 : I.value : l + "-" + (I == null ? void 0 : I.value));
|
|
70
|
+
}));
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
let s = v == null ? void 0 : v.value;
|
|
74
|
+
(s == null ? void 0 : s.length) > 0 ? s[0] = { key: "main", value: l } : (Array.isArray(s) || (s = []), s.push({ key: "main", value: l })), m.setSelectTitle(s), p.value = n;
|
|
75
|
+
}, R = (a) => {
|
|
76
|
+
var t, n;
|
|
77
|
+
if ((a == null ? void 0 : a.key) === "main")
|
|
78
|
+
m.setSelectIndex(""), m.setSelectMenu(""), m.setSelectTitle((t = v.value) == null ? void 0 : t[0]);
|
|
79
|
+
else {
|
|
80
|
+
const l = [];
|
|
81
|
+
let s = -1;
|
|
82
|
+
(n = v.value) == null || n.forEach((o, r) => {
|
|
83
|
+
(o == null ? void 0 : o.key) === (a == null ? void 0 : a.key) && (s = r), (s === -1 || s >= r) && l.push(o);
|
|
84
|
+
}), m.setSelectTitle(l), m.setSelectMenu(a == null ? void 0 : a.key);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
E(
|
|
88
|
+
() => _.value,
|
|
89
|
+
() => {
|
|
90
|
+
var t, n, l, s, o, r, u, i;
|
|
91
|
+
if (!_.value || ((t = _.value) == null ? void 0 : t.length) === 0) return;
|
|
92
|
+
let a = null;
|
|
93
|
+
if (!b.value)
|
|
94
|
+
a = (l = (n = j(_.value)) == null ? void 0 : n.filter((h) => (h == null ? void 0 : h.comp) === "Group")) == null ? void 0 : l[0], g.setActiveMenuPath(a == null ? void 0 : a.name);
|
|
95
|
+
else {
|
|
96
|
+
const h = (s = j(_.value)) == null ? void 0 : s.filter((S) => (S == null ? void 0 : S.comp) === "Group");
|
|
97
|
+
a = h == null ? void 0 : h.find((S) => S.name === b.value);
|
|
98
|
+
}
|
|
99
|
+
k.value = (r = (o = a == null ? void 0 : a.compData) == null ? void 0 : o[0]) == null ? void 0 : r.contents, p.value = (i = (u = a == null ? void 0 : a.compData) == null ? void 0 : u[0]) == null ? void 0 : i.contents, console.log("itemData监听", b.value, _.value);
|
|
100
|
+
},
|
|
101
|
+
{ deep: !0, immediate: !0 }
|
|
102
|
+
), E(() => b.value, (a) => {
|
|
103
|
+
var t, n, l, s, o;
|
|
104
|
+
if (console.log("点击-新-data2:", a), a) {
|
|
105
|
+
const r = (t = j(_.value)) == null ? void 0 : t.find((u) => u.name === a);
|
|
106
|
+
a && r ? (k.value = (l = (n = r == null ? void 0 : r.compData) == null ? void 0 : n[0]) == null ? void 0 : l.contents, p.value = (o = (s = r == null ? void 0 : r.compData) == null ? void 0 : s[0]) == null ? void 0 : o.contents, console.log("点击-新-data:", a, k.value)) : (k.value = [], p.value = []), m.setSelectTitle([]), m.setSelectIndex(""), m.setSelectMenu("");
|
|
107
|
+
}
|
|
108
|
+
}), E(
|
|
109
|
+
() => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
|
|
110
|
+
() => {
|
|
111
|
+
var l;
|
|
112
|
+
if (((l = e == null ? void 0 : e.jsonContents) == null ? void 0 : l.length) > 0) {
|
|
113
|
+
f.setOriginalData(e == null ? void 0 : e.jsonContents), f.setItemData(e == null ? void 0 : e.jsonContents);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (!(e != null && e.content) || (e == null ? void 0 : e.content) === "") return;
|
|
117
|
+
const a = Z(e == null ? void 0 : e.content);
|
|
118
|
+
console.log("newViewContents", a);
|
|
119
|
+
const t = Array.isArray(a) && (a == null ? void 0 : a.find((s) => {
|
|
120
|
+
var o;
|
|
121
|
+
return ((o = s.comp) == null ? void 0 : o.toUpperCase()) === "MENU";
|
|
122
|
+
}));
|
|
123
|
+
g.setRawMenu(t ?? {});
|
|
124
|
+
const n = Array.isArray(a) && (a == null ? void 0 : a.find((s) => {
|
|
125
|
+
var o;
|
|
126
|
+
return ((o = s.comp) == null ? void 0 : o.toUpperCase()) === "SYSTEM";
|
|
127
|
+
}));
|
|
128
|
+
g.setSystemKey((n == null ? void 0 : n.name) ?? ""), f.setOriginalData(a), f.setItemData(a);
|
|
129
|
+
},
|
|
130
|
+
{ deep: !0, immediate: !0 }
|
|
131
|
+
);
|
|
132
|
+
const G = (a) => ee(a);
|
|
133
|
+
return (a, t) => {
|
|
134
|
+
var n, l;
|
|
135
|
+
return c(), d("div", me, [
|
|
136
|
+
B(le, { class: "sys-aside" }),
|
|
137
|
+
((n = k.value) == null ? void 0 : n.length) > 0 ? (c(), d("div", he, [
|
|
138
|
+
((l = M(v)) == null ? void 0 : l.length) > 1 ? (c(), d("div", _e, [
|
|
139
|
+
(c(), V(de, {
|
|
140
|
+
key: M(v),
|
|
141
|
+
breadArray: M(v),
|
|
142
|
+
onClick: R
|
|
143
|
+
}, null, 8, ["breadArray"]))
|
|
144
|
+
])) : D("", !0),
|
|
145
|
+
(c(!0), d(K, null, L(k.value, (s, o) => (c(), d("div", {
|
|
146
|
+
class: "item-content",
|
|
147
|
+
key: o
|
|
148
|
+
}, [
|
|
149
|
+
M(C) === "" || o.toString() === M(C) ? (c(), d("div", ve, O(s.name), 1)) : D("", !0),
|
|
150
|
+
M(C) === "" || o.toString() === M(C) ? (c(), V(H(G(s.comp)), {
|
|
151
|
+
itemData: s == null ? void 0 : s.compData,
|
|
152
|
+
childItemData: s == null ? void 0 : s.itemChildData,
|
|
153
|
+
key: o,
|
|
154
|
+
onChange: U,
|
|
155
|
+
index: o,
|
|
156
|
+
onContentChange: w
|
|
157
|
+
}, null, 40, ["itemData", "childItemData", "index"])) : D("", !0)
|
|
158
|
+
]))), 128))
|
|
159
|
+
])) : D("", !0)
|
|
160
|
+
]);
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}, ye = /* @__PURE__ */ J(fe, [["__scopeId", "data-v-a92e5168"]]), ge = { class: "add-model-content" }, Ce = {
|
|
164
|
+
key: 0,
|
|
165
|
+
class: "model-import-data"
|
|
166
|
+
}, pe = { class: "import-button" }, ke = { key: 0 }, De = {
|
|
167
|
+
key: 1,
|
|
168
|
+
class: "model-operate"
|
|
169
|
+
}, Se = { class: "model-select" }, Ae = { class: "model-fill" }, be = {
|
|
170
|
+
key: 2,
|
|
171
|
+
class: "model-view"
|
|
172
|
+
}, Ie = {
|
|
173
|
+
__name: "index",
|
|
174
|
+
props: {
|
|
175
|
+
mode: {
|
|
176
|
+
type: String,
|
|
177
|
+
default: "view"
|
|
178
|
+
},
|
|
179
|
+
content: {
|
|
180
|
+
type: String,
|
|
181
|
+
default: ""
|
|
182
|
+
},
|
|
183
|
+
jsonContents: {
|
|
184
|
+
type: Array,
|
|
185
|
+
default: () => []
|
|
186
|
+
},
|
|
187
|
+
showButton: {
|
|
188
|
+
type: Boolean,
|
|
189
|
+
default: !0
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
emits: ["change"],
|
|
193
|
+
setup($, { emit: x }) {
|
|
194
|
+
const e = $, A = x, f = y(""), g = y([]), _ = y(0), m = W(N), C = Y(N), { itemData: v, originalData: b } = F(m), { activeMenuPath: q } = F(C), P = y(null), p = y(0), k = y(""), U = (t) => {
|
|
195
|
+
var l, s, o;
|
|
196
|
+
const n = (l = j(t == null ? void 0 : t.wholeValue)) == null ? void 0 : l.map((r) => {
|
|
197
|
+
var u;
|
|
198
|
+
return (r == null ? void 0 : r.comp) === "Form" && (r.compData = (u = r.compData) == null ? void 0 : u.map((i) => ((i == null ? void 0 : i.key) === "formContent" && (i.contents = ne(i == null ? void 0 : i.contents)), i))), r;
|
|
199
|
+
});
|
|
200
|
+
A("change", {
|
|
201
|
+
originalContents: b.value,
|
|
202
|
+
currentContents: t == null ? void 0 : t.wholeValue,
|
|
203
|
+
editContent: t == null ? void 0 : t.editValue,
|
|
204
|
+
arrayToContents: n
|
|
205
|
+
}), oe(t == null ? void 0 : t.wholeValue, (s = t == null ? void 0 : t.editValue) == null ? void 0 : s.content, (o = t == null ? void 0 : t.editValue) == null ? void 0 : o.buttonName), console.log("change123", t == null ? void 0 : t.editValue, t == null ? void 0 : t.wholeValue);
|
|
206
|
+
}, w = y([]), R = () => {
|
|
207
|
+
P.value.click();
|
|
208
|
+
}, G = (t) => {
|
|
209
|
+
const n = t.target.files[0];
|
|
210
|
+
if (!n) return;
|
|
211
|
+
const l = new FileReader();
|
|
212
|
+
l.onload = (s) => {
|
|
213
|
+
try {
|
|
214
|
+
f.value = s.target.result, w.value = a(s.target.result), p.value++;
|
|
215
|
+
} catch (o) {
|
|
216
|
+
console.error("解析失败:", o);
|
|
217
|
+
}
|
|
218
|
+
}, l.onerror = (s) => {
|
|
219
|
+
console.error("文件读取错误:", s);
|
|
220
|
+
}, l.readAsText(n);
|
|
221
|
+
};
|
|
222
|
+
E(
|
|
223
|
+
() => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
|
|
224
|
+
() => {
|
|
225
|
+
f.value = e == null ? void 0 : e.content, g.value = e == null ? void 0 : e.jsonContents;
|
|
226
|
+
},
|
|
227
|
+
{ deep: !0, immediate: !0 }
|
|
228
|
+
), E(
|
|
229
|
+
() => p.value,
|
|
230
|
+
() => {
|
|
231
|
+
var t;
|
|
232
|
+
((t = w.value) == null ? void 0 : t.length) !== 0 && (m.setOriginalData(w.value), m.setItemData(w.value));
|
|
233
|
+
},
|
|
234
|
+
{ deep: !0, immediate: !0 }
|
|
235
|
+
);
|
|
236
|
+
const a = (t) => {
|
|
237
|
+
let n = t.replace(/,/g, ",").replace(/;/g, ";").replace(/:/g, ":");
|
|
238
|
+
n = n.replace(/(\w+)\s*:/g, "$1:"), n = n.replace(/\r\n/g, "").replace(/\n/g, "").replace(/\t/g, "").replace(/\s+/g, " ").trim(), n = n.replace(/,\s*([}\]])/g, "$1"), n = n.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g, ": $2$4");
|
|
239
|
+
try {
|
|
240
|
+
return JSON.parse(n);
|
|
241
|
+
} catch (l) {
|
|
242
|
+
try {
|
|
243
|
+
const o = new Function(`return ${n}`)();
|
|
244
|
+
if (Array.isArray(o) || typeof o == "object")
|
|
245
|
+
return o;
|
|
246
|
+
throw new Error(`解析结果不是有效的数组或对象: ${l}`);
|
|
247
|
+
} catch (s) {
|
|
248
|
+
throw new Error(`无法解析JSON: ${s.message}`);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
return (t, n) => {
|
|
253
|
+
var l;
|
|
254
|
+
return c(), d("div", ge, [
|
|
255
|
+
((l = e == null ? void 0 : e.jsonContents) == null ? void 0 : l.length) === 0 && (e != null && e.showButton) ? (c(), d("div", Ce, [
|
|
256
|
+
T("div", pe, [
|
|
257
|
+
T("input", {
|
|
258
|
+
type: "file",
|
|
259
|
+
ref_key: "fileInput",
|
|
260
|
+
ref: P,
|
|
261
|
+
accept: ".txt",
|
|
262
|
+
onChange: G,
|
|
263
|
+
style: { display: "none" }
|
|
264
|
+
}, null, 544),
|
|
265
|
+
T("button", {
|
|
266
|
+
onClick: R,
|
|
267
|
+
class: "import-button-content"
|
|
268
|
+
}, "导入文件"),
|
|
269
|
+
k.value ? (c(), d("span", ke, O(k.value), 1)) : D("", !0)
|
|
270
|
+
])
|
|
271
|
+
])) : D("", !0),
|
|
272
|
+
(e == null ? void 0 : e.mode) === "edit" ? (c(), d("div", De, [
|
|
273
|
+
T("div", Se, [
|
|
274
|
+
B(ae)
|
|
275
|
+
]),
|
|
276
|
+
(c(), d("div", {
|
|
277
|
+
class: "model-show",
|
|
278
|
+
key: _.value
|
|
279
|
+
}, [
|
|
280
|
+
B(te)
|
|
281
|
+
])),
|
|
282
|
+
T("div", Ae, [
|
|
283
|
+
B(se)
|
|
284
|
+
])
|
|
285
|
+
])) : D("", !0),
|
|
286
|
+
(e == null ? void 0 : e.mode) === "view" ? (c(), d("div", be, [
|
|
287
|
+
(c(), V(ye, {
|
|
288
|
+
content: f.value,
|
|
289
|
+
onChange: U,
|
|
290
|
+
jsonContents: g.value,
|
|
291
|
+
key: _.value
|
|
292
|
+
}, null, 8, ["content", "jsonContents"]))
|
|
293
|
+
])) : D("", !0)
|
|
294
|
+
]);
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
}, Me = /* @__PURE__ */ J(Ie, [["__scopeId", "data-v-c8a54bd8"]]), $e = {
|
|
298
|
+
__name: "index",
|
|
299
|
+
setup($) {
|
|
300
|
+
return (x, e) => (c(), V(Me, { class: "ssComponent" }));
|
|
301
|
+
}
|
|
302
|
+
}, Ne = /* @__PURE__ */ J($e, [["__scopeId", "data-v-f196ec9f"]]);
|
|
303
|
+
export {
|
|
304
|
+
Ne as default
|
|
305
|
+
};
|