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