ss-component-new 1.1.32 → 1.1.34

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.
@@ -1,5 +1,5 @@
1
- import { defineAsyncComponent as j, computed as $, onMounted as O, resolveComponent as A, createBlock as C, openBlock as b, withCtx as F, resolveDynamicComponent as B, defineComponent as U, ref as v, watch as G, createVNode as V, createElementVNode as q, toDisplayString as z } from "vue";
2
- import { E as y, u as H, s as E } from "./menu-CER-9e62.js";
1
+ import { defineAsyncComponent as j, computed as E, onMounted as O, resolveComponent as A, createBlock as C, openBlock as b, withCtx as F, resolveDynamicComponent as B, defineComponent as U, ref as $, watch as G, createVNode as V, createElementVNode as q, toDisplayString as z } from "vue";
2
+ import { E as y, u as H, s as v } from "./menu-CER-9e62.js";
3
3
  import { u as J } from "./modelComp-BrI6MfnJ.js";
4
4
  import { c as _, _ as K } from "./_plugin-vue_export-helper-B7R8Jogt.js";
5
5
  const D = j(() => import("./index-BbRwol9Q.js"));
@@ -12,7 +12,7 @@ const Q = {
12
12
  name: String
13
13
  },
14
14
  setup(r) {
15
- const c = r, p = $(() => y[c.name]);
15
+ const c = r, p = E(() => y[c.name]);
16
16
  return O(() => {
17
17
  const m = Object.keys(y);
18
18
  console.log("iconComponent", p.value, c.name, y, m);
@@ -33,7 +33,7 @@ const Q = {
33
33
  DynamicIcon: Q
34
34
  },
35
35
  setup() {
36
- const r = H(), c = J(), { rawMenu: p, menuTriggerType: m } = E(r), { itemData: f } = E(c), d = v([]);
36
+ const r = H(), c = J(), { rawMenu: p, menuTriggerType: m } = v(r), { itemData: f } = v(c), d = $([]);
37
37
  let M;
38
38
  ((e) => {
39
39
  e[e.Menu = 0] = "Menu", e[e.FolderOpened = 1] = "FolderOpened";
@@ -78,7 +78,7 @@ const Q = {
78
78
  };
79
79
  return a.children && a.children.length > 0 && (l.children = S(a.children, i, n + 1)), l;
80
80
  });
81
- }, T = $(() => {
81
+ }, T = E(() => {
82
82
  const e = S(d.value);
83
83
  return console.log("temps", e), r.setMenus(e), e;
84
84
  }), k = (e) => {
@@ -87,7 +87,7 @@ const Q = {
87
87
  m.value === "click" ? r.setActiveMenuPath(e) : r.setMenuTriggerType("click");
88
88
  }, L = (e) => {
89
89
  r.setActiveMenuPath(e);
90
- }, N = v([
90
+ }, N = $([
91
91
  {
92
92
  name: "--ssComponent-menu-bg",
93
93
  value: "#426ec4"
@@ -43928,28 +43928,42 @@ const d7 = {
43928
43928
  ref: i
43929
43929
  }, null, 512));
43930
43930
  }
43931
- }, g7 = /* @__PURE__ */ Lb(d7, [["__scopeId", "data-v-798284db"]]), y7 = (r, e) => {
43932
- var n, i, o, s;
43933
- let t = e;
43934
- t.xAxis.data = (n = Ki(r)) == null ? void 0 : n.map((l) => l.x), t.legend.data = (o = (i = Ki(r)) == null ? void 0 : i[0]) != null && o.y ? Object.keys(Ki(r)[0].y) : [];
43935
- let a = [];
43936
- return ((s = t.legend.data) == null ? void 0 : s.length) > 0 && Ki(t.legend.data).forEach((l) => {
43937
- var f;
43938
- const u = (f = Ki(r)) == null ? void 0 : f.map((h) => {
43939
- var v;
43940
- return (v = h == null ? void 0 : h.y) == null ? void 0 : v[l];
43931
+ }, g7 = /* @__PURE__ */ Lb(d7, [["__scopeId", "data-v-798284db"]]), y7 = (r, e, t) => {
43932
+ var i, o, s, l;
43933
+ let a = e;
43934
+ a.title.text = (t == null ? void 0 : t.chartName) ?? "", a.xAxis.data = (i = Ki(r)) == null ? void 0 : i.map((u) => u.x), a.legend.data = (s = (o = Ki(r)) == null ? void 0 : o[0]) != null && s.y ? Object.keys(Ki(r)[0].y) : [];
43935
+ let n = [];
43936
+ return ((l = a.legend.data) == null ? void 0 : l.length) > 0 && Ki(a.legend.data).forEach((u) => {
43937
+ var h;
43938
+ const f = (h = Ki(r)) == null ? void 0 : h.map((v) => {
43939
+ var c;
43940
+ return (c = v == null ? void 0 : v.y) == null ? void 0 : c[u];
43941
43941
  });
43942
- a.push({
43943
- name: l,
43942
+ n.push({
43943
+ name: u,
43944
43944
  type: "line",
43945
43945
  stack: "Total",
43946
- data: u
43946
+ data: f
43947
43947
  });
43948
- }), t.series = a, t;
43948
+ }), a.series = n, a;
43949
43949
  }, _p = [
43950
43950
  {
43951
43951
  key: "折线图",
43952
43952
  value: {
43953
+ title: {
43954
+ text: "",
43955
+ // 标题文本
43956
+ left: "center",
43957
+ // 水平居中
43958
+ top: 25,
43959
+ // 距离顶部距离
43960
+ textStyle: {
43961
+ // 文本样式
43962
+ color: "#333",
43963
+ fontSize: 18,
43964
+ fontWeight: "bold"
43965
+ }
43966
+ },
43953
43967
  tooltip: {
43954
43968
  trigger: "axis"
43955
43969
  },
@@ -43986,12 +44000,12 @@ const d7 = {
43986
44000
  return Ab(() => {
43987
44001
  var n;
43988
44002
  const a = e == null ? void 0 : e.eChartContents;
43989
- t.value = y7(Ki(a == null ? void 0 : a.compData), (n = _p == null ? void 0 : _p.find((i) => (i == null ? void 0 : i.key) === (a == null ? void 0 : a.name))) == null ? void 0 : n.value);
44003
+ t.value = y7(Ki(a == null ? void 0 : a.compData), (n = _p == null ? void 0 : _p.find((i) => (i == null ? void 0 : i.key) === (a == null ? void 0 : a.name))) == null ? void 0 : n.value, a == null ? void 0 : a.extraContent);
43990
44004
  }), (a, n) => (Ib(), Mb("div", m7, [
43991
44005
  pL(g7, { optionContents: t.value }, null, 8, ["optionContents"])
43992
44006
  ]));
43993
44007
  }
43994
- }, w7 = /* @__PURE__ */ Lb(_7, [["__scopeId", "data-v-e2fd0c0f"]]);
44008
+ }, w7 = /* @__PURE__ */ Lb(_7, [["__scopeId", "data-v-0440fac3"]]);
43995
44009
  export {
43996
44010
  w7 as default
43997
44011
  };
@@ -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 T, toDisplayString as U, watch as O, createVNode as R, unref as E, createBlock as G, resolveDynamicComponent as te } from "vue";
2
+ import { p as J, 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-QkRCQCnN.js";
3
+ import { u as Q } from "./modelComp-BrI6MfnJ.js";
4
+ import { u as X, s as P } from "./menu-CER-9e62.js";
5
+ import ie from "./index-BBJEg3iA.js";
6
+ import { _ as V, c as B } from "./_plugin-vue_export-helper-B7R8Jogt.js";
7
+ const de = { class: "bread-content" }, me = ["onClick"], fe = { key: 0 }, he = {
8
+ __name: "index",
9
+ props: {
10
+ breadArray: {
11
+ type: Array,
12
+ default: () => []
13
+ }
14
+ },
15
+ emits: ["click"],
16
+ setup(_, { emit: y }) {
17
+ const t = _, d = D([]), u = y;
18
+ ee(() => {
19
+ d.value = t == null ? void 0 : t.breadArray;
20
+ });
21
+ const f = (p) => {
22
+ u("click", p);
23
+ };
24
+ return (p, v) => (i(), m("div", de, [
25
+ (i(!0), m(z, null, H(d.value, (h, g) => (i(), m("div", {
26
+ key: g,
27
+ class: "bread-item"
28
+ }, [
29
+ N("div", {
30
+ class: "bread-title",
31
+ onClick: (A) => f(h)
32
+ }, U(h.value), 9, me),
33
+ g !== d.value.length - 1 ? (i(), m("div", fe, U("/"))) : T("", !0)
34
+ ]))), 128))
35
+ ]));
36
+ }
37
+ }, ve = /* @__PURE__ */ V(he, [["__scopeId", "data-v-d55d3ede"]]);
38
+ function ge(_) {
39
+ const y = [], t = {
40
+ "(": ")",
41
+ "{": "}",
42
+ "[": "]"
43
+ };
44
+ for (let d = 0; d < _.length; d++) {
45
+ const u = _[d];
46
+ if (t[u])
47
+ y.push(u);
48
+ else if (Object.values(t).includes(u)) {
49
+ const f = y.pop();
50
+ if (console.log("stack", y, f, t[f]), t[f] !== u)
51
+ return !1;
52
+ }
53
+ }
54
+ return y.length === 0;
55
+ }
56
+ function _e(_) {
57
+ var d, u, f, p;
58
+ const y = (u = (d = _[0]) == null ? void 0 : d.compData) == null ? void 0 : u.filter((v) => v.key !== "formContent"), t = (p = (f = _[0]) == null ? void 0 : f.compData) == null ? void 0 : p.filter((v) => v.key === "formContent");
59
+ console.log("handleFormModel:", y, t, _);
60
+ }
61
+ const ye = { class: "system-wrap" }, pe = {
62
+ key: 0,
63
+ class: "show-content"
64
+ }, Ce = {
65
+ key: 0,
66
+ class: "item-menu-content"
67
+ }, ke = {
68
+ key: 0,
69
+ class: "item-view-group"
70
+ }, De = {
71
+ __name: "index",
72
+ props: {
73
+ content: String,
74
+ jsonContents: Array
75
+ },
76
+ emits: ["change", "contentChange"],
77
+ setup(_, { emit: y }) {
78
+ const t = _, d = y, u = Q(J);
79
+ ae(J);
80
+ const f = D(!0), p = X(), v = D(!0), { itemData: h } = P(u), g = ne(J), { activeMenuPath: A, activeMenuOpenPaths: Z, menuTriggerType: K, menus: L } = P(p), { selectIndex: w, selectTitle: M } = P(g), b = D([]), C = D([]), W = (e) => {
81
+ var n, o, a;
82
+ const s = (n = h.value) == null ? void 0 : n.find((l) => l.name === A.value);
83
+ C.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", {
84
+ wholeValue: b.value,
85
+ editValue: e
86
+ });
87
+ }, Y = (e) => {
88
+ var S, k, $;
89
+ 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));
90
+ let o = "";
91
+ (k = (S = B(n)) == null ? void 0 : S.filter((r) => (r == null ? void 0 : r.comp) === "Form")) == null || k.forEach((r) => {
92
+ var I;
93
+ (I = r == null ? void 0 : r.compData) == null || I.forEach((x) => {
94
+ var j;
95
+ (x == null ? void 0 : x.key) === "formContent" && ((j = x == null ? void 0 : x.contents) == null || j.forEach((F) => {
96
+ F.value !== "" && (o = o === "" ? F == null ? void 0 : F.value : o + "-" + (F == null ? void 0 : F.value));
97
+ }));
98
+ });
99
+ });
100
+ let a = M == null ? void 0 : M.value;
101
+ (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;
102
+ const l = ($ = h.value) == null ? void 0 : $.map((r, I) => {
103
+ var x;
104
+ 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;
105
+ });
106
+ u.setItemData(l), v.value && (v.value = !1), d("contentChange", {
107
+ wholeContent: h.value
108
+ });
109
+ }, q = (e) => {
110
+ var s, n;
111
+ if ((e == null ? void 0 : e.key) === "main")
112
+ g.setSelectIndex(""), g.setSelectMenu(""), g.setSelectTitle((s = M.value) == null ? void 0 : s[0]);
113
+ else {
114
+ const o = [];
115
+ let a = -1;
116
+ (n = M.value) == null || n.forEach((l, S) => {
117
+ (l == null ? void 0 : l.key) === (e == null ? void 0 : e.key) && (a = S), (a === -1 || a >= S) && o.push(l);
118
+ }), g.setSelectTitle(o), g.setSelectMenu(e == null ? void 0 : e.key);
119
+ }
120
+ };
121
+ O(
122
+ () => h.value,
123
+ () => {
124
+ var s, n, o, a, l, S, k, $;
125
+ if (!h.value || ((s = h.value) == null ? void 0 : s.length) === 0 || !f.value) return;
126
+ let e = null;
127
+ if (!A.value)
128
+ e = (o = (n = B(h.value)) == null ? void 0 : n.filter((r) => (r == null ? void 0 : r.comp) === "Group")) == null ? void 0 : o[0], p.setActiveMenuPath(e == null ? void 0 : e.name);
129
+ else {
130
+ const r = (a = B(h.value)) == null ? void 0 : a.filter((I) => (I == null ? void 0 : I.comp) === "Group");
131
+ e = r == null ? void 0 : r.find((I) => I.name === A.value);
132
+ }
133
+ C.value = (S = (l = e == null ? void 0 : e.compData) == null ? void 0 : l[0]) == null ? void 0 : S.contents, b.value = ($ = (k = e == null ? void 0 : e.compData) == null ? void 0 : k[0]) == null ? void 0 : $.contents, console.log("itemData监听", e, A.value, h.value);
134
+ },
135
+ { deep: !0, immediate: !0 }
136
+ ), O(() => A.value, (e) => {
137
+ var s, n, o, a, l, S;
138
+ if (e) {
139
+ const k = (s = B(h.value)) == null ? void 0 : s.find(($) => $.name === e);
140
+ if (e && k) {
141
+ C.value = (o = (n = k == null ? void 0 : k.compData) == null ? void 0 : n[0]) == null ? void 0 : o.contents, b.value = (l = (a = k == null ? void 0 : k.compData) == null ? void 0 : a[0]) == null ? void 0 : l.contents, console.log("点击-新-data:", e, C.value);
142
+ const $ = (S = C.value) == null ? void 0 : S.filter((r) => r.comp === "Form");
143
+ _e($);
144
+ } else
145
+ C.value = [], b.value = [];
146
+ g.setSelectTitle([]), g.setSelectIndex(""), g.setSelectMenu("");
147
+ }
148
+ }, {
149
+ immediate: !0
150
+ }), O(
151
+ () => [t == null ? void 0 : t.content, t == null ? void 0 : t.jsonContents],
152
+ () => {
153
+ var o;
154
+ if (((o = t == null ? void 0 : t.jsonContents) == null ? void 0 : o.length) > 0) {
155
+ u.setOriginalData(t == null ? void 0 : t.jsonContents), u.setItemData(t == null ? void 0 : t.jsonContents);
156
+ return;
157
+ }
158
+ if (!(t != null && t.content) || (t == null ? void 0 : t.content) === "") return;
159
+ f.value = !0;
160
+ const e = oe(t == null ? void 0 : t.content), s = Array.isArray(e) && (e == null ? void 0 : e.find((a) => {
161
+ var l;
162
+ return ((l = a.comp) == null ? void 0 : l.toUpperCase()) === "MENU";
163
+ }));
164
+ p.setRawMenu(s ?? {});
165
+ const n = Array.isArray(e) && (e == null ? void 0 : e.find((a) => {
166
+ var l;
167
+ return ((l = a.comp) == null ? void 0 : l.toUpperCase()) === "SYSTEM";
168
+ }));
169
+ p.setSystemKey((n == null ? void 0 : n.name) ?? ""), u.setOriginalData(e), u.setItemData(e);
170
+ },
171
+ { deep: !0, immediate: !0 }
172
+ );
173
+ const c = (e) => se(e);
174
+ return (e, s) => {
175
+ var n, o;
176
+ return i(), m("div", ye, [
177
+ R(ie, { class: "sys-aside" }),
178
+ ((n = C.value) == null ? void 0 : n.length) > 0 ? (i(), m("div", pe, [
179
+ ((o = E(M)) == null ? void 0 : o.length) > 1 ? (i(), m("div", Ce, [
180
+ (i(), G(ve, {
181
+ key: E(M),
182
+ breadArray: E(M),
183
+ onClick: q
184
+ }, null, 8, ["breadArray"]))
185
+ ])) : T("", !0),
186
+ (i(!0), m(z, null, H(C.value, (a, l) => (i(), m("div", {
187
+ class: "item-content",
188
+ key: l
189
+ }, [
190
+ E(w) === "" || l.toString() === E(w) ? (i(), m("div", ke, U(a.name), 1)) : T("", !0),
191
+ E(w) === "" || l.toString() === E(w) ? (i(), G(te(c(a.comp)), {
192
+ itemData: a == null ? void 0 : a.compData,
193
+ childItemData: a == null ? void 0 : a.itemChildData,
194
+ key: l,
195
+ onChange: W,
196
+ index: l,
197
+ onContentChange: Y
198
+ }, null, 40, ["itemData", "childItemData", "index"])) : T("", !0)
199
+ ]))), 128))
200
+ ])) : T("", !0)
201
+ ]);
202
+ };
203
+ }
204
+ }, Se = /* @__PURE__ */ V(De, [["__scopeId", "data-v-59cfbaff"]]), Ie = { class: "add-model-content" }, Me = {
205
+ key: 0,
206
+ class: "model-import-data"
207
+ }, Ae = { class: "import-button" }, be = { key: 0 }, $e = {
208
+ key: 1,
209
+ class: "model-operate"
210
+ }, xe = { class: "model-select" }, Te = { class: "model-fill" }, je = {
211
+ key: 2,
212
+ class: "model-view"
213
+ }, we = {
214
+ __name: "index",
215
+ props: {
216
+ mode: {
217
+ type: String,
218
+ default: "view"
219
+ },
220
+ content: {
221
+ type: String,
222
+ default: ""
223
+ },
224
+ jsonContents: {
225
+ type: Array,
226
+ default: () => []
227
+ },
228
+ showButton: {
229
+ type: Boolean,
230
+ default: !0
231
+ }
232
+ },
233
+ emits: ["change", "contentChange"],
234
+ setup(_, { emit: y }) {
235
+ const t = _, d = y, u = D(""), f = D([]), p = D(0), v = Q(J), h = X(J), { itemData: g, originalData: A } = P(v), { activeMenuPath: Z } = P(h), K = D(null), L = D(0), w = D(""), M = (c) => {
236
+ d("contentChange", c);
237
+ }, b = (c) => {
238
+ var s;
239
+ const e = (s = B(c == null ? void 0 : c.wholeValue)) == null ? void 0 : s.map((n) => {
240
+ var o;
241
+ 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 = ue(a == null ? void 0 : a.contents)), a))), n;
242
+ });
243
+ d("change", {
244
+ originalContents: A.value,
245
+ currentContents: c == null ? void 0 : c.wholeValue,
246
+ editContent: c == null ? void 0 : c.editValue,
247
+ arrayToContents: e
248
+ });
249
+ }, C = D([]), W = () => {
250
+ K.value.click();
251
+ }, Y = (c) => {
252
+ const e = c.target.files[0];
253
+ if (!e) return;
254
+ const s = new FileReader();
255
+ s.onload = (n) => {
256
+ try {
257
+ u.value = n.target.result;
258
+ const o = ge(n.target.result);
259
+ console.log("handleFileChange-isValid", o), C.value = q(n.target.result), L.value++;
260
+ } catch (o) {
261
+ console.error("解析失败:", o);
262
+ }
263
+ }, s.onerror = (n) => {
264
+ console.error("文件读取错误:", n);
265
+ }, s.readAsText(e);
266
+ };
267
+ O(
268
+ () => [t == null ? void 0 : t.content, t == null ? void 0 : t.jsonContents],
269
+ () => {
270
+ u.value = t == null ? void 0 : t.content, f.value = t == null ? void 0 : t.jsonContents;
271
+ },
272
+ { deep: !0, immediate: !0 }
273
+ ), O(
274
+ () => L.value,
275
+ () => {
276
+ var c;
277
+ ((c = C.value) == null ? void 0 : c.length) !== 0 && (v.setOriginalData(C.value), v.setItemData(C.value));
278
+ },
279
+ { deep: !0, immediate: !0 }
280
+ );
281
+ const q = (c) => {
282
+ let e = c.replace(/,/g, ",").replace(/;/g, ";").replace(/:/g, ":");
283
+ 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");
284
+ try {
285
+ return JSON.parse(e);
286
+ } catch (s) {
287
+ try {
288
+ const o = new Function(`return ${e}`)();
289
+ if (Array.isArray(o) || typeof o == "object")
290
+ return o;
291
+ throw new Error(`解析结果不是有效的数组或对象: ${s}`);
292
+ } catch (n) {
293
+ throw new Error(`无法解析JSON: ${n.message}`);
294
+ }
295
+ }
296
+ };
297
+ return (c, e) => {
298
+ var s;
299
+ return i(), m("div", Ie, [
300
+ ((s = t == null ? void 0 : t.jsonContents) == null ? void 0 : s.length) === 0 && (t != null && t.showButton) ? (i(), m("div", Me, [
301
+ N("div", Ae, [
302
+ N("input", {
303
+ type: "file",
304
+ ref_key: "fileInput",
305
+ ref: K,
306
+ accept: ".txt",
307
+ onChange: Y,
308
+ style: { display: "none" }
309
+ }, null, 544),
310
+ N("button", {
311
+ onClick: W,
312
+ class: "import-button-content"
313
+ }, "导入文件"),
314
+ w.value ? (i(), m("span", be, U(w.value), 1)) : T("", !0)
315
+ ])
316
+ ])) : T("", !0),
317
+ (t == null ? void 0 : t.mode) === "edit" ? (i(), m("div", $e, [
318
+ N("div", xe, [
319
+ R(le)
320
+ ]),
321
+ (i(), m("div", {
322
+ class: "model-show",
323
+ key: p.value
324
+ }, [
325
+ R(re)
326
+ ])),
327
+ N("div", Te, [
328
+ R(ce)
329
+ ])
330
+ ])) : T("", !0),
331
+ (t == null ? void 0 : t.mode) === "view" ? (i(), m("div", je, [
332
+ (i(), G(Se, {
333
+ content: u.value,
334
+ onChange: b,
335
+ jsonContents: f.value,
336
+ onContentChange: M,
337
+ key: p.value
338
+ }, null, 8, ["content", "jsonContents"]))
339
+ ])) : T("", !0)
340
+ ]);
341
+ };
342
+ }
343
+ }, Fe = /* @__PURE__ */ V(we, [["__scopeId", "data-v-876d48c6"]]), Ee = {
344
+ __name: "index",
345
+ setup(_) {
346
+ return (y, t) => (i(), G(Fe, { class: "ssComponent" }));
347
+ }
348
+ }, Ue = /* @__PURE__ */ V(Ee, [["__scopeId", "data-v-f196ec9f"]]);
349
+ export {
350
+ Ue as default
351
+ };