@dazhicheng/ui 1.6.46 → 1.6.48

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