zxt-table 0.6.6 → 0.6.7
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 +124 -118
- 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-cfbfc1e6]{width:100%}.zxt-table-container--full[data-v-cfbfc1e6]{display:flex;flex-direction:column;height:100%}.zxt-table-container--full[data-v-cfbfc1e6] .el-table{flex:1;min-height:0}.zxt-table-container--full[data-v-cfbfc1e6] .el-table__inner-wrapper{height:100%;display:flex;flex-direction:column}.zxt-table-container--full[data-v-cfbfc1e6] .el-table__body-wrapper{flex:1;overflow:auto}.zxt-table-container--full[data-v-cfbfc1e6] .el-table__empty-block{height:100%}[data-v-cfbfc1e6] .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-cfbfc1e6] .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-cfbfc1e6] .el-table td.el-table__cell{padding:8px 0}[data-v-cfbfc1e6] .el-table .cell{line-height:24px;padding:0 12px}[data-v-cfbfc1e6] .el-link.el-link--default,[data-v-cfbfc1e6] .el-link.el-link--primary{--el-link-text-color: #409eff;color:#409eff;font-weight:400}[data-v-cfbfc1e6] .el-link:hover{color:#66b1ff;text-decoration:none}[data-v-cfbfc1e6] .el-button--primary.is-link,[data-v-cfbfc1e6] .el-button--primary.is-text{color:#409eff}[data-v-cfbfc1e6] .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background-color:#fafafa}[data-v-cfbfc1e6] .el-table .el-tag{border-radius:4px;height:24px;line-height:22px;padding:0 8px}[data-v-cfbfc1e6] .el-table__expand-icon{outline:none;border:none}[data-v-cfbfc1e6] .el-table__expand-icon:focus,[data-v-cfbfc1e6] .el-table__expand-icon:focus-visible{outline:none;box-shadow:none;border:none}[data-v-cfbfc1e6] .el-table__expand-icon .el-icon{outline:none}[data-v-cfbfc1e6] .el-table__expand-icon .el-icon:focus,[data-v-cfbfc1e6] .el-table__expand-icon .el-icon:focus-visible{outline:none;box-shadow:none}.zxt-table-footer[data-v-cfbfc1e6]{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-
|
|
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-cfbfc1e6]{width:100%}.zxt-table-container--full[data-v-cfbfc1e6]{display:flex;flex-direction:column;height:100%}.zxt-table-container--full[data-v-cfbfc1e6] .el-table{flex:1;min-height:0}.zxt-table-container--full[data-v-cfbfc1e6] .el-table__inner-wrapper{height:100%;display:flex;flex-direction:column}.zxt-table-container--full[data-v-cfbfc1e6] .el-table__body-wrapper{flex:1;overflow:auto}.zxt-table-container--full[data-v-cfbfc1e6] .el-table__empty-block{height:100%}[data-v-cfbfc1e6] .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-cfbfc1e6] .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-cfbfc1e6] .el-table td.el-table__cell{padding:8px 0}[data-v-cfbfc1e6] .el-table .cell{line-height:24px;padding:0 12px}[data-v-cfbfc1e6] .el-link.el-link--default,[data-v-cfbfc1e6] .el-link.el-link--primary{--el-link-text-color: #409eff;color:#409eff;font-weight:400}[data-v-cfbfc1e6] .el-link:hover{color:#66b1ff;text-decoration:none}[data-v-cfbfc1e6] .el-button--primary.is-link,[data-v-cfbfc1e6] .el-button--primary.is-text{color:#409eff}[data-v-cfbfc1e6] .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background-color:#fafafa}[data-v-cfbfc1e6] .el-table .el-tag{border-radius:4px;height:24px;line-height:22px;padding:0 8px}[data-v-cfbfc1e6] .el-table__expand-icon{outline:none;border:none}[data-v-cfbfc1e6] .el-table__expand-icon:focus,[data-v-cfbfc1e6] .el-table__expand-icon:focus-visible{outline:none;box-shadow:none;border:none}[data-v-cfbfc1e6] .el-table__expand-icon .el-icon{outline:none}[data-v-cfbfc1e6] .el-table__expand-icon .el-icon:focus,[data-v-cfbfc1e6] .el-table__expand-icon .el-icon:focus-visible{outline:none;box-shadow:none}.zxt-table-footer[data-v-cfbfc1e6]{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-7de2fbab]{display:inline-flex;align-items:center;gap:4px;flex-wrap:nowrap}[data-v-7de2fbab] .action-column .action-btn.el-button:is(:focus,:focus-visible,:active){outline:none!important;outline-offset:0!important;box-shadow:none!important}[data-v-7de2fbab] .action-column .el-dropdown .el-tooltip__trigger:focus-visible{outline:none!important;outline-offset:0!important}.zxt-grid-action-column .action-btn.el-button.is-link{--el-button-outline-color: transparent}.zxt-grid-action-column .action-btn.el-button.is-link:is(:focus,:focus-visible,:active),.zxt-grid-action-column .zxt-grid-action-more.el-button.el-tooltip__trigger:is(:focus,:focus-visible,:active){outline:none!important;outline-offset:0!important;box-shadow:none!important;border-color:transparent!important}.zxt-grid-container[data-v-9b5f598e]{--zxt-primary-color: #fa2314;--zxt-primary-hover: #fb4f43;--zxt-primary-active: #e12012;width:100%}.zxt-grid-container--full[data-v-9b5f598e]{display:flex;flex-direction:column;height:100%}.zxt-grid-container--full .grid-table-wrapper[data-v-9b5f598e]{flex:1;display:flex;flex-direction:column;min-height:0}.zxt-grid-container--full .zxt-table-container[data-v-9b5f598e]{flex:1;min-height:0}.grid-search-form[data-v-9b5f598e]{padding:10px 10px 6px;border-radius:4px}.search-btn-group[data-v-9b5f598e]{display:flex;gap:10px}.grid-toolbar[data-v-9b5f598e]{margin-bottom:10px;padding:0 10px 10px;border-radius:4px;display:flex;gap:10px;align-items:center}.btn-search[data-v-9b5f598e]{background-color:#fff;border-color:var(--zxt-primary-color);color:var(--zxt-primary-color)}.btn-search[data-v-9b5f598e]:hover,.btn-search[data-v-9b5f598e]:focus,.btn-search[data-v-9b5f598e]:active{background-color:#fff}.btn-search[data-v-9b5f598e]:hover,.btn-search[data-v-9b5f598e]:focus{border-color:var(--zxt-primary-hover);color:var(--zxt-primary-hover);outline:none}.btn-search.el-button[data-v-9b5f598e]:focus,.btn-search.el-button[data-v-9b5f598e]:focus-visible{background-color:#fff;border-color:var(--zxt-primary-hover);color:var(--zxt-primary-hover);outline:none}.btn-search[data-v-9b5f598e]:active,.btn-search.el-button[data-v-9b5f598e]:active{background-color:#fff;border-color:var(--zxt-primary-active);color:var(--zxt-primary-active)}.btn-reset[data-v-9b5f598e]{background-color:#fff;border-color:#ddd;color:#111}.btn-reset[data-v-9b5f598e]:hover,.btn-reset[data-v-9b5f598e]:focus,.btn-reset[data-v-9b5f598e]:active{background-color:#fff}.btn-reset[data-v-9b5f598e]:focus,.btn-reset.el-button[data-v-9b5f598e]:focus,.btn-reset.el-button[data-v-9b5f598e]:focus-visible{border-color:#ddd;color:#111;outline:none}.btn-reset[data-v-9b5f598e]:hover,.btn-reset.el-button[data-v-9b5f598e]:hover{border-color:var(--zxt-primary-hover);color:var(--zxt-primary-hover)}.btn-reset[data-v-9b5f598e]:active,.btn-reset.el-button[data-v-9b5f598e]: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 g, openBlock as s, normalizeClass as ue, renderSlot as M, defineComponent as
|
|
1
|
+
import { createElementBlock as g, openBlock as s, normalizeClass as ue, renderSlot as M, defineComponent as _, createVNode as F, ref as k, watch as X, resolveComponent as S, createBlock as V, h as K, inject as Ie, computed as w, mergeProps as L, withCtx as y, Fragment as H, renderList as O, createSlots as Y, resolveDynamicComponent as _e, createTextVNode as j, toDisplayString as ee, useSlots as Be, provide as Ne, onMounted as Le, nextTick as xe, resolveDirective as Ue, normalizeStyle as qe, withDirectives as We, createCommentVNode as G, createElementVNode as b, reactive as Ge, toHandlers as Je, withModifiers as Ae, useAttrs as Ke, normalizeProps as Me, 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, ElIcon as lt, ElDropdownMenu as rt, ElDropdownItem as st, ElDropdown as it, ElButton as ut } from "element-plus";
|
|
3
3
|
const J = (e, t) => {
|
|
4
4
|
const n = e.__vccOpts || e;
|
|
@@ -40,7 +40,7 @@ const te = /* @__PURE__ */ J(dt, [["render", pt], ["__scopeId", "data-v-4480e77d
|
|
|
40
40
|
te.install = function(e) {
|
|
41
41
|
e.component(te.name, te);
|
|
42
42
|
};
|
|
43
|
-
const ae = /* @__PURE__ */
|
|
43
|
+
const ae = /* @__PURE__ */ _({
|
|
44
44
|
name: "JsxButton",
|
|
45
45
|
props: {
|
|
46
46
|
type: {
|
|
@@ -73,7 +73,7 @@ const ae = /* @__PURE__ */ b({
|
|
|
73
73
|
ae.install = function(e) {
|
|
74
74
|
e.component(ae.name, ae);
|
|
75
75
|
};
|
|
76
|
-
const ft =
|
|
76
|
+
const ft = _({
|
|
77
77
|
name: "ZxtPagination",
|
|
78
78
|
components: { ElPagination: Qe },
|
|
79
79
|
props: {
|
|
@@ -177,7 +177,7 @@ function gt(e, t) {
|
|
|
177
177
|
function ht(e, t) {
|
|
178
178
|
ne[e] && console.warn(`[ZxtTable] 内置渲染器 ${e} 已被覆盖`), ne[e] = t;
|
|
179
179
|
}
|
|
180
|
-
const vt =
|
|
180
|
+
const vt = _({
|
|
181
181
|
name: "ZxtTableColumn",
|
|
182
182
|
components: { ElTableColumn: nt },
|
|
183
183
|
props: {
|
|
@@ -234,7 +234,7 @@ function Ct(e, t, n, l, u, d) {
|
|
|
234
234
|
return e.normalizedColumn.children && e.normalizedColumn.children.length ? (s(), V(c, L({ key: 0 }, e.columnProps, {
|
|
235
235
|
key: e.normalizedColumn.prop + "-group"
|
|
236
236
|
}), {
|
|
237
|
-
default:
|
|
237
|
+
default: y(() => [
|
|
238
238
|
(s(!0), g(H, null, O(e.normalizedColumn.children, (p, z) => (s(), V(r, {
|
|
239
239
|
key: z,
|
|
240
240
|
column: p,
|
|
@@ -243,7 +243,7 @@ function Ct(e, t, n, l, u, d) {
|
|
|
243
243
|
}, Y({ _: 2 }, [
|
|
244
244
|
O(e.$slots, (f, i) => ({
|
|
245
245
|
name: i,
|
|
246
|
-
fn:
|
|
246
|
+
fn: y((C) => [
|
|
247
247
|
M(e.$slots, i, L({ ref_for: !0 }, C))
|
|
248
248
|
])
|
|
249
249
|
}))
|
|
@@ -256,20 +256,20 @@ function Ct(e, t, n, l, u, d) {
|
|
|
256
256
|
}), Y({ _: 2 }, [
|
|
257
257
|
e.normalizedColumn.headerSlot ? {
|
|
258
258
|
name: "header",
|
|
259
|
-
fn:
|
|
259
|
+
fn: y((p) => [
|
|
260
260
|
M(e.$slots, e.normalizedColumn.headerSlot, L({ column: e.normalizedColumn }, p))
|
|
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: y((p) => [
|
|
267
267
|
e.normalizedColumn.slot ? M(e.$slots, e.normalizedColumn.slot, {
|
|
268
268
|
key: 0,
|
|
269
269
|
row: p.row,
|
|
270
270
|
index: p.$index,
|
|
271
271
|
column: e.normalizedColumn
|
|
272
|
-
}) : e.normalizedColumn.cellRender ? (s(), V(
|
|
272
|
+
}) : e.normalizedColumn.cellRender ? (s(), V(_e(e.renderCell(p)), { key: 1 })) : e.normalizedColumn.formatter ? (s(), g(H, { key: 2 }, [
|
|
273
273
|
j(ee(e.normalizedColumn.formatter(
|
|
274
274
|
p.row,
|
|
275
275
|
e.normalizedColumn,
|
|
@@ -284,7 +284,7 @@ function Ct(e, t, n, l, u, d) {
|
|
|
284
284
|
} : void 0
|
|
285
285
|
]), 1040, ["index"]));
|
|
286
286
|
}
|
|
287
|
-
const wt = /* @__PURE__ */ J(vt, [["render", Ct]]),
|
|
287
|
+
const wt = /* @__PURE__ */ J(vt, [["render", Ct]]), yt = /* @__PURE__ */ new Set(["append", "empty"]), bt = _({
|
|
288
288
|
name: "ZxtTable",
|
|
289
289
|
inheritAttrs: !1,
|
|
290
290
|
components: { ZxtPagination: Q, ZxtTableColumn: wt, ElTable: ot },
|
|
@@ -344,7 +344,7 @@ const wt = /* @__PURE__ */ J(vt, [["render", Ct]]), _t = /* @__PURE__ */ new Set
|
|
|
344
344
|
return e.height;
|
|
345
345
|
}), v = w(() => !!e.proxyConfig), R = w(() => v.value ? p.value : e.total > 0 ? e.total : e.data.length), B = w(
|
|
346
346
|
() => v.value ? c.value : e.data
|
|
347
|
-
),
|
|
347
|
+
), T = () => {
|
|
348
348
|
xe(() => {
|
|
349
349
|
const m = l.value?.$el?.querySelector(
|
|
350
350
|
".el-table__body-wrapper .el-scrollbar__wrap"
|
|
@@ -352,9 +352,9 @@ const wt = /* @__PURE__ */ J(vt, [["render", Ct]]), _t = /* @__PURE__ */ new Set
|
|
|
352
352
|
m && (typeof m.scrollTo == "function" ? m.scrollTo({ top: 0, left: 0 }) : (m.scrollTop = 0, m.scrollLeft = 0));
|
|
353
353
|
});
|
|
354
354
|
}, I = (m) => {
|
|
355
|
-
v.value && (d.value = m.page, u.value = m.size, E()),
|
|
355
|
+
v.value && (d.value = m.page, u.value = m.size, E()), T(), t("size-change", m);
|
|
356
356
|
}, de = (m) => {
|
|
357
|
-
v.value && (d.value = m.page, u.value = m.size, E()),
|
|
357
|
+
v.value && (d.value = m.page, u.value = m.size, E()), T(), t("page-change", m);
|
|
358
358
|
}, ce = ({ column: m, prop: $, order: N }) => {
|
|
359
359
|
z.value = { prop: $, order: N }, v.value && E(), t("sort-change", { column: m, prop: $, order: N });
|
|
360
360
|
}, pe = (m) => {
|
|
@@ -367,29 +367,29 @@ const wt = /* @__PURE__ */ J(vt, [["render", Ct]]), _t = /* @__PURE__ */ new Set
|
|
|
367
367
|
U.sizeField;
|
|
368
368
|
const ve = U.sortField || "sort", Ce = U.orderField || "order", we = U.filtersField || "filters";
|
|
369
369
|
m?.formData !== void 0 ? i.value = m.formData : $._formData && (i.value = $._formData);
|
|
370
|
-
const
|
|
370
|
+
const ye = $.params || {}, q = {
|
|
371
371
|
[he]: {
|
|
372
372
|
currentPage: m?.page ?? d.value,
|
|
373
373
|
pageSize: m?.pageSize ?? u.value
|
|
374
374
|
},
|
|
375
375
|
form: i.value,
|
|
376
|
-
...
|
|
376
|
+
...ye
|
|
377
377
|
};
|
|
378
378
|
z.value?.prop && (q[ve] = z.value.prop, q[Ce] = z.value.order), f.value && Object.keys(f.value).length && (q[we] = f.value), r.value = !0;
|
|
379
379
|
try {
|
|
380
|
-
const
|
|
380
|
+
const A = await N(q), P = $.response || {}, o = P.listField || "list", h = P.totalField || "total", D = P.transform;
|
|
381
381
|
let Z = [], re = 0;
|
|
382
382
|
if (typeof D == "function") {
|
|
383
|
-
const
|
|
384
|
-
Z =
|
|
385
|
-
} else
|
|
383
|
+
const be = D(A);
|
|
384
|
+
Z = be?.list ?? [], re = be?.total ?? 0;
|
|
385
|
+
} else A && typeof A == "object" && (Z = A?.[o] ?? A?.data ?? [], re = A?.[h] ?? A?.total ?? 0);
|
|
386
386
|
c.value = Array.isArray(Z) ? Z : [], p.value = Number(re) || 0, t("loaded", {
|
|
387
387
|
data: c.value,
|
|
388
388
|
total: p.value,
|
|
389
389
|
payload: q
|
|
390
390
|
});
|
|
391
|
-
} catch (
|
|
392
|
-
t("load-error",
|
|
391
|
+
} catch (A) {
|
|
392
|
+
t("load-error", A);
|
|
393
393
|
} finally {
|
|
394
394
|
r.value = !1;
|
|
395
395
|
}
|
|
@@ -399,12 +399,12 @@ const wt = /* @__PURE__ */ J(vt, [["render", Ct]]), _t = /* @__PURE__ */ new Set
|
|
|
399
399
|
Ne("updateRow", oe), Le(() => {
|
|
400
400
|
v.value && e.autoLoad && E();
|
|
401
401
|
});
|
|
402
|
-
const fe = () => l.value, me = () => l.value?.getSelectionRows?.() || [], ge = (m) => E(m), le = () =>
|
|
402
|
+
const fe = () => l.value, me = () => l.value?.getSelectionRows?.() || [], ge = (m) => E(m), le = () => T();
|
|
403
403
|
return {
|
|
404
404
|
columnSlots: w(() => {
|
|
405
405
|
const m = {};
|
|
406
406
|
for (const $ in n)
|
|
407
|
-
|
|
407
|
+
yt.has($) || (m[$] = n[$]);
|
|
408
408
|
return m;
|
|
409
409
|
}),
|
|
410
410
|
tableRef: l,
|
|
@@ -428,7 +428,7 @@ const wt = /* @__PURE__ */ J(vt, [["render", Ct]]), _t = /* @__PURE__ */ new Set
|
|
|
428
428
|
resetScrollTop: le
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
|
-
}),
|
|
431
|
+
}), _t = {
|
|
432
432
|
key: 0,
|
|
433
433
|
class: "zxt-table-footer"
|
|
434
434
|
};
|
|
@@ -447,7 +447,7 @@ function zt(e, t, n, l, u, d) {
|
|
|
447
447
|
onSortChange: e.handleSortChange,
|
|
448
448
|
onFilterChange: e.handleFilterChange
|
|
449
449
|
}), Y({
|
|
450
|
-
default:
|
|
450
|
+
default: y(() => [
|
|
451
451
|
(s(!0), g(H, null, O(e.columns, (f, i) => (s(), V(r, {
|
|
452
452
|
key: i,
|
|
453
453
|
column: f,
|
|
@@ -456,7 +456,7 @@ function zt(e, t, n, l, u, d) {
|
|
|
456
456
|
}, Y({ _: 2 }, [
|
|
457
457
|
O(e.columnSlots, (C, a) => ({
|
|
458
458
|
name: a,
|
|
459
|
-
fn:
|
|
459
|
+
fn: y((v) => [
|
|
460
460
|
M(e.$slots, a, L({ ref_for: !0 }, v), void 0, !0)
|
|
461
461
|
])
|
|
462
462
|
}))
|
|
@@ -466,7 +466,7 @@ function zt(e, t, n, l, u, d) {
|
|
|
466
466
|
}, [
|
|
467
467
|
e.$slots.empty ? {
|
|
468
468
|
name: "empty",
|
|
469
|
-
fn:
|
|
469
|
+
fn: y(() => [
|
|
470
470
|
M(e.$slots, "empty", {}, void 0, !0)
|
|
471
471
|
]),
|
|
472
472
|
key: "0"
|
|
@@ -474,7 +474,7 @@ function zt(e, t, n, l, u, d) {
|
|
|
474
474
|
]), 1040, ["data", "height", "id", "onSortChange", "onFilterChange"])), [
|
|
475
475
|
[z, e.loading]
|
|
476
476
|
]),
|
|
477
|
-
e.$slots.append ? (s(), g("div",
|
|
477
|
+
e.$slots.append ? (s(), g("div", _t, [
|
|
478
478
|
M(e.$slots, "append", {}, void 0, !0)
|
|
479
479
|
])) : G("", !0),
|
|
480
480
|
e.pageable ? (s(), V(p, {
|
|
@@ -490,7 +490,7 @@ function zt(e, t, n, l, u, d) {
|
|
|
490
490
|
}, null, 8, ["model-value", "page-size", "page-sizes", "total", "layout", "onPageChange", "onSizeChange"])) : G("", !0)
|
|
491
491
|
], 6);
|
|
492
492
|
}
|
|
493
|
-
const x = /* @__PURE__ */ J(
|
|
493
|
+
const x = /* @__PURE__ */ J(bt, [["render", zt], ["__scopeId", "data-v-cfbfc1e6"]]), W = /* @__PURE__ */ new Map();
|
|
494
494
|
class St {
|
|
495
495
|
/**
|
|
496
496
|
* 注册自定义渲染器
|
|
@@ -572,7 +572,7 @@ x.install = function(e) {
|
|
|
572
572
|
};
|
|
573
573
|
x.registerRenderer = ht;
|
|
574
574
|
x.renderer = ze;
|
|
575
|
-
var $t = /* @__PURE__ */
|
|
575
|
+
var $t = /* @__PURE__ */ _({
|
|
576
576
|
name: "ArrowDown",
|
|
577
577
|
__name: "arrow-down",
|
|
578
578
|
setup(e) {
|
|
@@ -580,13 +580,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
580
580
|
xmlns: "http://www.w3.org/2000/svg",
|
|
581
581
|
viewBox: "0 0 1024 1024"
|
|
582
582
|
}, [
|
|
583
|
-
|
|
583
|
+
b("path", {
|
|
584
584
|
fill: "currentColor",
|
|
585
585
|
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"
|
|
586
586
|
})
|
|
587
587
|
]));
|
|
588
588
|
}
|
|
589
|
-
}), He = $t, Vt = /* @__PURE__ */
|
|
589
|
+
}), He = $t, Vt = /* @__PURE__ */ _({
|
|
590
590
|
name: "Check",
|
|
591
591
|
__name: "check",
|
|
592
592
|
setup(e) {
|
|
@@ -594,13 +594,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
594
594
|
xmlns: "http://www.w3.org/2000/svg",
|
|
595
595
|
viewBox: "0 0 1024 1024"
|
|
596
596
|
}, [
|
|
597
|
-
|
|
597
|
+
b("path", {
|
|
598
598
|
fill: "currentColor",
|
|
599
599
|
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"
|
|
600
600
|
})
|
|
601
601
|
]));
|
|
602
602
|
}
|
|
603
|
-
}), Pt = Vt, Dt = /* @__PURE__ */
|
|
603
|
+
}), Pt = Vt, Dt = /* @__PURE__ */ _({
|
|
604
604
|
name: "Close",
|
|
605
605
|
__name: "close",
|
|
606
606
|
setup(e) {
|
|
@@ -608,13 +608,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
608
608
|
xmlns: "http://www.w3.org/2000/svg",
|
|
609
609
|
viewBox: "0 0 1024 1024"
|
|
610
610
|
}, [
|
|
611
|
-
|
|
611
|
+
b("path", {
|
|
612
612
|
fill: "currentColor",
|
|
613
613
|
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"
|
|
614
614
|
})
|
|
615
615
|
]));
|
|
616
616
|
}
|
|
617
|
-
}), Ft = Dt, Rt = /* @__PURE__ */
|
|
617
|
+
}), Ft = Dt, Rt = /* @__PURE__ */ _({
|
|
618
618
|
name: "CopyDocument",
|
|
619
619
|
__name: "copy-document",
|
|
620
620
|
setup(e) {
|
|
@@ -622,17 +622,17 @@ var $t = /* @__PURE__ */ b({
|
|
|
622
622
|
xmlns: "http://www.w3.org/2000/svg",
|
|
623
623
|
viewBox: "0 0 1024 1024"
|
|
624
624
|
}, [
|
|
625
|
-
|
|
625
|
+
b("path", {
|
|
626
626
|
fill: "currentColor",
|
|
627
627
|
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"
|
|
628
628
|
}),
|
|
629
|
-
|
|
629
|
+
b("path", {
|
|
630
630
|
fill: "currentColor",
|
|
631
631
|
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"
|
|
632
632
|
})
|
|
633
633
|
]));
|
|
634
634
|
}
|
|
635
|
-
}),
|
|
635
|
+
}), Tt = Rt, At = /* @__PURE__ */ _({
|
|
636
636
|
name: "Delete",
|
|
637
637
|
__name: "delete",
|
|
638
638
|
setup(e) {
|
|
@@ -640,13 +640,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
640
640
|
xmlns: "http://www.w3.org/2000/svg",
|
|
641
641
|
viewBox: "0 0 1024 1024"
|
|
642
642
|
}, [
|
|
643
|
-
|
|
643
|
+
b("path", {
|
|
644
644
|
fill: "currentColor",
|
|
645
645
|
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"
|
|
646
646
|
})
|
|
647
647
|
]));
|
|
648
648
|
}
|
|
649
|
-
}), Se =
|
|
649
|
+
}), Se = At, Mt = /* @__PURE__ */ _({
|
|
650
650
|
name: "Document",
|
|
651
651
|
__name: "document",
|
|
652
652
|
setup(e) {
|
|
@@ -654,13 +654,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
654
654
|
xmlns: "http://www.w3.org/2000/svg",
|
|
655
655
|
viewBox: "0 0 1024 1024"
|
|
656
656
|
}, [
|
|
657
|
-
|
|
657
|
+
b("path", {
|
|
658
658
|
fill: "currentColor",
|
|
659
659
|
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"
|
|
660
660
|
})
|
|
661
661
|
]));
|
|
662
662
|
}
|
|
663
|
-
}), Ot = Mt, Bt = /* @__PURE__ */
|
|
663
|
+
}), Ot = Mt, Bt = /* @__PURE__ */ _({
|
|
664
664
|
name: "Download",
|
|
665
665
|
__name: "download",
|
|
666
666
|
setup(e) {
|
|
@@ -668,13 +668,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
668
668
|
xmlns: "http://www.w3.org/2000/svg",
|
|
669
669
|
viewBox: "0 0 1024 1024"
|
|
670
670
|
}, [
|
|
671
|
-
|
|
671
|
+
b("path", {
|
|
672
672
|
fill: "currentColor",
|
|
673
673
|
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"
|
|
674
674
|
})
|
|
675
675
|
]));
|
|
676
676
|
}
|
|
677
|
-
}), ke = Bt, Lt = /* @__PURE__ */
|
|
677
|
+
}), ke = Bt, Lt = /* @__PURE__ */ _({
|
|
678
678
|
name: "Edit",
|
|
679
679
|
__name: "edit",
|
|
680
680
|
setup(e) {
|
|
@@ -682,17 +682,17 @@ var $t = /* @__PURE__ */ b({
|
|
|
682
682
|
xmlns: "http://www.w3.org/2000/svg",
|
|
683
683
|
viewBox: "0 0 1024 1024"
|
|
684
684
|
}, [
|
|
685
|
-
|
|
685
|
+
b("path", {
|
|
686
686
|
fill: "currentColor",
|
|
687
687
|
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"
|
|
688
688
|
}),
|
|
689
|
-
|
|
689
|
+
b("path", {
|
|
690
690
|
fill: "currentColor",
|
|
691
691
|
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"
|
|
692
692
|
})
|
|
693
693
|
]));
|
|
694
694
|
}
|
|
695
|
-
}), $e = Lt, xt = /* @__PURE__ */
|
|
695
|
+
}), $e = Lt, xt = /* @__PURE__ */ _({
|
|
696
696
|
name: "Lock",
|
|
697
697
|
__name: "lock",
|
|
698
698
|
setup(e) {
|
|
@@ -700,17 +700,17 @@ var $t = /* @__PURE__ */ b({
|
|
|
700
700
|
xmlns: "http://www.w3.org/2000/svg",
|
|
701
701
|
viewBox: "0 0 1024 1024"
|
|
702
702
|
}, [
|
|
703
|
-
|
|
703
|
+
b("path", {
|
|
704
704
|
fill: "currentColor",
|
|
705
705
|
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"
|
|
706
706
|
}),
|
|
707
|
-
|
|
707
|
+
b("path", {
|
|
708
708
|
fill: "currentColor",
|
|
709
709
|
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"
|
|
710
710
|
})
|
|
711
711
|
]));
|
|
712
712
|
}
|
|
713
|
-
}), Ht = xt, Et = /* @__PURE__ */
|
|
713
|
+
}), Ht = xt, Et = /* @__PURE__ */ _({
|
|
714
714
|
name: "Plus",
|
|
715
715
|
__name: "plus",
|
|
716
716
|
setup(e) {
|
|
@@ -718,13 +718,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
718
718
|
xmlns: "http://www.w3.org/2000/svg",
|
|
719
719
|
viewBox: "0 0 1024 1024"
|
|
720
720
|
}, [
|
|
721
|
-
|
|
721
|
+
b("path", {
|
|
722
722
|
fill: "currentColor",
|
|
723
723
|
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"
|
|
724
724
|
})
|
|
725
725
|
]));
|
|
726
726
|
}
|
|
727
|
-
}), Ve = Et, Zt = /* @__PURE__ */
|
|
727
|
+
}), Ve = Et, Zt = /* @__PURE__ */ _({
|
|
728
728
|
name: "Refresh",
|
|
729
729
|
__name: "refresh",
|
|
730
730
|
setup(e) {
|
|
@@ -732,13 +732,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
732
732
|
xmlns: "http://www.w3.org/2000/svg",
|
|
733
733
|
viewBox: "0 0 1024 1024"
|
|
734
734
|
}, [
|
|
735
|
-
|
|
735
|
+
b("path", {
|
|
736
736
|
fill: "currentColor",
|
|
737
737
|
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"
|
|
738
738
|
})
|
|
739
739
|
]));
|
|
740
740
|
}
|
|
741
|
-
}), se = Zt, jt = /* @__PURE__ */
|
|
741
|
+
}), se = Zt, jt = /* @__PURE__ */ _({
|
|
742
742
|
name: "Search",
|
|
743
743
|
__name: "search",
|
|
744
744
|
setup(e) {
|
|
@@ -746,13 +746,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
746
746
|
xmlns: "http://www.w3.org/2000/svg",
|
|
747
747
|
viewBox: "0 0 1024 1024"
|
|
748
748
|
}, [
|
|
749
|
-
|
|
749
|
+
b("path", {
|
|
750
750
|
fill: "currentColor",
|
|
751
751
|
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"
|
|
752
752
|
})
|
|
753
753
|
]));
|
|
754
754
|
}
|
|
755
|
-
}), ie = jt, It = /* @__PURE__ */
|
|
755
|
+
}), ie = jt, It = /* @__PURE__ */ _({
|
|
756
756
|
name: "Setting",
|
|
757
757
|
__name: "setting",
|
|
758
758
|
setup(e) {
|
|
@@ -760,13 +760,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
760
760
|
xmlns: "http://www.w3.org/2000/svg",
|
|
761
761
|
viewBox: "0 0 1024 1024"
|
|
762
762
|
}, [
|
|
763
|
-
|
|
763
|
+
b("path", {
|
|
764
764
|
fill: "currentColor",
|
|
765
765
|
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"
|
|
766
766
|
})
|
|
767
767
|
]));
|
|
768
768
|
}
|
|
769
|
-
}), Pe = It, Nt = /* @__PURE__ */
|
|
769
|
+
}), Pe = It, Nt = /* @__PURE__ */ _({
|
|
770
770
|
name: "Share",
|
|
771
771
|
__name: "share",
|
|
772
772
|
setup(e) {
|
|
@@ -774,13 +774,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
774
774
|
xmlns: "http://www.w3.org/2000/svg",
|
|
775
775
|
viewBox: "0 0 1024 1024"
|
|
776
776
|
}, [
|
|
777
|
-
|
|
777
|
+
b("path", {
|
|
778
778
|
fill: "currentColor",
|
|
779
779
|
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"
|
|
780
780
|
})
|
|
781
781
|
]));
|
|
782
782
|
}
|
|
783
|
-
}), Ut = Nt, qt = /* @__PURE__ */
|
|
783
|
+
}), Ut = Nt, qt = /* @__PURE__ */ _({
|
|
784
784
|
name: "Unlock",
|
|
785
785
|
__name: "unlock",
|
|
786
786
|
setup(e) {
|
|
@@ -788,17 +788,17 @@ var $t = /* @__PURE__ */ b({
|
|
|
788
788
|
xmlns: "http://www.w3.org/2000/svg",
|
|
789
789
|
viewBox: "0 0 1024 1024"
|
|
790
790
|
}, [
|
|
791
|
-
|
|
791
|
+
b("path", {
|
|
792
792
|
fill: "currentColor",
|
|
793
793
|
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"
|
|
794
794
|
}),
|
|
795
|
-
|
|
795
|
+
b("path", {
|
|
796
796
|
fill: "currentColor",
|
|
797
797
|
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"
|
|
798
798
|
})
|
|
799
799
|
]));
|
|
800
800
|
}
|
|
801
|
-
}), Wt = qt, Gt = /* @__PURE__ */
|
|
801
|
+
}), Wt = qt, Gt = /* @__PURE__ */ _({
|
|
802
802
|
name: "Upload",
|
|
803
803
|
__name: "upload",
|
|
804
804
|
setup(e) {
|
|
@@ -806,13 +806,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
806
806
|
xmlns: "http://www.w3.org/2000/svg",
|
|
807
807
|
viewBox: "0 0 1024 1024"
|
|
808
808
|
}, [
|
|
809
|
-
|
|
809
|
+
b("path", {
|
|
810
810
|
fill: "currentColor",
|
|
811
811
|
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"
|
|
812
812
|
})
|
|
813
813
|
]));
|
|
814
814
|
}
|
|
815
|
-
}), De = Gt, Jt = /* @__PURE__ */
|
|
815
|
+
}), De = Gt, Jt = /* @__PURE__ */ _({
|
|
816
816
|
name: "View",
|
|
817
817
|
__name: "view",
|
|
818
818
|
setup(e) {
|
|
@@ -820,13 +820,13 @@ var $t = /* @__PURE__ */ b({
|
|
|
820
820
|
xmlns: "http://www.w3.org/2000/svg",
|
|
821
821
|
viewBox: "0 0 1024 1024"
|
|
822
822
|
}, [
|
|
823
|
-
|
|
823
|
+
b("path", {
|
|
824
824
|
fill: "currentColor",
|
|
825
825
|
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"
|
|
826
826
|
})
|
|
827
827
|
]));
|
|
828
828
|
}
|
|
829
|
-
}), Fe = Jt, Kt = /* @__PURE__ */
|
|
829
|
+
}), Fe = Jt, Kt = /* @__PURE__ */ _({
|
|
830
830
|
name: "Warning",
|
|
831
831
|
__name: "warning",
|
|
832
832
|
setup(e) {
|
|
@@ -834,14 +834,14 @@ var $t = /* @__PURE__ */ b({
|
|
|
834
834
|
xmlns: "http://www.w3.org/2000/svg",
|
|
835
835
|
viewBox: "0 0 1024 1024"
|
|
836
836
|
}, [
|
|
837
|
-
|
|
837
|
+
b("path", {
|
|
838
838
|
fill: "currentColor",
|
|
839
839
|
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"
|
|
840
840
|
})
|
|
841
841
|
]));
|
|
842
842
|
}
|
|
843
843
|
}), Qt = Kt;
|
|
844
|
-
const Xt =
|
|
844
|
+
const Xt = _({
|
|
845
845
|
name: "ZxtForm",
|
|
846
846
|
inheritAttrs: !1,
|
|
847
847
|
props: {
|
|
@@ -874,13 +874,13 @@ const Xt = b({
|
|
|
874
874
|
style: "width: 100%",
|
|
875
875
|
"popper-class": "zxt-form-popper"
|
|
876
876
|
};
|
|
877
|
-
let
|
|
877
|
+
let T = {};
|
|
878
878
|
switch (v) {
|
|
879
879
|
case "date":
|
|
880
880
|
case "daterange":
|
|
881
881
|
case "datetime":
|
|
882
882
|
case "datetimerange":
|
|
883
|
-
|
|
883
|
+
T = {
|
|
884
884
|
type: a.dateType || v,
|
|
885
885
|
startPlaceholder: a.startPlaceholder || "开始日期",
|
|
886
886
|
endPlaceholder: a.endPlaceholder || "结束日期",
|
|
@@ -889,18 +889,18 @@ const Xt = b({
|
|
|
889
889
|
};
|
|
890
890
|
break;
|
|
891
891
|
case "cascader":
|
|
892
|
-
|
|
892
|
+
T = {
|
|
893
893
|
options: a.options,
|
|
894
894
|
props: a.cascaderProps,
|
|
895
895
|
clearable: a.clearable !== !1
|
|
896
896
|
};
|
|
897
897
|
break;
|
|
898
898
|
default:
|
|
899
|
-
|
|
899
|
+
T = {};
|
|
900
900
|
}
|
|
901
901
|
const I = {
|
|
902
902
|
...B,
|
|
903
|
-
...
|
|
903
|
+
...T
|
|
904
904
|
};
|
|
905
905
|
return "clearable" in a && (I.clearable = a.clearable), a.props && typeof a.props == "object" && Object.assign(I, a.props), I;
|
|
906
906
|
}, p = w(() => e.formColumns.map((a) => ({
|
|
@@ -981,33 +981,33 @@ function aa(e, t, n, l, u, d) {
|
|
|
981
981
|
"label-width": e.labelWidth,
|
|
982
982
|
class: "zxt-form"
|
|
983
983
|
}), {
|
|
984
|
-
default:
|
|
984
|
+
default: y(() => [
|
|
985
985
|
F(z, { gutter: 20 }, {
|
|
986
|
-
default:
|
|
986
|
+
default: y(() => [
|
|
987
987
|
(s(!0), g(H, null, O(e.processedColumns, (i, C) => (s(), V(p, L({ key: C }, { ref_for: !0 }, i.colSpan), {
|
|
988
|
-
default:
|
|
988
|
+
default: y(() => [
|
|
989
989
|
F(c, {
|
|
990
990
|
prop: i.prop,
|
|
991
991
|
required: i.required,
|
|
992
992
|
"label-width": "0",
|
|
993
993
|
class: "custom-form-item"
|
|
994
994
|
}, {
|
|
995
|
-
default:
|
|
996
|
-
|
|
995
|
+
default: y(() => [
|
|
996
|
+
b("div", {
|
|
997
997
|
class: ue(["form-item-wrapper", { "is-action": i.isAction }])
|
|
998
998
|
}, [
|
|
999
999
|
i.label ? (s(), g("span", ea, ee(i.label), 1)) : G("", !0),
|
|
1000
|
-
|
|
1000
|
+
b("div", ta, [
|
|
1001
1001
|
i.type === "slot" ? M(e.$slots, i.slotName || i.prop, {
|
|
1002
1002
|
key: 0,
|
|
1003
1003
|
formData: e.formData,
|
|
1004
1004
|
column: i
|
|
1005
|
-
}, void 0, !0) : i.itemRender ? (s(), V(
|
|
1005
|
+
}, void 0, !0) : i.itemRender ? (s(), V(_e(e.renderCustomItem(i)), { key: 1 })) : (s(), V(_e(e.getComponentType(i.type)), L({
|
|
1006
1006
|
key: 2,
|
|
1007
1007
|
modelValue: e.formData[i.prop],
|
|
1008
1008
|
"onUpdate:modelValue": (a) => e.formData[i.prop] = a
|
|
1009
1009
|
}, { ref_for: !0 }, e.getComponentProps(i), Je(i.events || {})), {
|
|
1010
|
-
default:
|
|
1010
|
+
default: y(() => [
|
|
1011
1011
|
i.type === "select" ? (s(!0), g(H, { key: 0 }, O(i.options, (a, v) => (s(), V(r, {
|
|
1012
1012
|
key: v,
|
|
1013
1013
|
label: a.label,
|
|
@@ -1046,12 +1046,12 @@ const Re = /* @__PURE__ */ J(Xt, [["render", aa], ["__scopeId", "data-v-6b22a57b
|
|
|
1046
1046
|
Check: Pt,
|
|
1047
1047
|
Close: Ft,
|
|
1048
1048
|
Document: Ot,
|
|
1049
|
-
CopyDocument:
|
|
1049
|
+
CopyDocument: Tt,
|
|
1050
1050
|
Share: Ut,
|
|
1051
1051
|
Lock: Ht,
|
|
1052
1052
|
Unlock: Wt,
|
|
1053
1053
|
ArrowDown: He
|
|
1054
|
-
}, oa =
|
|
1054
|
+
}, oa = _({
|
|
1055
1055
|
name: "ActionColumn",
|
|
1056
1056
|
components: {
|
|
1057
1057
|
ElButton: ut,
|
|
@@ -1073,6 +1073,11 @@ const Re = /* @__PURE__ */ J(Xt, [["render", aa], ["__scopeId", "data-v-6b22a57b
|
|
|
1073
1073
|
maxVisible: {
|
|
1074
1074
|
type: Number,
|
|
1075
1075
|
default: 2
|
|
1076
|
+
},
|
|
1077
|
+
/** 与 ButtonConfig.type 一致,控制「更多」链接按钮主题色;不传为默认灰色 */
|
|
1078
|
+
moreType: {
|
|
1079
|
+
type: String,
|
|
1080
|
+
default: ""
|
|
1076
1081
|
}
|
|
1077
1082
|
},
|
|
1078
1083
|
emits: ["action-click"],
|
|
@@ -1122,11 +1127,11 @@ function ra(e, t, n, l, u, d) {
|
|
|
1122
1127
|
icon: e.getIconComponent(C.icon),
|
|
1123
1128
|
size: "small",
|
|
1124
1129
|
link: "",
|
|
1125
|
-
onMousedown: t[0] || (t[0] =
|
|
1130
|
+
onMousedown: t[0] || (t[0] = Ae(() => {
|
|
1126
1131
|
}, ["prevent"])),
|
|
1127
1132
|
onClick: (a) => e.handleClick(C, a)
|
|
1128
1133
|
}, {
|
|
1129
|
-
default:
|
|
1134
|
+
default: y(() => [
|
|
1130
1135
|
j(ee(C.label), 1)
|
|
1131
1136
|
]),
|
|
1132
1137
|
_: 2
|
|
@@ -1137,15 +1142,15 @@ function ra(e, t, n, l, u, d) {
|
|
|
1137
1142
|
onCommand: e.handleCommand,
|
|
1138
1143
|
onVisibleChange: e.handleMoreDropdownVisible
|
|
1139
1144
|
}, {
|
|
1140
|
-
dropdown:
|
|
1145
|
+
dropdown: y(() => [
|
|
1141
1146
|
F(f, null, {
|
|
1142
|
-
default:
|
|
1147
|
+
default: y(() => [
|
|
1143
1148
|
(s(!0), g(H, null, O(e.overflowButtons, (C) => (s(), V(z, {
|
|
1144
1149
|
key: C.code,
|
|
1145
1150
|
command: C,
|
|
1146
1151
|
icon: e.getIconComponent(C.icon)
|
|
1147
1152
|
}, {
|
|
1148
|
-
default:
|
|
1153
|
+
default: y(() => [
|
|
1149
1154
|
j(ee(C.label), 1)
|
|
1150
1155
|
]),
|
|
1151
1156
|
_: 2
|
|
@@ -1154,34 +1159,34 @@ function ra(e, t, n, l, u, d) {
|
|
|
1154
1159
|
_: 1
|
|
1155
1160
|
})
|
|
1156
1161
|
]),
|
|
1157
|
-
default:
|
|
1162
|
+
default: y(() => [
|
|
1158
1163
|
F(r, {
|
|
1159
1164
|
ref: "moreTriggerRef",
|
|
1160
1165
|
class: "action-btn zxt-grid-action-more",
|
|
1161
|
-
type: "",
|
|
1166
|
+
type: e.moreType || "",
|
|
1162
1167
|
size: "small",
|
|
1163
1168
|
link: "",
|
|
1164
|
-
onMousedown: t[1] || (t[1] =
|
|
1169
|
+
onMousedown: t[1] || (t[1] = Ae(() => {
|
|
1165
1170
|
}, ["prevent"])),
|
|
1166
1171
|
onClick: e.handleTriggerClick
|
|
1167
1172
|
}, {
|
|
1168
|
-
default:
|
|
1173
|
+
default: y(() => [
|
|
1169
1174
|
t[2] || (t[2] = j(" 更多 ", -1)),
|
|
1170
1175
|
F(p, { class: "el-icon--right" }, {
|
|
1171
|
-
default:
|
|
1176
|
+
default: y(() => [
|
|
1172
1177
|
F(c)
|
|
1173
1178
|
]),
|
|
1174
1179
|
_: 1
|
|
1175
1180
|
})
|
|
1176
1181
|
]),
|
|
1177
1182
|
_: 1
|
|
1178
|
-
}, 8, ["onClick"])
|
|
1183
|
+
}, 8, ["type", "onClick"])
|
|
1179
1184
|
]),
|
|
1180
1185
|
_: 1
|
|
1181
1186
|
}, 8, ["onCommand", "onVisibleChange"])) : G("", !0)
|
|
1182
1187
|
]);
|
|
1183
1188
|
}
|
|
1184
|
-
const sa = /* @__PURE__ */ J(oa, [["render", ra], ["__scopeId", "data-v-
|
|
1189
|
+
const sa = /* @__PURE__ */ J(oa, [["render", ra], ["__scopeId", "data-v-7de2fbab"]]), ia = _({
|
|
1185
1190
|
name: "ZxtGrid",
|
|
1186
1191
|
inheritAttrs: !1,
|
|
1187
1192
|
components: {
|
|
@@ -1259,7 +1264,7 @@ const sa = /* @__PURE__ */ J(oa, [["render", ra], ["__scopeId", "data-v-514a225d
|
|
|
1259
1264
|
isAction: !0,
|
|
1260
1265
|
...o.actionConfig
|
|
1261
1266
|
}), h;
|
|
1262
|
-
}),
|
|
1267
|
+
}), T = w(() => {
|
|
1263
1268
|
const o = /* @__PURE__ */ new Set(["search-actions"]);
|
|
1264
1269
|
return (B.value || []).forEach((h) => {
|
|
1265
1270
|
h.type === "slot" && o.add(h.slotName || h.prop);
|
|
@@ -1267,12 +1272,12 @@ const sa = /* @__PURE__ */ J(oa, [["render", ra], ["__scopeId", "data-v-514a225d
|
|
|
1267
1272
|
}), I = w(() => {
|
|
1268
1273
|
const o = {};
|
|
1269
1274
|
for (const h in u)
|
|
1270
|
-
h === "search-actions" || h === "toolbar" || (
|
|
1275
|
+
h === "search-actions" || h === "toolbar" || (T.value.has(h) || h.startsWith("form-")) && (o[h] = u[h]);
|
|
1271
1276
|
return o;
|
|
1272
1277
|
}), de = w(() => {
|
|
1273
1278
|
const o = {};
|
|
1274
1279
|
for (const h in u)
|
|
1275
|
-
h !== "toolbar" && !
|
|
1280
|
+
h !== "toolbar" && !T.value.has(h) && !h.startsWith("form-") && (o[h] = u[h]);
|
|
1276
1281
|
return o;
|
|
1277
1282
|
}), ce = () => {
|
|
1278
1283
|
r.value?.submitForm();
|
|
@@ -1298,7 +1303,7 @@ const sa = /* @__PURE__ */ J(oa, [["render", ra], ["__scopeId", "data-v-514a225d
|
|
|
1298
1303
|
formMode: D,
|
|
1299
1304
|
formColumns: Z,
|
|
1300
1305
|
rules: re,
|
|
1301
|
-
data:
|
|
1306
|
+
data: be,
|
|
1302
1307
|
proxyConfig: Ze,
|
|
1303
1308
|
...je
|
|
1304
1309
|
} = e.gridOptions;
|
|
@@ -1306,7 +1311,7 @@ const sa = /* @__PURE__ */ J(oa, [["render", ra], ["__scopeId", "data-v-514a225d
|
|
|
1306
1311
|
...je,
|
|
1307
1312
|
proxyConfig: me.value || Ze || null
|
|
1308
1313
|
};
|
|
1309
|
-
}), le = w(() => z.value !== null ? z.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []),
|
|
1314
|
+
}), le = w(() => z.value !== null ? z.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []), Te = w(() => !!e.gridOptions.proxyConfig), m = w(() => Te.value ? 0 : le.value.length), $ = (o, h) => {
|
|
1310
1315
|
t("toolbar-click", { code: o, button: h, grid: d.value });
|
|
1311
1316
|
}, N = (o) => {
|
|
1312
1317
|
c.value = o.page, t("page-change", o);
|
|
@@ -1314,12 +1319,12 @@ const sa = /* @__PURE__ */ J(oa, [["render", ra], ["__scopeId", "data-v-514a225d
|
|
|
1314
1319
|
p.value = o.size, t("size-change", o);
|
|
1315
1320
|
}, he = () => d.value, ve = () => r.value, Ce = () => d.value?.getTableRef()?.getSelectionRows?.() || [], we = (o) => {
|
|
1316
1321
|
z.value = o ?? null;
|
|
1317
|
-
},
|
|
1322
|
+
}, ye = (o) => {
|
|
1318
1323
|
f.value = o;
|
|
1319
1324
|
}, q = (o, h = !0) => {
|
|
1320
1325
|
const D = e.gridOptions.formConfig;
|
|
1321
1326
|
D?.data && Object.assign(D.data, o), i.value = { ...D?.data || {}, ...o }, h && e.gridOptions.proxyConfig && (c.value = 1, d.value?.reload?.({ formData: i.value, page: 1 }));
|
|
1322
|
-
},
|
|
1327
|
+
}, A = (o, ...h) => {
|
|
1323
1328
|
const D = i.value;
|
|
1324
1329
|
switch (o) {
|
|
1325
1330
|
case "query":
|
|
@@ -1347,9 +1352,9 @@ const sa = /* @__PURE__ */ J(oa, [["render", ra], ["__scopeId", "data-v-514a225d
|
|
|
1347
1352
|
getElTableRef: P,
|
|
1348
1353
|
getSelectedRows: Ce,
|
|
1349
1354
|
reloadData: we,
|
|
1350
|
-
setFormVisible:
|
|
1355
|
+
setFormVisible: ye,
|
|
1351
1356
|
setFormData: q,
|
|
1352
|
-
commitProxy:
|
|
1357
|
+
commitProxy: A,
|
|
1353
1358
|
clearSelection: () => P()?.clearSelection(),
|
|
1354
1359
|
toggleRowSelection: (...o) => P()?.toggleRowSelection(...o),
|
|
1355
1360
|
toggleAllSelection: () => P()?.toggleAllSelection(),
|
|
@@ -1408,14 +1413,14 @@ function fa(e, t, n, l, u, d) {
|
|
|
1408
1413
|
onSubmit: e.handleSearchSubmit,
|
|
1409
1414
|
onReset: e.handleSearchReset
|
|
1410
1415
|
}, Y({
|
|
1411
|
-
"search-actions":
|
|
1412
|
-
|
|
1416
|
+
"search-actions": y(() => [
|
|
1417
|
+
b("div", da, [
|
|
1413
1418
|
F(r, {
|
|
1414
1419
|
class: "btn-search",
|
|
1415
1420
|
icon: e.Search,
|
|
1416
1421
|
onClick: e.handleSearch
|
|
1417
1422
|
}, {
|
|
1418
|
-
default:
|
|
1423
|
+
default: y(() => [...t[0] || (t[0] = [
|
|
1419
1424
|
j(" 查询 ", -1)
|
|
1420
1425
|
])]),
|
|
1421
1426
|
_: 1
|
|
@@ -1425,7 +1430,7 @@ function fa(e, t, n, l, u, d) {
|
|
|
1425
1430
|
icon: e.Refresh,
|
|
1426
1431
|
onClick: e.handleReset
|
|
1427
1432
|
}, {
|
|
1428
|
-
default:
|
|
1433
|
+
default: y(() => [...t[1] || (t[1] = [
|
|
1429
1434
|
j(" 重置 ", -1)
|
|
1430
1435
|
])]),
|
|
1431
1436
|
_: 1
|
|
@@ -1436,23 +1441,23 @@ function fa(e, t, n, l, u, d) {
|
|
|
1436
1441
|
}, [
|
|
1437
1442
|
O(e.formFilteredSlots, (f, i) => ({
|
|
1438
1443
|
name: i,
|
|
1439
|
-
fn:
|
|
1444
|
+
fn: y((C) => [
|
|
1440
1445
|
M(e.$slots, i, Me(Oe(C)), void 0, !0)
|
|
1441
1446
|
])
|
|
1442
1447
|
}))
|
|
1443
1448
|
]), 1032, ["form-columns", "initial-form-data", "rules", "onSubmit", "onReset"])
|
|
1444
1449
|
])) : G("", !0),
|
|
1445
|
-
|
|
1450
|
+
b("div", ca, [
|
|
1446
1451
|
e.gridOptions.toolbar ? (s(), g("div", pa, [
|
|
1447
1452
|
(s(!0), g(H, null, O(e.gridOptions.toolbar.buttons, (f, i) => (s(), V(r, {
|
|
1448
1453
|
key: i,
|
|
1449
1454
|
type: f.type || "default",
|
|
1450
|
-
size: f.size || "
|
|
1455
|
+
size: f.size || "default",
|
|
1451
1456
|
icon: e.getIconComponent(f.icon),
|
|
1452
1457
|
disabled: f.disabled,
|
|
1453
1458
|
onClick: (C) => e.handleToolbarClick(f.code, f)
|
|
1454
1459
|
}, {
|
|
1455
|
-
default:
|
|
1460
|
+
default: y(() => [
|
|
1456
1461
|
j(ee(f.name), 1)
|
|
1457
1462
|
]),
|
|
1458
1463
|
_: 2
|
|
@@ -1478,19 +1483,20 @@ function fa(e, t, n, l, u, d) {
|
|
|
1478
1483
|
}), Y({ _: 2 }, [
|
|
1479
1484
|
e.actionColumnConfig ? {
|
|
1480
1485
|
name: "zxtActionInternal",
|
|
1481
|
-
fn:
|
|
1486
|
+
fn: y(({ row: f }) => [
|
|
1482
1487
|
F(p, {
|
|
1483
1488
|
buttons: e.actionColumnConfig.buttons,
|
|
1484
1489
|
row: f,
|
|
1485
1490
|
"max-visible": e.actionColumnConfig.maxVisible || 2,
|
|
1491
|
+
"more-type": e.actionColumnConfig.moreType,
|
|
1486
1492
|
onActionClick: e.handleActionClick
|
|
1487
|
-
}, null, 8, ["buttons", "row", "max-visible", "onActionClick"])
|
|
1493
|
+
}, null, 8, ["buttons", "row", "max-visible", "more-type", "onActionClick"])
|
|
1488
1494
|
]),
|
|
1489
1495
|
key: "0"
|
|
1490
1496
|
} : void 0,
|
|
1491
1497
|
O(e.tableFilteredSlots, (f, i) => ({
|
|
1492
1498
|
name: i,
|
|
1493
|
-
fn:
|
|
1499
|
+
fn: y((C) => [
|
|
1494
1500
|
M(e.$slots, i, Me(Oe(C)), void 0, !0)
|
|
1495
1501
|
])
|
|
1496
1502
|
}))
|
|
@@ -1498,7 +1504,7 @@ function fa(e, t, n, l, u, d) {
|
|
|
1498
1504
|
])
|
|
1499
1505
|
], 2);
|
|
1500
1506
|
}
|
|
1501
|
-
const Ee = /* @__PURE__ */ J(ia, [["render", fa], ["__scopeId", "data-v-
|
|
1507
|
+
const Ee = /* @__PURE__ */ J(ia, [["render", fa], ["__scopeId", "data-v-9b5f598e"]]);
|
|
1502
1508
|
Q.install = function(e) {
|
|
1503
1509
|
e.component(Q.name, Q);
|
|
1504
1510
|
};
|
package/dist/zxt-table.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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,b){"use strict";const T=(t,o)=>{const a=t.__vccOpts||t;for(const[l,c]of o)a[l]=c;return a},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:l=>{o("click",l)}}}},Ce=["disabled"];function we(t,o,a,l,c,d){return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["my-button",[`my-button--${a.type}`,{"is-disabled":a.disabled}]]),disabled:a.disabled,onClick:o[0]||(o[0]=(...s)=>l.handleClick&&l.handleClick(...s))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],10,Ce)}const L=T(he,[["render",we],["__scopeId","data-v-4480e77d"]]);L.install=function(t){t.component(L.name,L)};const O=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:a}){const l=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:l},[a.default?.()])}});O.install=function(t){t.component(O.name,O)};const ke=e.defineComponent({name:"ZxtPagination",components:{ElPagination:b.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 a=e.ref(t.modelValue),l=e.ref(t.pageSize);return e.watch(()=>t.modelValue,s=>{a.value=s}),e.watch(()=>t.pageSize,s=>{l.value=s}),{currentPage:a,pageSize:l,handleSizeChange:s=>{l.value=s,a.value=1,o("update:pageSize",s),o("size-change",{page:a.value,size:s})},handleCurrentChange:s=>{a.value=s,o("update:modelValue",s),o("page-change",{page:s,size:l.value})}}}});function ye(t,o,a,l,c,d){const s=e.resolveComponent("el-pagination");return e.openBlock(),e.createBlock(s,{"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=T(ke,[["render",ye],["__scopeId","data-v-497aa44d"]]),Z={default:({cellValue:t})=>t??"",input:({cellValue:t,row:o,column:a,updateRow:l})=>e.h(b.ElInput,{modelValue:t,size:"small",onInput:c=>l({...o,[a.property]:c})}),select:({cellValue:t,row:o,column:a,updateRow:l,options:c=[]})=>e.h(b.ElSelect,{modelValue:t,size:"small",onChange:d=>l({...o,[a.property]:d})},()=>c.map(d=>e.h(b.ElOption,{label:d.label,value:d.value,key:d.value}))),checkbox:({cellValue:t,row:o,column:a,updateRow:l})=>e.h(b.ElCheckbox,{modelValue:!!t,onChange:c=>l({...o,[a.property]:c})}),link:({cellValue:t,href:o,target:a="_blank"})=>e.h(b.ElLink,{href:o,target:a},()=>t)};function _e(t,o){if(!t)return null;if(typeof t=="string"){const a=Z[t];return a?a(o):(console.warn(`[ZxtTable] 未找到内置渲染器: ${t}`),o.cellValue??"")}if(typeof t=="function")return t(o);if(typeof t=="object"&&!Array.isArray(t)){const{name:a,props:l={},attrs:c={},events:d={},content:s}=t;return typeof a=="string"&&Z[a]?Z[a]({...o,...l,...c,...d}):typeof a=="object"||typeof a=="function"?e.h(a,{...l,...c,...d},s):(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:b.ElTableColumn},props:{column:{type:Object,required:!0},currentPage:{type:Number,default:1},pageSize:{type:Number,default:10}},setup(t){const o=e.inject("updateRow",()=>{}),a=s=>{const{currentPage:p,pageSize:m}=t;return(p-1)*m+s+1},l=e.computed(()=>{const s=t.column;return{...s,prop:s.prop??s.field,label:s.label??s.title}}),c=e.computed(()=>{const{children:s,...p}=l.value;return p});return{normalizedColumn:l,columnProps:c,renderCell:s=>{const p=l.value,m=s.row[p.prop],w=m??p.defaultValue??"";return _e(p.cellRender,{row:s.row,column:p,rowIndex:s.$index,cellValue:w,updateRow:f=>o(f,s.$index)})},defaultIndexMethod:a}}});function Se(t,o,a,l,c,d){const s=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,(m,w)=>(e.openBlock(),e.createBlock(s,{key:w,column:m,"current-page":t.currentPage,"page-size":t.pageSize},e.createSlots({_:2},[e.renderList(t.$slots,(f,i)=>({name:i,fn:e.withCtx(C=>[e.renderSlot(t.$slots,i,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(m=>[e.renderSlot(t.$slots,t.normalizedColumn.headerSlot,e.mergeProps({column:t.normalizedColumn},m))]),key:"0"}:void 0,!["selection","index"].includes(t.normalizedColumn.type)&&(t.normalizedColumn.type!=="expand"||t.normalizedColumn.slot)?{name:"default",fn:e.withCtx(m=>[t.normalizedColumn.slot?e.renderSlot(t.$slots,t.normalizedColumn.slot,{key:0,row:m.row,index:m.$index,column:t.normalizedColumn}):t.normalizedColumn.cellRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderCell(m)),{key:1})):t.normalizedColumn.formatter?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.normalizedColumn.formatter(m.row,t.normalizedColumn,m.row[t.normalizedColumn.prop],m.$index)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(m.row[t.normalizedColumn.prop]),1)],64))]),key:"1"}:void 0]),1040,["index"]))}const Be=T(ze,[["render",Se]]),Ve=new Set(["append","empty"]),Ee=e.defineComponent({name:"ZxtTable",inheritAttrs:!1,components:{ZxtPagination:N,ZxtTableColumn:Be,ElTable:b.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 a=e.useSlots(),l=e.ref(null),c=e.ref(t.pageSize),d=e.ref(t.currentPage),s=e.ref(!1),p=e.ref([]),m=e.ref(0),w=e.ref({prop:"",order:""}),f=e.ref({}),i=e.ref({});e.watch(()=>t.currentPage,g=>{d.value=g}),e.watch(()=>t.pageSize,g=>{c.value=g});const C=e.computed(()=>t.height==="full"?{height:"100%"}:{}),n=e.computed(()=>{if(t.height!=="full")return t.height}),h=e.computed(()=>!!t.proxyConfig),S=e.computed(()=>h.value?m.value:t.total>0?t.total:t.data.length),$=e.computed(()=>h.value?p.value:t.data),V=()=>{e.nextTick(()=>{const g=l.value?.$el?.querySelector(".el-table__body-wrapper .el-scrollbar__wrap");g&&(typeof g.scrollTo=="function"?g.scrollTo({top:0,left:0}):(g.scrollTop=0,g.scrollLeft=0))})},F=g=>{h.value&&(d.value=g.page,c.value=g.size,x()),V(),o("size-change",g)},oe=g=>{h.value&&(d.value=g.page,c.value=g.size,x()),V(),o("page-change",g)},ne=({column:g,prop:k,order:M})=>{w.value={prop:k,order:M},h.value&&x(),o("sort-change",{column:g,prop:k,order:M})},ae=g=>{f.value=g||{},h.value&&x(),o("filter-change",f.value)},x=async g=>{if(!h.value)return;const k=t.proxyConfig||{},M=k.ajax?.query;if(typeof M!="function")return;const R=k.props||{},ie=R.pageField||"page";R.sizeField;const ce=R.sortField||"sort",de=R.orderField||"order",pe=R.filtersField||"filters";g?.formData!==void 0?i.value=g.formData:k._formData&&(i.value=k._formData);const me=k.params||{},A={[ie]:{currentPage:g?.page??d.value,pageSize:g?.pageSize??c.value},form:i.value,...me};w.value?.prop&&(A[ce]=w.value.prop,A[de]=w.value.order),f.value&&Object.keys(f.value).length&&(A[pe]=f.value),s.value=!0;try{const E=await M(A),_=k.response||{},r=_.listField||"list",u=_.totalField||"total",z=_.transform;let D=[],W=0;if(typeof z=="function"){const fe=z(E);D=fe?.list??[],W=fe?.total??0}else E&&typeof E=="object"&&(D=E?.[r]??E?.data??[],W=E?.[u]??E?.total??0);p.value=Array.isArray(D)?D:[],m.value=Number(W)||0,o("loaded",{data:p.value,total:m.value,payload:A})}catch(E){o("load-error",E)}finally{s.value=!1}},q=(g,k)=>{h.value?p.value.splice(k,1,g):o("update:row",{index:k,row:g})};e.provide("updateRow",q),e.onMounted(()=>{h.value&&t.autoLoad&&x()});const re=()=>l.value,le=()=>l.value?.getSelectionRows?.()||[],se=g=>x(g),U=()=>V();return{columnSlots:e.computed(()=>{const g={};for(const k in a)Ve.has(k)||(g[k]=a[k]);return g}),tableRef:l,containerStyle:C,tableHeight:n,getTableRef:re,pageSize:c,currentPage:d,loading:s,renderData:$,total:S,pageSizes:e.computed(()=>t.pageSizes),paginationLayout:e.computed(()=>t.paginationLayout),handleSizeChange:F,handlePageChange:oe,handleSortChange:ne,handleFilterChange:ae,reload:se,getSelectedRows:le,updateRow:q,resetScrollTop:U}}}),$e={key:0,class:"zxt-table-footer"};function xe(t,o,a,l,c,d){const s=e.resolveComponent("ZxtTableColumn"),p=e.resolveComponent("el-table"),m=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,i)=>(e.openBlock(),e.createBlock(s,{key:i,column:f,"current-page":t.currentPage,"page-size":t.pageSize},e.createSlots({_:2},[e.renderList(t.columnSlots,(C,n)=>({name:n,fn:e.withCtx(h=>[e.renderSlot(t.$slots,n,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",$e,[e.renderSlot(t.$slots,"append",{},void 0,!0)])):e.createCommentVNode("",!0),t.pageable?(e.openBlock(),e.createBlock(m,{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 B=T(Ee,[["render",xe],["__scopeId","data-v-cfbfc1e6"]]),P=new Map;class De{add(o,a){return!o||typeof o!="string"?(console.warn("[ZxtTable] 渲染器名称必须是字符串"),this):!a||typeof a!="object"?(console.warn("[ZxtTable] 渲染器配置必须是对象"),this):(P.has(o)&&console.warn(`[ZxtTable] 渲染器 "${o}" 已存在,将被覆盖`),P.set(o,a),this)}get(o){return P.get(o)}delete(o){return P.delete(o)}has(o){return P.has(o)}getAll(){return Array.from(P.keys())}clear(){P.clear()}}const G=new De;function Te(t,o,a={}){if(!t||!t.itemRender)return null;const{name:l}=t.itemRender;if(l&&G.has(l)){const c=G.get(l);if(typeof c.renderItemContent=="function"){const d={data:o,field:t.field||t.prop,item:t,formData:o};try{return c.renderItemContent(a,d)}catch(s){return console.error(`[ZxtTable] 渲染器 "${l}" 执行出错:`,s),null}}}return null}B.install=function(t){t.component(B.name,B)},B.registerRenderer=be,B.renderer=G;var Ne=e.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(o,a)=>(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"})]))}}),ge=Ne,Pe=e.defineComponent({name:"Check",__name:"check",setup(t){return(o,a)=>(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"})]))}}),Fe=Pe,Me=e.defineComponent({name:"Close",__name:"close",setup(t){return(o,a)=>(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=Me,Ae=e.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(o,a)=>(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"})]))}}),Le=Ae,Oe=e.defineComponent({name:"Delete",__name:"delete",setup(t){return(o,a)=>(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,a)=>(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,a)=>(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,a)=>(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,a)=>(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"})]))}}),Ue=qe,We=e.defineComponent({name:"Plus",__name:"plus",setup(t){return(o,a)=>(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=We,Ge=e.defineComponent({name:"Refresh",__name:"refresh",setup(t){return(o,a)=>(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=Ge,Je=e.defineComponent({name:"Search",__name:"search",setup(t){return(o,a)=>(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,a)=>(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,a)=>(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,a)=>(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,a)=>(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,a)=>(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,a)=>(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:a}){const l=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"},s=n=>d[n]||"el-input",p=n=>{const h=n.type||"input",S=["select","date","daterange","datetime","datetimerange","cascader"].includes(h),$={placeholder:n.placeholder||`请${S?"选择":"输入"}${n.label}`,disabled:n.disabled,style:"width: 100%","popper-class":"zxt-form-popper"};let V={};switch(h){case"date":case"daterange":case"datetime":case"datetimerange":V={type:n.dateType||h,startPlaceholder:n.startPlaceholder||"开始日期",endPlaceholder:n.endPlaceholder||"结束日期",format:n.format,valueFormat:n.valueFormat};break;case"cascader":V={options:n.options,props:n.cascaderProps,clearable:n.clearable!==!1};break;default:V={}}const F={...$,...V};return"clearable"in n&&(F.clearable=n.clearable),n.props&&typeof n.props=="object"&&Object.assign(F,n.props),F},m=e.computed(()=>t.formColumns.map(n=>({...n,colSpan:{xs:n.xs??n.span??24,sm:n.sm??n.span??12,md:n.md??n.span??12,lg:n.lg??n.span??12,xl:n.xl??n.span??12}})));e.watch(()=>t.initialFormData,n=>{Object.keys(c).forEach(h=>{delete c[h]}),Object.assign(c,n)},{immediate:!0,deep:!0});const w=e.computed(()=>{const n={...t.rules};return Object.keys(n).length===0&&t.formColumns.length>0&&t.formColumns.forEach(h=>{if(h.required){const S=["select","date","daterange","datetime","datetimerange","cascader"].includes(h.type);n[h.prop]=[{required:!0,message:`请${S?"选择":"输入"}${h.label}`,trigger:S?"change":"blur"}]}}),n}),f=()=>{l.value&&l.value.validate(n=>{n&&o("submit",{...c})})},i=()=>{l.value&&l.value.resetFields(),o("reset")},C=n=>()=>Te(n,c,{})||null;return a({validate:()=>l.value?l.value.validate():Promise.resolve(!1),resetFields:()=>l.value&&l.value.resetFields(),getFormData:()=>({...c}),submitForm:f,resetForm:i}),{formRef:l,formData:c,formRules:w,submitForm:f,resetForm:i,processedColumns:m,getComponentType:s,getComponentProps:p,renderCustomItem:C}}}),rt={class:"zxt-form-container"},lt={key:0,class:"form-label"},st={class:"form-control"};function it(t,o,a,l,c,d){const s=e.resolveComponent("el-option"),p=e.resolveComponent("el-form-item"),m=e.resolveComponent("el-col"),w=e.resolveComponent("el-row"),f=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",rt,[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,(i,C)=>(e.openBlock(),e.createBlock(m,e.mergeProps({key:C},{ref_for:!0},i.colSpan),{default:e.withCtx(()=>[e.createVNode(p,{prop:i.prop,required:i.required,"label-width":"0",class:"custom-form-item"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["form-item-wrapper",{"is-action":i.isAction}])},[i.label?(e.openBlock(),e.createElementBlock("span",lt,e.toDisplayString(i.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",st,[i.type==="slot"?e.renderSlot(t.$slots,i.slotName||i.prop,{key:0,formData:t.formData,column:i},void 0,!0):i.itemRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderCustomItem(i)),{key:1})):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.getComponentType(i.type)),e.mergeProps({key:2,modelValue:t.formData[i.prop],"onUpdate:modelValue":n=>t.formData[i.prop]=n},{ref_for:!0},t.getComponentProps(i),e.toHandlers(i.events||{})),{default:e.withCtx(()=>[i.type==="select"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(i.options,(n,h)=>(e.openBlock(),e.createBlock(s,{key:h,label:n.label,value:n.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=T(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:Fe,Close:Re,Document:He,CopyDocument:Le,Share:Xe,Lock:Ue,Unlock:ve,ArrowDown:ge},dt=e.defineComponent({name:"ActionColumn",components:{ElButton:b.ElButton,ElDropdown:b.ElDropdown,ElDropdownItem:b.ElDropdownItem,ElDropdownMenu:b.ElDropdownMenu,ElIcon:b.ElIcon,ArrowDown:ge},props:{buttons:{type:Array,default:()=>[]},row:{type:Object,default:()=>({})},maxVisible:{type:Number,default:2}},emits:["action-click"],setup(t,{emit:o}){const a=e.ref(null),l=e.computed(()=>t.buttons.filter(n=>typeof n.visible=="function"?n.visible(t.row):typeof n.visible=="boolean"?n.visible:!0)),c=e.computed(()=>l.value.length>t.maxVisible),d=e.computed(()=>c.value?l.value.slice(0,t.maxVisible):l.value),s=e.computed(()=>c.value?l.value.slice(t.maxVisible):[]),p=n=>{if(n)return typeof n=="object"||typeof n=="function"?n:ct[n]},m=n=>{n?.currentTarget?.blur?.()};return{moreTriggerRef:a,visibleButtons:d,overflowButtons:s,getIconComponent:p,handleClick:(n,h)=>{m(h),o("action-click",{code:n.code,button:n,row:t.row})},handleCommand:n=>{o("action-click",{code:n.code,button:n,row:t.row})},handleTriggerClick:n=>{m(n)},handleMoreDropdownVisible:n=>{n||e.nextTick(()=>{const h=a.value,S=h?.$el??h,$=document.activeElement;S&&$&&typeof S.contains=="function"&&S.contains($)&&$.blur()})}}}}),pt={class:"action-column zxt-grid-action-column"};function mt(t,o,a,l,c,d){const s=e.resolveComponent("el-button"),p=e.resolveComponent("ArrowDown"),m=e.resolveComponent("el-icon"),w=e.resolveComponent("el-dropdown-item"),f=e.resolveComponent("el-dropdown-menu"),i=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(s,{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:n=>t.handleClick(C,n)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["type","icon","onClick"]))),128)),t.overflowButtons.length?(e.openBlock(),e.createBlock(i,{key:0,trigger:"hover",onCommand:t.handleCommand,onVisibleChange:t.handleMoreDropdownVisible},{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(s,{ref:"moreTriggerRef",class:"action-btn zxt-grid-action-more",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(m,{class:"el-icon--right"},{default:e.withCtx(()=>[e.createVNode(p)]),_:1})]),_:1},8,["onClick"])]),_:1},8,["onCommand","onVisibleChange"])):e.createCommentVNode("",!0)])}const ft=T(dt,[["render",mt],["__scopeId","data-v-514a225d"]]),gt=e.defineComponent({name:"ZxtGrid",inheritAttrs:!1,components:{ZxtTable:B,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:a}){const l=e.useAttrs(),c=e.useSlots(),d=e.ref(null),s=e.ref(null),p=e.ref(1),m=e.ref(10),w=e.ref(null),f=e.ref(t.gridOptions.formMode!==!1),i=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},n=e.computed(()=>{const u=(t.gridOptions.columns||[]).find(z=>z.actionColumn);return u?u.actionColumn:null}),h=e.computed(()=>(t.gridOptions.columns||[]).map(u=>u.actionColumn?{...u,slot:"zxtActionInternal",actionColumn:void 0}:u)),S=r=>{o("action-click",r)},$=e.computed(()=>{const r=t.gridOptions.formConfig;if(!r||!r.items)return[];const u=[...r.items];return u.some(D=>D.type==="slot"&&D.slotName==="search-actions")||u.push({type:"slot",slotName:"search-actions",span:6,labelWidth:"0px",isAction:!0,...r.actionConfig}),u}),V=e.computed(()=>{const r=new Set(["search-actions"]);return($.value||[]).forEach(u=>{u.type==="slot"&&r.add(u.slotName||u.prop)}),r}),F=e.computed(()=>{const r={};for(const u in c)u==="search-actions"||u==="toolbar"||(V.value.has(u)||u.startsWith("form-"))&&(r[u]=c[u]);return r}),oe=e.computed(()=>{const r={};for(const u in c)u!=="toolbar"&&!V.value.has(u)&&!u.startsWith("form-")&&(r[u]=c[u]);return r}),ne=()=>{s.value?.submitForm()},ae=r=>{o("submit",r),t.gridOptions.proxyConfig&&(i.value={...r},p.value=1,d.value?.reload?.({formData:i.value,page:1}))},x=()=>{s.value?.resetForm()},q=()=>{o("reset"),t.gridOptions.proxyConfig&&(i.value={},p.value=1,d.value?.reload?.({formData:{},page:1}))},re=r=>{if(r)return typeof r=="object"||typeof r=="function"?r:C[r]},le=e.computed(()=>{const r=t.gridOptions.proxyConfig;return r?{...r,_formData:i.value}:null}),se=e.computed(()=>{const{formConfig:r,toolbar:u,formMode:z,formColumns:D,rules:W,data:fe,proxyConfig:bt,...zt}=t.gridOptions;return{...zt,proxyConfig:le.value||bt||null}}),U=e.computed(()=>w.value!==null?w.value:t.externalData.length>0?t.externalData:t.gridOptions.data||[]),ue=e.computed(()=>!!t.gridOptions.proxyConfig),g=e.computed(()=>ue.value?0:U.value.length),k=(r,u)=>{o("toolbar-click",{code:r,button:u,grid:d.value})},M=r=>{p.value=r.page,o("page-change",r)},R=r=>{m.value=r.size,o("size-change",r)},ie=()=>d.value,ce=()=>s.value,de=()=>d.value?.getTableRef()?.getSelectionRows?.()||[],pe=r=>{w.value=r??null},me=r=>{f.value=r},A=(r,u=!0)=>{const z=t.gridOptions.formConfig;z?.data&&Object.assign(z.data,r),i.value={...z?.data||{},...r},u&&t.gridOptions.proxyConfig&&(p.value=1,d.value?.reload?.({formData:i.value,page:1}))},E=(r,...u)=>{const z=i.value;switch(r){case"query":p.value=1,d.value?.reload?.({formData:z,page:1});break;case"reload":d.value?.reload?.({formData:z});break;default:console.warn(`[ZxtGrid] commitProxy: unknown type "${r}"`)}};e.watch(()=>t.gridOptions.formMode,r=>{r!==void 0&&(f.value=r)}),e.onMounted(()=>{t.gridOptions.proxyConfig&&t.gridOptions.autoLoad!==!1&&d.value?.reload?.({formData:i.value,page:1})});const _=()=>d.value?.getTableRef?.();return a({getGridRef:ie,getFormRef:ce,getElTableRef:_,getSelectedRows:de,reloadData:pe,setFormVisible:me,setFormData:A,commitProxy:E,clearSelection:()=>_()?.clearSelection(),toggleRowSelection:(...r)=>_()?.toggleRowSelection(...r),toggleAllSelection:()=>_()?.toggleAllSelection(),toggleRowExpansion:(...r)=>_()?.toggleRowExpansion(...r),setCurrentRow:(...r)=>_()?.setCurrentRow(...r),clearSort:()=>_()?.clearSort(),clearFilter:(...r)=>_()?.clearFilter(...r),doLayout:()=>_()?.doLayout(),sort:(...r)=>_()?.sort(...r)}),{attrs:l,gridRef:d,searchFormRef:s,currentPage:p,pageSize:m,tableData:U,tableProps:se,mergedColumns:h,actionColumnConfig:n,total:g,isFormVisible:f,searchFormColumns:$,formFilteredSlots:F,tableFilteredSlots:oe,getIconComponent:re,handleToolbarClick:k,handleActionClick:S,handlePageChange:M,handleSizeChange:R,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,a,l,c,d){const s=e.resolveComponent("el-button"),p=e.resolveComponent("ZxtForm"),m=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(s,{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(s,{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,i)=>({name:i,fn:e.withCtx(C=>[e.renderSlot(t.$slots,i,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,i)=>(e.openBlock(),e.createBlock(s,{key:i,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(m,{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,i)=>({name:i,fn:e.withCtx(C=>[e.renderSlot(t.$slots,i,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=T(gt,[["render",kt],["__scopeId","data-v-0948a778"]]);N.install=function(t){t.component(N.name,N)};const yt=[L,O,B,te,I,N],_t={install:t=>{yt.forEach(o=>{t.component(o.name,o)})},MyButton:L,JsxButton:O,ZxtTable:B,ZxtGrid:te,ZxtForm:I,ZxtPagination:N,renderer:B.renderer,registerRenderer:B.registerRenderer};y.JsxButton=O,y.MyButton=L,y.ZxtForm=I,y.ZxtGrid=te,y.ZxtPagination=N,y.ZxtTable=B,y.default=_t,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
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,_){"use strict";const T=(t,o)=>{const a=t.__vccOpts||t;for(const[l,c]of o)a[l]=c;return a},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:l=>{o("click",l)}}}},Ce=["disabled"];function we(t,o,a,l,c,d){return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["my-button",[`my-button--${a.type}`,{"is-disabled":a.disabled}]]),disabled:a.disabled,onClick:o[0]||(o[0]=(...i)=>l.handleClick&&l.handleClick(...i))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],10,Ce)}const L=T(he,[["render",we],["__scopeId","data-v-4480e77d"]]);L.install=function(t){t.component(L.name,L)};const O=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:a}){const l=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:l},[a.default?.()])}});O.install=function(t){t.component(O.name,O)};const ye=e.defineComponent({name:"ZxtPagination",components:{ElPagination:_.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 a=e.ref(t.modelValue),l=e.ref(t.pageSize);return e.watch(()=>t.modelValue,i=>{a.value=i}),e.watch(()=>t.pageSize,i=>{l.value=i}),{currentPage:a,pageSize:l,handleSizeChange:i=>{l.value=i,a.value=1,o("update:pageSize",i),o("size-change",{page:a.value,size:i})},handleCurrentChange:i=>{a.value=i,o("update:modelValue",i),o("page-change",{page:i,size:l.value})}}}});function ke(t,o,a,l,c,d){const i=e.resolveComponent("el-pagination");return e.openBlock(),e.createBlock(i,{"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=T(ye,[["render",ke],["__scopeId","data-v-497aa44d"]]),Z={default:({cellValue:t})=>t??"",input:({cellValue:t,row:o,column:a,updateRow:l})=>e.h(_.ElInput,{modelValue:t,size:"small",onInput:c=>l({...o,[a.property]:c})}),select:({cellValue:t,row:o,column:a,updateRow:l,options:c=[]})=>e.h(_.ElSelect,{modelValue:t,size:"small",onChange:d=>l({...o,[a.property]:d})},()=>c.map(d=>e.h(_.ElOption,{label:d.label,value:d.value,key:d.value}))),checkbox:({cellValue:t,row:o,column:a,updateRow:l})=>e.h(_.ElCheckbox,{modelValue:!!t,onChange:c=>l({...o,[a.property]:c})}),link:({cellValue:t,href:o,target:a="_blank"})=>e.h(_.ElLink,{href:o,target:a},()=>t)};function be(t,o){if(!t)return null;if(typeof t=="string"){const a=Z[t];return a?a(o):(console.warn(`[ZxtTable] 未找到内置渲染器: ${t}`),o.cellValue??"")}if(typeof t=="function")return t(o);if(typeof t=="object"&&!Array.isArray(t)){const{name:a,props:l={},attrs:c={},events:d={},content:i}=t;return typeof a=="string"&&Z[a]?Z[a]({...o,...l,...c,...d}):typeof a=="object"||typeof a=="function"?e.h(a,{...l,...c,...d},i):(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:_.ElTableColumn},props:{column:{type:Object,required:!0},currentPage:{type:Number,default:1},pageSize:{type:Number,default:10}},setup(t){const o=e.inject("updateRow",()=>{}),a=i=>{const{currentPage:p,pageSize:m}=t;return(p-1)*m+i+1},l=e.computed(()=>{const i=t.column;return{...i,prop:i.prop??i.field,label:i.label??i.title}}),c=e.computed(()=>{const{children:i,...p}=l.value;return p});return{normalizedColumn:l,columnProps:c,renderCell:i=>{const p=l.value,m=i.row[p.prop],w=m??p.defaultValue??"";return be(p.cellRender,{row:i.row,column:p,rowIndex:i.$index,cellValue:w,updateRow:f=>o(f,i.$index)})},defaultIndexMethod:a}}});function Se(t,o,a,l,c,d){const i=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,(m,w)=>(e.openBlock(),e.createBlock(i,{key:w,column:m,"current-page":t.currentPage,"page-size":t.pageSize},e.createSlots({_:2},[e.renderList(t.$slots,(f,s)=>({name:s,fn:e.withCtx(C=>[e.renderSlot(t.$slots,s,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(m=>[e.renderSlot(t.$slots,t.normalizedColumn.headerSlot,e.mergeProps({column:t.normalizedColumn},m))]),key:"0"}:void 0,!["selection","index"].includes(t.normalizedColumn.type)&&(t.normalizedColumn.type!=="expand"||t.normalizedColumn.slot)?{name:"default",fn:e.withCtx(m=>[t.normalizedColumn.slot?e.renderSlot(t.$slots,t.normalizedColumn.slot,{key:0,row:m.row,index:m.$index,column:t.normalizedColumn}):t.normalizedColumn.cellRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderCell(m)),{key:1})):t.normalizedColumn.formatter?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.normalizedColumn.formatter(m.row,t.normalizedColumn,m.row[t.normalizedColumn.prop],m.$index)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(m.row[t.normalizedColumn.prop]),1)],64))]),key:"1"}:void 0]),1040,["index"]))}const Be=T(ze,[["render",Se]]),Ve=new Set(["append","empty"]),Ee=e.defineComponent({name:"ZxtTable",inheritAttrs:!1,components:{ZxtPagination:N,ZxtTableColumn:Be,ElTable:_.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 a=e.useSlots(),l=e.ref(null),c=e.ref(t.pageSize),d=e.ref(t.currentPage),i=e.ref(!1),p=e.ref([]),m=e.ref(0),w=e.ref({prop:"",order:""}),f=e.ref({}),s=e.ref({});e.watch(()=>t.currentPage,g=>{d.value=g}),e.watch(()=>t.pageSize,g=>{c.value=g});const C=e.computed(()=>t.height==="full"?{height:"100%"}:{}),n=e.computed(()=>{if(t.height!=="full")return t.height}),h=e.computed(()=>!!t.proxyConfig),S=e.computed(()=>h.value?m.value:t.total>0?t.total:t.data.length),$=e.computed(()=>h.value?p.value:t.data),V=()=>{e.nextTick(()=>{const g=l.value?.$el?.querySelector(".el-table__body-wrapper .el-scrollbar__wrap");g&&(typeof g.scrollTo=="function"?g.scrollTo({top:0,left:0}):(g.scrollTop=0,g.scrollLeft=0))})},F=g=>{h.value&&(d.value=g.page,c.value=g.size,x()),V(),o("size-change",g)},oe=g=>{h.value&&(d.value=g.page,c.value=g.size,x()),V(),o("page-change",g)},ne=({column:g,prop:y,order:M})=>{w.value={prop:y,order:M},h.value&&x(),o("sort-change",{column:g,prop:y,order:M})},ae=g=>{f.value=g||{},h.value&&x(),o("filter-change",f.value)},x=async g=>{if(!h.value)return;const y=t.proxyConfig||{},M=y.ajax?.query;if(typeof M!="function")return;const R=y.props||{},se=R.pageField||"page";R.sizeField;const ce=R.sortField||"sort",de=R.orderField||"order",pe=R.filtersField||"filters";g?.formData!==void 0?s.value=g.formData:y._formData&&(s.value=y._formData);const me=y.params||{},A={[se]:{currentPage:g?.page??d.value,pageSize:g?.pageSize??c.value},form:s.value,...me};w.value?.prop&&(A[ce]=w.value.prop,A[de]=w.value.order),f.value&&Object.keys(f.value).length&&(A[pe]=f.value),i.value=!0;try{const E=await M(A),b=y.response||{},r=b.listField||"list",u=b.totalField||"total",z=b.transform;let D=[],W=0;if(typeof z=="function"){const fe=z(E);D=fe?.list??[],W=fe?.total??0}else E&&typeof E=="object"&&(D=E?.[r]??E?.data??[],W=E?.[u]??E?.total??0);p.value=Array.isArray(D)?D:[],m.value=Number(W)||0,o("loaded",{data:p.value,total:m.value,payload:A})}catch(E){o("load-error",E)}finally{i.value=!1}},q=(g,y)=>{h.value?p.value.splice(y,1,g):o("update:row",{index:y,row:g})};e.provide("updateRow",q),e.onMounted(()=>{h.value&&t.autoLoad&&x()});const re=()=>l.value,le=()=>l.value?.getSelectionRows?.()||[],ie=g=>x(g),U=()=>V();return{columnSlots:e.computed(()=>{const g={};for(const y in a)Ve.has(y)||(g[y]=a[y]);return g}),tableRef:l,containerStyle:C,tableHeight:n,getTableRef:re,pageSize:c,currentPage:d,loading:i,renderData:$,total:S,pageSizes:e.computed(()=>t.pageSizes),paginationLayout:e.computed(()=>t.paginationLayout),handleSizeChange:F,handlePageChange:oe,handleSortChange:ne,handleFilterChange:ae,reload:ie,getSelectedRows:le,updateRow:q,resetScrollTop:U}}}),$e={key:0,class:"zxt-table-footer"};function xe(t,o,a,l,c,d){const i=e.resolveComponent("ZxtTableColumn"),p=e.resolveComponent("el-table"),m=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,s)=>(e.openBlock(),e.createBlock(i,{key:s,column:f,"current-page":t.currentPage,"page-size":t.pageSize},e.createSlots({_:2},[e.renderList(t.columnSlots,(C,n)=>({name:n,fn:e.withCtx(h=>[e.renderSlot(t.$slots,n,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",$e,[e.renderSlot(t.$slots,"append",{},void 0,!0)])):e.createCommentVNode("",!0),t.pageable?(e.openBlock(),e.createBlock(m,{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 B=T(Ee,[["render",xe],["__scopeId","data-v-cfbfc1e6"]]),P=new Map;class De{add(o,a){return!o||typeof o!="string"?(console.warn("[ZxtTable] 渲染器名称必须是字符串"),this):!a||typeof a!="object"?(console.warn("[ZxtTable] 渲染器配置必须是对象"),this):(P.has(o)&&console.warn(`[ZxtTable] 渲染器 "${o}" 已存在,将被覆盖`),P.set(o,a),this)}get(o){return P.get(o)}delete(o){return P.delete(o)}has(o){return P.has(o)}getAll(){return Array.from(P.keys())}clear(){P.clear()}}const G=new De;function Te(t,o,a={}){if(!t||!t.itemRender)return null;const{name:l}=t.itemRender;if(l&&G.has(l)){const c=G.get(l);if(typeof c.renderItemContent=="function"){const d={data:o,field:t.field||t.prop,item:t,formData:o};try{return c.renderItemContent(a,d)}catch(i){return console.error(`[ZxtTable] 渲染器 "${l}" 执行出错:`,i),null}}}return null}B.install=function(t){t.component(B.name,B)},B.registerRenderer=_e,B.renderer=G;var Ne=e.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(o,a)=>(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"})]))}}),ge=Ne,Pe=e.defineComponent({name:"Check",__name:"check",setup(t){return(o,a)=>(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"})]))}}),Fe=Pe,Me=e.defineComponent({name:"Close",__name:"close",setup(t){return(o,a)=>(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=Me,Ae=e.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(o,a)=>(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"})]))}}),Le=Ae,Oe=e.defineComponent({name:"Delete",__name:"delete",setup(t){return(o,a)=>(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,a)=>(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,a)=>(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,a)=>(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,a)=>(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"})]))}}),Ue=qe,We=e.defineComponent({name:"Plus",__name:"plus",setup(t){return(o,a)=>(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=We,Ge=e.defineComponent({name:"Refresh",__name:"refresh",setup(t){return(o,a)=>(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=Ge,Je=e.defineComponent({name:"Search",__name:"search",setup(t){return(o,a)=>(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,a)=>(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,a)=>(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,a)=>(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,a)=>(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,a)=>(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,a)=>(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:a}){const l=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"},i=n=>d[n]||"el-input",p=n=>{const h=n.type||"input",S=["select","date","daterange","datetime","datetimerange","cascader"].includes(h),$={placeholder:n.placeholder||`请${S?"选择":"输入"}${n.label}`,disabled:n.disabled,style:"width: 100%","popper-class":"zxt-form-popper"};let V={};switch(h){case"date":case"daterange":case"datetime":case"datetimerange":V={type:n.dateType||h,startPlaceholder:n.startPlaceholder||"开始日期",endPlaceholder:n.endPlaceholder||"结束日期",format:n.format,valueFormat:n.valueFormat};break;case"cascader":V={options:n.options,props:n.cascaderProps,clearable:n.clearable!==!1};break;default:V={}}const F={...$,...V};return"clearable"in n&&(F.clearable=n.clearable),n.props&&typeof n.props=="object"&&Object.assign(F,n.props),F},m=e.computed(()=>t.formColumns.map(n=>({...n,colSpan:{xs:n.xs??n.span??24,sm:n.sm??n.span??12,md:n.md??n.span??12,lg:n.lg??n.span??12,xl:n.xl??n.span??12}})));e.watch(()=>t.initialFormData,n=>{Object.keys(c).forEach(h=>{delete c[h]}),Object.assign(c,n)},{immediate:!0,deep:!0});const w=e.computed(()=>{const n={...t.rules};return Object.keys(n).length===0&&t.formColumns.length>0&&t.formColumns.forEach(h=>{if(h.required){const S=["select","date","daterange","datetime","datetimerange","cascader"].includes(h.type);n[h.prop]=[{required:!0,message:`请${S?"选择":"输入"}${h.label}`,trigger:S?"change":"blur"}]}}),n}),f=()=>{l.value&&l.value.validate(n=>{n&&o("submit",{...c})})},s=()=>{l.value&&l.value.resetFields(),o("reset")},C=n=>()=>Te(n,c,{})||null;return a({validate:()=>l.value?l.value.validate():Promise.resolve(!1),resetFields:()=>l.value&&l.value.resetFields(),getFormData:()=>({...c}),submitForm:f,resetForm:s}),{formRef:l,formData:c,formRules:w,submitForm:f,resetForm:s,processedColumns:m,getComponentType:i,getComponentProps:p,renderCustomItem:C}}}),rt={class:"zxt-form-container"},lt={key:0,class:"form-label"},it={class:"form-control"};function st(t,o,a,l,c,d){const i=e.resolveComponent("el-option"),p=e.resolveComponent("el-form-item"),m=e.resolveComponent("el-col"),w=e.resolveComponent("el-row"),f=e.resolveComponent("el-form");return e.openBlock(),e.createElementBlock("div",rt,[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,(s,C)=>(e.openBlock(),e.createBlock(m,e.mergeProps({key:C},{ref_for:!0},s.colSpan),{default:e.withCtx(()=>[e.createVNode(p,{prop:s.prop,required:s.required,"label-width":"0",class:"custom-form-item"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["form-item-wrapper",{"is-action":s.isAction}])},[s.label?(e.openBlock(),e.createElementBlock("span",lt,e.toDisplayString(s.label),1)):e.createCommentVNode("",!0),e.createElementVNode("div",it,[s.type==="slot"?e.renderSlot(t.$slots,s.slotName||s.prop,{key:0,formData:t.formData,column:s},void 0,!0):s.itemRender?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderCustomItem(s)),{key:1})):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.getComponentType(s.type)),e.mergeProps({key:2,modelValue:t.formData[s.prop],"onUpdate:modelValue":n=>t.formData[s.prop]=n},{ref_for:!0},t.getComponentProps(s),e.toHandlers(s.events||{})),{default:e.withCtx(()=>[s.type==="select"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.options,(n,h)=>(e.openBlock(),e.createBlock(i,{key:h,label:n.label,value:n.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=T(at,[["render",st],["__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:Fe,Close:Re,Document:He,CopyDocument:Le,Share:Xe,Lock:Ue,Unlock:ve,ArrowDown:ge},dt=e.defineComponent({name:"ActionColumn",components:{ElButton:_.ElButton,ElDropdown:_.ElDropdown,ElDropdownItem:_.ElDropdownItem,ElDropdownMenu:_.ElDropdownMenu,ElIcon:_.ElIcon,ArrowDown:ge},props:{buttons:{type:Array,default:()=>[]},row:{type:Object,default:()=>({})},maxVisible:{type:Number,default:2},moreType:{type:String,default:""}},emits:["action-click"],setup(t,{emit:o}){const a=e.ref(null),l=e.computed(()=>t.buttons.filter(n=>typeof n.visible=="function"?n.visible(t.row):typeof n.visible=="boolean"?n.visible:!0)),c=e.computed(()=>l.value.length>t.maxVisible),d=e.computed(()=>c.value?l.value.slice(0,t.maxVisible):l.value),i=e.computed(()=>c.value?l.value.slice(t.maxVisible):[]),p=n=>{if(n)return typeof n=="object"||typeof n=="function"?n:ct[n]},m=n=>{n?.currentTarget?.blur?.()};return{moreTriggerRef:a,visibleButtons:d,overflowButtons:i,getIconComponent:p,handleClick:(n,h)=>{m(h),o("action-click",{code:n.code,button:n,row:t.row})},handleCommand:n=>{o("action-click",{code:n.code,button:n,row:t.row})},handleTriggerClick:n=>{m(n)},handleMoreDropdownVisible:n=>{n||e.nextTick(()=>{const h=a.value,S=h?.$el??h,$=document.activeElement;S&&$&&typeof S.contains=="function"&&S.contains($)&&$.blur()})}}}}),pt={class:"action-column zxt-grid-action-column"};function mt(t,o,a,l,c,d){const i=e.resolveComponent("el-button"),p=e.resolveComponent("ArrowDown"),m=e.resolveComponent("el-icon"),w=e.resolveComponent("el-dropdown-item"),f=e.resolveComponent("el-dropdown-menu"),s=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(i,{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:n=>t.handleClick(C,n)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["type","icon","onClick"]))),128)),t.overflowButtons.length?(e.openBlock(),e.createBlock(s,{key:0,trigger:"hover",onCommand:t.handleCommand,onVisibleChange:t.handleMoreDropdownVisible},{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(i,{ref:"moreTriggerRef",class:"action-btn zxt-grid-action-more",type:t.moreType||"",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(m,{class:"el-icon--right"},{default:e.withCtx(()=>[e.createVNode(p)]),_:1})]),_:1},8,["type","onClick"])]),_:1},8,["onCommand","onVisibleChange"])):e.createCommentVNode("",!0)])}const ft=T(dt,[["render",mt],["__scopeId","data-v-7de2fbab"]]),gt=e.defineComponent({name:"ZxtGrid",inheritAttrs:!1,components:{ZxtTable:B,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:a}){const l=e.useAttrs(),c=e.useSlots(),d=e.ref(null),i=e.ref(null),p=e.ref(1),m=e.ref(10),w=e.ref(null),f=e.ref(t.gridOptions.formMode!==!1),s=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},n=e.computed(()=>{const u=(t.gridOptions.columns||[]).find(z=>z.actionColumn);return u?u.actionColumn:null}),h=e.computed(()=>(t.gridOptions.columns||[]).map(u=>u.actionColumn?{...u,slot:"zxtActionInternal",actionColumn:void 0}:u)),S=r=>{o("action-click",r)},$=e.computed(()=>{const r=t.gridOptions.formConfig;if(!r||!r.items)return[];const u=[...r.items];return u.some(D=>D.type==="slot"&&D.slotName==="search-actions")||u.push({type:"slot",slotName:"search-actions",span:6,labelWidth:"0px",isAction:!0,...r.actionConfig}),u}),V=e.computed(()=>{const r=new Set(["search-actions"]);return($.value||[]).forEach(u=>{u.type==="slot"&&r.add(u.slotName||u.prop)}),r}),F=e.computed(()=>{const r={};for(const u in c)u==="search-actions"||u==="toolbar"||(V.value.has(u)||u.startsWith("form-"))&&(r[u]=c[u]);return r}),oe=e.computed(()=>{const r={};for(const u in c)u!=="toolbar"&&!V.value.has(u)&&!u.startsWith("form-")&&(r[u]=c[u]);return r}),ne=()=>{i.value?.submitForm()},ae=r=>{o("submit",r),t.gridOptions.proxyConfig&&(s.value={...r},p.value=1,d.value?.reload?.({formData:s.value,page:1}))},x=()=>{i.value?.resetForm()},q=()=>{o("reset"),t.gridOptions.proxyConfig&&(s.value={},p.value=1,d.value?.reload?.({formData:{},page:1}))},re=r=>{if(r)return typeof r=="object"||typeof r=="function"?r:C[r]},le=e.computed(()=>{const r=t.gridOptions.proxyConfig;return r?{...r,_formData:s.value}:null}),ie=e.computed(()=>{const{formConfig:r,toolbar:u,formMode:z,formColumns:D,rules:W,data:fe,proxyConfig:_t,...zt}=t.gridOptions;return{...zt,proxyConfig:le.value||_t||null}}),U=e.computed(()=>w.value!==null?w.value:t.externalData.length>0?t.externalData:t.gridOptions.data||[]),ue=e.computed(()=>!!t.gridOptions.proxyConfig),g=e.computed(()=>ue.value?0:U.value.length),y=(r,u)=>{o("toolbar-click",{code:r,button:u,grid:d.value})},M=r=>{p.value=r.page,o("page-change",r)},R=r=>{m.value=r.size,o("size-change",r)},se=()=>d.value,ce=()=>i.value,de=()=>d.value?.getTableRef()?.getSelectionRows?.()||[],pe=r=>{w.value=r??null},me=r=>{f.value=r},A=(r,u=!0)=>{const z=t.gridOptions.formConfig;z?.data&&Object.assign(z.data,r),s.value={...z?.data||{},...r},u&&t.gridOptions.proxyConfig&&(p.value=1,d.value?.reload?.({formData:s.value,page:1}))},E=(r,...u)=>{const z=s.value;switch(r){case"query":p.value=1,d.value?.reload?.({formData:z,page:1});break;case"reload":d.value?.reload?.({formData:z});break;default:console.warn(`[ZxtGrid] commitProxy: unknown type "${r}"`)}};e.watch(()=>t.gridOptions.formMode,r=>{r!==void 0&&(f.value=r)}),e.onMounted(()=>{t.gridOptions.proxyConfig&&t.gridOptions.autoLoad!==!1&&d.value?.reload?.({formData:s.value,page:1})});const b=()=>d.value?.getTableRef?.();return a({getGridRef:se,getFormRef:ce,getElTableRef:b,getSelectedRows:de,reloadData:pe,setFormVisible:me,setFormData:A,commitProxy:E,clearSelection:()=>b()?.clearSelection(),toggleRowSelection:(...r)=>b()?.toggleRowSelection(...r),toggleAllSelection:()=>b()?.toggleAllSelection(),toggleRowExpansion:(...r)=>b()?.toggleRowExpansion(...r),setCurrentRow:(...r)=>b()?.setCurrentRow(...r),clearSort:()=>b()?.clearSort(),clearFilter:(...r)=>b()?.clearFilter(...r),doLayout:()=>b()?.doLayout(),sort:(...r)=>b()?.sort(...r)}),{attrs:l,gridRef:d,searchFormRef:i,currentPage:p,pageSize:m,tableData:U,tableProps:ie,mergedColumns:h,actionColumnConfig:n,total:g,isFormVisible:f,searchFormColumns:$,formFilteredSlots:F,tableFilteredSlots:oe,getIconComponent:re,handleToolbarClick:y,handleActionClick:S,handlePageChange:M,handleSizeChange:R,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 yt(t,o,a,l,c,d){const i=e.resolveComponent("el-button"),p=e.resolveComponent("ZxtForm"),m=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(i,{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(i,{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,s)=>({name:s,fn:e.withCtx(C=>[e.renderSlot(t.$slots,s,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,s)=>(e.openBlock(),e.createBlock(i,{key:s,type:f.type||"default",size:f.size||"default",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(m,{buttons:t.actionColumnConfig.buttons,row:f,"max-visible":t.actionColumnConfig.maxVisible||2,"more-type":t.actionColumnConfig.moreType,onActionClick:t.handleActionClick},null,8,["buttons","row","max-visible","more-type","onActionClick"])]),key:"0"}:void 0,e.renderList(t.tableFilteredSlots,(f,s)=>({name:s,fn:e.withCtx(C=>[e.renderSlot(t.$slots,s,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=T(gt,[["render",yt],["__scopeId","data-v-9b5f598e"]]);N.install=function(t){t.component(N.name,N)};const kt=[L,O,B,te,I,N],bt={install:t=>{kt.forEach(o=>{t.component(o.name,o)})},MyButton:L,JsxButton:O,ZxtTable:B,ZxtGrid:te,ZxtForm:I,ZxtPagination:N,renderer:B.renderer,registerRenderer:B.registerRenderer};k.JsxButton=O,k.MyButton=L,k.ZxtForm=I,k.ZxtGrid=te,k.ZxtPagination=N,k.ZxtTable=B,k.default=bt,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|