@kengic/vue 0.6.11-beta.0 → 0.6.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ComputedRef, Ref } from 'vue';
|
2
2
|
import { IRemoveEventListenerHandler } from '../../consts';
|
3
|
-
import { IKgTableBeforeRetrieveCb, IKgTableRetrieveCb, IKgTableRowDoubleClickCb, IKgTableStore } from './index.store';
|
3
|
+
import { IKgTableBeforeRetrieveCb, IKgTableBeforeSetDatasCb, IKgTableRetrieveCb, IKgTableRowDoubleClickCb, IKgTableStore } from './index.store';
|
4
4
|
export declare type IUseKgTable = {
|
5
5
|
formID: string;
|
6
6
|
/** 状态数据. */
|
@@ -42,7 +42,13 @@ export declare type IUseKgTable = {
|
|
42
42
|
*/
|
43
43
|
onBeforeRetrieve(cb: IKgTableBeforeRetrieveCb, once?: boolean): IRemoveEventListenerHandler;
|
44
44
|
/**
|
45
|
-
* 监听事件:
|
45
|
+
* 监听事件: 查询请求成功, 表格数据尚未赋值. 此处可以对返回的列表数据作处理.
|
46
|
+
* @param cb 回调函数.
|
47
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
48
|
+
*/
|
49
|
+
onBeforeSetDatas(cb: IKgTableBeforeSetDatasCb, once?: boolean): IRemoveEventListenerHandler;
|
50
|
+
/**
|
51
|
+
* 监听事件: 查询请求成功, 表格数据已经赋值.
|
46
52
|
* @param cb 回调函数.
|
47
53
|
* @param once 是否只会触发一次. 默认为 undefined.
|
48
54
|
*/
|
@@ -6,11 +6,12 @@ import { IKgEventCb } from '../../consts';
|
|
6
6
|
import { IKgTableRow } from './index.vm';
|
7
7
|
/**
|
8
8
|
* 事件类型.
|
9
|
-
* 'rowDoubleClick':
|
10
|
-
* 'beforeRetrieve':
|
11
|
-
* '
|
9
|
+
* 'rowDoubleClick': 双击某行.
|
10
|
+
* 'beforeRetrieve': 即将发起查询请求.
|
11
|
+
* 'beforeSetDatas': 查询请求成功, 表格数据尚未赋值. 此处可以对返回的列表数据作处理.
|
12
|
+
* 'retrieve': 查询请求成功, 表格数据已经赋值.
|
12
13
|
*/
|
13
|
-
export declare type IKgTableEvent = 'rowDoubleClick' | 'beforeRetrieve' | 'retrieve';
|
14
|
+
export declare type IKgTableEvent = 'rowDoubleClick' | 'beforeRetrieve' | 'beforeSetDatas' | 'retrieve';
|
14
15
|
/** 事件监听函数: rowDoubleClick. */
|
15
16
|
export declare type IKgTableRowDoubleClickParam = {
|
16
17
|
/** 双击的行. */
|
@@ -25,16 +26,24 @@ export declare type IKgTableBeforeRetrieveCbParam = {
|
|
25
26
|
response: Ref;
|
26
27
|
};
|
27
28
|
export declare type IKgTableBeforeRetrieveCb = ((param: IKgTableBeforeRetrieveCbParam) => Promise<boolean>) & IKgEventCb;
|
29
|
+
/** 事件监听函数: beforeSetDatas. */
|
30
|
+
export declare type IKgTableBeforeSetDatasCbParam = {
|
31
|
+
/** 经过组件处理之后的列表数据. */
|
32
|
+
datas: Ref<Array<IKgTableRow>>;
|
33
|
+
/** 总数. */
|
34
|
+
total: Ref<number>;
|
35
|
+
};
|
36
|
+
export declare type IKgTableBeforeSetDatasCb = ((param: IKgTableBeforeSetDatasCbParam) => Promise<boolean>) & IKgEventCb;
|
28
37
|
/** 事件监听函数: retrieve. */
|
29
38
|
export declare type IKgTableRetrieveCbParam = {
|
30
39
|
/** 接口返回的分页数据. */
|
31
40
|
page: IPage<IKgTableRow> | undefined | null;
|
32
|
-
/**
|
41
|
+
/** 经过组件处理之后的列表数据. */
|
33
42
|
datas: Ref<Array<IKgTableRow>>;
|
34
43
|
};
|
35
44
|
export declare type IKgTableRetrieveCb = ((param: IKgTableRetrieveCbParam) => Promise<boolean>) & IKgEventCb;
|
36
|
-
export declare type IKgTableCbParam = IKgTableRowDoubleClickParam | IKgTableBeforeRetrieveCbParam | IKgTableRetrieveCbParam;
|
37
|
-
export declare type IKgTableCb = IKgTableRowDoubleClickCb | IKgTableBeforeRetrieveCb | IKgTableRetrieveCb;
|
45
|
+
export declare type IKgTableCbParam = IKgTableRowDoubleClickParam | IKgTableBeforeRetrieveCbParam | IKgTableBeforeSetDatasCbParam | IKgTableRetrieveCbParam;
|
46
|
+
export declare type IKgTableCb = IKgTableRowDoubleClickCb | IKgTableBeforeRetrieveCb | IKgTableBeforeSetDatasCb | IKgTableRetrieveCb;
|
38
47
|
export interface IKgTableState {
|
39
48
|
/** 勾选的行的主键. */
|
40
49
|
selectedRowKeysMap: Map<string, Ref<Array<Key>>>;
|
@@ -53,6 +62,7 @@ export interface IKgTableState {
|
|
53
62
|
/** '双击某行'事件监听函数列表. */
|
54
63
|
rowDoubleClickListenersMap: Map<string, Array<IKgTableRowDoubleClickCb>>;
|
55
64
|
beforeRetrieveListenersMap: Map<string, Array<IKgTableBeforeRetrieveCb>>;
|
65
|
+
beforeSetDatasListenersMap: Map<string, Array<IKgTableBeforeSetDatasCb>>;
|
56
66
|
retrieveListenersMap: Map<string, Array<IKgTableRetrieveCb>>;
|
57
67
|
}
|
58
68
|
export declare type IKgTableStoreDefinition = StoreDefinition<'KgTable', IKgTableState, {
|