@kengic/vue 0.22.0 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +178 -139
- package/dist/index.css +1 -1
- package/dist/kengic-vue.js +4201 -3969
- 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 +74 -199
- package/dist/src/components/KgButton/index.store.d.ts +48 -184
- 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 -3622
- 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-route.util.d.ts +3 -2
- 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
@@ -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
|
/**
|
@@ -9,197 +10,56 @@ import { IKgEventCb, KG_BUTTON_TYPE } from '../../consts';
|
|
9
10
|
*/
|
10
11
|
export declare type IKgButtonEvent = 'click' | 'importOk' | 'submitSave' | 'submitCancel';
|
11
12
|
export declare type IKgButtonClickCbParam = {
|
13
|
+
/**
|
14
|
+
* 被点击的按钮.
|
15
|
+
*/
|
12
16
|
button: VarButton;
|
13
17
|
};
|
14
|
-
export declare type IKgButtonClickCb = ((
|
18
|
+
export declare type IKgButtonClickCb = ((param: IKgButtonClickCbParam) => Promise<boolean>) & IKgEventCb;
|
15
19
|
export declare type IKgButtonImportOkCbParam = {
|
16
20
|
button?: VarButton | null;
|
17
21
|
};
|
18
22
|
export declare type IKgButtonImportOkCb = ((args: IKgButtonImportOkCbParam) => Promise<boolean>) & IKgEventCb;
|
19
23
|
export declare type IKgButtonSubmitSaveCb = (() => Promise<boolean>) & IKgEventCb;
|
20
24
|
export declare type IKgButtonSubmitCancelCb = (() => Promise<boolean>) & IKgEventCb;
|
21
|
-
export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonImportOkCbParam
|
25
|
+
export declare type IKgButtonCbParam = IKgButtonClickCbParam | IKgButtonImportOkCbParam;
|
22
26
|
export declare type IKgButtonCb = IKgButtonClickCb | IKgButtonImportOkCb | IKgButtonSubmitSaveCb | IKgButtonSubmitCancelCb;
|
23
|
-
export
|
27
|
+
export interface IUseKgButtonStoreState {
|
28
|
+
clickListenersMap: Map<string, Array<IKgButtonClickCb>>;
|
24
29
|
/**
|
25
30
|
* <p>当前按钮.</p>
|
26
31
|
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
27
32
|
*/
|
28
33
|
currentButtonMap: Map<string, VarButton | null>;
|
29
|
-
|
30
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
31
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
32
|
-
*/
|
33
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
34
|
+
importOkListenersMap: Map<string, Array<IKgButtonImportOkCb>>;
|
34
35
|
/**
|
35
36
|
* <p>按钮的 click 事件是否被拦截.</p>
|
36
|
-
* <p>用户调用 kgVar.kgButton
|
37
|
+
* <p>用户调用 kgVar.kgButton.onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
37
38
|
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
38
39
|
*/
|
39
40
|
isClickInterceptedMap: Map<string, boolean>;
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
53
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
54
|
-
/**
|
55
|
-
* <p>当前按钮.</p>
|
56
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
57
|
-
*/
|
58
|
-
currentButtonMap: Map<string, VarButton | null>;
|
59
|
-
/**
|
60
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
61
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
62
|
-
*/
|
63
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
64
|
-
/**
|
65
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
66
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
67
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
68
|
-
*/
|
69
|
-
isClickInterceptedMap: Map<string, boolean>;
|
70
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
71
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
72
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
73
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
74
|
-
}>): (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: {
|
75
53
|
type?: KG_BUTTON_TYPE;
|
76
54
|
varName?: string | null;
|
77
55
|
}) => boolean;
|
78
|
-
|
79
|
-
currentButtonMap: Map<string, VarButton | null>;
|
80
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
81
|
-
isClickInterceptedMap: Map<string, boolean>;
|
82
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
83
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
84
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
85
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
86
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
87
|
-
/**
|
88
|
-
* <p>当前按钮.</p>
|
89
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
90
|
-
*/
|
91
|
-
currentButtonMap: Map<string, VarButton | null>;
|
92
|
-
/**
|
93
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
94
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
95
|
-
*/
|
96
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
97
|
-
/**
|
98
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
99
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
100
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
101
|
-
*/
|
102
|
-
isClickInterceptedMap: Map<string, boolean>;
|
103
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
104
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
105
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
106
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
107
|
-
}>): (formID: string | undefined | null) => boolean;
|
108
|
-
getCurrentButton: (state: {
|
109
|
-
currentButtonMap: Map<string, VarButton | null>;
|
110
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
111
|
-
isClickInterceptedMap: Map<string, boolean>;
|
112
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
113
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
114
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
115
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
116
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
117
|
-
/**
|
118
|
-
* <p>当前按钮.</p>
|
119
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
120
|
-
*/
|
121
|
-
currentButtonMap: Map<string, VarButton | null>;
|
122
|
-
/**
|
123
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
124
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
125
|
-
*/
|
126
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
127
|
-
/**
|
128
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
129
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
130
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
131
|
-
*/
|
132
|
-
isClickInterceptedMap: Map<string, boolean>;
|
133
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
134
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
135
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
136
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
137
|
-
}>) => (formID: string | null | undefined) => VarButton | null;
|
138
|
-
isCurrentButton(state: {
|
139
|
-
currentButtonMap: Map<string, VarButton | null>;
|
140
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
141
|
-
isClickInterceptedMap: Map<string, boolean>;
|
142
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
143
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
144
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
145
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
146
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
147
|
-
/**
|
148
|
-
* <p>当前按钮.</p>
|
149
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
150
|
-
*/
|
151
|
-
currentButtonMap: Map<string, VarButton | null>;
|
152
|
-
/**
|
153
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
154
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
155
|
-
*/
|
156
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
157
|
-
/**
|
158
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
159
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
160
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
161
|
-
*/
|
162
|
-
isClickInterceptedMap: Map<string, boolean>;
|
163
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
164
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
165
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
166
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
167
|
-
}>): (formID: string, param: {
|
56
|
+
isCurrentButton(): (formID: string, param: {
|
168
57
|
varName?: string;
|
169
58
|
type?: KG_BUTTON_TYPE;
|
170
59
|
}) => boolean;
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
isClickInterceptedMap: Map<string, boolean>;
|
175
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
176
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
177
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
178
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
179
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
180
|
-
/**
|
181
|
-
* <p>当前按钮.</p>
|
182
|
-
* <p>同一时间最多只会有一个按钮处于「正在执行」状态, 比如点击了创建按钮, 则当前按钮就是创建按钮.</p>
|
183
|
-
*/
|
184
|
-
currentButtonMap: Map<string, VarButton | null>;
|
185
|
-
/**
|
186
|
-
* <p>当前按钮是否正在请求后端接口.</p>
|
187
|
-
* <p>比如点击了创建按钮, 打开了创建弹窗, 此时「当前按钮」指的就是创建按钮. 当点击弹窗中的保存按钮时, 表示正在请求后端接口.</p>
|
188
|
-
*/
|
189
|
-
isCurrentButtonRequestingMap: Map<string, boolean>;
|
190
|
-
/**
|
191
|
-
* <p>按钮的 click 事件是否被拦截.</p>
|
192
|
-
* <p>用户调用 kgVar.kgButton().onClick(cb) 监听了 click 事件, 并且回调函数返回了 true, 表示该 click 事件被用户拦截了.</p>
|
193
|
-
* <p>被拦截之后, 该按钮的默认逻辑不会执行(例如打开提交弹窗, 加载各种数据等等), 后续由用户自行处理.</p>
|
194
|
-
*/
|
195
|
-
isClickInterceptedMap: Map<string, boolean>;
|
196
|
-
clickListenersMap: Map<string, IKgButtonClickCb[]>;
|
197
|
-
importOkListenersMap: Map<string, IKgButtonImportOkCb[]>;
|
198
|
-
submitCancelListenersMap: Map<string, IKgButtonSubmitCancelCb[]>;
|
199
|
-
submitSaveListenersMap: Map<string, IKgButtonSubmitSaveCb[]>;
|
200
|
-
}>): (formID: string | null | undefined) => VarButton | null;
|
201
|
-
}, {
|
202
|
-
dispose(formID: string | null | undefined): void;
|
60
|
+
isCurrentButtonRequesting(): (formID: string | undefined | null) => boolean;
|
61
|
+
}
|
62
|
+
export interface IUseKgButtonStoreActions {
|
203
63
|
/**
|
204
64
|
* 注册事件监听.
|
205
65
|
* @param formID 界面标识.
|
@@ -208,12 +68,15 @@ export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton
|
|
208
68
|
*/
|
209
69
|
addEventListener(formID: string, event: IKgButtonEvent, cb: IKgButtonCb): void;
|
210
70
|
/**
|
211
|
-
*
|
71
|
+
* <p>手动点击某个按钮.</p>
|
72
|
+
* <p>调用此方法相当于手动触发某个按钮的点击事件.</p>
|
73
|
+
*
|
212
74
|
* @param formID 界面标识.
|
213
|
-
* @param
|
214
|
-
* @param
|
75
|
+
* @param type 按钮类型.
|
76
|
+
* @param variableName 按钮变量名称.
|
215
77
|
*/
|
216
|
-
|
78
|
+
click(formID: string, type: KG_BUTTON_TYPE, variableName?: string): void;
|
79
|
+
dispose(formID: string | null | undefined): void;
|
217
80
|
/**
|
218
81
|
* 触发事件.
|
219
82
|
* @param formID 界面标识.
|
@@ -221,6 +84,17 @@ export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton
|
|
221
84
|
* @param param 数据.
|
222
85
|
*/
|
223
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>;
|
224
98
|
setIsClickIntercepted(formID: string | undefined | null, param: {
|
225
99
|
isIntercepted: boolean;
|
226
100
|
type?: KG_BUTTON_TYPE;
|
@@ -229,17 +103,7 @@ export declare const useKgButtonStore: import("pinia").StoreDefinition<"KgButton
|
|
229
103
|
setIsCurrentButtonRequesting(formID: string | undefined | null, param: {
|
230
104
|
isRequesting: boolean;
|
231
105
|
}): void;
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
/**
|
237
|
-
* <p>手动点击某个按钮.</p>
|
238
|
-
* <p>调用此方法相当于手动触发某个按钮的点击事件.</p>
|
239
|
-
*
|
240
|
-
* @param formID 界面标识.
|
241
|
-
* @param type 按钮类型.
|
242
|
-
* @param variableName 按钮变量名称.
|
243
|
-
*/
|
244
|
-
click(formID: string, type: KG_BUTTON_TYPE, variableName?: string): void;
|
245
|
-
}>;
|
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;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { StoreDefinition } from 'pinia';
|
1
2
|
import { ComputedRef, Ref } from 'vue';
|
2
3
|
import { IKgEventCb } from '../../consts';
|
3
4
|
import { IKgTableRow } from '../KgTable';
|
@@ -113,14 +114,17 @@ export declare type IKgFormLookupOkCbParam = {
|
|
113
114
|
export declare type IKgFormLookupOkCb = ((param: IKgFormLookupOkCbParam) => Promise<boolean>) & IKgEventCb;
|
114
115
|
export declare type IKgFormCbParam = IKgFormChangeCbParam | IKgFormSelectBeforeSetDatasCbParam | IKgFormSelectChangeCbParam | IKgFormLookupBeforeOpenCbParam | IKgFormLookupBeforeOkCbParam | IKgFormLookupOkCbParam;
|
115
116
|
export declare type IKgFormCb = IKgFormChangeCb | IKgFormSelectBeforeSetDatasCb | IKgFormSelectChangeCb | IKgFormLookupBeforeOpenCb | IKgFormLookupBeforeOkCb | IKgFormLookupOkCb;
|
116
|
-
export
|
117
|
-
changeListenersMap: Map<string, IKgFormChangeCb
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
}
|
117
|
+
export interface IUseKgFormStoreState {
|
118
|
+
changeListenersMap: Map<string, Array<IKgFormChangeCb>>;
|
119
|
+
lookupBeforeOkListenersMap: Map<string, Array<IKgFormLookupBeforeOkCb>>;
|
120
|
+
lookupBeforeOpenListenersMap: Map<string, Array<IKgFormLookupBeforeOpenCb>>;
|
121
|
+
lookupOkListenersMap: Map<string, Array<IKgFormLookupOkCb>>;
|
122
|
+
selectBeforeSetDatasListenersMap: Map<string, Array<IKgFormSelectBeforeSetDatasCb>>;
|
123
|
+
selectChangeListenersMap: Map<string, Array<IKgFormSelectChangeCb>>;
|
124
|
+
}
|
125
|
+
export interface IUseKgFormStoreGetters {
|
126
|
+
}
|
127
|
+
export interface IUseKgFormStoreActions {
|
124
128
|
/**
|
125
129
|
* 注册事件监听.
|
126
130
|
* @param formID 界面标识.
|
@@ -129,17 +133,20 @@ export declare const useKgFormStore: import("pinia").StoreDefinition<"KgForm", {
|
|
129
133
|
*/
|
130
134
|
addEventListener(formID: string, event: IKgFormEvent, cb: IKgFormCb): void;
|
131
135
|
/**
|
132
|
-
*
|
136
|
+
* 触发事件.
|
133
137
|
* @param formID 界面标识.
|
134
138
|
* @param event 事件名称.
|
135
|
-
* @param
|
139
|
+
* @param param 数据.
|
136
140
|
*/
|
137
|
-
|
141
|
+
emit<T = IKgFormCbParam>(formID: string, event: IKgFormEvent, param: T): Promise<boolean>;
|
138
142
|
/**
|
139
|
-
*
|
143
|
+
* 退订事件监听.
|
140
144
|
* @param formID 界面标识.
|
141
145
|
* @param event 事件名称.
|
142
|
-
* @param
|
146
|
+
* @param cb 回调函数.
|
143
147
|
*/
|
144
|
-
|
145
|
-
}
|
148
|
+
removeEventListener(formID: string, event: IKgFormEvent, cb?: IKgFormCb): void;
|
149
|
+
}
|
150
|
+
export declare type IUseKgFormStore = StoreDefinition<'KgForm', IUseKgFormStoreState, IUseKgFormStoreGetters, IUseKgFormStoreActions>;
|
151
|
+
export declare type IKgFormStore = ReturnType<IUseKgFormStore>;
|
152
|
+
export declare const useKgFormStore: IUseKgFormStore;
|
@@ -14,6 +14,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
14
14
|
kgSpan: import("vue").PropType<number>;
|
15
15
|
kgPlaceholder: import("vue").PropType<string>;
|
16
16
|
kgMode: import("vue").PropType<"multiple" | "tags">;
|
17
|
+
/** 是否全选. */
|
17
18
|
kgShowLabel: {
|
18
19
|
type: import("vue").PropType<boolean>;
|
19
20
|
default: boolean;
|
@@ -56,6 +57,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
56
57
|
kgSpan: import("vue").PropType<number>;
|
57
58
|
kgPlaceholder: import("vue").PropType<string>;
|
58
59
|
kgMode: import("vue").PropType<"multiple" | "tags">;
|
60
|
+
/** 是否全选. */
|
59
61
|
kgShowLabel: {
|
60
62
|
type: import("vue").PropType<boolean>;
|
61
63
|
default: boolean;
|
@@ -13,7 +13,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
13
13
|
};
|
14
14
|
kgSpan: import("vue").PropType<number>;
|
15
15
|
kgPlaceholder: import("vue").PropType<string>;
|
16
|
-
/** 初始. */
|
17
16
|
kgMode: import("vue").PropType<"multiple" | "tags">;
|
18
17
|
kgShowLabel: {
|
19
18
|
type: import("vue").PropType<boolean>;
|
@@ -56,7 +55,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
56
55
|
};
|
57
56
|
kgSpan: import("vue").PropType<number>;
|
58
57
|
kgPlaceholder: import("vue").PropType<string>;
|
59
|
-
/** 初始. */
|
60
58
|
kgMode: import("vue").PropType<"multiple" | "tags">;
|
61
59
|
kgShowLabel: {
|
62
60
|
type: import("vue").PropType<boolean>;
|
@@ -36,9 +36,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
36
36
|
type: import("vue").PropType<import("../index.vm").IKgFormItemValue>;
|
37
37
|
default: undefined;
|
38
38
|
};
|
39
|
-
/** 初始. */
|
40
39
|
'onUpdate:value': import("vue").PropType<(value: import("../index.vm").IKgFormItemValue | null) => void>;
|
41
|
-
onKgSubmit: import("vue").PropType<() => void>;
|
40
|
+
onKgSubmit: import("vue").PropType<() => void>;
|
42
41
|
onKgChange: import("vue").PropType<(value: any) => void>;
|
43
42
|
onKgSelectChange: import("vue").PropType<(value: any) => void>;
|
44
43
|
onKgSelectDatasChange: import("vue").PropType<(datas: any[]) => void>;
|
@@ -79,9 +78,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
79
78
|
type: import("vue").PropType<import("../index.vm").IKgFormItemValue>;
|
80
79
|
default: undefined;
|
81
80
|
};
|
82
|
-
/** 初始. */
|
83
81
|
'onUpdate:value': import("vue").PropType<(value: import("../index.vm").IKgFormItemValue | null) => void>;
|
84
|
-
onKgSubmit: import("vue").PropType<() => void>;
|
82
|
+
onKgSubmit: import("vue").PropType<() => void>;
|
85
83
|
onKgChange: import("vue").PropType<(value: any) => void>;
|
86
84
|
onKgSelectChange: import("vue").PropType<(value: any) => void>;
|
87
85
|
onKgSelectDatasChange: import("vue").PropType<(datas: any[]) => void>;
|