zl-arco-comp
Version:
install ``` npm install zl-arco-comp ```
884 lines (883 loc) • 29.6 kB
JavaScript
import { resolveComponent as b, createBlock as w, openBlock as m, withCtx as u, createVNode as C, renderSlot as k, defineComponent as O, computed as S, createElementBlock as I, normalizeStyle as U, h as P, resolveDynamicComponent as ne, mergeModels as Q, useModel as le, ref as Z, createElementVNode as v, nextTick as fe, inject as me, unref as L, isRef as ae, Fragment as H, renderList as A, createTextVNode as B, toDisplayString as M, useSlots as X, cloneVNode as _e, provide as he, createCommentVNode as F, onMounted as se, createSlots as ee, mergeProps as R, createApp as ge, onUnmounted as ve, onActivated as ye, onDeactivated as be, resolveDirective as xe, normalizeClass as Ce, withDirectives as ke } from "vue";
import { useStorage as ie } from "@vueuse/core";
import { useRoute as re } from "vue-router";
import { Modal as Se } from "@arco-design/web-vue";
const T = (t, n) => {
const e = t.__vccOpts || t;
for (const [l, a] of n)
e[l] = a;
return e;
}, we = {};
function $e(t, n) {
const e = b("a-layout-header"), l = b("a-layout-sider"), a = b("a-layout-content"), s = b("a-layout"), _ = b("a-layout-footer");
return m(), w(s, { class: "zl-layout" }, {
default: u(() => [
C(e, { class: "zl-layout-header" }, {
default: u(() => [
k(t.$slots, "header", {}, void 0, !0)
]),
_: 3
}),
C(s, null, {
default: u(() => [
C(l, { class: "zl-layout-sider" }, {
default: u(() => [
k(t.$slots, "sider", {}, void 0, !0)
]),
_: 3
}),
C(a, { class: "zl-layout-content" }, {
default: u(() => [
k(t.$slots, "content", {}, void 0, !0)
]),
_: 3
})
]),
_: 3
}),
C(_, null, {
default: u(() => [
k(t.$slots, "footer", {}, void 0, !0)
]),
_: 3
})
]),
_: 3
});
}
const K = /* @__PURE__ */ T(we, [["render", $e], ["__scopeId", "data-v-4971bcf1"]]);
K.install = (t) => {
t.component("ZlLayout", K);
};
const ze = /* @__PURE__ */ O({
__name: "index",
props: {
autoBorderRadius: { type: [Boolean, Function], default: !1 },
occupiedHeight: { default: 0 },
isFirst: { type: Function, default: () => !1 }
},
setup(t) {
const n = t, e = S(() => `calc(100vh - 60px - 32px - 24px - ${n.occupiedHeight}px)`);
return (l, a) => (m(), I("div", {
class: "zl-content-box",
style: U({
"--border": "0px 10px 10px 10px",
"--height": e.value
})
}, [
k(l.$slots, "default", {}, void 0, !0)
], 4));
}
}), q = /* @__PURE__ */ T(ze, [["__scopeId", "data-v-ce596e38"]]);
q.install = (t) => {
t.component("ZLContentBox", q);
};
const Ie = { class: "my-icon" }, Ve = /* @__PURE__ */ O({
__name: "index",
props: {
src: { default: "" },
icon: { default: "" },
size: { default: "12px" },
style: {}
},
setup(t) {
const n = t, e = S(() => n.src.includes("http://") || n.src.includes("https://") ? P("img", { src: n.src, style: { width: n.size, height: n.size, fontSize: n.size, ...n.style } }) : n.icon);
return (l, a) => (m(), I("div", Ie, [
(m(), w(ne(e.value)))
]));
}
}), E = /* @__PURE__ */ T(Ve, [["__scopeId", "data-v-8c01a026"]]), Be = /* @__PURE__ */ O({
__name: "index",
props: /* @__PURE__ */ Q({
trigger: { default: "click" },
position: { default: "bottom" },
duration: { default: 0.5 },
disabled: { type: Boolean },
popupContainer: {},
popupOffset: { default: 0 }
}, {
modelValue: {},
modelModifiers: {}
}),
emits: ["update:modelValue"],
setup(t) {
const n = t, e = le(t, "modelValue"), l = Z(), a = Z(!1), s = S({
get() {
return typeof e !== void 0 ? !!e.value : a.value;
},
set(h) {
h ? i() : f();
}
}), _ = () => {
fe(() => {
const { height: h } = l.value.getBoundingClientRect();
l.value.style.height = "0px", l.value.getBoundingClientRect(), l.value.style.height = `${h}px`, l.value.style.transition = `height ${n.duration}s`;
});
}, f = () => {
l.value.style.height = "0px", g(/* @__PURE__ */ new Date());
}, i = () => {
e.value = !0, a.value = !0, _();
}, g = (h) => {
requestAnimationFrame(() => {
if ((/* @__PURE__ */ new Date()).getTime() - h.getTime() >= n.duration * 1e3) {
e.value = !1, a.value = !1;
return;
}
return g(h);
});
};
return (h, p) => {
const x = b("a-trigger");
return m(), w(x, {
"popup-visible": s.value,
"onUpdate:popupVisible": p[0] || (p[0] = (V) => s.value = V),
trigger: h.trigger,
position: h.position,
duration: h.duration,
"popup-container": h.popupContainer,
"popup-offset": h.popupOffset
}, {
content: u(() => [
v("div", {
ref_key: "popupRef",
ref: l,
class: "content-popup"
}, [
k(h.$slots, "content", {}, void 0, !0)
], 512)
]),
default: u(() => [
k(h.$slots, "default", {}, void 0, !0)
]),
_: 3
}, 8, ["popup-visible", "trigger", "position", "duration", "popup-container", "popup-offset"]);
};
}
}), D = /* @__PURE__ */ T(Be, [["__scopeId", "data-v-d40be7ec"]]), Ze = { class: "custom-column-box" }, Te = {
__name: "SearchItem",
setup(t) {
const { searchItem: n, modelValue: e } = me("searchItem");
return (l, a) => {
const s = b("a-checkbox"), _ = b("a-checkbox-group"), f = b("a-form-item");
return m(), w(f, {
field: "search-item__custom",
"hide-label": ""
}, {
default: u(() => [
C(D, { "popup-translate": [20, 0] }, {
content: u(() => [
v("div", Ze, [
C(_, {
direction: "vertical",
modelValue: L(e),
"onUpdate:modelValue": a[0] || (a[0] = (i) => ae(e) ? e.value = i : null)
}, {
default: u(() => [
(m(!0), I(H, null, A(L(n), (i, g) => (m(), w(s, {
key: i.field,
value: i.field,
disabled: !g
}, {
default: u(() => [
B(M(i.label), 1)
]),
_: 2
}, 1032, ["value", "disabled"]))), 128))
]),
_: 1
}, 8, ["modelValue"])
])
]),
default: u(() => [
a[1] || (a[1] = v("div", { class: "custom-column" }, "筛选项", -1))
]),
_: 1,
__: [1]
})
]),
_: 1
});
};
}
}, Le = /* @__PURE__ */ T(Te, [["__scopeId", "data-v-f194a3bf"]]);
function Oe(t, n = "searchItem") {
const e = re(), l = X(), s = e.name + "-" + n;
if (!l.default)
return {};
const _ = l.default, i = _()[0];
if (!i.children)
return {};
const g = i.children;
if (!g.default)
return {};
const h = g.default(), p = S(() => h.filter((o) => o.props).map((o) => o.props)), x = ie(s, []), V = S({
get: () => {
var o;
return (o = x.value) != null && o.length ? x.value : t != null && t.length ? t.filter((r) => p.value.some((y) => (y == null ? void 0 : y.field) === r)) : p.value.map((r) => r == null ? void 0 : r.field).filter(Boolean);
},
set: (o) => {
x.value = o;
}
}), d = S(() => {
const o = _e(i);
return o.children = {
default: () => {
const r = h.filter((y) => {
var z, N;
return (N = V.value) == null ? void 0 : N.includes((z = y == null ? void 0 : y.props) == null ? void 0 : z.field);
});
return r.push(P(Le)), r;
}
}, o;
});
return { modelValue: V, searchItem: p, newVnode: d };
}
const De = { class: "search-container" }, Ae = {
ref: "fromRef",
class: "from-container"
}, Ee = { class: "btn-container" }, Ne = { class: "search" }, He = { class: "reset" }, Me = {
key: 0,
class: "line"
}, Re = /* @__PURE__ */ O({
__name: "index",
props: {
hideLine: { type: Boolean, default: !1 },
formItemWidth: { default: "14vw" },
openSearchItem: { type: Boolean, default: !1 },
defaultItem: { default: () => [] },
localKey: {}
},
emits: ["search", "reset"],
setup(t, { emit: n }) {
const e = t, l = n;
let a = null;
if (e.openSearchItem) {
const { modelValue: f, searchItem: i, newVnode: g } = Oe(e.defaultItem, e.localKey);
a = g, he("searchItem", { searchItem: i, modelValue: f });
}
const s = () => {
l("search");
}, _ = () => {
l("reset");
};
return (f, i) => {
const g = b("a-button");
return m(), I("div", {
class: "zl-search-box",
style: U({ "--formItemWidth": f.formItemWidth })
}, [
v("div", De, [
v("div", Ae, [
e.openSearchItem ? (m(), w(ne(L(a)), { key: 0 })) : k(f.$slots, "default", { key: 1 }, void 0, !0)
], 512),
v("div", Ee, [
v("div", Ne, [
C(g, {
type: "primary",
onClick: s
}, {
icon: u(() => [
C(E, { src: "https://static.wi-fi.cn/omc/202506/1a543473cbdd4bfbc258462f854d39076aea3b75.png" })
]),
_: 1
})
]),
v("div", He, [
C(g, { onClick: _ }, {
default: u(() => i[0] || (i[0] = [
B("重置")
])),
_: 1,
__: [0]
})
])
])
]),
e.hideLine ? F("", !0) : (m(), I("div", Me))
], 4);
};
}
}), W = /* @__PURE__ */ T(Re, [["__scopeId", "data-v-8ee10491"]]);
W.install = (t) => {
t.component("ZlSearchBox", W);
};
D.install = (t) => {
t.component("ZlTrigger", D);
};
E.install = (t) => {
t.component("ZlIcon", E);
};
const Ue = { class: "select-footer" }, Pe = { class: "select-footer" }, Fe = /* @__PURE__ */ O({
__name: "index",
props: /* @__PURE__ */ Q({
options: {},
maxTagCount: { default: 1 },
fieldNames: { default: () => ({ label: "label", value: "value" }) },
placeholder: { default: "请选择" },
multiple: { type: Boolean, default: !1 },
disabled: { type: Boolean, default: !1 },
hideClean: { type: Boolean, default: !1 },
allowCreate: { type: Boolean, default: !1 },
virtualListProps: { default: () => ({ height: 200 }) },
loading: { type: Boolean, default: void 0 },
formatLabel: { type: Function, default: void 0 }
}, {
modelValue: {},
modelModifiers: {}
}),
emits: /* @__PURE__ */ Q(["change", "input-value-change"], ["update:modelValue"]),
setup(t, { emit: n }) {
const e = t, l = le(t, "modelValue"), a = S({
get: () => {
var d;
return e.multiple ? Array.isArray(l.value) && ((d = l.value) != null && d.length) ? l.value : [] : l.value ? l.value : "";
},
set(d) {
l.value = d;
}
});
let s = !0;
const _ = S(() => {
var d;
return e.loading !== void 0 ? e.loading : (d = e.options) != null && d.length ? !1 : s;
}), f = Z(""), i = n;
se(() => {
setTimeout(() => s = !1, 15 * 1e3);
});
const g = () => {
const o = e.options.filter((r) => r[e.fieldNames.label].includes(f.value)).map((r) => r[e.fieldNames.value]);
a.value = Array.from(/* @__PURE__ */ new Set([...Array.isArray(a.value) ? a.value : [], ...o])), i("change", o), f.value = "";
}, h = (d) => {
i("change", d);
}, p = (d) => {
i("input-value-change", d);
}, x = () => {
f.value = "";
}, V = (d) => {
const o = d[e.fieldNames.label] || "";
return (o == null ? void 0 : o.length) > 10 ? `${o.slice(0, 10)}...` : o;
};
return (d, o) => {
const r = b("a-button"), y = b("a-select");
return m(), w(y, {
modelValue: a.value,
"onUpdate:modelValue": o[0] || (o[0] = (z) => a.value = z),
"input-value": f.value,
"onUpdate:inputValue": o[1] || (o[1] = (z) => f.value = z),
loading: _.value,
"allow-search": d.multiple ? { retainInputValue: !0 } : !0,
options: d.options,
"filter-option": !0,
placeholder: d.placeholder,
multiple: d.multiple,
disabled: d.disabled,
"field-names": d.fieldNames,
"allow-clear": !d.hideClean || !d.disabled,
"allow-create": d.allowCreate,
"max-tag-count": d.maxTagCount,
"virtual-list-props": e.virtualListProps,
"format-label": d.formatLabel ? d.formatLabel : V,
onChange: h,
onInputValueChange: p
}, ee({ _: 2 }, [
e.multiple && f.value ? {
name: "footer",
fn: u(() => [
v("div", Ue, [
C(r, {
type: "text",
size: "mini",
onClick: g
}, {
default: u(() => o[2] || (o[2] = [
B("全选")
])),
_: 1,
__: [2]
}),
C(r, {
type: "text",
size: "mini",
onClick: x
}, {
default: u(() => o[3] || (o[3] = [
B("清除")
])),
_: 1,
__: [3]
})
])
]),
key: "0"
} : void 0,
f.value ? {
name: "empty",
fn: u(() => [
v("div", Pe, [
C(r, {
type: "text",
size: "mini",
onClick: x
}, {
default: u(() => o[4] || (o[4] = [
B("清除")
])),
_: 1,
__: [4]
})
])
]),
key: "1"
} : void 0
]), 1032, ["modelValue", "input-value", "loading", "allow-search", "options", "placeholder", "multiple", "disabled", "field-names", "allow-clear", "allow-create", "max-tag-count", "virtual-list-props", "format-label"]);
};
}
}), Y = /* @__PURE__ */ T(Fe, [["__scopeId", "data-v-6a0292e1"]]);
Y.install = (t) => {
t.component("ZlSelect", Y);
};
const Ke = { class: "zl-dialog" }, qe = { class: "zl-dialog__content" }, We = {
key: 0,
class: "zl-dialog__footer"
}, Ye = { class: "zl-dialog__footer__custom" }, je = { class: "zl-dialog__footer__btn" }, Ge = /* @__PURE__ */ O({
__name: "index",
props: {
visible: { type: Boolean, default: !1 },
title: { default: "" },
width: { default: 800 },
titleAlign: { default: "start" },
hideCustomFooter: { type: Boolean, default: !1 },
maskClosable: { type: Boolean, default: !1 },
onBeforeOk: {}
},
emits: ["update:visible", "ok", "cancel"],
setup(t, { emit: n }) {
const e = t, l = n, a = X(), s = Z(!1), _ = S(() => {
const p = { ...a };
return delete p.default, delete p["custom-footer"], p;
}), f = (p) => {
p && (l("update:visible", !1), l("ok")), s.value = !1;
}, i = () => {
if (s.value = !0, !e.onBeforeOk) {
l("ok");
return;
}
const p = e.onBeforeOk(f);
h(p) ? p.then(() => f(!0)).catch(() => f(!1)).finally(() => s.value = !1) : typeof p == "boolean" && f(p);
}, g = () => {
l("cancel");
}, h = (p) => !!p && (typeof p == "object" || typeof p == "function") && typeof p.then == "function";
return (p, x) => {
const V = b("a-button"), d = b("a-modal");
return m(), w(d, R({
visible: e.visible,
"onUpdate:visible": x[0] || (x[0] = (o) => e.visible = o),
width: e.width,
closable: !0,
footer: !1,
title: e.title,
"title-align": e.titleAlign,
"mask-closable": e.maskClosable,
onCancel: x[1] || (x[1] = (o) => f(!0))
}, p.$attrs), ee({
default: u(() => [
v("div", Ke, [
v("div", qe, [
k(p.$slots, "default", {}, void 0, !0)
]),
e.hideCustomFooter ? F("", !0) : (m(), I("div", We, [
v("div", Ye, [
k(p.$slots, "custom-footer", {}, void 0, !0)
]),
v("div", je, [
C(V, {
class: "zl-dialog__footer__btn_cancel",
onClick: g
}, {
default: u(() => x[2] || (x[2] = [
B("取消")
])),
_: 1,
__: [2]
}),
C(V, {
loading: s.value,
type: "primary",
class: "zl-dialog__footer__btn_confirm",
onClick: i
}, {
default: u(() => x[3] || (x[3] = [
B("确认")
])),
_: 1,
__: [3]
}, 8, ["loading"])
])
]))
])
]),
_: 2
}, [
A(_.value, (o, r) => ({
name: r,
fn: u((y) => [
k(p.$slots, r, { data: y }, void 0, !0)
])
}))
]), 1040, ["visible", "width", "title", "title-align", "mask-closable"]);
};
}
}), j = /* @__PURE__ */ T(Ge, [["__scopeId", "data-v-ce703b82"]]);
j.install = (t) => {
t.component("ZlDialog", j);
};
function Je(t) {
t.component("ZlLayout", K), t.component("ZlContentBox", q), t.component("ZlSearchBox", W), t.component("ZlTrigger", D), t.component("ZlTable", G), t.component("ZlIcon", E), t.component("ZlSelect", Y), t.component("ZlDialog", j);
}
function Qe(t, n, e) {
const l = Z(!0), s = ge(() => P(
Se,
{
...n,
visible: l.value,
onCancel: () => {
l.value = !1;
},
onOk: () => {
l.value = !1;
}
},
{
...e,
defalut: () => P(t, n)
}
));
Je(s);
const _ = document.createElement("div");
return s.mount(_), document.body.appendChild(_), { unmount: () => {
s.unmount(), _.remove(), document.body.removeChild(_);
} };
}
const _t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: Qe
}, Symbol.toStringTag, { value: "Module" }));
function te(t) {
return t && typeof t == "object";
}
function Xe(t) {
return Array.isArray(t);
}
function ht(t) {
return typeof t == "function";
}
function oe(t, n = /* @__PURE__ */ new Map()) {
const e = {};
if (n.has(t))
return n.get(t);
n.set(t, t);
for (const l in t)
Xe(t[l]) ? e[l] = t[l].map((a) => te(a) ? oe(a, n) : a) : te(t[l]) ? e[l] = oe(t[l], n) : e[l] = t[l];
return e;
}
function gt(t) {
const n = {};
return Object.keys(t).forEach((e) => {
[void 0, null, ""].includes(t[e]) || (n[e] = t[e]);
}), n;
}
function vt() {
let t = (/* @__PURE__ */ new Date()).getTime();
return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(n) {
let e = (t + Math.random() * 16) % 16 | 0;
return t = Math.floor(t / 16), (n === "x" ? e : e & 3 | 8).toString(16);
});
}
function et(t, n) {
let e;
return function(...l) {
e && clearTimeout(e), e = setTimeout(() => {
t.apply(this, l);
}, n);
};
}
function tt() {
const t = Z(0);
let n = !1;
const e = et(() => {
t.value = ot();
}, 200);
return se(() => {
n = !0, window.addEventListener("resize", e);
}), ve(() => {
window.removeEventListener("resize", e);
}), ye(() => {
n || (n = !0, window.addEventListener("resize", e)), e();
}), be(() => {
n = !1, window.removeEventListener("resize", e);
}), e(), { tableHeight: t };
}
function ot() {
const t = document.querySelector(".zl-content-box");
if (!t)
return "100%";
const n = t.querySelector(".zl-search-box"), e = t.querySelector(".header-optional"), l = t.querySelector(".table-header-extend"), a = t.querySelector("thead"), s = window.getComputedStyle(t), _ = +(s == null ? void 0 : s.height.replace("px", "")) - nt(s == null ? void 0 : s.padding), f = (n == null ? void 0 : n.offsetHeight) || 0, i = _ - f - ((e == null ? void 0 : e.offsetHeight) || 0) - ((l == null ? void 0 : l.offsetHeight) || 0) - ((a == null ? void 0 : a.offsetHeight) || 0) - 81;
return i > 400 ? i : 400;
}
function nt(t) {
const e = t.split(" ").map((l) => +l.replace("px", ""));
return [1, 2].includes(e == null ? void 0 : e.length) ? e[0] * 2 : [3, 4].includes(e == null ? void 0 : e.length) ? e[0] + e[2] : 0;
}
function lt(t, n, e = "-tableCustomColumns") {
if (!n)
return {
customColumn: Z([]),
customColumnData: Z([])
};
const a = re().name + e, s = ie(a, []), _ = S(
() => t.filter((i) => !i.hidden).map(at)
);
return { customColumn: S(
{
get: () => {
var i;
return (i = s.value) != null && i.length ? s.value : t.map((g) => g.key || g.dataIndex);
},
set: (i) => {
s.value = i;
}
}
), customColumnData: _ };
}
function at(t) {
const n = { ...t };
return n.dataIndex && (n.key = n.dataIndex), n;
}
const st = { class: "header-optional" }, it = { class: "table-header-extend" }, rt = { key: 1 }, ut = { class: "operate-btn-box" }, ct = /* @__PURE__ */ O({
__name: "index",
props: {
columns: { default: () => [] },
data: { default: () => [] },
loading: { type: Boolean, default: !1 },
scroll: { default: void 0 },
noCache: { type: Boolean, default: !0 },
hideOperate: { type: Boolean, default: !1 },
operateWidth: { default: 240 },
page: { default: 1 },
limit: { default: 10 },
total: { default: 0 },
pagination: { default: void 0 },
pageSizeOptions: { default: () => [10, 20, 50, 100, 200] },
tableHeaderSplitLine: { type: Boolean, default: !0 },
customColumnKey: {}
},
emits: ["pageChange"],
setup(t, { emit: n }) {
const e = t, l = n, a = X(), { tableHeight: s } = tt(), _ = Z(), f = S(() => e.columns.filter((o) => e.noCache ? !o.hidden : !o.hidden && i.value.includes(o.key || o.dataIndex)).map((o) => {
const r = { ...o };
return r.key && (r.dataIndex = r.key), r;
})), { customColumn: i, customColumnData: g } = lt(e.columns, !e.noCache, e.customColumnKey), h = S(() => {
var o, r;
return {
x: ((o = e.scroll) == null ? void 0 : o.x) || e.columns.reduce((y, z) => y + (z.width || 120), e.operateWidth),
y: ((r = e.scroll) == null ? void 0 : r.y) || s.value
};
}), p = S(() => e.pagination !== void 0 ? e.pagination : {
current: e.page || 1,
total: e.total || 0,
pageSize: e.limit || 10,
showTotal: !0,
showPageSize: !0,
pageSizeOptions: e.pageSizeOptions || [10, 20, 50, 100, 200],
size: "small"
}), x = S(() => {
var r;
const o = { ...a };
return delete o.columns, delete o["header-left-optional"], delete o["header-right-optional"], delete o["table-extend"], (r = e.columns) == null || r.forEach((y) => {
if (y.custom) {
const z = y.key || y.dataIndex;
delete o[z];
}
}), o;
}), V = (o) => {
l("pageChange", o, e.limit);
}, d = (o) => {
l("pageChange", e.page, o);
};
return (o, r) => {
const y = b("a-space"), z = b("a-checkbox"), N = b("a-checkbox-group"), J = b("a-table-column"), ue = b("a-tooltip"), ce = b("a-table"), de = xe("ellipsis");
return m(), I("div", {
class: Ce(["zl-table", { "zl-table-header-split-line": e.tableHeaderSplitLine }]),
style: U({ "--table-height": L(s) - 20 + "px" })
}, [
v("div", st, [
C(y, null, {
default: u(() => [
k(o.$slots, "custom-left", {}, void 0, !0)
]),
_: 3
}),
C(y, null, {
default: u(() => [
k(o.$slots, "custom-right", {}, void 0, !0),
e.noCache ? F("", !0) : (m(), w(D, {
key: 0,
"popup-translate": [-35, 0]
}, {
content: u(() => [
v("div", {
class: "custom-column-box",
style: U({ maxHeight: L(s) + "px" })
}, [
C(N, {
direction: "vertical",
modelValue: L(i),
"onUpdate:modelValue": r[0] || (r[0] = (c) => ae(i) ? i.value = c : null)
}, {
default: u(() => [
(m(!0), I(H, null, A(L(g), (c, $) => (m(), w(z, {
key: c.key,
value: c.key,
disabled: $ < 2
}, {
default: u(() => [
B(M(c.title), 1)
]),
_: 2
}, 1032, ["value", "disabled"]))), 128))
]),
_: 1
}, 8, ["modelValue"])
], 4)
]),
default: u(() => [
r[1] || (r[1] = v("div", { class: "custom-column" }, "自定义列", -1))
]),
_: 1,
__: [1]
}))
]),
_: 3
})
]),
v("div", it, [
k(o.$slots, "table-extend", {}, void 0, !0)
]),
C(ce, R({
ref_key: "tableRef",
ref: _,
columns: f.value,
data: e.data,
pagination: p.value,
scroll: h.value,
loading: o.loading,
rowClass: ["zl-table-row"],
stripe: "",
"column-resizable": "",
onPageChange: V,
onPageSizeChange: d
}, { ...o.$attrs }), ee({
columns: u(() => [
k(o.$slots, "columns", {}, () => [
(m(!0), I(H, null, A(f.value, (c) => (m(), I(H, null, [
c.custom ? (m(), w(J, R({
key: 0,
ref_for: !0
}, c, {
width: c.width || 120,
ellipsis: !!c.ellipsis
}), {
cell: u(({ record: $ }) => [
k(o.$slots, c.dataIndex, { data: $ }, void 0, !0)
]),
_: 2
}, 1040, ["width", "ellipsis"])) : (m(), w(J, R({
key: 1,
ref_for: !0
}, c, {
width: c.width || 100,
ellipsis: !!c.ellipsis
}), {
cell: u(({ record: $ }) => [
c.ellipsis ? (m(), w(ue, {
key: 0,
position: "left",
content: c != null && c.computed ? c.computed($) : $[c.dataIndex]
}, {
default: u(() => [
ke((m(), I("div", null, [
B(M(c != null && c.computed ? c.computed($) : $[c.dataIndex]), 1)
])), [
[de, c.ellipsis]
])
]),
_: 2
}, 1032, ["content"])) : (m(), I("div", rt, M(c != null && c.computed ? c.computed($) : $[c.dataIndex]), 1))
]),
_: 2
}, 1040, ["width", "ellipsis"]))
], 64))), 256)),
e.hideOperate ? F("", !0) : (m(), w(J, {
key: 0,
title: "操作",
align: "left",
fixed: "right",
cellStyle: { width: e.operateWidth + "px" }
}, {
cell: u(({ record: c }) => [
v("div", ut, [
k(o.$slots, "table-operate", { data: c }, void 0, !0)
])
]),
_: 3
}, 8, ["cellStyle"]))
], !0)
]),
empty: u(() => [
r[2] || (r[2] = v("div", { class: "empty-container" }, [
v("img", {
src: "https://static.wi-fi.cn/omc/202507/2fd4569592c959158357dc30ba24c45f8cdc0841.png",
alt: ""
})
], -1))
]),
_: 2
}, [
A(x.value, (c, $) => ({
name: $,
fn: u((pe) => [
k(o.$slots, $, { data: pe }, void 0, !0)
])
}))
]), 1040, ["columns", "data", "pagination", "scroll", "loading"])
], 6);
};
}
}), G = /* @__PURE__ */ T(ct, [["__scopeId", "data-v-9ad7b719"]]);
G.install = (t) => {
t.component("ZlTable", G);
};
const yt = {
install(t) {
t.component("ZlLayout", K), t.component("ZlContentBox", q), t.component("ZlSearchBox", W), t.component("ZlTrigger", D), t.component("ZlTable", G), t.component("ZlIcon", E), t.component("ZlSelect", Y), t.component("ZlDialog", j);
}
};
export {
q as ZlContentBox,
j as ZlDialog,
E as ZlIcon,
K as ZlLayout,
W as ZlSearchBox,
Y as ZlSelect,
G as ZlTable,
D as ZlTrigger,
gt as clean,
et as debounce,
oe as deepClone,
yt as default,
vt as getUUID,
Xe as isArray,
ht as isFunction,
te as isObject,
_t as showDialog
};