@kengic/vue 0.26.6-beta.135 → 0.26.6-beta.138
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/kengic-vue.js +17412 -17414
- package/dist/src/component/KgAppSelect/index.event.d.ts +17 -0
- package/dist/src/component/KgAppSelect/index.hooks.d.ts +2 -1
- package/dist/src/component/KgAppSelect/index.store.d.ts +1 -17
- package/dist/src/component/KgButton/index.event.d.ts +27 -0
- package/dist/src/component/KgButton/index.hooks.d.ts +7 -6
- package/dist/src/component/KgButton/index.store.d.ts +5 -30
- package/dist/src/component/KgForm/index.event.d.ts +191 -0
- package/dist/src/component/KgForm/index.hooks.d.ts +9 -8
- package/dist/src/component/KgForm/index.store.d.ts +9 -199
- package/dist/src/component/KgForm.Item/components/KgForm.Item.Checkbox.d.ts +3 -1
- package/dist/src/component/KgForm.Item/components/KgForm.Item.CheckboxGroup.d.ts +3 -1
- package/dist/src/component/KgForm.Item/components/KgForm.Item.Date.d.ts +1 -1
- package/dist/src/component/KgForm.Item/components/KgForm.Item.DateRange.d.ts +1 -1
- package/dist/src/component/KgForm.Item/components/KgForm.Item.Input.d.ts +1 -1
- package/dist/src/component/KgForm.Item/components/KgForm.Item.InputNumber.d.ts +1 -1
- package/dist/src/component/KgForm.Item/components/KgForm.Item.InputPassword.d.ts +1 -1
- package/dist/src/component/KgForm.Item/components/KgForm.Item.RadioGroup.d.ts +7 -5
- package/dist/src/component/KgForm.Item/components/KgForm.Item.Select.d.ts +1 -3
- package/dist/src/component/KgForm.Item/components/KgForm.Item.Switch.d.ts +1 -1
- package/dist/src/component/KgForm.Item/components/KgForm.Item.TextArea.d.ts +1 -1
- package/dist/src/component/KgSearch/index.event.d.ts +17 -0
- package/dist/src/component/KgSearch/index.hooks.d.ts +5 -4
- package/dist/src/component/KgSearch/index.store.d.ts +12 -27
- package/dist/src/component/KgSubmit/index.event.d.ts +105 -0
- package/dist/src/component/KgSubmit/index.hooks.d.ts +9 -8
- package/dist/src/component/KgSubmit/index.store.d.ts +11 -114
- package/dist/src/component/KgTable/KgTable.service.d.ts +2 -2
- package/dist/src/component/KgTable/index.event.d.ts +57 -0
- package/dist/src/component/KgTable/index.hooks.d.ts +13 -12
- package/dist/src/component/KgTable/index.store.d.ts +8 -61
- package/dist/src/component/KgVar/index.vm.d.ts +8 -2
- package/dist/src/component/KgWarehouse/index.hooks.d.ts +2 -2
- package/dist/src/component/KgWarehouse/index.store.d.ts +5 -5
- package/dist/src/util/kg.util.d.ts +4 -4
- package/package.json +1 -1
@@ -0,0 +1,17 @@
|
|
1
|
+
import { IKgEventListener } from '@kengic/core.core';
|
2
|
+
/**
|
3
|
+
* 事件类型.
|
4
|
+
* 'onGotoApp': 进入某个模块
|
5
|
+
* 'onGotoPath': 进入某个地址
|
6
|
+
*/
|
7
|
+
export declare type IKgAppSelectEvent = 'onGotoApp' | 'onGotoPath';
|
8
|
+
export declare type IKgAppSelectOnGotoAppEventListenerParameter = {
|
9
|
+
app: string;
|
10
|
+
};
|
11
|
+
export declare type IKgAppSelectOnGotoAppEventListener = ((param: IKgAppSelectOnGotoAppEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
12
|
+
export declare type IKgAppSelectOnGotoPathEventListenerParameter = {
|
13
|
+
path: string;
|
14
|
+
};
|
15
|
+
export declare type IKgAppSelectOnGotoPathEventListener = ((param: IKgAppSelectOnGotoPathEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
16
|
+
export declare type IKgAppSelectEventListenerParameter = IKgAppSelectOnGotoAppEventListenerParameter | IKgAppSelectOnGotoPathEventListenerParameter;
|
17
|
+
export declare type IKgAppSelectEventListener = IKgAppSelectOnGotoAppEventListener | IKgAppSelectOnGotoPathEventListener;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { IRemoveEventListener } from '@kengic/core.core';
|
2
2
|
import { KG_APP, Menu } from '../../const';
|
3
|
-
import { IKgAppSelectOnGotoAppEventListener, IKgAppSelectOnGotoPathEventListener
|
3
|
+
import { IKgAppSelectOnGotoAppEventListener, IKgAppSelectOnGotoPathEventListener } from './index.event';
|
4
|
+
import { IKgAppSelectStore } from './index.store';
|
4
5
|
export declare type IUseKgAppSelect = {
|
5
6
|
/**
|
6
7
|
* 进入某个模块.
|
@@ -1,22 +1,6 @@
|
|
1
|
-
import { IKgEventListener } from '@kengic/core.core';
|
2
1
|
import { StoreDefinition } from 'pinia';
|
3
2
|
import { KG_APP, Menu } from '../../const';
|
4
|
-
|
5
|
-
* 事件类型.
|
6
|
-
* 'onGotoApp': 进入某个模块
|
7
|
-
* 'onGotoPath': 进入某个地址
|
8
|
-
*/
|
9
|
-
export declare type IKgAppSelectEvent = 'onGotoApp' | 'onGotoPath';
|
10
|
-
export declare type IKgAppSelectOnGotoAppEventListenerParameter = {
|
11
|
-
app: string;
|
12
|
-
};
|
13
|
-
export declare type IKgAppSelectOnGotoAppEventListener = ((param: IKgAppSelectOnGotoAppEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
14
|
-
export declare type IKgAppSelectOnGotoPathEventListenerParameter = {
|
15
|
-
path: string;
|
16
|
-
};
|
17
|
-
export declare type IKgAppSelectOnGotoPathEventListener = ((param: IKgAppSelectOnGotoPathEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
18
|
-
export declare type IKgAppSelectEventListenerParameter = IKgAppSelectOnGotoAppEventListenerParameter | IKgAppSelectOnGotoPathEventListenerParameter;
|
19
|
-
export declare type IKgAppSelectEventListener = IKgAppSelectOnGotoAppEventListener | IKgAppSelectOnGotoPathEventListener;
|
3
|
+
import { IKgAppSelectEvent, IKgAppSelectEventListenerParameter, IKgAppSelectOnGotoAppEventListener, IKgAppSelectOnGotoPathEventListener } from './index.event';
|
20
4
|
export interface IUseKgAppSelectStoreState {
|
21
5
|
/**
|
22
6
|
* 当前模块.
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { IKgEventListener } from '@kengic/core.core';
|
2
|
+
import { VarButton } from '../../api/WMS/models';
|
3
|
+
/**
|
4
|
+
* 事件类型.
|
5
|
+
* 'onClick': 点击按钮
|
6
|
+
* 'onImportOk': 导入成功, 导入接口调用成功
|
7
|
+
* 'onSubmitSave': 表格内编辑时, 点击保存按钮
|
8
|
+
* 'onSubmitCancel': 表格内编辑时, 点击取消按钮
|
9
|
+
*/
|
10
|
+
export declare type IKgButtonEvent = 'onClick' | 'onImportOk' | 'onSubmitSave' | 'onSubmitCancel';
|
11
|
+
export declare type IKgButtonOnClickEventListenerParameter = {
|
12
|
+
/**
|
13
|
+
* 被点击的按钮.
|
14
|
+
*/
|
15
|
+
button: VarButton;
|
16
|
+
};
|
17
|
+
export declare type IKgButtonOnClickEventListener = ((param: IKgButtonOnClickEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
18
|
+
export declare type IKgButtonOnImportOkEventListenerParameter = {
|
19
|
+
button?: VarButton | null;
|
20
|
+
};
|
21
|
+
export declare type IKgButtonOnImportOkEventListener = ((param: IKgButtonOnImportOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
22
|
+
export declare type IKgButtonOnSubmitSaveEventListenerParameter = {};
|
23
|
+
export declare type IKgButtonOnSubmitSaveEventListener = ((param: IKgButtonOnSubmitSaveEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
24
|
+
export declare type IKgButtonOnSubmitCancelEventListenerParameter = {};
|
25
|
+
export declare type IKgButtonOnSubmitCancelEventListener = ((param: IKgButtonOnSubmitCancelEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
26
|
+
export declare type IKgButtonEventListenerParameter = IKgButtonOnClickEventListenerParameter | IKgButtonOnImportOkEventListenerParameter | IKgButtonOnSubmitSaveEventListenerParameter | IKgButtonOnSubmitCancelEventListenerParameter;
|
27
|
+
export declare type IKgButtonEventListener = IKgButtonOnClickEventListener | IKgButtonOnImportOkEventListener | IKgButtonOnSubmitSaveEventListener | IKgButtonOnSubmitCancelEventListener;
|
@@ -1,7 +1,8 @@
|
|
1
|
+
import { IRemoveEventListener } from '@kengic/core.core';
|
1
2
|
import { ComputedRef } from 'vue';
|
2
3
|
import { KG__VAR_BUTTON__TYPE } from '../../const';
|
3
|
-
import {
|
4
|
-
import {
|
4
|
+
import { IKgButtonOnClickEventListener, IKgButtonOnImportOkEventListener, IKgButtonOnSubmitCancelEventListener, IKgButtonOnSubmitSaveEventListener } from './index.event';
|
5
|
+
import { IKgButtonStore } from './index.store';
|
5
6
|
export interface IUseKgButton {
|
6
7
|
/**
|
7
8
|
* <p>手动点击某个按钮.</p>
|
@@ -86,28 +87,28 @@ export interface IUseKgButton {
|
|
86
87
|
* @param listener 事件监听函数.
|
87
88
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
88
89
|
*/
|
89
|
-
onClick(listener:
|
90
|
+
onClick(listener: IKgButtonOnClickEventListener, isOnce?: boolean): IRemoveEventListener;
|
90
91
|
/**
|
91
92
|
* 监听事件: 导入成功, 导入接口调用成功.
|
92
93
|
*
|
93
94
|
* @param listener 事件监听函数.
|
94
95
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
95
96
|
*/
|
96
|
-
onImportOk(listener:
|
97
|
+
onImportOk(listener: IKgButtonOnImportOkEventListener, isOnce?: boolean): IRemoveEventListener;
|
97
98
|
/**
|
98
99
|
* 监听事件: 表格内编辑时, 点击取消按钮.
|
99
100
|
*
|
100
101
|
* @param listener 事件监听函数.
|
101
102
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
102
103
|
*/
|
103
|
-
onSubmitCancel(listener:
|
104
|
+
onSubmitCancel(listener: IKgButtonOnSubmitCancelEventListener, isOnce?: boolean): IRemoveEventListener;
|
104
105
|
/**
|
105
106
|
* 监听事件: 表格内编辑时, 点击保存按钮.
|
106
107
|
*
|
107
108
|
* @param listener 事件监听函数.
|
108
109
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
109
110
|
*/
|
110
|
-
onSubmitSave(listener:
|
111
|
+
onSubmitSave(listener: IKgButtonOnSubmitSaveEventListener, isOnce?: boolean): IRemoveEventListener;
|
111
112
|
/**
|
112
113
|
* <p>「查询按钮」.</p>
|
113
114
|
*/
|
@@ -1,40 +1,13 @@
|
|
1
|
-
import { IKgEventListener } from '@kengic/core.core';
|
2
1
|
import { StoreDefinition } from 'pinia';
|
3
2
|
import { VarButton, VarButtonConfig } from '../../api/WMS/models';
|
4
3
|
import { KG__VAR_BUTTON__TYPE } from '../../const';
|
5
|
-
|
6
|
-
* 事件类型.
|
7
|
-
* 'click': 点击按钮
|
8
|
-
* 'importOk': 导入成功, 导入接口调用成功
|
9
|
-
* 'submitSave': 表格内编辑时, 点击保存按钮
|
10
|
-
* 'submitCancel': 表格内编辑时, 点击取消按钮
|
11
|
-
*/
|
12
|
-
export declare type IKgButtonEvent = 'click' | 'importOk' | 'submitSave' | 'submitCancel';
|
13
|
-
export declare type IKgButtonClickEventListenerParameter = {
|
14
|
-
/**
|
15
|
-
* 被点击的按钮.
|
16
|
-
*/
|
17
|
-
button: VarButton;
|
18
|
-
};
|
19
|
-
export declare type IKgButtonClickEventListener = ((param: IKgButtonClickEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
20
|
-
export declare type IKgButtonImportOkEventListenerParameter = {
|
21
|
-
button?: VarButton | null;
|
22
|
-
};
|
23
|
-
export declare type IKgButtonImportOkEventListener = ((param: IKgButtonImportOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
24
|
-
export declare type IKgButtonSubmitSaveEventListenerParameter = {};
|
25
|
-
export declare type IKgButtonSubmitSaveEventListener = ((param: IKgButtonSubmitSaveEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
26
|
-
export declare type IKgButtonSubmitCancelEventListenerParameter = {};
|
27
|
-
export declare type IKgButtonSubmitCancelEventListener = ((param: IKgButtonSubmitCancelEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
28
|
-
export declare type IKgButtonEventListenerParameter = IKgButtonClickEventListenerParameter | IKgButtonImportOkEventListenerParameter | IKgButtonSubmitSaveEventListenerParameter | IKgButtonSubmitCancelEventListenerParameter;
|
29
|
-
export declare type IKgButtonEventListener = IKgButtonClickEventListener | IKgButtonImportOkEventListener | IKgButtonSubmitSaveEventListener | IKgButtonSubmitCancelEventListener;
|
4
|
+
import { IKgButtonEvent, IKgButtonEventListenerParameter, IKgButtonOnClickEventListener, IKgButtonOnImportOkEventListener, IKgButtonOnSubmitCancelEventListener, IKgButtonOnSubmitSaveEventListener } from './index.event';
|
30
5
|
export interface IUseKgButtonStoreState {
|
31
|
-
clickEventListenerMap: Map<string, Array<IKgButtonClickEventListener>>;
|
32
6
|
/**
|
33
7
|
* <p>当前按钮.</p>
|
34
8
|
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
35
9
|
*/
|
36
10
|
currentButtonMap: Map<string, VarButton | null>;
|
37
|
-
importOkEventListenerMap: Map<string, Array<IKgButtonImportOkEventListener>>;
|
38
11
|
/**
|
39
12
|
* <p>按钮的 click 事件是否被拦截.</p>
|
40
13
|
* <p>用户调用 kgVar.kgButton.onClick(listener) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
@@ -46,8 +19,10 @@ export interface IUseKgButtonStoreState {
|
|
46
19
|
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
47
20
|
*/
|
48
21
|
isCurrentButtonRequestingMap: Map<string, boolean>;
|
49
|
-
|
50
|
-
|
22
|
+
onClick: Map<string, Array<IKgButtonOnClickEventListener>>;
|
23
|
+
onImport: Map<string, Array<IKgButtonOnImportOkEventListener>>;
|
24
|
+
onSubmitCancel: Map<string, Array<IKgButtonOnSubmitCancelEventListener>>;
|
25
|
+
onSubmitSave: Map<string, Array<IKgButtonOnSubmitSaveEventListener>>;
|
51
26
|
}
|
52
27
|
export interface IUseKgButtonStoreGetters {
|
53
28
|
getButtonDescription(): (formID: string | null | undefined, param: {
|
@@ -0,0 +1,191 @@
|
|
1
|
+
import { IKgEventListener } from '@kengic/core.core';
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
3
|
+
import { KG_FORM_CONTEXT } from '../../const';
|
4
|
+
import { IKgTableRow } from '../KgTable';
|
5
|
+
/**
|
6
|
+
* 事件类型.
|
7
|
+
* 'onChange': 表单控件的值发生变更
|
8
|
+
* 'onBlur': 失去焦点
|
9
|
+
* 'onSelectBeforeRequest': 即将发起查询请求, 如果返回 true 表示不会发起请求,
|
10
|
+
* 'onSelectBeforeSetDatas': 下拉列表查询请求成功, 列表数据尚未赋值. 此处可以对查询接口返回的列表数据作处理
|
11
|
+
* 'onSelectChange': 下拉列表选中某个(可能多个)数据
|
12
|
+
* 'onLookupBeforeOpen': 查找弹窗打开之前
|
13
|
+
* 'onLookupBeforeOk': 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件
|
14
|
+
* 'onLookupOk': 查找弹窗点击确定
|
15
|
+
*/
|
16
|
+
export declare type IKgFormEvent = 'onChange' | 'onBlur' | 'onSelectBeforeRequest' | 'onSelectBeforeSetDatas' | 'onSelectChange' | 'onLookupBeforeOpen' | 'onLookupBeforeOk' | 'onLookupOk';
|
17
|
+
export declare type IKgFormOnChangeEventListenerParameter = {
|
18
|
+
/**
|
19
|
+
* 表单控件所处环境.
|
20
|
+
*/
|
21
|
+
context: KG_FORM_CONTEXT;
|
22
|
+
/** @deprecated */
|
23
|
+
isCopying: boolean | null;
|
24
|
+
/** @deprecated */
|
25
|
+
isCreating: boolean | null;
|
26
|
+
/** @deprecated */
|
27
|
+
isDeleting: boolean | null;
|
28
|
+
/** @deprecated */
|
29
|
+
isUpdating: boolean | null;
|
30
|
+
/**
|
31
|
+
* 表单控件当前数据.
|
32
|
+
*/
|
33
|
+
value: any;
|
34
|
+
/**
|
35
|
+
* 变量名称.
|
36
|
+
*/
|
37
|
+
varName: string;
|
38
|
+
/** @deprecated */
|
39
|
+
variableName: string;
|
40
|
+
};
|
41
|
+
export declare type IKgFormOnChangeEventListener = ((param: IKgFormOnChangeEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
42
|
+
export declare type IKgFormOnBlurEventListenerParameter = {
|
43
|
+
/**
|
44
|
+
* 表单控件所处环境.
|
45
|
+
*/
|
46
|
+
context: KG_FORM_CONTEXT;
|
47
|
+
/** @deprecated */
|
48
|
+
value: any;
|
49
|
+
/**
|
50
|
+
* 表单控件当前数据.
|
51
|
+
*/
|
52
|
+
values: Array<any>;
|
53
|
+
/**
|
54
|
+
* 变量名称.
|
55
|
+
*/
|
56
|
+
varName: string;
|
57
|
+
};
|
58
|
+
export declare type IKgFormOnBlurEventListener = ((param: IKgFormOnBlurEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
59
|
+
export declare type IKgFormOnSelectBeforeRequestEventListenerParameter = {
|
60
|
+
/**
|
61
|
+
* 表单控件所处环境.
|
62
|
+
*/
|
63
|
+
context: KG_FORM_CONTEXT;
|
64
|
+
/** 查询接口请求参数. */
|
65
|
+
params: Record<string, any>;
|
66
|
+
/** 查询接口返回的数据, 调用者可以直接修改该数据, 从而实现手动提供列表数据. */
|
67
|
+
response: Ref;
|
68
|
+
/**
|
69
|
+
* 变量名称.
|
70
|
+
*/
|
71
|
+
varName: string;
|
72
|
+
};
|
73
|
+
export declare type IKgFormOnSelectBeforeRequestEventListener = ((param: IKgFormOnSelectBeforeRequestEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
74
|
+
export declare type IKgFormOnSelectBeforeSetDatasEventListenerParameter<T = any> = {
|
75
|
+
/**
|
76
|
+
* 表单控件所处环境.
|
77
|
+
*/
|
78
|
+
context: KG_FORM_CONTEXT;
|
79
|
+
/** 列表数据. */
|
80
|
+
datas: Ref<Array<T>>;
|
81
|
+
/** @deprecated */
|
82
|
+
isCopying: boolean | null;
|
83
|
+
/** @deprecated */
|
84
|
+
isCreating: boolean | null;
|
85
|
+
/** @deprecated */
|
86
|
+
isDeleting: boolean | null;
|
87
|
+
/** @deprecated */
|
88
|
+
isUpdating: boolean | null;
|
89
|
+
/** 变量名称. */
|
90
|
+
varName: string;
|
91
|
+
};
|
92
|
+
export declare type IKgFormOnSelectBeforeSetDatasEventListener = ((param: IKgFormOnSelectBeforeSetDatasEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
93
|
+
export declare type IKgFormOnSelectChangeEventListenerParameter = {
|
94
|
+
/**
|
95
|
+
* 表单控件所处环境.
|
96
|
+
*/
|
97
|
+
context: KG_FORM_CONTEXT;
|
98
|
+
/** @deprecated */
|
99
|
+
isCopying: boolean | null;
|
100
|
+
/** @deprecated */
|
101
|
+
isCreating: boolean | null;
|
102
|
+
/** @deprecated */
|
103
|
+
isDeleting: boolean | null;
|
104
|
+
/** 是否多选, 否则单选. */
|
105
|
+
isMultiple: boolean;
|
106
|
+
/** @deprecated */
|
107
|
+
isUpdating: boolean | null;
|
108
|
+
/** @deprecated */
|
109
|
+
model: Ref<Record<string, any> | null> | null;
|
110
|
+
/**
|
111
|
+
* 表单数据对象.
|
112
|
+
* @deprecated
|
113
|
+
*/
|
114
|
+
formModel: Ref<Record<string, any> | null> | null;
|
115
|
+
/** 选中的数据对象组成的数组, 如果是单选则数组中只有一个数据对象. */
|
116
|
+
rows: Array<any> | null;
|
117
|
+
/** 选中的数据组成的数组, 如果是单选则数组中只有一个数据. */
|
118
|
+
values: Array<any>;
|
119
|
+
/** 变量. */
|
120
|
+
var_nam: string;
|
121
|
+
};
|
122
|
+
export declare type IKgFormOnSelectChangeEventListener = ((param: IKgFormOnSelectChangeEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
123
|
+
export declare type IKgFormOnLookupBeforeOpenEventListenerParameter = {
|
124
|
+
/**
|
125
|
+
* 表单控件所处环境.
|
126
|
+
*/
|
127
|
+
context: KG_FORM_CONTEXT;
|
128
|
+
/** 查找弹出的界面标识. */
|
129
|
+
lookupFormID: string;
|
130
|
+
/** 变量. */
|
131
|
+
var_nam: string;
|
132
|
+
};
|
133
|
+
export declare type IKgFormOnLookupBeforeOpenEventListener = ((param: IKgFormOnLookupBeforeOpenEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
134
|
+
export declare type IKgFormOnLookupBeforeOkEventListenerParameter = {
|
135
|
+
/**
|
136
|
+
* 表单控件所处环境.
|
137
|
+
*/
|
138
|
+
context: KG_FORM_CONTEXT;
|
139
|
+
/** 是否多选, 否则单选. */
|
140
|
+
isMultiple: boolean;
|
141
|
+
/**
|
142
|
+
* 单选时, 勾选的那一行.
|
143
|
+
* @deprecated 请直接使用属性 rows.
|
144
|
+
*/
|
145
|
+
row?: IKgTableRow | null;
|
146
|
+
/** 勾选的所有行. */
|
147
|
+
rows?: Array<IKgTableRow> | null;
|
148
|
+
/**
|
149
|
+
* 单选时, 对应的一个值.
|
150
|
+
* @deprecated 请直接使用属性 values.
|
151
|
+
*/
|
152
|
+
value?: any | null;
|
153
|
+
/** 勾选的所有值. */
|
154
|
+
values?: Array<any> | null;
|
155
|
+
/** 变量. */
|
156
|
+
varNam: string;
|
157
|
+
/** @deprecated. */
|
158
|
+
var_nam: string;
|
159
|
+
};
|
160
|
+
export declare type IKgFormOnLookupBeforeOkEventListener = ((param: IKgFormOnLookupBeforeOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
161
|
+
export declare type IKgFormOnLookupOkEventListenerParameter = {
|
162
|
+
/**
|
163
|
+
* 表单控件所处环境.
|
164
|
+
*/
|
165
|
+
context: KG_FORM_CONTEXT;
|
166
|
+
/** 是否多选, 否则单选. */
|
167
|
+
isMultiple: boolean;
|
168
|
+
/** 表单数据对象. */
|
169
|
+
model: ComputedRef<Record<string, any>>;
|
170
|
+
/**
|
171
|
+
* 单选时, 勾选的那一行.
|
172
|
+
* @deprecated 请直接使用属性 rows.
|
173
|
+
*/
|
174
|
+
row?: IKgTableRow | null;
|
175
|
+
/** 勾选的所有行. */
|
176
|
+
rows?: Array<IKgTableRow> | null;
|
177
|
+
/**
|
178
|
+
* 单选时, 对应的一个值.
|
179
|
+
* @deprecated 请直接使用属性 values.
|
180
|
+
*/
|
181
|
+
value?: any | null;
|
182
|
+
/** 勾选的所有值. */
|
183
|
+
values?: Array<any> | null;
|
184
|
+
/** 变量. */
|
185
|
+
varNam: string;
|
186
|
+
/** @deprecated. */
|
187
|
+
var_nam: string;
|
188
|
+
};
|
189
|
+
export declare type IKgFormOnLookupOkEventListener = ((param: IKgFormOnLookupOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
190
|
+
export declare type IKgFormEventListenerParameter = IKgFormOnChangeEventListenerParameter | IKgFormOnBlurEventListenerParameter | IKgFormOnSelectBeforeRequestEventListenerParameter | IKgFormOnSelectBeforeSetDatasEventListenerParameter | IKgFormOnSelectChangeEventListenerParameter | IKgFormOnLookupBeforeOpenEventListenerParameter | IKgFormOnLookupBeforeOkEventListenerParameter | IKgFormOnLookupOkEventListenerParameter;
|
191
|
+
export declare type IKgFormEventListener = IKgFormOnChangeEventListener | IKgFormOnBlurEventListener | IKgFormOnSelectBeforeRequestEventListener | IKgFormOnSelectBeforeSetDatasEventListener | IKgFormOnSelectChangeEventListener | IKgFormOnLookupBeforeOpenEventListener | IKgFormOnLookupBeforeOkEventListener | IKgFormOnLookupOkEventListener;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { IKgFormChangeEventListener, IKgFormLookupBeforeOkEventListener, IKgFormLookupBeforeOpenEventListener, IKgFormLookupOkEventListener, IKgFormOnBlurEventListener, IKgFormSelectBeforeRequestEventListener, IKgFormSelectBeforeSetDatasEventListener, IKgFormSelectChangeEventListener, IKgFormStore } from './index.store';
|
2
1
|
import { IRemoveEventListener } from '@kengic/core.core';
|
2
|
+
import { IKgFormOnBlurEventListener, IKgFormOnChangeEventListener, IKgFormOnLookupBeforeOkEventListener, IKgFormOnLookupBeforeOpenEventListener, IKgFormOnLookupOkEventListener, IKgFormOnSelectBeforeRequestEventListener, IKgFormOnSelectBeforeSetDatasEventListener, IKgFormOnSelectChangeEventListener } from './index.event';
|
3
|
+
import { IKgFormStore } from './index.store';
|
3
4
|
export declare type IUseKgForm = {
|
4
5
|
Select: {
|
5
6
|
/**
|
@@ -25,28 +26,28 @@ export declare type IUseKgForm = {
|
|
25
26
|
* @param listener 事件监听函数.
|
26
27
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
27
28
|
*/
|
28
|
-
onChange(listener:
|
29
|
+
onChange(listener: IKgFormOnChangeEventListener, isOnce?: boolean): IRemoveEventListener;
|
29
30
|
/**
|
30
31
|
* 监听事件: 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件.
|
31
32
|
*
|
32
33
|
* @param listener 事件监听函数.
|
33
34
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
34
35
|
*/
|
35
|
-
onLookupBeforeOk(listener:
|
36
|
+
onLookupBeforeOk(listener: IKgFormOnLookupBeforeOkEventListener, isOnce?: boolean): IRemoveEventListener;
|
36
37
|
/**
|
37
38
|
* 监听事件: 查找弹窗打开之前.
|
38
39
|
*
|
39
40
|
* @param listener 事件监听函数.
|
40
41
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
41
42
|
*/
|
42
|
-
onLookupBeforeOpen(listener:
|
43
|
+
onLookupBeforeOpen(listener: IKgFormOnLookupBeforeOpenEventListener, isOnce?: boolean): IRemoveEventListener;
|
43
44
|
/**
|
44
45
|
* 监听事件: 查找弹窗点击确定.
|
45
46
|
*
|
46
47
|
* @param listener 事件监听函数.
|
47
48
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
48
49
|
*/
|
49
|
-
onLookupOk(listener:
|
50
|
+
onLookupOk(listener: IKgFormOnLookupOkEventListener, isOnce?: boolean): IRemoveEventListener;
|
50
51
|
/**
|
51
52
|
* <p>监听事件: 即将发起查询请求, 如果返回 true 表示不会发起请求.</p>
|
52
53
|
* <p>通常在该事件中, 通过给 <code>response.value</code> 赋值, 来实现自定义下拉列表数据. 注意此时必须返回 true 来跳过后续的列表数据查询.</p>
|
@@ -54,21 +55,21 @@ export declare type IUseKgForm = {
|
|
54
55
|
* @param callback 事件监听函数.
|
55
56
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
56
57
|
*/
|
57
|
-
onSelectBeforeRequest(callback:
|
58
|
+
onSelectBeforeRequest(callback: IKgFormOnSelectBeforeRequestEventListener, isOnce?: boolean): IRemoveEventListener;
|
58
59
|
/**
|
59
60
|
* 监听事件: 查询请求成功, 列表数据尚未赋值. 此处可以对查询接口返回的列表数据作处理.
|
60
61
|
*
|
61
62
|
* @param callback 事件监听函数.
|
62
63
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
63
64
|
*/
|
64
|
-
onSelectBeforeSetDatas(callback:
|
65
|
+
onSelectBeforeSetDatas(callback: IKgFormOnSelectBeforeSetDatasEventListener, isOnce?: boolean): IRemoveEventListener;
|
65
66
|
/**
|
66
67
|
* 监听事件: 下拉列表选中某个(可能多个)数据.
|
67
68
|
*
|
68
69
|
* @param listener 事件监听函数.
|
69
70
|
* @param isOnce 是否只会触发一次. 默认为 undefined.
|
70
71
|
*/
|
71
|
-
onSelectChange(listener:
|
72
|
+
onSelectChange(listener: IKgFormOnSelectChangeEventListener, isOnce?: boolean): IRemoveEventListener;
|
72
73
|
/**
|
73
74
|
* 状态数据.
|
74
75
|
*/
|
@@ -1,204 +1,14 @@
|
|
1
|
-
import { IKgEventListener } from '@kengic/core.core';
|
2
1
|
import { StoreDefinition } from 'pinia';
|
3
|
-
import {
|
4
|
-
import { KG_FORM_CONTEXT } from '../../const';
|
5
|
-
import { IKgTableRow } from '../KgTable';
|
6
|
-
/**
|
7
|
-
* 事件类型.
|
8
|
-
* 'change': 表单控件的值发生变更
|
9
|
-
* 'onBlur': 失去焦点
|
10
|
-
* 'onSelectBeforeRequest': 即将发起查询请求, 如果返回 true 表示不会发起请求,
|
11
|
-
* 'selectBeforeSetDatas': 下拉列表查询请求成功, 列表数据尚未赋值. 此处可以对查询接口返回的列表数据作处理
|
12
|
-
* 'selectChange': 下拉列表选中某个(可能多个)数据
|
13
|
-
* 'lookupBeforeOpen': 查找弹窗打开之前
|
14
|
-
* 'lookupBeforeOk': 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件
|
15
|
-
* 'lookupOk': 查找弹窗点击确定
|
16
|
-
*/
|
17
|
-
export declare type IKgFormEvent = 'change' | 'onBlur' | 'onSelectBeforeRequest' | 'selectBeforeSetDatas' | 'selectChange' | 'lookupBeforeOpen' | 'lookupBeforeOk' | 'lookupOk';
|
18
|
-
export declare type IKgFormChangeEventListenerParameter = {
|
19
|
-
/**
|
20
|
-
* 表单控件所处环境.
|
21
|
-
*/
|
22
|
-
context: KG_FORM_CONTEXT;
|
23
|
-
/** @deprecated */
|
24
|
-
isCopying: boolean | null;
|
25
|
-
/** @deprecated */
|
26
|
-
isCreating: boolean | null;
|
27
|
-
/** @deprecated */
|
28
|
-
isDeleting: boolean | null;
|
29
|
-
/** @deprecated */
|
30
|
-
isUpdating: boolean | null;
|
31
|
-
/**
|
32
|
-
* 表单控件当前数据.
|
33
|
-
*/
|
34
|
-
value: any;
|
35
|
-
/**
|
36
|
-
* 变量名称.
|
37
|
-
*/
|
38
|
-
varName: string;
|
39
|
-
/** @deprecated */
|
40
|
-
variableName: string;
|
41
|
-
};
|
42
|
-
export declare type IKgFormChangeEventListener = ((param: IKgFormChangeEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
43
|
-
export declare type IKgFormOnBlurEventListenerParameter = {
|
44
|
-
/**
|
45
|
-
* 表单控件所处环境.
|
46
|
-
*/
|
47
|
-
context: KG_FORM_CONTEXT;
|
48
|
-
/** @deprecated */
|
49
|
-
value: any;
|
50
|
-
/**
|
51
|
-
* 表单控件当前数据.
|
52
|
-
*/
|
53
|
-
values: Array<any>;
|
54
|
-
/**
|
55
|
-
* 变量名称.
|
56
|
-
*/
|
57
|
-
varName: string;
|
58
|
-
};
|
59
|
-
export declare type IKgFormOnBlurEventListener = ((param: IKgFormOnBlurEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
60
|
-
export declare type IKgFormSelectBeforeRequestEventListenerParameter = {
|
61
|
-
/**
|
62
|
-
* 表单控件所处环境.
|
63
|
-
*/
|
64
|
-
context: KG_FORM_CONTEXT;
|
65
|
-
/** 查询接口请求参数. */
|
66
|
-
params: Record<string, any>;
|
67
|
-
/** 查询接口返回的数据, 调用者可以直接修改该数据, 从而实现手动提供列表数据. */
|
68
|
-
response: Ref;
|
69
|
-
/**
|
70
|
-
* 变量名称.
|
71
|
-
*/
|
72
|
-
varName: string;
|
73
|
-
};
|
74
|
-
export declare type IKgFormSelectBeforeRequestEventListener = ((param: IKgFormSelectBeforeRequestEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
75
|
-
export declare type IKgFormSelectBeforeSetDatasEventListenerParameter<T = any> = {
|
76
|
-
/**
|
77
|
-
* 表单控件所处环境.
|
78
|
-
*/
|
79
|
-
context: KG_FORM_CONTEXT;
|
80
|
-
/** 列表数据. */
|
81
|
-
datas: Ref<Array<T>>;
|
82
|
-
/** @deprecated */
|
83
|
-
isCopying: boolean | null;
|
84
|
-
/** @deprecated */
|
85
|
-
isCreating: boolean | null;
|
86
|
-
/** @deprecated */
|
87
|
-
isDeleting: boolean | null;
|
88
|
-
/** @deprecated */
|
89
|
-
isUpdating: boolean | null;
|
90
|
-
/** 变量名称. */
|
91
|
-
varName: string;
|
92
|
-
};
|
93
|
-
export declare type IKgFormSelectBeforeSetDatasEventListener = ((param: IKgFormSelectBeforeSetDatasEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
94
|
-
export declare type IKgFormSelectChangeEventListenerParameter = {
|
95
|
-
/**
|
96
|
-
* 表单控件所处环境.
|
97
|
-
*/
|
98
|
-
context: KG_FORM_CONTEXT;
|
99
|
-
/** @deprecated */
|
100
|
-
isCopying: boolean | null;
|
101
|
-
/** @deprecated */
|
102
|
-
isCreating: boolean | null;
|
103
|
-
/** @deprecated */
|
104
|
-
isDeleting: boolean | null;
|
105
|
-
/** 是否多选, 否则单选. */
|
106
|
-
isMultiple: boolean;
|
107
|
-
/** @deprecated */
|
108
|
-
isUpdating: boolean | null;
|
109
|
-
/** @deprecated */
|
110
|
-
model: Ref<Record<string, any> | null> | null;
|
111
|
-
/**
|
112
|
-
* 表单数据对象.
|
113
|
-
* @deprecated
|
114
|
-
*/
|
115
|
-
formModel: Ref<Record<string, any> | null> | null;
|
116
|
-
/** 选中的数据对象组成的数组, 如果是单选则数组中只有一个数据对象. */
|
117
|
-
rows: Array<any> | null;
|
118
|
-
/** 选中的数据组成的数组, 如果是单选则数组中只有一个数据. */
|
119
|
-
values: Array<any>;
|
120
|
-
/** 变量. */
|
121
|
-
var_nam: string;
|
122
|
-
};
|
123
|
-
export declare type IKgFormSelectChangeEventListener = ((param: IKgFormSelectChangeEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
124
|
-
export declare type IKgFormLookupBeforeOpenEventListenerParameter = {
|
125
|
-
/**
|
126
|
-
* 表单控件所处环境.
|
127
|
-
*/
|
128
|
-
context: KG_FORM_CONTEXT;
|
129
|
-
/** 查找弹出的界面标识. */
|
130
|
-
lookupFormID: string;
|
131
|
-
/** 变量. */
|
132
|
-
var_nam: string;
|
133
|
-
};
|
134
|
-
export declare type IKgFormLookupBeforeOpenEventListener = ((param: IKgFormLookupBeforeOpenEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
135
|
-
export declare type IKgFormLookupBeforeOkEventListenerParameter = {
|
136
|
-
/**
|
137
|
-
* 表单控件所处环境.
|
138
|
-
*/
|
139
|
-
context: KG_FORM_CONTEXT;
|
140
|
-
/** 是否多选, 否则单选. */
|
141
|
-
isMultiple: boolean;
|
142
|
-
/**
|
143
|
-
* 单选时, 勾选的那一行.
|
144
|
-
* @deprecated 请直接使用属性 rows.
|
145
|
-
*/
|
146
|
-
row?: IKgTableRow | null;
|
147
|
-
/** 勾选的所有行. */
|
148
|
-
rows?: Array<IKgTableRow> | null;
|
149
|
-
/**
|
150
|
-
* 单选时, 对应的一个值.
|
151
|
-
* @deprecated 请直接使用属性 values.
|
152
|
-
*/
|
153
|
-
value?: any | null;
|
154
|
-
/** 勾选的所有值. */
|
155
|
-
values?: Array<any> | null;
|
156
|
-
/** 变量. */
|
157
|
-
varNam: string;
|
158
|
-
/** @deprecated. */
|
159
|
-
var_nam: string;
|
160
|
-
};
|
161
|
-
export declare type IKgFormLookupBeforeOkEventListener = ((param: IKgFormLookupBeforeOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
162
|
-
export declare type IKgFormLookupOkEventListenerParameter = {
|
163
|
-
/**
|
164
|
-
* 表单控件所处环境.
|
165
|
-
*/
|
166
|
-
context: KG_FORM_CONTEXT;
|
167
|
-
/** 是否多选, 否则单选. */
|
168
|
-
isMultiple: boolean;
|
169
|
-
/** 表单数据对象. */
|
170
|
-
model: ComputedRef<Record<string, any>>;
|
171
|
-
/**
|
172
|
-
* 单选时, 勾选的那一行.
|
173
|
-
* @deprecated 请直接使用属性 rows.
|
174
|
-
*/
|
175
|
-
row?: IKgTableRow | null;
|
176
|
-
/** 勾选的所有行. */
|
177
|
-
rows?: Array<IKgTableRow> | null;
|
178
|
-
/**
|
179
|
-
* 单选时, 对应的一个值.
|
180
|
-
* @deprecated 请直接使用属性 values.
|
181
|
-
*/
|
182
|
-
value?: any | null;
|
183
|
-
/** 勾选的所有值. */
|
184
|
-
values?: Array<any> | null;
|
185
|
-
/** 变量. */
|
186
|
-
varNam: string;
|
187
|
-
/** @deprecated. */
|
188
|
-
var_nam: string;
|
189
|
-
};
|
190
|
-
export declare type IKgFormLookupOkEventListener = ((param: IKgFormLookupOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
191
|
-
export declare type IKgFormEventListenerParameter = IKgFormChangeEventListenerParameter | IKgFormOnBlurEventListenerParameter | IKgFormSelectBeforeRequestEventListenerParameter | IKgFormSelectBeforeSetDatasEventListenerParameter | IKgFormSelectChangeEventListenerParameter | IKgFormLookupBeforeOpenEventListenerParameter | IKgFormLookupBeforeOkEventListenerParameter | IKgFormLookupOkEventListenerParameter;
|
192
|
-
export declare type IKgFormEventListener = IKgFormChangeEventListener | IKgFormOnBlurEventListener | IKgFormSelectBeforeRequestEventListener | IKgFormSelectBeforeSetDatasEventListener | IKgFormSelectChangeEventListener | IKgFormLookupBeforeOpenEventListener | IKgFormLookupBeforeOkEventListener | IKgFormLookupOkEventListener;
|
2
|
+
import { IKgFormEvent, IKgFormEventListenerParameter, IKgFormOnBlurEventListener, IKgFormOnChangeEventListener, IKgFormOnLookupBeforeOkEventListener, IKgFormOnLookupBeforeOpenEventListener, IKgFormOnLookupOkEventListener, IKgFormOnSelectBeforeRequestEventListener, IKgFormOnSelectBeforeSetDatasEventListener, IKgFormOnSelectChangeEventListener } from './index.event';
|
193
3
|
export interface IUseKgFormStoreState {
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
4
|
+
onBlur: Map<string, Array<IKgFormOnBlurEventListener>>;
|
5
|
+
onChange: Map<string, Array<IKgFormOnChangeEventListener>>;
|
6
|
+
onLookupBeforeOk: Map<string, Array<IKgFormOnLookupBeforeOkEventListener>>;
|
7
|
+
onLookupBeforeOpen: Map<string, Array<IKgFormOnLookupBeforeOpenEventListener>>;
|
8
|
+
onLookupOk: Map<string, Array<IKgFormOnLookupOkEventListener>>;
|
9
|
+
onSelectBeforeRequest: Map<string, Array<IKgFormOnSelectBeforeRequestEventListener>>;
|
10
|
+
onSelectBeforeSetDatas: Map<string, Array<IKgFormOnSelectBeforeSetDatasEventListener>>;
|
11
|
+
onSelectChange: Map<string, Array<IKgFormOnSelectChangeEventListener>>;
|
202
12
|
}
|
203
13
|
export interface IUseKgFormStoreGetters {
|
204
14
|
}
|