vft 0.0.496 → 0.0.498
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/index.css +1 -1
- package/es/component.js +18 -16
- package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/button/index.d.ts +9 -9
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +257 -255
- package/es/components/modal/index.d.ts +6 -0
- package/es/components/modal/modal.vue.d.ts +3 -0
- package/es/components/modal/modal.vue2.js +12 -12
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/select/defaults.d.ts +4 -0
- package/es/components/select/defaults.js +7 -3
- package/es/components/select/index.d.ts +13 -4
- package/es/components/select/select.vue.d.ts +13 -4
- package/es/components/select/select.vue.js +9 -8
- package/es/components/select/select.vue2.js +40 -29
- package/es/components/select/token.d.ts +4 -1
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/components/super-form/index.d.ts +9 -0
- package/es/components/super-form/style/css.d.ts +1 -0
- package/es/components/super-form/style/css.js +2 -0
- package/es/components/super-form/style/index.d.ts +1 -0
- package/es/components/super-form/style/index.js +2 -0
- package/es/components/super-form/super-form-item.vue2.js +355 -255
- package/es/components/super-form/super-form.vue2.js +1 -1
- package/es/components/super-form/types.d.ts +26 -1
- package/es/components/super-form/use/helper.js +37 -36
- package/es/components/super-form/use/use-form-events.js +126 -125
- package/es/components/table/index.d.ts +9 -6
- package/es/components/table/style/css.js +2 -0
- package/es/components/table/style/index.js +2 -0
- package/es/components/table/table.vue.d.ts +2 -1
- package/es/components/table/table.vue2.js +99 -94
- package/es/components/table/types.d.ts +5 -3
- package/es/components/table/use/use-data-source.d.ts +6 -4
- package/es/components/table/use/use-data-source.js +150 -148
- package/es/components/table/use/use-table.js +8 -8
- package/es/components/tree/index.d.ts +71 -71
- package/es/components/tree/tree-node.vue.d.ts +1 -1
- package/es/components/tree/tree.type.d.ts +2 -0
- package/es/components/tree/tree.vue.d.ts +14 -14
- package/es/components/tree-select/cache-options.d.ts +20 -0
- package/es/components/tree-select/cache-options.js +30 -0
- package/es/components/tree-select/index.d.ts +8 -0
- package/es/components/tree-select/index.js +10 -0
- package/es/components/tree-select/instance.d.ts +5 -0
- package/es/components/tree-select/instance.js +1 -0
- package/es/components/tree-select/select.d.ts +10 -0
- package/es/components/tree-select/select.js +129 -0
- package/es/components/tree-select/style/css.d.ts +4 -0
- package/es/components/tree-select/style/css.js +11 -0
- package/es/components/tree-select/style/index.d.ts +4 -0
- package/es/components/tree-select/style/index.js +11 -0
- package/es/components/tree-select/tree-select-option.d.ts +42 -0
- package/es/components/tree-select/tree-select-option.js +35 -0
- package/es/components/tree-select/tree-select.vue.d.ts +4 -0
- package/es/components/tree-select/tree-select.vue.js +5 -0
- package/es/components/tree-select/tree-select.vue2.js +155 -0
- package/es/components/tree-select/tree.d.ts +11 -0
- package/es/components/tree-select/tree.js +201 -0
- package/es/components/tree-select/utils.d.ts +10 -0
- package/es/components/tree-select/utils.js +45 -0
- package/es/index.js +1 -0
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/script.css +1 -1
- package/es/utils/form-register.d.ts +1 -0
- package/es/utils/form-register.js +11 -10
- package/lib/component.cjs +1 -1
- package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/button/index.d.ts +9 -9
- package/lib/components/index.cjs +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/modal/index.d.ts +6 -0
- package/lib/components/modal/modal.vue.d.ts +3 -0
- package/lib/components/modal/modal.vue2.cjs +1 -1
- package/lib/components/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/select/defaults.cjs +1 -1
- package/lib/components/select/defaults.d.ts +4 -0
- package/lib/components/select/index.d.ts +13 -4
- package/lib/components/select/select.vue.cjs +1 -1
- package/lib/components/select/select.vue.d.ts +13 -4
- package/lib/components/select/select.vue2.cjs +1 -1
- package/lib/components/select/token.d.ts +4 -1
- package/lib/components/select/useSelect.d.ts +4 -4
- package/lib/components/super-form/index.d.ts +9 -0
- package/lib/components/super-form/style/css.cjs +1 -1
- package/lib/components/super-form/style/css.d.ts +1 -0
- package/lib/components/super-form/style/index.cjs +1 -1
- package/lib/components/super-form/style/index.d.ts +1 -0
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/super-form.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +26 -1
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/components/super-form/use/use-form-events.cjs +1 -1
- package/lib/components/table/index.d.ts +9 -6
- package/lib/components/table/style/css.cjs +1 -1
- package/lib/components/table/style/index.cjs +1 -1
- package/lib/components/table/table.vue.d.ts +2 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/table/types.d.ts +5 -3
- package/lib/components/table/use/use-data-source.cjs +1 -1
- package/lib/components/table/use/use-data-source.d.ts +6 -4
- package/lib/components/table/use/use-table.cjs +1 -1
- package/lib/components/tree/index.d.ts +71 -71
- package/lib/components/tree/tree-node.vue.d.ts +1 -1
- package/lib/components/tree/tree.type.d.ts +2 -0
- package/lib/components/tree/tree.vue.d.ts +14 -14
- package/lib/components/tree-select/cache-options.cjs +1 -0
- package/lib/components/tree-select/cache-options.d.ts +20 -0
- package/lib/components/tree-select/index.cjs +1 -0
- package/lib/components/tree-select/index.d.ts +8 -0
- package/lib/components/tree-select/instance.cjs +1 -0
- package/lib/components/tree-select/instance.d.ts +5 -0
- package/lib/components/tree-select/select.cjs +1 -0
- package/lib/components/tree-select/select.d.ts +10 -0
- package/lib/components/tree-select/style/css.cjs +1 -0
- package/lib/components/tree-select/style/css.d.ts +4 -0
- package/lib/components/tree-select/style/index.cjs +1 -0
- package/lib/components/tree-select/style/index.d.ts +4 -0
- package/lib/components/tree-select/tree-select-option.cjs +1 -0
- package/lib/components/tree-select/tree-select-option.d.ts +42 -0
- package/lib/components/tree-select/tree-select.vue.cjs +1 -0
- package/lib/components/tree-select/tree-select.vue.d.ts +4 -0
- package/lib/components/tree-select/tree-select.vue2.cjs +1 -0
- package/lib/components/tree-select/tree.cjs +1 -0
- package/lib/components/tree-select/tree.d.ts +11 -0
- package/lib/components/tree-select/utils.cjs +1 -0
- package/lib/components/tree-select/utils.d.ts +10 -0
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/lib/script.css +1 -1
- package/lib/utils/form-register.cjs +1 -1
- package/lib/utils/form-register.d.ts +1 -0
- package/package.json +5 -5
- package/theme-style/index.css +1 -1
- package/theme-style/src/cascader.scss +1 -12
- package/theme-style/src/tree-select.scss +10 -1
- package/theme-style/vft-cascader.css +1 -1
- package/theme-style/vft-tree-select.css +1 -1
- package/web-types.json +1 -1
|
@@ -31,7 +31,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
31
31
|
type: import("vue").PropType<boolean | "strict">;
|
|
32
32
|
};
|
|
33
33
|
afterFetch: {
|
|
34
|
-
type: import("vue").PropType<(
|
|
34
|
+
type: import("vue").PropType<(data: import("../types").Recordable[]) => import("../types").Recordable[] | Promise<import("../types").Recordable[]>>;
|
|
35
35
|
};
|
|
36
36
|
transformParams: {
|
|
37
37
|
type: import("vue").PropType<boolean>;
|
|
@@ -504,7 +504,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
504
504
|
setProps: (props: Partial<import("./types").TableProps>) => void;
|
|
505
505
|
reload: (opt?: any) => Promise<import("../types").Recordable[] | undefined>;
|
|
506
506
|
deleteTableDataRecord: (row: import("../types").Recordable | import("../types").Recordable[], rowKey?: string | number | string[] | number[]) => void;
|
|
507
|
-
insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number) => import("../types").Recordable[] | undefined
|
|
507
|
+
insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number, parentRowId?: string | number) => Promise<import("../types").Recordable[] | undefined>;
|
|
508
508
|
updateTableDataRecord: (rowKey: string | number, record: import("../types").Recordable) => import("../types").Recordable | undefined;
|
|
509
509
|
updateTableData: (index: number, key: string, value: any) => Promise<import("../types").Recordable>;
|
|
510
510
|
setTableData: <T = import("../types").Recordable>(values: T[]) => void;
|
|
@@ -513,6 +513,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
513
513
|
setColumns: (columnList: any) => void;
|
|
514
514
|
getRawDataSource: () => import("../types").Recordable[];
|
|
515
515
|
tableSearch: (value: any) => void;
|
|
516
|
+
expandTreeLevel: (level?: number) => void;
|
|
516
517
|
table: import("vue").Ref<import("./types").TableInstance | undefined, import("./types").TableInstance | undefined>;
|
|
517
518
|
formRef: import("vue").Ref<any, any>;
|
|
518
519
|
pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -952,7 +953,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
952
953
|
type: import("vue").PropType<boolean | "strict">;
|
|
953
954
|
};
|
|
954
955
|
afterFetch: {
|
|
955
|
-
type: import("vue").PropType<(
|
|
956
|
+
type: import("vue").PropType<(data: import("../types").Recordable[]) => import("../types").Recordable[] | Promise<import("../types").Recordable[]>>;
|
|
956
957
|
};
|
|
957
958
|
transformParams: {
|
|
958
959
|
type: import("vue").PropType<boolean>;
|
|
@@ -1425,7 +1426,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
1425
1426
|
setProps: (props: Partial<import("./types").TableProps>) => void;
|
|
1426
1427
|
reload: (opt?: any) => Promise<import("../types").Recordable[] | undefined>;
|
|
1427
1428
|
deleteTableDataRecord: (row: import("../types").Recordable | import("../types").Recordable[], rowKey?: string | number | string[] | number[]) => void;
|
|
1428
|
-
insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number) => import("../types").Recordable[] | undefined
|
|
1429
|
+
insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number, parentRowId?: string | number) => Promise<import("../types").Recordable[] | undefined>;
|
|
1429
1430
|
updateTableDataRecord: (rowKey: string | number, record: import("../types").Recordable) => import("../types").Recordable | undefined;
|
|
1430
1431
|
updateTableData: (index: number, key: string, value: any) => Promise<import("../types").Recordable>;
|
|
1431
1432
|
setTableData: <T = import("../types").Recordable>(values: T[]) => void;
|
|
@@ -1434,6 +1435,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
1434
1435
|
setColumns: (columnList: any) => void;
|
|
1435
1436
|
getRawDataSource: () => import("../types").Recordable[];
|
|
1436
1437
|
tableSearch: (value: any) => void;
|
|
1438
|
+
expandTreeLevel: (level?: number) => void;
|
|
1437
1439
|
table: import("vue").Ref<import("./types").TableInstance | undefined, import("./types").TableInstance | undefined>;
|
|
1438
1440
|
formRef: import("vue").Ref<any, any>;
|
|
1439
1441
|
pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1757,7 +1759,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
1757
1759
|
type: import("vue").PropType<boolean | "strict">;
|
|
1758
1760
|
};
|
|
1759
1761
|
afterFetch: {
|
|
1760
|
-
type: import("vue").PropType<(
|
|
1762
|
+
type: import("vue").PropType<(data: import("../types").Recordable[]) => import("../types").Recordable[] | Promise<import("../types").Recordable[]>>;
|
|
1761
1763
|
};
|
|
1762
1764
|
transformParams: {
|
|
1763
1765
|
type: import("vue").PropType<boolean>;
|
|
@@ -2230,7 +2232,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
2230
2232
|
setProps: (props: Partial<import("./types").TableProps>) => void;
|
|
2231
2233
|
reload: (opt?: any) => Promise<import("../types").Recordable[] | undefined>;
|
|
2232
2234
|
deleteTableDataRecord: (row: import("../types").Recordable | import("../types").Recordable[], rowKey?: string | number | string[] | number[]) => void;
|
|
2233
|
-
insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number) => import("../types").Recordable[] | undefined
|
|
2235
|
+
insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number, parentRowId?: string | number) => Promise<import("../types").Recordable[] | undefined>;
|
|
2234
2236
|
updateTableDataRecord: (rowKey: string | number, record: import("../types").Recordable) => import("../types").Recordable | undefined;
|
|
2235
2237
|
updateTableData: (index: number, key: string, value: any) => Promise<import("../types").Recordable>;
|
|
2236
2238
|
setTableData: <T = import("../types").Recordable>(values: T[]) => void;
|
|
@@ -2239,6 +2241,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
2239
2241
|
setColumns: (columnList: any) => void;
|
|
2240
2242
|
getRawDataSource: () => import("../types").Recordable[];
|
|
2241
2243
|
tableSearch: (value: any) => void;
|
|
2244
|
+
expandTreeLevel: (level?: number) => void;
|
|
2242
2245
|
table: import("vue").Ref<import("./types").TableInstance | undefined, import("./types").TableInstance | undefined>;
|
|
2243
2246
|
formRef: import("vue").Ref<any, any>;
|
|
2244
2247
|
pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -36,6 +36,8 @@ import "vft/theme-style/vft-col.css";
|
|
|
36
36
|
import "vft/theme-style/vft-form.css";
|
|
37
37
|
import "vft/theme-style/vft-form-item.css";
|
|
38
38
|
import "vft/theme-style/vft-time-select.css";
|
|
39
|
+
import "vft/theme-style/vft-tree.css";
|
|
40
|
+
import "vft/theme-style/vft-tree-select.css";
|
|
39
41
|
import "vft/theme-style/vft-super-form.css";
|
|
40
42
|
import "vft/theme-style/vft-skeleton-item.css";
|
|
41
43
|
import "vft/theme-style/vft-skeleton.css";
|
|
@@ -40,5 +40,7 @@ import "vft/theme-style/src/col.scss";
|
|
|
40
40
|
import "vft/theme-style/src/form.scss";
|
|
41
41
|
import "vft/theme-style/src/form-item.scss";
|
|
42
42
|
import "vft/theme-style/src/time-select.scss";
|
|
43
|
+
import "vft/theme-style/src/tree.scss";
|
|
44
|
+
import "vft/theme-style/src/tree-select.scss";
|
|
43
45
|
import "vft/theme-style/src/super-form.scss";
|
|
44
46
|
import "vft/theme-style/src/table.scss";
|
|
@@ -15,7 +15,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
15
15
|
setProps: typeof setProps;
|
|
16
16
|
reload: (opt?: any) => Promise<import("../types").Recordable[] | undefined>;
|
|
17
17
|
deleteTableDataRecord: (row: import("../types").Recordable | import("../types").Recordable[], rowKey?: string | number | string[] | number[]) => void;
|
|
18
|
-
insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number) => import("../types").Recordable[] | undefined
|
|
18
|
+
insertTableDataRecord: (record: import("../types").Recordable | import("../types").Recordable[], index?: number, parentRowId?: string | number) => Promise<import("../types").Recordable[] | undefined>;
|
|
19
19
|
updateTableDataRecord: (rowKey: string | number, record: import("../types").Recordable) => import("../types").Recordable | undefined;
|
|
20
20
|
updateTableData: (index: number, key: string, value: any) => Promise<import("../types").Recordable>;
|
|
21
21
|
setTableData: <T = import("../types").Recordable>(values: T[]) => void;
|
|
@@ -24,6 +24,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
24
24
|
setColumns: (columnList: any) => void;
|
|
25
25
|
getRawDataSource: () => import("../types").Recordable[];
|
|
26
26
|
tableSearch: (value: any) => void;
|
|
27
|
+
expandTreeLevel: (level?: number) => void;
|
|
27
28
|
table: import("vue").Ref<TableInstance | undefined, TableInstance | undefined>;
|
|
28
29
|
formRef: import("vue").Ref<any, any>;
|
|
29
30
|
pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as K, createVNode as i, useAttrs as
|
|
2
|
-
import { VftClientOnly as
|
|
3
|
-
import { VftEmpty as
|
|
4
|
-
import { vLoading as
|
|
5
|
-
import { deepMerge as L, isClient as
|
|
6
|
-
import { FormCompEnum as
|
|
1
|
+
import { defineComponent as K, createVNode as i, useAttrs as ue, ref as d, getCurrentInstance as me, computed as $, unref as o, watch as pe, nextTick as _, toRaw as he, createElementBlock as Ce, openBlock as k, normalizeClass as be, withCtx as n, createBlock as G, createCommentVNode as M, mergeProps as q, withDirectives as ye, createElementVNode as we, vShow as ve, renderSlot as s, normalizeProps as p, guardReactiveProps as h, createSlots as xe, createTextVNode as ke } from "vue";
|
|
2
|
+
import { VftClientOnly as Se } from "../client-only/index.js";
|
|
3
|
+
import { VftEmpty as Be } from "../empty/index.js";
|
|
4
|
+
import { vLoading as Re } from "../loading/directive.js";
|
|
5
|
+
import { deepMerge as L, isClient as ze, omit as Pe, isFunction as S } from "@vft/utils";
|
|
6
|
+
import { FormCompEnum as C } from "../../utils/form-register.js";
|
|
7
7
|
import "@vueuse/core";
|
|
8
8
|
import "../config-provider/hooks/use-global-config.js";
|
|
9
9
|
import "lodash-es";
|
|
10
|
-
import { useForm as
|
|
11
|
-
import { useNamespace as
|
|
10
|
+
import { useForm as De } from "../super-form/use/use-form.js";
|
|
11
|
+
import { useNamespace as He } from "../../hooks/use-namespace/index.js";
|
|
12
12
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
13
|
import "@popperjs/core";
|
|
14
14
|
import "../../hooks/use-z-index/index.js";
|
|
15
15
|
import "../icon/index.js";
|
|
16
|
-
import { VftPagination as
|
|
17
|
-
import { VftSkeleton as
|
|
16
|
+
import { VftPagination as Oe } from "../pagination/index.js";
|
|
17
|
+
import { VftSkeleton as Te } from "../skeleton/index.js";
|
|
18
18
|
import { VftSuperForm as Fe } from "../super-form/index.js";
|
|
19
|
-
import { VxeGrid as
|
|
20
|
-
import
|
|
21
|
-
import { PageSize as
|
|
22
|
-
import { useColumns as
|
|
23
|
-
import { useDataSource as
|
|
24
|
-
import { useLoading as
|
|
25
|
-
import { usePagination as
|
|
26
|
-
import { EmptyEnum as
|
|
19
|
+
import { VxeGrid as Ae } from "vxe-table";
|
|
20
|
+
import Ee from "xe-utils";
|
|
21
|
+
import { PageSize as I } from "./constants.js";
|
|
22
|
+
import { useColumns as Ne } from "./use/use-columns.js";
|
|
23
|
+
import { useDataSource as Ve } from "./use/use-data-source.js";
|
|
24
|
+
import { useLoading as $e } from "./use/use-loading.js";
|
|
25
|
+
import { usePagination as _e } from "./use/use-pagination.js";
|
|
26
|
+
import { EmptyEnum as Ge } from "../empty/constants.js";
|
|
27
27
|
const Me = K({
|
|
28
28
|
name: "vft-table"
|
|
29
|
-
}),
|
|
29
|
+
}), ho = /* @__PURE__ */ K({
|
|
30
30
|
...Me,
|
|
31
31
|
props: {
|
|
32
32
|
sticky: {
|
|
@@ -34,7 +34,7 @@ const Me = K({
|
|
|
34
34
|
},
|
|
35
35
|
api: {},
|
|
36
36
|
pageSize: {
|
|
37
|
-
default:
|
|
37
|
+
default: I
|
|
38
38
|
},
|
|
39
39
|
total: {},
|
|
40
40
|
rowkey: {
|
|
@@ -79,7 +79,7 @@ const Me = K({
|
|
|
79
79
|
onChange: {},
|
|
80
80
|
emptyCfg: {
|
|
81
81
|
default: () => ({
|
|
82
|
-
type:
|
|
82
|
+
type: Ge.NoData
|
|
83
83
|
})
|
|
84
84
|
},
|
|
85
85
|
loadingCfg: {
|
|
@@ -403,22 +403,22 @@ const Me = K({
|
|
|
403
403
|
expose: X,
|
|
404
404
|
emit: j
|
|
405
405
|
}) {
|
|
406
|
-
const c = j, g =
|
|
406
|
+
const c = j, g = He("table"), Y = ue(), f = d(), B = d(), W = d([]), b = d(), y = d(), U = me(), a = $(() => L(U.props, o(b))), {
|
|
407
407
|
getLoading: J,
|
|
408
408
|
setLoading: Q
|
|
409
|
-
} = Ve(a), {
|
|
410
|
-
getPaginationInfo: f,
|
|
411
|
-
setPagination: y,
|
|
412
|
-
getCurrentPage: Z
|
|
413
409
|
} = $e(a), {
|
|
410
|
+
getPaginationInfo: u,
|
|
411
|
+
setPagination: w,
|
|
412
|
+
getCurrentPage: Z
|
|
413
|
+
} = _e(a), {
|
|
414
414
|
getViewColumns: ee,
|
|
415
415
|
setColumns: oe
|
|
416
|
-
} =
|
|
417
|
-
|
|
416
|
+
} = Ne(a);
|
|
417
|
+
pe(() => Z(), (e) => {
|
|
418
418
|
_(() => {
|
|
419
419
|
R({
|
|
420
420
|
seqConfig: {
|
|
421
|
-
startIndex: (e - 1) * (
|
|
421
|
+
startIndex: (e - 1) * (u.value?.pageSize || o(a).pageSize || I)
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
424
|
});
|
|
@@ -426,15 +426,15 @@ const Me = K({
|
|
|
426
426
|
immediate: !0
|
|
427
427
|
});
|
|
428
428
|
function R(e) {
|
|
429
|
-
|
|
430
|
-
...o(
|
|
429
|
+
b.value = {
|
|
430
|
+
...o(b),
|
|
431
431
|
...e
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
434
|
const {
|
|
435
435
|
getDataSourceRef: z,
|
|
436
436
|
handleTableChange: ae,
|
|
437
|
-
reload:
|
|
437
|
+
reload: v,
|
|
438
438
|
deleteTableDataRecord: te,
|
|
439
439
|
insertTableDataRecord: le,
|
|
440
440
|
updateTableData: re,
|
|
@@ -442,23 +442,25 @@ const Me = K({
|
|
|
442
442
|
setTableData: P,
|
|
443
443
|
getDataSource: ce,
|
|
444
444
|
getRawDataSource: D,
|
|
445
|
-
tableSearch: H
|
|
446
|
-
|
|
445
|
+
tableSearch: H,
|
|
446
|
+
expandTreeLevel: ie
|
|
447
|
+
} = Ve(a, {
|
|
447
448
|
tableData: W,
|
|
448
449
|
setLoading: Q,
|
|
449
|
-
getPaginationInfo:
|
|
450
|
-
setPagination:
|
|
450
|
+
getPaginationInfo: u,
|
|
451
|
+
setPagination: w,
|
|
452
|
+
getGridRef: () => f.value
|
|
451
453
|
}, c);
|
|
452
454
|
function O(e) {
|
|
453
|
-
e?.pageSize &&
|
|
455
|
+
e?.pageSize && w({
|
|
454
456
|
currentPage: 1
|
|
455
457
|
}), ae(e), c("change", e);
|
|
456
458
|
const {
|
|
457
459
|
onChange: t
|
|
458
460
|
} = o(a);
|
|
459
|
-
t &&
|
|
461
|
+
t && S(t) && t(e);
|
|
460
462
|
}
|
|
461
|
-
const
|
|
463
|
+
const T = {};
|
|
462
464
|
[
|
|
463
465
|
"update:data",
|
|
464
466
|
"keydown-start",
|
|
@@ -580,19 +582,19 @@ const Me = K({
|
|
|
580
582
|
"toolbar-tool-click",
|
|
581
583
|
"zoom"
|
|
582
584
|
].forEach((e) => {
|
|
583
|
-
const t =
|
|
584
|
-
|
|
585
|
+
const t = Ee.camelCase(`on-${e}`);
|
|
586
|
+
T[t] = (...l) => c(e, ...l);
|
|
585
587
|
});
|
|
586
588
|
const r = $(() => {
|
|
587
589
|
const e = o(z), t = {
|
|
588
590
|
...Y,
|
|
589
591
|
...o(a),
|
|
590
|
-
columns:
|
|
592
|
+
columns: he(o(ee)),
|
|
591
593
|
loading: o(J),
|
|
592
594
|
data: e,
|
|
593
|
-
...
|
|
595
|
+
...T
|
|
594
596
|
};
|
|
595
|
-
if (
|
|
597
|
+
if (ze) {
|
|
596
598
|
(o(a)?.addMaxHeight || o(a)?.maxHeight) && (t.maxHeight = o(a)?.maxHeight ? o(a)?.maxHeight : `${window.innerHeight - o(a)?.extraSysHeight - (a.value?.showPager ? a.value?.pageHeight || 40 : 0)}px`);
|
|
597
599
|
const l = o(a)?.minHeight;
|
|
598
600
|
t.minHeight = l || (l !== 0 && o(a)?.toolbarConfig?.custom ? 300 : void 0);
|
|
@@ -604,14 +606,14 @@ const Me = K({
|
|
|
604
606
|
},
|
|
605
607
|
autoLoad: !1,
|
|
606
608
|
ajax: {
|
|
607
|
-
query: async () => await
|
|
609
|
+
query: async () => await v()
|
|
608
610
|
}
|
|
609
611
|
}), t;
|
|
610
|
-
}),
|
|
611
|
-
setPagination:
|
|
612
|
+
}), F = {
|
|
613
|
+
setPagination: w,
|
|
612
614
|
emit: c,
|
|
613
615
|
setProps: R,
|
|
614
|
-
reload:
|
|
616
|
+
reload: v,
|
|
615
617
|
deleteTableDataRecord: te,
|
|
616
618
|
insertTableDataRecord: le,
|
|
617
619
|
updateTableDataRecord: ne,
|
|
@@ -621,13 +623,14 @@ const Me = K({
|
|
|
621
623
|
getDataSourceRef: z,
|
|
622
624
|
setColumns: oe,
|
|
623
625
|
getRawDataSource: D,
|
|
624
|
-
tableSearch: H
|
|
626
|
+
tableSearch: H,
|
|
627
|
+
expandTreeLevel: ie
|
|
625
628
|
};
|
|
626
|
-
c("register",
|
|
627
|
-
const
|
|
629
|
+
c("register", F);
|
|
630
|
+
const se = {
|
|
628
631
|
field: "_filterTableData",
|
|
629
632
|
label: "",
|
|
630
|
-
type:
|
|
633
|
+
type: C.Search,
|
|
631
634
|
itemProps: {
|
|
632
635
|
class: "search-all-form-item"
|
|
633
636
|
},
|
|
@@ -639,7 +642,7 @@ const Me = K({
|
|
|
639
642
|
}
|
|
640
643
|
})
|
|
641
644
|
}, A = L({
|
|
642
|
-
schemas: [r.value?.formOptions?.addSearchAllSchema ?
|
|
645
|
+
schemas: [r.value?.formOptions?.addSearchAllSchema ? se : {}],
|
|
643
646
|
rowProps: {
|
|
644
647
|
justify: "start"
|
|
645
648
|
},
|
|
@@ -653,37 +656,37 @@ const Me = K({
|
|
|
653
656
|
btnText: "搜索"
|
|
654
657
|
},
|
|
655
658
|
actionInline: !0
|
|
656
|
-
},
|
|
657
|
-
e &&
|
|
658
|
-
|
|
659
|
+
}, Pe(r.value?.formOptions, ["showActionForm", "addSearchAllSchema"]), "replace"), E = (e) => (...t) => {
|
|
660
|
+
e && S(e) && e(...t), _(() => {
|
|
661
|
+
v();
|
|
659
662
|
});
|
|
660
|
-
}, [
|
|
663
|
+
}, [de] = De({
|
|
661
664
|
...A,
|
|
662
665
|
schemas: (o(A)?.schemas || []).map((e) => {
|
|
663
666
|
if (!o(r)?.formOptions?.autoReloadOnClear)
|
|
664
667
|
return e;
|
|
665
|
-
if (!e.type || e.type ===
|
|
668
|
+
if (!e.type || e.type === C.Input || e.type === C.Search || e.type === C.Textarea) {
|
|
666
669
|
const {
|
|
667
|
-
componentProps:
|
|
670
|
+
componentProps: m
|
|
668
671
|
} = e;
|
|
669
|
-
if (
|
|
672
|
+
if (S(m))
|
|
670
673
|
return {
|
|
671
674
|
...e,
|
|
672
|
-
componentProps: async (
|
|
673
|
-
const V = await
|
|
675
|
+
componentProps: async (x) => {
|
|
676
|
+
const V = await m(x), fe = V?.onClear;
|
|
674
677
|
return {
|
|
675
678
|
...V,
|
|
676
|
-
onClear: E(
|
|
679
|
+
onClear: E(fe)
|
|
677
680
|
};
|
|
678
681
|
}
|
|
679
682
|
};
|
|
680
683
|
{
|
|
681
|
-
const
|
|
684
|
+
const x = m?.onClear;
|
|
682
685
|
return {
|
|
683
686
|
...e,
|
|
684
687
|
componentProps: {
|
|
685
|
-
...
|
|
686
|
-
onClear: E(
|
|
688
|
+
...m,
|
|
689
|
+
onClear: E(x)
|
|
687
690
|
}
|
|
688
691
|
};
|
|
689
692
|
}
|
|
@@ -692,66 +695,68 @@ const Me = K({
|
|
|
692
695
|
})
|
|
693
696
|
}), N = (e) => {
|
|
694
697
|
Reflect.has(e, "_filterTableData") && H(e._filterTableData), c("form-submit", e);
|
|
695
|
-
},
|
|
698
|
+
}, ge = () => {
|
|
696
699
|
P(D()), c("form-reset");
|
|
697
700
|
};
|
|
698
|
-
return
|
|
699
|
-
|
|
700
|
-
|
|
701
|
+
return setTimeout(() => {
|
|
702
|
+
console.log(f.value, "xGridxGrid");
|
|
703
|
+
}, 1500), X({
|
|
704
|
+
table: f,
|
|
705
|
+
formRef: y,
|
|
701
706
|
pageRef: B,
|
|
702
|
-
...
|
|
703
|
-
}), (e, t) => (k(),
|
|
704
|
-
class:
|
|
705
|
-
[o(g).is("form-exceed-one-rows")]:
|
|
707
|
+
...F
|
|
708
|
+
}), (e, t) => (k(), Ce("div", {
|
|
709
|
+
class: be([o(g).b(), {
|
|
710
|
+
[o(g).is("form-exceed-one-rows")]: y.value?.willExceedOneRow
|
|
706
711
|
}])
|
|
707
|
-
}, [i(o(
|
|
708
|
-
fallback: n(() => [i(o(
|
|
709
|
-
default: n(() => [i(o(
|
|
712
|
+
}, [i(o(Se), null, {
|
|
713
|
+
fallback: n(() => [i(o(Te))]),
|
|
714
|
+
default: n(() => [i(o(Ae), q({
|
|
710
715
|
ref_key: "xGrid",
|
|
711
|
-
ref:
|
|
716
|
+
ref: f
|
|
712
717
|
}, r.value), {
|
|
713
|
-
toolbarButtons: n(() => [s(e.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (k(),
|
|
718
|
+
toolbarButtons: n(() => [s(e.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (k(), G(o(Fe), {
|
|
714
719
|
key: 0,
|
|
715
720
|
ref_key: "formRef",
|
|
716
|
-
ref:
|
|
717
|
-
onRegister: o(
|
|
721
|
+
ref: y,
|
|
722
|
+
onRegister: o(de),
|
|
718
723
|
onSubmit: N,
|
|
719
|
-
onReset:
|
|
720
|
-
},
|
|
724
|
+
onReset: ge
|
|
725
|
+
}, xe({
|
|
721
726
|
_: 2
|
|
722
727
|
}, [e.$slots.resetBefore ? {
|
|
723
728
|
name: "resetBefore",
|
|
724
|
-
fn: n((l) => [s(e.$slots, "resetBefore",
|
|
729
|
+
fn: n((l) => [s(e.$slots, "resetBefore", p(h(l)))]),
|
|
725
730
|
key: "0"
|
|
726
731
|
} : void 0, e.$slots.submitBefore ? {
|
|
727
732
|
name: "submitBefore",
|
|
728
|
-
fn: n((l) => [s(e.$slots, "submitBefore",
|
|
733
|
+
fn: n((l) => [s(e.$slots, "submitBefore", p(h(l)))]),
|
|
729
734
|
key: "1"
|
|
730
735
|
} : void 0, e.$slots.submitAfter ? {
|
|
731
736
|
name: "submitAfter",
|
|
732
|
-
fn: n((l) => [s(e.$slots, "submitAfter",
|
|
737
|
+
fn: n((l) => [s(e.$slots, "submitAfter", p(h(l)))]),
|
|
733
738
|
key: "2"
|
|
734
|
-
} : void 0]), 1032, ["onRegister"])) :
|
|
735
|
-
empty: n(() => [s(e.$slots, "empty", {}, () => [i(o(
|
|
736
|
-
loading: n(() => [
|
|
739
|
+
} : void 0]), 1032, ["onRegister"])) : M("", !0), s(e.$slots, "toolbar-right")]),
|
|
740
|
+
empty: n(() => [s(e.$slots, "empty", {}, () => [i(o(Be), p(h(r.value.emptyCfg)), null, 16)])]),
|
|
741
|
+
loading: n(() => [ye(we("div", null, null, 512), [[ve, r.value.loading], [o(Re), r.value.loadingCfg]])]),
|
|
737
742
|
_: 3
|
|
738
|
-
}, 16), r.value.showPager ? (k(),
|
|
743
|
+
}, 16), r.value.showPager ? (k(), G(o(Oe), q({
|
|
739
744
|
key: 0,
|
|
740
745
|
ref_key: "pageRef",
|
|
741
746
|
ref: B
|
|
742
|
-
}, o(
|
|
743
|
-
class: [o(g).e("pager"), o(g).m(`pager-${o(
|
|
747
|
+
}, o(u), {
|
|
748
|
+
class: [o(g).e("pager"), o(g).m(`pager-${o(u)?.pagePlacement}`)],
|
|
744
749
|
onCurrentChange: t[0] || (t[0] = (l) => O({
|
|
745
750
|
currentPage: l
|
|
746
751
|
})),
|
|
747
752
|
onSizeChange: t[1] || (t[1] = (l) => O({
|
|
748
753
|
pageSize: l
|
|
749
754
|
}))
|
|
750
|
-
}), null, 16, ["class"])) :
|
|
755
|
+
}), null, 16, ["class"])) : M("", !0)]),
|
|
751
756
|
_: 3
|
|
752
757
|
})], 2));
|
|
753
758
|
}
|
|
754
759
|
});
|
|
755
760
|
export {
|
|
756
|
-
|
|
761
|
+
ho as default
|
|
757
762
|
};
|
|
@@ -47,7 +47,7 @@ export interface TableProps extends VxeGridProps {
|
|
|
47
47
|
/** 是否删除空参数,true 表示删除空字符串和 null,'strict' 表示删除空字符串、null 和 undefined */
|
|
48
48
|
delEmptyParams?: boolean | 'strict';
|
|
49
49
|
/** 数据获取后的处理函数,可以对响应数据进行转换 */
|
|
50
|
-
afterFetch?: (
|
|
50
|
+
afterFetch?: (data: Recordable[]) => Recordable[] | Promise<Recordable[]>;
|
|
51
51
|
/** 是否转换参数,将分页参数转换为标准格式,默认为 true */
|
|
52
52
|
transformParams?: boolean;
|
|
53
53
|
/** 额外的请求参数,会合并到请求参数中 */
|
|
@@ -109,8 +109,10 @@ export interface TableActionType {
|
|
|
109
109
|
updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | void;
|
|
110
110
|
/** 删除指定的数据记录,支持单个或多个记录 */
|
|
111
111
|
deleteTableDataRecord: (row: Recordable | Recordable[], rowKey?: string | number | string[] | number[]) => void;
|
|
112
|
-
/**
|
|
113
|
-
insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable[] | void
|
|
112
|
+
/** 插入新的数据记录,可指定插入位置和父节点 */
|
|
113
|
+
insertTableDataRecord: (record: Recordable | Recordable[], index?: number, parentRowId?: string | number) => Promise<Recordable[] | void>;
|
|
114
114
|
/** 根据 rowKey 查找指定的数据记录 */
|
|
115
115
|
findTableDataRecord: (rowKey: string | number) => Recordable | void;
|
|
116
|
+
/** 展开树形表格指定层级 */
|
|
117
|
+
expandTreeLevel: (level?: number) => void;
|
|
116
118
|
}
|
|
@@ -2,16 +2,17 @@ import { type PaginationProps } from 'vft/es/components/pagination';
|
|
|
2
2
|
import { type ComputedRef } from 'vue';
|
|
3
3
|
import { type Recordable } from '../../types';
|
|
4
4
|
import type { TableProps } from '../types';
|
|
5
|
-
export declare function useDataSource(propsRef: ComputedRef<TableProps>, { tableData, setLoading, getPaginationInfo, setPagination }: {
|
|
5
|
+
export declare function useDataSource(propsRef: ComputedRef<TableProps>, { tableData, setLoading, getPaginationInfo, setPagination, getGridRef, }: {
|
|
6
6
|
tableData: any;
|
|
7
|
-
setLoading:
|
|
7
|
+
setLoading: (loading: boolean) => void;
|
|
8
8
|
getPaginationInfo: any;
|
|
9
|
-
setPagination: any;
|
|
9
|
+
setPagination: (info: any) => void;
|
|
10
|
+
getGridRef: () => any;
|
|
10
11
|
}, emit: any): {
|
|
11
12
|
setTableData: <T = Recordable>(values: T[]) => void;
|
|
12
13
|
updateTableData: (index: number, key: string, value: any) => Promise<Recordable>;
|
|
13
14
|
updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | undefined;
|
|
14
|
-
insertTableDataRecord: (record: Recordable | Recordable[], index?: number) => Recordable[] | undefined
|
|
15
|
+
insertTableDataRecord: (record: Recordable | Recordable[], index?: number, parentRowId?: string | number) => Promise<Recordable[] | undefined>;
|
|
15
16
|
deleteTableDataRecord: (row: Recordable | Recordable[], rowKey?: string | number | string[] | number[]) => void;
|
|
16
17
|
reload: (opt?: any) => Promise<Recordable[] | undefined>;
|
|
17
18
|
handleTableChange: (pagination: PaginationProps) => void;
|
|
@@ -19,4 +20,5 @@ export declare function useDataSource(propsRef: ComputedRef<TableProps>, { table
|
|
|
19
20
|
getDataSource: <T = Recordable>() => T[];
|
|
20
21
|
getRawDataSource: () => Recordable[];
|
|
21
22
|
tableSearch: (value: any) => void;
|
|
23
|
+
expandTreeLevel: (level?: number) => void;
|
|
22
24
|
};
|