ss-component-new 1.1.21 → 1.1.23

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