@kengic/vue 0.7.0 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
|
|
1
1
|
import { IRemoveEventListenerHandler, KG_BUTTON_TYPE } from '../../consts';
|
2
|
-
import { IKgButtonClickCb, IKgButtonDeleteOkCb, IKgButtonStore, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb, IKgButtonUpdateBeforeClickCb } from './index.store';
|
2
|
+
import { IKgButtonClickCb, IKgButtonDeleteOkCb, IKgButtonOtherOkCb, IKgButtonStore, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb, IKgButtonUpdateBeforeClickCb } from './index.store';
|
3
3
|
export declare type IUseKgButton = {
|
4
4
|
formID: string;
|
5
5
|
/** 状态数据. */
|
@@ -30,6 +30,12 @@ export declare type IUseKgButton = {
|
|
30
30
|
* @param once 是否只会触发一次. 默认为 undefined.
|
31
31
|
*/
|
32
32
|
onDeleteOk(cb: IKgButtonDeleteOkCb, once?: boolean): IRemoveEventListenerHandler;
|
33
|
+
/**
|
34
|
+
* 监听事件: other 类型的按钮接口调用成功.
|
35
|
+
* @param cb 回调函数.
|
36
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
37
|
+
*/
|
38
|
+
onOtherOk(cb: IKgButtonOtherOkCb, once?: boolean): IRemoveEventListenerHandler;
|
33
39
|
/**
|
34
40
|
* 监听事件: 表格内编辑时, 点击保存按钮.
|
35
41
|
* @param cb 回调函数.
|
@@ -7,10 +7,11 @@ import { IKgTableRow } from '../KgTable';
|
|
7
7
|
* 'click': 点击按钮
|
8
8
|
* 'updateBeforeClick': 点击更新按钮之后, 执行默认逻辑之前. 如果返回 Promise.resolve(false), 则不执行默认逻辑
|
9
9
|
* 'deleteOk': 删除成功, 删除接口调用成功
|
10
|
+
* 'otherOk': other 类型的按钮接口调用成功
|
10
11
|
* 'submitSave': 表格内编辑时, 点击保存按钮
|
11
12
|
* 'submitCancel': 表格内编辑时, 点击取消按钮
|
12
13
|
*/
|
13
|
-
export declare type IKgButtonEvent = 'click' | 'updateBeforeClick' | 'deleteOk' | 'submitSave' | 'submitCancel';
|
14
|
+
export declare type IKgButtonEvent = 'click' | 'updateBeforeClick' | 'deleteOk' | 'otherOk' | 'submitSave' | 'submitCancel';
|
14
15
|
/** 事件监听函数: click. */
|
15
16
|
export declare type IKgButtonClickCbParam = {
|
16
17
|
button: VarButton;
|
@@ -24,15 +25,24 @@ export declare type IKgButtonUpdateBeforeClickCbParam = {
|
|
24
25
|
export declare type IKgButtonUpdateBeforeClickCb = ((args: IKgButtonUpdateBeforeClickCbParam) => Promise<boolean>) & IKgEventCb;
|
25
26
|
/** 事件监听函数: deleteOk. */
|
26
27
|
export declare type IKgButtonDeleteOkCb = (() => Promise<boolean>) & IKgEventCb;
|
28
|
+
/** 事件监听函数: otherOk. */
|
29
|
+
export declare type IKgButtonOtherOkCbParam = {
|
30
|
+
button?: VarButton | null;
|
31
|
+
/** 接口返回的数据. */
|
32
|
+
data: any;
|
33
|
+
};
|
34
|
+
export declare type IKgButtonOtherOkCb = ((args: IKgButtonOtherOkCbParam) => Promise<boolean>) & IKgEventCb;
|
27
35
|
/** 事件监听函数: submitSave. */
|
28
36
|
export declare type IKgButtonSubmitSaveCb = (() => Promise<boolean>) & IKgEventCb;
|
29
37
|
/** 事件监听函数: submitCancel. */
|
30
38
|
export declare type IKgButtonSubmitCancelCb = (() => Promise<boolean>) & IKgEventCb;
|
31
|
-
export declare type
|
39
|
+
export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonUpdateBeforeClickCbParam | IKgButtonOtherOkCbParam | any;
|
40
|
+
export declare type IKgButtonCb = IKgButtonClickCb | IKgButtonUpdateBeforeClickCb | IKgButtonDeleteOkCb | IKgButtonOtherOkCb | IKgButtonSubmitSaveCb | IKgButtonSubmitCancelCb;
|
32
41
|
export interface IKgButtonState {
|
33
42
|
clickListenersMap: Map<string, Array<IKgButtonClickCb>>;
|
34
43
|
updateBeforeClickListenersMap: Map<string, Array<IKgButtonUpdateBeforeClickCb>>;
|
35
44
|
deleteOkListenersMap: Map<string, Array<IKgButtonDeleteOkCb>>;
|
45
|
+
otherOkListenersMap: Map<string, Array<IKgButtonOtherOkCb>>;
|
36
46
|
submitSaveListenersMap: Map<string, Array<IKgButtonSubmitSaveCb>>;
|
37
47
|
submitCancelListenersMap: Map<string, Array<IKgButtonSubmitCancelCb>>;
|
38
48
|
}
|
@@ -57,9 +67,9 @@ export declare type IKgButtonStoreDefinition = StoreDefinition<'KgButton', IKgBu
|
|
57
67
|
* 触发事件.
|
58
68
|
* @param formID 界面标识.
|
59
69
|
* @param event 事件名称.
|
60
|
-
* @param
|
70
|
+
* @param param 数据.
|
61
71
|
*/
|
62
|
-
emit(formID: string, event: IKgButtonEvent,
|
72
|
+
emit(formID: string, event: IKgButtonEvent, param: IKgButtonCbParam): Promise<boolean>;
|
63
73
|
/**
|
64
74
|
* 点击某个按钮, 即通过代码的方式, 手动触发某个按钮的点击事件.
|
65
75
|
* @param formID 界面标识.
|
@@ -47,12 +47,14 @@ export declare const enum KG_FORM_ITEM_TYPE {
|
|
47
47
|
SELECT_MULTIPLE = "SELECT_MULTIPLE",
|
48
48
|
/** 年月日, 2020-05-01. */
|
49
49
|
DATE_DATE = "DATE_DATE",
|
50
|
+
/** 年月日的范围, [DATE_DATE, DATE_DATE] */
|
51
|
+
DATE_DATE_RANGE = "DATE_DATE_RANGE",
|
50
52
|
/** 时分秒, 11:59:59. */
|
51
53
|
DATE_TIME = "DATE_TIME",
|
54
|
+
/** 时分秒的范围, [DATE_TIME, DATE_TIME]. */
|
55
|
+
DATE_TIME_RANGE = "DATE_TIME_RANGE",
|
52
56
|
/** 年月日时分秒, 2020-05-01 11:59:59. */
|
53
57
|
DATE_DATETIME = "DATE_DATETIME",
|
54
|
-
/** 年月日的范围, [DATE_DATE, DATE_DATE] */
|
55
|
-
DATE_DATE_RANGE = "DATE_DATE_RANGE",
|
56
58
|
/** 年月日时分秒的范围, [DATE_DATETIME, DATE_DATETIME] */
|
57
59
|
DATE_DATETIME_RANGE = "DATE_DATETIME_RANGE",
|
58
60
|
DATE_WEEK = "DATE_WEEK",
|