ss-component-new 1.1.65 → 1.1.66
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--0IppVXf.js +3352 -0
- package/dist/index-BIlayS_1.js +671 -0
- package/dist/index-C8dZocQc.js +163 -0
- package/dist/main-B61LgIPg.js +286 -0
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +3 -3
- package/dist/ss-component.umd.cjs +50 -47
- package/package.json +1 -1
- package/dist/array-BejyPB_1.js +0 -3227
- package/dist/index-BT8Pkr84.js +0 -35
- package/dist/index-ChCXzsYf.js +0 -26
- package/dist/index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-DG5vph3h.js +0 -143
- package/dist/main-BUjoLIJC.js +0 -404
package/dist/index-BT8Pkr84.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ref as e, resolveComponent as o, createBlock as r, openBlock as n } from "vue";
|
|
2
|
-
import { _ as p } from "./_plugin-vue_export-helper-B7R8Jogt.js";
|
|
3
|
-
import "./array-BejyPB_1.js";
|
|
4
|
-
import "./index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-DG5vph3h.js";
|
|
5
|
-
e(0);
|
|
6
|
-
const a = {
|
|
7
|
-
__name: "index",
|
|
8
|
-
props: {
|
|
9
|
-
mode: {
|
|
10
|
-
type: String,
|
|
11
|
-
default: "view"
|
|
12
|
-
},
|
|
13
|
-
content: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: ""
|
|
16
|
-
},
|
|
17
|
-
jsonContents: {
|
|
18
|
-
type: Array,
|
|
19
|
-
default: () => []
|
|
20
|
-
},
|
|
21
|
-
showButton: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: !0
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
setup(c) {
|
|
27
|
-
return e(!1), (s, _) => {
|
|
28
|
-
const t = o("router-view");
|
|
29
|
-
return n(), r(t);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}, d = /* @__PURE__ */ p(a, [["__scopeId", "data-v-c06bb5c0"]]);
|
|
33
|
-
export {
|
|
34
|
-
d as default
|
|
35
|
-
};
|
package/dist/index-ChCXzsYf.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { _ as c } from "./index.vue_vue_type_style_index_0_scoped_dc84a8f7_lang-DG5vph3h.js";
|
|
2
|
-
import { resolveComponent as o, createBlock as a, openBlock as u, withCtx as r, createVNode as l, createElementVNode as i, toDisplayString as p } from "vue";
|
|
3
|
-
import { _ as m } from "./_plugin-vue_export-helper-B7R8Jogt.js";
|
|
4
|
-
function M(e, _, d, f, C, y) {
|
|
5
|
-
const t = o("DynamicIcon"), s = o("ssMenu");
|
|
6
|
-
return u(), a(s, {
|
|
7
|
-
menuList: e.renderMenuList,
|
|
8
|
-
onClickMenu: e.clickMenu,
|
|
9
|
-
onOpenMenu: e.openMenu,
|
|
10
|
-
onCloseMenu: e.closeMenu,
|
|
11
|
-
onChangeMenuStyle: e.changeMenuStyle,
|
|
12
|
-
class: "menuList-wrap"
|
|
13
|
-
}, {
|
|
14
|
-
title: r(({ menu: n }) => [
|
|
15
|
-
l(t, {
|
|
16
|
-
name: n.icon ?? ""
|
|
17
|
-
}, null, 8, ["name"]),
|
|
18
|
-
i("span", null, p(n.title ?? ""), 1)
|
|
19
|
-
]),
|
|
20
|
-
_: 1
|
|
21
|
-
}, 8, ["menuList", "onClickMenu", "onOpenMenu", "onCloseMenu", "onChangeMenuStyle"]);
|
|
22
|
-
}
|
|
23
|
-
const L = /* @__PURE__ */ m(c, [["render", M], ["__scopeId", "data-v-dc84a8f7"]]);
|
|
24
|
-
export {
|
|
25
|
-
L as default
|
|
26
|
-
};
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { defineAsyncComponent as U, computed as D, onMounted as O, resolveComponent as G, createBlock as v, openBlock as C, withCtx as I, resolveDynamicComponent as N, defineComponent as k, ref as T, watch as q } from "vue";
|
|
2
|
-
import { E as M, u as z, s as E } from "./menu-oGClEGzK.js";
|
|
3
|
-
import { u as H } from "./modelComp-CqA1NVfH.js";
|
|
4
|
-
import { c as f } from "./_plugin-vue_export-helper-B7R8Jogt.js";
|
|
5
|
-
const g = U(() => import("./index-BvoThyOF.js"));
|
|
6
|
-
g.install = (u) => {
|
|
7
|
-
u.component("ssMenu", g);
|
|
8
|
-
};
|
|
9
|
-
const J = {
|
|
10
|
-
__name: "index",
|
|
11
|
-
props: {
|
|
12
|
-
name: String
|
|
13
|
-
},
|
|
14
|
-
setup(u) {
|
|
15
|
-
const c = u, m = D(() => M[c.name]);
|
|
16
|
-
return O(() => {
|
|
17
|
-
const p = Object.keys(M);
|
|
18
|
-
console.log("iconComponent", m.value, c.name, M, p);
|
|
19
|
-
}), (p, A) => {
|
|
20
|
-
const d = G("el-icon");
|
|
21
|
-
return C(), v(d, null, {
|
|
22
|
-
default: I(() => [
|
|
23
|
-
(C(), v(N(m.value)))
|
|
24
|
-
]),
|
|
25
|
-
_: 1
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}, Y = k({
|
|
30
|
-
name: "menu",
|
|
31
|
-
components: {
|
|
32
|
-
ssMenu: g,
|
|
33
|
-
DynamicIcon: J
|
|
34
|
-
},
|
|
35
|
-
setup() {
|
|
36
|
-
const u = z(), c = H(), { rawMenu: m, menuTriggerType: p } = E(u), { itemData: A } = E(c), d = T([]);
|
|
37
|
-
let h;
|
|
38
|
-
((e) => {
|
|
39
|
-
e[e.Menu = 0] = "Menu", e[e.FolderOpened = 1] = "FolderOpened";
|
|
40
|
-
})(h || (h = {}));
|
|
41
|
-
const S = (e) => {
|
|
42
|
-
let n = [], s = [];
|
|
43
|
-
return e == null || e.forEach((r) => {
|
|
44
|
-
n = y(r, s);
|
|
45
|
-
}), console.log("splitMenu", n), n;
|
|
46
|
-
}, y = (e, n) => {
|
|
47
|
-
const s = n, r = [];
|
|
48
|
-
e == null || e.forEach((o) => {
|
|
49
|
-
Array.isArray(o) ? r.push({ children: y(o, []) }) : r.push({ title: o });
|
|
50
|
-
});
|
|
51
|
-
let i = r.reduce((o, a) => (Object.entries(a).forEach(([t, l]) => {
|
|
52
|
-
o[t] === void 0 ? l != null && l.title ? o[t] = [l] : o[t] = l : (Array.isArray(o[t]) || (o[t] = [{ title: o[t] }]), l != null && l.title || Array.isArray(l) ? o[t].push(l) : o[t].push({ title: l }));
|
|
53
|
-
}), o), {});
|
|
54
|
-
return i = F(f(i)), s.push(i), Array.isArray(s) && (s == null ? void 0 : s.length) > 1 ? s : s == null ? void 0 : s[0];
|
|
55
|
-
}, F = (e) => {
|
|
56
|
-
var n, s, r;
|
|
57
|
-
return Array.isArray(e == null ? void 0 : e.title) && ((n = e == null ? void 0 : e.title) == null ? void 0 : n.length) === ((r = (s = e == null ? void 0 : e.title) == null ? void 0 : s.filter((i) => i.title)) == null ? void 0 : r.length) ? e == null ? void 0 : e.title : Array.isArray(e == null ? void 0 : e.children) ? P(e) : e;
|
|
58
|
-
}, P = (e) => {
|
|
59
|
-
var s;
|
|
60
|
-
const n = e;
|
|
61
|
-
return n.children = (s = n.children) == null ? void 0 : s.map((r) => {
|
|
62
|
-
var i;
|
|
63
|
-
return (i = r == null ? void 0 : r.title) != null && i.children ? r == null ? void 0 : r.title : r;
|
|
64
|
-
}), n;
|
|
65
|
-
}, b = (e, n = "", s = 0) => {
|
|
66
|
-
var o;
|
|
67
|
-
const r = f(A.value), i = (o = r == null ? void 0 : r.filter((a) => {
|
|
68
|
-
var t;
|
|
69
|
-
return ((t = a.comp) == null ? void 0 : t.toUpperCase()) === "GROUP";
|
|
70
|
-
})) == null ? void 0 : o.map((a) => a.name);
|
|
71
|
-
return e == null ? void 0 : e.map((a) => {
|
|
72
|
-
const t = n ? `${n}/${a.title}` : a.title, l = {
|
|
73
|
-
...a,
|
|
74
|
-
path: t,
|
|
75
|
-
level: s,
|
|
76
|
-
icon: h[`${s}`],
|
|
77
|
-
carryData: i == null ? void 0 : i.includes(t)
|
|
78
|
-
};
|
|
79
|
-
return a.children && a.children.length > 0 && (l.children = b(a.children, t, s + 1)), l;
|
|
80
|
-
});
|
|
81
|
-
}, _ = D(() => {
|
|
82
|
-
const e = b(d.value);
|
|
83
|
-
return console.log("temps", e), u.setMenus(e), e;
|
|
84
|
-
}), $ = (e) => {
|
|
85
|
-
console.log("clickMenu", e), u.setMenuTriggerType("click"), u.setActiveMenuPath(e == null ? void 0 : e.path);
|
|
86
|
-
}, R = (e) => {
|
|
87
|
-
p.value === "click" ? u.setActiveMenuPath(e) : u.setMenuTriggerType("click");
|
|
88
|
-
}, j = (e) => {
|
|
89
|
-
u.setActiveMenuPath(e);
|
|
90
|
-
}, w = T([
|
|
91
|
-
{
|
|
92
|
-
name: "--ssComponent-menu-bg",
|
|
93
|
-
value: "#426ec4"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: "--ssComponent-submenu-hover-bg",
|
|
97
|
-
value: "#00000033"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: "--ssComponent-submenu-open-bg",
|
|
101
|
-
value: "#2DA0FF"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: "--ssComponent-submenu-open-inline-bg",
|
|
105
|
-
value: "#1C4275"
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "--ssComponent-menuitem-hover-bg",
|
|
109
|
-
value: "#1d7bef"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: "--ssComponent-menuitem-active-bg",
|
|
113
|
-
value: "#1d7bef"
|
|
114
|
-
}
|
|
115
|
-
]), B = () => {
|
|
116
|
-
var n;
|
|
117
|
-
const e = document.documentElement;
|
|
118
|
-
(n = w.value) == null || n.forEach((s) => {
|
|
119
|
-
e.style.setProperty(s.name, s.value);
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
return O(() => {
|
|
123
|
-
}), q(() => m.value, (e) => {
|
|
124
|
-
var n, s, r;
|
|
125
|
-
if (e) {
|
|
126
|
-
const i = (r = (s = (n = f(e)) == null ? void 0 : n.compData) == null ? void 0 : s[0]) == null ? void 0 : r.contents;
|
|
127
|
-
d.value = S(i), console.log("rawMenu", _.value);
|
|
128
|
-
} else
|
|
129
|
-
u.setActiveMenuPath("");
|
|
130
|
-
}, {
|
|
131
|
-
immediate: !0
|
|
132
|
-
}), {
|
|
133
|
-
renderMenuList: _,
|
|
134
|
-
clickMenu: $,
|
|
135
|
-
openMenu: R,
|
|
136
|
-
closeMenu: j,
|
|
137
|
-
changeMenuStyle: B
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
export {
|
|
142
|
-
Y as _
|
|
143
|
-
};
|
package/dist/main-BUjoLIJC.js
DELETED
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
import { createElementBlock as _, openBlock as r, Fragment as W, renderList as U, unref as ie, createElementVNode as b, createBlock as B, resolveDynamicComponent as q, toDisplayString as E, ref as w, watch as J, resolveComponent as ue, createVNode as z, withCtx as K, createCommentVNode as v, onMounted as _e } from "vue";
|
|
2
|
-
import { p as A, s as fe, g as P, e as he, a as ye } from "./array-BejyPB_1.js";
|
|
3
|
-
import { s as L, E as pe, u as ge } from "./menu-oGClEGzK.js";
|
|
4
|
-
import { u as M } from "./modelComp-CqA1NVfH.js";
|
|
5
|
-
import { _ as R, c as k } from "./_plugin-vue_export-helper-B7R8Jogt.js";
|
|
6
|
-
const Ce = { class: "type-select" }, ke = ["onClick"], be = { class: "list-icon" }, Ie = {
|
|
7
|
-
__name: "index",
|
|
8
|
-
setup(T) {
|
|
9
|
-
const $ = M(A), { itemData: e } = L($), j = (l) => pe[l], f = (l) => {
|
|
10
|
-
const y = k(e.value);
|
|
11
|
-
y.push({
|
|
12
|
-
comp: l.comp,
|
|
13
|
-
name: l.name,
|
|
14
|
-
compData: []
|
|
15
|
-
}), $.setItemData(y);
|
|
16
|
-
};
|
|
17
|
-
return (l, y) => (r(), _("div", Ce, [
|
|
18
|
-
(r(!0), _(W, null, U(ie(fe), (h, s) => (r(), _("div", {
|
|
19
|
-
class: "type-list",
|
|
20
|
-
key: s
|
|
21
|
-
}, [
|
|
22
|
-
b("div", {
|
|
23
|
-
class: "list-content",
|
|
24
|
-
onClick: (p) => f(h)
|
|
25
|
-
}, [
|
|
26
|
-
b("div", be, [
|
|
27
|
-
(r(), B(q(j(h.icon))))
|
|
28
|
-
]),
|
|
29
|
-
b("div", null, E(h.name), 1)
|
|
30
|
-
], 8, ke)
|
|
31
|
-
]))), 128))
|
|
32
|
-
]));
|
|
33
|
-
}
|
|
34
|
-
}, De = /* @__PURE__ */ R(Ie, [["__scopeId", "data-v-fe4aecc8"]]), we = { class: "fill-content" }, $e = { class: "operate-content" }, je = { class: "collapse-title" }, xe = { class: "comp-child" }, Ve = {
|
|
35
|
-
__name: "index",
|
|
36
|
-
setup(T) {
|
|
37
|
-
const $ = M(A), { itemData: e, originalData: j } = L($), f = w([]), l = w([]);
|
|
38
|
-
J(
|
|
39
|
-
() => e.value,
|
|
40
|
-
() => {
|
|
41
|
-
var s;
|
|
42
|
-
!e.value || ((s = e.value) == null ? void 0 : s.length) === 0 || (f.value = k(e.value));
|
|
43
|
-
},
|
|
44
|
-
{ deep: !0, immediate: !0 }
|
|
45
|
-
);
|
|
46
|
-
const y = (s) => P(s), h = (s, p, S) => {
|
|
47
|
-
if (!s || s.length === 0) return;
|
|
48
|
-
let n = k(e.value);
|
|
49
|
-
const c = k(p);
|
|
50
|
-
c.compData = s, n = n == null ? void 0 : n.map((g, d) => (d === S && (g = c), g)), $.setItemData(n);
|
|
51
|
-
};
|
|
52
|
-
return (s, p) => {
|
|
53
|
-
const S = ue("el-collapse-item"), n = ue("el-collapse");
|
|
54
|
-
return r(), _("div", we, [
|
|
55
|
-
p[1] || (p[1] = b("div", { class: "fill-operate" }, E("操作栏"), -1)),
|
|
56
|
-
b("div", $e, [
|
|
57
|
-
z(n, {
|
|
58
|
-
modelValue: l.value,
|
|
59
|
-
"onUpdate:modelValue": p[0] || (p[0] = (c) => l.value = c),
|
|
60
|
-
class: "collapse-content"
|
|
61
|
-
}, {
|
|
62
|
-
default: K(() => [
|
|
63
|
-
(r(!0), _(W, null, U(f.value, (c, g) => (r(), B(S, {
|
|
64
|
-
key: g,
|
|
65
|
-
name: g
|
|
66
|
-
}, {
|
|
67
|
-
title: K(() => [
|
|
68
|
-
b("div", je, E(c.name), 1)
|
|
69
|
-
]),
|
|
70
|
-
default: K(() => {
|
|
71
|
-
var d, O;
|
|
72
|
-
return [
|
|
73
|
-
b("div", xe, [
|
|
74
|
-
(r(), B(q(y(c.comp + "Operate")), {
|
|
75
|
-
itemContents: c == null ? void 0 : c.compData,
|
|
76
|
-
originalItemContents: (O = (d = ie(j)) == null ? void 0 : d.find((N, G) => G === g)) == null ? void 0 : O.compData,
|
|
77
|
-
onChange: (N) => h(N, c, g)
|
|
78
|
-
}, null, 40, ["itemContents", "originalItemContents", "onChange"]))
|
|
79
|
-
])
|
|
80
|
-
];
|
|
81
|
-
}),
|
|
82
|
-
_: 2
|
|
83
|
-
}, 1032, ["name"]))), 128))
|
|
84
|
-
]),
|
|
85
|
-
_: 1
|
|
86
|
-
}, 8, ["modelValue"])
|
|
87
|
-
])
|
|
88
|
-
]);
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
}, Oe = /* @__PURE__ */ R(Ve, [["__scopeId", "data-v-a216b035"]]), Se = {
|
|
92
|
-
key: 0,
|
|
93
|
-
class: "show-content"
|
|
94
|
-
}, Ne = {
|
|
95
|
-
__name: "index",
|
|
96
|
-
setup(T) {
|
|
97
|
-
const $ = M(A), { itemData: e } = L($), j = w([]);
|
|
98
|
-
J(
|
|
99
|
-
() => e.value,
|
|
100
|
-
() => {
|
|
101
|
-
var l;
|
|
102
|
-
!e.value || ((l = e.value) == null ? void 0 : l.length) === 0 || (j.value = k(e.value));
|
|
103
|
-
},
|
|
104
|
-
{ deep: !0, immediate: !0 }
|
|
105
|
-
);
|
|
106
|
-
const f = (l) => P(l);
|
|
107
|
-
return (l, y) => {
|
|
108
|
-
var h;
|
|
109
|
-
return ((h = j.value) == null ? void 0 : h.length) > 0 ? (r(), _("div", Se, [
|
|
110
|
-
(r(!0), _(W, null, U(j.value, (s, p) => (r(), _("div", {
|
|
111
|
-
class: "item-content",
|
|
112
|
-
key: p
|
|
113
|
-
}, [
|
|
114
|
-
b("div", null, E(s.name), 1),
|
|
115
|
-
(r(), B(q(f(s.comp)), {
|
|
116
|
-
itemData: s == null ? void 0 : s.compData,
|
|
117
|
-
childItemData: s == null ? void 0 : s.itemChildData,
|
|
118
|
-
key: p
|
|
119
|
-
}, null, 8, ["itemData", "childItemData"]))
|
|
120
|
-
]))), 128))
|
|
121
|
-
])) : v("", !0);
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
}, Te = /* @__PURE__ */ R(Ne, [["__scopeId", "data-v-79320497"]]), F = [
|
|
125
|
-
{
|
|
126
|
-
key: "FormName",
|
|
127
|
-
value: "Form"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
key: "TableName",
|
|
131
|
-
value: "Table"
|
|
132
|
-
}
|
|
133
|
-
], m = [
|
|
134
|
-
{
|
|
135
|
-
key: "FormDirect",
|
|
136
|
-
value: "formFlex"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
key: "Form",
|
|
140
|
-
value: "formContent"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
key: "FormButton",
|
|
144
|
-
value: "formButton"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
key: "TableColumns",
|
|
148
|
-
value: "header"
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
key: "TableButton",
|
|
152
|
-
value: "extraButton"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
key: "LineButton",
|
|
156
|
-
value: "rowButton"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
key: "Table",
|
|
160
|
-
value: "tableContents"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
key: "TableIndex",
|
|
164
|
-
value: "tableIndex"
|
|
165
|
-
}
|
|
166
|
-
], Fe = {
|
|
167
|
-
key: 0,
|
|
168
|
-
class: "show-content"
|
|
169
|
-
}, ve = { class: "item-view-group" }, Be = {
|
|
170
|
-
__name: "index",
|
|
171
|
-
props: {
|
|
172
|
-
content: String,
|
|
173
|
-
jsonContents: Array
|
|
174
|
-
},
|
|
175
|
-
emits: ["change"],
|
|
176
|
-
setup(T, { emit: $ }) {
|
|
177
|
-
const e = T, j = $, f = M(A), { itemData: l } = L(f), y = w([]), h = w([]), s = (n) => {
|
|
178
|
-
j("change", {
|
|
179
|
-
wholeValue: y.value,
|
|
180
|
-
editValue: n
|
|
181
|
-
});
|
|
182
|
-
}, p = (n) => {
|
|
183
|
-
const c = k(y.value), g = c == null ? void 0 : c.map((d, O) => (O === (n == null ? void 0 : n.index) && (d.compData = n == null ? void 0 : n.contents), d));
|
|
184
|
-
y.value = g;
|
|
185
|
-
};
|
|
186
|
-
J(
|
|
187
|
-
() => l.value,
|
|
188
|
-
() => {
|
|
189
|
-
var n;
|
|
190
|
-
!l.value || ((n = l.value) == null ? void 0 : n.length) === 0 || (h.value = l.value, y.value = l.value);
|
|
191
|
-
},
|
|
192
|
-
{ deep: !0, immediate: !0 }
|
|
193
|
-
), J(
|
|
194
|
-
() => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
|
|
195
|
-
() => {
|
|
196
|
-
var c;
|
|
197
|
-
if (((c = e == null ? void 0 : e.jsonContents) == null ? void 0 : c.length) > 0) {
|
|
198
|
-
f.setOriginalData(e == null ? void 0 : e.jsonContents), f.setItemData(e == null ? void 0 : e.jsonContents);
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
if (!(e != null && e.content) || (e == null ? void 0 : e.content) === "") return;
|
|
202
|
-
const n = he(e == null ? void 0 : e.content);
|
|
203
|
-
f.setOriginalData(n), f.setItemData(n);
|
|
204
|
-
},
|
|
205
|
-
{ deep: !0, immediate: !0 }
|
|
206
|
-
);
|
|
207
|
-
const S = (n) => P(n);
|
|
208
|
-
return (n, c) => {
|
|
209
|
-
var g;
|
|
210
|
-
return ((g = h.value) == null ? void 0 : g.length) > 0 ? (r(), _("div", Fe, [
|
|
211
|
-
(r(!0), _(W, null, U(h.value, (d, O) => (r(), _("div", {
|
|
212
|
-
class: "item-content",
|
|
213
|
-
key: O
|
|
214
|
-
}, [
|
|
215
|
-
b("div", ve, E(d.name), 1),
|
|
216
|
-
(r(), B(q(S(d.comp)), {
|
|
217
|
-
itemData: d == null ? void 0 : d.compData,
|
|
218
|
-
childItemData: d == null ? void 0 : d.itemChildData,
|
|
219
|
-
key: O,
|
|
220
|
-
onChange: s,
|
|
221
|
-
index: O,
|
|
222
|
-
onContentChange: p
|
|
223
|
-
}, null, 40, ["itemData", "childItemData", "index"]))
|
|
224
|
-
]))), 128))
|
|
225
|
-
])) : v("", !0);
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
}, Ee = /* @__PURE__ */ R(Be, [["__scopeId", "data-v-869e6e20"]]), Je = { class: "add-model-content" }, Ae = {
|
|
229
|
-
key: 0,
|
|
230
|
-
class: "model-import-data"
|
|
231
|
-
}, Le = { class: "import-button" }, Me = { key: 0 }, Re = {
|
|
232
|
-
key: 1,
|
|
233
|
-
class: "model-operate"
|
|
234
|
-
}, ze = { class: "model-select" }, We = { class: "model-fill" }, Ue = {
|
|
235
|
-
key: 2,
|
|
236
|
-
class: "model-view ssComponent"
|
|
237
|
-
}, qe = {
|
|
238
|
-
__name: "main",
|
|
239
|
-
props: {
|
|
240
|
-
mode: {
|
|
241
|
-
type: String,
|
|
242
|
-
default: "view"
|
|
243
|
-
},
|
|
244
|
-
content: {
|
|
245
|
-
type: String,
|
|
246
|
-
default: ""
|
|
247
|
-
},
|
|
248
|
-
jsonContents: {
|
|
249
|
-
type: Array,
|
|
250
|
-
default: () => []
|
|
251
|
-
},
|
|
252
|
-
showButton: {
|
|
253
|
-
type: Boolean,
|
|
254
|
-
default: !0
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
emits: ["change"],
|
|
258
|
-
setup(T, { emit: $ }) {
|
|
259
|
-
const e = T, j = $, f = w(""), l = w([]), y = w(0), h = M(A);
|
|
260
|
-
ge(A);
|
|
261
|
-
const { itemData: s, originalData: p } = L(h), S = w(null), n = w(0), c = w(""), g = () => {
|
|
262
|
-
y.value = window.innerWidth;
|
|
263
|
-
}, d = async (u) => {
|
|
264
|
-
var C;
|
|
265
|
-
const o = (C = k(u == null ? void 0 : u.wholeValue)) == null ? void 0 : C.map((a) => {
|
|
266
|
-
var x;
|
|
267
|
-
return (a == null ? void 0 : a.comp) === "Form" && (a.compData = (x = a.compData) == null ? void 0 : x.map((V) => ((V == null ? void 0 : V.key) === "formContent" && (V.contents = ye(V == null ? void 0 : V.contents)), V))), a;
|
|
268
|
-
});
|
|
269
|
-
j("change", {
|
|
270
|
-
originalContents: p.value,
|
|
271
|
-
currentContents: u == null ? void 0 : u.wholeValue,
|
|
272
|
-
editContent: u == null ? void 0 : u.editValue,
|
|
273
|
-
stringContent: O(k(u == null ? void 0 : u.wholeValue)),
|
|
274
|
-
arrayToContents: o
|
|
275
|
-
});
|
|
276
|
-
}, O = (u) => {
|
|
277
|
-
var C;
|
|
278
|
-
let o = [];
|
|
279
|
-
return (C = k(u)) == null || C.forEach((a) => {
|
|
280
|
-
var x, V;
|
|
281
|
-
F != null && F.find((t) => (t == null ? void 0 : t.value) === (a == null ? void 0 : a.comp)) && o.push(((x = F == null ? void 0 : F.find((t) => (t == null ? void 0 : t.value) === (a == null ? void 0 : a.comp))) == null ? void 0 : x.key) + "=" + a.name + "/r/n"), (V = a == null ? void 0 : a.compData) == null || V.forEach((t) => {
|
|
282
|
-
var Q, X, Y, Z, ee, te, ne, ae, oe, le, se, re;
|
|
283
|
-
if (m != null && m.find((I) => (I == null ? void 0 : I.value) === (t == null ? void 0 : t.key)))
|
|
284
|
-
if (!((Q = t == null ? void 0 : t.contents) != null && Q.length))
|
|
285
|
-
o.push(((X = m == null ? void 0 : m.find((I) => (I == null ? void 0 : I.value) === (t == null ? void 0 : t.key))) == null ? void 0 : X.key) + "=" + (t.contents === !0 ? '""' : "Vertical") + "/r/n");
|
|
286
|
-
else {
|
|
287
|
-
let I = (Y = t == null ? void 0 : t.contents) == null ? void 0 : Y[0];
|
|
288
|
-
if (!I) return;
|
|
289
|
-
if (Object.keys(I).includes("label") && Object.keys(I).includes("key") && Object.keys(I).includes("width"))
|
|
290
|
-
if (((ee = (Z = t.contents) == null ? void 0 : Z.filter((D) => D.width !== 1)) == null ? void 0 : ee.length) === 0) {
|
|
291
|
-
const D = (te = k(t == null ? void 0 : t.contents)) == null ? void 0 : te.map((i) => ({ [i.label]: i.value }));
|
|
292
|
-
o.push(((ne = m == null ? void 0 : m.find((i) => (i == null ? void 0 : i.value) === (t == null ? void 0 : t.key))) == null ? void 0 : ne.key) + "=" + JSON.stringify(D) + "/r/n");
|
|
293
|
-
} else {
|
|
294
|
-
let D = [];
|
|
295
|
-
(ae = k(t == null ? void 0 : t.contents)) == null || ae.reduce((i, H) => {
|
|
296
|
-
var ce;
|
|
297
|
-
return i[H.label] = H.key, ((ce = Object.keys(k(i))) == null ? void 0 : ce.length) >= H.width && (D.push(k(i)), i = {}), i;
|
|
298
|
-
}, {}), o.push(((oe = m == null ? void 0 : m.find((i) => (i == null ? void 0 : i.value) === (t == null ? void 0 : t.key))) == null ? void 0 : oe.key) + "=" + JSON.stringify(D) + "/r/n");
|
|
299
|
-
}
|
|
300
|
-
else if (Object.keys(I).includes("label")) {
|
|
301
|
-
const D = (le = k(t == null ? void 0 : t.contents)) == null ? void 0 : le.map((i) => i.label);
|
|
302
|
-
o.push(((se = m == null ? void 0 : m.find((i) => (i == null ? void 0 : i.value) === (t == null ? void 0 : t.key))) == null ? void 0 : se.key) + "=" + JSON.stringify(D) + "/r/n");
|
|
303
|
-
} else
|
|
304
|
-
o.push(((re = m == null ? void 0 : m.find((D) => (D == null ? void 0 : D.value) === (t == null ? void 0 : t.key))) == null ? void 0 : re.key) + "=" + JSON.stringify(t == null ? void 0 : t.contents) + "/r/n");
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
}), JSON.stringify(o);
|
|
308
|
-
}, N = w([]), G = () => {
|
|
309
|
-
S.value.click();
|
|
310
|
-
}, de = (u) => {
|
|
311
|
-
const o = u.target.files[0];
|
|
312
|
-
if (!o) return;
|
|
313
|
-
const C = new FileReader();
|
|
314
|
-
C.onload = (a) => {
|
|
315
|
-
try {
|
|
316
|
-
f.value = a.target.result, N.value = me(a.target.result), n.value++;
|
|
317
|
-
} catch (x) {
|
|
318
|
-
console.error("解析失败:", x);
|
|
319
|
-
}
|
|
320
|
-
}, C.onerror = (a) => {
|
|
321
|
-
console.error("文件读取错误:", a);
|
|
322
|
-
}, C.readAsText(o);
|
|
323
|
-
};
|
|
324
|
-
_e(() => {
|
|
325
|
-
window.addEventListener("resize", g);
|
|
326
|
-
}), J(
|
|
327
|
-
() => [e == null ? void 0 : e.content, e == null ? void 0 : e.jsonContents],
|
|
328
|
-
() => {
|
|
329
|
-
f.value = e == null ? void 0 : e.content, l.value = e == null ? void 0 : e.jsonContents;
|
|
330
|
-
},
|
|
331
|
-
{ deep: !0, immediate: !0 }
|
|
332
|
-
), J(
|
|
333
|
-
() => n.value,
|
|
334
|
-
() => {
|
|
335
|
-
var u;
|
|
336
|
-
((u = N.value) == null ? void 0 : u.length) !== 0 && (h.setOriginalData(N.value), h.setItemData(N.value));
|
|
337
|
-
},
|
|
338
|
-
{ deep: !0, immediate: !0 }
|
|
339
|
-
);
|
|
340
|
-
const me = (u) => {
|
|
341
|
-
let o = u.replace(/,/g, ",").replace(/;/g, ";").replace(/:/g, ":");
|
|
342
|
-
o = o.replace(/(\w+)\s*:/g, "$1:"), o = o.replace(/\r\n/g, "").replace(/\n/g, "").replace(/\t/g, "").replace(/\s+/g, " ").trim(), o = o.replace(/,\s*([}\]])/g, "$1"), o = o.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g, ": $2$4");
|
|
343
|
-
try {
|
|
344
|
-
return JSON.parse(o);
|
|
345
|
-
} catch (C) {
|
|
346
|
-
try {
|
|
347
|
-
const x = new Function(`return ${o}`)();
|
|
348
|
-
if (Array.isArray(x) || typeof x == "object")
|
|
349
|
-
return x;
|
|
350
|
-
throw new Error(`解析结果不是有效的数组或对象: ${C}`);
|
|
351
|
-
} catch (a) {
|
|
352
|
-
throw new Error(`无法解析JSON: ${a.message}`);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
};
|
|
356
|
-
return (u, o) => {
|
|
357
|
-
var C;
|
|
358
|
-
return r(), _("div", Je, [
|
|
359
|
-
((C = e == null ? void 0 : e.jsonContents) == null ? void 0 : C.length) === 0 ? (r(), _("div", Ae, [
|
|
360
|
-
b("div", Le, [
|
|
361
|
-
b("input", {
|
|
362
|
-
type: "file",
|
|
363
|
-
ref_key: "fileInput",
|
|
364
|
-
ref: S,
|
|
365
|
-
accept: ".txt",
|
|
366
|
-
onChange: de,
|
|
367
|
-
style: { display: "none" }
|
|
368
|
-
}, null, 544),
|
|
369
|
-
b("button", {
|
|
370
|
-
onClick: G,
|
|
371
|
-
class: "import-button-content"
|
|
372
|
-
}, "导入文件"),
|
|
373
|
-
c.value ? (r(), _("span", Me, E(c.value), 1)) : v("", !0)
|
|
374
|
-
])
|
|
375
|
-
])) : v("", !0),
|
|
376
|
-
(e == null ? void 0 : e.mode) === "edit" ? (r(), _("div", Re, [
|
|
377
|
-
b("div", ze, [
|
|
378
|
-
z(De)
|
|
379
|
-
]),
|
|
380
|
-
(r(), _("div", {
|
|
381
|
-
class: "model-show",
|
|
382
|
-
key: y.value
|
|
383
|
-
}, [
|
|
384
|
-
z(Te)
|
|
385
|
-
])),
|
|
386
|
-
b("div", We, [
|
|
387
|
-
z(Oe)
|
|
388
|
-
])
|
|
389
|
-
])) : v("", !0),
|
|
390
|
-
(e == null ? void 0 : e.mode) === "view" ? (r(), _("div", Ue, [
|
|
391
|
-
(r(), B(Ee, {
|
|
392
|
-
content: f.value,
|
|
393
|
-
onChange: d,
|
|
394
|
-
jsonContents: l.value,
|
|
395
|
-
key: y.value
|
|
396
|
-
}, null, 8, ["content", "jsonContents"]))
|
|
397
|
-
])) : v("", !0)
|
|
398
|
-
]);
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
}, Xe = /* @__PURE__ */ R(qe, [["__scopeId", "data-v-b25bde75"]]);
|
|
402
|
-
export {
|
|
403
|
-
Xe as default
|
|
404
|
-
};
|