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