|
|
@@ -1,9 +1,14 @@
|
|
|
-import { ref as d, onMounted as T, onActivated as L, resolveDirective as P, openBlock as l, createElementBlock as i, normalizeStyle as c, createElementVNode as r, toDisplayString as S, Fragment as V, renderList as A, withDirectives as _, createBlock as b, withCtx as w, createTextVNode as N, resolveDynamicComponent as z, createCommentVNode as f, vShow as E, renderSlot as m, nextTick as M } from "vue";
|
|
|
-import { n as W, B as X } from "./index2.js";
|
|
|
-const F = { class: "title" }, I = { class: "btns" }, j = {
|
|
|
+import { ref as u, computed as Y, watch as Z, onMounted as ee, onActivated as te, resolveComponent as V, resolveDirective as ne, openBlock as n, createElementBlock as a, normalizeStyle as v, createElementVNode as d, toDisplayString as C, Fragment as K, renderList as L, withDirectives as j, createBlock as m, withCtx as f, createTextVNode as A, resolveDynamicComponent as le, createCommentVNode as r, vShow as se, renderSlot as D, createVNode as h, nextTick as oe } from "vue";
|
|
|
+import { n as ae, B as ie } from "./index2.js";
|
|
|
+import { _ as ue, S as re } from "./index10.js";
|
|
|
+import { T as ce, _ as de } from "./index11.js";
|
|
|
+const fe = { class: "title" }, ye = { class: "btns" }, pe = {
|
|
|
key: 0,
|
|
|
style: { "margin-left": "8px" }
|
|
|
-}, q = /* @__PURE__ */ Object.assign({ name: "SSkeletonLayout" }, {
|
|
|
+}, ve = {
|
|
|
+ key: 1,
|
|
|
+ class: "steps-btns"
|
|
|
+}, me = /* @__PURE__ */ Object.assign({ name: "SSkeletonLayout" }, {
|
|
|
__name: "SSkeletonLayout",
|
|
|
props: {
|
|
|
// 页面标题
|
|
|
@@ -16,23 +21,57 @@ const F = { class: "title" }, I = { class: "btns" }, j = {
|
|
|
type: Array,
|
|
|
default: () => []
|
|
|
},
|
|
|
- bgColor: {
|
|
|
- type: String,
|
|
|
- default: ""
|
|
|
+ tabs: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
+ },
|
|
|
+ tabKey: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({
|
|
|
+ label: "label",
|
|
|
+ value: "value"
|
|
|
+ })
|
|
|
+ },
|
|
|
+ steps: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
}
|
|
|
},
|
|
|
- emits: ["btnCallback"],
|
|
|
- setup(p, { emit: $ }) {
|
|
|
- const h = d(null), v = d(null), k = d(null), y = d(232), a = d(0);
|
|
|
- function g() {
|
|
|
- M(() => {
|
|
|
- var o, t, n, C;
|
|
|
- const e = ((t = (o = h.value) == null ? void 0 : o.parentNode) == null ? void 0 : t.offsetHeight) || 0, s = ((n = v.value) == null ? void 0 : n.offsetHeight) || 0, u = ((C = k.value) == null ? void 0 : C.offsetHeight) || 0;
|
|
|
- a.value = Math.max(e - s - u, 0);
|
|
|
+ emits: ["tabsChange", "btnCallback", "stepChange", "stepConfirm"],
|
|
|
+ setup(s, { emit: F }) {
|
|
|
+ const _ = F, g = s, x = u(null), N = u(null), P = u(null), O = u(232), y = u(0), b = u(""), z = u(null), R = u(null), p = u(0), E = u(0), B = Y(() => g.tabKey && g.tabKey.value || "value");
|
|
|
+ Z(() => g.tabs, I, { immediate: !0, deep: !0 });
|
|
|
+ const I = () => {
|
|
|
+ const e = g.tabs || [];
|
|
|
+ if (!e.length) {
|
|
|
+ b.value = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const l = B.value;
|
|
|
+ e.some((o) => o && o[l] === b.value) || (b.value = e[0][l]);
|
|
|
+ };
|
|
|
+ function q(e) {
|
|
|
+ b.value = e;
|
|
|
+ const l = g.tabs.find((o) => o[B.value] === e);
|
|
|
+ _("tabsChange", l);
|
|
|
+ }
|
|
|
+ function M(e) {
|
|
|
+ p.value += e === "prev" ? -1 : 1, _("stepChange", e, p.value);
|
|
|
+ }
|
|
|
+ function U() {
|
|
|
+ _("stepConfirm", p.value);
|
|
|
+ }
|
|
|
+ function W() {
|
|
|
+ oe(() => {
|
|
|
+ var i, S, w, $, H, T;
|
|
|
+ const e = ((S = (i = x.value) == null ? void 0 : i.parentNode) == null ? void 0 : S.offsetHeight) || 0, l = ((w = N.value) == null ? void 0 : w.offsetHeight) || 0, o = (($ = P.value) == null ? void 0 : $.offsetHeight) || 0;
|
|
|
+ y.value = Math.max(e - l - o, 0);
|
|
|
+ const c = ((H = z.value) == null ? void 0 : H.offsetHeight) || 0, k = ((T = R.value) == null ? void 0 : T.offsetHeight) || 0;
|
|
|
+ E.value = y.value - c - k;
|
|
|
});
|
|
|
}
|
|
|
- T(() => g()), L(() => g());
|
|
|
- const D = $, H = {
|
|
|
+ ee(() => W()), te(() => W());
|
|
|
+ const G = {
|
|
|
add: "PlusCircleOutlined",
|
|
|
edit: "FormOutlined",
|
|
|
delete: "DeleteOutlined",
|
|
|
@@ -49,26 +88,26 @@ const F = { class: "title" }, I = { class: "btns" }, j = {
|
|
|
TOP: "VerticalAlignTopOutlined",
|
|
|
synchronize: "SyncOutlined"
|
|
|
};
|
|
|
- function x(e) {
|
|
|
- D("btnCallback", e.key);
|
|
|
+ function J(e) {
|
|
|
+ _("btnCallback", e.key);
|
|
|
}
|
|
|
- function O(e) {
|
|
|
- return typeof e.icon == "string" ? e.icon : typeof e.icon == "boolean" && e.icon && H[e.key] || "";
|
|
|
+ function X(e) {
|
|
|
+ return typeof e.icon == "string" ? e.icon : typeof e.icon == "boolean" && e.icon && G[e.key] || "";
|
|
|
}
|
|
|
- const B = {
|
|
|
+ const Q = {
|
|
|
mounted(e) {
|
|
|
- e.style.cursor = "e-resize", document.addEventListener("selectstart", (s) => {
|
|
|
- s.preventDefault();
|
|
|
- }), e.onmousedown = (s) => {
|
|
|
- const u = s.clientX, o = y.value;
|
|
|
- document.onmousemove = (t) => {
|
|
|
- const n = t.clientX - u;
|
|
|
- if (n < 0) {
|
|
|
- if (o + n <= 232) return;
|
|
|
- y.value = o + n;
|
|
|
+ e.style.cursor = "e-resize", document.addEventListener("selectstart", (l) => {
|
|
|
+ l.preventDefault();
|
|
|
+ }), e.onmousedown = (l) => {
|
|
|
+ const o = l.clientX, c = O.value;
|
|
|
+ document.onmousemove = (k) => {
|
|
|
+ const i = k.clientX - o;
|
|
|
+ if (i < 0) {
|
|
|
+ if (c + i <= 232) return;
|
|
|
+ O.value = c + i;
|
|
|
} else {
|
|
|
- if (o + n >= 500) return;
|
|
|
- y.value = o + n;
|
|
|
+ if (c + i >= 500) return;
|
|
|
+ O.value = c + i;
|
|
|
}
|
|
|
}, document.onmouseup = () => {
|
|
|
document.onmousemove = document.onmousedown = null;
|
|
|
@@ -76,85 +115,168 @@ const F = { class: "title" }, I = { class: "btns" }, j = {
|
|
|
};
|
|
|
}
|
|
|
};
|
|
|
- return (e, s) => {
|
|
|
- const u = X, o = P("action");
|
|
|
- return l(), i("div", {
|
|
|
+ return (e, l) => {
|
|
|
+ const o = ie, c = V("arrow-left-outlined"), k = V("arrow-right-outlined"), i = V("save-outlined"), S = re, w = ue, $ = de, H = ce, T = ne("action");
|
|
|
+ return n(), a("div", {
|
|
|
class: "s-skeleton-layout",
|
|
|
ref_key: "layout",
|
|
|
- ref: h,
|
|
|
- style: c({ backgroundColor: p.bgColor })
|
|
|
+ ref: x,
|
|
|
+ style: v({ backgroundColor: e.bgColor })
|
|
|
}, [
|
|
|
- r("div", {
|
|
|
+ d("div", {
|
|
|
class: "tools",
|
|
|
ref_key: "tools",
|
|
|
- ref: v
|
|
|
+ ref: N
|
|
|
}, [
|
|
|
- r("div", F, S(p.title), 1),
|
|
|
- r("div", I, [
|
|
|
- (l(!0), i(V, null, A(p.buttons, (t) => (l(), i("span", {
|
|
|
+ d("div", fe, C(s.title), 1),
|
|
|
+ d("div", ye, [
|
|
|
+ (n(!0), a(K, null, L(s.buttons, (t) => (n(), a("span", {
|
|
|
class: "item-btn",
|
|
|
key: t.key
|
|
|
}, [
|
|
|
- _((l(), b(u, {
|
|
|
+ j((n(), m(o, {
|
|
|
class: "btn",
|
|
|
disabled: !!t.disabled,
|
|
|
type: t.type || t.key === "add" ? "primary" : "default",
|
|
|
- onClick: (n) => x(t)
|
|
|
+ onClick: (he) => J(t)
|
|
|
}, {
|
|
|
- icon: w(() => [
|
|
|
- O(t) ? (l(), b(z(O(t)), { key: 0 })) : f("", !0)
|
|
|
+ icon: f(() => [
|
|
|
+ X(t) ? (n(), m(le(X(t)), { key: 0 })) : r("", !0)
|
|
|
]),
|
|
|
- default: w(() => [
|
|
|
- N(" " + S(e.$l(t.name)), 1)
|
|
|
+ default: f(() => [
|
|
|
+ A(" " + C(e.$l(t.name)), 1)
|
|
|
]),
|
|
|
_: 2
|
|
|
}, 1032, ["disabled", "type", "onClick"])), [
|
|
|
- [o, t.action || t.key],
|
|
|
- [E, t.show !== !1]
|
|
|
+ [T, t.action || t.key],
|
|
|
+ [se, t.show !== !1]
|
|
|
])
|
|
|
]))), 128)),
|
|
|
- e.$slots.otherBtns ? (l(), i("span", j, [
|
|
|
- m(e.$slots, "otherBtns", {}, void 0, !0)
|
|
|
- ])) : f("", !0)
|
|
|
+ e.$slots.otherBtns ? (n(), a("span", pe, [
|
|
|
+ D(e.$slots, "otherBtns", {}, void 0, !0)
|
|
|
+ ])) : r("", !0),
|
|
|
+ s.steps.length > 0 ? (n(), a("span", ve, [
|
|
|
+ s.steps.length ? (n(), m(o, {
|
|
|
+ key: 0,
|
|
|
+ class: "btn",
|
|
|
+ disabled: p.value === e.stepDefaultActive,
|
|
|
+ onClick: l[0] || (l[0] = (t) => M("prev"))
|
|
|
+ }, {
|
|
|
+ default: f(() => [
|
|
|
+ h(c),
|
|
|
+ A(C(e.$l("上一步")), 1)
|
|
|
+ ]),
|
|
|
+ _: 1
|
|
|
+ }, 8, ["disabled"])) : r("", !0),
|
|
|
+ s.steps.length ? (n(), m(o, {
|
|
|
+ key: 1,
|
|
|
+ class: "btn",
|
|
|
+ type: "primary",
|
|
|
+ disabled: p.value === s.steps.length - 1,
|
|
|
+ onClick: l[1] || (l[1] = (t) => M("next"))
|
|
|
+ }, {
|
|
|
+ default: f(() => [
|
|
|
+ h(k),
|
|
|
+ A(C(e.$l("下一步")), 1)
|
|
|
+ ]),
|
|
|
+ _: 1
|
|
|
+ }, 8, ["disabled"])) : r("", !0),
|
|
|
+ h(o, {
|
|
|
+ style: { "margin-right": "8px" },
|
|
|
+ type: "primary",
|
|
|
+ onClick: U
|
|
|
+ }, {
|
|
|
+ default: f(() => [
|
|
|
+ h(i),
|
|
|
+ A(" " + C(e.$l("确认")), 1)
|
|
|
+ ]),
|
|
|
+ _: 1
|
|
|
+ })
|
|
|
+ ])) : r("", !0)
|
|
|
])
|
|
|
], 512),
|
|
|
- r("div", {
|
|
|
+ d("div", {
|
|
|
class: "skeleton-layout-main",
|
|
|
- style: c({ height: a.value + "px" })
|
|
|
+ style: v({ height: y.value + "px" })
|
|
|
}, [
|
|
|
- e.$slots.tree ? (l(), i("div", {
|
|
|
+ e.$slots.tree ? (n(), a("div", {
|
|
|
key: 0,
|
|
|
class: "side s-side-tree",
|
|
|
ref: "side",
|
|
|
- style: c([{ height: a.value + "px", width: y.value + "px" }, { "overflow-y": "auto" }])
|
|
|
+ style: v([{ height: y.value + "px", width: O.value + "px" }, { "overflow-y": "auto" }])
|
|
|
}, [
|
|
|
- m(e.$slots, "tree", {}, void 0, !0)
|
|
|
- ], 4)) : f("", !0),
|
|
|
- e.$slots.tree ? _((l(), i("div", {
|
|
|
+ D(e.$slots, "tree", {}, void 0, !0)
|
|
|
+ ], 4)) : r("", !0),
|
|
|
+ e.$slots.tree ? j((n(), a("div", {
|
|
|
key: 1,
|
|
|
class: "side-bar s-theme-bg",
|
|
|
- style: c({ height: a.value + "px" })
|
|
|
+ style: v({ height: y.value + "px" })
|
|
|
}, null, 4)), [
|
|
|
- [B]
|
|
|
- ]) : f("", !0),
|
|
|
- r("div", {
|
|
|
+ [Q]
|
|
|
+ ]) : r("", !0),
|
|
|
+ d("div", {
|
|
|
class: "skeleton-content",
|
|
|
- style: c({ height: a.value + "px" })
|
|
|
+ style: v({ height: y.value + "px" })
|
|
|
}, [
|
|
|
- m(e.$slots, "default", {}, void 0, !0)
|
|
|
+ s.steps && s.steps.length ? (n(), a("div", {
|
|
|
+ key: 0,
|
|
|
+ class: "step-wrap",
|
|
|
+ ref_key: "stepRef",
|
|
|
+ ref: R
|
|
|
+ }, [
|
|
|
+ h(w, {
|
|
|
+ current: p.value,
|
|
|
+ type: "navigation",
|
|
|
+ size: "small"
|
|
|
+ }, {
|
|
|
+ default: f(() => [
|
|
|
+ (n(!0), a(K, null, L(s.steps, (t) => (n(), m(S, {
|
|
|
+ title: t,
|
|
|
+ key: t,
|
|
|
+ disabled: !0
|
|
|
+ }, null, 8, ["title"]))), 128))
|
|
|
+ ]),
|
|
|
+ _: 1
|
|
|
+ }, 8, ["current"])
|
|
|
+ ], 512)) : r("", !0),
|
|
|
+ s.tabs && s.tabs.length ? (n(), a("div", {
|
|
|
+ key: 1,
|
|
|
+ class: "tabs-wrap",
|
|
|
+ ref_key: "tabsRef",
|
|
|
+ ref: z
|
|
|
+ }, [
|
|
|
+ h(H, {
|
|
|
+ "active-key": b.value,
|
|
|
+ onChange: q
|
|
|
+ }, {
|
|
|
+ default: f(() => [
|
|
|
+ (n(!0), a(K, null, L(s.tabs, (t) => (n(), m($, {
|
|
|
+ tab: t[s.tabKey.label],
|
|
|
+ key: t[B.value]
|
|
|
+ }, null, 8, ["tab"]))), 128))
|
|
|
+ ]),
|
|
|
+ _: 1
|
|
|
+ }, 8, ["active-key"])
|
|
|
+ ], 512)) : r("", !0),
|
|
|
+ d("div", {
|
|
|
+ class: "skeleton-container",
|
|
|
+ style: v({ height: E.value + "px" })
|
|
|
+ }, [
|
|
|
+ D(e.$slots, "default", {}, void 0, !0)
|
|
|
+ ], 4)
|
|
|
], 4)
|
|
|
], 4),
|
|
|
- r("div", {
|
|
|
+ d("div", {
|
|
|
class: "other",
|
|
|
ref_key: "other",
|
|
|
- ref: k
|
|
|
+ ref: P
|
|
|
}, [
|
|
|
- m(e.$slots, "other", {}, void 0, !0)
|
|
|
+ D(e.$slots, "other", {}, void 0, !0)
|
|
|
], 512)
|
|
|
], 4);
|
|
|
};
|
|
|
}
|
|
|
-}), J = /* @__PURE__ */ W(q, [["__scopeId", "data-v-9e0f7d9d"]]);
|
|
|
+}), _e = /* @__PURE__ */ ae(me, [["__scopeId", "data-v-b3f920e1"]]);
|
|
|
export {
|
|
|
- J as default
|
|
|
+ _e as default
|
|
|
};
|