@kengic/vue 0.22.1-beta.0 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +58 -22
- package/dist/index.css +1 -1
- package/dist/kengic-vue.js +4192 -3968
- package/dist/project/build/script/postBuild.ts +1 -1
- package/dist/src/apis/WMS/Controllers/DescriptionController/ListByCodeNamesAndCodeValues.d.ts +16 -0
- package/dist/src/apis/WMS/Controllers/DescriptionController/index.d.ts +1 -0
- package/dist/src/apis/WMS/models.d.ts +8 -0
- package/dist/src/components/KgButton/index.hooks.d.ts +66 -67
- package/dist/src/components/KgButton/index.store.d.ts +43 -182
- package/dist/src/components/KgForm/index.hooks.d.ts +22 -28
- package/dist/src/components/KgForm/index.store.d.ts +22 -15
- package/dist/src/components/KgForm.Item/components/KgForm.Item.CheckboxGroup.d.ts +2 -0
- package/dist/src/components/KgForm.Item/components/KgForm.Item.RadioGroup.d.ts +0 -2
- package/dist/src/components/KgForm.Item/components/KgForm.Item.Select.d.ts +2 -4
- package/dist/src/components/KgSearch/index.hooks.d.ts +31 -136
- package/dist/src/components/KgSearch/index.store.d.ts +59 -175
- package/dist/src/components/KgSubmit/index.hooks.d.ts +80 -279
- package/dist/src/components/KgSubmit/index.store.d.ts +40 -225
- package/dist/src/components/KgTable/{KgTable.hooks.d.ts → KgTable.service.d.ts} +8 -16
- package/dist/src/components/KgTable/components/setting/KgTable.Setting.d.ts +0 -1
- package/dist/src/components/KgTable/components/setting/config/KgTable.Setting.ConfigModal.d.ts +0 -2
- package/dist/src/components/KgTable/index.hooks.d.ts +65 -428
- package/dist/src/components/KgTable/index.store.d.ts +87 -621
- package/dist/src/components/KgVar/index.hooks.d.ts +105 -3468
- package/dist/src/components/KgVar/index.store.d.ts +129 -3213
- package/dist/src/config/index.hooks.d.ts +31 -38
- package/dist/src/config/index.store.d.ts +74 -52
- package/dist/src/consts/i18n/en.d.ts +1 -0
- package/dist/src/consts/i18n/zh_CN.d.ts +1 -0
- package/dist/src/consts/index.d.ts +20 -13
- package/dist/src/consts/index.vm.d.ts +78 -51
- package/dist/src/pages/KgPageDda/components/KgPageDda.Create.store.d.ts +1 -1
- package/dist/src/utils/kg.util.d.ts +2 -2
- package/package.json +1 -1
- /package/dist/src/components/KgForm.Item/{KgForm.Item.hooks.d.ts → KgForm.Item.service.d.ts} +0 -0
- /package/dist/src/components/KgForm.Item/components/{KgForm.Item.Select.hooks.d.ts → KgForm.Item.Select.service.d.ts} +0 -0
- /package/dist/src/components/KgModal/{KgModal.hooks.d.ts → KgModal.service.d.ts} +0 -0
- /package/dist/src/components/KgSearch/{KgSearch.hooks.d.ts → KgSearch.service.d.ts} +0 -0
- /package/dist/src/components/KgSubmit/{KgSubmit.hooks.d.ts → KgSubmit.service.d.ts} +0 -0
- /package/dist/src/components/KgTable/components/setting/{KgTable.Setting.hooks.d.ts → KgTable.Setting.service.d.ts} +0 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
import { IRequestConfig, IRequestOptions } from '../../../../services';
|
2
|
+
import * as DEF from '../../../def';
|
3
|
+
/** 请求参数. */
|
4
|
+
export declare class ListByCodeNamesAndCodeValuesQuery {
|
5
|
+
}
|
6
|
+
/**
|
7
|
+
* 根据多个 codeName 和 codeValue 批量查询描述数据.
|
8
|
+
*
|
9
|
+
* @param config 请求配置.
|
10
|
+
* @param option 请求选项.
|
11
|
+
*/
|
12
|
+
export declare function ListByCodeNamesAndCodeValues(config?: IRequestConfig<ListByCodeNamesAndCodeValuesQuery, Array<DEF.WMS.DescriptionBatchQuery>>, option?: IRequestOptions): Promise<Array<DEF.WMS.Description>>;
|
13
|
+
export declare namespace ListByCodeNamesAndCodeValues {
|
14
|
+
var method: "POST";
|
15
|
+
var url: string;
|
16
|
+
}
|
@@ -96,6 +96,14 @@ export declare class Description {
|
|
96
96
|
sysDefFlg?: number | null;
|
97
97
|
constructor(obj?: Description);
|
98
98
|
}
|
99
|
+
/** 根据多个 codeName 和 codeValue 批量查询描述数据. */
|
100
|
+
export declare class DescriptionBatchQuery {
|
101
|
+
/** 描述组的编号. */
|
102
|
+
codeName?: string | null;
|
103
|
+
/** 描述项的编号列表. */
|
104
|
+
codeValues?: Array<string> | null;
|
105
|
+
constructor(obj?: DescriptionBatchQuery);
|
106
|
+
}
|
99
107
|
/** 获取 SQL 查询结果的元数据. */
|
100
108
|
export declare class GetResultSetMetadataFromSqlQuery {
|
101
109
|
/** SQL. */
|
@@ -1,16 +1,7 @@
|
|
1
1
|
import { ComputedRef } from 'vue';
|
2
|
-
import { VarButton } from '../../apis/WMS/models';
|
3
2
|
import { IRemoveEventListenerHandler, KG_BUTTON_TYPE } from '../../consts';
|
4
|
-
import { IKgButtonClickCb, IKgButtonImportOkCb, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb
|
3
|
+
import { IKgButtonClickCb, IKgButtonImportOkCb, IKgButtonStore, IKgButtonSubmitCancelCb, IKgButtonSubmitSaveCb } from './index.store';
|
5
4
|
export interface IUseKgButton {
|
6
|
-
/**
|
7
|
-
* 界面标识.
|
8
|
-
*/
|
9
|
-
formID: string;
|
10
|
-
/**
|
11
|
-
* 状态数据.
|
12
|
-
*/
|
13
|
-
store: ReturnType<typeof useKgButtonStore>;
|
14
5
|
/**
|
15
6
|
* <p>手动点击某个按钮.</p>
|
16
7
|
* <p>调用此方法相当于手动触发某个按钮的点击事件.</p>
|
@@ -25,45 +16,35 @@ export interface IUseKgButton {
|
|
25
16
|
/**
|
26
17
|
* <p>「当前按钮」.</p>
|
27
18
|
*/
|
28
|
-
currentButton: ComputedRef<
|
19
|
+
currentButton: ComputedRef<ReturnType<IKgButtonStore['getCurrentButton']>>;
|
29
20
|
/**
|
30
|
-
*
|
31
|
-
*/
|
32
|
-
searchButton: ComputedRef<VarButton | null>;
|
33
|
-
/**
|
34
|
-
* <p>判断「当前按钮」的 click 事件是否被拦截.</p>
|
35
|
-
*/
|
36
|
-
isCurrentButtonClickIntercepted: ComputedRef<boolean>;
|
37
|
-
/**
|
38
|
-
* <p>判断「当前按钮」是否正在请求后端接口.</p>
|
21
|
+
* 界面标识.
|
39
22
|
*/
|
40
|
-
|
23
|
+
formID: string;
|
41
24
|
/**
|
42
|
-
* <p
|
25
|
+
* <p>判断某个按钮的 click 事件是否被拦截.</p>
|
26
|
+
* <p>用户调用 <code>kgVar.kgButton.onClick(cb)</code> 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
27
|
+
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
43
28
|
*
|
44
29
|
* <ul>
|
45
30
|
* <li>
|
46
|
-
* <p>如果参数 {@link param}
|
47
|
-
* <p>调用方式如下: <code>
|
48
|
-
* </li>
|
49
|
-
* <li>
|
50
|
-
* <p>否则, 如果参数 {@link param.type} !== <code>undefined</code> && {@link param.type} !== {@link KG_BUTTON_TYPE.OTHER}, 则根据参数 {@link param.type} 获取按钮.</p>
|
51
|
-
* <p>调用方式如下: <code>setCurrentButton({ type: KG_BUTTON_TYPE.CREATE });</code></p>
|
31
|
+
* <p>如果参数 {@link param.type} !== <code>undefined</code> && {@link param.type} !== {@link KG_BUTTON_TYPE.OTHER}, 则根据参数 {@link param.type} 获取按钮.</p>
|
32
|
+
* <p>调用方式如下: <code>isClickIntercepted({ type: KG_BUTTON_TYPE.CREATE });</code></p>
|
52
33
|
* </li>
|
53
34
|
* <li>
|
54
|
-
* <p
|
35
|
+
* <p>如果参数 {@link param.type} === <code>undefined</code> || {@link param.type} === {@link KG_BUTTON_TYPE.OTHER}, 则参数 {@link param.varName} 必须传值, 否则报错.</p>
|
55
36
|
* <p>根据参数 {@link param.varName} 获取按钮.</p>
|
56
|
-
* <p>调用方式如下: <code>
|
37
|
+
* <p>调用方式如下: <code>isClickIntercepted({ varName: 'SOME-OTHER-BUTTON' });</code></p>
|
57
38
|
* </li>
|
58
39
|
* </ul>
|
59
40
|
*
|
60
41
|
* @param param.type <p>按钮的类型, 对应的是 {@link VarButton.typ} 属性, 取值请参考 {@link KG_BUTTON_TYPE}.</p>
|
61
42
|
* @param param.varName <p>按钮的变量名称, 对应的是 {@link VarButton.var_nam} 属性.</p>
|
62
43
|
*/
|
63
|
-
|
44
|
+
isClickIntercepted(param: {
|
64
45
|
type?: KG_BUTTON_TYPE;
|
65
46
|
varName?: string | null;
|
66
|
-
}
|
47
|
+
}): boolean;
|
67
48
|
/**
|
68
49
|
* <p>判断某个按钮是否是「当前按钮」.</p>
|
69
50
|
*
|
@@ -87,29 +68,71 @@ export interface IUseKgButton {
|
|
87
68
|
varName?: string;
|
88
69
|
}): boolean;
|
89
70
|
/**
|
90
|
-
* <p
|
91
|
-
|
92
|
-
|
71
|
+
* <p>判断「当前按钮」的 click 事件是否被拦截.</p>
|
72
|
+
*/
|
73
|
+
isCurrentButtonClickIntercepted: ComputedRef<ReturnType<IKgButtonStore['isClickIntercepted']>>;
|
74
|
+
/**
|
75
|
+
* <p>判断「当前按钮」是否正在请求后端接口.</p>
|
76
|
+
*/
|
77
|
+
isCurrentButtonRequesting: ComputedRef<ReturnType<IKgButtonStore['isCurrentButtonRequesting']>>;
|
78
|
+
/**
|
79
|
+
* 事件: 点击按钮.
|
80
|
+
*
|
81
|
+
* @param cb 回调函数.
|
82
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
83
|
+
*/
|
84
|
+
onClick(cb: IKgButtonClickCb, once?: boolean): IRemoveEventListenerHandler;
|
85
|
+
/**
|
86
|
+
* 事件: 导入成功, 导入接口调用成功.
|
87
|
+
*
|
88
|
+
* @param cb 回调函数.
|
89
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
90
|
+
*/
|
91
|
+
onImportOk(cb: IKgButtonImportOkCb, once?: boolean): IRemoveEventListenerHandler;
|
92
|
+
/**
|
93
|
+
* 事件: 表格内编辑时, 点击取消按钮.
|
94
|
+
*
|
95
|
+
* @param cb 回调函数.
|
96
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
97
|
+
*/
|
98
|
+
onSubmitCancel(cb: IKgButtonSubmitCancelCb, once?: boolean): IRemoveEventListenerHandler;
|
99
|
+
/**
|
100
|
+
* 事件: 表格内编辑时, 点击保存按钮.
|
101
|
+
*
|
102
|
+
* @param cb 回调函数.
|
103
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
104
|
+
*/
|
105
|
+
onSubmitSave(cb: IKgButtonSubmitSaveCb, once?: boolean): IRemoveEventListenerHandler;
|
106
|
+
/**
|
107
|
+
* <p>「查询按钮」.</p>
|
108
|
+
*/
|
109
|
+
searchButton: ComputedRef<ReturnType<IKgButtonStore['getSearchButton']>>;
|
110
|
+
/**
|
111
|
+
* <p>设置「当前按钮」. 比如点击「创建」按钮, 则此时「创建」按钮就是「当前按钮」, 同一时间最多只会有一个按钮处于「正在执行」状态.</p>
|
93
112
|
*
|
94
113
|
* <ul>
|
95
114
|
* <li>
|
96
|
-
* <p>如果参数 {@link param
|
97
|
-
* <p>调用方式如下: <code>
|
115
|
+
* <p>如果参数 {@link param} === null, 表示清空「当前按钮」.</p>
|
116
|
+
* <p>调用方式如下: <code>setCurrentButton(null);</code></p>
|
98
117
|
* </li>
|
99
118
|
* <li>
|
100
|
-
* <p
|
119
|
+
* <p>否则, 如果参数 {@link param.type} !== <code>undefined</code> && {@link param.type} !== {@link KG_BUTTON_TYPE.OTHER}, 则根据参数 {@link param.type} 获取按钮.</p>
|
120
|
+
* <p>调用方式如下: <code>setCurrentButton({ type: KG_BUTTON_TYPE.CREATE });</code></p>
|
121
|
+
* </li>
|
122
|
+
* <li>
|
123
|
+
* <p>否则, 如果参数 {@link param.type} === <code>undefined</code> || {@link param.type} === {@link KG_BUTTON_TYPE.OTHER}, 则参数 {@link param.varName} 必须传值, 否则报错.</p>
|
101
124
|
* <p>根据参数 {@link param.varName} 获取按钮.</p>
|
102
|
-
* <p>调用方式如下: <code>
|
125
|
+
* <p>调用方式如下: <code>setCurrentButton({ varName: 'SOME-OTHER-BUTTON' });</code></p>
|
103
126
|
* </li>
|
104
127
|
* </ul>
|
105
128
|
*
|
106
129
|
* @param param.type <p>按钮的类型, 对应的是 {@link VarButton.typ} 属性, 取值请参考 {@link KG_BUTTON_TYPE}.</p>
|
107
130
|
* @param param.varName <p>按钮的变量名称, 对应的是 {@link VarButton.var_nam} 属性.</p>
|
108
131
|
*/
|
109
|
-
|
132
|
+
setCurrentButton(param: {
|
110
133
|
type?: KG_BUTTON_TYPE;
|
111
134
|
varName?: string | null;
|
112
|
-
}):
|
135
|
+
} | null): Promise<void>;
|
113
136
|
/**
|
114
137
|
* <p>设置某个按钮的 click 事件是否被拦截.</p>
|
115
138
|
*
|
@@ -143,33 +166,9 @@ export interface IUseKgButton {
|
|
143
166
|
isRequesting: boolean;
|
144
167
|
}): void;
|
145
168
|
/**
|
146
|
-
*
|
147
|
-
*
|
148
|
-
* @param cb 回调函数.
|
149
|
-
* @param once 是否只会触发一次. 默认为 undefined.
|
150
|
-
*/
|
151
|
-
onClick(cb: IKgButtonClickCb, once?: boolean): IRemoveEventListenerHandler;
|
152
|
-
/**
|
153
|
-
* 事件: 导入成功, 导入接口调用成功.
|
154
|
-
*
|
155
|
-
* @param cb 回调函数.
|
156
|
-
* @param once 是否只会触发一次. 默认为 undefined.
|
157
|
-
*/
|
158
|
-
onImportOk(cb: IKgButtonImportOkCb, once?: boolean): IRemoveEventListenerHandler;
|
159
|
-
/**
|
160
|
-
* 事件: 表格内编辑时, 点击保存按钮.
|
161
|
-
*
|
162
|
-
* @param cb 回调函数.
|
163
|
-
* @param once 是否只会触发一次. 默认为 undefined.
|
164
|
-
*/
|
165
|
-
onSubmitSave(cb: IKgButtonSubmitSaveCb, once?: boolean): IRemoveEventListenerHandler;
|
166
|
-
/**
|
167
|
-
* 事件: 表格内编辑时, 点击取消按钮.
|
168
|
-
*
|
169
|
-
* @param cb 回调函数.
|
170
|
-
* @param once 是否只会触发一次. 默认为 undefined.
|
169
|
+
* 状态数据.
|
171
170
|
*/
|
172
|
-
|
171
|
+
store: IKgButtonStore;
|
173
172
|
}
|
174
173
|
/**
|
175
174
|
* @param formID 界面标识.
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { StoreDefinition } from 'pinia';
|
1
2
|
import { VarButton } from '../../apis/WMS/models';
|
2
3
|
import { IKgEventCb, KG_BUTTON_TYPE } from '../../consts';
|
3
4
|
/**
|
@@ -23,186 +24,42 @@ export declare type IKgButtonSubmitSaveCb = (() => Promise<boolean>) & IKgEventC
|
|
23
24
|
export declare type IKgButtonSubmitCancelCb = (() => Promise<boolean>) & IKgEventCb;
|
24
25
|
export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonImportOkCbParam;
|
25
26
|
export declare type IKgButtonCb = IKgButtonClickCb | IKgButtonImportOkCb | IKgButtonSubmitSaveCb | IKgButtonSubmitCancelCb;
|
26
|
-
export
|
27
|
+
export interface IUseKgButtonStoreState {
|
28
|
+
clickListenersMap: Map<string, Array<IKgButtonClickCb>>;
|
27
29
|
/**
|
28
30
|
* <p>当前按钮.</p>
|
29
31
|
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
30
32
|
*/
|
31
33
|
currentButtonMap: Map<string, VarButton | null>;
|
32
|
-
|
33
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
34
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
35
|
-
*/
|
36
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
34
|
+
importOkListenersMap: Map<string, Array<IKgButtonImportOkCb>>;
|
37
35
|
/**
|
38
36
|
* <p>按钮的 click 事件是否被拦截.</p>
|
39
|
-
* <p>用户调用 kgVar.kgButton
|
37
|
+
* <p>用户调用 kgVar.kgButton.onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
40
38
|
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
41
39
|
*/
|
42
40
|
isClickInterceptedMap: Map<string, boolean>;
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
56
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
57
|
-
/**
|
58
|
-
* <p>当前按钮.</p>
|
59
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
60
|
-
*/
|
61
|
-
currentButtonMap: Map<string, VarButton | null>;
|
62
|
-
/**
|
63
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
64
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
65
|
-
*/
|
66
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
67
|
-
/**
|
68
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
69
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
70
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
71
|
-
*/
|
72
|
-
isClickInterceptedMap: Map<string, boolean>;
|
73
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
74
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
75
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
76
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
77
|
-
}>): (formID: string | undefined | null, param: {
|
41
|
+
/**
|
42
|
+
* <p>当前按钮是否正在请求后端接口.</p>
|
43
|
+
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
44
|
+
*/
|
45
|
+
isCurrentButtonRequestingMap: Map<string, boolean>;
|
46
|
+
submitCancelListenersMap: Map<string, Array<IKgButtonSubmitCancelCb>>;
|
47
|
+
submitSaveListenersMap: Map<string, Array<IKgButtonSubmitSaveCb>>;
|
48
|
+
}
|
49
|
+
export interface IUseKgButtonStoreGetters {
|
50
|
+
getCurrentButton(): (formID: string | null | undefined) => VarButton | null;
|
51
|
+
getSearchButton(): (formID: string | null | undefined) => VarButton | null;
|
52
|
+
isClickIntercepted(): (formID: string | undefined | null, param: {
|
78
53
|
type?: KG_BUTTON_TYPE;
|
79
54
|
varName?: string | null;
|
80
55
|
}) => boolean;
|
81
|
-
|
82
|
-
currentButtonMap: Map<string, VarButton | null>;
|
83
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
84
|
-
isClickInterceptedMap: Map<string, boolean>;
|
85
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
86
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
87
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
88
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
89
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
90
|
-
/**
|
91
|
-
* <p>当前按钮.</p>
|
92
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
93
|
-
*/
|
94
|
-
currentButtonMap: Map<string, VarButton | null>;
|
95
|
-
/**
|
96
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
97
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
98
|
-
*/
|
99
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
100
|
-
/**
|
101
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
102
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
103
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
104
|
-
*/
|
105
|
-
isClickInterceptedMap: Map<string, boolean>;
|
106
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
107
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
108
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
109
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
110
|
-
}>): (formID: string | undefined | null) => boolean;
|
111
|
-
getCurrentButton: (state: {
|
112
|
-
currentButtonMap: Map<string, VarButton | null>;
|
113
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
114
|
-
isClickInterceptedMap: Map<string, boolean>;
|
115
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
116
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
117
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
118
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
119
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
120
|
-
/**
|
121
|
-
* <p>当前按钮.</p>
|
122
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
123
|
-
*/
|
124
|
-
currentButtonMap: Map<string, VarButton | null>;
|
125
|
-
/**
|
126
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
127
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
128
|
-
*/
|
129
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
130
|
-
/**
|
131
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
132
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
133
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
134
|
-
*/
|
135
|
-
isClickInterceptedMap: Map<string, boolean>;
|
136
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
137
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
138
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
139
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
140
|
-
}>) => (formID: string | null | undefined) => VarButton | null;
|
141
|
-
isCurrentButton(state: {
|
142
|
-
currentButtonMap: Map<string, VarButton | null>;
|
143
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
144
|
-
isClickInterceptedMap: Map<string, boolean>;
|
145
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
146
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
147
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
148
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
149
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
150
|
-
/**
|
151
|
-
* <p>当前按钮.</p>
|
152
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
153
|
-
*/
|
154
|
-
currentButtonMap: Map<string, VarButton | null>;
|
155
|
-
/**
|
156
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
157
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
158
|
-
*/
|
159
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
160
|
-
/**
|
161
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
162
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
163
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
164
|
-
*/
|
165
|
-
isClickInterceptedMap: Map<string, boolean>;
|
166
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
167
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
168
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
169
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
170
|
-
}>): (formID: string, param: {
|
56
|
+
isCurrentButton(): (formID: string, param: {
|
171
57
|
varName?: string;
|
172
58
|
type?: KG_BUTTON_TYPE;
|
173
59
|
}) => boolean;
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
isClickInterceptedMap: Map<string, boolean>;
|
178
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
179
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
180
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
181
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
182
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
183
|
-
/**
|
184
|
-
* <p>当前按钮.</p>
|
185
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
186
|
-
*/
|
187
|
-
currentButtonMap: Map<string, VarButton | null>;
|
188
|
-
/**
|
189
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
190
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
191
|
-
*/
|
192
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
193
|
-
/**
|
194
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
195
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
196
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
197
|
-
*/
|
198
|
-
isClickInterceptedMap: Map<string, boolean>;
|
199
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
200
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
201
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
202
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
203
|
-
}>): (formID: string | null | undefined) => VarButton | null;
|
204
|
-
}, {
|
205
|
-
dispose(formID: string | null | undefined): void;
|
60
|
+
isCurrentButtonRequesting(): (formID: string | undefined | null) => boolean;
|
61
|
+
}
|
62
|
+
export interface IUseKgButtonStoreActions {
|
206
63
|
/**
|
207
64
|
* 注册事件监听.
|
208
65
|
* @param formID 界面标识.
|
@@ -211,12 +68,15 @@ export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton
|
|
211
68
|
*/
|
212
69
|
addEventListener(formID: string, event: IKgButtonEvent, cb: IKgButtonCb): void;
|
213
70
|
/**
|
214
|
-
*
|
71
|
+
* <p>手动点击某个按钮.</p>
|
72
|
+
* <p>调用此方法相当于手动触发某个按钮的点击事件.</p>
|
73
|
+
*
|
215
74
|
* @param formID 界面标识.
|
216
|
-
* @param
|
217
|
-
* @param
|
75
|
+
* @param type 按钮类型.
|
76
|
+
* @param variableName 按钮变量名称.
|
218
77
|
*/
|
219
|
-
|
78
|
+
click(formID: string, type: KG_BUTTON_TYPE, variableName?: string): void;
|
79
|
+
dispose(formID: string | null | undefined): void;
|
220
80
|
/**
|
221
81
|
* 触发事件.
|
222
82
|
* @param formID 界面标识.
|
@@ -224,6 +84,17 @@ export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton
|
|
224
84
|
* @param param 数据.
|
225
85
|
*/
|
226
86
|
emit(formID: string, event: IKgButtonEvent, param: IKgButtonCbParam): Promise<boolean>;
|
87
|
+
/**
|
88
|
+
* 退订事件监听.
|
89
|
+
* @param formID 界面标识.
|
90
|
+
* @param event 事件名称.
|
91
|
+
* @param cb 回调函数.
|
92
|
+
*/
|
93
|
+
removeEventListener(formID: string, event: IKgButtonEvent, cb?: IKgButtonCb): void;
|
94
|
+
setCurrentButton(formID: string, param: {
|
95
|
+
type?: KG_BUTTON_TYPE;
|
96
|
+
varName?: string | null;
|
97
|
+
} | null): Promise<void>;
|
227
98
|
setIsClickIntercepted(formID: string | undefined | null, param: {
|
228
99
|
isIntercepted: boolean;
|
229
100
|
type?: KG_BUTTON_TYPE;
|
@@ -232,17 +103,7 @@ export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton
|
|
232
103
|
setIsCurrentButtonRequesting(formID: string | undefined | null, param: {
|
233
104
|
isRequesting: boolean;
|
234
105
|
}): void;
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
/**
|
240
|
-
* <p>手动点击某个按钮.</p>
|
241
|
-
* <p>调用此方法相当于手动触发某个按钮的点击事件.</p>
|
242
|
-
*
|
243
|
-
* @param formID 界面标识.
|
244
|
-
* @param type 按钮类型.
|
245
|
-
* @param variableName 按钮变量名称.
|
246
|
-
*/
|
247
|
-
click(formID: string, type: KG_BUTTON_TYPE, variableName?: string): void;
|
248
|
-
}>;
|
106
|
+
}
|
107
|
+
export declare type IUseKgButtonStore = StoreDefinition<'KgButton', IUseKgButtonStoreState, IUseKgButtonStoreGetters, IUseKgButtonStoreActions>;
|
108
|
+
export declare type IKgButtonStore = ReturnType<IUseKgButtonStore>;
|
109
|
+
export declare const useKgButtonStore: IUseKgButtonStore;
|
@@ -1,55 +1,49 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
*/
|
5
|
-
export declare function useKgForm(formID?: string | null): {
|
1
|
+
import { IRemoveEventListenerHandler } from '../../consts';
|
2
|
+
import { IKgFormChangeCb, IKgFormLookupBeforeOkCb, IKgFormLookupBeforeOpenCb, IKgFormLookupOkCb, IKgFormSelectBeforeSetDatasCb, IKgFormSelectChangeCb, IKgFormStore } from './index.store';
|
3
|
+
export declare type IUseKgForm = {
|
6
4
|
formID: string;
|
7
|
-
store: import("pinia").Store<"KgForm", {
|
8
|
-
changeListenersMap: Map<string, IKgFormChangeCb[]>;
|
9
|
-
selectBeforeSetDatasListenersMap: Map<string, IKgFormSelectBeforeSetDatasCb[]>;
|
10
|
-
selectChangeListenersMap: Map<string, IKgFormSelectChangeCb[]>;
|
11
|
-
lookupBeforeOpenListenersMap: Map<string, IKgFormLookupBeforeOpenCb[]>;
|
12
|
-
lookupBeforeOkListenersMap: Map<string, IKgFormLookupBeforeOkCb[]>;
|
13
|
-
lookupOkListenersMap: Map<string, IKgFormLookupOkCb[]>;
|
14
|
-
}, {}, {
|
15
|
-
addEventListener(formID: string, event: IKgFormEvent, cb: import("./index.store").IKgFormCb): void;
|
16
|
-
removeEventListener(formID: string, event: IKgFormEvent, cb?: import("./index.store").IKgFormCb | undefined): void;
|
17
|
-
emit<T = import("./index.store").IKgFormCbParam>(formID: string, event: IKgFormEvent, param: T): Promise<boolean>;
|
18
|
-
}>;
|
19
5
|
/**
|
20
6
|
* 事件: 表单控件数据发生变更.
|
21
7
|
* @param cb 回调函数.
|
22
8
|
* @param once 是否只会触发一次. 默认为 undefined.
|
23
9
|
*/
|
24
|
-
onChange
|
10
|
+
onChange(cb: IKgFormChangeCb, once?: boolean): IRemoveEventListenerHandler;
|
25
11
|
/**
|
26
|
-
* 事件:
|
12
|
+
* 事件: 查找弹窗点击确定之前. 如果返回 true 则查找弹窗不会触发 kgOk 事件.
|
27
13
|
* @param cb 回调函数.
|
28
14
|
* @param once 是否只会触发一次. 默认为 undefined.
|
29
15
|
*/
|
30
|
-
|
16
|
+
onLookupBeforeOk(cb: IKgFormLookupBeforeOkCb, once?: boolean): IRemoveEventListenerHandler;
|
31
17
|
/**
|
32
|
-
* 事件:
|
18
|
+
* 事件: 查找弹窗打开之前.
|
33
19
|
* @param cb 回调函数.
|
34
20
|
* @param once 是否只会触发一次. 默认为 undefined.
|
35
21
|
*/
|
36
|
-
|
22
|
+
onLookupBeforeOpen(cb: IKgFormLookupBeforeOpenCb, once?: boolean): IRemoveEventListenerHandler;
|
37
23
|
/**
|
38
|
-
* 事件:
|
24
|
+
* 事件: 查找弹窗点击确定.
|
39
25
|
* @param cb 回调函数.
|
40
26
|
* @param once 是否只会触发一次. 默认为 undefined.
|
41
27
|
*/
|
42
|
-
|
28
|
+
onLookupOk(cb: IKgFormLookupOkCb, once?: boolean): IRemoveEventListenerHandler;
|
43
29
|
/**
|
44
|
-
* 事件:
|
30
|
+
* 事件: 查询请求成功, 列表数据尚未赋值. 此处可以对查询接口返回的列表数据作处理.
|
45
31
|
* @param cb 回调函数.
|
46
32
|
* @param once 是否只会触发一次. 默认为 undefined.
|
47
33
|
*/
|
48
|
-
|
34
|
+
onSelectBeforeSetDatas(cb: IKgFormSelectBeforeSetDatasCb, once?: boolean): IRemoveEventListenerHandler;
|
49
35
|
/**
|
50
|
-
* 事件:
|
36
|
+
* 事件: 下拉列表选中某个(可能多个)数据.
|
51
37
|
* @param cb 回调函数.
|
52
38
|
* @param once 是否只会触发一次. 默认为 undefined.
|
53
39
|
*/
|
54
|
-
|
40
|
+
onSelectChange(cb: IKgFormSelectChangeCb, once?: boolean): IRemoveEventListenerHandler;
|
41
|
+
/**
|
42
|
+
* 状态数据.
|
43
|
+
*/
|
44
|
+
store: IKgFormStore;
|
55
45
|
};
|
46
|
+
/**
|
47
|
+
* @param formID 界面标识.
|
48
|
+
*/
|
49
|
+
export declare function useKgForm(formID?: string | null): IUseKgForm;
|