import { ref as i, computed as Y, watch as Z, resolveComponent as S, resolveDirective as x, openBlock as n, createElementBlock as l, createElementVNode as d, toDisplayString as b, createBlock as f, withCtx as u, createVNode as m, createTextVNode as _, createCommentVNode as a, Fragment as $, renderList as T, withDirectives as B, resolveDynamicComponent as ee, vShow as te, renderSlot as g, normalizeStyle as ne } from "vue"; import { n as se, y as oe, B as le } from "./index2.js"; import { _ as ae, S as ie } from "./index11.js"; import { T as ue, _ as re } from "./index12.js"; const de = { class: "title" }, ce = { style: { "margin-right": "10px" } }, fe = { class: "btns" }, me = { key: 0, style: { "margin-left": "8px" } }, ye = { key: 1, class: "steps-btns" }, pe = { class: "skeleton-layout-main" }, ve = { key: 1, class: "side-bar s-theme-bg" }, be = { class: "skeleton-content" }, ke = { class: "skeleton-container" }, he = 0, _e = /* @__PURE__ */ Object.assign({ name: "SSkeletonLayout" }, { __name: "SSkeletonLayout", props: { // 页面标题 title: { type: String, required: !0 }, // 页面副标题 subTitle: { type: String, default: "" }, // 工具条按钮:[{ key, name, icon, type, show, disabled, action }] buttons: { type: Array, default: () => [] }, tabs: { type: Array, default: () => [] }, tabKey: { type: Object, default: () => ({ label: "label", value: "value" }) }, steps: { type: Array, default: () => [] } }, emits: ["tabsChange", "btnCallback", "stepChange", "stepConfirm"], setup(s, { emit: L }) { const C = L, k = s, V = i(null), K = i(null), P = i(null), z = i(null), O = i(232), h = i(""), E = i(null), I = i(null), y = i(0), N = () => { const e = k.tabs || []; if (!e.length) { h.value = ""; return; } const o = w.value; e.some((r) => r && r[o] === h.value) || (h.value = e[0][o]); }, w = Y(() => k.tabKey && k.tabKey.value || "value"); Z(() => k.tabs, N, { immediate: !0, deep: !0 }); function R(e) { h.value = e; const o = k.tabs.find((r) => r[w.value] === e); C("tabsChange", o); } function D(e) { y.value += e === "prev" ? -1 : 1, C("stepChange", e, y.value); } function W() { C("stepConfirm", y.value); } const X = { add: "PlusCircleOutlined", edit: "FormOutlined", delete: "DeleteOutlined", remove: "DeleteOutlined", import: "UploadOutlined", export: "DownloadOutlined", assign: "ClusterOutlined", execute: "PlayCircleOutlined", pause: "PauseCircleOutlined", resume: "PoweroffOutlined", approve: "HighlightOutlined", setting: "SettingOutlined", TopOfType: "VerticalAlignTopOutlined", TOP: "VerticalAlignTopOutlined", synchronize: "SyncOutlined" }; function j(e) { C("btnCallback", e.key); } function A(e) { return typeof e.icon == "string" ? e.icon : typeof e.icon == "boolean" && e.icon && X[e.key] || ""; } const F = { mounted(e) { e.style.cursor = "e-resize", document.addEventListener("selectstart", (o) => { o.preventDefault(); }), e.onmousedown = (o) => { const r = o.clientX, p = O.value; document.onmousemove = (v) => { const c = v.clientX - r; if (c < 0) { if (p + c <= 232) return; O.value = p + c; } else { if (p + c >= 500) return; O.value = p + c; } }, document.onmouseup = () => { document.onmousemove = document.onmousedown = null; }; }; } }; return (e, o) => { const r = S("InfoCircleOutlined"), p = oe, v = le, c = S("arrow-left-outlined"), q = S("arrow-right-outlined"), H = S("save-outlined"), M = ie, U = ae, G = re, J = ue, Q = x("action"); return n(), l("div", { class: "s-skeleton-layout", ref_key: "layout", ref: V }, [ d("div", { class: "tools", ref_key: "tools", ref: K }, [ d("div", de, [ d("span", ce, b(s.title), 1), s.subTitle ? (n(), f(p, { key: 0, placement: "topLeft", mouseEnterDelay: 0.5, mouseLeaveDelay: 0.5 }, { title: u(() => [ _(b(s.subTitle), 1) ]), default: u(() => [ m(r) ]), _: 1 })) : a("", !0) ]), d("div", fe, [ (n(!0), l($, null, T(s.buttons, (t) => (n(), l("span", { class: "item-btn", key: t.key }, [ B((n(), f(v, { class: "btn", disabled: !!t.disabled, type: t.type || t.key === "add" ? "primary" : "default", onClick: (ge) => j(t) }, { icon: u(() => [ A(t) ? (n(), f(ee(A(t)), { key: 0 })) : a("", !0) ]), default: u(() => [ _(" " + b(e.$l(t.name)), 1) ]), _: 2 }, 1032, ["disabled", "type", "onClick"])), [ [Q, t.action || t.key], [te, t.show !== !1] ]) ]))), 128)), e.$slots.otherBtns ? (n(), l("span", me, [ g(e.$slots, "otherBtns", {}, void 0, !0) ])) : a("", !0), s.steps.length > 0 ? (n(), l("span", ye, [ s.steps.length ? (n(), f(v, { key: 0, class: "btn", disabled: y.value === he, onClick: o[0] || (o[0] = (t) => D("prev")) }, { default: u(() => [ m(c), _(b(e.$l("上一步")), 1) ]), _: 1 }, 8, ["disabled"])) : a("", !0), s.steps.length ? (n(), f(v, { key: 1, class: "btn", type: "primary", disabled: y.value === s.steps.length - 1, onClick: o[1] || (o[1] = (t) => D("next")) }, { default: u(() => [ m(q), _(b(e.$l("下一步")), 1) ]), _: 1 }, 8, ["disabled"])) : a("", !0), m(v, { style: { "margin-right": "8px" }, type: "primary", onClick: W }, { default: u(() => [ m(H), _(" " + b(e.$l("确认")), 1) ]), _: 1 }) ])) : a("", !0) ]) ], 512), d("div", pe, [ e.$slots.tree ? (n(), l("div", { key: 0, class: "side s-side-tree", ref: "side", style: ne({ width: O.value + "px" }) }, [ g(e.$slots, "tree", {}, void 0, !0) ], 4)) : a("", !0), e.$slots.tree ? B((n(), l("div", ve, null, 512)), [ [F] ]) : a("", !0), d("div", be, [ s.steps && s.steps.length ? (n(), l("div", { key: 0, class: "step-wrap", ref_key: "stepRef", ref: I }, [ m(U, { current: y.value, type: "navigation", size: "small" }, { default: u(() => [ (n(!0), l($, null, T(s.steps, (t) => (n(), f(M, { title: t, key: t, disabled: !0 }, null, 8, ["title"]))), 128)) ]), _: 1 }, 8, ["current"]) ], 512)) : a("", !0), s.tabs && s.tabs.length ? (n(), l("div", { key: 1, class: "tabs-wrap", ref_key: "tabsRef", ref: E }, [ m(J, { "active-key": h.value, onChange: R }, { default: u(() => [ (n(!0), l($, null, T(s.tabs, (t) => (n(), f(G, { tab: t[s.tabKey.label], key: t[w.value] }, null, 8, ["tab"]))), 128)) ]), _: 1 }, 8, ["active-key"]) ], 512)) : a("", !0), d("div", ke, [ g(e.$slots, "default", {}, void 0, !0) ]) ]) ]), d("div", { class: "other", ref_key: "other", ref: P }, [ g(e.$slots, "other", {}, void 0, !0) ], 512), e.$slots.footer ? (n(), l("div", { key: 0, class: "skeleton-footer", ref_key: "footer", ref: z }, [ g(e.$slots, "footer", {}, void 0, !0) ], 512)) : a("", !0) ], 512); }; } }), $e = /* @__PURE__ */ se(_e, [["__scopeId", "data-v-56957248"]]); export { $e as default };