@dazhicheng/ui 1.5.266 → 1.6.1
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-api-component/index.js +4 -3
- package/dist/components/tt-api-component/index.vue2.js +4 -3
- package/dist/components/tt-area/TtArea.vue.js +1 -1
- package/dist/components/tt-area/TtArea.vue3.js +8 -7
- package/dist/components/tt-button/index.js +5 -4
- package/dist/components/tt-button/index.vue2.js +4 -3
- package/dist/components/tt-checkbox/index.js +4 -3
- package/dist/components/tt-checkbox/index.vue.js +4 -3
- package/dist/components/tt-drawer/index.js +4 -3
- package/dist/components/tt-drawer/src/RenderDrawer.vue.js +4 -3
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +8 -7
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +3 -2
- package/dist/components/tt-drawer/src/hooks/useResizable.js +2 -2
- package/dist/components/tt-drawer/src/props.js +3 -2
- package/dist/components/tt-drawer/src/utils/drawer-api.js +4 -2
- package/dist/components/tt-empty/index.js +9 -8
- package/dist/components/tt-form/index.js +10 -9
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +3 -2
- package/dist/components/tt-form/src/components/FormActions.vue2.js +4 -2
- package/dist/components/tt-form/src/form/FormDescription.vue.js +3 -2
- package/dist/components/tt-form/src/form/FormItem.vue.js +6 -5
- package/dist/components/tt-form/src/form/FormLabel.vue.js +8 -7
- package/dist/components/tt-form/src/form/RenderContent.vue.js +4 -3
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +30 -28
- package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +4 -2
- 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 +1 -0
- package/dist/components/tt-form/src/form-render/array-register/utils.js +6 -4
- package/dist/components/tt-form/src/form-render/dependencies.js +19 -18
- package/dist/components/tt-form/src/form-render/form.vue2.js +4 -2
- package/dist/components/tt-form/src/form-render/helper.js +15 -14
- package/dist/components/tt-form/src/form-render/rootWrapperClass.js +3 -2
- package/dist/components/tt-form/src/formApi.js +3 -2
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +4 -3
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +2 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +4 -2
- package/dist/components/tt-form/src/group-form/groupFormApi.js +4 -3
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +3 -2
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +28 -27
- package/dist/components/tt-form/src/index.vue2.js +3 -2
- package/dist/components/tt-form/src/useFormContext.js +11 -10
- package/dist/components/tt-form-item-error-tooltip/index.js +5 -4
- package/dist/components/tt-form-item-error-tooltip/index.vue.js +4 -3
- package/dist/components/tt-icon/index.js +6 -5
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-image/index.js +6 -5
- package/dist/components/tt-image/src/components/ImageViewer.js +7 -6
- package/dist/components/tt-loading/index.js +4 -3
- package/dist/components/tt-loading/src/directive.js +24 -23
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-log/index.js +4 -3
- package/dist/components/tt-log/index.vue.js +3 -2
- package/dist/components/tt-modal/index.js +3 -2
- package/dist/components/tt-modal/src/RenderModal.vue.js +3 -2
- package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +3 -2
- package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +3 -2
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +15 -14
- package/dist/components/tt-modal/src/props.js +3 -2
- package/dist/components/tt-modal/src/utils/modal-api.js +4 -2
- package/dist/components/tt-modal-form/index.vue.js +4 -3
- package/dist/components/tt-nav-anchor/index.js +4 -3
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +15 -14
- package/dist/components/tt-panel-select/index.js +4 -3
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +2 -2
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +95 -87
- package/dist/components/tt-panel-select/src/index.vue.js +4 -2
- package/dist/components/tt-radio-group/index.js +4 -3
- package/dist/components/tt-radio-group/index.vue.js +7 -6
- package/dist/components/tt-select/index.js +4 -3
- package/dist/components/tt-select/src/Select.vue.d.ts +12 -12
- package/dist/components/tt-select/src/Select.vue.js +4 -3
- package/dist/components/tt-select/src/components/SelectTable.vue.d.ts +116 -7
- package/dist/components/tt-select/src/components/SelectTable.vue.js +3 -2
- package/dist/components/tt-select/src/components/Table.vue.d.ts +8 -8
- package/dist/components/tt-select/src/components/Table.vue.js +3 -2
- package/dist/components/tt-select/src/hooks/useDataSource.js +4 -3
- package/dist/components/tt-select/src/hooks/useKeyboard.d.ts +7 -1
- package/dist/components/tt-select/src/hooks/useSelect.js +3 -2
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +28 -27
- package/dist/components/tt-select/src/props.d.ts +2 -2
- package/dist/components/tt-table/index.d.ts +526 -361
- package/dist/components/tt-table/index.js +7 -5
- package/dist/components/tt-table/src/Table.vue.d.ts +308 -218
- package/dist/components/tt-table/src/Table.vue.js +406 -618
- package/dist/components/tt-table/src/TableForm.vue.d.ts +384 -19
- package/dist/components/tt-table/src/TableForm.vue.js +219 -229
- package/dist/components/tt-table/src/components/TableAction.vue.js +110 -131
- package/dist/components/tt-table/src/components/TableButtons.js +30 -29
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +88 -84
- 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} +34 -35
- package/dist/components/tt-table/src/components/TableToolbarTools.vue2.js +4 -0
- package/dist/components/tt-table/src/emits.d.ts +10 -1
- 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 +64 -0
- package/dist/components/tt-table/src/hooks/useColumns.d.ts +505 -21
- package/dist/components/tt-table/src/hooks/useColumns.js +101 -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 +98 -0
- package/dist/components/tt-table/src/hooks/usePagination.d.ts +14 -8
- package/dist/components/tt-table/src/hooks/usePagination.js +30 -33
- package/dist/components/tt-table/src/hooks/useQuery.d.ts +41 -0
- package/dist/components/tt-table/src/hooks/useQuery.js +148 -0
- package/dist/components/tt-table/src/hooks/useRowIdentity.d.ts +22 -0
- package/dist/components/tt-table/src/hooks/useRowIdentity.js +97 -0
- package/dist/components/tt-table/src/hooks/useRowSelection.d.ts +24 -12
- package/dist/components/tt-table/src/hooks/useRowSelection.js +95 -70
- package/dist/components/tt-table/src/hooks/{useLeftRightSlot.d.ts → useSideSlot.d.ts} +25 -17
- package/dist/components/tt-table/src/hooks/useSideSlot.js +78 -0
- package/dist/components/tt-table/src/hooks/useSyncProps.d.ts +12 -0
- package/dist/components/tt-table/src/hooks/useSyncProps.js +56 -0
- package/dist/components/tt-table/src/hooks/useTableData.d.ts +71 -0
- package/dist/components/tt-table/src/hooks/useTableData.js +308 -0
- package/dist/components/tt-table/src/hooks/useTableFooter.d.ts +15 -0
- package/dist/components/tt-table/src/hooks/useTableFooter.js +47 -0
- package/dist/components/tt-table/src/hooks/useTableForm.d.ts +10 -5
- package/dist/components/tt-table/src/hooks/useTableForm.js +56 -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 +57 -55
- package/dist/components/tt-table/src/props.d.ts +326 -153
- package/dist/components/tt-table/src/props.js +125 -271
- 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 +71 -0
- package/dist/components/tt-table/src/types/table.d.ts +223 -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 +51 -0
- package/dist/components/tt-table/src/utils/context.js +26 -12
- package/dist/components/tt-table/src/utils/table-api.d.ts +136 -58
- package/dist/components/tt-table/src/utils/table-api.js +200 -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 +35 -23
- package/dist/components/tt-text/index.js +4 -3
- package/dist/components/tt-upload/index.js +6 -5
- package/dist/components/tt-upload/src/TtUpload.vue.js +4 -3
- package/dist/components/types.d.ts +0 -20
- package/dist/directives/disabled-tip/index.js +9 -8
- package/dist/hooks/useFormSchemasLink.js +4 -3
- package/dist/hooks/useFormat.d.ts +35 -71
- package/dist/hooks/useFormat.js +28 -39
- package/dist/hooks/usePanelSelectSchemas.js +4 -3
- package/dist/hooks/useScreenshotOss.js +16 -15
- package/dist/hooks/useSetup.js +0 -3
- package/dist/packages/hooks/src/useDebounce.js +6 -5
- package/dist/packages/hooks/src/useElementScreenshot.js +4 -3
- package/dist/packages/hooks/src/usePriorityValue.js +5 -4
- package/dist/packages/utils/src/format.js +48 -0
- package/dist/packages/utils/src/is.js +20 -18
- package/dist/packages/utils/src/tool.js +76 -149
- package/dist/plugins/default/renderCellContent.js +4 -3
- package/dist/plugins/vxeTable/switchStatus.js +14 -13
- package/dist/style.css +1 -1
- 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,179 +1,128 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var c = (r, t, e) => t in r ? u(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var a = (r, t, e) => c(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import "axios";
|
|
5
5
|
import "element-plus";
|
|
6
|
-
import { isFunction as
|
|
7
|
-
import { reactive as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
6
|
+
import { isFunction as w } from "../../../../packages/utils/src/is.js";
|
|
7
|
+
import { reactive as m, shallowRef as y, computed as n, toValue as d } from "vue";
|
|
8
|
+
import "dayjs";
|
|
9
|
+
import "numeral";
|
|
10
|
+
import { bindMethods as p } from "../../../../packages/utils/src/tool.js";
|
|
11
|
+
import { mergeWithArrayOverride as h } from "../../../../packages/utils/src/merge.js";
|
|
10
12
|
import "../../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.js";
|
|
11
|
-
import { StateHandler as
|
|
13
|
+
import { StateHandler as g } from "../../../../packages/utils/src/stateHandler.js";
|
|
12
14
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
13
15
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
14
16
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
15
17
|
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
16
18
|
import "lodash-es";
|
|
17
19
|
import { GlobalConfig as o } from "../../../../hooks/useSetup.js";
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
import { createSharedTableDefaults as R } from "../table-defaults.js";
|
|
21
|
+
import { Store as b } from "@tanstack/vue-store";
|
|
22
|
+
function C() {
|
|
23
|
+
var r, t, e, s, i, l;
|
|
21
24
|
return {
|
|
22
|
-
|
|
23
|
-
total: 0,
|
|
24
|
-
showCheckbox: !1,
|
|
25
|
-
showExpand: !1,
|
|
26
|
-
showRadio: !1,
|
|
27
|
-
showIndex: !1,
|
|
28
|
-
isCellResize: !1,
|
|
29
|
-
isColumnsDrag: !1,
|
|
30
|
-
isCellSort: !1,
|
|
31
|
-
showAction: !1,
|
|
32
|
-
actionWidth: 0,
|
|
33
|
-
actionTitle: "",
|
|
34
|
-
actionProps: {},
|
|
35
|
-
indexColumnProps: {},
|
|
36
|
-
checkboxColumnProps: {},
|
|
37
|
-
expandColumnProps: {},
|
|
38
|
-
radioColumnProps: {},
|
|
39
|
-
searchInfo: {},
|
|
40
|
-
immediate: !0,
|
|
25
|
+
...R(),
|
|
41
26
|
loading: !1,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
filterNoVisibleField: [],
|
|
47
|
-
showTableAlert: !1,
|
|
48
|
-
modelValue: [],
|
|
49
|
-
title: "",
|
|
50
|
-
showTitle: !1,
|
|
27
|
+
/**
|
|
28
|
+
* hook 方式默认不铺满,与 `props.ts` 的组件方式默认 `true` 有意不同,不要统一:
|
|
29
|
+
* 改任一边都会改变现有页面的表格高度。
|
|
30
|
+
*/
|
|
51
31
|
autoHeight: !1,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
showHeaderOverflow: !0,
|
|
63
|
-
isScrollFetch: !1,
|
|
64
|
-
showScrollFetchLoading: !0,
|
|
65
|
-
toolbarConfig: void 0,
|
|
66
|
-
zoomConfig: void 0,
|
|
67
|
-
formApi: void 0,
|
|
68
|
-
useHttpCache: (a = o.table) == null ? void 0 : a.useHttpCache,
|
|
69
|
-
defaultDisplayFields: (e = o.table) == null ? void 0 : e.defaultDisplayFields,
|
|
70
|
-
loadingText: (t = o.table) == null ? void 0 : t.loadingText,
|
|
71
|
-
emptyText: (i = o.table) == null ? void 0 : i.emptyText,
|
|
72
|
-
emptyImageStatus: "no-data",
|
|
73
|
-
noSearchText: (d = o.table) == null ? void 0 : d.noSearchText,
|
|
74
|
-
showSetColumn: (h = o.table) == null ? void 0 : h.showSetColumn,
|
|
75
|
-
showSetting: (m = o.table) == null ? void 0 : m.showSetting,
|
|
76
|
-
showRefresh: (u = o.table) == null ? void 0 : u.showRefresh,
|
|
77
|
-
tableRowId: (c = o.table) == null ? void 0 : c.tableRowId,
|
|
78
|
-
currentPageField: (p = o.table) == null ? void 0 : p.currentPageField,
|
|
79
|
-
pageSizeField: (g = o.table) == null ? void 0 : g.pageSizeField,
|
|
80
|
-
totalField: (w = o.table) == null ? void 0 : w.totalField,
|
|
81
|
-
dataField: (f = o.table) == null ? void 0 : f.dataField,
|
|
82
|
-
pagerConfig: (b = o.table) == null ? void 0 : b.pagerConfig,
|
|
83
|
-
size: (y = o.table) == null ? void 0 : y.size,
|
|
84
|
-
keyboardConfig: (S = o.table) == null ? void 0 : S.keyboardConfig,
|
|
85
|
-
menuConfig: {},
|
|
86
|
-
mouseConfig: (C = o.table) == null ? void 0 : C.mouseConfig,
|
|
87
|
-
checkboxConfig: (x = o.table) == null ? void 0 : x.checkboxConfig,
|
|
88
|
-
radioConfig: (R = o.table) == null ? void 0 : R.radioConfig,
|
|
89
|
-
stripe: (T = o.table) == null ? void 0 : T.stripe,
|
|
90
|
-
border: (v = o.table) == null ? void 0 : v.border,
|
|
91
|
-
updateColumnsApi: (E = o.table) == null ? void 0 : E.updateColumnsApi,
|
|
92
|
-
getColumnsApi: (P = o.table) == null ? void 0 : P.getColumnsApi,
|
|
93
|
-
setColumnsApi: (D = o.table) == null ? void 0 : D.setColumnsApi,
|
|
94
|
-
columnsKey: (F = o.table) == null ? void 0 : F.columnsKey
|
|
32
|
+
stripe: (r = o.table) == null ? void 0 : r.stripe,
|
|
33
|
+
border: (t = o.table) == null ? void 0 : t.border,
|
|
34
|
+
updateColumnsApi: (e = o.table) == null ? void 0 : e.updateColumnsApi,
|
|
35
|
+
getColumnsApi: (s = o.table) == null ? void 0 : s.getColumnsApi,
|
|
36
|
+
setColumnsApi: (i = o.table) == null ? void 0 : i.setColumnsApi,
|
|
37
|
+
/**
|
|
38
|
+
* hook 方式取全局配置,与 `props.ts` 的组件方式固定取 `""` 有意不同,不要统一:
|
|
39
|
+
* 统一会改变组件方式下的列配置缓存 key,已存的服务端列配置会读不到。
|
|
40
|
+
*/
|
|
41
|
+
columnsKey: (l = o.table) == null ? void 0 : l.columnsKey
|
|
95
42
|
};
|
|
96
43
|
}
|
|
97
|
-
class
|
|
44
|
+
class F {
|
|
98
45
|
/**
|
|
99
46
|
* 构造函数,初始化 store、状态等
|
|
100
47
|
* @param options 表格配置项
|
|
101
48
|
*/
|
|
102
|
-
constructor(
|
|
49
|
+
constructor(t = {}) {
|
|
103
50
|
/** vxe-grid 表格实例 */
|
|
104
|
-
|
|
51
|
+
a(this, "grid", m({}));
|
|
105
52
|
/** 表格操作方法集合(TtTableMethods) */
|
|
106
|
-
|
|
53
|
+
a(this, "methods", m({}));
|
|
107
54
|
/** 当前表格的 props 状态 */
|
|
108
|
-
|
|
55
|
+
a(this, "state", null);
|
|
109
56
|
/** 响应式 store,存储表格的状态 */
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
isTableEvent: !1,
|
|
116
|
-
selectedRows: []
|
|
117
|
-
}));
|
|
118
|
-
s(this, "isMounted", !1);
|
|
119
|
-
s(this, "stateHandler");
|
|
57
|
+
a(this, "store");
|
|
58
|
+
/** 组件内的响应式状态源(loading、行选择),挂载时由组件交进来 */
|
|
59
|
+
a(this, "stateSources", y(null));
|
|
60
|
+
a(this, "isMounted", !1);
|
|
61
|
+
a(this, "stateHandler");
|
|
120
62
|
/**
|
|
121
|
-
* @description:
|
|
122
|
-
* @return {DT[]}
|
|
63
|
+
* @description: 获取表格选中数据的keys(响应式)
|
|
123
64
|
*/
|
|
124
|
-
|
|
65
|
+
a(this, "selectedKeys", n(() => {
|
|
66
|
+
var t;
|
|
67
|
+
return d((t = this.stateSources.value) == null ? void 0 : t.selectedKeys) ?? [];
|
|
68
|
+
}));
|
|
125
69
|
/**
|
|
126
|
-
* @description:
|
|
127
|
-
* @return {DT[]}
|
|
70
|
+
* @description: 获取表格选中数据(响应式)
|
|
128
71
|
*/
|
|
129
|
-
|
|
72
|
+
a(this, "selectedRows", n(() => {
|
|
73
|
+
var t;
|
|
74
|
+
return d((t = this.stateSources.value) == null ? void 0 : t.selectedRows) ?? [];
|
|
75
|
+
}));
|
|
130
76
|
/**
|
|
131
77
|
* 获取表格 loading 状态(响应式)
|
|
132
78
|
*/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
this.store = new z(n(t, i), {
|
|
79
|
+
a(this, "getLoading", n(() => {
|
|
80
|
+
var t;
|
|
81
|
+
return d((t = this.stateSources.value) == null ? void 0 : t.loading) ?? !1;
|
|
82
|
+
}));
|
|
83
|
+
const e = { ...t }, s = C();
|
|
84
|
+
this.store = new b(h(e, s), {
|
|
140
85
|
onUpdate: () => {
|
|
141
86
|
this.state = this.store.state;
|
|
142
87
|
}
|
|
143
|
-
}), this.state = this.store.state, this.stateHandler = new
|
|
88
|
+
}), this.state = this.store.state, this.stateHandler = new g(), p(this);
|
|
144
89
|
}
|
|
145
90
|
/**
|
|
146
91
|
* 组件挂载时调用,注入表格实例和方法
|
|
147
92
|
* @param instance vxe-grid 实例
|
|
148
93
|
* @param methods 表格操作方法
|
|
149
94
|
*/
|
|
150
|
-
mount(
|
|
151
|
-
|
|
95
|
+
mount(t, e) {
|
|
96
|
+
var s;
|
|
97
|
+
if (!this.isMounted && t) {
|
|
98
|
+
const i = ((s = e.getTableInstance) == null ? void 0 : s.call(e)) || t;
|
|
99
|
+
Object.setPrototypeOf(this.grid, i), Object.setPrototypeOf(this.methods, e), this.stateHandler.setConditionTrue(), this.isMounted = !0;
|
|
100
|
+
}
|
|
152
101
|
}
|
|
153
102
|
/**
|
|
154
103
|
* 更新表格的状态
|
|
155
104
|
* @param stateOrFn 新状态或返回新状态的函数
|
|
156
105
|
*/
|
|
157
|
-
setState(
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
return
|
|
161
|
-
}) : this.store.setState((
|
|
106
|
+
setState(t) {
|
|
107
|
+
w(t) ? this.store.setState((e) => {
|
|
108
|
+
const s = t(e);
|
|
109
|
+
return h(s, e, ["searchInfo"]);
|
|
110
|
+
}) : this.store.setState((e) => h(t, e, ["searchInfo"]));
|
|
162
111
|
}
|
|
163
112
|
/**
|
|
164
113
|
* 组件卸载时调用,重置挂载状态
|
|
165
114
|
*/
|
|
166
115
|
unmount() {
|
|
167
|
-
this.isMounted = !1, this.stateHandler.reset();
|
|
116
|
+
this.isMounted = !1, this.stateSources.value = null, Object.setPrototypeOf(this.grid, Object.prototype), Object.setPrototypeOf(this.methods, Object.prototype), this.stateHandler.reset();
|
|
168
117
|
}
|
|
169
118
|
/**
|
|
170
119
|
* @description: 表格重载数据
|
|
171
120
|
* @param {FetchParams | undefined} data 加载的params
|
|
172
121
|
* @return {*}
|
|
173
122
|
*/
|
|
174
|
-
async reload(
|
|
123
|
+
async reload(t) {
|
|
175
124
|
try {
|
|
176
|
-
this.methods.reload(
|
|
125
|
+
await this.methods.reload(t);
|
|
177
126
|
} catch {
|
|
178
127
|
}
|
|
179
128
|
}
|
|
@@ -181,8 +130,8 @@ class $ {
|
|
|
181
130
|
* @description: 设置表格props
|
|
182
131
|
* @param {Partial<TtTableProps>} props 表格props
|
|
183
132
|
*/
|
|
184
|
-
setProps(
|
|
185
|
-
this.methods.setProps(
|
|
133
|
+
setProps(t) {
|
|
134
|
+
this.methods.setProps(t);
|
|
186
135
|
}
|
|
187
136
|
/**
|
|
188
137
|
* @description: 重新计算高度
|
|
@@ -196,8 +145,8 @@ class $ {
|
|
|
196
145
|
* @param {VxeGridPropTypes.Columns<DT>} columns columns
|
|
197
146
|
* @return {*}
|
|
198
147
|
*/
|
|
199
|
-
setTableColumns(
|
|
200
|
-
this.methods.setTableColumns(
|
|
148
|
+
setTableColumns(t) {
|
|
149
|
+
this.methods.setTableColumns(t);
|
|
201
150
|
}
|
|
202
151
|
/**
|
|
203
152
|
* @description: 获取表格columns
|
|
@@ -217,8 +166,8 @@ class $ {
|
|
|
217
166
|
* @description: 设置表格loading
|
|
218
167
|
* @param {boolean} loading
|
|
219
168
|
*/
|
|
220
|
-
setLoading(
|
|
221
|
-
this.methods.setLoading(
|
|
169
|
+
setLoading(t) {
|
|
170
|
+
this.methods.setLoading(t);
|
|
222
171
|
}
|
|
223
172
|
/**
|
|
224
173
|
* @description: 获取表格pagination
|
|
@@ -231,8 +180,8 @@ class $ {
|
|
|
231
180
|
* @description: 设置表格pagination
|
|
232
181
|
* @param {Partial<VxeGridPropTypes.PagerConfig>} props 表格pagination
|
|
233
182
|
*/
|
|
234
|
-
setPagination(
|
|
235
|
-
this.methods.setPagination(
|
|
183
|
+
setPagination(t) {
|
|
184
|
+
this.methods.setPagination(t);
|
|
236
185
|
}
|
|
237
186
|
/**
|
|
238
187
|
* @description: 获取选中数据的keys集合
|
|
@@ -253,8 +202,8 @@ class $ {
|
|
|
253
202
|
* @param {TtSelectRowsType[]} rows 选中的数据
|
|
254
203
|
* @param {TtSelectRowKeysType[]} keys 选中的数据keys
|
|
255
204
|
*/
|
|
256
|
-
setSelectedRowKeys(
|
|
257
|
-
this.methods.setSelectedRowKeys(
|
|
205
|
+
setSelectedRowKeys(t, e) {
|
|
206
|
+
this.methods.setSelectedRowKeys(t, e);
|
|
258
207
|
}
|
|
259
208
|
/**
|
|
260
209
|
* @description: 清除全部行选择
|
|
@@ -266,8 +215,8 @@ class $ {
|
|
|
266
215
|
* 往表格插入临时数据,从第一行新增一行或多行新数据
|
|
267
216
|
* @param records 新数据
|
|
268
217
|
*/
|
|
269
|
-
async insert(
|
|
270
|
-
return await this.methods.insert(
|
|
218
|
+
async insert(t) {
|
|
219
|
+
return await this.methods.insert(t);
|
|
271
220
|
}
|
|
272
221
|
/**
|
|
273
222
|
* 往表格指定行中插入临时数据
|
|
@@ -277,15 +226,31 @@ class $ {
|
|
|
277
226
|
* @param {Object/Array} records 新的数据
|
|
278
227
|
* @param {Row} row 指定行
|
|
279
228
|
*/
|
|
280
|
-
async insertAt(
|
|
281
|
-
return await this.methods.insertAt(
|
|
229
|
+
async insertAt(t, e) {
|
|
230
|
+
return await this.methods.insertAt(t, e);
|
|
231
|
+
}
|
|
232
|
+
/** 在指定行之后插入临时数据 */
|
|
233
|
+
async insertNextAt(t, e) {
|
|
234
|
+
return await this.methods.insertNextAt(t, e);
|
|
235
|
+
}
|
|
236
|
+
/** 在树节点下插入临时子数据 */
|
|
237
|
+
async insertChild(t, e) {
|
|
238
|
+
return await this.methods.insertChild(t, e);
|
|
239
|
+
}
|
|
240
|
+
/** 在树节点下的指定位置插入临时子数据 */
|
|
241
|
+
async insertChildAt(t, e, s) {
|
|
242
|
+
return await this.methods.insertChildAt(t, e, s);
|
|
243
|
+
}
|
|
244
|
+
/** 在树节点下的指定行之后插入临时子数据 */
|
|
245
|
+
async insertChildNextAt(t, e, s) {
|
|
246
|
+
return await this.methods.insertChildNextAt(t, e, s);
|
|
282
247
|
}
|
|
283
248
|
/**
|
|
284
249
|
* 删除指定行数据,指定 row 或 [row, ...] 删除多条数据,如果为空则删除所有数据
|
|
285
250
|
* @param rows 指定行
|
|
286
251
|
*/
|
|
287
|
-
async remove(
|
|
288
|
-
return await this.methods.remove(
|
|
252
|
+
async remove(t) {
|
|
253
|
+
return await this.methods.remove(t);
|
|
289
254
|
}
|
|
290
255
|
/**
|
|
291
256
|
* 删除复选框选中的行数据
|
|
@@ -305,48 +270,73 @@ class $ {
|
|
|
305
270
|
async removeCurrentRow() {
|
|
306
271
|
return await this.methods.removeCurrentRow();
|
|
307
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* 删除所有新增的临时数据
|
|
275
|
+
*/
|
|
276
|
+
async removeInsertRow() {
|
|
277
|
+
return await this.methods.removeInsertRow();
|
|
278
|
+
}
|
|
279
|
+
/** 清除表格的全部数据状态 */
|
|
280
|
+
async clearAll() {
|
|
281
|
+
return await this.methods.clearAll();
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* 重新加载 VXE 当前同步数据。
|
|
285
|
+
* @deprecated VXE 已废弃 syncData,请使用 reloadData 或 getDataSource。
|
|
286
|
+
*/
|
|
287
|
+
async syncData() {
|
|
288
|
+
return await this.methods.syncData();
|
|
289
|
+
}
|
|
290
|
+
/** 重新计算 VXE 的数据视图 */
|
|
291
|
+
async updateData() {
|
|
292
|
+
return await this.methods.updateData();
|
|
293
|
+
}
|
|
294
|
+
/** 修改指定行数据 */
|
|
295
|
+
async setRow(t, e) {
|
|
296
|
+
return await this.methods.setRow(t, e);
|
|
297
|
+
}
|
|
308
298
|
/**
|
|
309
299
|
* 清除编辑状态并重置数据
|
|
310
300
|
*/
|
|
311
|
-
clearEditRevertData(
|
|
312
|
-
this.methods.clearEditRevertData(
|
|
301
|
+
clearEditRevertData(t) {
|
|
302
|
+
this.methods.clearEditRevertData(t);
|
|
313
303
|
}
|
|
314
304
|
/**
|
|
315
305
|
* 指定行激活编辑
|
|
316
|
-
* @param {
|
|
306
|
+
* @param {Row} row 行数据
|
|
317
307
|
* @param {string | VxeTableDefines.ColumnInfo} fieldOrColumn 列配置可以时field
|
|
318
308
|
*/
|
|
319
|
-
setEditRow(
|
|
320
|
-
this.methods.setEditRow(
|
|
309
|
+
setEditRow(t, e) {
|
|
310
|
+
this.methods.setEditRow(t, e);
|
|
321
311
|
}
|
|
322
312
|
/**
|
|
323
313
|
* 指定单元格激活编辑
|
|
324
|
-
* @param {
|
|
314
|
+
* @param {Row} row 当前行数据
|
|
325
315
|
* @param {string | VxeTableDefines.ColumnInfo} fieldOrColumn 列配置可以时field
|
|
326
316
|
*/
|
|
327
|
-
setEditCell(
|
|
328
|
-
this.methods.setEditCell(
|
|
317
|
+
setEditCell(t, e) {
|
|
318
|
+
this.methods.setEditCell(t, e);
|
|
329
319
|
}
|
|
330
320
|
/**
|
|
331
321
|
* 加载数据
|
|
332
322
|
* @param data 数据
|
|
333
323
|
*/
|
|
334
|
-
async loadData(
|
|
335
|
-
return await this.methods.loadData(
|
|
324
|
+
async loadData(t) {
|
|
325
|
+
return await this.methods.loadData(t);
|
|
336
326
|
}
|
|
337
327
|
/**
|
|
338
328
|
* 加载数据并恢复到初始状态
|
|
339
329
|
* @param data 数据
|
|
340
330
|
*/
|
|
341
|
-
async reloadData(
|
|
342
|
-
return await this.methods.reloadData(
|
|
331
|
+
async reloadData(t) {
|
|
332
|
+
return await this.methods.reloadData(t);
|
|
343
333
|
}
|
|
344
334
|
/**
|
|
345
335
|
* 重新加载列
|
|
346
336
|
* @param columns 列对象
|
|
347
337
|
*/
|
|
348
|
-
async reloadColumn(
|
|
349
|
-
return await this.methods.reloadColumn(
|
|
338
|
+
async reloadColumn(t) {
|
|
339
|
+
return await this.methods.reloadColumn(t);
|
|
350
340
|
}
|
|
351
341
|
/**
|
|
352
342
|
* 局部加载行数据并恢复到初始状态
|
|
@@ -354,44 +344,89 @@ class $ {
|
|
|
354
344
|
* @param record 新数据
|
|
355
345
|
* @param field 指定字段名
|
|
356
346
|
*/
|
|
357
|
-
async reloadRow(
|
|
358
|
-
return await this.methods.reloadRow(
|
|
347
|
+
async reloadRow(t, e, s) {
|
|
348
|
+
return await this.methods.reloadRow(t, e, s);
|
|
349
|
+
}
|
|
350
|
+
/** 还原 keep-source 保存的行数据 */
|
|
351
|
+
async revertData(t, e) {
|
|
352
|
+
return await this.methods.revertData(t, e);
|
|
353
|
+
}
|
|
354
|
+
/** 加载树节点的子数据 */
|
|
355
|
+
async loadTreeChildren(t, e) {
|
|
356
|
+
return await this.methods.loadTreeChildren(t, e);
|
|
359
357
|
}
|
|
360
358
|
/**
|
|
361
359
|
* 手动清空单元格内容,如果不传参数,则清空整个表格内容,如果传了行则清空指定行内容,如果传了指定字段,则清空该字段内容
|
|
362
360
|
* @param data 指定行
|
|
363
361
|
* @param field 字段名
|
|
364
362
|
*/
|
|
365
|
-
async clearData(
|
|
366
|
-
return await this.methods.clearData(
|
|
363
|
+
async clearData(t, e) {
|
|
364
|
+
return await this.methods.clearData(t, e);
|
|
365
|
+
}
|
|
366
|
+
/** 移动行到指定行位置 */
|
|
367
|
+
async moveRowTo(t, e, s) {
|
|
368
|
+
return await this.methods.moveRowTo(t, e, s);
|
|
369
|
+
}
|
|
370
|
+
/** 撤销最近一次数据操作 */
|
|
371
|
+
async undo() {
|
|
372
|
+
return await this.methods.undo();
|
|
373
|
+
}
|
|
374
|
+
/** 重做最近一次数据操作 */
|
|
375
|
+
async redo() {
|
|
376
|
+
return await this.methods.redo();
|
|
367
377
|
}
|
|
368
378
|
/**
|
|
369
379
|
* 重新懒加载展开行,并展开内容
|
|
370
380
|
* @param row 指定行
|
|
371
381
|
*/
|
|
372
|
-
reloadRowExpand(
|
|
373
|
-
this.methods.reloadRowExpand(
|
|
382
|
+
async reloadRowExpand(t) {
|
|
383
|
+
return await this.methods.reloadRowExpand(t);
|
|
374
384
|
}
|
|
375
385
|
/**
|
|
376
386
|
* 重新懒加载树节点,并展开该节点
|
|
377
387
|
* @param row 指定行
|
|
378
388
|
*/
|
|
379
|
-
reloadTreeExpand(
|
|
380
|
-
this.methods.
|
|
389
|
+
async reloadTreeExpand(t) {
|
|
390
|
+
return await this.methods.reloadTreeExpand(t);
|
|
381
391
|
}
|
|
382
392
|
/** 获取表格实例 */
|
|
383
393
|
getTableInstance() {
|
|
384
394
|
return this.grid;
|
|
385
395
|
}
|
|
386
396
|
/**
|
|
387
|
-
*
|
|
388
|
-
* @param
|
|
397
|
+
* 校验表格编辑数据
|
|
398
|
+
* @param isFull true 时校验全部行并收集所有错误,缺省或 false 时遇到第一个错误即停止
|
|
399
|
+
* @returns 全部通过时为 undefined,否则为 vxe 原生形状的错误映射(以列字段为键)
|
|
400
|
+
*/
|
|
401
|
+
async validate(t) {
|
|
402
|
+
return await this.methods.validate(t);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* 校验指定行的指定字段
|
|
406
|
+
* @param row 行数据
|
|
407
|
+
* @param field 列字段名
|
|
408
|
+
*/
|
|
409
|
+
async validateField(t, e) {
|
|
410
|
+
return await this.methods.validateField(t, e);
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* 设置空数据提示文字
|
|
414
|
+
* @param text 提示文字
|
|
415
|
+
*/
|
|
416
|
+
setEmptyText(t) {
|
|
417
|
+
this.methods.setEmptyText(t);
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* 绑定组件内的响应式状态源
|
|
421
|
+
*
|
|
422
|
+
* 直接持有组件的 ref,读取时才取值,避免用 watch 把状态同步到 api 上。
|
|
423
|
+
* @param sources 状态源
|
|
389
424
|
*/
|
|
390
|
-
|
|
391
|
-
this.
|
|
425
|
+
bindState(t) {
|
|
426
|
+
this.stateSources.value = t;
|
|
392
427
|
}
|
|
393
428
|
}
|
|
394
429
|
export {
|
|
395
|
-
|
|
396
|
-
|
|
430
|
+
F as TableApi,
|
|
431
|
+
C as getDefaultState
|
|
397
432
|
};
|
|
@@ -13,37 +13,37 @@ import { Store } from '@tanstack/vue-store';
|
|
|
13
13
|
* api.reload()
|
|
14
14
|
* api.setFormProps({ ... })
|
|
15
15
|
*/
|
|
16
|
-
declare class TableFormApi {
|
|
16
|
+
declare class TableFormApi<Row = any> {
|
|
17
17
|
/** form 表单实例(FormApi) */
|
|
18
18
|
formApi: TtExtendedFormApi;
|
|
19
19
|
/** 表格 API 实例(TableApi) */
|
|
20
|
-
tableApi: TtTableExtendedTableApi
|
|
20
|
+
tableApi: TtTableExtendedTableApi<Row>;
|
|
21
21
|
/** vxe-grid 表格实例 */
|
|
22
22
|
grid: VxeGridInstance;
|
|
23
23
|
/** 当前表单+表格的 props 状态 */
|
|
24
|
-
state: null | TtTableFormProps
|
|
24
|
+
state: null | TtTableFormProps<Row>;
|
|
25
25
|
/** 表单操作方法集合(TableFormActionType) */
|
|
26
|
-
tableForm: TtTableFormActionType
|
|
26
|
+
tableForm: TtTableFormActionType<Row>;
|
|
27
27
|
/** 响应式 store,存储表单+表格的状态 */
|
|
28
|
-
store: Store<TtTableFormProps
|
|
28
|
+
store: Store<TtTableFormProps<Row>>;
|
|
29
29
|
private isMounted;
|
|
30
30
|
private stateHandler;
|
|
31
31
|
/**
|
|
32
32
|
* 构造函数,初始化 store、tableApi、状态等
|
|
33
33
|
* @param options 表单+表格配置项
|
|
34
34
|
*/
|
|
35
|
-
constructor(options?: TtTableFormProps);
|
|
35
|
+
constructor(options?: TtTableFormProps<Row>);
|
|
36
36
|
/**
|
|
37
37
|
* 组件挂载时调用,注入表单和表格实例
|
|
38
38
|
* @param instance 表单操作方法实例
|
|
39
39
|
* @param formApi 表单实例
|
|
40
40
|
*/
|
|
41
|
-
mount(instance: null | TtTableFormActionType
|
|
41
|
+
mount(instance: null | TtTableFormActionType<Row>, formApi: TtExtendedFormApi): void;
|
|
42
42
|
/**
|
|
43
43
|
* 更新表单+表格的数据
|
|
44
44
|
* @param stateOrFn 新状态或返回新状态的函数
|
|
45
45
|
*/
|
|
46
|
-
setState(stateOrFn: ((prev: TtTableFormProps) => Partial<TtTableFormProps
|
|
46
|
+
setState(stateOrFn: ((prev: TtTableFormProps<Row>) => Partial<TtTableFormProps<Row>>) | Partial<TtTableFormProps<Row>>): void;
|
|
47
47
|
/**
|
|
48
48
|
* 重新加载表格数据
|
|
49
49
|
* @param data 可选的查询参数
|
|
@@ -64,12 +64,12 @@ declare class TableFormApi {
|
|
|
64
64
|
/**
|
|
65
65
|
* 获取表格 API 实例
|
|
66
66
|
*/
|
|
67
|
-
tableInstance(): TtTableExtendedTableApi
|
|
67
|
+
tableInstance(): TtTableExtendedTableApi<Row>;
|
|
68
68
|
/**
|
|
69
69
|
* 设置表格属性
|
|
70
70
|
* @param props 表格属性
|
|
71
71
|
*/
|
|
72
|
-
setTableProps(props: Partial<TtTableProps
|
|
72
|
+
setTableProps(props: Partial<TtTableProps<Row>>): void;
|
|
73
73
|
/**
|
|
74
74
|
* 设置表单属性
|
|
75
75
|
* @param props 表单属性
|
|
@@ -79,7 +79,7 @@ declare class TableFormApi {
|
|
|
79
79
|
* 设置表单+表格属性
|
|
80
80
|
* @param props 属性
|
|
81
81
|
*/
|
|
82
|
-
setProps(props: Partial<TtTableFormProps
|
|
82
|
+
setProps(props: Partial<TtTableFormProps<Row>>): void;
|
|
83
83
|
/**
|
|
84
84
|
* 组件卸载时调用,重置挂载状态
|
|
85
85
|
*/
|