| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- import { ref as o, computed as x, watch as ee, resolveComponent as g, resolveDirective as te, openBlock as n, createElementBlock as a, createElementVNode as c, toDisplayString as y, createBlock as d, withCtx as s, createVNode as r, createTextVNode as b, createCommentVNode as u, Fragment as O, renderList as $, withDirectives as A, resolveDynamicComponent as ne, vShow as le, renderSlot as _, normalizeStyle as se, unref as oe } from "vue";
- import { c as ae } from "./side-drag.js";
- import { n as ie, y as re, B as ue } from "./index2.js";
- import { S as ce } from "./index9.js";
- import { _ as de, S as fe } from "./index12.js";
- import { T as pe, _ as ye } from "./index13.js";
- const me = { class: "title" }, ve = { style: { "margin-right": "10px" } }, be = { class: "btns" }, _e = { class: "skeleton-layout-main" }, ke = {
- key: 1,
- class: "side-bar s-theme-bg"
- }, he = { class: "skeleton-content" }, ge = { class: "skeleton-container" }, Ce = 0, Se = /* @__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(l, { emit: V }) {
- const k = V, m = l, B = o(null), K = o(null), L = o(null), P = o(null), C = o(232), v = o(""), I = o(null), N = o(null), f = o(0), w = o(8), R = () => {
- const e = m.tabs || [];
- if (!e.length) {
- v.value = "";
- return;
- }
- const i = S.value;
- e.some((p) => p && p[i] === v.value) || (v.value = e[0][i]);
- }, S = x(() => m.tabKey && m.tabKey.value || "value");
- ee(() => m.tabs, R, { immediate: !0, deep: !0 });
- function E(e) {
- v.value = e;
- const i = m.tabs.find((p) => p[S.value] === e);
- k("tabsChange", i);
- }
- function T(e) {
- f.value += e === "prev" ? -1 : 1, k("stepChange", e, f.value);
- }
- function j() {
- k("stepConfirm", f.value);
- }
- const F = {
- 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 q(e) {
- k("btnCallback", e.key);
- }
- function D(e) {
- return typeof e.icon == "string" ? e.icon : typeof e.icon == "boolean" && e.icon && F[e.key] || "";
- }
- const H = ae(
- () => C.value,
- (e) => C.value = e,
- { min: 232 }
- );
- return (e, i) => {
- const p = g("InfoCircleOutlined"), M = re, h = ue, U = g("arrow-left-outlined"), W = g("arrow-right-outlined"), G = g("save-outlined"), z = ce, J = fe, Q = de, X = ye, Y = pe, Z = te("action");
- return n(), a("div", {
- class: "s-skeleton-layout",
- ref_key: "layout",
- ref: B
- }, [
- c("div", {
- class: "tools",
- ref_key: "tools",
- ref: K
- }, [
- c("div", me, [
- c("span", ve, y(l.title), 1),
- l.subTitle ? (n(), d(M, {
- key: 0,
- placement: "topLeft",
- mouseEnterDelay: 0.5,
- mouseLeaveDelay: 0.5
- }, {
- title: s(() => [
- b(y(l.subTitle), 1)
- ]),
- default: s(() => [
- r(p)
- ]),
- _: 1
- })) : u("", !0)
- ]),
- c("div", be, [
- r(z, { size: w.value }, {
- default: s(() => [
- (n(!0), a(O, null, $(l.buttons, (t) => (n(), a("span", {
- class: "item-btn",
- key: t.key
- }, [
- A((n(), d(h, {
- class: "btn",
- disabled: !!t.disabled,
- type: t.type || t.key === "add" ? "primary" : "default",
- onClick: (Oe) => q(t)
- }, {
- icon: s(() => [
- D(t) ? (n(), d(ne(D(t)), { key: 0 })) : u("", !0)
- ]),
- default: s(() => [
- b(" " + y(e.$l(t.name)), 1)
- ]),
- _: 2
- }, 1032, ["disabled", "type", "onClick"])), [
- [Z, t.action || t.key],
- [le, t.show !== !1]
- ])
- ]))), 128)),
- _(e.$slots, "otherBtns", {}, void 0, !0),
- l.steps.length ? (n(), d(h, {
- key: 0,
- class: "btn",
- disabled: f.value === Ce,
- onClick: i[0] || (i[0] = (t) => T("prev"))
- }, {
- default: s(() => [
- r(U),
- b(y(e.$l("上一步")), 1)
- ]),
- _: 1
- }, 8, ["disabled"])) : u("", !0),
- l.steps.length ? (n(), d(h, {
- key: 1,
- class: "btn",
- type: "primary",
- disabled: f.value === l.steps.length - 1,
- onClick: i[1] || (i[1] = (t) => T("next"))
- }, {
- default: s(() => [
- r(W),
- b(y(e.$l("下一步")), 1)
- ]),
- _: 1
- }, 8, ["disabled"])) : u("", !0),
- r(h, {
- type: "primary",
- onClick: j
- }, {
- default: s(() => [
- r(G),
- b(" " + y(e.$l("确认")), 1)
- ]),
- _: 1
- })
- ]),
- _: 3
- }, 8, ["size"])
- ])
- ], 512),
- c("div", _e, [
- e.$slots.tree ? (n(), a("div", {
- key: 0,
- class: "side s-side-tree",
- ref: "side",
- style: se({ width: C.value + "px" })
- }, [
- _(e.$slots, "tree", {}, void 0, !0)
- ], 4)) : u("", !0),
- e.$slots.tree ? A((n(), a("div", ke, null, 512)), [
- [oe(H)]
- ]) : u("", !0),
- c("div", he, [
- l.steps && l.steps.length ? (n(), a("div", {
- key: 0,
- class: "step-wrap",
- ref_key: "stepRef",
- ref: N
- }, [
- r(Q, {
- current: f.value,
- type: "navigation",
- size: "small"
- }, {
- default: s(() => [
- (n(!0), a(O, null, $(l.steps, (t) => (n(), d(J, {
- title: t,
- key: t,
- disabled: !0
- }, null, 8, ["title"]))), 128))
- ]),
- _: 1
- }, 8, ["current"])
- ], 512)) : u("", !0),
- l.tabs && l.tabs.length ? (n(), a("div", {
- key: 1,
- class: "tabs-wrap",
- ref_key: "tabsRef",
- ref: I
- }, [
- r(Y, {
- "active-key": v.value,
- onChange: E
- }, {
- default: s(() => [
- (n(!0), a(O, null, $(l.tabs, (t) => (n(), d(X, {
- tab: t[l.tabKey.label],
- key: t[S.value]
- }, null, 8, ["tab"]))), 128))
- ]),
- _: 1
- }, 8, ["active-key"])
- ], 512)) : u("", !0),
- c("div", ge, [
- _(e.$slots, "default", {}, void 0, !0)
- ])
- ])
- ]),
- c("div", {
- class: "other",
- ref_key: "other",
- ref: L
- }, [
- _(e.$slots, "other", {}, void 0, !0)
- ], 512),
- e.$slots.footer ? (n(), a("div", {
- key: 0,
- class: "skeleton-footer",
- ref_key: "footer",
- ref: P
- }, [
- r(z, { size: w.value }, {
- default: s(() => [
- _(e.$slots, "footer", {}, void 0, !0)
- ]),
- _: 3
- }, 8, ["size"])
- ], 512)) : u("", !0)
- ], 512);
- };
- }
- }), Ve = /* @__PURE__ */ ie(Se, [["__scopeId", "data-v-a7223d88"]]);
- export {
- Ve as default
- };
|