ss-component-new 1.1.69 → 1.1.70

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,8 +1,10 @@
1
1
  import { ref as _, watch as V, createElementBlock as C, createCommentVNode as I, openBlock as f, Fragment as le, renderList as se, createElementVNode as O, createBlock as Z, toDisplayString as v, resolveDynamicComponent as ue, onMounted as ce, createVNode as A } from "vue";
2
- import { p as E, e as ie, g as de, m as me, a as ye, b as fe, c as ge } from "./array-BGMpYX__.js";
3
- import { u as ee } from "./modelComp-Cr1QF6ip.js";
4
- import { s as te, u as he } from "./menu-D6yKPqgS.js";
5
- import { _ as ne, c as k } from "./_plugin-vue_export-helper-B7R8Jogt.js";
2
+ import { m as ie, a as me, b as de } from "./index-DT5WJi3E.js";
3
+ import { p as E, e as ye, g as fe, a as ge } from "./array-BAin2LgZ.js";
4
+ import { u as ee } from "./modelComp-CvlV4fLW.js";
5
+ import { s as te, u as he } from "./menu-R7bFdGaV.js";
6
+ import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ import { c as k } from "./cloneDeep-D5Kd1l4C.js";
6
8
  const x = [
7
9
  {
8
10
  key: "FormName",
@@ -56,20 +58,20 @@ const x = [
56
58
  },
57
59
  emits: ["change"],
58
60
  setup(F, { emit: B }) {
59
- const e = F, $ = B, h = ee(E), { itemData: b } = te(h), p = _([]), w = _([]), L = (l) => {
61
+ const e = F, $ = B, h = ee(E), { itemData: p } = te(h), b = _([]), w = _([]), L = (l) => {
60
62
  $("change", {
61
- wholeValue: p.value,
63
+ wholeValue: b.value,
62
64
  editValue: l
63
65
  });
64
66
  }, D = (l) => {
65
- const g = k(p.value), S = g == null ? void 0 : g.map((c, j) => (j === (l == null ? void 0 : l.index) && (c.compData = l == null ? void 0 : l.contents), c));
66
- p.value = S;
67
+ const g = k(b.value), S = g == null ? void 0 : g.map((c, j) => (j === (l == null ? void 0 : l.index) && (c.compData = l == null ? void 0 : l.contents), c));
68
+ b.value = S;
67
69
  };
68
70
  V(
69
- () => b.value,
71
+ () => p.value,
70
72
  () => {
71
73
  var l;
72
- !b.value || ((l = b.value) == null ? void 0 : l.length) === 0 || (w.value = b.value, p.value = b.value);
74
+ !p.value || ((l = p.value) == null ? void 0 : l.length) === 0 || (w.value = p.value, b.value = p.value);
73
75
  },
74
76
  { deep: !0, immediate: !0 }
75
77
  ), V(
@@ -81,12 +83,12 @@ const x = [
81
83
  return;
82
84
  }
83
85
  if (!(e != null && e.content) || (e == null ? void 0 : e.content) === "") return;
84
- const l = ie(e == null ? void 0 : e.content);
86
+ const l = ye(e == null ? void 0 : e.content);
85
87
  h.setOriginalData(l), h.setItemData(l);
86
88
  },
87
89
  { deep: !0, immediate: !0 }
88
90
  );
89
- const N = (l) => de(l);
91
+ const N = (l) => fe(l);
90
92
  return (l, g) => {
91
93
  var S;
92
94
  return ((S = w.value) == null ? void 0 : S.length) > 0 ? (f(), C("div", ke, [
@@ -107,7 +109,7 @@ const x = [
107
109
  ])) : I("", !0);
108
110
  };
109
111
  }
110
- }, be = /* @__PURE__ */ ne(Ce, [["__scopeId", "data-v-869e6e20"]]), pe = { class: "add-model-content" }, we = {
112
+ }, pe = /* @__PURE__ */ ne(Ce, [["__scopeId", "data-v-869e6e20"]]), be = { class: "add-model-content" }, we = {
111
113
  key: 0,
112
114
  class: "model-import-data"
113
115
  }, je = { class: "import-button" }, Se = { key: 0 }, xe = {
@@ -138,15 +140,15 @@ const x = [
138
140
  },
139
141
  emits: ["change"],
140
142
  setup(F, { emit: B }) {
141
- const e = F, $ = B, h = _(""), b = _([]), p = _(0), w = ee(E);
143
+ const e = F, $ = B, h = _(""), p = _([]), b = _(0), w = ee(E);
142
144
  he(E);
143
145
  const { itemData: L, originalData: D } = te(w), N = _(null), l = _(0), g = _(""), S = () => {
144
- p.value = window.innerWidth;
146
+ b.value = window.innerWidth;
145
147
  }, c = async (o) => {
146
148
  var u;
147
149
  const a = (u = k(o == null ? void 0 : o.wholeValue)) == null ? void 0 : u.map((n) => {
148
- var m;
149
- return (n == null ? void 0 : n.comp) === "Form" && (n.compData = (m = n.compData) == null ? void 0 : m.map((y) => ((y == null ? void 0 : y.key) === "formContent" && (y.contents = ge(y == null ? void 0 : y.contents)), y))), n;
150
+ var d;
151
+ return (n == null ? void 0 : n.comp) === "Form" && (n.compData = (d = n.compData) == null ? void 0 : d.map((y) => ((y == null ? void 0 : y.key) === "formContent" && (y.contents = ge(y == null ? void 0 : y.contents)), y))), n;
150
152
  });
151
153
  $("change", {
152
154
  originalContents: D.value,
@@ -159,8 +161,8 @@ const x = [
159
161
  var u;
160
162
  let a = [];
161
163
  return (u = k(o)) == null || u.forEach((n) => {
162
- var m, y;
163
- x != null && x.find((t) => (t == null ? void 0 : t.value) === (n == null ? void 0 : n.comp)) && a.push(((m = x == null ? void 0 : x.find((t) => (t == null ? void 0 : t.value) === (n == null ? void 0 : n.comp))) == null ? void 0 : m.key) + "=" + n.name + "/r/n"), (y = n == null ? void 0 : n.compData) == null || y.forEach((t) => {
164
+ var d, y;
165
+ x != null && x.find((t) => (t == null ? void 0 : t.value) === (n == null ? void 0 : n.comp)) && a.push(((d = x == null ? void 0 : x.find((t) => (t == null ? void 0 : t.value) === (n == null ? void 0 : n.comp))) == null ? void 0 : d.key) + "=" + n.name + "/r/n"), (y = n == null ? void 0 : n.compData) == null || y.forEach((t) => {
164
166
  var M, R, z, W, q, G, H, K, P, Q, U, X;
165
167
  if (s != null && s.find((i) => (i == null ? void 0 : i.value) === (t == null ? void 0 : t.key)))
166
168
  if (!((M = t == null ? void 0 : t.contents) != null && M.length))
@@ -169,21 +171,21 @@ const x = [
169
171
  let i = (z = t == null ? void 0 : t.contents) == null ? void 0 : z[0];
170
172
  if (!i) return;
171
173
  if (Object.keys(i).includes("label") && Object.keys(i).includes("key") && Object.keys(i).includes("width"))
172
- if (((q = (W = t.contents) == null ? void 0 : W.filter((d) => d.width !== 1)) == null ? void 0 : q.length) === 0) {
173
- const d = (G = k(t == null ? void 0 : t.contents)) == null ? void 0 : G.map((r) => ({ [r.label]: r.value }));
174
- a.push(((H = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : H.key) + "=" + JSON.stringify(d) + "/r/n");
174
+ if (((q = (W = t.contents) == null ? void 0 : W.filter((m) => m.width !== 1)) == null ? void 0 : q.length) === 0) {
175
+ const m = (G = k(t == null ? void 0 : t.contents)) == null ? void 0 : G.map((r) => ({ [r.label]: r.value }));
176
+ a.push(((H = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : H.key) + "=" + JSON.stringify(m) + "/r/n");
175
177
  } else {
176
- let d = [];
178
+ let m = [];
177
179
  (K = k(t == null ? void 0 : t.contents)) == null || K.reduce((r, J) => {
178
180
  var Y;
179
- return r[J.label] = J.key, ((Y = Object.keys(k(r))) == null ? void 0 : Y.length) >= J.width && (d.push(k(r)), r = {}), r;
180
- }, {}), a.push(((P = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : P.key) + "=" + JSON.stringify(d) + "/r/n");
181
+ return r[J.label] = J.key, ((Y = Object.keys(k(r))) == null ? void 0 : Y.length) >= J.width && (m.push(k(r)), r = {}), r;
182
+ }, {}), a.push(((P = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : P.key) + "=" + JSON.stringify(m) + "/r/n");
181
183
  }
182
184
  else if (Object.keys(i).includes("label")) {
183
- const d = (Q = k(t == null ? void 0 : t.contents)) == null ? void 0 : Q.map((r) => r.label);
184
- a.push(((U = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : U.key) + "=" + JSON.stringify(d) + "/r/n");
185
+ const m = (Q = k(t == null ? void 0 : t.contents)) == null ? void 0 : Q.map((r) => r.label);
186
+ a.push(((U = s == null ? void 0 : s.find((r) => (r == null ? void 0 : r.value) === (t == null ? void 0 : t.key))) == null ? void 0 : U.key) + "=" + JSON.stringify(m) + "/r/n");
185
187
  } else
186
- a.push(((X = s == null ? void 0 : s.find((d) => (d == null ? void 0 : d.value) === (t == null ? void 0 : t.key))) == null ? void 0 : X.key) + "=" + JSON.stringify(t == null ? void 0 : t.contents) + "/r/n");
188
+ a.push(((X = s == null ? void 0 : s.find((m) => (m == null ? void 0 : m.value) === (t == null ? void 0 : t.key))) == null ? void 0 : X.key) + "=" + JSON.stringify(t == null ? void 0 : t.contents) + "/r/n");
187
189
  }
188
190
  });
189
191
  }), JSON.stringify(a);
@@ -196,8 +198,8 @@ const x = [
196
198
  u.onload = (n) => {
197
199
  try {
198
200
  h.value = n.target.result, T.value = re(n.target.result), l.value++;
199
- } catch (m) {
200
- console.error("解析失败:", m);
201
+ } catch (d) {
202
+ console.error("解析失败:", d);
201
203
  }
202
204
  }, u.onerror = (n) => {
203
205
  console.error("文件读取错误:", n);
@@ -208,7 +210,7 @@ const x = [
208
210
  }), V(
209
211
  () => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
210
212
  () => {
211
- h.value = e == null ? void 0 : e.content, b.value = e == null ? void 0 : e.jsonContents;
213
+ h.value = e == null ? void 0 : e.content, p.value = e == null ? void 0 : e.jsonContents;
212
214
  },
213
215
  { deep: !0, immediate: !0 }
214
216
  ), V(
@@ -226,9 +228,9 @@ const x = [
226
228
  return JSON.parse(a);
227
229
  } catch (u) {
228
230
  try {
229
- const m = new Function(`return ${a}`)();
230
- if (Array.isArray(m) || typeof m == "object")
231
- return m;
231
+ const d = new Function(`return ${a}`)();
232
+ if (Array.isArray(d) || typeof d == "object")
233
+ return d;
232
234
  throw new Error(`解析结果不是有效的数组或对象: ${u}`);
233
235
  } catch (n) {
234
236
  throw new Error(`无法解析JSON: ${n.message}`);
@@ -237,7 +239,7 @@ const x = [
237
239
  };
238
240
  return (o, a) => {
239
241
  var u;
240
- return f(), C("div", pe, [
242
+ return f(), C("div", be, [
241
243
  ((u = e == null ? void 0 : e.jsonContents) == null ? void 0 : u.length) === 0 ? (f(), C("div", we, [
242
244
  O("div", je, [
243
245
  O("input", {
@@ -257,30 +259,30 @@ const x = [
257
259
  ])) : I("", !0),
258
260
  (e == null ? void 0 : e.mode) === "edit" ? (f(), C("div", xe, [
259
261
  O("div", Oe, [
260
- A(me)
262
+ A(ie)
261
263
  ]),
262
264
  (f(), C("div", {
263
265
  class: "model-show",
264
- key: p.value
266
+ key: b.value
265
267
  }, [
266
- A(ye)
268
+ A(me)
267
269
  ])),
268
270
  O("div", Ie, [
269
- A(fe)
271
+ A(de)
270
272
  ])
271
273
  ])) : I("", !0),
272
274
  (e == null ? void 0 : e.mode) === "view" ? (f(), C("div", Ne, [
273
- (f(), Z(be, {
275
+ (f(), Z(pe, {
274
276
  content: h.value,
275
277
  onChange: c,
276
- jsonContents: b.value,
277
- key: p.value
278
+ jsonContents: p.value,
279
+ key: b.value
278
280
  }, null, 8, ["content", "jsonContents"]))
279
281
  ])) : I("", !0)
280
282
  ]);
281
283
  };
282
284
  }
283
- }, Je = /* @__PURE__ */ ne(Te, [["__scopeId", "data-v-b25bde75"]]);
285
+ }, Ee = /* @__PURE__ */ ne(Te, [["__scopeId", "data-v-b25bde75"]]);
284
286
  export {
285
- Je as default
287
+ Ee as default
286
288
  };