| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- 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
- };
|