ss-component-new 1.1.8 → 1.1.10
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-0PzArXAH.js +3278 -0
- package/dist/config.js +10 -0
- package/dist/{index-DixPKGKu.js → index-B6eq-MSC.js} +3 -2
- package/dist/index-C2Y-VOs_.js +239 -0
- package/dist/{index-CgQCR4W5.js → index-hjkvqVVf.js} +2 -2
- package/dist/index-vyAHI5uV.js +110 -0
- package/dist/main-u6Z66hys.js +285 -0
- package/dist/{menu-qSnszHpf.js → menu-3a4UTvU1.js} +69 -65
- package/dist/{modelComp-DJ7SRqQv.js → modelComp-BLx5jS0f.js} +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +4 -4
- package/dist/ss-component.umd.cjs +15 -10
- package/package.json +4 -1
- package/dist/calculator-CsPcsxBA.js +0 -1366
- package/dist/index-Br7oZmYc.js +0 -226
- package/dist/index-eTMU2pmA.js +0 -109
- package/dist/main-k1gppu55.js +0 -275
package/dist/index-Br7oZmYc.js
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { ref as u, watch as k, createElementBlock as m, openBlock as l, createVNode as I, createCommentVNode as w, Fragment as G, renderList as q, createElementVNode as C, createBlock as F, toDisplayString as z, resolveDynamicComponent as H, onMounted as K } from "vue";
|
|
2
|
-
import { p as $, u as Q, e as X, g as Y, m as Z, a as V, b as ee } from "./calculator-CsPcsxBA.js";
|
|
3
|
-
import { u as L } from "./modelComp-DJ7SRqQv.js";
|
|
4
|
-
import { _ as N, u as U, s as b, c as T } from "./menu-qSnszHpf.js";
|
|
5
|
-
import te from "./index-eTMU2pmA.js";
|
|
6
|
-
const ne = { class: "system-wrap" }, ae = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "show-content"
|
|
9
|
-
}, oe = { class: "item-view-group" }, se = {
|
|
10
|
-
__name: "index",
|
|
11
|
-
props: {
|
|
12
|
-
content: String,
|
|
13
|
-
jsonContents: Array
|
|
14
|
-
},
|
|
15
|
-
emits: ["change"],
|
|
16
|
-
setup(x, { emit: M }) {
|
|
17
|
-
const e = x, S = M, d = L($);
|
|
18
|
-
Q($);
|
|
19
|
-
const y = U(), { itemData: v } = b(d), { activeMenuPath: p, activeMenuOpenPaths: O, menuTriggerType: E } = b(y), g = u([]), h = u([]), j = (n) => {
|
|
20
|
-
S("change", {
|
|
21
|
-
wholeValue: g.value,
|
|
22
|
-
editValue: n
|
|
23
|
-
});
|
|
24
|
-
}, A = (n) => {
|
|
25
|
-
const o = T(g.value), s = o == null ? void 0 : o.map((t, a) => (a === (n == null ? void 0 : n.index) && (t.compData = n == null ? void 0 : n.contents), t));
|
|
26
|
-
g.value = s;
|
|
27
|
-
};
|
|
28
|
-
k(
|
|
29
|
-
() => v.value,
|
|
30
|
-
() => {
|
|
31
|
-
var o, s, t, a, c, r, i;
|
|
32
|
-
if (!v.value || ((o = v.value) == null ? void 0 : o.length) === 0) return;
|
|
33
|
-
const n = (t = (s = T(v.value)) == null ? void 0 : s.filter((f) => (f == null ? void 0 : f.comp) === "Group")) == null ? void 0 : t[0];
|
|
34
|
-
h.value = (c = (a = n == null ? void 0 : n.compData) == null ? void 0 : a[0]) == null ? void 0 : c.contents, g.value = (i = (r = n == null ? void 0 : n.compData) == null ? void 0 : r[0]) == null ? void 0 : i.contents, console.log("newContent", n);
|
|
35
|
-
},
|
|
36
|
-
{ deep: !0, immediate: !0 }
|
|
37
|
-
);
|
|
38
|
-
const D = u(0);
|
|
39
|
-
k(() => [p.value, O.value], (n, o) => {
|
|
40
|
-
var a, c, r, i, f, P, J, R, B;
|
|
41
|
-
let s = "";
|
|
42
|
-
n[0] !== (o == null ? void 0 : o[0]) ? s = n[0] : s = (a = n[1]) == null ? void 0 : a[0], D.value++, console.log("点击-activeMenuPath:", n[0], "activeMenuOpenPaths:", (c = n[1]) == null ? void 0 : c[0], "curPath:", s), console.log("点击-新:", n[0], "展开:", (r = n[1]) == null ? void 0 : r[0], D.value), console.log("点击-旧:", o == null ? void 0 : o[0], "展开-旧:", (i = o == null ? void 0 : o[1]) == null ? void 0 : i[0], D.value);
|
|
43
|
-
const t = (f = T(v.value)) == null ? void 0 : f.find((W) => W.name === s);
|
|
44
|
-
s && t ? (h.value = (J = (P = t == null ? void 0 : t.compData) == null ? void 0 : P[0]) == null ? void 0 : J.contents, g.value = (B = (R = t == null ? void 0 : t.compData) == null ? void 0 : R[0]) == null ? void 0 : B.contents, console.log("点击-新-data:", h.value)) : (h.value = [], g.value = []);
|
|
45
|
-
}), k(
|
|
46
|
-
() => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
|
|
47
|
-
() => {
|
|
48
|
-
var s;
|
|
49
|
-
if (((s = e == null ? void 0 : e.jsonContents) == null ? void 0 : s.length) > 0) {
|
|
50
|
-
d.setOriginalData(e == null ? void 0 : e.jsonContents), d.setItemData(e == null ? void 0 : e.jsonContents);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (!(e != null && e.content) || (e == null ? void 0 : e.content) === "") return;
|
|
54
|
-
const n = X(e == null ? void 0 : e.content);
|
|
55
|
-
console.log("newViewContents", n);
|
|
56
|
-
const o = Array.isArray(n) && (n == null ? void 0 : n.find((t) => {
|
|
57
|
-
var a;
|
|
58
|
-
return ((a = t.comp) == null ? void 0 : a.toUpperCase()) === "MENU";
|
|
59
|
-
}));
|
|
60
|
-
y.setRawMenu(o ?? {}), d.setOriginalData(n), d.setItemData(n);
|
|
61
|
-
},
|
|
62
|
-
{ deep: !0, immediate: !0 }
|
|
63
|
-
);
|
|
64
|
-
const _ = (n) => Y(n);
|
|
65
|
-
return (n, o) => {
|
|
66
|
-
var s;
|
|
67
|
-
return l(), m("div", ne, [
|
|
68
|
-
I(te, { class: "sys-aside" }),
|
|
69
|
-
((s = h.value) == null ? void 0 : s.length) > 0 ? (l(), m("div", ae, [
|
|
70
|
-
(l(!0), m(G, null, q(h.value, (t, a) => (l(), m("div", {
|
|
71
|
-
class: "item-content",
|
|
72
|
-
key: a
|
|
73
|
-
}, [
|
|
74
|
-
C("div", oe, z(t.name), 1),
|
|
75
|
-
(l(), F(H(_(t.comp)), {
|
|
76
|
-
itemData: t == null ? void 0 : t.compData,
|
|
77
|
-
childItemData: t == null ? void 0 : t.itemChildData,
|
|
78
|
-
key: a,
|
|
79
|
-
onChange: j,
|
|
80
|
-
index: a,
|
|
81
|
-
onContentChange: A
|
|
82
|
-
}, null, 40, ["itemData", "childItemData", "index"]))
|
|
83
|
-
]))), 128))
|
|
84
|
-
])) : w("", !0)
|
|
85
|
-
]);
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}, ce = /* @__PURE__ */ N(se, [["__scopeId", "data-v-7f7e468c"]]), re = { class: "add-model-content" }, le = {
|
|
89
|
-
key: 0,
|
|
90
|
-
class: "model-import-data"
|
|
91
|
-
}, ie = { class: "import-button" }, ue = { key: 0 }, me = {
|
|
92
|
-
key: 1,
|
|
93
|
-
class: "model-operate"
|
|
94
|
-
}, de = { class: "model-select" }, ve = { class: "model-fill" }, ge = {
|
|
95
|
-
key: 2,
|
|
96
|
-
class: "model-view"
|
|
97
|
-
}, he = {
|
|
98
|
-
__name: "index",
|
|
99
|
-
props: {
|
|
100
|
-
mode: {
|
|
101
|
-
type: String,
|
|
102
|
-
default: "view"
|
|
103
|
-
},
|
|
104
|
-
content: {
|
|
105
|
-
type: String,
|
|
106
|
-
default: ""
|
|
107
|
-
},
|
|
108
|
-
jsonContents: {
|
|
109
|
-
type: Array,
|
|
110
|
-
default: () => []
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
emits: ["change"],
|
|
114
|
-
setup(x, { emit: M }) {
|
|
115
|
-
const e = x, S = M, d = u(""), y = u([]), v = u(0), p = L($);
|
|
116
|
-
U($);
|
|
117
|
-
const { itemData: O, originalData: E } = b(p), g = u(null), h = u(0), j = u(""), A = () => {
|
|
118
|
-
v.value = window.innerWidth;
|
|
119
|
-
}, D = (t) => {
|
|
120
|
-
S("change", {
|
|
121
|
-
originalContents: E.value,
|
|
122
|
-
currentContents: t == null ? void 0 : t.wholeValue,
|
|
123
|
-
editContent: t == null ? void 0 : t.editValue
|
|
124
|
-
});
|
|
125
|
-
}, _ = u([]), n = () => {
|
|
126
|
-
g.value.click();
|
|
127
|
-
}, o = (t) => {
|
|
128
|
-
const a = t.target.files[0];
|
|
129
|
-
if (!a) return;
|
|
130
|
-
const c = new FileReader();
|
|
131
|
-
c.onload = (r) => {
|
|
132
|
-
try {
|
|
133
|
-
d.value = r.target.result, _.value = s(r.target.result), h.value++;
|
|
134
|
-
} catch (i) {
|
|
135
|
-
console.error("解析失败:", i);
|
|
136
|
-
}
|
|
137
|
-
}, c.onerror = (r) => {
|
|
138
|
-
console.error("文件读取错误:", r);
|
|
139
|
-
}, c.readAsText(a);
|
|
140
|
-
};
|
|
141
|
-
K(() => {
|
|
142
|
-
window.addEventListener("resize", A);
|
|
143
|
-
}), k(
|
|
144
|
-
() => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
|
|
145
|
-
() => {
|
|
146
|
-
d.value = e == null ? void 0 : e.content, y.value = e == null ? void 0 : e.jsonContents;
|
|
147
|
-
},
|
|
148
|
-
{ deep: !0, immediate: !0 }
|
|
149
|
-
), k(
|
|
150
|
-
() => h.value,
|
|
151
|
-
() => {
|
|
152
|
-
var t;
|
|
153
|
-
((t = _.value) == null ? void 0 : t.length) !== 0 && (p.setOriginalData(_.value), p.setItemData(_.value));
|
|
154
|
-
},
|
|
155
|
-
{ deep: !0, immediate: !0 }
|
|
156
|
-
);
|
|
157
|
-
const s = (t) => {
|
|
158
|
-
let a = t.replace(/,/g, ",").replace(/;/g, ";").replace(/:/g, ":");
|
|
159
|
-
a = a.replace(/(\w+)\s*:/g, "$1:"), a = a.replace(/\r\n/g, "").replace(/\n/g, "").replace(/\t/g, "").replace(/\s+/g, " ").trim(), a = a.replace(/,\s*([}\]])/g, "$1"), a = a.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g, ": $2$4");
|
|
160
|
-
try {
|
|
161
|
-
return JSON.parse(a);
|
|
162
|
-
} catch (c) {
|
|
163
|
-
try {
|
|
164
|
-
const i = new Function(`return ${a}`)();
|
|
165
|
-
if (Array.isArray(i) || typeof i == "object")
|
|
166
|
-
return i;
|
|
167
|
-
throw new Error(`解析结果不是有效的数组或对象: ${c}`);
|
|
168
|
-
} catch (r) {
|
|
169
|
-
throw new Error(`无法解析JSON: ${r.message}`);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
return (t, a) => {
|
|
174
|
-
var c;
|
|
175
|
-
return l(), m("div", re, [
|
|
176
|
-
((c = e == null ? void 0 : e.jsonContents) == null ? void 0 : c.length) === 0 ? (l(), m("div", le, [
|
|
177
|
-
C("div", ie, [
|
|
178
|
-
C("input", {
|
|
179
|
-
type: "file",
|
|
180
|
-
ref_key: "fileInput",
|
|
181
|
-
ref: g,
|
|
182
|
-
accept: ".txt",
|
|
183
|
-
onChange: o,
|
|
184
|
-
style: { display: "none" }
|
|
185
|
-
}, null, 544),
|
|
186
|
-
C("button", {
|
|
187
|
-
onClick: n,
|
|
188
|
-
class: "import-button-content"
|
|
189
|
-
}, "导入文件"),
|
|
190
|
-
j.value ? (l(), m("span", ue, z(j.value), 1)) : w("", !0)
|
|
191
|
-
])
|
|
192
|
-
])) : w("", !0),
|
|
193
|
-
(e == null ? void 0 : e.mode) === "edit" ? (l(), m("div", me, [
|
|
194
|
-
C("div", de, [
|
|
195
|
-
I(Z)
|
|
196
|
-
]),
|
|
197
|
-
(l(), m("div", {
|
|
198
|
-
class: "model-show",
|
|
199
|
-
key: v.value
|
|
200
|
-
}, [
|
|
201
|
-
I(V)
|
|
202
|
-
])),
|
|
203
|
-
C("div", ve, [
|
|
204
|
-
I(ee)
|
|
205
|
-
])
|
|
206
|
-
])) : w("", !0),
|
|
207
|
-
(e == null ? void 0 : e.mode) === "view" ? (l(), m("div", ge, [
|
|
208
|
-
(l(), F(ce, {
|
|
209
|
-
content: d.value,
|
|
210
|
-
onChange: D,
|
|
211
|
-
jsonContents: y.value,
|
|
212
|
-
key: v.value
|
|
213
|
-
}, null, 8, ["content", "jsonContents"]))
|
|
214
|
-
])) : w("", !0)
|
|
215
|
-
]);
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
}, _e = /* @__PURE__ */ N(he, [["__scopeId", "data-v-991b5d44"]]), fe = {
|
|
219
|
-
__name: "index",
|
|
220
|
-
setup(x) {
|
|
221
|
-
return (M, e) => (l(), F(_e, { class: "ssComponent" }));
|
|
222
|
-
}
|
|
223
|
-
}, ke = /* @__PURE__ */ N(fe, [["__scopeId", "data-v-ebf75a04"]]);
|
|
224
|
-
export {
|
|
225
|
-
ke as default
|
|
226
|
-
};
|
package/dist/index-eTMU2pmA.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { defineAsyncComponent as L, computed as E, onMounted as N, resolveComponent as U, createBlock as m, openBlock as M, withCtx as S, resolveDynamicComponent as G, defineComponent as V, ref as q, watch as z, unref as H, createVNode as J, createElementVNode as K, toDisplayString as Q } from "vue";
|
|
2
|
-
import { E as h, u as W, s as C, c as D, _ as X } from "./menu-qSnszHpf.js";
|
|
3
|
-
import { u as Y } from "./modelComp-DJ7SRqQv.js";
|
|
4
|
-
const f = L(() => import("./index-CgQCR4W5.js"));
|
|
5
|
-
f.install = (i) => {
|
|
6
|
-
i.component("ssMenu", f);
|
|
7
|
-
};
|
|
8
|
-
const Z = {
|
|
9
|
-
__name: "index",
|
|
10
|
-
props: {
|
|
11
|
-
name: String
|
|
12
|
-
},
|
|
13
|
-
setup(i) {
|
|
14
|
-
const u = i, c = E(() => h[u.name]);
|
|
15
|
-
return N(() => {
|
|
16
|
-
const d = Object.keys(h);
|
|
17
|
-
console.log("iconComponent", c.value, u.name, h, d);
|
|
18
|
-
}), (d, b) => {
|
|
19
|
-
const _ = U("el-icon");
|
|
20
|
-
return M(), m(_, null, {
|
|
21
|
-
default: S(() => [
|
|
22
|
-
(M(), m(G(c.value)))
|
|
23
|
-
]),
|
|
24
|
-
_: 1
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var $ = /* @__PURE__ */ ((i) => (i[i.Menu = 0] = "Menu", i[i.FolderOpened = 1] = "FolderOpened", i[i.Cpu = 2] = "Cpu", i))($ || {});
|
|
30
|
-
const x = /* @__PURE__ */ V({
|
|
31
|
-
__name: "index",
|
|
32
|
-
setup(i) {
|
|
33
|
-
const u = W(), c = Y(), { rawMenu: d, activeMenuPath: b, activeMenuOpenPaths: _ } = C(u), { itemData: w } = C(c), A = q([]), P = (e) => {
|
|
34
|
-
let o = [], r = [];
|
|
35
|
-
return e == null || e.forEach((s) => {
|
|
36
|
-
o = g(s, r);
|
|
37
|
-
}), console.log("splitMenu", o), o;
|
|
38
|
-
}, g = (e, o) => {
|
|
39
|
-
const r = o, s = [];
|
|
40
|
-
e == null || e.forEach((t) => {
|
|
41
|
-
Array.isArray(t) ? s.push({ children: g(t, []) }) : s.push({ title: t });
|
|
42
|
-
});
|
|
43
|
-
let a = s.reduce((t, p) => (Object.entries(p).forEach(([n, l]) => {
|
|
44
|
-
t[n] === void 0 ? l != null && l.title ? t[n] = [l] : t[n] = l : (Array.isArray(t[n]) || (t[n] = [{ title: t[n] }]), l != null && l.title ? t[n].push({ title: l == null ? void 0 : l.title }) : Array.isArray(l) ? t[n].push(l) : t[n].push({ title: l }));
|
|
45
|
-
}), t), {});
|
|
46
|
-
return a = R(D(a)), r.push(a), Array.isArray(r) && (r == null ? void 0 : r.length) > 1 ? r : r == null ? void 0 : r[0];
|
|
47
|
-
}, R = (e) => {
|
|
48
|
-
var o, r, s;
|
|
49
|
-
return Array.isArray(e == null ? void 0 : e.title) && ((o = e == null ? void 0 : e.title) == null ? void 0 : o.length) === ((s = (r = e == null ? void 0 : e.title) == null ? void 0 : r.filter((a) => a.title)) == null ? void 0 : s.length) ? e == null ? void 0 : e.title : Array.isArray(e == null ? void 0 : e.children) ? T(e) : e;
|
|
50
|
-
}, T = (e) => {
|
|
51
|
-
var r;
|
|
52
|
-
const o = e;
|
|
53
|
-
return o.children = (r = o.children) == null ? void 0 : r.map((s) => {
|
|
54
|
-
var a;
|
|
55
|
-
return (a = s == null ? void 0 : s.title) != null && a.children ? s == null ? void 0 : s.title : s;
|
|
56
|
-
}), o;
|
|
57
|
-
}, y = (e, o = "", r = 0) => {
|
|
58
|
-
var t;
|
|
59
|
-
const s = D(w.value), a = (t = s == null ? void 0 : s.filter((p) => {
|
|
60
|
-
var n;
|
|
61
|
-
return ((n = p.comp) == null ? void 0 : n.toUpperCase()) === "GROUP";
|
|
62
|
-
})) == null ? void 0 : t.map((p) => p.name);
|
|
63
|
-
return e == null ? void 0 : e.map((p) => {
|
|
64
|
-
const n = o ? `${o}/${p.title}` : p.title, l = {
|
|
65
|
-
...p,
|
|
66
|
-
path: n,
|
|
67
|
-
level: r,
|
|
68
|
-
icon: $[`${r}`],
|
|
69
|
-
carryData: a == null ? void 0 : a.includes(n)
|
|
70
|
-
};
|
|
71
|
-
return p.children && p.children.length > 0 && (l.children = y(p.children, n, r + 1)), l;
|
|
72
|
-
});
|
|
73
|
-
}, O = E(() => {
|
|
74
|
-
const e = y(A.value);
|
|
75
|
-
return console.log("handleDefaultMenu", e), e;
|
|
76
|
-
}), j = (e) => {
|
|
77
|
-
console.log("clickMenu", e), u.setActiveMenuPath(e == null ? void 0 : e.path);
|
|
78
|
-
}, B = (e) => {
|
|
79
|
-
console.log("openMenu1", [e]), u.setActiveMenuOpenPaths([e]);
|
|
80
|
-
}, F = (e) => {
|
|
81
|
-
};
|
|
82
|
-
return z(() => d.value, (e) => {
|
|
83
|
-
var o, r;
|
|
84
|
-
if (e) {
|
|
85
|
-
const s = (r = (o = e.compData) == null ? void 0 : o[0]) == null ? void 0 : r.contents;
|
|
86
|
-
A.value = P(s), console.log("rawMenu", O.value);
|
|
87
|
-
}
|
|
88
|
-
}, {
|
|
89
|
-
immediate: !0
|
|
90
|
-
}), (e, o) => (M(), m(H(f), {
|
|
91
|
-
menuList: O.value,
|
|
92
|
-
onClickMenu: j,
|
|
93
|
-
onOpenMenu: B,
|
|
94
|
-
onCloseMenu: F,
|
|
95
|
-
class: "menuList-wrap"
|
|
96
|
-
}, {
|
|
97
|
-
title: S(({ menu: r }) => [
|
|
98
|
-
J(Z, {
|
|
99
|
-
name: r.icon ?? ""
|
|
100
|
-
}, null, 8, ["name"]),
|
|
101
|
-
K("span", null, Q(r.title ?? ""), 1)
|
|
102
|
-
]),
|
|
103
|
-
_: 1
|
|
104
|
-
}, 8, ["menuList"]));
|
|
105
|
-
}
|
|
106
|
-
}), ee = /* @__PURE__ */ X(x, [["__scopeId", "data-v-958f5c1f"]]);
|
|
107
|
-
export {
|
|
108
|
-
ee as default
|
|
109
|
-
};
|
package/dist/main-k1gppu55.js
DELETED
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { ref as g, watch as V, createElementBlock as h, createCommentVNode as O, openBlock as m, Fragment as re, renderList as se, createElementVNode as x, createBlock as Z, toDisplayString as v, resolveDynamicComponent as ue, onMounted as ce, createVNode as A } from "vue";
|
|
2
|
-
import { p as D, e as ie, g as de, m as me, a as ye, b as fe } from "./calculator-CsPcsxBA.js";
|
|
3
|
-
import { u as ee } from "./modelComp-DJ7SRqQv.js";
|
|
4
|
-
import { _ as te, s as ne, c as b, u as ge } from "./menu-qSnszHpf.js";
|
|
5
|
-
const S = [
|
|
6
|
-
{
|
|
7
|
-
key: "FormName",
|
|
8
|
-
value: "Form"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
key: "TableName",
|
|
12
|
-
value: "Table"
|
|
13
|
-
}
|
|
14
|
-
], s = [
|
|
15
|
-
{
|
|
16
|
-
key: "FormDirect",
|
|
17
|
-
value: "formFlex"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
key: "Form",
|
|
21
|
-
value: "formContent"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
key: "FormButton",
|
|
25
|
-
value: "formButton"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
key: "TableColumns",
|
|
29
|
-
value: "header"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
key: "TableButton",
|
|
33
|
-
value: "extraButton"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
key: "LineButton",
|
|
37
|
-
value: "rowButton"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
key: "Table",
|
|
41
|
-
value: "tableContents"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
key: "TableIndex",
|
|
45
|
-
value: "tableIndex"
|
|
46
|
-
}
|
|
47
|
-
], he = {
|
|
48
|
-
key: 0,
|
|
49
|
-
class: "show-content"
|
|
50
|
-
}, ke = { class: "item-view-group" }, _e = {
|
|
51
|
-
__name: "index",
|
|
52
|
-
props: {
|
|
53
|
-
content: String,
|
|
54
|
-
jsonContents: Array
|
|
55
|
-
},
|
|
56
|
-
emits: ["change"],
|
|
57
|
-
setup(F, { emit: T }) {
|
|
58
|
-
const e = F, $ = T, f = ee(D), { itemData: k } = ne(f), _ = g([]), j = g([]), E = (o) => {
|
|
59
|
-
$("change", {
|
|
60
|
-
wholeValue: _.value,
|
|
61
|
-
editValue: o
|
|
62
|
-
});
|
|
63
|
-
}, B = (o) => {
|
|
64
|
-
const y = b(_.value), w = y == null ? void 0 : y.map((u, p) => (p === (o == null ? void 0 : o.index) && (u.compData = o == null ? void 0 : o.contents), u));
|
|
65
|
-
_.value = w;
|
|
66
|
-
};
|
|
67
|
-
V(
|
|
68
|
-
() => k.value,
|
|
69
|
-
() => {
|
|
70
|
-
var o;
|
|
71
|
-
!k.value || ((o = k.value) == null ? void 0 : o.length) === 0 || (j.value = k.value, _.value = k.value);
|
|
72
|
-
},
|
|
73
|
-
{ deep: !0, immediate: !0 }
|
|
74
|
-
), V(
|
|
75
|
-
() => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
|
|
76
|
-
() => {
|
|
77
|
-
var y;
|
|
78
|
-
if (((y = e == null ? void 0 : e.jsonContents) == null ? void 0 : y.length) > 0) {
|
|
79
|
-
f.setOriginalData(e == null ? void 0 : e.jsonContents), f.setItemData(e == null ? void 0 : e.jsonContents);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
if (!(e != null && e.content) || (e == null ? void 0 : e.content) === "") return;
|
|
83
|
-
const o = ie(e == null ? void 0 : e.content);
|
|
84
|
-
f.setOriginalData(o), f.setItemData(o);
|
|
85
|
-
},
|
|
86
|
-
{ deep: !0, immediate: !0 }
|
|
87
|
-
);
|
|
88
|
-
const I = (o) => de(o);
|
|
89
|
-
return (o, y) => {
|
|
90
|
-
var w;
|
|
91
|
-
return ((w = j.value) == null ? void 0 : w.length) > 0 ? (m(), h("div", he, [
|
|
92
|
-
(m(!0), h(re, null, se(j.value, (u, p) => (m(), h("div", {
|
|
93
|
-
class: "item-content",
|
|
94
|
-
key: p
|
|
95
|
-
}, [
|
|
96
|
-
x("div", ke, v(u.name), 1),
|
|
97
|
-
(m(), Z(ue(I(u.comp)), {
|
|
98
|
-
itemData: u == null ? void 0 : u.compData,
|
|
99
|
-
childItemData: u == null ? void 0 : u.itemChildData,
|
|
100
|
-
key: p,
|
|
101
|
-
onChange: E,
|
|
102
|
-
index: p,
|
|
103
|
-
onContentChange: B
|
|
104
|
-
}, null, 40, ["itemData", "childItemData", "index"]))
|
|
105
|
-
]))), 128))
|
|
106
|
-
])) : O("", !0);
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}, Ce = /* @__PURE__ */ te(_e, [["__scopeId", "data-v-1123712d"]]), be = { class: "add-model-content" }, je = {
|
|
110
|
-
key: 0,
|
|
111
|
-
class: "model-import-data"
|
|
112
|
-
}, pe = { class: "import-button" }, we = { key: 0 }, Se = {
|
|
113
|
-
key: 1,
|
|
114
|
-
class: "model-operate"
|
|
115
|
-
}, xe = { class: "model-select" }, Oe = { class: "model-fill" }, Ie = {
|
|
116
|
-
key: 2,
|
|
117
|
-
class: "model-view ssComponent"
|
|
118
|
-
}, Ne = {
|
|
119
|
-
__name: "main",
|
|
120
|
-
props: {
|
|
121
|
-
mode: {
|
|
122
|
-
type: String,
|
|
123
|
-
default: "view"
|
|
124
|
-
},
|
|
125
|
-
content: {
|
|
126
|
-
type: String,
|
|
127
|
-
default: ""
|
|
128
|
-
},
|
|
129
|
-
jsonContents: {
|
|
130
|
-
type: Array,
|
|
131
|
-
default: () => []
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
emits: ["change"],
|
|
135
|
-
setup(F, { emit: T }) {
|
|
136
|
-
const e = F, $ = T, f = g(""), k = g([]), _ = g(0), j = ee(D);
|
|
137
|
-
ge(D);
|
|
138
|
-
const { itemData: E, originalData: B } = ne(j), I = g(null), o = g(0), y = g(""), w = () => {
|
|
139
|
-
_.value = window.innerWidth;
|
|
140
|
-
}, u = (l) => {
|
|
141
|
-
$("change", {
|
|
142
|
-
originalContents: B.value,
|
|
143
|
-
currentContents: l == null ? void 0 : l.wholeValue,
|
|
144
|
-
editContent: l == null ? void 0 : l.editValue,
|
|
145
|
-
stringContent: p(b(l == null ? void 0 : l.wholeValue))
|
|
146
|
-
});
|
|
147
|
-
}, p = (l) => {
|
|
148
|
-
var d;
|
|
149
|
-
let n = [];
|
|
150
|
-
return (d = b(l)) == null || d.forEach((r) => {
|
|
151
|
-
var C, L;
|
|
152
|
-
S != null && S.find((t) => (t == null ? void 0 : t.value) === (r == null ? void 0 : r.comp)) && n.push(((C = S == null ? void 0 : S.find((t) => (t == null ? void 0 : t.value) === (r == null ? void 0 : r.comp))) == null ? void 0 : C.key) + "=" + r.name + "/r/n"), (L = r == null ? void 0 : r.compData) == null || L.forEach((t) => {
|
|
153
|
-
var M, R, z, W, q, G, H, K, P, Q, U, X;
|
|
154
|
-
if (s != null && s.find((c) => (c == null ? void 0 : c.value) === (t == null ? void 0 : t.key)))
|
|
155
|
-
if (!((M = t == null ? void 0 : t.contents) != null && M.length))
|
|
156
|
-
n.push(((R = s == null ? void 0 : s.find((c) => (c == null ? void 0 : c.value) === (t == null ? void 0 : t.key))) == null ? void 0 : R.key) + "=" + (t.contents === !0 ? '""' : "Vertical") + "/r/n");
|
|
157
|
-
else {
|
|
158
|
-
let c = (z = t == null ? void 0 : t.contents) == null ? void 0 : z[0];
|
|
159
|
-
if (!c) return;
|
|
160
|
-
if (Object.keys(c).includes("label") && Object.keys(c).includes("key") && Object.keys(c).includes("width"))
|
|
161
|
-
if (((q = (W = t.contents) == null ? void 0 : W.filter((i) => i.width !== 1)) == null ? void 0 : q.length) === 0) {
|
|
162
|
-
const i = (G = b(t == null ? void 0 : t.contents)) == null ? void 0 : G.map((a) => ({ [a.label]: a.value }));
|
|
163
|
-
n.push(((H = s == null ? void 0 : s.find((a) => (a == null ? void 0 : a.value) === (t == null ? void 0 : t.key))) == null ? void 0 : H.key) + "=" + JSON.stringify(i) + "/r/n");
|
|
164
|
-
} else {
|
|
165
|
-
let i = [];
|
|
166
|
-
(K = b(t == null ? void 0 : t.contents)) == null || K.reduce((a, J) => {
|
|
167
|
-
var Y;
|
|
168
|
-
return a[J.label] = J.key, ((Y = Object.keys(b(a))) == null ? void 0 : Y.length) >= J.width && (i.push(b(a)), a = {}), a;
|
|
169
|
-
}, {}), n.push(((P = s == null ? void 0 : s.find((a) => (a == null ? void 0 : a.value) === (t == null ? void 0 : t.key))) == null ? void 0 : P.key) + "=" + JSON.stringify(i) + "/r/n");
|
|
170
|
-
}
|
|
171
|
-
else if (Object.keys(c).includes("label")) {
|
|
172
|
-
const i = (Q = b(t == null ? void 0 : t.contents)) == null ? void 0 : Q.map((a) => a.label);
|
|
173
|
-
n.push(((U = s == null ? void 0 : s.find((a) => (a == null ? void 0 : a.value) === (t == null ? void 0 : t.key))) == null ? void 0 : U.key) + "=" + JSON.stringify(i) + "/r/n");
|
|
174
|
-
} else
|
|
175
|
-
n.push(((X = s == null ? void 0 : s.find((i) => (i == null ? void 0 : i.value) === (t == null ? void 0 : t.key))) == null ? void 0 : X.key) + "=" + JSON.stringify(t == null ? void 0 : t.contents) + "/r/n");
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
}), JSON.stringify(n);
|
|
179
|
-
}, N = g([]), ae = () => {
|
|
180
|
-
I.value.click();
|
|
181
|
-
}, oe = (l) => {
|
|
182
|
-
const n = l.target.files[0];
|
|
183
|
-
if (!n) return;
|
|
184
|
-
const d = new FileReader();
|
|
185
|
-
d.onload = (r) => {
|
|
186
|
-
try {
|
|
187
|
-
f.value = r.target.result, N.value = le(r.target.result), o.value++;
|
|
188
|
-
} catch (C) {
|
|
189
|
-
console.error("解析失败:", C);
|
|
190
|
-
}
|
|
191
|
-
}, d.onerror = (r) => {
|
|
192
|
-
console.error("文件读取错误:", r);
|
|
193
|
-
}, d.readAsText(n);
|
|
194
|
-
};
|
|
195
|
-
ce(() => {
|
|
196
|
-
window.addEventListener("resize", w);
|
|
197
|
-
}), V(
|
|
198
|
-
() => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
|
|
199
|
-
() => {
|
|
200
|
-
f.value = e == null ? void 0 : e.content, k.value = e == null ? void 0 : e.jsonContents;
|
|
201
|
-
},
|
|
202
|
-
{ deep: !0, immediate: !0 }
|
|
203
|
-
), V(
|
|
204
|
-
() => o.value,
|
|
205
|
-
() => {
|
|
206
|
-
var l;
|
|
207
|
-
((l = N.value) == null ? void 0 : l.length) !== 0 && (j.setOriginalData(N.value), j.setItemData(N.value));
|
|
208
|
-
},
|
|
209
|
-
{ deep: !0, immediate: !0 }
|
|
210
|
-
);
|
|
211
|
-
const le = (l) => {
|
|
212
|
-
let n = l.replace(/,/g, ",").replace(/;/g, ";").replace(/:/g, ":");
|
|
213
|
-
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");
|
|
214
|
-
try {
|
|
215
|
-
return JSON.parse(n);
|
|
216
|
-
} catch (d) {
|
|
217
|
-
try {
|
|
218
|
-
const C = new Function(`return ${n}`)();
|
|
219
|
-
if (Array.isArray(C) || typeof C == "object")
|
|
220
|
-
return C;
|
|
221
|
-
throw new Error(`解析结果不是有效的数组或对象: ${d}`);
|
|
222
|
-
} catch (r) {
|
|
223
|
-
throw new Error(`无法解析JSON: ${r.message}`);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
return (l, n) => {
|
|
228
|
-
var d;
|
|
229
|
-
return m(), h("div", be, [
|
|
230
|
-
((d = e == null ? void 0 : e.jsonContents) == null ? void 0 : d.length) === 0 ? (m(), h("div", je, [
|
|
231
|
-
x("div", pe, [
|
|
232
|
-
x("input", {
|
|
233
|
-
type: "file",
|
|
234
|
-
ref_key: "fileInput",
|
|
235
|
-
ref: I,
|
|
236
|
-
accept: ".txt",
|
|
237
|
-
onChange: oe,
|
|
238
|
-
style: { display: "none" }
|
|
239
|
-
}, null, 544),
|
|
240
|
-
x("button", {
|
|
241
|
-
onClick: ae,
|
|
242
|
-
class: "import-button-content"
|
|
243
|
-
}, "导入文件"),
|
|
244
|
-
y.value ? (m(), h("span", we, v(y.value), 1)) : O("", !0)
|
|
245
|
-
])
|
|
246
|
-
])) : O("", !0),
|
|
247
|
-
(e == null ? void 0 : e.mode) === "edit" ? (m(), h("div", Se, [
|
|
248
|
-
x("div", xe, [
|
|
249
|
-
A(me)
|
|
250
|
-
]),
|
|
251
|
-
(m(), h("div", {
|
|
252
|
-
class: "model-show",
|
|
253
|
-
key: _.value
|
|
254
|
-
}, [
|
|
255
|
-
A(ye)
|
|
256
|
-
])),
|
|
257
|
-
x("div", Oe, [
|
|
258
|
-
A(fe)
|
|
259
|
-
])
|
|
260
|
-
])) : O("", !0),
|
|
261
|
-
(e == null ? void 0 : e.mode) === "view" ? (m(), h("div", Ie, [
|
|
262
|
-
(m(), Z(Ce, {
|
|
263
|
-
content: f.value,
|
|
264
|
-
onChange: u,
|
|
265
|
-
jsonContents: k.value,
|
|
266
|
-
key: _.value
|
|
267
|
-
}, null, 8, ["content", "jsonContents"]))
|
|
268
|
-
])) : O("", !0)
|
|
269
|
-
]);
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
}, Be = /* @__PURE__ */ te(Ne, [["__scopeId", "data-v-99d8c39a"]]);
|
|
273
|
-
export {
|
|
274
|
-
Be as default
|
|
275
|
-
};
|