@dazhicheng/ui 1.6.19 → 1.6.21
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 +0 -6
- 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/index.d.ts +1 -0
- package/dist/components/tt-modal/index.js +8 -3
- package/dist/components/tt-modal/src/RenderModal.vue.js +224 -210
- package/dist/components/tt-modal/src/hooks/useModalRender.js +66 -67
- package/dist/components/tt-modal/src/index.js +9 -7
- package/dist/components/tt-modal/src/utils/modal-api.d.ts +9 -3
- package/dist/components/tt-modal/src/utils/modal-api.js +42 -36
- package/dist/components/tt-modal/src/utils/modal-close-transition.d.ts +13 -0
- package/dist/components/tt-modal/src/utils/modal-close-transition.js +13 -0
- package/dist/components/tt-modal/src/utils/modal-host-app.d.ts +5 -0
- package/dist/components/tt-modal/src/utils/modal-host-app.js +12 -0
- package/dist/components/tt-modal/src/utils/modal-scope.d.ts +21 -0
- package/dist/components/tt-modal/src/utils/modal-scope.js +20 -0
- package/dist/components/tt-modal/src/utils/modal-service.d.ts +23 -0
- package/dist/components/tt-modal/src/utils/modal-service.js +51 -0
- package/dist/components/tt-modal/src/utils/modal-stack.d.ts +14 -13
- package/dist/components/tt-modal/src/utils/modal-stack.js +20 -9
- package/dist/components/tt-modal/src/utils/modal-z-index.d.ts +15 -0
- package/dist/components/tt-modal/src/utils/modal-z-index.js +24 -0
- package/dist/components/tt-modal/src/utils/resolve-modal-target.d.ts +14 -0
- package/dist/components/tt-modal/src/utils/resolve-modal-target.js +83 -47
- 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 +7 -5
- package/dist/components/tt-table/src/TableForm.vue.js +199 -180
- 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 +6 -0
- package/dist/components/tt-table/src/props.js +5 -0
- package/dist/components/tt-table/src/types/table.d.ts +8 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +29 -14
- package/dist/components/tt-table/src/utils/table-form-api.d.ts +11 -11
- package/dist/index.js +132 -127
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { Slot, nextTick } from 'vue';
|
|
|
2
2
|
import { TtModalExtendedModalApi } from '../../tt-modal';
|
|
3
3
|
import { Recordable } from '../../../../../utils/src';
|
|
4
4
|
import { TtTableProps } from './types/table';
|
|
5
|
-
import { TtTableExtendedTableFormApi, TtTableFormProps } from './types/tableForm';
|
|
5
|
+
import { TtTableExtendedTableFormApi, TtTableFormProps, TtTableSearchBeforeResult, TtTableSearchTrigger } from './types/tableForm';
|
|
6
6
|
declare function __VLS_template(): {
|
|
7
7
|
attrs: Partial<{}>;
|
|
8
8
|
slots: Readonly<{
|
|
@@ -331,6 +331,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
331
331
|
immediate?: boolean;
|
|
332
332
|
afterFetch?: ((data: any[], res: globalThis.Recordable | globalThis.Recordable[]) => Promise<any[]>) | undefined;
|
|
333
333
|
beforeFetch?: (params: globalThis.Recordable) => Promise<globalThis.Recordable>;
|
|
334
|
+
beforePageChange?: (page: import("vxe-table").VxeGridPropTypes.PagerConfig) => boolean | Promise<boolean>;
|
|
334
335
|
isScrollFetch?: boolean;
|
|
335
336
|
showToolbar?: boolean;
|
|
336
337
|
columnsFieldSort?: string[];
|
|
@@ -370,10 +371,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
370
371
|
}>, {
|
|
371
372
|
instance: import('vue').ComponentInternalInstance | null;
|
|
372
373
|
setTableProps: (props: Partial<TtTableProps<any>>) => void;
|
|
373
|
-
setFormProps: (props: import('../../../index').
|
|
374
|
+
setFormProps: (props: Partial<import('../../../index').TtFormProps<Record<string, any>>>) => void;
|
|
374
375
|
tableMethods: import('../../../index').TtTableMethods<any>;
|
|
375
|
-
formMethods: import('../../../index').TtTableRenderFormInstance
|
|
376
|
-
setProps: (props: Partial<TtTableFormProps<any
|
|
376
|
+
formMethods: import('../../../index').TtTableRenderFormInstance<Record<string, any>>;
|
|
377
|
+
setProps: (props: Partial<TtTableFormProps<any, Record<string, any>>>) => void;
|
|
377
378
|
reload: import('../../../index').TtTableMethods<Row>["reload"];
|
|
378
379
|
selectedKeys: import('vue').MaybeRef<import('../../../index').TtSelectRowKeysType>;
|
|
379
380
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
@@ -558,6 +559,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
558
559
|
immediate?: boolean;
|
|
559
560
|
afterFetch?: ((data: any[], res: globalThis.Recordable | globalThis.Recordable[]) => Promise<any[]>) | undefined;
|
|
560
561
|
beforeFetch?: (params: globalThis.Recordable) => Promise<globalThis.Recordable>;
|
|
562
|
+
beforePageChange?: (page: import("vxe-table").VxeGridPropTypes.PagerConfig) => boolean | Promise<boolean>;
|
|
561
563
|
isScrollFetch?: boolean;
|
|
562
564
|
showToolbar?: boolean;
|
|
563
565
|
columnsFieldSort?: string[];
|
|
@@ -602,7 +604,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
602
604
|
handleSearchInfoFn: Fn<any, any>;
|
|
603
605
|
toolConfig: import('../../../index').TtTableToolsProps;
|
|
604
606
|
tableRefreshBefore: Fn<any, any>;
|
|
605
|
-
tableSearchBefore: (values:
|
|
607
|
+
tableSearchBefore: (values: Record<string, any>, trigger: TtTableSearchTrigger) => TtTableSearchBeforeResult | Promise<TtTableSearchBeforeResult>;
|
|
606
608
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
607
609
|
columnModalRef: ({
|
|
608
610
|
$: import('vue').ComponentInternalInstance;
|
|
@@ -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,121 +87,138 @@ const ct = ["data-testid"], ut = ["data-testid"], ko = /* @__PURE__ */ Ve({
|
|
|
87
87
|
"export",
|
|
88
88
|
"import",
|
|
89
89
|
"set-columns",
|
|
90
|
-
...
|
|
90
|
+
...at
|
|
91
91
|
],
|
|
92
|
-
setup(
|
|
93
|
-
var
|
|
94
|
-
const n =
|
|
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
|
-
return Object.hasOwn(((e =
|
|
97
|
+
return Object.hasOwn(((e = h == null ? void 0 : h.vnode) == null ? void 0 : e.props) || {}, "table");
|
|
98
98
|
}
|
|
99
|
-
const E =
|
|
99
|
+
const E = ze();
|
|
100
100
|
let o = n.tableFormApi;
|
|
101
|
-
o || (o = new
|
|
102
|
-
const
|
|
103
|
-
function
|
|
104
|
-
Object.assign(
|
|
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
|
|
106
|
+
z(), ee(o.store.subscribe(z));
|
|
107
|
+
const m = b(() => L), T = b(() => {
|
|
108
108
|
var t;
|
|
109
109
|
if (n.testId) return n.testId;
|
|
110
|
-
const e = (t = r(
|
|
111
|
-
return e ?
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
submit:
|
|
116
|
-
reset:
|
|
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
|
-
|
|
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
121
|
o.tableApi.reload,
|
|
122
122
|
o.tableApi.getLoading,
|
|
123
123
|
o.tableApi.getPagination
|
|
124
|
-
),
|
|
125
|
-
let
|
|
124
|
+
), x = xe([]), ye = b(() => (n.table, !H() || !n.table ? !1 : (n.table.data, Object.hasOwn(M(n.table), "data"))));
|
|
125
|
+
let I = () => {
|
|
126
126
|
};
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
() =>
|
|
127
|
+
function Te(e) {
|
|
128
|
+
I(), I = S(
|
|
129
|
+
() => y(e),
|
|
130
130
|
(t) => {
|
|
131
|
-
|
|
131
|
+
x.value = t || [];
|
|
132
132
|
},
|
|
133
|
-
{ immediate: !0, deep:
|
|
133
|
+
{ immediate: !0, deep: qe(e) ? !1 : 1 }
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Ce() {
|
|
137
137
|
if (n.table)
|
|
138
|
-
return n.table.data,
|
|
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 });
|
|
143
|
+
}
|
|
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;
|
|
139
164
|
}
|
|
140
|
-
|
|
141
|
-
|
|
165
|
+
async function Pe() {
|
|
166
|
+
return await P("page");
|
|
167
|
+
}
|
|
168
|
+
const { run: Ae } = F(
|
|
142
169
|
async () => {
|
|
143
170
|
const e = await a.getValues();
|
|
144
171
|
await a.resetForm(e, { force: !0 });
|
|
145
172
|
const t = await a.getValues();
|
|
146
|
-
a.setLatestSubmissionValues(t), (await a.validate()).valid &&
|
|
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
|
-
)
|
|
151
|
-
async function ve() {
|
|
152
|
-
await o.tableApi.reloadData([]), o.tableApi.setPagination({ currentPage: 1, total: 0 });
|
|
153
|
-
}
|
|
154
|
-
async function Ce(e) {
|
|
155
|
-
const { tableSearchBefore: t } = r(c);
|
|
156
|
-
if (!se(t)) return !0;
|
|
157
|
-
const i = await t(e), { canSearch: s, clearData: p } = Je(i) ? i : { canSearch: i, clearData: !1 };
|
|
158
|
-
return p && await ve(), s !== !1;
|
|
159
|
-
}
|
|
160
|
-
const { run: Fe } = v(
|
|
177
|
+
), { run: Me } = F(
|
|
161
178
|
async (e) => {
|
|
162
179
|
const t = e;
|
|
163
|
-
await
|
|
180
|
+
await P("submit", t) && (await o.grid.clearFilter(), await j(t));
|
|
164
181
|
},
|
|
165
182
|
200,
|
|
166
183
|
{ leading: !0 }
|
|
167
|
-
), [
|
|
168
|
-
...
|
|
169
|
-
handleSubmit:
|
|
170
|
-
handleReset:
|
|
184
|
+
), [Oe, a] = Ye({
|
|
185
|
+
...y(_),
|
|
186
|
+
handleSubmit: Me,
|
|
187
|
+
handleReset: Ae,
|
|
171
188
|
submitOnEnter: !0,
|
|
172
189
|
submitButtonOptions: {
|
|
173
|
-
content: (
|
|
190
|
+
content: (Q = tt.form) == null ? void 0 : Q.submitTitle
|
|
174
191
|
},
|
|
175
192
|
showCollapseButton: !0,
|
|
176
193
|
collapsed: !0,
|
|
177
194
|
collapseTriggerResize: !0,
|
|
178
195
|
collapsedRows: 3
|
|
179
|
-
}), { restoreColumns:
|
|
180
|
-
getTableProps:
|
|
181
|
-
getProps:
|
|
196
|
+
}), { restoreColumns: De, saveColumns: N } = it({
|
|
197
|
+
getTableProps: u,
|
|
198
|
+
getProps: m,
|
|
182
199
|
tableMethods: o.tableApi
|
|
183
200
|
});
|
|
184
|
-
let
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
201
|
+
let c = !1;
|
|
202
|
+
const C = {};
|
|
203
|
+
pt.forEach(([e, t]) => {
|
|
204
|
+
C[t] = (...i) => v(e, ...i);
|
|
188
205
|
});
|
|
189
|
-
const { run:
|
|
190
|
-
if (
|
|
206
|
+
const { run: Re } = F(async () => {
|
|
207
|
+
if (c || !r(u).useHttpCache) return;
|
|
191
208
|
const e = (o.tableApi.getTableColumns() || []).map((t) => t.field).filter(Boolean);
|
|
192
|
-
e.length && await
|
|
209
|
+
e.length && await N(JSON.stringify(e));
|
|
193
210
|
}, 300);
|
|
194
|
-
function
|
|
211
|
+
function $e(e) {
|
|
195
212
|
var t;
|
|
196
|
-
(t =
|
|
213
|
+
(t = C.columnDragend) == null || t.call(C, e), Re();
|
|
197
214
|
}
|
|
198
|
-
const
|
|
199
|
-
function
|
|
200
|
-
o.setState((t) => t.table ?
|
|
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));
|
|
201
218
|
}
|
|
202
|
-
const { run:
|
|
219
|
+
const { run: Ie } = F(
|
|
203
220
|
async (e) => {
|
|
204
|
-
if (a.isMounted && r(
|
|
221
|
+
if (a.isMounted && r(m).useSearchForm) {
|
|
205
222
|
if (!(await a.validate()).valid) return;
|
|
206
223
|
const i = await a.getValues();
|
|
207
224
|
await o.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo, ...i } });
|
|
@@ -211,146 +228,148 @@ const ct = ["data-testid"], ut = ["data-testid"], ko = /* @__PURE__ */ Ve({
|
|
|
211
228
|
},
|
|
212
229
|
200,
|
|
213
230
|
{ leading: !0 }
|
|
214
|
-
),
|
|
231
|
+
), A = {
|
|
215
232
|
tableMethods: o.tableApi,
|
|
216
233
|
formMethods: a,
|
|
217
234
|
setTableProps: o.tableApi.setState,
|
|
218
235
|
setFormProps: a.setState,
|
|
219
|
-
setProps:
|
|
220
|
-
reload:
|
|
221
|
-
selectedKeys:
|
|
236
|
+
setProps: _e,
|
|
237
|
+
reload: Ie,
|
|
238
|
+
selectedKeys: b(() => y(o.tableApi.selectedKeys))
|
|
222
239
|
};
|
|
223
|
-
async function
|
|
224
|
-
|
|
225
|
-
|
|
240
|
+
async function Ve() {
|
|
241
|
+
if (!await P("refresh")) return;
|
|
242
|
+
const { tableRefreshBefore: e } = r(m);
|
|
243
|
+
le(e) && await e(), A.reload();
|
|
226
244
|
}
|
|
227
|
-
let
|
|
228
|
-
const { run:
|
|
245
|
+
let B = { width: window.innerWidth, height: window.innerHeight };
|
|
246
|
+
const { run: W } = F(async () => {
|
|
229
247
|
var s, p;
|
|
230
|
-
if (await
|
|
231
|
-
const { innerWidth: e, innerHeight: t } = window, i = e !==
|
|
232
|
-
if (
|
|
233
|
-
if (!r(
|
|
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;
|
|
234
252
|
(s = o.tableApi) == null || s.redoHeight(!1);
|
|
235
253
|
return;
|
|
236
254
|
}
|
|
237
255
|
(p = o.tableApi) == null || p.redoHeight();
|
|
238
256
|
}, 100);
|
|
239
|
-
async function
|
|
240
|
-
var p,
|
|
241
|
-
if (
|
|
242
|
-
const t =
|
|
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);
|
|
243
261
|
if (e.isExport) {
|
|
244
|
-
|
|
262
|
+
v("export", e.checkedModel, e.modalApi);
|
|
245
263
|
return;
|
|
246
264
|
}
|
|
247
265
|
e.modalApi.setModalProps({ confirmLoading: !0 });
|
|
248
266
|
try {
|
|
249
|
-
if (r(
|
|
250
|
-
o.tableApi.setTableColumns(s), e.modalApi.closeModal(),
|
|
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);
|
|
251
269
|
} finally {
|
|
252
|
-
|
|
270
|
+
c || e.modalApi.setModalProps({ confirmLoading: !1 });
|
|
253
271
|
}
|
|
254
272
|
}
|
|
255
|
-
function
|
|
256
|
-
var
|
|
257
|
-
const { notSetColumnField: i, columns: s } = r(
|
|
258
|
-
(
|
|
259
|
-
columns: (
|
|
260
|
-
displayFields: t ?
|
|
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,
|
|
261
279
|
disabledColumnField: i || [],
|
|
262
280
|
isExport: e
|
|
263
|
-
}), (
|
|
264
|
-
}
|
|
265
|
-
function W(e = !1) {
|
|
266
|
-
N(!1, e);
|
|
281
|
+
}), (Z = E.value) == null || Z.setModalProps({ title: e ? "自定义导出" : "列设置" });
|
|
267
282
|
}
|
|
268
283
|
function J(e = !1) {
|
|
269
|
-
|
|
284
|
+
G(!1, e);
|
|
285
|
+
}
|
|
286
|
+
function q(e = !1) {
|
|
287
|
+
G(!0, e);
|
|
270
288
|
}
|
|
271
|
-
function
|
|
289
|
+
function Ke() {
|
|
272
290
|
const e = n.table;
|
|
273
|
-
if (!
|
|
291
|
+
if (!H() || !e) return;
|
|
274
292
|
const t = {};
|
|
275
|
-
return Object.keys(
|
|
293
|
+
return Object.keys(M(e)).forEach((i) => {
|
|
276
294
|
i !== "data" && Object.assign(t, { [i]: e[i] });
|
|
277
295
|
}), t;
|
|
278
296
|
}
|
|
279
|
-
return
|
|
280
|
-
|
|
297
|
+
return lt(n, o.setState, ["tableFormApi", "table"]), S(
|
|
298
|
+
Ke,
|
|
281
299
|
(e) => {
|
|
282
300
|
e && o.setState({ table: e });
|
|
283
301
|
},
|
|
284
302
|
{ deep: !0, immediate: !0 }
|
|
285
|
-
),
|
|
303
|
+
), st({ formInstance: a }), S(
|
|
286
304
|
() => o.tableApi.getLoading.value,
|
|
287
305
|
(e) => {
|
|
288
306
|
a == null || a.setState({ submitButtonOptions: { loading: e } });
|
|
289
307
|
},
|
|
290
|
-
{ immediate: (
|
|
291
|
-
),
|
|
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) => {
|
|
292
310
|
var t;
|
|
293
311
|
return (t = o.tableApi) == null ? void 0 : t.setState(e);
|
|
294
|
-
}),
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}), window.addEventListener("resize",
|
|
298
|
-
}),
|
|
299
|
-
|
|
300
|
-
}),
|
|
301
|
-
class:
|
|
302
|
-
"data-testid":
|
|
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
|
|
303
321
|
}, [
|
|
304
|
-
|
|
322
|
+
m.value.useSearchForm ? (re(), oe("div", {
|
|
305
323
|
key: 0,
|
|
306
|
-
class:
|
|
307
|
-
"data-testid":
|
|
324
|
+
class: K(`${r($)}-header`),
|
|
325
|
+
"data-testid": de.value
|
|
308
326
|
}, [
|
|
309
|
-
|
|
327
|
+
O(r(Oe), {
|
|
310
328
|
"test-id": `${T.value}-search-form`
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
name: r(
|
|
314
|
-
fn:
|
|
315
|
-
l(e.$slots, i,
|
|
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 || {})))
|
|
316
334
|
])
|
|
317
335
|
}))
|
|
318
336
|
]), 1032, ["test-id"]),
|
|
319
337
|
l(e.$slots, "header-down")
|
|
320
|
-
], 10,
|
|
321
|
-
|
|
322
|
-
class:
|
|
338
|
+
], 10, bt)) : We("", !0),
|
|
339
|
+
Ge("div", {
|
|
340
|
+
class: K({
|
|
323
341
|
[`${r($)}-wrapper`]: !0,
|
|
324
342
|
"pt-(--tt-base-padding)!": !0,
|
|
325
|
-
"pb-(--tt-base-padding)!": !r(
|
|
343
|
+
"pb-(--tt-base-padding)!": !r(u).showPager
|
|
326
344
|
})
|
|
327
345
|
}, [
|
|
328
346
|
l(e.$slots, "table-top"),
|
|
329
|
-
|
|
330
|
-
...r(
|
|
331
|
-
...
|
|
347
|
+
O(ut, ne({
|
|
348
|
+
...r(u),
|
|
349
|
+
...ye.value ? { data: x.value } : {},
|
|
350
|
+
beforePageChange: Pe
|
|
332
351
|
}, {
|
|
333
352
|
"form-api": r(a),
|
|
334
353
|
"table-api": r(o).tableApi
|
|
335
|
-
},
|
|
336
|
-
|
|
337
|
-
name: r(
|
|
338
|
-
fn:
|
|
339
|
-
l(e.$slots, i,
|
|
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 || {})))
|
|
340
359
|
])
|
|
341
360
|
})),
|
|
342
|
-
r(
|
|
361
|
+
r(u).showToolbar ? {
|
|
343
362
|
name: "toolbar_tools",
|
|
344
|
-
fn:
|
|
345
|
-
|
|
346
|
-
onOnRefresh:
|
|
347
|
-
onOnExport:
|
|
348
|
-
onOnColumnsSetting:
|
|
363
|
+
fn: g(() => [
|
|
364
|
+
O(rt, ne(r(Se), {
|
|
365
|
+
onOnRefresh: Ve,
|
|
366
|
+
onOnExport: q,
|
|
367
|
+
onOnColumnsSetting: J
|
|
349
368
|
}), {
|
|
350
|
-
"toolbar-left":
|
|
369
|
+
"toolbar-left": g(() => [
|
|
351
370
|
l(e.$slots, "t-toolbar_tools-left")
|
|
352
371
|
]),
|
|
353
|
-
"toolbar-right":
|
|
372
|
+
"toolbar-right": g(() => [
|
|
354
373
|
l(e.$slots, "t-toolbar_tools-right")
|
|
355
374
|
]),
|
|
356
375
|
_: 3
|
|
@@ -362,29 +381,29 @@ const ct = ["data-testid"], ut = ["data-testid"], ko = /* @__PURE__ */ Ve({
|
|
|
362
381
|
]), 1040, ["form-api", "table-api"]),
|
|
363
382
|
l(e.$slots, "table-bottom")
|
|
364
383
|
], 2),
|
|
365
|
-
|
|
384
|
+
O(ot, {
|
|
366
385
|
ref_key: "columnModalRef",
|
|
367
386
|
ref: E,
|
|
368
|
-
"open-export":
|
|
369
|
-
"open-column":
|
|
370
|
-
onOnSubmit:
|
|
371
|
-
},
|
|
372
|
-
beforeFooter:
|
|
387
|
+
"open-export": q,
|
|
388
|
+
"open-column": J,
|
|
389
|
+
onOnSubmit: Be
|
|
390
|
+
}, k({
|
|
391
|
+
beforeFooter: g(() => [
|
|
373
392
|
l(e.$slots, "t-column-modal-before-footer")
|
|
374
393
|
]),
|
|
375
394
|
_: 2
|
|
376
395
|
}, [
|
|
377
|
-
r(
|
|
396
|
+
r(R)["t-column-modal-title"] ? {
|
|
378
397
|
name: "title",
|
|
379
|
-
fn:
|
|
398
|
+
fn: g(() => [
|
|
380
399
|
l(e.$slots, "t-column-modal-title")
|
|
381
400
|
]),
|
|
382
401
|
key: "0"
|
|
383
402
|
} : void 0
|
|
384
403
|
]), 1536)
|
|
385
|
-
], 10,
|
|
404
|
+
], 10, dt));
|
|
386
405
|
}
|
|
387
406
|
});
|
|
388
407
|
export {
|
|
389
|
-
|
|
408
|
+
zo as default
|
|
390
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 {};
|