@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.
- package/dist/components/tt-custom-export-modal/index.d.ts +8 -0
- package/dist/components/tt-custom-export-modal/index.js +21 -0
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.d.ts +37 -0
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.js +322 -0
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue2.js +4 -0
- package/dist/components/tt-custom-export-modal/src/api.d.ts +57 -0
- package/dist/components/tt-custom-export-modal/src/api.js +44 -0
- package/dist/components/tt-custom-export-modal/src/assets/search.svg.js +8 -0
- package/dist/components/tt-custom-export-modal/src/assets/star.svg.js +7 -0
- package/dist/components/tt-custom-export-modal/src/assets/trash.svg.js +11 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.d.ts +275 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.js +7 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue2.js +321 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue.d.ts +28 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue.js +65 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue2.js +4 -0
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue.d.ts +31 -0
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue.js +152 -0
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue2.js +4 -0
- package/dist/components/tt-custom-export-modal/src/types/index.d.ts +74 -0
- package/dist/components/tt-custom-export-modal/src/types/report.d.ts +129 -0
- package/dist/components/tt-panel-select/src/index.vue.d.ts +2 -0
- package/dist/components/tt-panel-select/src/index.vue.js +53 -49
- package/dist/components/tt-table/index.js +5 -4
- package/dist/components/tt-table/src/TableForm.vue.d.ts +143 -0
- package/dist/components/tt-table/src/TableForm.vue.js +223 -198
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.d.ts +11 -0
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.js +33 -25
- package/dist/components/tt-table/src/hooks/useTableForm.js +13 -12
- package/dist/components/tt-table/src/props.d.ts +5 -0
- package/dist/components/tt-table/src/props.js +4 -0
- package/dist/components/tt-table/src/toolProps.d.ts +5 -0
- package/dist/components/tt-table/src/toolProps.js +5 -0
- package/dist/components/tt-table/src/types/table.d.ts +2 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +6 -0
- package/dist/components/tt-table/src/types/tableTools.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +102 -99
- package/dist/packages/utils/src/calc.js +26 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
38
|
-
import { useDebounceFn as
|
|
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
|
|
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
|
|
66
|
-
import
|
|
66
|
+
import { useTemplateSlot as de } from "../../../hooks/useTemplateSlot.js";
|
|
67
|
+
import nt from "./components/TableColumnModal.vue2.js";
|
|
67
68
|
/* empty css */
|
|
68
|
-
import
|
|
69
|
-
import { basicTableEmits as
|
|
70
|
-
import { useColumnPersistence as
|
|
71
|
-
import { createTableFormContext as
|
|
72
|
-
import { useTableForm as
|
|
73
|
-
import { useSyncProps as
|
|
74
|
-
import { tableFormProps as
|
|
75
|
-
import
|
|
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
|
|
78
|
-
import { TableFormApi as
|
|
79
|
-
import { provideFormActionTestIds as
|
|
80
|
-
const
|
|
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:
|
|
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
|
-
...
|
|
92
|
+
...mt
|
|
92
93
|
],
|
|
93
|
-
setup(
|
|
94
|
-
var
|
|
95
|
-
const n =
|
|
96
|
-
function
|
|
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 =
|
|
99
|
+
return Object.hasOwn(((e = S == null ? void 0 : S.vnode) == null ? void 0 : e.props) || {}, "table");
|
|
99
100
|
}
|
|
100
|
-
const
|
|
101
|
+
const I = ie(), W = ie();
|
|
101
102
|
let o = n.tableFormApi;
|
|
102
|
-
o || (o = new
|
|
103
|
-
const
|
|
104
|
-
function
|
|
105
|
-
Object.assign(
|
|
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
|
-
|
|
108
|
-
const
|
|
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(
|
|
112
|
-
return e ?
|
|
113
|
-
}),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
submit: D(r(
|
|
117
|
-
reset: D(r(
|
|
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:
|
|
121
|
-
|
|
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
|
-
),
|
|
126
|
-
let
|
|
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
|
|
129
|
-
|
|
130
|
-
() =>
|
|
129
|
+
function Ae(e) {
|
|
130
|
+
x(), x = C(
|
|
131
|
+
() => h(e),
|
|
131
132
|
(t) => {
|
|
132
|
-
|
|
133
|
+
U.value = t || [];
|
|
133
134
|
},
|
|
134
|
-
{ immediate: !0, deep:
|
|
135
|
+
{ immediate: !0, deep: Ye(e) ? !1 : 1 }
|
|
135
136
|
);
|
|
136
137
|
}
|
|
137
|
-
function
|
|
138
|
+
function Me() {
|
|
138
139
|
if (n.table)
|
|
139
|
-
return n.table.data,
|
|
140
|
+
return n.table.data, O(n.table).data;
|
|
140
141
|
}
|
|
141
|
-
|
|
142
|
-
async function
|
|
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
|
|
146
|
-
return !r(
|
|
146
|
+
async function Ee() {
|
|
147
|
+
return !r(l).useSearchForm || !a.isMounted ? {} : await a.getValues();
|
|
147
148
|
}
|
|
148
|
-
let
|
|
149
|
+
let K = !1;
|
|
149
150
|
async function P(e, t) {
|
|
150
|
-
const { tableSearchBefore: i } = r(
|
|
151
|
-
if (!
|
|
152
|
-
if (
|
|
153
|
-
|
|
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
|
|
157
|
+
s = await i(t || await Ee(), e);
|
|
157
158
|
} catch {
|
|
158
159
|
return !1;
|
|
159
160
|
} finally {
|
|
160
|
-
|
|
161
|
+
K = !1;
|
|
161
162
|
}
|
|
162
|
-
if (
|
|
163
|
-
const { canSearch:
|
|
164
|
-
return
|
|
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
|
|
167
|
+
async function Oe() {
|
|
167
168
|
return await P("page");
|
|
168
169
|
}
|
|
169
|
-
const { run:
|
|
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
|
|
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:
|
|
179
|
+
), { run: De } = A(
|
|
179
180
|
async (e) => {
|
|
180
181
|
const t = e;
|
|
181
|
-
await P("submit", t) && (await o.grid.clearFilter(), await
|
|
182
|
+
await P("submit", t) && (await o.grid.clearFilter(), await Q(t));
|
|
182
183
|
},
|
|
183
184
|
200,
|
|
184
185
|
{ leading: !0 }
|
|
185
|
-
), [
|
|
186
|
-
...
|
|
187
|
-
handleSubmit:
|
|
188
|
-
handleReset:
|
|
186
|
+
), [_e, a] = rt({
|
|
187
|
+
...h(V),
|
|
188
|
+
handleSubmit: De,
|
|
189
|
+
handleReset: Re,
|
|
189
190
|
submitOnEnter: !0,
|
|
190
191
|
submitButtonOptions: {
|
|
191
|
-
content: (
|
|
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:
|
|
198
|
-
getTableProps:
|
|
199
|
-
getProps:
|
|
198
|
+
}), { restoreColumns: $e, saveColumns: X } = ut({
|
|
199
|
+
getTableProps: f,
|
|
200
|
+
getProps: l,
|
|
200
201
|
tableMethods: o.tableApi
|
|
201
202
|
});
|
|
202
|
-
let
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
let b = !1;
|
|
204
|
+
const T = {};
|
|
205
|
+
gt.forEach(([e, t]) => {
|
|
206
|
+
T[t] = (...i) => M(e, ...i);
|
|
206
207
|
});
|
|
207
|
-
const { run:
|
|
208
|
-
if (
|
|
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
|
|
211
|
+
e.length && await X(JSON.stringify(e));
|
|
211
212
|
}, 300);
|
|
212
|
-
function
|
|
213
|
+
function Ve(e) {
|
|
213
214
|
var t;
|
|
214
|
-
(t =
|
|
215
|
+
(t = T.columnDragend) == null || t.call(T, e), Ie();
|
|
215
216
|
}
|
|
216
|
-
const
|
|
217
|
-
function
|
|
218
|
-
o.setState((t) => t.table ?
|
|
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:
|
|
221
|
+
const { run: ke } = A(
|
|
221
222
|
async (e) => {
|
|
222
|
-
if (a.isMounted && r(
|
|
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
|
-
),
|
|
233
|
+
), E = {
|
|
233
234
|
tableMethods: o.tableApi,
|
|
234
235
|
formMethods: a,
|
|
235
236
|
setTableProps: o.tableApi.setState,
|
|
236
237
|
setFormProps: a.setState,
|
|
237
|
-
setProps:
|
|
238
|
-
reload:
|
|
239
|
-
selectedKeys:
|
|
238
|
+
setProps: Ke,
|
|
239
|
+
reload: ke,
|
|
240
|
+
selectedKeys: g(() => h(o.tableApi.selectedKeys))
|
|
240
241
|
};
|
|
241
|
-
async function
|
|
242
|
+
async function Be() {
|
|
242
243
|
if (!await P("refresh")) return;
|
|
243
|
-
const { tableRefreshBefore: e } = r(
|
|
244
|
-
|
|
244
|
+
const { tableRefreshBefore: e } = r(l);
|
|
245
|
+
j(e) && await e(), E.reload();
|
|
245
246
|
}
|
|
246
|
-
let
|
|
247
|
-
const { run:
|
|
248
|
-
var s,
|
|
249
|
-
if (await
|
|
250
|
-
const { innerWidth: e, innerHeight: t } = window, i = e !==
|
|
251
|
-
if (
|
|
252
|
-
if (!r(
|
|
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
|
-
(
|
|
257
|
+
(m = o.tableApi) == null || m.redoHeight();
|
|
257
258
|
}, 100);
|
|
258
|
-
async function
|
|
259
|
-
var
|
|
260
|
-
if (
|
|
261
|
-
const t =
|
|
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
|
-
|
|
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(
|
|
269
|
-
o.tableApi.setTableColumns(s), e.modalApi.closeModal(),
|
|
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
|
-
|
|
272
|
+
b || e.modalApi.setModalProps({ confirmLoading: !1 });
|
|
272
273
|
}
|
|
273
274
|
}
|
|
274
|
-
function
|
|
275
|
-
var
|
|
276
|
-
const { notSetColumnField: i, columns: s } = r(
|
|
277
|
-
(
|
|
278
|
-
columns: (
|
|
279
|
-
displayFields: t ?
|
|
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
|
-
}), (
|
|
283
|
+
}), (F = I.value) == null || F.setModalProps({ title: e ? "自定义导出" : "列设置" });
|
|
284
|
+
}
|
|
285
|
+
function ee(e = !1) {
|
|
286
|
+
Z(!1, e);
|
|
283
287
|
}
|
|
284
|
-
function
|
|
285
|
-
|
|
288
|
+
function te(e = !1) {
|
|
289
|
+
Z(!0, e);
|
|
286
290
|
}
|
|
287
|
-
function
|
|
288
|
-
|
|
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
|
|
309
|
+
function ze() {
|
|
291
310
|
const e = n.table;
|
|
292
|
-
if (!
|
|
311
|
+
if (!N() || !e) return;
|
|
293
312
|
const t = {};
|
|
294
|
-
return Object.keys(
|
|
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
|
|
299
|
-
|
|
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
|
-
),
|
|
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: (
|
|
310
|
-
),
|
|
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
|
-
}),
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}), window.addEventListener("resize",
|
|
317
|
-
}),
|
|
318
|
-
|
|
319
|
-
}),
|
|
320
|
-
class:
|
|
321
|
-
"data-testid":
|
|
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
|
-
|
|
342
|
+
l.value.useSearchForm ? (B(), le("div", {
|
|
324
343
|
key: 0,
|
|
325
|
-
class:
|
|
326
|
-
"data-testid":
|
|
344
|
+
class: H(`${r($)}-header`),
|
|
345
|
+
"data-testid": Se.value
|
|
327
346
|
}, [
|
|
328
|
-
|
|
329
|
-
"test-id": `${
|
|
330
|
-
},
|
|
331
|
-
|
|
332
|
-
name: r(
|
|
333
|
-
fn:
|
|
334
|
-
|
|
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
|
-
|
|
339
|
-
], 10,
|
|
340
|
-
|
|
341
|
-
class:
|
|
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(
|
|
363
|
+
"pb-(--tt-base-padding)!": !r(f).showPager
|
|
345
364
|
})
|
|
346
365
|
}, [
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
...r(
|
|
350
|
-
...
|
|
351
|
-
beforePageChange:
|
|
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
|
-
},
|
|
356
|
-
|
|
357
|
-
name: r(
|
|
358
|
-
fn:
|
|
359
|
-
|
|
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(
|
|
381
|
+
r(f).showToolbar ? {
|
|
363
382
|
name: "toolbar_tools",
|
|
364
|
-
fn:
|
|
365
|
-
|
|
366
|
-
onOnRefresh:
|
|
367
|
-
onOnExport:
|
|
368
|
-
|
|
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":
|
|
371
|
-
|
|
390
|
+
"toolbar-left": w(() => [
|
|
391
|
+
c(e.$slots, "t-toolbar_tools-left")
|
|
372
392
|
]),
|
|
373
|
-
"toolbar-right":
|
|
374
|
-
|
|
393
|
+
"toolbar-right": w(() => [
|
|
394
|
+
c(e.$slots, "t-toolbar_tools-right")
|
|
375
395
|
]),
|
|
376
396
|
_: 3
|
|
377
397
|
}, 16),
|
|
378
|
-
|
|
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
|
-
|
|
403
|
+
c(e.$slots, "table-bottom")
|
|
384
404
|
], 2),
|
|
385
|
-
|
|
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:
|
|
388
|
-
"open-export":
|
|
389
|
-
"open-column":
|
|
390
|
-
onOnSubmit:
|
|
391
|
-
},
|
|
392
|
-
beforeFooter:
|
|
393
|
-
|
|
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(
|
|
422
|
+
r(_)["t-column-modal-title"] ? {
|
|
398
423
|
name: "title",
|
|
399
|
-
fn:
|
|
400
|
-
|
|
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,
|
|
430
|
+
], 10, St));
|
|
406
431
|
}
|
|
407
432
|
});
|
|
408
433
|
export {
|
|
409
|
-
|
|
434
|
+
qo as default
|
|
410
435
|
};
|