ss-component-new 1.1.33 → 1.1.35
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-DtgJKVEb.js +3332 -0
- package/dist/{index-BbRwol9Q.js → index-BvoThyOF.js} +1 -1
- package/dist/{index-CVUTr_Jx.js → index-BxaQLJoi.js} +8 -8
- package/dist/index-CCk26goC.js +351 -0
- package/dist/{index-CjOEbW6x.js → index-DBU5Vzpm.js} +1303 -1267
- package/dist/main-Bq42CX91.js +286 -0
- package/dist/{menu-CER-9e62.js → menu-oGClEGzK.js} +2 -2
- package/dist/{modelComp-BrI6MfnJ.js → modelComp-CqA1NVfH.js} +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +4 -4
- package/dist/ss-component.umd.cjs +47 -47
- package/package.json +1 -1
- package/dist/index-8iZXbyao.js +0 -12
- package/dist/main-BolQoZMW.js +0 -3601
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as g, onMounted as A, resolveComponent as l, createElementBlock as _, openBlock as o, Fragment as d, renderList as m, createBlock as r, withCtx as s, createVNode as I, createSlots as b, renderSlot as u, mergeProps as O, computed as S } from "vue";
|
|
2
|
-
import { u as q, s as E } from "./menu-
|
|
2
|
+
import { u as q, s as E } from "./menu-oGClEGzK.js";
|
|
3
3
|
import { _ as F } from "./_plugin-vue_export-helper-B7R8Jogt.js";
|
|
4
4
|
const R = /* @__PURE__ */ g({
|
|
5
5
|
__name: "menuItem",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineAsyncComponent as j, computed as
|
|
2
|
-
import { E as y, u as H, s as
|
|
3
|
-
import { u as J } from "./modelComp-
|
|
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-oGClEGzK.js";
|
|
3
|
+
import { u as J } from "./modelComp-CqA1NVfH.js";
|
|
4
4
|
import { c as _, _ as K } from "./_plugin-vue_export-helper-B7R8Jogt.js";
|
|
5
|
-
const D = j(() => import("./index-
|
|
5
|
+
const D = j(() => import("./index-BvoThyOF.js"));
|
|
6
6
|
D.install = (r) => {
|
|
7
7
|
r.component("ssMenu", D);
|
|
8
8
|
};
|
|
@@ -12,7 +12,7 @@ const Q = {
|
|
|
12
12
|
name: String
|
|
13
13
|
},
|
|
14
14
|
setup(r) {
|
|
15
|
-
const c = r, p =
|
|
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 } =
|
|
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 =
|
|
90
|
+
}, N = $([
|
|
91
91
|
{
|
|
92
92
|
name: "--ssComponent-menu-bg",
|
|
93
93
|
value: "#426ec4"
|
|
@@ -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-DtgJKVEb.js";
|
|
3
|
+
import { u as Q } from "./modelComp-CqA1NVfH.js";
|
|
4
|
+
import { u as X, s as P } from "./menu-oGClEGzK.js";
|
|
5
|
+
import ie from "./index-BxaQLJoi.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));
|
|
347
|
+
}
|
|
348
|
+
}, Ue = /* @__PURE__ */ V(Ee, [["__scopeId", "data-v-87aa07ff"]]);
|
|
349
|
+
export {
|
|
350
|
+
Ue as default
|
|
351
|
+
};
|