zxt-table 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/zxt-table.css +1 -1
- package/dist/zxt-table.es.js +149 -149
- package/dist/zxt-table.umd.js +1 -1
- package/package.json +1 -1
package/dist/zxt-table.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.my-button[data-v-4480e77d]{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;text-align:center;box-sizing:border-box;outline:none;margin:0;transition:.1s;font-weight:500;padding:12px 20px;font-size:14px;border-radius:4px}.my-button--primary[data-v-4480e77d]{color:#fff;background-color:#409eff;border-color:#409eff}.my-button--success[data-v-4480e77d]{color:#fff;background-color:#67c23a;border-color:#67c23a}.my-button--warning[data-v-4480e77d]{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.my-button--danger[data-v-4480e77d]{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.my-button.is-disabled[data-v-4480e77d]{cursor:not-allowed;opacity:.7}.jsx-button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;text-align:center;box-sizing:border-box;outline:none;margin:0;transition:.1s;font-weight:500;padding:12px 20px;font-size:14px;border-radius:4px}.jsx-button--primary{color:#fff;background-color:#409eff;border-color:#409eff}.jsx-button--success{color:#fff;background-color:#67c23a;border-color:#67c23a}.jsx-button--warning{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.jsx-button--danger{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.jsx-button.is-disabled{cursor:not-allowed;opacity:.7}.zxt-pagination[data-v-497aa44d]{display:flex;justify-content:flex-end;margin-top:20px;--el-color-primary: #ff3a33;--el-pagination-hover-color: #ff3a33}[data-v-497aa44d] .el-pager li.is-active{color:#ff3a33!important}[data-v-497aa44d] .el-pagination.is-background .el-pager li:not(.is-disabled).is-active{background-color:#ff3a33!important;color:#fff}[data-v-497aa44d] .el-pager li:hover{color:#ff3a33!important}[data-v-497aa44d] .el-pagination__sizes .el-input.is-focus .el-input__wrapper,[data-v-497aa44d] .el-pagination__sizes .el-input__wrapper:hover{box-shadow:0 0 0 1px #ff3a33 inset!important}.el-select-dropdown__item.is-selected{color:#ff3a33!important}.zxt-table-container[data-v-
|
|
1
|
+
.my-button[data-v-4480e77d]{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;text-align:center;box-sizing:border-box;outline:none;margin:0;transition:.1s;font-weight:500;padding:12px 20px;font-size:14px;border-radius:4px}.my-button--primary[data-v-4480e77d]{color:#fff;background-color:#409eff;border-color:#409eff}.my-button--success[data-v-4480e77d]{color:#fff;background-color:#67c23a;border-color:#67c23a}.my-button--warning[data-v-4480e77d]{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.my-button--danger[data-v-4480e77d]{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.my-button.is-disabled[data-v-4480e77d]{cursor:not-allowed;opacity:.7}.jsx-button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;text-align:center;box-sizing:border-box;outline:none;margin:0;transition:.1s;font-weight:500;padding:12px 20px;font-size:14px;border-radius:4px}.jsx-button--primary{color:#fff;background-color:#409eff;border-color:#409eff}.jsx-button--success{color:#fff;background-color:#67c23a;border-color:#67c23a}.jsx-button--warning{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.jsx-button--danger{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.jsx-button.is-disabled{cursor:not-allowed;opacity:.7}.zxt-pagination[data-v-497aa44d]{display:flex;justify-content:flex-end;margin-top:20px;--el-color-primary: #ff3a33;--el-pagination-hover-color: #ff3a33}[data-v-497aa44d] .el-pager li.is-active{color:#ff3a33!important}[data-v-497aa44d] .el-pagination.is-background .el-pager li:not(.is-disabled).is-active{background-color:#ff3a33!important;color:#fff}[data-v-497aa44d] .el-pager li:hover{color:#ff3a33!important}[data-v-497aa44d] .el-pagination__sizes .el-input.is-focus .el-input__wrapper,[data-v-497aa44d] .el-pagination__sizes .el-input__wrapper:hover{box-shadow:0 0 0 1px #ff3a33 inset!important}.el-select-dropdown__item.is-selected{color:#ff3a33!important}.zxt-table-container[data-v-bc4be279]{width:100%}.zxt-table-container--full[data-v-bc4be279]{display:flex;flex-direction:column;height:100%}.zxt-table-container--full[data-v-bc4be279] .el-table{flex:1;min-height:0}.zxt-table-container--full[data-v-bc4be279] .el-table__inner-wrapper{height:100%;display:flex;flex-direction:column}.zxt-table-container--full[data-v-bc4be279] .el-table__body-wrapper{flex:1;overflow:auto}.zxt-table-container--full[data-v-bc4be279] .el-table__empty-block{height:100%}[data-v-bc4be279] .el-table{--el-table-header-bg-color: #f8f8f9;--el-table-header-text-color: #333333;--el-table-text-color: #606266;--el-table-border-color: #ebeef5;--el-table-row-hover-bg-color: #f5f7fa}[data-v-bc4be279] .el-table th.el-table__cell{background-color:var(--el-table-header-bg-color)!important;color:var(--el-table-header-text-color);font-weight:600;height:48px;padding:6px 0}[data-v-bc4be279] .el-table td.el-table__cell{padding:8px 0}[data-v-bc4be279] .el-table .cell{line-height:24px;padding:0 12px}[data-v-bc4be279] .el-link.el-link--default,[data-v-bc4be279] .el-link.el-link--primary{--el-link-text-color: #409eff;color:#409eff;font-weight:400}[data-v-bc4be279] .el-link:hover{color:#66b1ff;text-decoration:none}[data-v-bc4be279] .el-button--primary.is-link,[data-v-bc4be279] .el-button--primary.is-text{color:#409eff}[data-v-bc4be279] .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background-color:#fafafa}[data-v-bc4be279] .el-table .el-tag{border-radius:4px;height:24px;line-height:22px;padding:0 8px}[data-v-bc4be279] .el-table__expand-icon{outline:none;border:none}[data-v-bc4be279] .el-table__expand-icon:focus,[data-v-bc4be279] .el-table__expand-icon:focus-visible{outline:none;box-shadow:none;border:none}[data-v-bc4be279] .el-table__expand-icon .el-icon{outline:none}[data-v-bc4be279] .el-table__expand-icon .el-icon:focus,[data-v-bc4be279] .el-table__expand-icon .el-icon:focus-visible{outline:none;box-shadow:none}.zxt-table-footer[data-v-bc4be279]{flex-shrink:0;border-top:1px solid var(--el-table-border-color, #ebeef5)}.zxt-form-popper .el-select-dropdown__item.selected,.zxt-form-popper .el-select-dropdown__item.is-selected{color:#fa2314!important}.zxt-form-popper .el-select-dropdown__item.hover,.zxt-form-popper .el-select-dropdown__item:hover{background-color:#f5f7fa;color:#fa2314}.zxt-form-popper .el-date-table td.current:not(.disabled) .el-date-table-cell__text{background-color:#fa2314!important}.zxt-form-popper .el-date-table td.today .el-date-table-cell__text{color:#fa2314}.zxt-form-popper .el-date-table td.today.current .el-date-table-cell__text{color:#fff}.zxt-form-popper .el-year-table td.current .cell,.zxt-form-popper .el-month-table td.current .cell{color:#fa2314!important}.zxt-form-popper .el-date-table td.start-date .el-date-table-cell__text,.zxt-form-popper .el-date-table td.end-date .el-date-table-cell__text{background-color:#fa2314!important}.zxt-form-popper .el-date-table td.available:hover,.zxt-form-popper .el-year-table td .cell:hover,.zxt-form-popper .el-month-table td .cell:hover,.zxt-form-popper .el-date-picker__header-label:hover,.zxt-form-popper .el-picker-panel__icon-btn:hover{color:#fa2314}.form-actions[data-v-6b22a57b]{display:flex;justify-content:center;margin-top:30px;gap:10px}.form-item-wrapper[data-v-6b22a57b]{display:flex;align-items:center;border:1px solid #dcdfe6;border-radius:4px;padding:0 12px;width:100%;background-color:#fff;transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.form-item-wrapper.is-action[data-v-6b22a57b]{border:none;background-color:transparent;padding:0}.form-item-wrapper[data-v-6b22a57b]:focus-within{border-color:#fa2314}.custom-form-item.is-error .form-item-wrapper[data-v-6b22a57b]{border-color:#f56c6c}.form-label[data-v-6b22a57b]{color:#606266;white-space:nowrap;margin-right:12px;font-size:14px;line-height:32px}.form-control[data-v-6b22a57b]{flex:1;min-width:0;display:flex;align-items:center}.custom-form-item[data-v-6b22a57b] .el-input__wrapper,.custom-form-item[data-v-6b22a57b] .el-select__wrapper,.custom-form-item[data-v-6b22a57b] .el-textarea__wrapper{box-shadow:none!important;background-color:transparent!important;padding-left:0;padding-right:0}.custom-form-item[data-v-6b22a57b] .el-date-editor.el-input__wrapper{width:100%}.custom-form-item[data-v-6b22a57b] .el-range-editor.el-input__wrapper{padding:0;box-shadow:none!important}.action-column[data-v-e1262cc7]{display:inline-flex;align-items:center;gap:4px;flex-wrap:nowrap}[data-v-e1262cc7] .action-column .action-btn.el-button:focus,[data-v-e1262cc7] .action-column .action-btn.el-button:focus-visible,[data-v-e1262cc7] .action-column .action-btn.el-button:active,[data-v-e1262cc7] .action-column .action-btn:focus,[data-v-e1262cc7] .action-column .action-btn:focus-visible,[data-v-e1262cc7] .action-column .action-btn:active{outline:none;box-shadow:none}.zxt-grid-container[data-v-25a21d5d]{--zxt-primary-color: #fa2314;--zxt-primary-hover: #fb4f43;--zxt-primary-active: #e12012;width:100%}.zxt-grid-container--full[data-v-25a21d5d]{display:flex;flex-direction:column;height:100%}.zxt-grid-container--full .grid-table-wrapper[data-v-25a21d5d]{flex:1;display:flex;flex-direction:column;min-height:0}.zxt-grid-container--full .zxt-table-container[data-v-25a21d5d]{flex:1;min-height:0}.grid-search-form[data-v-25a21d5d]{padding:10px 10px 6px;border-radius:4px}.search-btn-group[data-v-25a21d5d]{display:flex;gap:10px}.grid-toolbar[data-v-25a21d5d]{margin-bottom:10px;padding:0 10px 10px;border-radius:4px;display:flex;gap:10px;align-items:center}.btn-search[data-v-25a21d5d]{background-color:#fff;border-color:var(--zxt-primary-color);color:var(--zxt-primary-color)}.btn-search[data-v-25a21d5d]:hover,.btn-search[data-v-25a21d5d]:focus,.btn-search[data-v-25a21d5d]:active{background-color:#fff}.btn-search[data-v-25a21d5d]:hover,.btn-search[data-v-25a21d5d]:focus{border-color:var(--zxt-primary-hover);color:var(--zxt-primary-hover);outline:none}.btn-search.el-button[data-v-25a21d5d]:focus,.btn-search.el-button[data-v-25a21d5d]:focus-visible{background-color:#fff;border-color:var(--zxt-primary-hover);color:var(--zxt-primary-hover);outline:none}.btn-search[data-v-25a21d5d]:active,.btn-search.el-button[data-v-25a21d5d]:active{background-color:#fff;border-color:var(--zxt-primary-active);color:var(--zxt-primary-active)}.btn-reset[data-v-25a21d5d]{background-color:#fff;border-color:#ddd;color:#111}.btn-reset[data-v-25a21d5d]:hover,.btn-reset[data-v-25a21d5d]:focus,.btn-reset[data-v-25a21d5d]:active{background-color:#fff}.btn-reset[data-v-25a21d5d]:focus,.btn-reset.el-button[data-v-25a21d5d]:focus,.btn-reset.el-button[data-v-25a21d5d]:focus-visible{border-color:#ddd;color:#111;outline:none}.btn-reset[data-v-25a21d5d]:hover,.btn-reset.el-button[data-v-25a21d5d]:hover{border-color:var(--zxt-primary-hover);color:var(--zxt-primary-hover)}.btn-reset[data-v-25a21d5d]:active,.btn-reset.el-button[data-v-25a21d5d]:active{background-color:#fff;border-color:var(--zxt-primary-active);color:var(--zxt-primary-active)}
|
package/dist/zxt-table.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElementBlock as m, openBlock as i, normalizeClass as ue, renderSlot as T, defineComponent as y, createVNode as
|
|
1
|
+
import { createElementBlock as m, openBlock as i, normalizeClass as ue, renderSlot as T, defineComponent as y, createVNode as D, ref as k, watch as X, resolveComponent as S, createBlock as V, h as K, inject as Ie, computed as w, mergeProps as O, withCtx as _, Fragment as B, renderList as x, createSlots as Y, resolveDynamicComponent as ze, createTextVNode as j, toDisplayString as ee, useSlots as Me, provide as Ee, onMounted as Be, nextTick as Ne, resolveDirective as Ue, normalizeStyle as qe, withDirectives as Ge, createCommentVNode as G, createElementVNode as b, reactive as We, toHandlers as Je, withModifiers as Te, useAttrs as Ke, normalizeProps as xe, guardReactiveProps as Oe } from "vue";
|
|
2
2
|
import { ElPagination as Qe, ElLink as Xe, ElCheckbox as Ye, ElSelect as et, ElOption as tt, ElInput as at, ElTableColumn as nt, ElTable as ot } from "element-plus";
|
|
3
3
|
const W = (e, t) => {
|
|
4
4
|
const a = e.__vccOpts || e;
|
|
@@ -61,7 +61,7 @@ const ae = /* @__PURE__ */ y({
|
|
|
61
61
|
const s = (u) => {
|
|
62
62
|
e.disabled || t("click", u);
|
|
63
63
|
};
|
|
64
|
-
return () =>
|
|
64
|
+
return () => D("button", {
|
|
65
65
|
class: ["jsx-button", `jsx-button--${e.type}`, {
|
|
66
66
|
"is-disabled": e.disabled
|
|
67
67
|
}],
|
|
@@ -195,11 +195,11 @@ const pt = y({
|
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
setup(e) {
|
|
198
|
-
const t =
|
|
198
|
+
const t = Ie("updateRow", () => {
|
|
199
199
|
}), a = (l) => {
|
|
200
200
|
const { currentPage: c, pageSize: g } = e;
|
|
201
201
|
return (c - 1) * g + l + 1;
|
|
202
|
-
}, s =
|
|
202
|
+
}, s = w(() => {
|
|
203
203
|
const l = e.column;
|
|
204
204
|
return {
|
|
205
205
|
...l,
|
|
@@ -208,7 +208,7 @@ const pt = y({
|
|
|
208
208
|
label: l.label ?? l.title
|
|
209
209
|
// 优先使用 label,兼容 title
|
|
210
210
|
};
|
|
211
|
-
}), u =
|
|
211
|
+
}), u = w(() => {
|
|
212
212
|
const { children: l, ...c } = s.value;
|
|
213
213
|
return c;
|
|
214
214
|
});
|
|
@@ -231,39 +231,39 @@ const pt = y({
|
|
|
231
231
|
});
|
|
232
232
|
function ft(e, t, a, s, u, d) {
|
|
233
233
|
const l = S("ZxtTableColumn", !0), c = S("el-table-column");
|
|
234
|
-
return e.normalizedColumn.children && e.normalizedColumn.children.length ? (i(), V(c,
|
|
234
|
+
return e.normalizedColumn.children && e.normalizedColumn.children.length ? (i(), V(c, O({ key: 0 }, e.columnProps, {
|
|
235
235
|
key: e.normalizedColumn.prop + "-group"
|
|
236
236
|
}), {
|
|
237
|
-
default:
|
|
238
|
-
(i(!0), m(B, null,
|
|
237
|
+
default: _(() => [
|
|
238
|
+
(i(!0), m(B, null, x(e.normalizedColumn.children, (g, z) => (i(), V(l, {
|
|
239
239
|
key: z,
|
|
240
240
|
column: g,
|
|
241
241
|
"current-page": e.currentPage,
|
|
242
242
|
"page-size": e.pageSize
|
|
243
243
|
}, Y({ _: 2 }, [
|
|
244
|
-
|
|
244
|
+
x(e.$slots, (f, n) => ({
|
|
245
245
|
name: n,
|
|
246
|
-
fn:
|
|
247
|
-
T(e.$slots, n,
|
|
246
|
+
fn: _((C) => [
|
|
247
|
+
T(e.$slots, n, O({ ref_for: !0 }, C))
|
|
248
248
|
])
|
|
249
249
|
}))
|
|
250
250
|
]), 1032, ["column", "current-page", "page-size"]))), 128))
|
|
251
251
|
]),
|
|
252
252
|
_: 3
|
|
253
|
-
}, 16)) : (i(), V(c,
|
|
253
|
+
}, 16)) : (i(), V(c, O({ key: 1 }, e.columnProps, {
|
|
254
254
|
key: e.normalizedColumn.prop,
|
|
255
255
|
index: e.normalizedColumn.indexMethod || e.defaultIndexMethod
|
|
256
256
|
}), Y({ _: 2 }, [
|
|
257
257
|
e.normalizedColumn.headerSlot ? {
|
|
258
258
|
name: "header",
|
|
259
|
-
fn:
|
|
260
|
-
T(e.$slots, e.normalizedColumn.headerSlot,
|
|
259
|
+
fn: _((g) => [
|
|
260
|
+
T(e.$slots, e.normalizedColumn.headerSlot, O({ column: e.normalizedColumn }, g))
|
|
261
261
|
]),
|
|
262
262
|
key: "0"
|
|
263
263
|
} : void 0,
|
|
264
264
|
!["selection", "index"].includes(e.normalizedColumn.type) && (e.normalizedColumn.type !== "expand" || e.normalizedColumn.slot) ? {
|
|
265
265
|
name: "default",
|
|
266
|
-
fn:
|
|
266
|
+
fn: _((g) => [
|
|
267
267
|
e.normalizedColumn.slot ? T(e.$slots, e.normalizedColumn.slot, {
|
|
268
268
|
key: 0,
|
|
269
269
|
row: g.row,
|
|
@@ -333,16 +333,16 @@ const mt = /* @__PURE__ */ W(pt, [["render", ft]]), gt = /* @__PURE__ */ new Set
|
|
|
333
333
|
"update:row"
|
|
334
334
|
],
|
|
335
335
|
setup(e, { emit: t }) {
|
|
336
|
-
const a =
|
|
336
|
+
const a = Me(), s = k(null), u = k(e.pageSize), d = k(e.currentPage), l = k(!1), c = k([]), g = k(0), z = k({ prop: "", order: "" }), f = k({}), n = k({});
|
|
337
337
|
X(() => e.currentPage, (p) => {
|
|
338
338
|
d.value = p;
|
|
339
339
|
}), X(() => e.pageSize, (p) => {
|
|
340
340
|
u.value = p;
|
|
341
341
|
});
|
|
342
|
-
const C =
|
|
342
|
+
const C = w(() => e.height === "full" ? { height: "100%" } : {}), r = w(() => {
|
|
343
343
|
if (e.height !== "full")
|
|
344
344
|
return e.height;
|
|
345
|
-
}), v =
|
|
345
|
+
}), v = w(() => !!e.proxyConfig), L = w(() => v.value ? g.value : e.total > 0 ? e.total : e.data.length), J = w(
|
|
346
346
|
() => v.value ? c.value : e.data
|
|
347
347
|
), F = () => {
|
|
348
348
|
Ne(() => {
|
|
@@ -351,21 +351,21 @@ const mt = /* @__PURE__ */ W(pt, [["render", ft]]), gt = /* @__PURE__ */ new Set
|
|
|
351
351
|
);
|
|
352
352
|
p && (typeof p.scrollTo == "function" ? p.scrollTo({ top: 0, left: 0 }) : (p.scrollTop = 0, p.scrollLeft = 0));
|
|
353
353
|
});
|
|
354
|
-
},
|
|
354
|
+
}, I = (p) => {
|
|
355
355
|
v.value && (d.value = p.page, u.value = p.size, Z()), F(), t("size-change", p);
|
|
356
356
|
}, de = (p) => {
|
|
357
357
|
v.value && (d.value = p.page, u.value = p.size, Z()), F(), t("page-change", p);
|
|
358
|
-
}, ce = ({ column: p, prop: $, order:
|
|
359
|
-
z.value = { prop: $, order:
|
|
358
|
+
}, ce = ({ column: p, prop: $, order: E }) => {
|
|
359
|
+
z.value = { prop: $, order: E }, v.value && Z(), t("sort-change", { column: p, prop: $, order: E });
|
|
360
360
|
}, pe = (p) => {
|
|
361
361
|
f.value = p || {}, v.value && Z(), t("filter-change", f.value);
|
|
362
362
|
}, Z = async (p) => {
|
|
363
363
|
if (!v.value) return;
|
|
364
|
-
const $ = e.proxyConfig || {},
|
|
365
|
-
if (typeof
|
|
364
|
+
const $ = e.proxyConfig || {}, E = $.ajax?.query;
|
|
365
|
+
if (typeof E != "function") return;
|
|
366
366
|
const N = $.props || {}, ve = N.pageField || "page";
|
|
367
367
|
N.sizeField;
|
|
368
|
-
const Ce = N.sortField || "sort",
|
|
368
|
+
const Ce = N.sortField || "sort", we = N.orderField || "order", _e = N.filtersField || "filters";
|
|
369
369
|
p?.formData !== void 0 ? n.value = p.formData : $._formData && (n.value = $._formData);
|
|
370
370
|
const be = $.params || {}, U = {
|
|
371
371
|
[ve]: {
|
|
@@ -375,12 +375,12 @@ const mt = /* @__PURE__ */ W(pt, [["render", ft]]), gt = /* @__PURE__ */ new Set
|
|
|
375
375
|
form: n.value,
|
|
376
376
|
...be
|
|
377
377
|
};
|
|
378
|
-
z.value?.prop && (U[Ce] = z.value.prop, U[
|
|
378
|
+
z.value?.prop && (U[Ce] = z.value.prop, U[we] = z.value.order), f.value && Object.keys(f.value).length && (U[_e] = f.value), l.value = !0;
|
|
379
379
|
try {
|
|
380
|
-
const R = await
|
|
380
|
+
const R = await E(U), P = $.response || {}, o = P.listField || "list", h = P.totalField || "total", A = P.transform;
|
|
381
381
|
let H = [], re = 0;
|
|
382
|
-
if (typeof
|
|
383
|
-
const ye =
|
|
382
|
+
if (typeof A == "function") {
|
|
383
|
+
const ye = A(R);
|
|
384
384
|
H = ye?.list ?? [], re = ye?.total ?? 0;
|
|
385
385
|
} else R && typeof R == "object" && (H = R?.[o] ?? R?.data ?? [], re = R?.[h] ?? R?.total ?? 0);
|
|
386
386
|
c.value = Array.isArray(H) ? H : [], g.value = Number(re) || 0, t("loaded", {
|
|
@@ -396,18 +396,18 @@ const mt = /* @__PURE__ */ W(pt, [["render", ft]]), gt = /* @__PURE__ */ new Set
|
|
|
396
396
|
}, oe = (p, $) => {
|
|
397
397
|
v.value ? c.value.splice($, 1, p) : t("update:row", { index: $, row: p });
|
|
398
398
|
};
|
|
399
|
-
|
|
399
|
+
Ee("updateRow", oe), Be(() => {
|
|
400
400
|
v.value && e.autoLoad && Z();
|
|
401
401
|
});
|
|
402
|
-
const fe = () => s.value, me = () => s.value?.getSelectionRows?.() || [], ge = (p) => Z(p), le = () => F(), he =
|
|
402
|
+
const fe = () => s.value, me = () => s.value?.getSelectionRows?.() || [], ge = (p) => Z(p), le = () => F(), he = w(() => {
|
|
403
403
|
const p = {};
|
|
404
404
|
for (const $ in a)
|
|
405
405
|
gt.has($) || (p[$] = a[$]);
|
|
406
406
|
return p;
|
|
407
407
|
});
|
|
408
408
|
return console.log("[ZxtTable][4] props.columns =", e.columns), console.log(
|
|
409
|
-
"[ZxtTable][4] has
|
|
410
|
-
(e.columns || []).some((p) => p?.slot === "
|
|
409
|
+
"[ZxtTable][4] has zxtActionInternal slot col =",
|
|
410
|
+
(e.columns || []).some((p) => p?.slot === "zxtActionInternal")
|
|
411
411
|
), {
|
|
412
412
|
columnSlots: he,
|
|
413
413
|
tableRef: s,
|
|
@@ -419,9 +419,9 @@ const mt = /* @__PURE__ */ W(pt, [["render", ft]]), gt = /* @__PURE__ */ new Set
|
|
|
419
419
|
loading: l,
|
|
420
420
|
renderData: J,
|
|
421
421
|
total: L,
|
|
422
|
-
pageSizes:
|
|
423
|
-
paginationLayout:
|
|
424
|
-
handleSizeChange:
|
|
422
|
+
pageSizes: w(() => e.pageSizes),
|
|
423
|
+
paginationLayout: w(() => e.paginationLayout),
|
|
424
|
+
handleSizeChange: I,
|
|
425
425
|
handlePageChange: de,
|
|
426
426
|
handleSortChange: ce,
|
|
427
427
|
handleFilterChange: pe,
|
|
@@ -441,7 +441,7 @@ function Ct(e, t, a, s, u, d) {
|
|
|
441
441
|
class: ue(["zxt-table-container", { "zxt-table-container--full": e.height === "full" }]),
|
|
442
442
|
style: qe(e.containerStyle)
|
|
443
443
|
}, [
|
|
444
|
-
Ge((i(), V(c,
|
|
444
|
+
Ge((i(), V(c, O({
|
|
445
445
|
ref: "tableRef",
|
|
446
446
|
data: e.renderData,
|
|
447
447
|
height: e.tableHeight
|
|
@@ -450,17 +450,17 @@ function Ct(e, t, a, s, u, d) {
|
|
|
450
450
|
onSortChange: e.handleSortChange,
|
|
451
451
|
onFilterChange: e.handleFilterChange
|
|
452
452
|
}), Y({
|
|
453
|
-
default:
|
|
454
|
-
(i(!0), m(B, null,
|
|
453
|
+
default: _(() => [
|
|
454
|
+
(i(!0), m(B, null, x(e.columns, (f, n) => (i(), V(l, {
|
|
455
455
|
key: n,
|
|
456
456
|
column: f,
|
|
457
457
|
"current-page": e.currentPage,
|
|
458
458
|
"page-size": e.pageSize
|
|
459
459
|
}, Y({ _: 2 }, [
|
|
460
|
-
|
|
460
|
+
x(e.columnSlots, (C, r) => ({
|
|
461
461
|
name: r,
|
|
462
|
-
fn:
|
|
463
|
-
T(e.$slots, r,
|
|
462
|
+
fn: _((v) => [
|
|
463
|
+
T(e.$slots, r, O({ ref_for: !0 }, v), void 0, !0)
|
|
464
464
|
])
|
|
465
465
|
}))
|
|
466
466
|
]), 1032, ["column", "current-page", "page-size"]))), 128))
|
|
@@ -469,7 +469,7 @@ function Ct(e, t, a, s, u, d) {
|
|
|
469
469
|
}, [
|
|
470
470
|
e.$slots.empty ? {
|
|
471
471
|
name: "empty",
|
|
472
|
-
fn:
|
|
472
|
+
fn: _(() => [
|
|
473
473
|
T(e.$slots, "empty", {}, void 0, !0)
|
|
474
474
|
]),
|
|
475
475
|
key: "0"
|
|
@@ -493,8 +493,8 @@ function Ct(e, t, a, s, u, d) {
|
|
|
493
493
|
}, null, 8, ["model-value", "page-size", "page-sizes", "total", "layout", "onPageChange", "onSizeChange"])) : G("", !0)
|
|
494
494
|
], 6);
|
|
495
495
|
}
|
|
496
|
-
const
|
|
497
|
-
class
|
|
496
|
+
const M = /* @__PURE__ */ W(ht, [["render", Ct], ["__scopeId", "data-v-bc4be279"]]), q = /* @__PURE__ */ new Map();
|
|
497
|
+
class wt {
|
|
498
498
|
/**
|
|
499
499
|
* 注册自定义渲染器
|
|
500
500
|
* @param {String} name - 渲染器名称
|
|
@@ -547,8 +547,8 @@ class _t {
|
|
|
547
547
|
q.clear();
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
const Se = new
|
|
551
|
-
function
|
|
550
|
+
const Se = new wt();
|
|
551
|
+
function _t(e, t, a = {}) {
|
|
552
552
|
if (!e || !e.itemRender)
|
|
553
553
|
return null;
|
|
554
554
|
const { name: s } = e.itemRender;
|
|
@@ -570,11 +570,11 @@ function wt(e, t, a = {}) {
|
|
|
570
570
|
}
|
|
571
571
|
return null;
|
|
572
572
|
}
|
|
573
|
-
|
|
574
|
-
e.component(
|
|
573
|
+
M.install = function(e) {
|
|
574
|
+
e.component(M.name, M);
|
|
575
575
|
};
|
|
576
|
-
|
|
577
|
-
|
|
576
|
+
M.registerRenderer = ct;
|
|
577
|
+
M.renderer = Se;
|
|
578
578
|
var bt = /* @__PURE__ */ y({
|
|
579
579
|
name: "ArrowDown",
|
|
580
580
|
__name: "arrow-down",
|
|
@@ -649,7 +649,7 @@ var bt = /* @__PURE__ */ y({
|
|
|
649
649
|
})
|
|
650
650
|
]));
|
|
651
651
|
}
|
|
652
|
-
}), ke = Pt,
|
|
652
|
+
}), ke = Pt, At = /* @__PURE__ */ y({
|
|
653
653
|
name: "Document",
|
|
654
654
|
__name: "document",
|
|
655
655
|
setup(e) {
|
|
@@ -663,7 +663,7 @@ var bt = /* @__PURE__ */ y({
|
|
|
663
663
|
})
|
|
664
664
|
]));
|
|
665
665
|
}
|
|
666
|
-
}),
|
|
666
|
+
}), Dt = At, Ft = /* @__PURE__ */ y({
|
|
667
667
|
name: "Download",
|
|
668
668
|
__name: "download",
|
|
669
669
|
setup(e) {
|
|
@@ -713,7 +713,7 @@ var bt = /* @__PURE__ */ y({
|
|
|
713
713
|
})
|
|
714
714
|
]));
|
|
715
715
|
}
|
|
716
|
-
}),
|
|
716
|
+
}), xt = Tt, Ot = /* @__PURE__ */ y({
|
|
717
717
|
name: "Plus",
|
|
718
718
|
__name: "plus",
|
|
719
719
|
setup(e) {
|
|
@@ -727,7 +727,7 @@ var bt = /* @__PURE__ */ y({
|
|
|
727
727
|
})
|
|
728
728
|
]));
|
|
729
729
|
}
|
|
730
|
-
}), Pe =
|
|
730
|
+
}), Pe = Ot, Mt = /* @__PURE__ */ y({
|
|
731
731
|
name: "Refresh",
|
|
732
732
|
__name: "refresh",
|
|
733
733
|
setup(e) {
|
|
@@ -741,7 +741,7 @@ var bt = /* @__PURE__ */ y({
|
|
|
741
741
|
})
|
|
742
742
|
]));
|
|
743
743
|
}
|
|
744
|
-
}), se =
|
|
744
|
+
}), se = Mt, Bt = /* @__PURE__ */ y({
|
|
745
745
|
name: "Search",
|
|
746
746
|
__name: "search",
|
|
747
747
|
setup(e) {
|
|
@@ -769,7 +769,7 @@ var bt = /* @__PURE__ */ y({
|
|
|
769
769
|
})
|
|
770
770
|
]));
|
|
771
771
|
}
|
|
772
|
-
}),
|
|
772
|
+
}), Ae = Lt, Zt = /* @__PURE__ */ y({
|
|
773
773
|
name: "Share",
|
|
774
774
|
__name: "share",
|
|
775
775
|
setup(e) {
|
|
@@ -801,7 +801,7 @@ var bt = /* @__PURE__ */ y({
|
|
|
801
801
|
})
|
|
802
802
|
]));
|
|
803
803
|
}
|
|
804
|
-
}),
|
|
804
|
+
}), It = jt, Et = /* @__PURE__ */ y({
|
|
805
805
|
name: "Upload",
|
|
806
806
|
__name: "upload",
|
|
807
807
|
setup(e) {
|
|
@@ -815,7 +815,7 @@ var bt = /* @__PURE__ */ y({
|
|
|
815
815
|
})
|
|
816
816
|
]));
|
|
817
817
|
}
|
|
818
|
-
}),
|
|
818
|
+
}), De = Et, Nt = /* @__PURE__ */ y({
|
|
819
819
|
name: "View",
|
|
820
820
|
__name: "view",
|
|
821
821
|
setup(e) {
|
|
@@ -901,12 +901,12 @@ const Gt = y({
|
|
|
901
901
|
default:
|
|
902
902
|
F = {};
|
|
903
903
|
}
|
|
904
|
-
const
|
|
904
|
+
const I = {
|
|
905
905
|
...J,
|
|
906
906
|
...F
|
|
907
907
|
};
|
|
908
|
-
return "clearable" in r && (
|
|
909
|
-
}, g =
|
|
908
|
+
return "clearable" in r && (I.clearable = r.clearable), r.props && typeof r.props == "object" && Object.assign(I, r.props), I;
|
|
909
|
+
}, g = w(() => e.formColumns.map((r) => ({
|
|
910
910
|
...r,
|
|
911
911
|
colSpan: {
|
|
912
912
|
xs: r.xs ?? r.span ?? 24,
|
|
@@ -925,7 +925,7 @@ const Gt = y({
|
|
|
925
925
|
},
|
|
926
926
|
{ immediate: !0, deep: !0 }
|
|
927
927
|
);
|
|
928
|
-
const z =
|
|
928
|
+
const z = w(() => {
|
|
929
929
|
const r = { ...e.rules };
|
|
930
930
|
return Object.keys(r).length === 0 && e.formColumns.length > 0 && e.formColumns.forEach((v) => {
|
|
931
931
|
if (v.required) {
|
|
@@ -952,7 +952,7 @@ const Gt = y({
|
|
|
952
952
|
});
|
|
953
953
|
}, n = () => {
|
|
954
954
|
s.value && s.value.resetFields(), t("reset");
|
|
955
|
-
}, C = (r) => () =>
|
|
955
|
+
}, C = (r) => () => _t(r, u, {}) || null;
|
|
956
956
|
return a({
|
|
957
957
|
validate: () => s.value ? s.value.validate() : Promise.resolve(!1),
|
|
958
958
|
resetFields: () => s.value && s.value.resetFields(),
|
|
@@ -978,24 +978,24 @@ const Gt = y({
|
|
|
978
978
|
function Qt(e, t, a, s, u, d) {
|
|
979
979
|
const l = S("el-option"), c = S("el-form-item"), g = S("el-col"), z = S("el-row"), f = S("el-form");
|
|
980
980
|
return i(), m("div", Wt, [
|
|
981
|
-
|
|
981
|
+
D(f, O({ ref: "formRef" }, e.$attrs, {
|
|
982
982
|
model: e.formData,
|
|
983
983
|
rules: e.formRules,
|
|
984
984
|
"label-width": e.labelWidth,
|
|
985
985
|
class: "zxt-form"
|
|
986
986
|
}), {
|
|
987
|
-
default:
|
|
988
|
-
|
|
989
|
-
default:
|
|
990
|
-
(i(!0), m(B, null,
|
|
991
|
-
default:
|
|
992
|
-
|
|
987
|
+
default: _(() => [
|
|
988
|
+
D(z, { gutter: 20 }, {
|
|
989
|
+
default: _(() => [
|
|
990
|
+
(i(!0), m(B, null, x(e.processedColumns, (n, C) => (i(), V(g, O({ key: C }, { ref_for: !0 }, n.colSpan), {
|
|
991
|
+
default: _(() => [
|
|
992
|
+
D(c, {
|
|
993
993
|
prop: n.prop,
|
|
994
994
|
required: n.required,
|
|
995
995
|
"label-width": "0",
|
|
996
996
|
class: "custom-form-item"
|
|
997
997
|
}, {
|
|
998
|
-
default:
|
|
998
|
+
default: _(() => [
|
|
999
999
|
b("div", {
|
|
1000
1000
|
class: ue(["form-item-wrapper", { "is-action": n.isAction }])
|
|
1001
1001
|
}, [
|
|
@@ -1005,13 +1005,13 @@ function Qt(e, t, a, s, u, d) {
|
|
|
1005
1005
|
key: 0,
|
|
1006
1006
|
formData: e.formData,
|
|
1007
1007
|
column: n
|
|
1008
|
-
}, void 0, !0) : n.itemRender ? (i(), V(ze(e.renderCustomItem(n)), { key: 1 })) : (i(), V(ze(e.getComponentType(n.type)),
|
|
1008
|
+
}, void 0, !0) : n.itemRender ? (i(), V(ze(e.renderCustomItem(n)), { key: 1 })) : (i(), V(ze(e.getComponentType(n.type)), O({
|
|
1009
1009
|
key: 2,
|
|
1010
1010
|
modelValue: e.formData[n.prop],
|
|
1011
1011
|
"onUpdate:modelValue": (r) => e.formData[n.prop] = r
|
|
1012
1012
|
}, { ref_for: !0 }, e.getComponentProps(n), Je(n.events || {})), {
|
|
1013
|
-
default:
|
|
1014
|
-
n.type === "select" ? (i(!0), m(B, { key: 0 },
|
|
1013
|
+
default: _(() => [
|
|
1014
|
+
n.type === "select" ? (i(!0), m(B, { key: 0 }, x(n.options, (r, v) => (i(), V(l, {
|
|
1015
1015
|
key: v,
|
|
1016
1016
|
label: r.label,
|
|
1017
1017
|
value: r.value
|
|
@@ -1043,16 +1043,16 @@ const Re = /* @__PURE__ */ W(Gt, [["render", Qt], ["__scopeId", "data-v-6b22a57b
|
|
|
1043
1043
|
Search: ie,
|
|
1044
1044
|
Edit: Ve,
|
|
1045
1045
|
View: Fe,
|
|
1046
|
-
Upload:
|
|
1047
|
-
Setting:
|
|
1046
|
+
Upload: De,
|
|
1047
|
+
Setting: Ae,
|
|
1048
1048
|
Warning: qt,
|
|
1049
1049
|
Check: zt,
|
|
1050
1050
|
Close: kt,
|
|
1051
|
-
Document:
|
|
1051
|
+
Document: Dt,
|
|
1052
1052
|
CopyDocument: Vt,
|
|
1053
1053
|
Share: Ht,
|
|
1054
|
-
Lock:
|
|
1055
|
-
Unlock:
|
|
1054
|
+
Lock: xt,
|
|
1055
|
+
Unlock: It,
|
|
1056
1056
|
ArrowDown: Le
|
|
1057
1057
|
}, Yt = y({
|
|
1058
1058
|
name: "ActionColumn",
|
|
@@ -1073,11 +1073,11 @@ const Re = /* @__PURE__ */ W(Gt, [["render", Qt], ["__scopeId", "data-v-6b22a57b
|
|
|
1073
1073
|
},
|
|
1074
1074
|
emits: ["action-click"],
|
|
1075
1075
|
setup(e, { emit: t }) {
|
|
1076
|
-
const a =
|
|
1076
|
+
const a = w(() => e.buttons.filter((n) => typeof n.visible == "function" ? n.visible(e.row) : typeof n.visible == "boolean" ? n.visible : !0)), s = w(
|
|
1077
1077
|
() => a.value.length > e.maxVisible
|
|
1078
|
-
), u =
|
|
1078
|
+
), u = w(
|
|
1079
1079
|
() => s.value ? a.value.slice(0, e.maxVisible) : a.value
|
|
1080
|
-
), d =
|
|
1080
|
+
), d = w(
|
|
1081
1081
|
() => s.value ? a.value.slice(e.maxVisible) : []
|
|
1082
1082
|
);
|
|
1083
1083
|
console.log("[ActionColumn][5] props.buttons =", e.buttons), console.log("[ActionColumn][5] row =", e.row), console.log("[ActionColumn][5] resolvedButtons =", a.value), console.log("[ActionColumn][5] visibleButtons =", u.value), console.log("[ActionColumn][5] overflowButtons =", d.value);
|
|
@@ -1106,7 +1106,7 @@ const Re = /* @__PURE__ */ W(Gt, [["render", Qt], ["__scopeId", "data-v-6b22a57b
|
|
|
1106
1106
|
function ta(e, t, a, s, u, d) {
|
|
1107
1107
|
const l = S("el-button"), c = S("ArrowDown"), g = S("el-icon"), z = S("el-dropdown-item"), f = S("el-dropdown-menu"), n = S("el-dropdown");
|
|
1108
1108
|
return i(), m("div", ea, [
|
|
1109
|
-
(i(!0), m(B, null,
|
|
1109
|
+
(i(!0), m(B, null, x(e.visibleButtons, (C) => (i(), V(l, {
|
|
1110
1110
|
key: C.code,
|
|
1111
1111
|
class: "action-btn",
|
|
1112
1112
|
type: C.type || "",
|
|
@@ -1117,7 +1117,7 @@ function ta(e, t, a, s, u, d) {
|
|
|
1117
1117
|
}, ["prevent"])),
|
|
1118
1118
|
onClick: (r) => e.handleClick(C, r)
|
|
1119
1119
|
}, {
|
|
1120
|
-
default:
|
|
1120
|
+
default: _(() => [
|
|
1121
1121
|
j(ee(C.label), 1)
|
|
1122
1122
|
]),
|
|
1123
1123
|
_: 2
|
|
@@ -1127,15 +1127,15 @@ function ta(e, t, a, s, u, d) {
|
|
|
1127
1127
|
trigger: "hover",
|
|
1128
1128
|
onCommand: e.handleCommand
|
|
1129
1129
|
}, {
|
|
1130
|
-
dropdown:
|
|
1131
|
-
|
|
1132
|
-
default:
|
|
1133
|
-
(i(!0), m(B, null,
|
|
1130
|
+
dropdown: _(() => [
|
|
1131
|
+
D(f, null, {
|
|
1132
|
+
default: _(() => [
|
|
1133
|
+
(i(!0), m(B, null, x(e.overflowButtons, (C) => (i(), V(z, {
|
|
1134
1134
|
key: C.code,
|
|
1135
1135
|
command: C,
|
|
1136
1136
|
icon: e.getIconComponent(C.icon)
|
|
1137
1137
|
}, {
|
|
1138
|
-
default:
|
|
1138
|
+
default: _(() => [
|
|
1139
1139
|
j(ee(C.label), 1)
|
|
1140
1140
|
]),
|
|
1141
1141
|
_: 2
|
|
@@ -1144,8 +1144,8 @@ function ta(e, t, a, s, u, d) {
|
|
|
1144
1144
|
_: 1
|
|
1145
1145
|
})
|
|
1146
1146
|
]),
|
|
1147
|
-
default:
|
|
1148
|
-
|
|
1147
|
+
default: _(() => [
|
|
1148
|
+
D(l, {
|
|
1149
1149
|
class: "action-btn",
|
|
1150
1150
|
type: "",
|
|
1151
1151
|
size: "small",
|
|
@@ -1154,11 +1154,11 @@ function ta(e, t, a, s, u, d) {
|
|
|
1154
1154
|
}, ["prevent"])),
|
|
1155
1155
|
onClick: e.handleTriggerClick
|
|
1156
1156
|
}, {
|
|
1157
|
-
default:
|
|
1157
|
+
default: _(() => [
|
|
1158
1158
|
t[2] || (t[2] = j(" 更多 ", -1)),
|
|
1159
|
-
|
|
1160
|
-
default:
|
|
1161
|
-
|
|
1159
|
+
D(g, { class: "el-icon--right" }, {
|
|
1160
|
+
default: _(() => [
|
|
1161
|
+
D(c)
|
|
1162
1162
|
]),
|
|
1163
1163
|
_: 1
|
|
1164
1164
|
})
|
|
@@ -1174,7 +1174,7 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1174
1174
|
name: "ZxtGrid",
|
|
1175
1175
|
inheritAttrs: !1,
|
|
1176
1176
|
components: {
|
|
1177
|
-
ZxtTable:
|
|
1177
|
+
ZxtTable: M,
|
|
1178
1178
|
ZxtForm: Re,
|
|
1179
1179
|
ActionColumn: aa,
|
|
1180
1180
|
Plus: Pe,
|
|
@@ -1184,8 +1184,8 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1184
1184
|
Search: ie,
|
|
1185
1185
|
Edit: Ve,
|
|
1186
1186
|
View: Fe,
|
|
1187
|
-
Upload:
|
|
1188
|
-
Setting:
|
|
1187
|
+
Upload: De,
|
|
1188
|
+
Setting: Ae
|
|
1189
1189
|
},
|
|
1190
1190
|
props: {
|
|
1191
1191
|
// 网格配置选项
|
|
@@ -1213,7 +1213,7 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1213
1213
|
},
|
|
1214
1214
|
emits: ["toolbar-click", "action-click", "submit", "reset", "page-change", "size-change"],
|
|
1215
1215
|
setup(e, { emit: t, expose: a }) {
|
|
1216
|
-
const s = Ke(), u =
|
|
1216
|
+
const s = Ke(), u = Me(), d = k(null), l = k(null), c = k(1), g = k(10), z = k(null), f = k(e.gridOptions.formMode !== !1), n = k({
|
|
1217
1217
|
...e.gridOptions.formConfig?.data || {}
|
|
1218
1218
|
}), C = {
|
|
1219
1219
|
Plus: Pe,
|
|
@@ -1223,16 +1223,16 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1223
1223
|
Search: ie,
|
|
1224
1224
|
Edit: Ve,
|
|
1225
1225
|
View: Fe,
|
|
1226
|
-
Upload:
|
|
1227
|
-
Setting:
|
|
1228
|
-
}, r =
|
|
1226
|
+
Upload: De,
|
|
1227
|
+
Setting: Ae
|
|
1228
|
+
}, r = w(() => {
|
|
1229
1229
|
const o = e.gridOptions.columns || [];
|
|
1230
1230
|
console.log("cols", e.gridOptions.columns);
|
|
1231
|
-
const h = o.find((
|
|
1231
|
+
const h = o.find((A) => A.actionColumn);
|
|
1232
1232
|
return h ? h.actionColumn : null;
|
|
1233
|
-
}), v =
|
|
1233
|
+
}), v = w(() => (e.gridOptions.columns || []).map((h) => h.actionColumn ? {
|
|
1234
1234
|
...h,
|
|
1235
|
-
slot: "
|
|
1235
|
+
slot: "zxtActionInternal",
|
|
1236
1236
|
actionColumn: void 0
|
|
1237
1237
|
} : h));
|
|
1238
1238
|
console.log("[ZxtGrid][1] source columns =", e.gridOptions.columns), console.log(
|
|
@@ -1240,7 +1240,7 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1240
1240
|
(e.gridOptions.columns || []).find((o) => o?.actionColumn)
|
|
1241
1241
|
), console.log("[ZxtGrid][2] mergedColumns =", v.value), console.log(
|
|
1242
1242
|
"[ZxtGrid][2] merged action slot col =",
|
|
1243
|
-
v.value.find((o) => o?.slot === "
|
|
1243
|
+
v.value.find((o) => o?.slot === "zxtActionInternal")
|
|
1244
1244
|
), console.log("[ZxtGrid][3] actionColumnConfig =", r.value), console.log(
|
|
1245
1245
|
"[ZxtGrid][3] buttons =",
|
|
1246
1246
|
r.value?.buttons,
|
|
@@ -1249,7 +1249,7 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1249
1249
|
);
|
|
1250
1250
|
const L = (o) => {
|
|
1251
1251
|
t("action-click", o);
|
|
1252
|
-
}, J =
|
|
1252
|
+
}, J = w(() => {
|
|
1253
1253
|
const o = e.gridOptions.formConfig;
|
|
1254
1254
|
if (!o || !o.items) return [];
|
|
1255
1255
|
const h = [...o.items];
|
|
@@ -1263,17 +1263,17 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1263
1263
|
isAction: !0,
|
|
1264
1264
|
...o.actionConfig
|
|
1265
1265
|
}), h;
|
|
1266
|
-
}), F =
|
|
1266
|
+
}), F = w(() => {
|
|
1267
1267
|
const o = /* @__PURE__ */ new Set(["search-actions"]);
|
|
1268
1268
|
return (J.value || []).forEach((h) => {
|
|
1269
1269
|
h.type === "slot" && o.add(h.slotName || h.prop);
|
|
1270
1270
|
}), o;
|
|
1271
|
-
}),
|
|
1271
|
+
}), I = w(() => {
|
|
1272
1272
|
const o = {};
|
|
1273
1273
|
for (const h in u)
|
|
1274
1274
|
h === "search-actions" || h === "toolbar" || (F.value.has(h) || h.startsWith("form-")) && (o[h] = u[h]);
|
|
1275
1275
|
return o;
|
|
1276
|
-
}), de =
|
|
1276
|
+
}), de = w(() => {
|
|
1277
1277
|
const o = {};
|
|
1278
1278
|
for (const h in u)
|
|
1279
1279
|
h !== "toolbar" && !F.value.has(h) && !h.startsWith("form-") && (o[h] = u[h]);
|
|
@@ -1289,17 +1289,17 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1289
1289
|
}, fe = (o) => {
|
|
1290
1290
|
if (o)
|
|
1291
1291
|
return typeof o == "object" || typeof o == "function" ? o : C[o];
|
|
1292
|
-
}, me =
|
|
1292
|
+
}, me = w(() => {
|
|
1293
1293
|
const o = e.gridOptions.proxyConfig;
|
|
1294
1294
|
return o ? {
|
|
1295
1295
|
...o,
|
|
1296
1296
|
_formData: n.value
|
|
1297
1297
|
} : null;
|
|
1298
|
-
}), ge =
|
|
1298
|
+
}), ge = w(() => {
|
|
1299
1299
|
const {
|
|
1300
1300
|
formConfig: o,
|
|
1301
1301
|
toolbar: h,
|
|
1302
|
-
formMode:
|
|
1302
|
+
formMode: A,
|
|
1303
1303
|
formColumns: H,
|
|
1304
1304
|
rules: re,
|
|
1305
1305
|
data: ye,
|
|
@@ -1310,27 +1310,27 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1310
1310
|
...je,
|
|
1311
1311
|
proxyConfig: me.value || He || null
|
|
1312
1312
|
};
|
|
1313
|
-
}), le =
|
|
1313
|
+
}), le = w(() => z.value !== null ? z.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []), he = w(() => !!e.gridOptions.proxyConfig), p = w(() => he.value ? 0 : le.value.length), $ = (o, h) => {
|
|
1314
1314
|
t("toolbar-click", { code: o, button: h, grid: d.value });
|
|
1315
|
-
},
|
|
1315
|
+
}, E = (o) => {
|
|
1316
1316
|
c.value = o.page, t("page-change", o);
|
|
1317
1317
|
}, N = (o) => {
|
|
1318
1318
|
g.value = o.size, t("size-change", o);
|
|
1319
|
-
}, ve = () => d.value, Ce = () => l.value,
|
|
1319
|
+
}, ve = () => d.value, Ce = () => l.value, we = () => d.value?.getTableRef()?.getSelectionRows?.() || [], _e = (o) => {
|
|
1320
1320
|
z.value = o ?? null;
|
|
1321
1321
|
}, be = (o) => {
|
|
1322
1322
|
f.value = o;
|
|
1323
1323
|
}, U = (o, h = !0) => {
|
|
1324
|
-
const
|
|
1325
|
-
|
|
1324
|
+
const A = e.gridOptions.formConfig;
|
|
1325
|
+
A?.data && Object.assign(A.data, o), n.value = { ...A?.data || {}, ...o }, h && e.gridOptions.proxyConfig && (c.value = 1, d.value?.reload?.({ formData: n.value, page: 1 }));
|
|
1326
1326
|
}, R = (o, ...h) => {
|
|
1327
|
-
const
|
|
1327
|
+
const A = n.value;
|
|
1328
1328
|
switch (o) {
|
|
1329
1329
|
case "query":
|
|
1330
|
-
c.value = 1, d.value?.reload?.({ formData:
|
|
1330
|
+
c.value = 1, d.value?.reload?.({ formData: A, page: 1 });
|
|
1331
1331
|
break;
|
|
1332
1332
|
case "reload":
|
|
1333
|
-
d.value?.reload?.({ formData:
|
|
1333
|
+
d.value?.reload?.({ formData: A });
|
|
1334
1334
|
break;
|
|
1335
1335
|
default:
|
|
1336
1336
|
console.warn(`[ZxtGrid] commitProxy: unknown type "${o}"`);
|
|
@@ -1349,8 +1349,8 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1349
1349
|
getGridRef: ve,
|
|
1350
1350
|
getFormRef: Ce,
|
|
1351
1351
|
getElTableRef: P,
|
|
1352
|
-
getSelectedRows:
|
|
1353
|
-
reloadData:
|
|
1352
|
+
getSelectedRows: we,
|
|
1353
|
+
reloadData: _e,
|
|
1354
1354
|
setFormVisible: be,
|
|
1355
1355
|
setFormData: U,
|
|
1356
1356
|
commitProxy: R,
|
|
@@ -1376,12 +1376,12 @@ const aa = /* @__PURE__ */ W(Yt, [["render", ta], ["__scopeId", "data-v-e1262cc7
|
|
|
1376
1376
|
total: p,
|
|
1377
1377
|
isFormVisible: f,
|
|
1378
1378
|
searchFormColumns: J,
|
|
1379
|
-
formFilteredSlots:
|
|
1379
|
+
formFilteredSlots: I,
|
|
1380
1380
|
tableFilteredSlots: de,
|
|
1381
1381
|
getIconComponent: fe,
|
|
1382
1382
|
handleToolbarClick: $,
|
|
1383
1383
|
handleActionClick: L,
|
|
1384
|
-
handlePageChange:
|
|
1384
|
+
handlePageChange: E,
|
|
1385
1385
|
handleSizeChange: N,
|
|
1386
1386
|
handleSearch: ce,
|
|
1387
1387
|
handleSearchSubmit: pe,
|
|
@@ -1404,7 +1404,7 @@ function ia(e, t, a, s, u, d) {
|
|
|
1404
1404
|
class: ue(["zxt-grid-container", { "zxt-grid-container--full": e.gridOptions.height === "full" }])
|
|
1405
1405
|
}, [
|
|
1406
1406
|
e.gridOptions.formConfig && e.isFormVisible ? (i(), m("div", oa, [
|
|
1407
|
-
|
|
1407
|
+
D(c, {
|
|
1408
1408
|
ref: "searchFormRef",
|
|
1409
1409
|
"form-columns": e.searchFormColumns,
|
|
1410
1410
|
"initial-form-data": e.gridOptions.formConfig.data,
|
|
@@ -1412,24 +1412,24 @@ function ia(e, t, a, s, u, d) {
|
|
|
1412
1412
|
onSubmit: e.handleSearchSubmit,
|
|
1413
1413
|
onReset: e.handleSearchReset
|
|
1414
1414
|
}, Y({
|
|
1415
|
-
"search-actions":
|
|
1415
|
+
"search-actions": _(() => [
|
|
1416
1416
|
b("div", la, [
|
|
1417
|
-
|
|
1417
|
+
D(l, {
|
|
1418
1418
|
class: "btn-search",
|
|
1419
1419
|
icon: e.Search,
|
|
1420
1420
|
onClick: e.handleSearch
|
|
1421
1421
|
}, {
|
|
1422
|
-
default:
|
|
1422
|
+
default: _(() => [...t[0] || (t[0] = [
|
|
1423
1423
|
j(" 查询 ", -1)
|
|
1424
1424
|
])]),
|
|
1425
1425
|
_: 1
|
|
1426
1426
|
}, 8, ["icon", "onClick"]),
|
|
1427
|
-
|
|
1427
|
+
D(l, {
|
|
1428
1428
|
class: "btn-reset",
|
|
1429
1429
|
icon: e.Refresh,
|
|
1430
1430
|
onClick: e.handleReset
|
|
1431
1431
|
}, {
|
|
1432
|
-
default:
|
|
1432
|
+
default: _(() => [...t[1] || (t[1] = [
|
|
1433
1433
|
j(" 重置 ", -1)
|
|
1434
1434
|
])]),
|
|
1435
1435
|
_: 1
|
|
@@ -1438,17 +1438,17 @@ function ia(e, t, a, s, u, d) {
|
|
|
1438
1438
|
]),
|
|
1439
1439
|
_: 2
|
|
1440
1440
|
}, [
|
|
1441
|
-
|
|
1441
|
+
x(e.formFilteredSlots, (f, n) => ({
|
|
1442
1442
|
name: n,
|
|
1443
|
-
fn:
|
|
1444
|
-
T(e.$slots, n, Oe(
|
|
1443
|
+
fn: _((C) => [
|
|
1444
|
+
T(e.$slots, n, xe(Oe(C)), void 0, !0)
|
|
1445
1445
|
])
|
|
1446
1446
|
}))
|
|
1447
1447
|
]), 1032, ["form-columns", "initial-form-data", "rules", "onSubmit", "onReset"])
|
|
1448
1448
|
])) : G("", !0),
|
|
1449
1449
|
b("div", ra, [
|
|
1450
1450
|
e.gridOptions.toolbar ? (i(), m("div", sa, [
|
|
1451
|
-
(i(!0), m(B, null,
|
|
1451
|
+
(i(!0), m(B, null, x(e.gridOptions.toolbar.buttons, (f, n) => (i(), V(l, {
|
|
1452
1452
|
key: n,
|
|
1453
1453
|
type: f.type || "default",
|
|
1454
1454
|
size: f.size || "small",
|
|
@@ -1456,7 +1456,7 @@ function ia(e, t, a, s, u, d) {
|
|
|
1456
1456
|
disabled: f.disabled,
|
|
1457
1457
|
onClick: (C) => e.handleToolbarClick(f.code, f)
|
|
1458
1458
|
}, {
|
|
1459
|
-
default:
|
|
1459
|
+
default: _(() => [
|
|
1460
1460
|
j(ee(f.name), 1)
|
|
1461
1461
|
]),
|
|
1462
1462
|
_: 2
|
|
@@ -1465,7 +1465,7 @@ function ia(e, t, a, s, u, d) {
|
|
|
1465
1465
|
grid: e.$refs.gridRef
|
|
1466
1466
|
}, void 0, !0)
|
|
1467
1467
|
])) : G("", !0),
|
|
1468
|
-
|
|
1468
|
+
D(z, O({ ref: "gridRef" }, { ...e.tableProps, ...e.attrs }, {
|
|
1469
1469
|
id: e.gridOptions.id,
|
|
1470
1470
|
columns: e.mergedColumns,
|
|
1471
1471
|
data: e.tableData,
|
|
@@ -1481,9 +1481,9 @@ function ia(e, t, a, s, u, d) {
|
|
|
1481
1481
|
onSizeChange: e.handleSizeChange
|
|
1482
1482
|
}), Y({ _: 2 }, [
|
|
1483
1483
|
e.actionColumnConfig ? {
|
|
1484
|
-
name: "
|
|
1485
|
-
fn:
|
|
1486
|
-
|
|
1484
|
+
name: "zxtActionInternal",
|
|
1485
|
+
fn: _(({ row: f }) => [
|
|
1486
|
+
D(g, {
|
|
1487
1487
|
buttons: e.actionColumnConfig.buttons,
|
|
1488
1488
|
row: f,
|
|
1489
1489
|
"max-visible": e.actionColumnConfig.maxVisible || 2,
|
|
@@ -1492,24 +1492,24 @@ function ia(e, t, a, s, u, d) {
|
|
|
1492
1492
|
]),
|
|
1493
1493
|
key: "0"
|
|
1494
1494
|
} : void 0,
|
|
1495
|
-
|
|
1495
|
+
x(e.tableFilteredSlots, (f, n) => ({
|
|
1496
1496
|
name: n,
|
|
1497
|
-
fn:
|
|
1498
|
-
T(e.$slots, n, Oe(
|
|
1497
|
+
fn: _((C) => [
|
|
1498
|
+
T(e.$slots, n, xe(Oe(C)), void 0, !0)
|
|
1499
1499
|
])
|
|
1500
1500
|
}))
|
|
1501
1501
|
]), 1040, ["id", "columns", "data", "height", "pageable", "current-page", "page-size", "page-sizes", "total", "pagination-layout", "onPageChange", "onSizeChange"])
|
|
1502
1502
|
])
|
|
1503
1503
|
], 2);
|
|
1504
1504
|
}
|
|
1505
|
-
const Ze = /* @__PURE__ */ W(na, [["render", ia], ["__scopeId", "data-v-
|
|
1505
|
+
const Ze = /* @__PURE__ */ W(na, [["render", ia], ["__scopeId", "data-v-25a21d5d"]]);
|
|
1506
1506
|
Q.install = function(e) {
|
|
1507
1507
|
e.component(Q.name, Q);
|
|
1508
1508
|
};
|
|
1509
1509
|
const ua = [
|
|
1510
1510
|
te,
|
|
1511
1511
|
ae,
|
|
1512
|
-
|
|
1512
|
+
M,
|
|
1513
1513
|
Ze,
|
|
1514
1514
|
Re,
|
|
1515
1515
|
Q
|
|
@@ -1521,13 +1521,13 @@ const ua = [
|
|
|
1521
1521
|
install: da,
|
|
1522
1522
|
MyButton: te,
|
|
1523
1523
|
JsxButton: ae,
|
|
1524
|
-
ZxtTable:
|
|
1524
|
+
ZxtTable: M,
|
|
1525
1525
|
ZxtGrid: Ze,
|
|
1526
1526
|
ZxtForm: Re,
|
|
1527
1527
|
ZxtPagination: Q,
|
|
1528
1528
|
// 暴露渲染器 API
|
|
1529
|
-
renderer:
|
|
1530
|
-
registerRenderer:
|
|
1529
|
+
renderer: M.renderer,
|
|
1530
|
+
registerRenderer: M.registerRenderer
|
|
1531
1531
|
};
|
|
1532
1532
|
export {
|
|
1533
1533
|
ae as JsxButton,
|
|
@@ -1535,6 +1535,6 @@ export {
|
|
|
1535
1535
|
Re as ZxtForm,
|
|
1536
1536
|
Ze as ZxtGrid,
|
|
1537
1537
|
Q as ZxtPagination,
|
|
1538
|
-
|
|
1538
|
+
M as ZxtTable,
|
|
1539
1539
|
fa as default
|
|
1540
1540
|
};
|
package/dist/zxt-table.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.ZxtTable={},k.Vue,k.ElementPlus))})(this,(function(k,e,V){"use strict";const P=(t,o)=>{const n=t.__vccOpts||t;for(const[i,c]of o)n[i]=c;return n},he={name:"MyButton",props:{type:{type:String,default:"default",validator:t=>["default","primary","success","warning","danger"].includes(t)},disabled:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){return{handleClick:i=>{o("click",i)}}}},Ce=["disabled"];function we(t,o,n,i,c,d){return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["my-button",[`my-button--${n.type}`,{"is-disabled":n.disabled}]]),disabled:n.disabled,onClick:o[0]||(o[0]=(...r)=>i.handleClick&&i.handleClick(...r))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],10,Ce)}const L=P(he,[["render",we],["__scopeId","data-v-4480e77d"]]);L.install=function(t){t.component(L.name,L)};const M=e.defineComponent({name:"JsxButton",props:{type:{type:String,default:"default",validator:t=>["default","primary","success","warning","danger"].includes(t)},disabled:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o,slots:n}){const i=c=>{t.disabled||o("click",c)};return()=>e.createVNode("button",{class:["jsx-button",`jsx-button--${t.type}`,{"is-disabled":t.disabled}],disabled:t.disabled,onClick:i},[n.default?.()])}});M.install=function(t){t.component(M.name,M)};const _e=e.defineComponent({name:"ZxtPagination",components:{ElPagination:V.ElPagination},props:{modelValue:{type:Number,default:1},pageSize:{type:Number,default:10},pageSizes:{type:Array,default:()=>[10,20,50,100]},total:{type:Number,default:0},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"}},emits:["update:modelValue","update:pageSize","page-change","size-change"],setup(t,{emit:o}){const n=e.ref(t.modelValue),i=e.ref(t.pageSize);return e.watch(()=>t.modelValue,r=>{n.value=r}),e.watch(()=>t.pageSize,r=>{i.value=r}),{currentPage:n,pageSize:i,handleSizeChange:r=>{i.value=r,n.value=1,o("update:pageSize",r),o("size-change",{page:n.value,size:r})},handleCurrentChange:r=>{n.value=r,o("update:modelValue",r),o("page-change",{page:r,size:i.value})}}}});function ke(t,o,n,i,c,d){const r=e.resolveComponent("el-pagination");return e.openBlock(),e.createBlock(r,{"current-page":t.currentPage,"onUpdate:currentPage":o[0]||(o[0]=p=>t.currentPage=p),"page-size":t.pageSize,"onUpdate:pageSize":o[1]||(o[1]=p=>t.pageSize=p),"page-sizes":t.pageSizes,total:t.total,layout:t.layout,class:"zxt-pagination",onSizeChange:t.handleSizeChange,onCurrentChange:t.handleCurrentChange},null,8,["current-page","page-size","page-sizes","total","layout","onSizeChange","onCurrentChange"])}const N=P(_e,[["render",ke],["__scopeId","data-v-497aa44d"]]),Z={default:({cellValue:t})=>t??"",input:({cellValue:t,row:o,column:n,updateRow:i})=>e.h(V.ElInput,{modelValue:t,size:"small",onInput:c=>i({...o,[n.property]:c})}),select:({cellValue:t,row:o,column:n,updateRow:i,options:c=[]})=>e.h(V.ElSelect,{modelValue:t,size:"small",onChange:d=>i({...o,[n.property]:d})},()=>c.map(d=>e.h(V.ElOption,{label:d.label,value:d.value,key:d.value}))),checkbox:({cellValue:t,row:o,column:n,updateRow:i})=>e.h(V.ElCheckbox,{modelValue:!!t,onChange:c=>i({...o,[n.property]:c})}),link:({cellValue:t,href:o,target:n="_blank"})=>e.h(V.ElLink,{href:o,target:n},()=>t)};function ye(t,o){if(!t)return null;if(typeof t=="string"){const n=Z[t];return n?n(o):(console.warn(`[ZxtTable] 未找到内置渲染器: ${t}`),o.cellValue??"")}if(typeof t=="function")return t(o);if(typeof t=="object"&&!Array.isArray(t)){const{name:n,props:i={},attrs:c={},events:d={},content:r}=t;return typeof n=="string"&&Z[n]?Z[n]({...o,...i,...c,...d}):typeof n=="object"||typeof n=="function"?e.h(n,{...i,...c,...d},r):(console.warn("[ZxtTable] cellRender 对象缺少有效的 name 字段"),o.cellValue??"")}return o.cellValue??""}function be(t,o){Z[t]&&console.warn(`[ZxtTable] 内置渲染器 ${t} 已被覆盖`),Z[t]=o}const ze=e.defineComponent({name:"ZxtTableColumn",components:{ElTableColumn:V.ElTableColumn},props:{column:{type:Object,required:!0},currentPage:{type:Number,default:1},pageSize:{type:Number,default:10}},setup(t){const o=e.inject("updateRow",()=>{}),n=r=>{const{currentPage:p,pageSize:g}=t;return(p-1)*g+r+1},i=e.computed(()=>{const r=t.column;return{...r,prop:r.prop??r.field,label:r.label??r.title}}),c=e.computed(()=>{const{children:r,...p}=i.value;return p});return{normalizedColumn:i,columnProps:c,renderCell:r=>{const p=i.value,g=r.row[p.prop],w=g??p.defaultValue??"";return ye(p.cellRender,{row:r.row,column:p,rowIndex:r.$index,cellValue:w,updateRow:f=>o(f,r.$index)})},defaultIndexMethod:n}}});function Be(t,o,n,i,c,d){const r=e.resolveComponent("ZxtTableColumn",!0),p=e.resolveComponent("el-table-column");return t.normalizedColumn.children&&t.normalizedColumn.children.length?(e.openBlock(),e.createBlock(p,e.mergeProps({key:0},t.columnProps,{key:t.normalizedColumn.prop+"-group"}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedColumn.children,(g,w)=>(e.openBlock(),e.createBlock(r,{key:w,column:g,"current-page":t.currentPage,"page-size":t.pageSize},e.createSlots({_:2},[e.renderList(t.$slots,(f,a)=>({name:a,fn:e.withCtx(C=>[e.renderSlot(t.$slots,a,e.mergeProps({ref_for:!0},C))])}))]),1032,["column","current-page","page-size"]))),128))]),_:3},16)):(e.openBlock(),e.createBlock(p,e.mergeProps({key:1},t.columnProps,{key:t.normalizedColumn.prop,index:t.normalizedColumn.indexMethod||t.defaultIndexMethod}),e.createSlots({_:2},[t.normalizedColumn.headerSlot?{name:"header",fn:e.withCtx(g=>[e.renderSlot(t.$slots,t.normalizedColumn.headerSlot,e.mergeProps({column:t.normalizedColumn},g))]),key:"0"}:void 0,!["selection","index"].includes(t.normalizedColumn.type)&&(t.normalizedColumn.type!=="expand"||t.normalizedColumn.slot)?{name:"default",fn:e.withCtx(g=>[t.normalizedColumn.slot?e.renderSlot(t.$slots,t.normalizedColumn.slot,{key:0,row:g.row,index:g.$index,column:t.normalizedColumn}):t.normalizedColumn.cellRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderCell(g)),{key:1})):t.normalizedColumn.formatter?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.normalizedColumn.formatter(g.row,t.normalizedColumn,g.row[t.normalizedColumn.prop],g.$index)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(g.row[t.normalizedColumn.prop]),1)],64))]),key:"1"}:void 0]),1040,["index"]))}const Se=P(ze,[["render",Be]]),Ve=new Set(["append","empty"]),Ee=e.defineComponent({name:"ZxtTable",inheritAttrs:!1,components:{ZxtPagination:N,ZxtTableColumn:Se,ElTable:V.ElTable},props:{id:{type:String,default:""},columns:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},height:{type:[String,Number],default:""},pageable:{type:Boolean,default:!0},currentPage:{type:Number,default:1},pageSize:{type:Number,default:10},pageSizes:{type:Array,default:()=>[10,20,50,100]},total:{type:Number,default:0},paginationLayout:{type:String,default:"total, sizes, prev, pager, next, jumper"},proxyConfig:{type:Object,default:null},autoLoad:{type:Boolean,default:!0}},emits:["page-change","size-change","sort-change","filter-change","loaded","load-error","update:row"],setup(t,{emit:o}){const n=e.useSlots(),i=e.ref(null),c=e.ref(t.pageSize),d=e.ref(t.currentPage),r=e.ref(!1),p=e.ref([]),g=e.ref(0),w=e.ref({prop:"",order:""}),f=e.ref({}),a=e.ref({});e.watch(()=>t.currentPage,m=>{d.value=m}),e.watch(()=>t.pageSize,m=>{c.value=m});const C=e.computed(()=>t.height==="full"?{height:"100%"}:{}),s=e.computed(()=>{if(t.height!=="full")return t.height}),h=e.computed(()=>!!t.proxyConfig),E=e.computed(()=>h.value?g.value:t.total>0?t.total:t.data.length),O=e.computed(()=>h.value?p.value:t.data),B=()=>{e.nextTick(()=>{const m=i.value?.$el?.querySelector(".el-table__body-wrapper .el-scrollbar__wrap");m&&(typeof m.scrollTo=="function"?m.scrollTo({top:0,left:0}):(m.scrollTop=0,m.scrollLeft=0))})},F=m=>{h.value&&(d.value=m.page,c.value=m.size,x()),B(),o("size-change",m)},oe=m=>{h.value&&(d.value=m.page,c.value=m.size,x()),B(),o("page-change",m)},ne=({column:m,prop:_,order:D})=>{w.value={prop:_,order:D},h.value&&x(),o("sort-change",{column:m,prop:_,order:D})},ae=m=>{f.value=m||{},h.value&&x(),o("filter-change",f.value)},x=async m=>{if(!h.value)return;const _=t.proxyConfig||{},D=_.ajax?.query;if(typeof D!="function")return;const A=_.props||{},ce=A.pageField||"page";A.sizeField;const de=A.sortField||"sort",pe=A.orderField||"order",me=A.filtersField||"filters";m?.formData!==void 0?a.value=m.formData:_._formData&&(a.value=_._formData);const fe=_.params||{},R={[ce]:{currentPage:m?.page??d.value,pageSize:m?.pageSize??c.value},form:a.value,...fe};w.value?.prop&&(R[de]=w.value.prop,R[pe]=w.value.order),f.value&&Object.keys(f.value).length&&(R[me]=f.value),r.value=!0;try{const S=await D(R),y=_.response||{},l=y.listField||"list",u=y.totalField||"total",b=y.transform;let $=[],U=0;if(typeof b=="function"){const ge=b(S);$=ge?.list??[],U=ge?.total??0}else S&&typeof S=="object"&&($=S?.[l]??S?.data??[],U=S?.[u]??S?.total??0);p.value=Array.isArray($)?$:[],g.value=Number(U)||0,o("loaded",{data:p.value,total:g.value,payload:R})}catch(S){o("load-error",S)}finally{r.value=!1}},q=(m,_)=>{h.value?p.value.splice(_,1,m):o("update:row",{index:_,row:m})};e.provide("updateRow",q),e.onMounted(()=>{h.value&&t.autoLoad&&x()});const le=()=>i.value,re=()=>i.value?.getSelectionRows?.()||[],se=m=>x(m),G=()=>B(),ie=e.computed(()=>{const m={};for(const _ in n)Ve.has(_)||(m[_]=n[_]);return m});return console.log("[ZxtTable][4] props.columns =",t.columns),console.log("[ZxtTable][4] has __action__ slot col =",(t.columns||[]).some(m=>m?.slot==="__action__")),{columnSlots:ie,tableRef:i,containerStyle:C,tableHeight:s,getTableRef:le,pageSize:c,currentPage:d,loading:r,renderData:O,total:E,pageSizes:e.computed(()=>t.pageSizes),paginationLayout:e.computed(()=>t.paginationLayout),handleSizeChange:F,handlePageChange:oe,handleSortChange:ne,handleFilterChange:ae,reload:se,getSelectedRows:re,updateRow:q,resetScrollTop:G}}}),xe={key:0,class:"zxt-table-footer"};function $e(t,o,n,i,c,d){const r=e.resolveComponent("ZxtTableColumn"),p=e.resolveComponent("el-table"),g=e.resolveComponent("ZxtPagination"),w=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["zxt-table-container",{"zxt-table-container--full":t.height==="full"}]),style:e.normalizeStyle(t.containerStyle)},[e.withDirectives((e.openBlock(),e.createBlock(p,e.mergeProps({ref:"tableRef",data:t.renderData,height:t.tableHeight},t.$attrs,{id:t.id,onSortChange:t.handleSortChange,onFilterChange:t.handleFilterChange}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(f,a)=>(e.openBlock(),e.createBlock(r,{key:a,column:f,"current-page":t.currentPage,"page-size":t.pageSize},e.createSlots({_:2},[e.renderList(t.columnSlots,(C,s)=>({name:s,fn:e.withCtx(h=>[e.renderSlot(t.$slots,s,e.mergeProps({ref_for:!0},h),void 0,!0)])}))]),1032,["column","current-page","page-size"]))),128))]),_:2},[t.$slots.empty?{name:"empty",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"empty",{},void 0,!0)]),key:"0"}:void 0]),1040,["data","height","id","onSortChange","onFilterChange"])),[[w,t.loading]]),t.$slots.append?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(t.$slots,"append",{},void 0,!0)])):e.createCommentVNode("",!0),t.pageable?(e.openBlock(),e.createBlock(g,{key:1,"model-value":t.currentPage,"page-size":t.pageSize,"onUpdate:pageSize":o[0]||(o[0]=f=>t.pageSize=f),"page-sizes":t.pageSizes,total:t.total,layout:t.paginationLayout,onPageChange:t.handlePageChange,onSizeChange:t.handleSizeChange},null,8,["model-value","page-size","page-sizes","total","layout","onPageChange","onSizeChange"])):e.createCommentVNode("",!0)],6)}const z=P(Ee,[["render",$e],["__scopeId","data-v-18bf8d0a"]]),T=new Map;class Pe{add(o,n){return!o||typeof o!="string"?(console.warn("[ZxtTable] 渲染器名称必须是字符串"),this):!n||typeof n!="object"?(console.warn("[ZxtTable] 渲染器配置必须是对象"),this):(T.has(o)&&console.warn(`[ZxtTable] 渲染器 "${o}" 已存在,将被覆盖`),T.set(o,n),this)}get(o){return T.get(o)}delete(o){return T.delete(o)}has(o){return T.has(o)}getAll(){return Array.from(T.keys())}clear(){T.clear()}}const W=new Pe;function Ne(t,o,n={}){if(!t||!t.itemRender)return null;const{name:i}=t.itemRender;if(i&&W.has(i)){const c=W.get(i);if(typeof c.renderItemContent=="function"){const d={data:o,field:t.field||t.prop,item:t,formData:o};try{return c.renderItemContent(n,d)}catch(r){return console.error(`[ZxtTable] 渲染器 "${i}" 执行出错:`,r),null}}}return null}z.install=function(t){t.component(z.name,z)},z.registerRenderer=be,z.renderer=W;var Te=e.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}}),ue=Te,Fe=e.defineComponent({name:"Check",__name:"check",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}}),De=Fe,Ae=e.defineComponent({name:"Close",__name:"close",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Re=Ae,Le=e.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"}),e.createElementVNode("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"})]))}}),Me=Le,Oe=e.defineComponent({name:"Delete",__name:"delete",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),J=Oe,Ze=e.defineComponent({name:"Document",__name:"document",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),He=Ze,je=e.defineComponent({name:"Download",__name:"download",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"})]))}}),K=je,Ie=e.defineComponent({name:"Edit",__name:"edit",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),e.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),Q=Ie,qe=e.defineComponent({name:"Lock",__name:"lock",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),e.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),Ge=qe,Ue=e.defineComponent({name:"Plus",__name:"plus",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),X=Ue,We=e.defineComponent({name:"Refresh",__name:"refresh",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"})]))}}),H=We,Je=e.defineComponent({name:"Search",__name:"search",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}}),j=Je,Ke=e.defineComponent({name:"Setting",__name:"setting",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"})]))}}),Y=Ke,Qe=e.defineComponent({name:"Share",__name:"share",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"m679.872 348.8-301.76 188.608a127.8 127.8 0 0 1 5.12 52.16l279.936 104.96a128 128 0 1 1-22.464 59.904l-279.872-104.96a128 128 0 1 1-16.64-166.272l301.696-188.608a128 128 0 1 1 33.92 54.272z"})]))}}),Xe=Qe,Ye=e.defineComponent({name:"Unlock",__name:"unlock",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),e.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"})]))}}),ve=Ye,et=e.defineComponent({name:"Upload",__name:"upload",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z"})]))}}),v=et,tt=e.defineComponent({name:"View",__name:"view",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),ee=tt,ot=e.defineComponent({name:"Warning",__name:"warning",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}}),nt=ot;const at=e.defineComponent({name:"ZxtForm",inheritAttrs:!1,props:{formColumns:{type:Array,default:()=>[]},initialFormData:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},labelWidth:{type:String,default:"100px"}},emits:["submit","reset"],setup(t,{emit:o,expose:n}){const i=e.ref(null),c=e.reactive({}),d={input:"el-input",select:"el-select",date:"el-date-picker",daterange:"el-date-picker",datetime:"el-date-picker",datetimerange:"el-date-picker",cascader:"el-cascader"},r=s=>d[s]||"el-input",p=s=>{const h=s.type||"input",E=["select","date","daterange","datetime","datetimerange","cascader"].includes(h),O={placeholder:s.placeholder||`请${E?"选择":"输入"}${s.label}`,disabled:s.disabled,style:"width: 100%","popper-class":"zxt-form-popper"};let B={};switch(h){case"date":case"daterange":case"datetime":case"datetimerange":B={type:s.dateType||h,startPlaceholder:s.startPlaceholder||"开始日期",endPlaceholder:s.endPlaceholder||"结束日期",format:s.format,valueFormat:s.valueFormat};break;case"cascader":B={options:s.options,props:s.cascaderProps,clearable:s.clearable!==!1};break;default:B={}}const F={...O,...B};return"clearable"in s&&(F.clearable=s.clearable),s.props&&typeof s.props=="object"&&Object.assign(F,s.props),F},g=e.computed(()=>t.formColumns.map(s=>({...s,colSpan:{xs:s.xs??s.span??24,sm:s.sm??s.span??12,md:s.md??s.span??12,lg:s.lg??s.span??12,xl:s.xl??s.span??12}})));e.watch(()=>t.initialFormData,s=>{Object.keys(c).forEach(h=>{delete c[h]}),Object.assign(c,s)},{immediate:!0,deep:!0});const w=e.computed(()=>{const s={...t.rules};return Object.keys(s).length===0&&t.formColumns.length>0&&t.formColumns.forEach(h=>{if(h.required){const E=["select","date","daterange","datetime","datetimerange","cascader"].includes(h.type);s[h.prop]=[{required:!0,message:`请${E?"选择":"输入"}${h.label}`,trigger:E?"change":"blur"}]}}),s}),f=()=>{i.value&&i.value.validate(s=>{s&&o("submit",{...c})})},a=()=>{i.value&&i.value.resetFields(),o("reset")},C=s=>()=>Ne(s,c,{})||null;return n({validate:()=>i.value?i.value.validate():Promise.resolve(!1),resetFields:()=>i.value&&i.value.resetFields(),getFormData:()=>({...c}),submitForm:f,resetForm:a}),{formRef:i,formData:c,formRules:w,submitForm:f,resetForm:a,processedColumns:g,getComponentType:r,getComponentProps:p,renderCustomItem:C}}}),lt={class:"zxt-form-container"},rt={key:0,class:"form-label"},st={class:"form-control"};function it(t,o,n,i,c,d){const r=e.resolveComponent("el-option"),p=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-col"),w=e.resolveComponent("el-row"),f=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",lt,[e.createVNode(f,e.mergeProps({ref:"formRef"},t.$attrs,{model:t.formData,rules:t.formRules,"label-width":t.labelWidth,class:"zxt-form"}),{default:e.withCtx(()=>[e.createVNode(w,{gutter:20},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.processedColumns,(a,C)=>(e.openBlock(),e.createBlock(g,e.mergeProps({key:C},{ref_for:!0},a.colSpan),{default:e.withCtx(()=>[e.createVNode(p,{prop:a.prop,required:a.required,"label-width":"0",class:"custom-form-item"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["form-item-wrapper",{"is-action":a.isAction}])},[a.label?(e.openBlock(),e.createElementBlock("span",rt,e.toDisplayString(a.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",st,[a.type==="slot"?e.renderSlot(t.$slots,a.slotName||a.prop,{key:0,formData:t.formData,column:a},void 0,!0):a.itemRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderCustomItem(a)),{key:1})):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.getComponentType(a.type)),e.mergeProps({key:2,modelValue:t.formData[a.prop],"onUpdate:modelValue":s=>t.formData[a.prop]=s},{ref_for:!0},t.getComponentProps(a),e.toHandlers(a.events||{})),{default:e.withCtx(()=>[a.type==="select"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.options,(s,h)=>(e.openBlock(),e.createBlock(r,{key:h,label:s.label,value:s.value},null,8,["label","value"]))),128)):e.createCommentVNode("",!0)]),_:2},1040,["modelValue","onUpdate:modelValue"]))])],2)]),_:2},1032,["prop","required"])]),_:2},1040))),128))]),_:3})]),_:3},16,["model","rules","label-width"])])}const I=P(at,[["render",it],["__scopeId","data-v-6b22a57b"]]),ct={Plus:X,Delete:J,Refresh:H,Download:K,Search:j,Edit:Q,View:ee,Upload:v,Setting:Y,Warning:nt,Check:De,Close:Re,Document:He,CopyDocument:Me,Share:Xe,Lock:Ge,Unlock:ve,ArrowDown:ue},dt=e.defineComponent({name:"ActionColumn",components:{ArrowDown:ue},props:{buttons:{type:Array,default:()=>[]},row:{type:Object,default:()=>({})},maxVisible:{type:Number,default:2}},emits:["action-click"],setup(t,{emit:o}){const n=e.computed(()=>t.buttons.filter(a=>typeof a.visible=="function"?a.visible(t.row):typeof a.visible=="boolean"?a.visible:!0)),i=e.computed(()=>n.value.length>t.maxVisible),c=e.computed(()=>i.value?n.value.slice(0,t.maxVisible):n.value),d=e.computed(()=>i.value?n.value.slice(t.maxVisible):[]);console.log("[ActionColumn][5] props.buttons =",t.buttons),console.log("[ActionColumn][5] row =",t.row),console.log("[ActionColumn][5] resolvedButtons =",n.value),console.log("[ActionColumn][5] visibleButtons =",c.value),console.log("[ActionColumn][5] overflowButtons =",d.value);const r=a=>{if(a)return typeof a=="object"||typeof a=="function"?a:ct[a]},p=a=>{a?.currentTarget?.blur?.()};return{visibleButtons:c,overflowButtons:d,getIconComponent:r,handleClick:(a,C)=>{p(C),o("action-click",{code:a.code,button:a,row:t.row})},handleCommand:a=>{o("action-click",{code:a.code,button:a,row:t.row})},handleTriggerClick:a=>{p(a)}}}}),pt={class:"action-column"};function mt(t,o,n,i,c,d){const r=e.resolveComponent("el-button"),p=e.resolveComponent("ArrowDown"),g=e.resolveComponent("el-icon"),w=e.resolveComponent("el-dropdown-item"),f=e.resolveComponent("el-dropdown-menu"),a=e.resolveComponent("el-dropdown");return e.openBlock(),e.createElementBlock("div",pt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.visibleButtons,C=>(e.openBlock(),e.createBlock(r,{key:C.code,class:"action-btn",type:C.type||"",icon:t.getIconComponent(C.icon),size:"small",link:"",onMousedown:o[0]||(o[0]=e.withModifiers(()=>{},["prevent"])),onClick:s=>t.handleClick(C,s)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["type","icon","onClick"]))),128)),t.overflowButtons.length?(e.openBlock(),e.createBlock(a,{key:0,trigger:"hover",onCommand:t.handleCommand},{dropdown:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.overflowButtons,C=>(e.openBlock(),e.createBlock(w,{key:C.code,command:C,icon:t.getIconComponent(C.icon)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["command","icon"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createVNode(r,{class:"action-btn",type:"",size:"small",link:"",onMousedown:o[1]||(o[1]=e.withModifiers(()=>{},["prevent"])),onClick:t.handleTriggerClick},{default:e.withCtx(()=>[o[2]||(o[2]=e.createTextVNode(" 更多 ",-1)),e.createVNode(g,{class:"el-icon--right"},{default:e.withCtx(()=>[e.createVNode(p)]),_:1})]),_:1},8,["onClick"])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0)])}const ft=P(dt,[["render",mt],["__scopeId","data-v-e1262cc7"]]),gt=e.defineComponent({name:"ZxtGrid",inheritAttrs:!1,components:{ZxtTable:z,ZxtForm:I,ActionColumn:ft,Plus:X,Delete:J,Refresh:H,Download:K,Search:j,Edit:Q,View:ee,Upload:v,Setting:Y},props:{gridOptions:{type:Object,default:()=>({id:"grid",columns:[],data:[],height:400,pageable:!0,pageSizes:[10,20,50,100],paginationLayout:"total, sizes, prev, pager, next, jumper",toolbar:null,formMode:!1,formColumns:[],rules:{}})},externalData:{type:Array,default:()=>[]}},emits:["toolbar-click","action-click","submit","reset","page-change","size-change"],setup(t,{emit:o,expose:n}){const i=e.useAttrs(),c=e.useSlots(),d=e.ref(null),r=e.ref(null),p=e.ref(1),g=e.ref(10),w=e.ref(null),f=e.ref(t.gridOptions.formMode!==!1),a=e.ref({...t.gridOptions.formConfig?.data||{}}),C={Plus:X,Delete:J,Refresh:H,Download:K,Search:j,Edit:Q,View:ee,Upload:v,Setting:Y},s=e.computed(()=>{const l=t.gridOptions.columns||[];console.log("cols",t.gridOptions.columns);const u=l.find(b=>b.actionColumn);return u?u.actionColumn:null}),h=e.computed(()=>(t.gridOptions.columns||[]).map(u=>u.actionColumn?{...u,slot:"__action__",actionColumn:void 0}:u));console.log("[ZxtGrid][1] source columns =",t.gridOptions.columns),console.log("[ZxtGrid][1] source action col =",(t.gridOptions.columns||[]).find(l=>l?.actionColumn)),console.log("[ZxtGrid][2] mergedColumns =",h.value),console.log("[ZxtGrid][2] merged action slot col =",h.value.find(l=>l?.slot==="__action__")),console.log("[ZxtGrid][3] actionColumnConfig =",s.value),console.log("[ZxtGrid][3] buttons =",s.value?.buttons,"len=",s.value?.buttons?.length);const E=l=>{o("action-click",l)},O=e.computed(()=>{const l=t.gridOptions.formConfig;if(!l||!l.items)return[];const u=[...l.items];return u.some($=>$.type==="slot"&&$.slotName==="search-actions")||u.push({type:"slot",slotName:"search-actions",span:6,labelWidth:"0px",isAction:!0,...l.actionConfig}),u}),B=e.computed(()=>{const l=new Set(["search-actions"]);return(O.value||[]).forEach(u=>{u.type==="slot"&&l.add(u.slotName||u.prop)}),l}),F=e.computed(()=>{const l={};for(const u in c)u==="search-actions"||u==="toolbar"||(B.value.has(u)||u.startsWith("form-"))&&(l[u]=c[u]);return l}),oe=e.computed(()=>{const l={};for(const u in c)u!=="toolbar"&&!B.value.has(u)&&!u.startsWith("form-")&&(l[u]=c[u]);return l}),ne=()=>{r.value?.submitForm()},ae=l=>{o("submit",l),t.gridOptions.proxyConfig&&(a.value={...l},p.value=1,d.value?.reload?.({formData:a.value,page:1}))},x=()=>{r.value?.resetForm()},q=()=>{o("reset"),t.gridOptions.proxyConfig&&(a.value={},p.value=1,d.value?.reload?.({formData:{},page:1}))},le=l=>{if(l)return typeof l=="object"||typeof l=="function"?l:C[l]},re=e.computed(()=>{const l=t.gridOptions.proxyConfig;return l?{...l,_formData:a.value}:null}),se=e.computed(()=>{const{formConfig:l,toolbar:u,formMode:b,formColumns:$,rules:U,data:ge,proxyConfig:bt,...zt}=t.gridOptions;return{...zt,proxyConfig:re.value||bt||null}}),G=e.computed(()=>w.value!==null?w.value:t.externalData.length>0?t.externalData:t.gridOptions.data||[]),ie=e.computed(()=>!!t.gridOptions.proxyConfig),m=e.computed(()=>ie.value?0:G.value.length),_=(l,u)=>{o("toolbar-click",{code:l,button:u,grid:d.value})},D=l=>{p.value=l.page,o("page-change",l)},A=l=>{g.value=l.size,o("size-change",l)},ce=()=>d.value,de=()=>r.value,pe=()=>d.value?.getTableRef()?.getSelectionRows?.()||[],me=l=>{w.value=l??null},fe=l=>{f.value=l},R=(l,u=!0)=>{const b=t.gridOptions.formConfig;b?.data&&Object.assign(b.data,l),a.value={...b?.data||{},...l},u&&t.gridOptions.proxyConfig&&(p.value=1,d.value?.reload?.({formData:a.value,page:1}))},S=(l,...u)=>{const b=a.value;switch(l){case"query":p.value=1,d.value?.reload?.({formData:b,page:1});break;case"reload":d.value?.reload?.({formData:b});break;default:console.warn(`[ZxtGrid] commitProxy: unknown type "${l}"`)}};e.watch(()=>t.gridOptions.formMode,l=>{l!==void 0&&(f.value=l)}),e.onMounted(()=>{t.gridOptions.proxyConfig&&t.gridOptions.autoLoad!==!1&&d.value?.reload?.({formData:a.value,page:1})});const y=()=>d.value?.getTableRef?.();return n({getGridRef:ce,getFormRef:de,getElTableRef:y,getSelectedRows:pe,reloadData:me,setFormVisible:fe,setFormData:R,commitProxy:S,clearSelection:()=>y()?.clearSelection(),toggleRowSelection:(...l)=>y()?.toggleRowSelection(...l),toggleAllSelection:()=>y()?.toggleAllSelection(),toggleRowExpansion:(...l)=>y()?.toggleRowExpansion(...l),setCurrentRow:(...l)=>y()?.setCurrentRow(...l),clearSort:()=>y()?.clearSort(),clearFilter:(...l)=>y()?.clearFilter(...l),doLayout:()=>y()?.doLayout(),sort:(...l)=>y()?.sort(...l)}),{attrs:i,gridRef:d,searchFormRef:r,currentPage:p,pageSize:g,tableData:G,tableProps:se,mergedColumns:h,actionColumnConfig:s,total:m,isFormVisible:f,searchFormColumns:O,formFilteredSlots:F,tableFilteredSlots:oe,getIconComponent:le,handleToolbarClick:_,handleActionClick:E,handlePageChange:D,handleSizeChange:A,handleSearch:ne,handleSearchSubmit:ae,handleReset:x,handleSearchReset:q,Search:j,Refresh:H}}}),ut={key:0,class:"grid-search-form"},ht={class:"search-btn-group"},Ct={class:"grid-table-wrapper"},wt={key:0,class:"grid-toolbar"};function _t(t,o,n,i,c,d){const r=e.resolveComponent("el-button"),p=e.resolveComponent("ZxtForm"),g=e.resolveComponent("ActionColumn"),w=e.resolveComponent("ZxtTable");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["zxt-grid-container",{"zxt-grid-container--full":t.gridOptions.height==="full"}])},[t.gridOptions.formConfig&&t.isFormVisible?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(p,{ref:"searchFormRef","form-columns":t.searchFormColumns,"initial-form-data":t.gridOptions.formConfig.data,rules:t.gridOptions.formConfig.rules,onSubmit:t.handleSearchSubmit,onReset:t.handleSearchReset},e.createSlots({"search-actions":e.withCtx(()=>[e.createElementVNode("div",ht,[e.createVNode(r,{class:"btn-search",icon:t.Search,onClick:t.handleSearch},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createTextVNode(" 查询 ",-1)])]),_:1},8,["icon","onClick"]),e.createVNode(r,{class:"btn-reset",icon:t.Refresh,onClick:t.handleReset},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["icon","onClick"])])]),_:2},[e.renderList(t.formFilteredSlots,(f,a)=>({name:a,fn:e.withCtx(C=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(C)),void 0,!0)])}))]),1032,["form-columns","initial-form-data","rules","onSubmit","onReset"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ct,[t.gridOptions.toolbar?(e.openBlock(),e.createElementBlock("div",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.gridOptions.toolbar.buttons,(f,a)=>(e.openBlock(),e.createBlock(r,{key:a,type:f.type||"default",size:f.size||"small",icon:t.getIconComponent(f.icon),disabled:f.disabled,onClick:C=>t.handleToolbarClick(f.code,f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.name),1)]),_:2},1032,["type","size","icon","disabled","onClick"]))),128)),e.renderSlot(t.$slots,"toolbar",{grid:t.$refs.gridRef},void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(w,e.mergeProps({ref:"gridRef"},{...t.tableProps,...t.attrs},{id:t.gridOptions.id,columns:t.mergedColumns,data:t.tableData,height:t.gridOptions.height,"auto-load":!1,pageable:t.gridOptions.pageable!==!1,"current-page":t.currentPage,"page-size":t.pageSize,"page-sizes":t.gridOptions.pageSizes,total:t.total,"pagination-layout":t.gridOptions.paginationLayout,onPageChange:t.handlePageChange,onSizeChange:t.handleSizeChange}),e.createSlots({_:2},[t.actionColumnConfig?{name:"__action__",fn:e.withCtx(({row:f})=>[e.createVNode(g,{buttons:t.actionColumnConfig.buttons,row:f,"max-visible":t.actionColumnConfig.maxVisible||2,onActionClick:t.handleActionClick},null,8,["buttons","row","max-visible","onActionClick"])]),key:"0"}:void 0,e.renderList(t.tableFilteredSlots,(f,a)=>({name:a,fn:e.withCtx(C=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(C)),void 0,!0)])}))]),1040,["id","columns","data","height","pageable","current-page","page-size","page-sizes","total","pagination-layout","onPageChange","onSizeChange"])])],2)}const te=P(gt,[["render",_t],["__scopeId","data-v-d7c7dfc0"]]);N.install=function(t){t.component(N.name,N)};const kt=[L,M,z,te,I,N],yt={install:t=>{kt.forEach(o=>{t.component(o.name,o)})},MyButton:L,JsxButton:M,ZxtTable:z,ZxtGrid:te,ZxtForm:I,ZxtPagination:N,renderer:z.renderer,registerRenderer:z.registerRenderer};k.JsxButton=M,k.MyButton=L,k.ZxtForm=I,k.ZxtGrid=te,k.ZxtPagination=N,k.ZxtTable=z,k.default=yt,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(y=typeof globalThis<"u"?globalThis:y||self,e(y.ZxtTable={},y.Vue,y.ElementPlus))})(this,(function(y,e,V){"use strict";const P=(t,o)=>{const n=t.__vccOpts||t;for(const[i,c]of o)n[i]=c;return n},he={name:"MyButton",props:{type:{type:String,default:"default",validator:t=>["default","primary","success","warning","danger"].includes(t)},disabled:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){return{handleClick:i=>{o("click",i)}}}},Ce=["disabled"];function we(t,o,n,i,c,d){return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["my-button",[`my-button--${n.type}`,{"is-disabled":n.disabled}]]),disabled:n.disabled,onClick:o[0]||(o[0]=(...r)=>i.handleClick&&i.handleClick(...r))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],10,Ce)}const L=P(he,[["render",we],["__scopeId","data-v-4480e77d"]]);L.install=function(t){t.component(L.name,L)};const M=e.defineComponent({name:"JsxButton",props:{type:{type:String,default:"default",validator:t=>["default","primary","success","warning","danger"].includes(t)},disabled:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o,slots:n}){const i=c=>{t.disabled||o("click",c)};return()=>e.createVNode("button",{class:["jsx-button",`jsx-button--${t.type}`,{"is-disabled":t.disabled}],disabled:t.disabled,onClick:i},[n.default?.()])}});M.install=function(t){t.component(M.name,M)};const ke=e.defineComponent({name:"ZxtPagination",components:{ElPagination:V.ElPagination},props:{modelValue:{type:Number,default:1},pageSize:{type:Number,default:10},pageSizes:{type:Array,default:()=>[10,20,50,100]},total:{type:Number,default:0},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"}},emits:["update:modelValue","update:pageSize","page-change","size-change"],setup(t,{emit:o}){const n=e.ref(t.modelValue),i=e.ref(t.pageSize);return e.watch(()=>t.modelValue,r=>{n.value=r}),e.watch(()=>t.pageSize,r=>{i.value=r}),{currentPage:n,pageSize:i,handleSizeChange:r=>{i.value=r,n.value=1,o("update:pageSize",r),o("size-change",{page:n.value,size:r})},handleCurrentChange:r=>{n.value=r,o("update:modelValue",r),o("page-change",{page:r,size:i.value})}}}});function ye(t,o,n,i,c,d){const r=e.resolveComponent("el-pagination");return e.openBlock(),e.createBlock(r,{"current-page":t.currentPage,"onUpdate:currentPage":o[0]||(o[0]=p=>t.currentPage=p),"page-size":t.pageSize,"onUpdate:pageSize":o[1]||(o[1]=p=>t.pageSize=p),"page-sizes":t.pageSizes,total:t.total,layout:t.layout,class:"zxt-pagination",onSizeChange:t.handleSizeChange,onCurrentChange:t.handleCurrentChange},null,8,["current-page","page-size","page-sizes","total","layout","onSizeChange","onCurrentChange"])}const N=P(ke,[["render",ye],["__scopeId","data-v-497aa44d"]]),Z={default:({cellValue:t})=>t??"",input:({cellValue:t,row:o,column:n,updateRow:i})=>e.h(V.ElInput,{modelValue:t,size:"small",onInput:c=>i({...o,[n.property]:c})}),select:({cellValue:t,row:o,column:n,updateRow:i,options:c=[]})=>e.h(V.ElSelect,{modelValue:t,size:"small",onChange:d=>i({...o,[n.property]:d})},()=>c.map(d=>e.h(V.ElOption,{label:d.label,value:d.value,key:d.value}))),checkbox:({cellValue:t,row:o,column:n,updateRow:i})=>e.h(V.ElCheckbox,{modelValue:!!t,onChange:c=>i({...o,[n.property]:c})}),link:({cellValue:t,href:o,target:n="_blank"})=>e.h(V.ElLink,{href:o,target:n},()=>t)};function be(t,o){if(!t)return null;if(typeof t=="string"){const n=Z[t];return n?n(o):(console.warn(`[ZxtTable] 未找到内置渲染器: ${t}`),o.cellValue??"")}if(typeof t=="function")return t(o);if(typeof t=="object"&&!Array.isArray(t)){const{name:n,props:i={},attrs:c={},events:d={},content:r}=t;return typeof n=="string"&&Z[n]?Z[n]({...o,...i,...c,...d}):typeof n=="object"||typeof n=="function"?e.h(n,{...i,...c,...d},r):(console.warn("[ZxtTable] cellRender 对象缺少有效的 name 字段"),o.cellValue??"")}return o.cellValue??""}function _e(t,o){Z[t]&&console.warn(`[ZxtTable] 内置渲染器 ${t} 已被覆盖`),Z[t]=o}const ze=e.defineComponent({name:"ZxtTableColumn",components:{ElTableColumn:V.ElTableColumn},props:{column:{type:Object,required:!0},currentPage:{type:Number,default:1},pageSize:{type:Number,default:10}},setup(t){const o=e.inject("updateRow",()=>{}),n=r=>{const{currentPage:p,pageSize:g}=t;return(p-1)*g+r+1},i=e.computed(()=>{const r=t.column;return{...r,prop:r.prop??r.field,label:r.label??r.title}}),c=e.computed(()=>{const{children:r,...p}=i.value;return p});return{normalizedColumn:i,columnProps:c,renderCell:r=>{const p=i.value,g=r.row[p.prop],w=g??p.defaultValue??"";return be(p.cellRender,{row:r.row,column:p,rowIndex:r.$index,cellValue:w,updateRow:f=>o(f,r.$index)})},defaultIndexMethod:n}}});function Be(t,o,n,i,c,d){const r=e.resolveComponent("ZxtTableColumn",!0),p=e.resolveComponent("el-table-column");return t.normalizedColumn.children&&t.normalizedColumn.children.length?(e.openBlock(),e.createBlock(p,e.mergeProps({key:0},t.columnProps,{key:t.normalizedColumn.prop+"-group"}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.normalizedColumn.children,(g,w)=>(e.openBlock(),e.createBlock(r,{key:w,column:g,"current-page":t.currentPage,"page-size":t.pageSize},e.createSlots({_:2},[e.renderList(t.$slots,(f,a)=>({name:a,fn:e.withCtx(C=>[e.renderSlot(t.$slots,a,e.mergeProps({ref_for:!0},C))])}))]),1032,["column","current-page","page-size"]))),128))]),_:3},16)):(e.openBlock(),e.createBlock(p,e.mergeProps({key:1},t.columnProps,{key:t.normalizedColumn.prop,index:t.normalizedColumn.indexMethod||t.defaultIndexMethod}),e.createSlots({_:2},[t.normalizedColumn.headerSlot?{name:"header",fn:e.withCtx(g=>[e.renderSlot(t.$slots,t.normalizedColumn.headerSlot,e.mergeProps({column:t.normalizedColumn},g))]),key:"0"}:void 0,!["selection","index"].includes(t.normalizedColumn.type)&&(t.normalizedColumn.type!=="expand"||t.normalizedColumn.slot)?{name:"default",fn:e.withCtx(g=>[t.normalizedColumn.slot?e.renderSlot(t.$slots,t.normalizedColumn.slot,{key:0,row:g.row,index:g.$index,column:t.normalizedColumn}):t.normalizedColumn.cellRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderCell(g)),{key:1})):t.normalizedColumn.formatter?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.normalizedColumn.formatter(g.row,t.normalizedColumn,g.row[t.normalizedColumn.prop],g.$index)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(g.row[t.normalizedColumn.prop]),1)],64))]),key:"1"}:void 0]),1040,["index"]))}const Se=P(ze,[["render",Be]]),Ve=new Set(["append","empty"]),Ee=e.defineComponent({name:"ZxtTable",inheritAttrs:!1,components:{ZxtPagination:N,ZxtTableColumn:Se,ElTable:V.ElTable},props:{id:{type:String,default:""},columns:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},height:{type:[String,Number],default:""},pageable:{type:Boolean,default:!0},currentPage:{type:Number,default:1},pageSize:{type:Number,default:10},pageSizes:{type:Array,default:()=>[10,20,50,100]},total:{type:Number,default:0},paginationLayout:{type:String,default:"total, sizes, prev, pager, next, jumper"},proxyConfig:{type:Object,default:null},autoLoad:{type:Boolean,default:!0}},emits:["page-change","size-change","sort-change","filter-change","loaded","load-error","update:row"],setup(t,{emit:o}){const n=e.useSlots(),i=e.ref(null),c=e.ref(t.pageSize),d=e.ref(t.currentPage),r=e.ref(!1),p=e.ref([]),g=e.ref(0),w=e.ref({prop:"",order:""}),f=e.ref({}),a=e.ref({});e.watch(()=>t.currentPage,m=>{d.value=m}),e.watch(()=>t.pageSize,m=>{c.value=m});const C=e.computed(()=>t.height==="full"?{height:"100%"}:{}),s=e.computed(()=>{if(t.height!=="full")return t.height}),h=e.computed(()=>!!t.proxyConfig),E=e.computed(()=>h.value?g.value:t.total>0?t.total:t.data.length),O=e.computed(()=>h.value?p.value:t.data),B=()=>{e.nextTick(()=>{const m=i.value?.$el?.querySelector(".el-table__body-wrapper .el-scrollbar__wrap");m&&(typeof m.scrollTo=="function"?m.scrollTo({top:0,left:0}):(m.scrollTop=0,m.scrollLeft=0))})},F=m=>{h.value&&(d.value=m.page,c.value=m.size,x()),B(),o("size-change",m)},oe=m=>{h.value&&(d.value=m.page,c.value=m.size,x()),B(),o("page-change",m)},ne=({column:m,prop:k,order:D})=>{w.value={prop:k,order:D},h.value&&x(),o("sort-change",{column:m,prop:k,order:D})},ae=m=>{f.value=m||{},h.value&&x(),o("filter-change",f.value)},x=async m=>{if(!h.value)return;const k=t.proxyConfig||{},D=k.ajax?.query;if(typeof D!="function")return;const A=k.props||{},ce=A.pageField||"page";A.sizeField;const de=A.sortField||"sort",pe=A.orderField||"order",me=A.filtersField||"filters";m?.formData!==void 0?a.value=m.formData:k._formData&&(a.value=k._formData);const fe=k.params||{},R={[ce]:{currentPage:m?.page??d.value,pageSize:m?.pageSize??c.value},form:a.value,...fe};w.value?.prop&&(R[de]=w.value.prop,R[pe]=w.value.order),f.value&&Object.keys(f.value).length&&(R[me]=f.value),r.value=!0;try{const S=await D(R),b=k.response||{},l=b.listField||"list",u=b.totalField||"total",_=b.transform;let $=[],U=0;if(typeof _=="function"){const ge=_(S);$=ge?.list??[],U=ge?.total??0}else S&&typeof S=="object"&&($=S?.[l]??S?.data??[],U=S?.[u]??S?.total??0);p.value=Array.isArray($)?$:[],g.value=Number(U)||0,o("loaded",{data:p.value,total:g.value,payload:R})}catch(S){o("load-error",S)}finally{r.value=!1}},q=(m,k)=>{h.value?p.value.splice(k,1,m):o("update:row",{index:k,row:m})};e.provide("updateRow",q),e.onMounted(()=>{h.value&&t.autoLoad&&x()});const le=()=>i.value,re=()=>i.value?.getSelectionRows?.()||[],se=m=>x(m),G=()=>B(),ie=e.computed(()=>{const m={};for(const k in n)Ve.has(k)||(m[k]=n[k]);return m});return console.log("[ZxtTable][4] props.columns =",t.columns),console.log("[ZxtTable][4] has zxtActionInternal slot col =",(t.columns||[]).some(m=>m?.slot==="zxtActionInternal")),{columnSlots:ie,tableRef:i,containerStyle:C,tableHeight:s,getTableRef:le,pageSize:c,currentPage:d,loading:r,renderData:O,total:E,pageSizes:e.computed(()=>t.pageSizes),paginationLayout:e.computed(()=>t.paginationLayout),handleSizeChange:F,handlePageChange:oe,handleSortChange:ne,handleFilterChange:ae,reload:se,getSelectedRows:re,updateRow:q,resetScrollTop:G}}}),xe={key:0,class:"zxt-table-footer"};function $e(t,o,n,i,c,d){const r=e.resolveComponent("ZxtTableColumn"),p=e.resolveComponent("el-table"),g=e.resolveComponent("ZxtPagination"),w=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["zxt-table-container",{"zxt-table-container--full":t.height==="full"}]),style:e.normalizeStyle(t.containerStyle)},[e.withDirectives((e.openBlock(),e.createBlock(p,e.mergeProps({ref:"tableRef",data:t.renderData,height:t.tableHeight},t.$attrs,{id:t.id,onSortChange:t.handleSortChange,onFilterChange:t.handleFilterChange}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(f,a)=>(e.openBlock(),e.createBlock(r,{key:a,column:f,"current-page":t.currentPage,"page-size":t.pageSize},e.createSlots({_:2},[e.renderList(t.columnSlots,(C,s)=>({name:s,fn:e.withCtx(h=>[e.renderSlot(t.$slots,s,e.mergeProps({ref_for:!0},h),void 0,!0)])}))]),1032,["column","current-page","page-size"]))),128))]),_:2},[t.$slots.empty?{name:"empty",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"empty",{},void 0,!0)]),key:"0"}:void 0]),1040,["data","height","id","onSortChange","onFilterChange"])),[[w,t.loading]]),t.$slots.append?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(t.$slots,"append",{},void 0,!0)])):e.createCommentVNode("",!0),t.pageable?(e.openBlock(),e.createBlock(g,{key:1,"model-value":t.currentPage,"page-size":t.pageSize,"onUpdate:pageSize":o[0]||(o[0]=f=>t.pageSize=f),"page-sizes":t.pageSizes,total:t.total,layout:t.paginationLayout,onPageChange:t.handlePageChange,onSizeChange:t.handleSizeChange},null,8,["model-value","page-size","page-sizes","total","layout","onPageChange","onSizeChange"])):e.createCommentVNode("",!0)],6)}const z=P(Ee,[["render",$e],["__scopeId","data-v-bc4be279"]]),T=new Map;class Pe{add(o,n){return!o||typeof o!="string"?(console.warn("[ZxtTable] 渲染器名称必须是字符串"),this):!n||typeof n!="object"?(console.warn("[ZxtTable] 渲染器配置必须是对象"),this):(T.has(o)&&console.warn(`[ZxtTable] 渲染器 "${o}" 已存在,将被覆盖`),T.set(o,n),this)}get(o){return T.get(o)}delete(o){return T.delete(o)}has(o){return T.has(o)}getAll(){return Array.from(T.keys())}clear(){T.clear()}}const W=new Pe;function Ne(t,o,n={}){if(!t||!t.itemRender)return null;const{name:i}=t.itemRender;if(i&&W.has(i)){const c=W.get(i);if(typeof c.renderItemContent=="function"){const d={data:o,field:t.field||t.prop,item:t,formData:o};try{return c.renderItemContent(n,d)}catch(r){return console.error(`[ZxtTable] 渲染器 "${i}" 执行出错:`,r),null}}}return null}z.install=function(t){t.component(z.name,z)},z.registerRenderer=_e,z.renderer=W;var Te=e.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}}),ue=Te,Fe=e.defineComponent({name:"Check",__name:"check",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}}),De=Fe,Ae=e.defineComponent({name:"Close",__name:"close",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Re=Ae,Le=e.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"}),e.createElementVNode("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"})]))}}),Me=Le,Oe=e.defineComponent({name:"Delete",__name:"delete",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),J=Oe,Ze=e.defineComponent({name:"Document",__name:"document",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),He=Ze,je=e.defineComponent({name:"Download",__name:"download",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"})]))}}),K=je,Ie=e.defineComponent({name:"Edit",__name:"edit",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),e.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),Q=Ie,qe=e.defineComponent({name:"Lock",__name:"lock",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),e.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),Ge=qe,Ue=e.defineComponent({name:"Plus",__name:"plus",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),X=Ue,We=e.defineComponent({name:"Refresh",__name:"refresh",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"})]))}}),H=We,Je=e.defineComponent({name:"Search",__name:"search",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}}),j=Je,Ke=e.defineComponent({name:"Setting",__name:"setting",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"})]))}}),Y=Ke,Qe=e.defineComponent({name:"Share",__name:"share",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"m679.872 348.8-301.76 188.608a127.8 127.8 0 0 1 5.12 52.16l279.936 104.96a128 128 0 1 1-22.464 59.904l-279.872-104.96a128 128 0 1 1-16.64-166.272l301.696-188.608a128 128 0 1 1 33.92 54.272z"})]))}}),Xe=Qe,Ye=e.defineComponent({name:"Unlock",__name:"unlock",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),e.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"})]))}}),ve=Ye,et=e.defineComponent({name:"Upload",__name:"upload",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z"})]))}}),v=et,tt=e.defineComponent({name:"View",__name:"view",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),ee=tt,ot=e.defineComponent({name:"Warning",__name:"warning",setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}}),nt=ot;const at=e.defineComponent({name:"ZxtForm",inheritAttrs:!1,props:{formColumns:{type:Array,default:()=>[]},initialFormData:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},labelWidth:{type:String,default:"100px"}},emits:["submit","reset"],setup(t,{emit:o,expose:n}){const i=e.ref(null),c=e.reactive({}),d={input:"el-input",select:"el-select",date:"el-date-picker",daterange:"el-date-picker",datetime:"el-date-picker",datetimerange:"el-date-picker",cascader:"el-cascader"},r=s=>d[s]||"el-input",p=s=>{const h=s.type||"input",E=["select","date","daterange","datetime","datetimerange","cascader"].includes(h),O={placeholder:s.placeholder||`请${E?"选择":"输入"}${s.label}`,disabled:s.disabled,style:"width: 100%","popper-class":"zxt-form-popper"};let B={};switch(h){case"date":case"daterange":case"datetime":case"datetimerange":B={type:s.dateType||h,startPlaceholder:s.startPlaceholder||"开始日期",endPlaceholder:s.endPlaceholder||"结束日期",format:s.format,valueFormat:s.valueFormat};break;case"cascader":B={options:s.options,props:s.cascaderProps,clearable:s.clearable!==!1};break;default:B={}}const F={...O,...B};return"clearable"in s&&(F.clearable=s.clearable),s.props&&typeof s.props=="object"&&Object.assign(F,s.props),F},g=e.computed(()=>t.formColumns.map(s=>({...s,colSpan:{xs:s.xs??s.span??24,sm:s.sm??s.span??12,md:s.md??s.span??12,lg:s.lg??s.span??12,xl:s.xl??s.span??12}})));e.watch(()=>t.initialFormData,s=>{Object.keys(c).forEach(h=>{delete c[h]}),Object.assign(c,s)},{immediate:!0,deep:!0});const w=e.computed(()=>{const s={...t.rules};return Object.keys(s).length===0&&t.formColumns.length>0&&t.formColumns.forEach(h=>{if(h.required){const E=["select","date","daterange","datetime","datetimerange","cascader"].includes(h.type);s[h.prop]=[{required:!0,message:`请${E?"选择":"输入"}${h.label}`,trigger:E?"change":"blur"}]}}),s}),f=()=>{i.value&&i.value.validate(s=>{s&&o("submit",{...c})})},a=()=>{i.value&&i.value.resetFields(),o("reset")},C=s=>()=>Ne(s,c,{})||null;return n({validate:()=>i.value?i.value.validate():Promise.resolve(!1),resetFields:()=>i.value&&i.value.resetFields(),getFormData:()=>({...c}),submitForm:f,resetForm:a}),{formRef:i,formData:c,formRules:w,submitForm:f,resetForm:a,processedColumns:g,getComponentType:r,getComponentProps:p,renderCustomItem:C}}}),lt={class:"zxt-form-container"},rt={key:0,class:"form-label"},st={class:"form-control"};function it(t,o,n,i,c,d){const r=e.resolveComponent("el-option"),p=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-col"),w=e.resolveComponent("el-row"),f=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",lt,[e.createVNode(f,e.mergeProps({ref:"formRef"},t.$attrs,{model:t.formData,rules:t.formRules,"label-width":t.labelWidth,class:"zxt-form"}),{default:e.withCtx(()=>[e.createVNode(w,{gutter:20},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.processedColumns,(a,C)=>(e.openBlock(),e.createBlock(g,e.mergeProps({key:C},{ref_for:!0},a.colSpan),{default:e.withCtx(()=>[e.createVNode(p,{prop:a.prop,required:a.required,"label-width":"0",class:"custom-form-item"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["form-item-wrapper",{"is-action":a.isAction}])},[a.label?(e.openBlock(),e.createElementBlock("span",rt,e.toDisplayString(a.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",st,[a.type==="slot"?e.renderSlot(t.$slots,a.slotName||a.prop,{key:0,formData:t.formData,column:a},void 0,!0):a.itemRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderCustomItem(a)),{key:1})):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.getComponentType(a.type)),e.mergeProps({key:2,modelValue:t.formData[a.prop],"onUpdate:modelValue":s=>t.formData[a.prop]=s},{ref_for:!0},t.getComponentProps(a),e.toHandlers(a.events||{})),{default:e.withCtx(()=>[a.type==="select"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.options,(s,h)=>(e.openBlock(),e.createBlock(r,{key:h,label:s.label,value:s.value},null,8,["label","value"]))),128)):e.createCommentVNode("",!0)]),_:2},1040,["modelValue","onUpdate:modelValue"]))])],2)]),_:2},1032,["prop","required"])]),_:2},1040))),128))]),_:3})]),_:3},16,["model","rules","label-width"])])}const I=P(at,[["render",it],["__scopeId","data-v-6b22a57b"]]),ct={Plus:X,Delete:J,Refresh:H,Download:K,Search:j,Edit:Q,View:ee,Upload:v,Setting:Y,Warning:nt,Check:De,Close:Re,Document:He,CopyDocument:Me,Share:Xe,Lock:Ge,Unlock:ve,ArrowDown:ue},dt=e.defineComponent({name:"ActionColumn",components:{ArrowDown:ue},props:{buttons:{type:Array,default:()=>[]},row:{type:Object,default:()=>({})},maxVisible:{type:Number,default:2}},emits:["action-click"],setup(t,{emit:o}){const n=e.computed(()=>t.buttons.filter(a=>typeof a.visible=="function"?a.visible(t.row):typeof a.visible=="boolean"?a.visible:!0)),i=e.computed(()=>n.value.length>t.maxVisible),c=e.computed(()=>i.value?n.value.slice(0,t.maxVisible):n.value),d=e.computed(()=>i.value?n.value.slice(t.maxVisible):[]);console.log("[ActionColumn][5] props.buttons =",t.buttons),console.log("[ActionColumn][5] row =",t.row),console.log("[ActionColumn][5] resolvedButtons =",n.value),console.log("[ActionColumn][5] visibleButtons =",c.value),console.log("[ActionColumn][5] overflowButtons =",d.value);const r=a=>{if(a)return typeof a=="object"||typeof a=="function"?a:ct[a]},p=a=>{a?.currentTarget?.blur?.()};return{visibleButtons:c,overflowButtons:d,getIconComponent:r,handleClick:(a,C)=>{p(C),o("action-click",{code:a.code,button:a,row:t.row})},handleCommand:a=>{o("action-click",{code:a.code,button:a,row:t.row})},handleTriggerClick:a=>{p(a)}}}}),pt={class:"action-column"};function mt(t,o,n,i,c,d){const r=e.resolveComponent("el-button"),p=e.resolveComponent("ArrowDown"),g=e.resolveComponent("el-icon"),w=e.resolveComponent("el-dropdown-item"),f=e.resolveComponent("el-dropdown-menu"),a=e.resolveComponent("el-dropdown");return e.openBlock(),e.createElementBlock("div",pt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.visibleButtons,C=>(e.openBlock(),e.createBlock(r,{key:C.code,class:"action-btn",type:C.type||"",icon:t.getIconComponent(C.icon),size:"small",link:"",onMousedown:o[0]||(o[0]=e.withModifiers(()=>{},["prevent"])),onClick:s=>t.handleClick(C,s)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["type","icon","onClick"]))),128)),t.overflowButtons.length?(e.openBlock(),e.createBlock(a,{key:0,trigger:"hover",onCommand:t.handleCommand},{dropdown:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.overflowButtons,C=>(e.openBlock(),e.createBlock(w,{key:C.code,command:C,icon:t.getIconComponent(C.icon)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["command","icon"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createVNode(r,{class:"action-btn",type:"",size:"small",link:"",onMousedown:o[1]||(o[1]=e.withModifiers(()=>{},["prevent"])),onClick:t.handleTriggerClick},{default:e.withCtx(()=>[o[2]||(o[2]=e.createTextVNode(" 更多 ",-1)),e.createVNode(g,{class:"el-icon--right"},{default:e.withCtx(()=>[e.createVNode(p)]),_:1})]),_:1},8,["onClick"])]),_:1},8,["onCommand"])):e.createCommentVNode("",!0)])}const ft=P(dt,[["render",mt],["__scopeId","data-v-e1262cc7"]]),gt=e.defineComponent({name:"ZxtGrid",inheritAttrs:!1,components:{ZxtTable:z,ZxtForm:I,ActionColumn:ft,Plus:X,Delete:J,Refresh:H,Download:K,Search:j,Edit:Q,View:ee,Upload:v,Setting:Y},props:{gridOptions:{type:Object,default:()=>({id:"grid",columns:[],data:[],height:400,pageable:!0,pageSizes:[10,20,50,100],paginationLayout:"total, sizes, prev, pager, next, jumper",toolbar:null,formMode:!1,formColumns:[],rules:{}})},externalData:{type:Array,default:()=>[]}},emits:["toolbar-click","action-click","submit","reset","page-change","size-change"],setup(t,{emit:o,expose:n}){const i=e.useAttrs(),c=e.useSlots(),d=e.ref(null),r=e.ref(null),p=e.ref(1),g=e.ref(10),w=e.ref(null),f=e.ref(t.gridOptions.formMode!==!1),a=e.ref({...t.gridOptions.formConfig?.data||{}}),C={Plus:X,Delete:J,Refresh:H,Download:K,Search:j,Edit:Q,View:ee,Upload:v,Setting:Y},s=e.computed(()=>{const l=t.gridOptions.columns||[];console.log("cols",t.gridOptions.columns);const u=l.find(_=>_.actionColumn);return u?u.actionColumn:null}),h=e.computed(()=>(t.gridOptions.columns||[]).map(u=>u.actionColumn?{...u,slot:"zxtActionInternal",actionColumn:void 0}:u));console.log("[ZxtGrid][1] source columns =",t.gridOptions.columns),console.log("[ZxtGrid][1] source action col =",(t.gridOptions.columns||[]).find(l=>l?.actionColumn)),console.log("[ZxtGrid][2] mergedColumns =",h.value),console.log("[ZxtGrid][2] merged action slot col =",h.value.find(l=>l?.slot==="zxtActionInternal")),console.log("[ZxtGrid][3] actionColumnConfig =",s.value),console.log("[ZxtGrid][3] buttons =",s.value?.buttons,"len=",s.value?.buttons?.length);const E=l=>{o("action-click",l)},O=e.computed(()=>{const l=t.gridOptions.formConfig;if(!l||!l.items)return[];const u=[...l.items];return u.some($=>$.type==="slot"&&$.slotName==="search-actions")||u.push({type:"slot",slotName:"search-actions",span:6,labelWidth:"0px",isAction:!0,...l.actionConfig}),u}),B=e.computed(()=>{const l=new Set(["search-actions"]);return(O.value||[]).forEach(u=>{u.type==="slot"&&l.add(u.slotName||u.prop)}),l}),F=e.computed(()=>{const l={};for(const u in c)u==="search-actions"||u==="toolbar"||(B.value.has(u)||u.startsWith("form-"))&&(l[u]=c[u]);return l}),oe=e.computed(()=>{const l={};for(const u in c)u!=="toolbar"&&!B.value.has(u)&&!u.startsWith("form-")&&(l[u]=c[u]);return l}),ne=()=>{r.value?.submitForm()},ae=l=>{o("submit",l),t.gridOptions.proxyConfig&&(a.value={...l},p.value=1,d.value?.reload?.({formData:a.value,page:1}))},x=()=>{r.value?.resetForm()},q=()=>{o("reset"),t.gridOptions.proxyConfig&&(a.value={},p.value=1,d.value?.reload?.({formData:{},page:1}))},le=l=>{if(l)return typeof l=="object"||typeof l=="function"?l:C[l]},re=e.computed(()=>{const l=t.gridOptions.proxyConfig;return l?{...l,_formData:a.value}:null}),se=e.computed(()=>{const{formConfig:l,toolbar:u,formMode:_,formColumns:$,rules:U,data:ge,proxyConfig:_t,...zt}=t.gridOptions;return{...zt,proxyConfig:re.value||_t||null}}),G=e.computed(()=>w.value!==null?w.value:t.externalData.length>0?t.externalData:t.gridOptions.data||[]),ie=e.computed(()=>!!t.gridOptions.proxyConfig),m=e.computed(()=>ie.value?0:G.value.length),k=(l,u)=>{o("toolbar-click",{code:l,button:u,grid:d.value})},D=l=>{p.value=l.page,o("page-change",l)},A=l=>{g.value=l.size,o("size-change",l)},ce=()=>d.value,de=()=>r.value,pe=()=>d.value?.getTableRef()?.getSelectionRows?.()||[],me=l=>{w.value=l??null},fe=l=>{f.value=l},R=(l,u=!0)=>{const _=t.gridOptions.formConfig;_?.data&&Object.assign(_.data,l),a.value={..._?.data||{},...l},u&&t.gridOptions.proxyConfig&&(p.value=1,d.value?.reload?.({formData:a.value,page:1}))},S=(l,...u)=>{const _=a.value;switch(l){case"query":p.value=1,d.value?.reload?.({formData:_,page:1});break;case"reload":d.value?.reload?.({formData:_});break;default:console.warn(`[ZxtGrid] commitProxy: unknown type "${l}"`)}};e.watch(()=>t.gridOptions.formMode,l=>{l!==void 0&&(f.value=l)}),e.onMounted(()=>{t.gridOptions.proxyConfig&&t.gridOptions.autoLoad!==!1&&d.value?.reload?.({formData:a.value,page:1})});const b=()=>d.value?.getTableRef?.();return n({getGridRef:ce,getFormRef:de,getElTableRef:b,getSelectedRows:pe,reloadData:me,setFormVisible:fe,setFormData:R,commitProxy:S,clearSelection:()=>b()?.clearSelection(),toggleRowSelection:(...l)=>b()?.toggleRowSelection(...l),toggleAllSelection:()=>b()?.toggleAllSelection(),toggleRowExpansion:(...l)=>b()?.toggleRowExpansion(...l),setCurrentRow:(...l)=>b()?.setCurrentRow(...l),clearSort:()=>b()?.clearSort(),clearFilter:(...l)=>b()?.clearFilter(...l),doLayout:()=>b()?.doLayout(),sort:(...l)=>b()?.sort(...l)}),{attrs:i,gridRef:d,searchFormRef:r,currentPage:p,pageSize:g,tableData:G,tableProps:se,mergedColumns:h,actionColumnConfig:s,total:m,isFormVisible:f,searchFormColumns:O,formFilteredSlots:F,tableFilteredSlots:oe,getIconComponent:le,handleToolbarClick:k,handleActionClick:E,handlePageChange:D,handleSizeChange:A,handleSearch:ne,handleSearchSubmit:ae,handleReset:x,handleSearchReset:q,Search:j,Refresh:H}}}),ut={key:0,class:"grid-search-form"},ht={class:"search-btn-group"},Ct={class:"grid-table-wrapper"},wt={key:0,class:"grid-toolbar"};function kt(t,o,n,i,c,d){const r=e.resolveComponent("el-button"),p=e.resolveComponent("ZxtForm"),g=e.resolveComponent("ActionColumn"),w=e.resolveComponent("ZxtTable");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["zxt-grid-container",{"zxt-grid-container--full":t.gridOptions.height==="full"}])},[t.gridOptions.formConfig&&t.isFormVisible?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(p,{ref:"searchFormRef","form-columns":t.searchFormColumns,"initial-form-data":t.gridOptions.formConfig.data,rules:t.gridOptions.formConfig.rules,onSubmit:t.handleSearchSubmit,onReset:t.handleSearchReset},e.createSlots({"search-actions":e.withCtx(()=>[e.createElementVNode("div",ht,[e.createVNode(r,{class:"btn-search",icon:t.Search,onClick:t.handleSearch},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createTextVNode(" 查询 ",-1)])]),_:1},8,["icon","onClick"]),e.createVNode(r,{class:"btn-reset",icon:t.Refresh,onClick:t.handleReset},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["icon","onClick"])])]),_:2},[e.renderList(t.formFilteredSlots,(f,a)=>({name:a,fn:e.withCtx(C=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(C)),void 0,!0)])}))]),1032,["form-columns","initial-form-data","rules","onSubmit","onReset"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ct,[t.gridOptions.toolbar?(e.openBlock(),e.createElementBlock("div",wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.gridOptions.toolbar.buttons,(f,a)=>(e.openBlock(),e.createBlock(r,{key:a,type:f.type||"default",size:f.size||"small",icon:t.getIconComponent(f.icon),disabled:f.disabled,onClick:C=>t.handleToolbarClick(f.code,f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.name),1)]),_:2},1032,["type","size","icon","disabled","onClick"]))),128)),e.renderSlot(t.$slots,"toolbar",{grid:t.$refs.gridRef},void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(w,e.mergeProps({ref:"gridRef"},{...t.tableProps,...t.attrs},{id:t.gridOptions.id,columns:t.mergedColumns,data:t.tableData,height:t.gridOptions.height,"auto-load":!1,pageable:t.gridOptions.pageable!==!1,"current-page":t.currentPage,"page-size":t.pageSize,"page-sizes":t.gridOptions.pageSizes,total:t.total,"pagination-layout":t.gridOptions.paginationLayout,onPageChange:t.handlePageChange,onSizeChange:t.handleSizeChange}),e.createSlots({_:2},[t.actionColumnConfig?{name:"zxtActionInternal",fn:e.withCtx(({row:f})=>[e.createVNode(g,{buttons:t.actionColumnConfig.buttons,row:f,"max-visible":t.actionColumnConfig.maxVisible||2,onActionClick:t.handleActionClick},null,8,["buttons","row","max-visible","onActionClick"])]),key:"0"}:void 0,e.renderList(t.tableFilteredSlots,(f,a)=>({name:a,fn:e.withCtx(C=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(C)),void 0,!0)])}))]),1040,["id","columns","data","height","pageable","current-page","page-size","page-sizes","total","pagination-layout","onPageChange","onSizeChange"])])],2)}const te=P(gt,[["render",kt],["__scopeId","data-v-25a21d5d"]]);N.install=function(t){t.component(N.name,N)};const yt=[L,M,z,te,I,N],bt={install:t=>{yt.forEach(o=>{t.component(o.name,o)})},MyButton:L,JsxButton:M,ZxtTable:z,ZxtGrid:te,ZxtForm:I,ZxtPagination:N,renderer:z.renderer,registerRenderer:z.registerRenderer};y.JsxButton=M,y.MyButton=L,y.ZxtForm=I,y.ZxtGrid=te,y.ZxtPagination=N,y.ZxtTable=z,y.default=bt,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|