@dazhicheng/ui 1.6.18 → 1.6.20
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/components/tt-form/index.d.ts +2 -2
- package/dist/components/tt-form/src/formApi.d.ts +11 -2
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +162 -114
- package/dist/components/tt-form/src/group-form/groupFormApi.js +8 -14
- package/dist/components/tt-form/src/group-form/lazyContext.d.ts +18 -0
- package/dist/components/tt-form/src/group-form/lazyContext.js +64 -36
- package/dist/components/tt-form/src/group-form/types.d.ts +39 -6
- package/dist/components/tt-form/src/group-form/useGroupForm.d.ts +7 -5
- package/dist/components/tt-form/src/types.d.ts +58 -26
- package/dist/components/tt-form/src/useForm.d.ts +1 -1
- package/dist/components/tt-form/src/useForm.js +5 -5
- package/dist/components/tt-modal-form/props.d.ts +9 -4
- package/dist/components/tt-modal-form/useModalForm.d.ts +1 -1
- package/dist/components/tt-table/index.d.ts +15 -0
- package/dist/components/tt-table/src/Table.vue.d.ts +9 -0
- package/dist/components/tt-table/src/Table.vue.js +240 -242
- package/dist/components/tt-table/src/TableForm.vue.d.ts +15 -4
- package/dist/components/tt-table/src/TableForm.vue.js +232 -202
- package/dist/components/tt-table/src/hooks/usePagination.d.ts +1 -1
- package/dist/components/tt-table/src/hooks/usePagination.js +38 -24
- package/dist/components/tt-table/src/hooks/useTableRender.d.ts +4 -4
- package/dist/components/tt-table/src/props.d.ts +12 -1
- package/dist/components/tt-table/src/props.js +14 -4
- package/dist/components/tt-table/src/types/table.d.ts +8 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +44 -10
- package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ke, useSlots as He, getCurrentInstance as Le, ref as ze, shallowReactive as je, onScopeDispose as ee, computed as b, unref as r, shallowRef as xe, toRaw as M, watch as S, toValue as y, onMounted as Ne, nextTick as te, createElementBlock as oe, openBlock as re, normalizeClass as K, createCommentVNode as We, createElementVNode as Ge, createVNode as O, renderSlot as l, createSlots as k, renderList as ae, withCtx as g, normalizeProps as ie, guardReactiveProps as se, mergeProps as ne, toHandlers as Je, isRef as qe } from "vue";
|
|
2
2
|
import "../../tt-button/index.js";
|
|
3
3
|
import "../../tt-checkbox/index.js";
|
|
4
4
|
import "../../tt-empty/index.js";
|
|
5
5
|
import "axios";
|
|
6
6
|
import "element-plus";
|
|
7
|
-
import { isFunction as
|
|
7
|
+
import { isFunction as le, isObject as Qe } from "../../../packages/utils/src/is.js";
|
|
8
8
|
import "dayjs";
|
|
9
9
|
import "numeral";
|
|
10
|
-
import { extractResourceFromApi as
|
|
10
|
+
import { extractResourceFromApi as Ue, generateTestId as D } from "../../../packages/utils/src/testid-helper.js";
|
|
11
11
|
import "xe-utils";
|
|
12
12
|
import "dayjs/plugin/utc";
|
|
13
13
|
import "dayjs/plugin/timezone";
|
|
14
|
-
import { mergeWithArrayOverride as
|
|
14
|
+
import { mergeWithArrayOverride as Xe } from "../../../packages/utils/src/merge.js";
|
|
15
15
|
import "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
16
16
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
17
17
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
@@ -25,16 +25,16 @@ import "../../tt-upload/index.js";
|
|
|
25
25
|
import "../../tt-api-component/index.js";
|
|
26
26
|
import "vee-validate";
|
|
27
27
|
import "../../../utils/uppercaseInput.js";
|
|
28
|
-
import { useForm as
|
|
28
|
+
import { useForm as Ye } from "../../tt-form/src/useForm.js";
|
|
29
29
|
import "zod";
|
|
30
30
|
import "@vee-validate/zod";
|
|
31
|
-
import { useStore as
|
|
31
|
+
import { useStore as Ze } from "@tanstack/vue-store";
|
|
32
32
|
import "es-toolkit/compat";
|
|
33
33
|
import "../../tt-form/src/shared/zod-defaults.js";
|
|
34
34
|
import "../../tt-nav-anchor/index.js";
|
|
35
35
|
import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
36
|
-
import { useDesign as
|
|
37
|
-
import { useDebounceFn as
|
|
36
|
+
import { useDesign as et } from "../../../packages/hooks/src/useDesign.js";
|
|
37
|
+
import { useDebounceFn as F } from "../../../packages/hooks/src/useDebounce.js";
|
|
38
38
|
import "vue-router";
|
|
39
39
|
import "../../tt-icon/index.js";
|
|
40
40
|
import "../../tt-form/src/components/Slot.js";
|
|
@@ -50,7 +50,7 @@ import "../../tt-drawer/index.js";
|
|
|
50
50
|
import "../../tt-modal/index.js";
|
|
51
51
|
import "../../tt-text/index.js";
|
|
52
52
|
import "../../../directives/disabled-tip/index.js";
|
|
53
|
-
import { GlobalConfig as
|
|
53
|
+
import { GlobalConfig as tt } from "../../../hooks/useSetup.js";
|
|
54
54
|
import "../../tt-log/index.js";
|
|
55
55
|
/* empty css */
|
|
56
56
|
/* empty css */
|
|
@@ -61,25 +61,25 @@ import "../../tt-log/index.js";
|
|
|
61
61
|
import "../../tt-loading/index.js";
|
|
62
62
|
import "../index.js";
|
|
63
63
|
import "../../../hooks/basicDataCodes.js";
|
|
64
|
-
import { useTemplateSlot as
|
|
65
|
-
import
|
|
64
|
+
import { useTemplateSlot as me } from "../../../hooks/useTemplateSlot.js";
|
|
65
|
+
import ot from "./components/TableColumnModal.vue2.js";
|
|
66
66
|
/* empty css */
|
|
67
|
-
import
|
|
68
|
-
import { basicTableEmits as
|
|
69
|
-
import { useColumnPersistence as
|
|
70
|
-
import { createTableFormContext as
|
|
71
|
-
import { useTableForm as
|
|
72
|
-
import { useSyncProps as
|
|
73
|
-
import { tableFormProps as
|
|
74
|
-
import
|
|
67
|
+
import rt from "./components/TableToolbarTools.vue.js";
|
|
68
|
+
import { basicTableEmits as at } from "./emits.js";
|
|
69
|
+
import { useColumnPersistence as it } from "./hooks/useColumnPersistence.js";
|
|
70
|
+
import { createTableFormContext as st } from "./hooks/useTableContext.js";
|
|
71
|
+
import { useTableForm as nt } from "./hooks/useTableForm.js";
|
|
72
|
+
import { useSyncProps as lt } from "./hooks/useSyncProps.js";
|
|
73
|
+
import { tableFormProps as mt } from "./props.js";
|
|
74
|
+
import ut from "./Table.vue.js";
|
|
75
75
|
/* empty css */
|
|
76
|
-
import { forwardedEventEntries as
|
|
77
|
-
import { TableFormApi as
|
|
78
|
-
import { provideFormActionTestIds as
|
|
79
|
-
const
|
|
76
|
+
import { forwardedEventEntries as pt } from "./table-mutation-events.js";
|
|
77
|
+
import { TableFormApi as ct } from "./utils/table-form-api.js";
|
|
78
|
+
import { provideFormActionTestIds as ft } from "./utils/context.js";
|
|
79
|
+
const dt = ["data-testid"], bt = ["data-testid"], zo = /* @__PURE__ */ ke({
|
|
80
80
|
name: "TtTableForm",
|
|
81
81
|
__name: "TableForm",
|
|
82
|
-
props:
|
|
82
|
+
props: mt,
|
|
83
83
|
emits: [
|
|
84
84
|
"register",
|
|
85
85
|
"columns-setting",
|
|
@@ -87,254 +87,284 @@ const lt = ["data-testid"], mt = ["data-testid"], Vo = /* @__PURE__ */ _e({
|
|
|
87
87
|
"export",
|
|
88
88
|
"import",
|
|
89
89
|
"set-columns",
|
|
90
|
-
...
|
|
90
|
+
...at
|
|
91
91
|
],
|
|
92
|
-
setup(
|
|
93
|
-
var
|
|
94
|
-
const
|
|
95
|
-
function
|
|
92
|
+
setup(ue, { expose: pe, emit: ce }) {
|
|
93
|
+
var Q, U, X;
|
|
94
|
+
const n = ue, v = ce, R = He(), h = Le(), { prefixCls: $ } = et("table-form");
|
|
95
|
+
function H() {
|
|
96
96
|
var e;
|
|
97
97
|
return Object.hasOwn(((e = h == null ? void 0 : h.vnode) == null ? void 0 : e.props) || {}, "table");
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
let
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
function
|
|
104
|
-
Object.assign(
|
|
99
|
+
const E = ze();
|
|
100
|
+
let o = n.tableFormApi;
|
|
101
|
+
o || (o = new ct(n), o.useStore = (e) => Ze(o.store, e));
|
|
102
|
+
const L = je({});
|
|
103
|
+
function z() {
|
|
104
|
+
Object.assign(L, M(o.store.state) || {});
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
var
|
|
109
|
-
if (
|
|
110
|
-
const e = (
|
|
111
|
-
return e ?
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
submit:
|
|
116
|
-
reset:
|
|
106
|
+
z(), ee(o.store.subscribe(z));
|
|
107
|
+
const m = b(() => L), T = b(() => {
|
|
108
|
+
var t;
|
|
109
|
+
if (n.testId) return n.testId;
|
|
110
|
+
const e = (t = r(m).table) == null ? void 0 : t.api;
|
|
111
|
+
return e ? Ue(e) : "table";
|
|
112
|
+
}), fe = b(() => D(r(T), "tableform")), de = b(() => D(r(T), "search-form-header"));
|
|
113
|
+
ft(
|
|
114
|
+
b(() => ({
|
|
115
|
+
submit: D(r(T), "search-btn-query"),
|
|
116
|
+
reset: D(r(T), "search-btn-reset")
|
|
117
117
|
}))
|
|
118
118
|
);
|
|
119
|
-
const { getSlotKeys:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
),
|
|
119
|
+
const { getSlotKeys: be, replaceSlotKey: ge } = me("form-"), { getSlotKeys: he, replaceSlotKey: we } = me("t-"), { getFormProps: _, getTableProps: u, getTableToolProps: Se, submitSearchQuery: j } = nt(
|
|
120
|
+
m,
|
|
121
|
+
o.tableApi.reload,
|
|
122
|
+
o.tableApi.getLoading,
|
|
123
|
+
o.tableApi.getPagination
|
|
124
|
+
), x = xe([]), ye = b(() => (n.table, !H() || !n.table ? !1 : (n.table.data, Object.hasOwn(M(n.table), "data"))));
|
|
125
125
|
let I = () => {
|
|
126
126
|
};
|
|
127
|
-
function
|
|
128
|
-
I(), I =
|
|
129
|
-
() =>
|
|
130
|
-
(
|
|
131
|
-
|
|
127
|
+
function Te(e) {
|
|
128
|
+
I(), I = S(
|
|
129
|
+
() => y(e),
|
|
130
|
+
(t) => {
|
|
131
|
+
x.value = t || [];
|
|
132
132
|
},
|
|
133
|
-
{ immediate: !0, deep:
|
|
133
|
+
{ immediate: !0, deep: qe(e) ? !1 : 1 }
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
if (
|
|
138
|
-
return
|
|
136
|
+
function Ce() {
|
|
137
|
+
if (n.table)
|
|
138
|
+
return n.table.data, M(n.table).data;
|
|
139
|
+
}
|
|
140
|
+
S(Ce, (e) => Te(e), { immediate: !0 });
|
|
141
|
+
async function Fe() {
|
|
142
|
+
await o.tableApi.reloadData([]), o.tableApi.setPagination({ total: 0 });
|
|
139
143
|
}
|
|
140
|
-
|
|
141
|
-
|
|
144
|
+
async function ve() {
|
|
145
|
+
return !r(m).useSearchForm || !a.isMounted ? {} : await a.getValues();
|
|
146
|
+
}
|
|
147
|
+
let V = !1;
|
|
148
|
+
async function P(e, t) {
|
|
149
|
+
const { tableSearchBefore: i } = r(m);
|
|
150
|
+
if (!le(i)) return !0;
|
|
151
|
+
if (V) return !1;
|
|
152
|
+
V = !0;
|
|
153
|
+
let s;
|
|
154
|
+
try {
|
|
155
|
+
s = await i(t || await ve(), e);
|
|
156
|
+
} catch {
|
|
157
|
+
return !1;
|
|
158
|
+
} finally {
|
|
159
|
+
V = !1;
|
|
160
|
+
}
|
|
161
|
+
if (c) return !1;
|
|
162
|
+
const { canSearch: p, clearData: w } = Qe(s) ? s : { canSearch: s, clearData: !1 };
|
|
163
|
+
return w && await Fe(), p !== !1;
|
|
164
|
+
}
|
|
165
|
+
async function Pe() {
|
|
166
|
+
return await P("page");
|
|
167
|
+
}
|
|
168
|
+
const { run: Ae } = F(
|
|
142
169
|
async () => {
|
|
143
|
-
const e = await
|
|
144
|
-
await
|
|
145
|
-
const
|
|
146
|
-
|
|
170
|
+
const e = await a.getValues();
|
|
171
|
+
await a.resetForm(e, { force: !0 });
|
|
172
|
+
const t = await a.getValues();
|
|
173
|
+
a.setLatestSubmissionValues(t), (await a.validate()).valid && await P("reset", t) && await j(t);
|
|
147
174
|
},
|
|
148
175
|
200,
|
|
149
176
|
{ leading: !0 }
|
|
150
|
-
), { run:
|
|
177
|
+
), { run: Me } = F(
|
|
151
178
|
async (e) => {
|
|
152
|
-
|
|
179
|
+
const t = e;
|
|
180
|
+
await P("submit", t) && (await o.grid.clearFilter(), await j(t));
|
|
153
181
|
},
|
|
154
182
|
200,
|
|
155
183
|
{ leading: !0 }
|
|
156
|
-
), [
|
|
157
|
-
...
|
|
158
|
-
handleSubmit:
|
|
159
|
-
handleReset:
|
|
184
|
+
), [Oe, a] = Ye({
|
|
185
|
+
...y(_),
|
|
186
|
+
handleSubmit: Me,
|
|
187
|
+
handleReset: Ae,
|
|
160
188
|
submitOnEnter: !0,
|
|
161
189
|
submitButtonOptions: {
|
|
162
|
-
content: (
|
|
190
|
+
content: (Q = tt.form) == null ? void 0 : Q.submitTitle
|
|
163
191
|
},
|
|
164
192
|
showCollapseButton: !0,
|
|
165
193
|
collapsed: !0,
|
|
166
194
|
collapseTriggerResize: !0,
|
|
167
195
|
collapsedRows: 3
|
|
168
|
-
}), { restoreColumns:
|
|
169
|
-
getTableProps:
|
|
170
|
-
getProps:
|
|
171
|
-
tableMethods:
|
|
196
|
+
}), { restoreColumns: De, saveColumns: N } = it({
|
|
197
|
+
getTableProps: u,
|
|
198
|
+
getProps: m,
|
|
199
|
+
tableMethods: o.tableApi
|
|
172
200
|
});
|
|
173
|
-
let
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
201
|
+
let c = !1;
|
|
202
|
+
const C = {};
|
|
203
|
+
pt.forEach(([e, t]) => {
|
|
204
|
+
C[t] = (...i) => v(e, ...i);
|
|
177
205
|
});
|
|
178
|
-
const { run:
|
|
179
|
-
if (
|
|
180
|
-
const e = (
|
|
181
|
-
e.length && await
|
|
206
|
+
const { run: Re } = F(async () => {
|
|
207
|
+
if (c || !r(u).useHttpCache) return;
|
|
208
|
+
const e = (o.tableApi.getTableColumns() || []).map((t) => t.field).filter(Boolean);
|
|
209
|
+
e.length && await N(JSON.stringify(e));
|
|
182
210
|
}, 300);
|
|
183
|
-
function
|
|
184
|
-
var
|
|
185
|
-
(
|
|
211
|
+
function $e(e) {
|
|
212
|
+
var t;
|
|
213
|
+
(t = C.columnDragend) == null || t.call(C, e), Re();
|
|
186
214
|
}
|
|
187
|
-
const
|
|
188
|
-
function
|
|
189
|
-
|
|
215
|
+
const Ee = b(() => ({ ...C, columnDragend: $e }));
|
|
216
|
+
function _e(e) {
|
|
217
|
+
o.setState((t) => t.table ? Xe(e, t) : {}), e.table && o.tableApi.setState(e.table), e.form && (a == null || a.setState(e.form));
|
|
190
218
|
}
|
|
191
|
-
const { run:
|
|
219
|
+
const { run: Ie } = F(
|
|
192
220
|
async (e) => {
|
|
193
|
-
if (
|
|
194
|
-
if (!(await
|
|
195
|
-
const
|
|
196
|
-
await
|
|
221
|
+
if (a.isMounted && r(m).useSearchForm) {
|
|
222
|
+
if (!(await a.validate()).valid) return;
|
|
223
|
+
const i = await a.getValues();
|
|
224
|
+
await o.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo, ...i } });
|
|
197
225
|
return;
|
|
198
226
|
}
|
|
199
|
-
await
|
|
227
|
+
await o.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo } });
|
|
200
228
|
},
|
|
201
229
|
200,
|
|
202
230
|
{ leading: !0 }
|
|
203
|
-
),
|
|
204
|
-
tableMethods:
|
|
205
|
-
formMethods:
|
|
206
|
-
setTableProps:
|
|
207
|
-
setFormProps:
|
|
208
|
-
setProps:
|
|
209
|
-
reload:
|
|
210
|
-
selectedKeys:
|
|
231
|
+
), A = {
|
|
232
|
+
tableMethods: o.tableApi,
|
|
233
|
+
formMethods: a,
|
|
234
|
+
setTableProps: o.tableApi.setState,
|
|
235
|
+
setFormProps: a.setState,
|
|
236
|
+
setProps: _e,
|
|
237
|
+
reload: Ie,
|
|
238
|
+
selectedKeys: b(() => y(o.tableApi.selectedKeys))
|
|
211
239
|
};
|
|
212
|
-
async function
|
|
213
|
-
|
|
214
|
-
|
|
240
|
+
async function Ve() {
|
|
241
|
+
if (!await P("refresh")) return;
|
|
242
|
+
const { tableRefreshBefore: e } = r(m);
|
|
243
|
+
le(e) && await e(), A.reload();
|
|
215
244
|
}
|
|
216
|
-
let
|
|
217
|
-
const { run:
|
|
218
|
-
var
|
|
219
|
-
if (await
|
|
220
|
-
const { innerWidth: e, innerHeight:
|
|
221
|
-
if (
|
|
222
|
-
if (!r(
|
|
223
|
-
(
|
|
245
|
+
let B = { width: window.innerWidth, height: window.innerHeight };
|
|
246
|
+
const { run: W } = F(async () => {
|
|
247
|
+
var s, p;
|
|
248
|
+
if (await te(), c) return;
|
|
249
|
+
const { innerWidth: e, innerHeight: t } = window, i = e !== B.width || t !== B.height;
|
|
250
|
+
if (B = { width: e, height: t }, !i) {
|
|
251
|
+
if (!r(u).autoHeight) return;
|
|
252
|
+
(s = o.tableApi) == null || s.redoHeight(!1);
|
|
224
253
|
return;
|
|
225
254
|
}
|
|
226
|
-
(
|
|
255
|
+
(p = o.tableApi) == null || p.redoHeight();
|
|
227
256
|
}, 100);
|
|
228
|
-
async function
|
|
229
|
-
var
|
|
230
|
-
if (
|
|
231
|
-
const
|
|
257
|
+
async function Be(e) {
|
|
258
|
+
var p, w;
|
|
259
|
+
if (c) return;
|
|
260
|
+
const t = y((w = (p = r(m)) == null ? void 0 : p.table) == null ? void 0 : w.columns) || [], i = new Map(t.map((f) => [f.field, f])), s = e.checkedModel.map((f) => i.get(f)).filter(Boolean);
|
|
232
261
|
if (e.isExport) {
|
|
233
|
-
|
|
262
|
+
v("export", e.checkedModel, e.modalApi);
|
|
234
263
|
return;
|
|
235
264
|
}
|
|
236
265
|
e.modalApi.setModalProps({ confirmLoading: !0 });
|
|
237
266
|
try {
|
|
238
|
-
if (r(
|
|
239
|
-
|
|
267
|
+
if (r(u).useHttpCache && await N(JSON.stringify(e.checkedModel)), c) return;
|
|
268
|
+
o.tableApi.setTableColumns(s), e.modalApi.closeModal(), v("set-columns", s);
|
|
240
269
|
} finally {
|
|
241
|
-
|
|
270
|
+
c || e.modalApi.setModalProps({ confirmLoading: !1 });
|
|
242
271
|
}
|
|
243
272
|
}
|
|
244
|
-
function
|
|
245
|
-
var
|
|
246
|
-
const { notSetColumnField:
|
|
247
|
-
(
|
|
248
|
-
columns: (
|
|
249
|
-
displayFields:
|
|
250
|
-
disabledColumnField:
|
|
273
|
+
function G(e, t = !1) {
|
|
274
|
+
var f, Y, Z;
|
|
275
|
+
const { notSetColumnField: i, columns: s } = r(u), p = ((((f = o.tableApi.getTableInstance()) == null ? void 0 : f.getTableColumn()) || {}).visibleColumn || []).map((d) => d.field).filter(Boolean), w = (y(s) || []).filter((d) => d.visible === !0 || d.visible === void 0).map((d) => d.field);
|
|
276
|
+
(Y = E.value) == null || Y.openModal({
|
|
277
|
+
columns: (y(s) || []).filter((d) => d.visible !== !1),
|
|
278
|
+
displayFields: t ? w : p,
|
|
279
|
+
disabledColumnField: i || [],
|
|
251
280
|
isExport: e
|
|
252
|
-
}), (
|
|
253
|
-
}
|
|
254
|
-
function W(e = !1) {
|
|
255
|
-
N(!1, e);
|
|
281
|
+
}), (Z = E.value) == null || Z.setModalProps({ title: e ? "自定义导出" : "列设置" });
|
|
256
282
|
}
|
|
257
283
|
function J(e = !1) {
|
|
258
|
-
|
|
284
|
+
G(!1, e);
|
|
285
|
+
}
|
|
286
|
+
function q(e = !1) {
|
|
287
|
+
G(!0, e);
|
|
259
288
|
}
|
|
260
|
-
function
|
|
261
|
-
const e =
|
|
262
|
-
if (!
|
|
263
|
-
const
|
|
264
|
-
return Object.keys(
|
|
265
|
-
|
|
266
|
-
}),
|
|
289
|
+
function Ke() {
|
|
290
|
+
const e = n.table;
|
|
291
|
+
if (!H() || !e) return;
|
|
292
|
+
const t = {};
|
|
293
|
+
return Object.keys(M(e)).forEach((i) => {
|
|
294
|
+
i !== "data" && Object.assign(t, { [i]: e[i] });
|
|
295
|
+
}), t;
|
|
267
296
|
}
|
|
268
|
-
return
|
|
269
|
-
|
|
297
|
+
return lt(n, o.setState, ["tableFormApi", "table"]), S(
|
|
298
|
+
Ke,
|
|
270
299
|
(e) => {
|
|
271
|
-
e &&
|
|
300
|
+
e && o.setState({ table: e });
|
|
272
301
|
},
|
|
273
302
|
{ deep: !0, immediate: !0 }
|
|
274
|
-
),
|
|
275
|
-
() =>
|
|
303
|
+
), st({ formInstance: a }), S(
|
|
304
|
+
() => o.tableApi.getLoading.value,
|
|
276
305
|
(e) => {
|
|
277
|
-
|
|
306
|
+
a == null || a.setState({ submitButtonOptions: { loading: e } });
|
|
278
307
|
},
|
|
279
|
-
{ immediate: (
|
|
280
|
-
),
|
|
281
|
-
var
|
|
282
|
-
return (
|
|
283
|
-
}),
|
|
284
|
-
h &&
|
|
285
|
-
|
|
286
|
-
}), window.addEventListener("resize",
|
|
287
|
-
}),
|
|
288
|
-
|
|
289
|
-
}),
|
|
290
|
-
class:
|
|
291
|
-
"data-testid":
|
|
308
|
+
{ immediate: (X = (U = o.store.state) == null ? void 0 : U.table) == null ? void 0 : X.immediate }
|
|
309
|
+
), S(_, (e) => a == null ? void 0 : a.setState(e)), S(u, (e) => {
|
|
310
|
+
var t;
|
|
311
|
+
return (t = o.tableApi) == null ? void 0 : t.setState(e);
|
|
312
|
+
}), Ne(() => {
|
|
313
|
+
h && v("register", A, h.uid), o.mount(A, a), a == null || a.setState(r(_)), te(() => {
|
|
314
|
+
c || De();
|
|
315
|
+
}), window.addEventListener("resize", W);
|
|
316
|
+
}), ee(() => {
|
|
317
|
+
c = !0, I(), o == null || o.unmount(), window.removeEventListener("resize", W);
|
|
318
|
+
}), pe({ ...A, instance: h }), (e, t) => (re(), oe("div", {
|
|
319
|
+
class: K(r($)),
|
|
320
|
+
"data-testid": fe.value
|
|
292
321
|
}, [
|
|
293
|
-
|
|
322
|
+
m.value.useSearchForm ? (re(), oe("div", {
|
|
294
323
|
key: 0,
|
|
295
|
-
class:
|
|
296
|
-
"data-testid":
|
|
324
|
+
class: K(`${r($)}-header`),
|
|
325
|
+
"data-testid": de.value
|
|
297
326
|
}, [
|
|
298
|
-
|
|
327
|
+
O(r(Oe), {
|
|
299
328
|
"test-id": `${T.value}-search-form`
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
-
name: r(
|
|
303
|
-
fn: g((
|
|
304
|
-
l(e.$slots,
|
|
329
|
+
}, k({ _: 2 }, [
|
|
330
|
+
ae(r(be)(r(R)), (i) => ({
|
|
331
|
+
name: r(ge)(i),
|
|
332
|
+
fn: g((s) => [
|
|
333
|
+
l(e.$slots, i, ie(se(s || {})))
|
|
305
334
|
])
|
|
306
335
|
}))
|
|
307
336
|
]), 1032, ["test-id"]),
|
|
308
337
|
l(e.$slots, "header-down")
|
|
309
|
-
], 10,
|
|
310
|
-
|
|
311
|
-
class:
|
|
312
|
-
[`${r(
|
|
338
|
+
], 10, bt)) : We("", !0),
|
|
339
|
+
Ge("div", {
|
|
340
|
+
class: K({
|
|
341
|
+
[`${r($)}-wrapper`]: !0,
|
|
313
342
|
"pt-(--tt-base-padding)!": !0,
|
|
314
|
-
"pb-(--tt-base-padding)!": !r(
|
|
343
|
+
"pb-(--tt-base-padding)!": !r(u).showPager
|
|
315
344
|
})
|
|
316
345
|
}, [
|
|
317
346
|
l(e.$slots, "table-top"),
|
|
318
|
-
|
|
319
|
-
...r(
|
|
320
|
-
...
|
|
347
|
+
O(ut, ne({
|
|
348
|
+
...r(u),
|
|
349
|
+
...ye.value ? { data: x.value } : {},
|
|
350
|
+
beforePageChange: Pe
|
|
321
351
|
}, {
|
|
322
|
-
"form-api": r(
|
|
323
|
-
"table-api": r(
|
|
324
|
-
},
|
|
325
|
-
|
|
326
|
-
name: r(
|
|
327
|
-
fn: g((
|
|
328
|
-
l(e.$slots,
|
|
352
|
+
"form-api": r(a),
|
|
353
|
+
"table-api": r(o).tableApi
|
|
354
|
+
}, Je(Ee.value)), k({ _: 2 }, [
|
|
355
|
+
ae(r(he)(r(R)), (i) => ({
|
|
356
|
+
name: r(we)(i),
|
|
357
|
+
fn: g((s) => [
|
|
358
|
+
l(e.$slots, i, ie(se(s || {})))
|
|
329
359
|
])
|
|
330
360
|
})),
|
|
331
|
-
r(
|
|
361
|
+
r(u).showToolbar ? {
|
|
332
362
|
name: "toolbar_tools",
|
|
333
363
|
fn: g(() => [
|
|
334
|
-
|
|
335
|
-
onOnRefresh:
|
|
336
|
-
onOnExport:
|
|
337
|
-
onOnColumnsSetting:
|
|
364
|
+
O(rt, ne(r(Se), {
|
|
365
|
+
onOnRefresh: Ve,
|
|
366
|
+
onOnExport: q,
|
|
367
|
+
onOnColumnsSetting: J
|
|
338
368
|
}), {
|
|
339
369
|
"toolbar-left": g(() => [
|
|
340
370
|
l(e.$slots, "t-toolbar_tools-left")
|
|
@@ -351,19 +381,19 @@ const lt = ["data-testid"], mt = ["data-testid"], Vo = /* @__PURE__ */ _e({
|
|
|
351
381
|
]), 1040, ["form-api", "table-api"]),
|
|
352
382
|
l(e.$slots, "table-bottom")
|
|
353
383
|
], 2),
|
|
354
|
-
|
|
384
|
+
O(ot, {
|
|
355
385
|
ref_key: "columnModalRef",
|
|
356
|
-
ref:
|
|
357
|
-
"open-export":
|
|
358
|
-
"open-column":
|
|
359
|
-
onOnSubmit:
|
|
360
|
-
},
|
|
386
|
+
ref: E,
|
|
387
|
+
"open-export": q,
|
|
388
|
+
"open-column": J,
|
|
389
|
+
onOnSubmit: Be
|
|
390
|
+
}, k({
|
|
361
391
|
beforeFooter: g(() => [
|
|
362
392
|
l(e.$slots, "t-column-modal-before-footer")
|
|
363
393
|
]),
|
|
364
394
|
_: 2
|
|
365
395
|
}, [
|
|
366
|
-
r(
|
|
396
|
+
r(R)["t-column-modal-title"] ? {
|
|
367
397
|
name: "title",
|
|
368
398
|
fn: g(() => [
|
|
369
399
|
l(e.$slots, "t-column-modal-title")
|
|
@@ -371,9 +401,9 @@ const lt = ["data-testid"], mt = ["data-testid"], Vo = /* @__PURE__ */ _e({
|
|
|
371
401
|
key: "0"
|
|
372
402
|
} : void 0
|
|
373
403
|
]), 1536)
|
|
374
|
-
], 10,
|
|
404
|
+
], 10, dt));
|
|
375
405
|
}
|
|
376
406
|
});
|
|
377
407
|
export {
|
|
378
|
-
|
|
408
|
+
zo as default
|
|
379
409
|
};
|
|
@@ -104,6 +104,6 @@ export declare function usePagination(propsRef: ComputedRef<TtTableProps>, emit:
|
|
|
104
104
|
paginationInfo: ComputedRef<VxeGridPropTypes.PagerConfig | undefined>;
|
|
105
105
|
getPagination: () => VxeGridPropTypes.PagerConfig | undefined;
|
|
106
106
|
setPagination: (info: Partial<PagerConfig>) => void;
|
|
107
|
-
onPageChange: (data: VxePagerDefines.PageChangeEventParams | Parameters<VxePagerEvents.PageChange>[0]) => void
|
|
107
|
+
onPageChange: (data: VxePagerDefines.PageChangeEventParams | Parameters<VxePagerEvents.PageChange>[0]) => Promise<void>;
|
|
108
108
|
};
|
|
109
109
|
export {};
|