@dazhicheng/ui 1.6.6 → 1.6.8
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-form/src/form-render/expandable.js +31 -32
- package/dist/components/tt-form/src/useFormContext.js +1 -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/src/utils/resolve-modal-target.js +1 -3
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
- package/dist/components/tt-table/index.d.ts +3 -15
- package/dist/components/tt-table/index.js +5 -4
- package/dist/components/tt-table/src/Table.vue.d.ts +1 -1
- package/dist/components/tt-table/src/Table.vue.js +3 -3
- package/dist/components/tt-table/src/TableForm.vue.d.ts +0 -9
- package/dist/components/tt-table/src/TableForm.vue.js +175 -167
- package/dist/components/tt-table/src/components/TableAction.vue.d.ts +2 -12
- package/dist/components/tt-table/src/components/TableAction.vue.js +78 -175
- package/dist/components/tt-table/src/hooks/useGridProps.js +64 -60
- package/dist/components/tt-table/src/hooks/useTableData.js +77 -74
- package/dist/components/tt-table/src/hooks/useTableForm.js +22 -23
- package/dist/components/tt-table/src/props.d.ts +0 -5
- package/dist/components/tt-table/src/props.js +22 -31
- package/dist/components/tt-table/src/types/table.d.ts +2 -1
- package/dist/components/tt-table/src/types/tableForm.d.ts +0 -2
- package/dist/components/tt-table/src/utils/table-api.d.ts +2 -1
- package/dist/components/tt-table/src/utils/table-api.js +3 -2
- package/dist/components/tt-table/src/utils/table-form-api.js +14 -15
- package/dist/components/tt-vtable/index.js +54 -0
- package/dist/components/tt-vtable/src/components/TtVTable.vue.d.ts +188 -0
- package/dist/components/tt-vtable/src/components/TtVTable.vue.js +227 -0
- package/dist/components/tt-vtable/src/components/TtVTable.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue.d.ts +32 -0
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue.js +121 -0
- package/dist/components/tt-vtable/src/components/TtVTableForm.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue.d.ts +64 -0
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue.js +97 -0
- package/dist/components/tt-vtable/src/components/VTableEmpty.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTablePagination.vue.d.ts +53 -0
- package/dist/components/tt-vtable/src/components/VTablePagination.vue.js +52 -0
- package/dist/components/tt-vtable/src/components/VTablePagination.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.d.ts +35 -0
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue.js +50 -0
- package/dist/components/tt-vtable/src/components/VTableSelectionAlert.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue.d.ts +63 -0
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue.js +126 -0
- package/dist/components/tt-vtable/src/components/VTableToolbar.vue2.js +4 -0
- package/dist/components/tt-vtable/src/components/VTableViewport.vue.js +133 -0
- package/dist/components/tt-vtable/src/components/VTableViewport.vue2.js +4 -0
- package/dist/components/tt-vtable/src/composables/useVTable.d.ts +41 -0
- package/dist/components/tt-vtable/src/composables/useVTable.js +25 -0
- package/dist/components/tt-vtable/src/composables/useVTableFormRender.d.ts +13 -0
- package/dist/components/tt-vtable/src/composables/useVTableFormRender.js +92 -0
- package/dist/components/tt-vtable/src/composables/useVTableRender.d.ts +13 -0
- package/dist/components/tt-vtable/src/composables/useVTableRender.js +13 -0
- package/dist/components/tt-vtable/src/engine/visactor/createListTable.d.ts +10 -0
- package/dist/components/tt-vtable/src/engine/visactor/createListTable.js +63 -0
- package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.d.ts +37 -0
- package/dist/components/tt-vtable/src/engine/visactor/createVueCellLayout.js +133 -0
- package/dist/components/tt-vtable/src/engine/visactor/index.d.ts +8 -0
- package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.d.ts +23 -0
- package/dist/components/tt-vtable/src/engine/visactor/native-boundaries.js +70 -0
- package/dist/components/tt-vtable/src/engine/visactor/record-adapter.d.ts +38 -0
- package/dist/components/tt-vtable/src/engine/visactor/record-adapter.js +41 -0
- package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.d.ts +45 -0
- package/dist/components/tt-vtable/src/engine/visactor/toColumnDefinitions.js +73 -0
- package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.d.ts +25 -0
- package/dist/components/tt-vtable/src/engine/visactor/toListTableOptions.js +25 -0
- package/dist/components/tt-vtable/src/engine/visactor/types.d.ts +29 -0
- package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.d.ts +36 -0
- package/dist/components/tt-vtable/src/features/column-preferences/column-preference-storage.js +52 -0
- package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.d.ts +74 -0
- package/dist/components/tt-vtable/src/features/column-preferences/useColumnPreferences.js +232 -0
- package/dist/components/tt-vtable/src/features/editing/useCellEditing.d.ts +48 -0
- package/dist/components/tt-vtable/src/features/editing/useCellEditing.js +102 -0
- package/dist/components/tt-vtable/src/features/form-integration/useVTableForm.d.ts +51 -0
- package/dist/components/tt-vtable/src/features/pagination/useTablePagination.d.ts +40 -0
- package/dist/components/tt-vtable/src/features/pagination/useTablePagination.js +51 -0
- package/dist/components/tt-vtable/src/features/querying/useRecordQuery.d.ts +38 -0
- package/dist/components/tt-vtable/src/features/querying/useRecordQuery.js +57 -0
- package/dist/components/tt-vtable/src/features/records/index.d.ts +3 -0
- package/dist/components/tt-vtable/src/features/records/record-index.d.ts +122 -0
- package/dist/components/tt-vtable/src/features/records/record-index.js +209 -0
- package/dist/components/tt-vtable/src/features/records/useRecordSource.d.ts +41 -0
- package/dist/components/tt-vtable/src/features/records/useRecordSource.js +249 -0
- package/dist/components/tt-vtable/src/features/selection/useRowSelection.d.ts +65 -0
- package/dist/components/tt-vtable/src/features/selection/useRowSelection.js +129 -0
- package/dist/components/tt-vtable/src/features/tree/useTreeRecords.d.ts +60 -0
- package/dist/components/tt-vtable/src/features/tree/useTreeRecords.js +125 -0
- package/dist/components/tt-vtable/src/public/index.d.ts +7 -0
- package/dist/components/tt-vtable/src/public/table-api.d.ts +215 -0
- package/dist/components/tt-vtable/src/public/table-column.d.ts +123 -0
- package/dist/components/tt-vtable/src/public/table-errors.d.ts +26 -0
- package/dist/components/tt-vtable/src/public/table-errors.js +26 -0
- package/dist/components/tt-vtable/src/public/table-events.d.ts +69 -0
- package/dist/components/tt-vtable/src/public/table-props.d.ts +216 -0
- package/dist/components/tt-vtable/src/public/table-slots.d.ts +37 -0
- package/dist/components/tt-vtable/src/runtime/createVTableController.d.ts +12 -0
- package/dist/components/tt-vtable/src/runtime/createVTableController.js +238 -0
- package/dist/components/tt-vtable/src/runtime/createVTableRuntime.d.ts +79 -0
- package/dist/components/tt-vtable/src/runtime/createVTableRuntime.js +380 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +129 -115
- package/dist/packages/utils/src/is.js +46 -37
- package/dist/style.css +1 -1
- package/package.json +3 -1
- package/dist/assets/svg/action_more.svg.js +0 -4
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as _e, useSlots as Ie, getCurrentInstance as De, ref as Ve, shallowReactive as Ke, onScopeDispose as Y, computed as u, unref as r, shallowRef as ke, toRaw as P, watch as w, toValue as S, onMounted as Be, nextTick as Z, createElementBlock as ee, openBlock as te, normalizeClass as V, createCommentVNode as He, createElementVNode as Le, createVNode as M, renderSlot as l, createSlots as K, renderList as oe, withCtx as g, normalizeProps as re, guardReactiveProps as ie, mergeProps as se, toHandlers as ze, isRef as xe } 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 je } from "../../../packages/utils/src/is.js";
|
|
8
8
|
import "dayjs";
|
|
9
9
|
import "numeral";
|
|
10
|
-
import { extractResourceFromApi as Ne, generateTestId as
|
|
10
|
+
import { extractResourceFromApi as Ne, generateTestId as O } from "../../../packages/utils/src/testid-helper.js";
|
|
11
11
|
import "xe-utils";
|
|
12
12
|
import "dayjs/plugin/utc";
|
|
13
13
|
import "dayjs/plugin/timezone";
|
|
14
|
-
import { mergeWithArrayOverride as
|
|
14
|
+
import { mergeWithArrayOverride as We } 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 Je } from "../../tt-form/src/useForm.js";
|
|
29
29
|
import "zod";
|
|
30
30
|
import "@vee-validate/zod";
|
|
31
|
-
import { useStore as
|
|
31
|
+
import { useStore as qe } 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 Ge } from "../../../packages/hooks/src/useDesign.js";
|
|
37
|
+
import { useDebounceFn as v } 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,8 +50,9 @@ 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 Qe } from "../../../hooks/useSetup.js";
|
|
54
54
|
import "../../tt-log/index.js";
|
|
55
|
+
import "../../tt-vtable/index.js";
|
|
55
56
|
/* empty css */
|
|
56
57
|
/* empty css */
|
|
57
58
|
/* empty css */
|
|
@@ -62,24 +63,24 @@ import "../../tt-loading/index.js";
|
|
|
62
63
|
import "../index.js";
|
|
63
64
|
import "../../../hooks/basicDataCodes.js";
|
|
64
65
|
import { useTemplateSlot as ae } from "../../../hooks/useTemplateSlot.js";
|
|
65
|
-
import
|
|
66
|
+
import Ue from "./components/TableColumnModal.vue2.js";
|
|
66
67
|
/* 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
|
|
68
|
+
import Xe from "./components/TableToolbarTools.vue.js";
|
|
69
|
+
import { basicTableEmits as Ye } from "./emits.js";
|
|
70
|
+
import { useColumnPersistence as Ze } from "./hooks/useColumnPersistence.js";
|
|
71
|
+
import { createTableFormContext as et } from "./hooks/useTableContext.js";
|
|
72
|
+
import { useTableForm as tt } from "./hooks/useTableForm.js";
|
|
73
|
+
import { useSyncProps as ot } from "./hooks/useSyncProps.js";
|
|
74
|
+
import { tableFormProps as rt } from "./props.js";
|
|
75
|
+
import it from "./Table.vue.js";
|
|
75
76
|
/* empty css */
|
|
76
77
|
import { forwardedEventEntries as st } from "./table-mutation-events.js";
|
|
77
78
|
import { TableFormApi as at } from "./utils/table-form-api.js";
|
|
78
|
-
import { provideFormActionTestIds as
|
|
79
|
-
const
|
|
79
|
+
import { provideFormActionTestIds as nt } from "./utils/context.js";
|
|
80
|
+
const lt = ["data-testid"], mt = ["data-testid"], Ko = /* @__PURE__ */ _e({
|
|
80
81
|
name: "TtTableForm",
|
|
81
82
|
__name: "TableForm",
|
|
82
|
-
props:
|
|
83
|
+
props: rt,
|
|
83
84
|
emits: [
|
|
84
85
|
"register",
|
|
85
86
|
"columns-setting",
|
|
@@ -87,286 +88,293 @@ const nt = ["data-testid"], lt = ["data-testid"], Do = /* @__PURE__ */ Ee({
|
|
|
87
88
|
"export",
|
|
88
89
|
"import",
|
|
89
90
|
"set-columns",
|
|
90
|
-
...
|
|
91
|
+
...Ye
|
|
91
92
|
],
|
|
92
|
-
setup(
|
|
93
|
-
var
|
|
94
|
-
const
|
|
95
|
-
function
|
|
93
|
+
setup(ne, { expose: le, emit: me }) {
|
|
94
|
+
var q, G, Q;
|
|
95
|
+
const a = ne, C = me, $ = Ie(), h = De(), { prefixCls: E } = Ge("table-form");
|
|
96
|
+
function k() {
|
|
96
97
|
var e;
|
|
97
|
-
return Object.hasOwn(((e =
|
|
98
|
+
return Object.hasOwn(((e = h == null ? void 0 : h.vnode) == null ? void 0 : e.props) || {}, "table");
|
|
98
99
|
}
|
|
99
|
-
const
|
|
100
|
-
let t =
|
|
101
|
-
t || (t = new at(
|
|
102
|
-
const
|
|
103
|
-
function
|
|
104
|
-
Object.assign(
|
|
100
|
+
const R = Ve();
|
|
101
|
+
let t = a.tableFormApi;
|
|
102
|
+
t || (t = new at(a), t.useStore = (e) => qe(t.store, e));
|
|
103
|
+
const B = Ke({});
|
|
104
|
+
function H() {
|
|
105
|
+
Object.assign(B, P(t.store.state) || {});
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
-
const c = u(() =>
|
|
107
|
+
H(), Y(t.store.subscribe(H));
|
|
108
|
+
const c = u(() => B), T = u(() => {
|
|
108
109
|
var o;
|
|
109
|
-
if (
|
|
110
|
+
if (a.testId) return a.testId;
|
|
110
111
|
const e = (o = r(c).table) == null ? void 0 : o.api;
|
|
111
112
|
return e ? Ne(e) : "table";
|
|
112
|
-
}),
|
|
113
|
-
|
|
113
|
+
}), pe = u(() => O(r(T), "tableform")), ue = u(() => O(r(T), "search-form-header"));
|
|
114
|
+
nt(
|
|
114
115
|
u(() => ({
|
|
115
|
-
submit:
|
|
116
|
-
reset:
|
|
116
|
+
submit: O(r(T), "search-btn-query"),
|
|
117
|
+
reset: O(r(T), "search-btn-reset")
|
|
117
118
|
}))
|
|
118
119
|
);
|
|
119
|
-
const { getSlotKeys:
|
|
120
|
+
const { getSlotKeys: ce, replaceSlotKey: de } = ae("form-"), { getSlotKeys: fe, replaceSlotKey: be } = ae("t-"), { getFormProps: _, getTableProps: m, getTableToolProps: ge, submitSearchQuery: L } = tt(
|
|
120
121
|
c,
|
|
121
122
|
t.tableApi.reload,
|
|
122
123
|
t.tableApi.getLoading,
|
|
123
124
|
t.tableApi.getPagination
|
|
124
|
-
), z =
|
|
125
|
-
let
|
|
125
|
+
), z = ke([]), he = u(() => (a.table, !k() || !a.table ? !1 : (a.table.data, Object.hasOwn(P(a.table), "data"))));
|
|
126
|
+
let I = () => {
|
|
126
127
|
};
|
|
127
|
-
function
|
|
128
|
-
|
|
128
|
+
function we(e) {
|
|
129
|
+
I(), I = w(
|
|
129
130
|
() => S(e),
|
|
130
131
|
(o) => {
|
|
131
132
|
z.value = o || [];
|
|
132
133
|
},
|
|
133
|
-
{ immediate: !0, deep:
|
|
134
|
+
{ immediate: !0, deep: xe(e) ? !1 : 1 }
|
|
134
135
|
);
|
|
135
136
|
}
|
|
136
137
|
function Se() {
|
|
137
|
-
if (
|
|
138
|
-
return
|
|
138
|
+
if (a.table)
|
|
139
|
+
return a.table.data, P(a.table).data;
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
-
const { run:
|
|
141
|
+
w(Se, (e) => we(e), { immediate: !0 });
|
|
142
|
+
const { run: Te } = v(
|
|
142
143
|
async () => {
|
|
143
|
-
const e = await
|
|
144
|
-
await
|
|
145
|
-
const o = await
|
|
146
|
-
|
|
144
|
+
const e = await i.getValues();
|
|
145
|
+
await i.resetForm(e, { force: !0 });
|
|
146
|
+
const o = await i.getValues();
|
|
147
|
+
i.setLatestSubmissionValues(o), (await i.validate()).valid && L(o);
|
|
147
148
|
},
|
|
148
149
|
200,
|
|
149
150
|
{ leading: !0 }
|
|
150
|
-
), { run:
|
|
151
|
+
), { run: ye } = v(
|
|
151
152
|
async (e) => {
|
|
152
153
|
await t.grid.clearFilter(), await L(e);
|
|
153
154
|
},
|
|
154
155
|
200,
|
|
155
156
|
{ leading: !0 }
|
|
156
|
-
), [
|
|
157
|
-
...S(
|
|
158
|
-
handleSubmit:
|
|
159
|
-
handleReset:
|
|
157
|
+
), [ve, i] = Je({
|
|
158
|
+
...S(_),
|
|
159
|
+
handleSubmit: ye,
|
|
160
|
+
handleReset: Te,
|
|
160
161
|
submitOnEnter: !0,
|
|
161
162
|
submitButtonOptions: {
|
|
162
|
-
content: (
|
|
163
|
+
content: (q = Qe.form) == null ? void 0 : q.submitTitle
|
|
163
164
|
},
|
|
164
165
|
showCollapseButton: !0,
|
|
165
166
|
collapsed: !0,
|
|
166
167
|
collapseTriggerResize: !0,
|
|
167
168
|
collapsedRows: 3
|
|
168
|
-
}), { restoreColumns:
|
|
169
|
+
}), { restoreColumns: Ce, saveColumns: x } = Ze({
|
|
169
170
|
getTableProps: m,
|
|
170
171
|
getProps: c,
|
|
171
172
|
tableMethods: t.tableApi
|
|
172
173
|
});
|
|
173
174
|
let d = !1;
|
|
174
|
-
const
|
|
175
|
+
const y = {};
|
|
175
176
|
st.forEach(([e, o]) => {
|
|
176
|
-
|
|
177
|
+
y[o] = (...s) => C(e, ...s);
|
|
177
178
|
});
|
|
178
|
-
const { run: Fe } =
|
|
179
|
+
const { run: Fe } = v(async () => {
|
|
179
180
|
if (d || !r(m).useHttpCache) return;
|
|
180
181
|
const e = (t.tableApi.getTableColumns() || []).map((o) => o.field).filter(Boolean);
|
|
181
|
-
e.length && await
|
|
182
|
+
e.length && await x(JSON.stringify(e));
|
|
182
183
|
}, 300);
|
|
183
|
-
function
|
|
184
|
+
function Ae(e) {
|
|
184
185
|
var o;
|
|
185
|
-
(o =
|
|
186
|
+
(o = y.columnDragend) == null || o.call(y, e), Fe();
|
|
186
187
|
}
|
|
187
|
-
const Pe = u(() => ({ ...
|
|
188
|
-
function
|
|
189
|
-
t.setState((o) => o.table ?
|
|
188
|
+
const Pe = u(() => ({ ...y, columnDragend: Ae }));
|
|
189
|
+
function Me(e) {
|
|
190
|
+
t.setState((o) => o.table ? We(e, o) : {}), e.table && t.tableApi.setState(e.table), e.form && (i == null || i.setState(e.form));
|
|
190
191
|
}
|
|
191
|
-
const { run:
|
|
192
|
+
const { run: Oe } = v(
|
|
192
193
|
async (e) => {
|
|
193
|
-
if (
|
|
194
|
-
if (!(await
|
|
195
|
-
const
|
|
196
|
-
await t.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo, ...
|
|
194
|
+
if (i.isMounted && r(c).useSearchForm) {
|
|
195
|
+
if (!(await i.validate()).valid) return;
|
|
196
|
+
const s = await i.getValues();
|
|
197
|
+
await t.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo, ...s } });
|
|
197
198
|
return;
|
|
198
199
|
}
|
|
199
200
|
await t.tableApi.reload({ ...e, searchInfo: { ...e == null ? void 0 : e.searchInfo } });
|
|
200
201
|
},
|
|
201
202
|
200,
|
|
202
203
|
{ leading: !0 }
|
|
203
|
-
),
|
|
204
|
+
), F = {
|
|
204
205
|
tableMethods: t.tableApi,
|
|
205
|
-
formMethods:
|
|
206
|
+
formMethods: i,
|
|
206
207
|
setTableProps: t.tableApi.setState,
|
|
207
|
-
setFormProps:
|
|
208
|
-
setProps:
|
|
209
|
-
reload:
|
|
208
|
+
setFormProps: i.setState,
|
|
209
|
+
setProps: Me,
|
|
210
|
+
reload: Oe,
|
|
210
211
|
selectedKeys: u(() => S(t.tableApi.selectedKeys))
|
|
211
212
|
};
|
|
212
|
-
async function
|
|
213
|
+
async function $e() {
|
|
213
214
|
const { tableRefreshBefore: e } = r(c);
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
async function x() {
|
|
217
|
-
var e;
|
|
218
|
-
await Y(), !d && ((e = t.tableApi) == null || e.redoHeight());
|
|
215
|
+
je(e) && await e(), F.reload();
|
|
219
216
|
}
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
let D = { width: window.innerWidth, height: window.innerHeight };
|
|
218
|
+
const { run: j } = v(async () => {
|
|
219
|
+
var n, f;
|
|
220
|
+
if (await Z(), d) return;
|
|
221
|
+
const { innerWidth: e, innerHeight: o } = window, s = e !== D.width || o !== D.height;
|
|
222
|
+
if (D = { width: e, height: o }, !s) {
|
|
223
|
+
if (!r(m).autoHeight) return;
|
|
224
|
+
(n = t.tableApi) == null || n.redoHeight(!1);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
(f = t.tableApi) == null || f.redoHeight();
|
|
228
|
+
}, 100);
|
|
229
|
+
async function Ee(e) {
|
|
230
|
+
var f, A;
|
|
222
231
|
if (d) return;
|
|
223
|
-
const o = S((
|
|
232
|
+
const o = S((A = (f = r(c)) == null ? void 0 : f.table) == null ? void 0 : A.columns) || [], s = new Map(o.map((b) => [b.field, b])), n = e.checkedModel.map((b) => s.get(b)).filter(Boolean);
|
|
224
233
|
if (e.isExport) {
|
|
225
|
-
|
|
234
|
+
C("export", e.checkedModel, e.modalApi);
|
|
226
235
|
return;
|
|
227
236
|
}
|
|
228
237
|
e.modalApi.setModalProps({ confirmLoading: !0 });
|
|
229
238
|
try {
|
|
230
|
-
if (r(m).useHttpCache && await
|
|
231
|
-
t.tableApi.setTableColumns(
|
|
239
|
+
if (r(m).useHttpCache && await x(JSON.stringify(e.checkedModel)), d) return;
|
|
240
|
+
t.tableApi.setTableColumns(n), e.modalApi.closeModal(), C("set-columns", n);
|
|
232
241
|
} finally {
|
|
233
242
|
d || e.modalApi.setModalProps({ confirmLoading: !1 });
|
|
234
243
|
}
|
|
235
244
|
}
|
|
236
245
|
function N(e, o = !1) {
|
|
237
|
-
var
|
|
238
|
-
const { notSetColumnField:
|
|
239
|
-
(
|
|
240
|
-
columns: (S(
|
|
241
|
-
displayFields: o ?
|
|
242
|
-
disabledColumnField:
|
|
246
|
+
var b, U, X;
|
|
247
|
+
const { notSetColumnField: s, columns: n } = r(m), f = ((((b = t.tableApi.getTableInstance()) == null ? void 0 : b.getTableColumn()) || {}).visibleColumn || []).map((p) => p.field).filter(Boolean), A = (S(n) || []).filter((p) => p.visible === !0 || p.visible === void 0).map((p) => p.field);
|
|
248
|
+
(U = R.value) == null || U.openModal({
|
|
249
|
+
columns: (S(n) || []).filter((p) => p.visible !== !1),
|
|
250
|
+
displayFields: o ? A : f,
|
|
251
|
+
disabledColumnField: s || [],
|
|
243
252
|
isExport: e
|
|
244
|
-
}), (
|
|
253
|
+
}), (X = R.value) == null || X.setModalProps({ title: e ? "自定义导出" : "列设置" });
|
|
245
254
|
}
|
|
246
|
-
function
|
|
255
|
+
function W(e = !1) {
|
|
247
256
|
N(!1, e);
|
|
248
257
|
}
|
|
249
|
-
function
|
|
258
|
+
function J(e = !1) {
|
|
250
259
|
N(!0, e);
|
|
251
260
|
}
|
|
252
|
-
function
|
|
253
|
-
const e =
|
|
254
|
-
if (!
|
|
261
|
+
function Re() {
|
|
262
|
+
const e = a.table;
|
|
263
|
+
if (!k() || !e) return;
|
|
255
264
|
const o = {};
|
|
256
|
-
return Object.keys(P(e)).forEach((
|
|
257
|
-
|
|
265
|
+
return Object.keys(P(e)).forEach((s) => {
|
|
266
|
+
s !== "data" && Object.assign(o, { [s]: e[s] });
|
|
258
267
|
}), o;
|
|
259
268
|
}
|
|
260
|
-
return
|
|
261
|
-
|
|
269
|
+
return ot(a, t.setState, ["tableFormApi", "table"]), w(
|
|
270
|
+
Re,
|
|
262
271
|
(e) => {
|
|
263
272
|
e && t.setState({ table: e });
|
|
264
273
|
},
|
|
265
274
|
{ deep: !0, immediate: !0 }
|
|
266
|
-
),
|
|
275
|
+
), et({ formInstance: i }), w(
|
|
267
276
|
() => t.tableApi.getLoading.value,
|
|
268
277
|
(e) => {
|
|
269
|
-
|
|
278
|
+
i == null || i.setState({ submitButtonOptions: { loading: e } });
|
|
270
279
|
},
|
|
271
|
-
{ immediate: (
|
|
272
|
-
),
|
|
280
|
+
{ immediate: (Q = (G = t.store.state) == null ? void 0 : G.table) == null ? void 0 : Q.immediate }
|
|
281
|
+
), w(_, (e) => i == null ? void 0 : i.setState(e)), w(m, (e) => {
|
|
273
282
|
var o;
|
|
274
283
|
return (o = t.tableApi) == null ? void 0 : o.setState(e);
|
|
275
|
-
}),
|
|
276
|
-
|
|
277
|
-
d ||
|
|
278
|
-
}), window.addEventListener("resize",
|
|
279
|
-
}),
|
|
280
|
-
d = !0,
|
|
281
|
-
}),
|
|
282
|
-
class:
|
|
283
|
-
"data-testid":
|
|
284
|
+
}), Be(() => {
|
|
285
|
+
h && C("register", F, h.uid), t.mount(F, i), i == null || i.setState(r(_)), Z(() => {
|
|
286
|
+
d || Ce();
|
|
287
|
+
}), window.addEventListener("resize", j);
|
|
288
|
+
}), Y(() => {
|
|
289
|
+
d = !0, I(), t == null || t.unmount(), window.removeEventListener("resize", j);
|
|
290
|
+
}), le({ ...F, instance: h }), (e, o) => (te(), ee("div", {
|
|
291
|
+
class: V(r(E)),
|
|
292
|
+
"data-testid": pe.value
|
|
284
293
|
}, [
|
|
285
|
-
c.value.useSearchForm ? (
|
|
294
|
+
c.value.useSearchForm ? (te(), ee("div", {
|
|
286
295
|
key: 0,
|
|
287
|
-
class:
|
|
288
|
-
"data-testid":
|
|
296
|
+
class: V(`${r(E)}-header`),
|
|
297
|
+
"data-testid": ue.value
|
|
289
298
|
}, [
|
|
290
|
-
|
|
291
|
-
"test-id": `${
|
|
299
|
+
M(r(ve), {
|
|
300
|
+
"test-id": `${T.value}-search-form`
|
|
292
301
|
}, K({ _: 2 }, [
|
|
293
|
-
|
|
294
|
-
name: r(
|
|
295
|
-
fn:
|
|
296
|
-
|
|
302
|
+
oe(r(ce)(r($)), (s) => ({
|
|
303
|
+
name: r(de)(s),
|
|
304
|
+
fn: g((n) => [
|
|
305
|
+
l(e.$slots, s, re(ie(n || {})))
|
|
297
306
|
])
|
|
298
307
|
}))
|
|
299
308
|
]), 1032, ["test-id"]),
|
|
300
|
-
|
|
301
|
-
], 10,
|
|
309
|
+
l(e.$slots, "header-down")
|
|
310
|
+
], 10, mt)) : He("", !0),
|
|
302
311
|
Le("div", {
|
|
303
|
-
class:
|
|
304
|
-
[`${r(
|
|
312
|
+
class: V({
|
|
313
|
+
[`${r(E)}-wrapper`]: !0,
|
|
305
314
|
"pt-(--tt-base-padding)!": !0,
|
|
306
315
|
"pb-(--tt-base-padding)!": !r(m).showPager
|
|
307
316
|
})
|
|
308
317
|
}, [
|
|
309
|
-
|
|
310
|
-
|
|
318
|
+
l(e.$slots, "table-top"),
|
|
319
|
+
M(it, se({
|
|
311
320
|
...r(m),
|
|
312
|
-
...
|
|
321
|
+
...he.value ? { data: z.value } : {}
|
|
313
322
|
}, {
|
|
314
|
-
"
|
|
315
|
-
"form-api": r(s),
|
|
323
|
+
"form-api": r(i),
|
|
316
324
|
"table-api": r(t).tableApi
|
|
317
325
|
}, ze(Pe.value)), K({ _: 2 }, [
|
|
318
|
-
|
|
319
|
-
name: r(
|
|
320
|
-
fn:
|
|
321
|
-
|
|
326
|
+
oe(r(fe)(r($)), (s) => ({
|
|
327
|
+
name: r(be)(s),
|
|
328
|
+
fn: g((n) => [
|
|
329
|
+
l(e.$slots, s, re(ie(n || {})))
|
|
322
330
|
])
|
|
323
331
|
})),
|
|
324
332
|
r(m).showToolbar ? {
|
|
325
333
|
name: "toolbar_tools",
|
|
326
|
-
fn:
|
|
327
|
-
|
|
328
|
-
onOnRefresh:
|
|
329
|
-
onOnExport:
|
|
330
|
-
onOnColumnsSetting:
|
|
334
|
+
fn: g(() => [
|
|
335
|
+
M(Xe, se(r(ge), {
|
|
336
|
+
onOnRefresh: $e,
|
|
337
|
+
onOnExport: J,
|
|
338
|
+
onOnColumnsSetting: W
|
|
331
339
|
}), {
|
|
332
|
-
"toolbar-left":
|
|
333
|
-
|
|
340
|
+
"toolbar-left": g(() => [
|
|
341
|
+
l(e.$slots, "t-toolbar_tools-left")
|
|
334
342
|
]),
|
|
335
|
-
"toolbar-right":
|
|
336
|
-
|
|
343
|
+
"toolbar-right": g(() => [
|
|
344
|
+
l(e.$slots, "t-toolbar_tools-right")
|
|
337
345
|
]),
|
|
338
346
|
_: 3
|
|
339
347
|
}, 16),
|
|
340
|
-
|
|
348
|
+
l(e.$slots, "t-toolbar_tools")
|
|
341
349
|
]),
|
|
342
350
|
key: "0"
|
|
343
351
|
} : void 0
|
|
344
|
-
]), 1040, ["
|
|
345
|
-
|
|
352
|
+
]), 1040, ["form-api", "table-api"]),
|
|
353
|
+
l(e.$slots, "table-bottom")
|
|
346
354
|
], 2),
|
|
347
|
-
|
|
355
|
+
M(Ue, {
|
|
348
356
|
ref_key: "columnModalRef",
|
|
349
|
-
ref:
|
|
350
|
-
"open-export":
|
|
351
|
-
"open-column":
|
|
352
|
-
onOnSubmit:
|
|
357
|
+
ref: R,
|
|
358
|
+
"open-export": J,
|
|
359
|
+
"open-column": W,
|
|
360
|
+
onOnSubmit: Ee
|
|
353
361
|
}, K({
|
|
354
|
-
beforeFooter:
|
|
355
|
-
|
|
362
|
+
beforeFooter: g(() => [
|
|
363
|
+
l(e.$slots, "t-column-modal-before-footer")
|
|
356
364
|
]),
|
|
357
365
|
_: 2
|
|
358
366
|
}, [
|
|
359
|
-
r(
|
|
367
|
+
r($)["t-column-modal-title"] ? {
|
|
360
368
|
name: "title",
|
|
361
|
-
fn:
|
|
362
|
-
|
|
369
|
+
fn: g(() => [
|
|
370
|
+
l(e.$slots, "t-column-modal-title")
|
|
363
371
|
]),
|
|
364
372
|
key: "0"
|
|
365
373
|
} : void 0
|
|
366
374
|
]), 1536)
|
|
367
|
-
], 10,
|
|
375
|
+
], 10, lt));
|
|
368
376
|
}
|
|
369
377
|
});
|
|
370
378
|
export {
|
|
371
|
-
|
|
379
|
+
Ko as default
|
|
372
380
|
};
|
|
@@ -32,11 +32,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
32
32
|
/** 是否分割线 */
|
|
33
33
|
/** 是否清除冒泡 */
|
|
34
34
|
stopButtonPropagation: any;
|
|
35
|
-
/**
|
|
36
|
-
showBtnNums: any;
|
|
37
|
-
/** 弹出框的宽度 */
|
|
38
|
-
popoverWidth: any;
|
|
39
|
-
/** 是否自动换行 */
|
|
35
|
+
/** 操作按钮在宽度不足时是否自动换行 */
|
|
40
36
|
wrap: any;
|
|
41
37
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
42
38
|
/** 操作项 */
|
|
@@ -57,11 +53,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
57
53
|
/** 是否分割线 */
|
|
58
54
|
/** 是否清除冒泡 */
|
|
59
55
|
stopButtonPropagation: any;
|
|
60
|
-
/**
|
|
61
|
-
showBtnNums: any;
|
|
62
|
-
/** 弹出框的宽度 */
|
|
63
|
-
popoverWidth: any;
|
|
64
|
-
/** 是否自动换行 */
|
|
56
|
+
/** 操作按钮在宽度不足时是否自动换行 */
|
|
65
57
|
wrap: any;
|
|
66
58
|
}>> & Readonly<{}>, {
|
|
67
59
|
wrap: any;
|
|
@@ -69,8 +61,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
69
61
|
actions: TtActionItem[];
|
|
70
62
|
slotContext: Record<string, any>;
|
|
71
63
|
stopButtonPropagation: any;
|
|
72
|
-
showBtnNums: any;
|
|
73
|
-
popoverWidth: any;
|
|
74
64
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
75
65
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
76
66
|
export default _default;
|