@kengic/vue 0.23.0 → 0.23.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/dist/index.css +1 -1
- package/dist/kengic-vue.js +6479 -5667
- package/dist/project/build/script/buildConf.ts +1 -2
- package/dist/project/build/script/postBuild.ts +1 -1
- package/dist/project/src/api/sys/model/userModel.ts +1 -0
- package/dist/src/apis/WMS/Controllers/VarConfigDescriptionController/index.d.ts +0 -7
- package/dist/src/apis/WMS/Controllers/VarConfigPossibilityController/ExecuteQuery.d.ts +18 -0
- package/dist/src/apis/WMS/Controllers/VarConfigPossibilityController/index.d.ts +1 -0
- package/dist/src/apis/WMS/Controllers/index.d.ts +1 -0
- package/dist/src/apis/WMS/models.d.ts +20 -4
- package/dist/src/components/KgAppSelect/index.hooks.d.ts +3 -3
- package/dist/src/components/KgAppSelect/index.store.d.ts +30 -29
- package/dist/src/components/KgButton/KgButton.d.ts +18 -12
- package/dist/src/components/KgButton/index.d.ts +4 -4
- package/dist/src/components/KgButton/index.hooks.d.ts +7 -5
- package/dist/src/components/KgButton/index.store.d.ts +19 -16
- package/dist/src/components/KgForm/index.hooks.d.ts +21 -8
- package/dist/src/components/KgForm/index.store.d.ts +74 -34
- package/dist/src/components/KgForm.Item/KgForm.Item.d.ts +3 -3
- package/dist/src/components/KgForm.Item/KgForm.Item.service.d.ts +3 -3
- package/dist/src/components/KgForm.Item/components/KgForm.Item.Checkbox.d.ts +8 -7
- package/dist/src/components/KgForm.Item/components/KgForm.Item.CheckboxGroup.d.ts +6 -7
- package/dist/src/components/KgForm.Item/components/KgForm.Item.Date.d.ts +6 -5
- package/dist/src/components/KgForm.Item/components/KgForm.Item.DateRange.d.ts +6 -5
- package/dist/src/components/KgForm.Item/components/KgForm.Item.Image.d.ts +3 -3
- package/dist/src/components/KgForm.Item/components/KgForm.Item.Input.d.ts +6 -5
- package/dist/src/components/KgForm.Item/components/KgForm.Item.InputNumber.d.ts +6 -5
- package/dist/src/components/KgForm.Item/components/KgForm.Item.RadioGroup.d.ts +6 -5
- package/dist/src/components/KgForm.Item/components/KgForm.Item.Select.d.ts +7 -3
- package/dist/src/components/KgForm.Item/components/KgForm.Item.Select.service.d.ts +16 -13
- package/dist/src/components/KgForm.Item/components/KgForm.Item.Switch.d.ts +6 -5
- package/dist/src/components/KgForm.Item/components/KgForm.Item.TextArea.d.ts +6 -5
- package/dist/src/components/KgForm.Item/index.d.ts +1 -1
- package/dist/src/components/KgForm.Item/index.vm.d.ts +9 -7
- package/dist/src/components/KgResizable/KgResizable.d.ts +52 -52
- package/dist/src/components/KgSearch/KgSearch.d.ts +0 -16
- package/dist/src/components/KgSearch/KgSearch.service.d.ts +20 -16
- package/dist/src/components/KgSearch/index.hooks.d.ts +33 -9
- package/dist/src/components/KgSearch/index.store.d.ts +44 -37
- package/dist/src/components/KgSubmit/index.hooks.d.ts +48 -15
- package/dist/src/components/KgSubmit/index.store.d.ts +44 -45
- package/dist/src/components/KgSubmit/index.vm.d.ts +2 -1
- package/dist/src/components/KgTable/components/setting/KgTable.Setting.service.d.ts +1 -1
- package/dist/src/components/KgTable/index.hooks.d.ts +23 -8
- package/dist/src/components/KgTable/index.store.d.ts +48 -34
- package/dist/src/components/KgTable/index.vm.d.ts +1 -1
- package/dist/src/components/KgVar/index.hooks.d.ts +9 -11
- package/dist/src/components/KgVar/index.store.d.ts +51 -60
- package/dist/src/components/KgVar/index.store.service.d.ts +2 -1
- package/dist/src/components/KgVar/index.vm.d.ts +7 -7
- package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.VarConfigInput.d.ts +2 -0
- package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.VarConfigLookup.d.ts +2 -0
- package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.VarConfigPossibility.d.ts +2 -0
- package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.VarConfigTip.d.ts +2 -0
- package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.VarVariable.d.ts +2 -0
- package/dist/src/components/KgVarConfig/index.store.d.ts +23 -16
- package/dist/src/components/KgVarConfig/index.vm.d.ts +32 -0
- package/dist/src/components/KgWarehouse/index.hooks.d.ts +10 -6
- package/dist/src/components/KgWarehouse/index.store.d.ts +15 -14
- package/dist/src/components/util.d.ts +7 -7
- package/dist/src/consts/i18n/en.d.ts +10 -7
- package/dist/src/consts/i18n/zh_CN.d.ts +10 -7
- package/dist/src/consts/index.d.ts +0 -284
- package/dist/src/consts/index.vm.d.ts +425 -24
- package/dist/src/pages/KgPageDda/components/KgPageDda.Create.store.d.ts +6 -0
- package/dist/src/utils/kg-var.util.d.ts +4 -3
- package/dist/src/utils/kg.util.d.ts +11 -14
- package/package.json +2 -2
- package/dist/src/apis/WMS/Controllers/VarConfigDescriptionController/Delete.d.ts +0 -18
- package/dist/src/apis/WMS/Controllers/VarConfigDescriptionController/DeleteBatch.d.ts +0 -18
- package/dist/src/apis/WMS/Controllers/VarConfigDescriptionController/Edit.d.ts +0 -16
- package/dist/src/apis/WMS/Controllers/VarConfigDescriptionController/ExportXls.d.ts +0 -30
- package/dist/src/apis/WMS/Controllers/VarConfigDescriptionController/ImportExcel.d.ts +0 -15
- package/dist/src/apis/WMS/Controllers/VarConfigDescriptionController/List.d.ts +0 -37
- package/dist/src/apis/WMS/Controllers/VarConfigDescriptionController/QueryById.d.ts +0 -19
- package/dist/src/components/KgVarConfig/components/var/KgVarConfig.Modal.Var.CreateModal.d.ts +0 -32
- /package/dist/src/components/KgTable/components/setting/config/{KgTable.Setting.ConfigModal.VarGridMaster.hooks.d.ts → KgTable.Setting.ConfigModal.VarGridMaster.service.d.ts} +0 -0
- /package/dist/src/components/KgVarConfig/components/var/{KgVarConfig.Modal.Var.Vars.d.ts → KgVarConfig.Modal.Var.VarConfigControl.d.ts} +0 -0
@@ -1,8 +1,8 @@
|
|
1
1
|
import { FormInstance } from 'ant-design-vue';
|
2
2
|
import { ComputedRef, Ref } from 'vue';
|
3
3
|
import { VarSubmitConfig, VarSubmitDetail } from '../../apis/WMS/models';
|
4
|
-
import { IKgVarSubmitConfigProperties, IRemoveEventListenerHandler, KG__VAR_SUBMIT_CONFIG__DISPLAY_TYPE, KG_BUTTON_TYPE } from '../../consts';
|
5
|
-
import {
|
4
|
+
import { IKgVarSubmitConfigProperties, IRemoveEventListenerHandler, KG__VAR_SUBMIT_CONFIG__DISPLAY_TYPE, KG__VAR_SUBMIT_CONFIG__LAYOUT, KG_BUTTON_TYPE, KG_WIDTH_UNIT } from '../../consts';
|
5
|
+
import { IKgSubmitAfterValidateEventListener, IKgSubmitBeforeOkEventListener, IKgSubmitBeforeOpenEventListener, IKgSubmitBeforeRequestEventListener, IKgSubmitCloseEventListener, IKgSubmitErrorEventListener, IKgSubmitOkEventListener, IKgSubmitOpenEventListener, IKgSubmitStore } from './index.store';
|
6
6
|
export interface IUseKgSubmit {
|
7
7
|
/**
|
8
8
|
* <p>「当前按钮」的「提交表单配置」.</p>
|
@@ -11,11 +11,15 @@ export interface IUseKgSubmit {
|
|
11
11
|
/**
|
12
12
|
* <p>「当前按钮」的「提交表单配置」的显示方式.</p>
|
13
13
|
*/
|
14
|
-
|
14
|
+
currentVarSubmitConfig$DisplayType: ComputedRef<KG__VAR_SUBMIT_CONFIG__DISPLAY_TYPE>;
|
15
|
+
/**
|
16
|
+
* <p>「当前按钮」的「提交表单配置」的布局.</p>
|
17
|
+
*/
|
18
|
+
currentVarSubmitConfig$Layout: ComputedRef<KG__VAR_SUBMIT_CONFIG__LAYOUT>;
|
15
19
|
/**
|
16
20
|
* <p>「当前按钮」的「提交表单配置」的配置属性.</p>
|
17
21
|
*/
|
18
|
-
|
22
|
+
currentVarSubmitConfig$Props: ComputedRef<IKgVarSubmitConfigProperties>;
|
19
23
|
/**
|
20
24
|
* <p>「当前按钮」的「提交表单字段」的所属分组(可见的).</p>
|
21
25
|
*/
|
@@ -48,10 +52,18 @@ export interface IUseKgSubmit {
|
|
48
52
|
* 界面标识.
|
49
53
|
*/
|
50
54
|
formID: string;
|
55
|
+
/**
|
56
|
+
* 表单数据对象.
|
57
|
+
*/
|
58
|
+
formModel: ComputedRef<Record<string, any>>;
|
51
59
|
/**
|
52
60
|
* 表单组件.
|
53
61
|
*/
|
54
62
|
formRef: Ref<FormInstance | null>;
|
63
|
+
/**
|
64
|
+
* 表单验证规则.
|
65
|
+
*/
|
66
|
+
formRules: ReturnType<IKgSubmitStore['getFormRules']>;
|
55
67
|
/**
|
56
68
|
* <p>获取「提交表单配置」, 根据所传参数进行过滤.</p>
|
57
69
|
*
|
@@ -108,6 +120,8 @@ export interface IUseKgSubmit {
|
|
108
120
|
} | null): Array<VarSubmitDetail>;
|
109
121
|
/**
|
110
122
|
* 表单数据对象.
|
123
|
+
*
|
124
|
+
* @deprecated 请使用 {@link formModel}
|
111
125
|
*/
|
112
126
|
model: ComputedRef<Record<string, any>>;
|
113
127
|
/**
|
@@ -118,7 +132,7 @@ export interface IUseKgSubmit {
|
|
118
132
|
* @param once 是否只会触发一次. 默认为 undefined.
|
119
133
|
* @return {} 移除事件监听函数.
|
120
134
|
*/
|
121
|
-
onAfterValidate(cb:
|
135
|
+
onAfterValidate(cb: IKgSubmitAfterValidateEventListener, once?: boolean): IRemoveEventListenerHandler;
|
122
136
|
/**
|
123
137
|
* <p>事件: 点击确认按钮之后, 执行默认逻辑之前.</p>
|
124
138
|
* <ul>
|
@@ -131,14 +145,14 @@ export interface IUseKgSubmit {
|
|
131
145
|
* @param once 是否只会触发一次. 默认为 undefined.
|
132
146
|
* @return {} 移除事件监听函数.
|
133
147
|
*/
|
134
|
-
onBeforeOk(cb:
|
148
|
+
onBeforeOk(cb: IKgSubmitBeforeOkEventListener, once?: boolean): IRemoveEventListenerHandler;
|
135
149
|
/**
|
136
150
|
* <p>事件: 打开提交弹窗之前.</p>
|
137
151
|
* @param cb 回调函数.
|
138
152
|
* @param once 是否只会触发一次. 默认为 undefined.
|
139
153
|
* @return {} 移除事件监听函数.
|
140
154
|
*/
|
141
|
-
onBeforeOpen(cb:
|
155
|
+
onBeforeOpen(cb: IKgSubmitBeforeOpenEventListener, once?: boolean): IRemoveEventListenerHandler;
|
142
156
|
/**
|
143
157
|
* <p>事件: 发起接口请求之前. 表单验证完成, 参数解析完成.</p>
|
144
158
|
* <p>回调函数如果返回 true, 则不会再执行后面的代码.</p>
|
@@ -147,7 +161,7 @@ export interface IUseKgSubmit {
|
|
147
161
|
* @param once 是否只会触发一次. 默认为 undefined.
|
148
162
|
* @return {} 移除事件监听函数.
|
149
163
|
*/
|
150
|
-
onBeforeRequest(cb:
|
164
|
+
onBeforeRequest(cb: IKgSubmitBeforeRequestEventListener, once?: boolean): IRemoveEventListenerHandler;
|
151
165
|
/**
|
152
166
|
* <p>事件: 关闭提交弹窗. 下面几种场景都会触发此事件:</p>
|
153
167
|
* <ul>
|
@@ -159,30 +173,31 @@ export interface IUseKgSubmit {
|
|
159
173
|
* @param once 是否只会触发一次. 默认为 undefined.
|
160
174
|
* @return {} 移除事件监听函数.
|
161
175
|
*/
|
162
|
-
onClose(cb:
|
176
|
+
onClose(cb: IKgSubmitCloseEventListener, once?: boolean): IRemoveEventListenerHandler;
|
163
177
|
/**
|
164
178
|
* <p>事件: 请求失败. 请求失败了, 或者请求返回了错误消息.</p>
|
165
179
|
* @param cb 回调函数.
|
166
180
|
* @param once 是否只会触发一次. 默认为 undefined.
|
167
181
|
* @return {} 移除事件监听函数.
|
168
182
|
*/
|
169
|
-
onError(cb:
|
183
|
+
onError(cb: IKgSubmitErrorEventListener, once?: boolean): IRemoveEventListenerHandler;
|
170
184
|
/**
|
171
|
-
* <p>事件: 点击保存按钮之后, 执行默认逻辑之后, 调用接口成功,
|
185
|
+
* <p>事件: 点击保存按钮之后, 执行默认逻辑之后, 调用接口成功, 关闭提交弹窗之后.</p>
|
172
186
|
* @param cb 回调函数.
|
173
187
|
* @param once 是否只会触发一次. 默认为 undefined.
|
174
188
|
* @return {} 移除事件监听函数.
|
175
189
|
*/
|
176
|
-
onOk(cb:
|
190
|
+
onOk(cb: IKgSubmitOkEventListener, once?: boolean): IRemoveEventListenerHandler;
|
177
191
|
/**
|
178
192
|
* <p>事件: 打开提交弹窗.</p>
|
179
193
|
* @param cb 回调函数.
|
180
194
|
* @param once 是否只会触发一次. 默认为 undefined.
|
181
195
|
* @return {} 移除事件监听函数.
|
182
196
|
*/
|
183
|
-
onOpen(cb:
|
197
|
+
onOpen(cb: IKgSubmitOpenEventListener, once?: boolean): IRemoveEventListenerHandler;
|
184
198
|
/**
|
185
|
-
*
|
199
|
+
* <p>修改某个「提交表单字段」的部分属性.</p>
|
200
|
+
* <p>如果参数 param.buttonType 和 param.buttonVarName 都为 undefined, 表示修改的是「当前按钮」的「提交表单字段」</p>
|
186
201
|
*
|
187
202
|
* @param param.buttonType <p>按钮的类型, 对应的是 {@link VarButton.typ} 属性, 取值请参考 {@link KG_BUTTON_TYPE}.</p>
|
188
203
|
* @param param.buttonVarName <p>按钮的变量名称, 对应的是 {@link VarButton.var_nam} 属性.</p>
|
@@ -197,8 +212,26 @@ export interface IUseKgSubmit {
|
|
197
212
|
}): void;
|
198
213
|
/**
|
199
214
|
* 表单验证规则.
|
215
|
+
*
|
216
|
+
* @deprecated 请使用 {@link formRules}.
|
217
|
+
*/
|
218
|
+
rules: ReturnType<IKgSubmitStore['getFormRules']>;
|
219
|
+
/**
|
220
|
+
* <p>「查询按钮」的「提交表单配置」.</p>
|
221
|
+
*/
|
222
|
+
searchVarSubmitConfig: ComputedRef<VarSubmitConfig | null>;
|
223
|
+
/**
|
224
|
+
* <p>「查询按钮」的「提交表单配置」的文本宽度.</p>
|
225
|
+
*/
|
226
|
+
searchVarSubmitConfig$LabelColumn: ComputedRef<number>;
|
227
|
+
/**
|
228
|
+
* <p>「查询按钮」的「提交表单配置」的文本宽度单位.</p>
|
229
|
+
*/
|
230
|
+
searchVarSubmitConfig$LabelColumnUnit: ComputedRef<KG_WIDTH_UNIT>;
|
231
|
+
/**
|
232
|
+
* <p>「查询按钮」的「提交表单配置」的布局.</p>
|
200
233
|
*/
|
201
|
-
|
234
|
+
searchVarSubmitConfig$Layout: ComputedRef<KG__VAR_SUBMIT_CONFIG__LAYOUT>;
|
202
235
|
/**
|
203
236
|
* 状态数据.
|
204
237
|
*/
|
@@ -3,7 +3,7 @@ import { FormInstance } from 'ant-design-vue/lib/form/Form';
|
|
3
3
|
import { StoreDefinition } from 'pinia';
|
4
4
|
import { Ref } from 'vue';
|
5
5
|
import { VarSubmitConfig, VarSubmitDetail } from '../../apis/WMS/models';
|
6
|
-
import {
|
6
|
+
import { IKgEventListener, KG_BUTTON_TYPE } from '../../consts';
|
7
7
|
import { KgAny } from '../../types';
|
8
8
|
import { IKgTableRow } from '../KgTable';
|
9
9
|
/**
|
@@ -13,33 +13,35 @@ import { IKgTableRow } from '../KgTable';
|
|
13
13
|
* 'beforeOk': 点击确认按钮之后, 执行默认逻辑之前
|
14
14
|
* 'afterValidate': 点击确认按钮之后, 表单验证完成,
|
15
15
|
* 'beforeRequest': 发起接口请求之前. 表单验证完成, 参数解析完成,
|
16
|
-
* 'ok': 请求成功,
|
16
|
+
* 'ok': 请求成功, 关闭提交弹窗之后
|
17
17
|
* 'error': 请求失败. 请求失败了, 或者请求返回了错误消息
|
18
18
|
* 'close': 关闭提交弹窗
|
19
19
|
*/
|
20
20
|
export declare type IKgSubmitEvent = 'beforeOpen' | 'open' | 'beforeOk' | 'afterValidate' | 'beforeRequest' | 'ok' | 'error' | 'close';
|
21
|
-
|
22
|
-
export declare type IKgSubmitBeforeOpenCbParam = {
|
21
|
+
export declare type IKgSubmitBeforeOpenEventListenerParameter = {
|
23
22
|
isCreating: boolean | null;
|
24
23
|
isUpdating: boolean | null;
|
25
24
|
isCopying: boolean | null;
|
26
25
|
isDeleting: boolean | null;
|
27
26
|
row: IKgTableRow | null;
|
28
27
|
};
|
29
|
-
export declare type
|
30
|
-
|
31
|
-
|
28
|
+
export declare type IKgSubmitBeforeOpenEventListener = ((param: IKgSubmitBeforeOpenEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
29
|
+
export declare type IKgSubmitOpenEventListenerParameter = {
|
30
|
+
/** @deprecated 请直接使用 {@link IUseKgVar.isCreating} */
|
32
31
|
isCreating: boolean | null;
|
32
|
+
/** @deprecated 请直接使用 {@link IUseKgVar.isUpdating} */
|
33
33
|
isUpdating: boolean | null;
|
34
|
+
/** @deprecated 请直接使用 {@link IUseKgVar.isCopying} */
|
34
35
|
isCopying: boolean | null;
|
36
|
+
/** @deprecated 请直接使用 {@link IUseKgVar.isDeleting} */
|
35
37
|
isDeleting: boolean | null;
|
36
|
-
/**
|
38
|
+
/** @deprecated 请直接使用 {@link IUseKgTable.selectedRow} */
|
37
39
|
row: IKgTableRow | null;
|
40
|
+
/** @deprecated 请直接使用 {@link IUseKgSearch.formModel} */
|
38
41
|
model: Ref<Record<string, any>>;
|
39
42
|
};
|
40
|
-
export declare type
|
41
|
-
|
42
|
-
export declare type IKgSubmitBeforeOkCbParam = {
|
43
|
+
export declare type IKgSubmitOpenEventListener = ((param: IKgSubmitOpenEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
44
|
+
export declare type IKgSubmitBeforeOkEventListenerParameter = {
|
43
45
|
isCopying: boolean | null;
|
44
46
|
isCreating: boolean | null;
|
45
47
|
isDeleting: boolean | null;
|
@@ -57,9 +59,8 @@ export declare type IKgSubmitBeforeOkCbParam = {
|
|
57
59
|
*/
|
58
60
|
rules: Ref<Record<string, RuleObject[]>>;
|
59
61
|
};
|
60
|
-
export declare type
|
61
|
-
|
62
|
-
export declare type IKgSubmitAfterValidateCbParam = {
|
62
|
+
export declare type IKgSubmitBeforeOkEventListener = ((param: IKgSubmitBeforeOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
63
|
+
export declare type IKgSubmitAfterValidateEventListenerParameter = {
|
63
64
|
isCopying: boolean | null;
|
64
65
|
isCreating: boolean | null;
|
65
66
|
isDeleting: boolean | null;
|
@@ -68,9 +69,8 @@ export declare type IKgSubmitAfterValidateCbParam = {
|
|
68
69
|
row: IKgTableRow | null;
|
69
70
|
rows: Array<IKgTableRow> | null;
|
70
71
|
};
|
71
|
-
export declare type
|
72
|
-
|
73
|
-
export declare type IKgSubmitBeforeRequestCbParam = {
|
72
|
+
export declare type IKgSubmitAfterValidateEventListener = ((param: IKgSubmitAfterValidateEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
73
|
+
export declare type IKgSubmitBeforeRequestEventListenerParameter = {
|
74
74
|
/**
|
75
75
|
* <p>请求参数.</p>
|
76
76
|
* <p>是一个对象或者列表.</p>
|
@@ -91,9 +91,8 @@ export declare type IKgSubmitBeforeRequestCbParam = {
|
|
91
91
|
row: IKgTableRow | null;
|
92
92
|
rows: Array<IKgTableRow> | null;
|
93
93
|
};
|
94
|
-
export declare type
|
95
|
-
|
96
|
-
export declare type IKgSubmitOkCbParam = {
|
94
|
+
export declare type IKgSubmitBeforeRequestEventListener = ((param: IKgSubmitBeforeRequestEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
95
|
+
export declare type IKgSubmitOkEventListenerParameter = {
|
97
96
|
isCreating: boolean | null;
|
98
97
|
isUpdating: boolean | null;
|
99
98
|
isCopying: boolean | null;
|
@@ -103,37 +102,37 @@ export declare type IKgSubmitOkCbParam = {
|
|
103
102
|
/** 接口返回结果. */
|
104
103
|
result: any | null;
|
105
104
|
};
|
106
|
-
export declare type
|
107
|
-
|
108
|
-
export declare type
|
109
|
-
|
110
|
-
export declare type
|
111
|
-
export declare type
|
112
|
-
export declare type
|
105
|
+
export declare type IKgSubmitOkEventListener = ((param: IKgSubmitOkEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
106
|
+
export declare type IKgSubmitErrorEventListenerParameter = {};
|
107
|
+
export declare type IKgSubmitErrorEventListener = ((param: IKgSubmitErrorEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
108
|
+
export declare type IKgSubmitCloseEventListenerParameter = {} | null | undefined;
|
109
|
+
export declare type IKgSubmitCloseEventListener = ((param: IKgSubmitCloseEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
110
|
+
export declare type IKgSubmitEventListenerParameter = IKgSubmitBeforeOpenEventListenerParameter | IKgSubmitOpenEventListenerParameter | IKgSubmitBeforeOkEventListenerParameter | IKgSubmitAfterValidateEventListenerParameter | IKgSubmitBeforeRequestEventListenerParameter | IKgSubmitOkEventListenerParameter | IKgSubmitErrorEventListenerParameter | IKgSubmitCloseEventListenerParameter;
|
111
|
+
export declare type IKgSubmitEventListener = IKgSubmitBeforeOpenEventListener | IKgSubmitOpenEventListener | IKgSubmitBeforeOkEventListener | IKgSubmitAfterValidateEventListener | IKgSubmitBeforeRequestEventListener | IKgSubmitOkEventListener | IKgSubmitErrorEventListener | IKgSubmitCloseEventListener;
|
113
112
|
export interface IUseKgSubmitStoreState {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
113
|
+
afterValidateEventListenersMap: Map<string, Array<IKgSubmitAfterValidateEventListener>>;
|
114
|
+
beforeOkEventListenersMap: Map<string, Array<IKgSubmitBeforeOkEventListener>>;
|
115
|
+
beforeOpenEventListenersMap: Map<string, Array<IKgSubmitBeforeOpenEventListener>>;
|
116
|
+
beforeRequestEventListenersMap: Map<string, Array<IKgSubmitBeforeRequestEventListener>>;
|
117
|
+
closeEventListenersMap: Map<string, Array<IKgSubmitCloseEventListener>>;
|
118
|
+
errorEventListenersMap: Map<string, Array<IKgSubmitErrorEventListener>>;
|
119
|
+
/** 表单数据对象. */
|
120
|
+
formModelMap: Map<string, Record<string, any>>;
|
120
121
|
/** 表单对象. */
|
121
122
|
formRefMap: Map<string, Ref<FormInstance | null>>;
|
122
|
-
isLoadingMap: Map<string, boolean>;
|
123
|
-
/** 表单数据对象. */
|
124
|
-
modelMap: Map<string, Record<string, any>>;
|
125
|
-
okListenersMap: Map<string, Array<IKgSubmitOkCb>>;
|
126
|
-
openListenersMap: Map<string, Array<IKgSubmitOpenCb>>;
|
127
123
|
/**
|
128
124
|
* <p>表单验证规则.</p>
|
129
125
|
* <p>在 beforeOk 事件中会将此对象传给调用者, 调用者可以修改此对象, 从而添加自定义的验证规则.</p>
|
130
126
|
*/
|
131
|
-
|
127
|
+
formRulesMap: Map<string, Ref<Record<string, Array<RuleObject>>>>;
|
128
|
+
isLoadingMap: Map<string, boolean>;
|
129
|
+
okEventListenersMap: Map<string, Array<IKgSubmitOkEventListener>>;
|
130
|
+
openEventListenersMap: Map<string, Array<IKgSubmitOpenEventListener>>;
|
132
131
|
}
|
133
132
|
export interface IUseKgSubmitStoreGetters {
|
133
|
+
getFormModel(): (formID?: string | null) => Record<string, any> | null;
|
134
134
|
getFormRef(): (formID?: string | null) => Ref<FormInstance | null>;
|
135
|
-
|
136
|
-
getRules(): (formID?: string | null) => Ref<Record<string, Array<RuleObject>>>;
|
135
|
+
getFormRules(): (formID?: string | null) => Ref<Record<string, Array<RuleObject>>>;
|
137
136
|
getVarSubmitConfig(): (formID: string | null | undefined, param?: {
|
138
137
|
buttonType?: KG_BUTTON_TYPE;
|
139
138
|
buttonVarName?: string | null;
|
@@ -155,13 +154,13 @@ export interface IUseKgSubmitStoreActions {
|
|
155
154
|
* @param event 事件名称.
|
156
155
|
* @param cb 回调函数.
|
157
156
|
*/
|
158
|
-
addEventListener(formID: string, event: IKgSubmitEvent, cb:
|
157
|
+
addEventListener(formID: string, event: IKgSubmitEvent, cb: IKgSubmitEventListener): void;
|
159
158
|
/**
|
160
159
|
* 清理数据.
|
161
160
|
* @param formID 页面标识.
|
162
161
|
*/
|
163
162
|
dispose(formID?: string | null): void;
|
164
|
-
emit(formID: string, event: IKgSubmitEvent, param:
|
163
|
+
emit<T = IKgSubmitEventListenerParameter>(formID: string, event: IKgSubmitEvent, param: T): Promise<boolean>;
|
165
164
|
patchVarSubmitDetail(formID: string | null | undefined, param: {
|
166
165
|
buttonType?: KG_BUTTON_TYPE;
|
167
166
|
buttonVarName?: string | null;
|
@@ -174,9 +173,9 @@ export interface IUseKgSubmitStoreActions {
|
|
174
173
|
* @param event 事件名称.
|
175
174
|
* @param cb 回调函数.
|
176
175
|
*/
|
177
|
-
removeEventListener(formID: string, event: IKgSubmitEvent, cb?:
|
176
|
+
removeEventListener(formID: string, event: IKgSubmitEvent, cb?: IKgSubmitEventListener): void;
|
177
|
+
setFormModel(formID?: string | null, model?: Record<string, any> | null): void;
|
178
178
|
setIsLoading(formID: string, value: boolean): void;
|
179
|
-
setModel(formID?: string | null, model?: Record<string, any> | null): void;
|
180
179
|
}
|
181
180
|
export declare type IUseKgSubmitStore = StoreDefinition<'KgSubmit', IUseKgSubmitStoreState, IUseKgSubmitStoreGetters, IUseKgSubmitStoreActions>;
|
182
181
|
export declare type IKgSubmitStore = ReturnType<IUseKgSubmitStore>;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { KG__VAR_SUBMIT_CONFIG__LAYOUT } from '../../consts';
|
1
2
|
/**
|
2
3
|
* 表单的左边距.
|
3
4
|
*/
|
@@ -45,7 +46,7 @@ export declare const SUBMIT_DEFAULT_WIDTH: number;
|
|
45
46
|
/**
|
46
47
|
* 默认布局方式.
|
47
48
|
*/
|
48
|
-
export declare const SUBMIT_DEFAULT_LAYOUT =
|
49
|
+
export declare const SUBMIT_DEFAULT_LAYOUT = KG__VAR_SUBMIT_CONFIG__LAYOUT.VERTICAL;
|
49
50
|
/**
|
50
51
|
* 单位为 SPAN 时, 文本的默认宽度.
|
51
52
|
*/
|
@@ -11,4 +11,4 @@ export declare type IUseServices = {
|
|
11
11
|
};
|
12
12
|
export declare function _useServices(): IUseServices;
|
13
13
|
/** 监控表格列的下拉列表的尺寸变化, 从而调整位置, 防止遮盖. */
|
14
|
-
export declare function
|
14
|
+
export declare function _useObserveMenuItemColumns(isMenuItemColumnsVisible: Ref<boolean>): void;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { ComputedRef } from 'vue';
|
2
|
+
import { VarGridConfig } from '../../apis/WMS/models';
|
2
3
|
import { IRemoveEventListenerHandler } from '../../consts';
|
3
|
-
import {
|
4
|
+
import { IKgTableAfterRequestEventListener, IKgTableBeforeParseParameterEventListener, IKgTableBeforeRequestEventListener, IKgTableBeforeSetDatasEventListener, IKgTableReadyEventListener, IKgTableRowDoubleClickEventListener, IKgTableStore } from './index.store';
|
4
5
|
export interface IUseKgTable {
|
5
6
|
/** 界面标识. */
|
6
7
|
formID: string;
|
@@ -37,49 +38,63 @@ export interface IUseKgTable {
|
|
37
38
|
* @param cb 回调函数.
|
38
39
|
* @param once 是否只会触发一次. 默认为 undefined.
|
39
40
|
*/
|
40
|
-
onAfterSearch(cb:
|
41
|
+
onAfterSearch(cb: IKgTableAfterRequestEventListener, once?: boolean): IRemoveEventListenerHandler;
|
42
|
+
/**
|
43
|
+
* 事件: 即将解析请求参数.
|
44
|
+
* @param cb 回调函数.
|
45
|
+
* @param once 是否只会触发一次. 默认为 undefined.
|
46
|
+
*/
|
47
|
+
onBeforeParseParameter(cb: IKgTableBeforeParseParameterEventListener, once?: boolean): IRemoveEventListenerHandler;
|
41
48
|
/**
|
42
49
|
* 事件: 即将发起查询请求, 如果返回 true 表示不会发起请求.
|
43
50
|
* @param cb 回调函数.
|
44
51
|
* @param once 是否只会触发一次. 默认为 undefined.
|
45
52
|
* @deprecated 已废弃, 请使用 onBeforeSearch() 方法.
|
46
53
|
*/
|
47
|
-
onBeforeRetrieve(cb:
|
54
|
+
onBeforeRetrieve(cb: IKgTableBeforeRequestEventListener, once?: boolean): IRemoveEventListenerHandler;
|
48
55
|
/**
|
49
56
|
* 事件: 即将发起查询请求, 如果返回 true 表示不会发起请求.
|
50
57
|
* @param cb 回调函数.
|
51
58
|
* @param once 是否只会触发一次. 默认为 undefined.
|
52
59
|
*/
|
53
|
-
onBeforeSearch(cb:
|
60
|
+
onBeforeSearch(cb: IKgTableBeforeRequestEventListener, once?: boolean): IRemoveEventListenerHandler;
|
54
61
|
/**
|
55
62
|
* 事件: 查询请求成功, 表格数据尚未赋值. 此处可以对查询接口返回的列表数据作处理.
|
56
63
|
* @param cb 回调函数.
|
57
64
|
* @param once 是否只会触发一次. 默认为 undefined.
|
58
65
|
*/
|
59
|
-
onBeforeSetDatas(cb:
|
66
|
+
onBeforeSetDatas(cb: IKgTableBeforeSetDatasEventListener, once?: boolean): IRemoveEventListenerHandler;
|
60
67
|
/**
|
61
68
|
* 事件: ready, 配置初始完成, 组件渲染完成.
|
62
69
|
* @param cb 回调函数.
|
63
70
|
* @param once 是否只会触发一次. 默认为 undefined.
|
64
71
|
*/
|
65
|
-
onReady(cb:
|
72
|
+
onReady(cb: IKgTableReadyEventListener, once?: boolean): IRemoveEventListenerHandler;
|
66
73
|
/**
|
67
74
|
* 事件: 查询请求成功, 表格数据已经赋值, 表格状态已经更新.
|
68
75
|
* @param cb 回调函数.
|
69
76
|
* @param once 是否只会触发一次. 默认为 undefined.
|
70
77
|
* @deprecated 已废弃, 请使用 onAfterSearch() 方法.
|
71
78
|
*/
|
72
|
-
onRetrieve(cb:
|
79
|
+
onRetrieve(cb: IKgTableAfterRequestEventListener, once?: boolean): IRemoveEventListenerHandler;
|
73
80
|
/**
|
74
81
|
* 事件: 双击某行.
|
75
82
|
* @param cb 回调函数.
|
76
83
|
* @param once 是否只会触发一次. 默认为 undefined.
|
77
84
|
*/
|
78
|
-
onRowDoubleClick(cb:
|
85
|
+
onRowDoubleClick(cb: IKgTableRowDoubleClickEventListener, once?: boolean): IRemoveEventListenerHandler;
|
79
86
|
/** 当前分页选项. */
|
80
87
|
pageSizeOption: ComputedRef<number>;
|
81
88
|
/** 所有分页选项. */
|
82
89
|
pageSizeOptions: ComputedRef<number[]>;
|
90
|
+
/**
|
91
|
+
* 修改「表格配置」的部分属性.
|
92
|
+
*
|
93
|
+
* @param param.properties 要修改的部分属性.
|
94
|
+
*/
|
95
|
+
patchVarGridConfig(param: {
|
96
|
+
properties: VarGridConfig;
|
97
|
+
}): Promise<void>;
|
83
98
|
/**
|
84
99
|
* <p>查询参数.</p>
|
85
100
|
* <p>此查询参数是最终传给后端接口的参数, 包含了查询条件, 还包含了表格中的排序和分页, 还包含了表格配置中的参数.</p>
|
@@ -1,43 +1,46 @@
|
|
1
1
|
import { Key } from 'ant-design-vue/lib/_util/type';
|
2
2
|
import { StoreDefinition } from 'pinia';
|
3
3
|
import { Ref } from 'vue';
|
4
|
-
import { IPage } from '../../apis/WMS/models';
|
5
|
-
import {
|
4
|
+
import { IPage, VarGridConfig } from '../../apis/WMS/models';
|
5
|
+
import { IKgEventListener } from '../../consts';
|
6
6
|
import { IKgTableRow, IKgTableRowHeight } from './index.vm';
|
7
7
|
/**
|
8
8
|
* 事件类型.
|
9
|
-
* 'ready':
|
10
|
-
* 'rowDoubleClick':
|
11
|
-
* '
|
12
|
-
* '
|
13
|
-
* '
|
9
|
+
* 'ready': 就绪, 配置初始完成, 组件渲染完成
|
10
|
+
* 'rowDoubleClick': 双击某行
|
11
|
+
* 'beforeParseParameter': 即将解析请求参数,
|
12
|
+
* 'beforeSearch': 即将发起查询请求, 如果返回 true 表示不会发起请求
|
13
|
+
* 'beforeSetDatas': 查询请求成功, 表格数据尚未赋值. 此处可以对查询接口返回的列表数据作处理
|
14
|
+
* 'afterSearch': 查询请求成功, 表格数据已经赋值, 表格状态已经更新
|
14
15
|
*/
|
15
|
-
export declare type IKgTableEvent = 'ready' | 'rowDoubleClick' | 'beforeSearch' | 'beforeSetDatas' | 'afterSearch';
|
16
|
-
|
17
|
-
export declare type
|
18
|
-
export declare type
|
19
|
-
/** 事件监听函数: rowDoubleClick. */
|
20
|
-
export declare type IKgTableRowDoubleClickParam = {
|
16
|
+
export declare type IKgTableEvent = 'ready' | 'rowDoubleClick' | 'beforeParseParameter' | 'beforeSearch' | 'beforeSetDatas' | 'afterSearch';
|
17
|
+
export declare type IKgTableReadyEventListenerParameter = {};
|
18
|
+
export declare type IKgTableReadyEventListener = ((param: IKgTableReadyEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
19
|
+
export declare type IKgTableRowDoubleClickEventListenerParameter = {
|
21
20
|
/** 双击的行. */
|
22
21
|
row: IKgTableRow;
|
23
22
|
};
|
24
|
-
export declare type
|
25
|
-
|
26
|
-
|
23
|
+
export declare type IKgTableRowDoubleClickEventListener = ((param: IKgTableRowDoubleClickEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
24
|
+
export declare type IKgTableBeforeParseParameterEventListenerParameter = {
|
25
|
+
/**
|
26
|
+
* 查询接口请求参数, 尚未解析.
|
27
|
+
*/
|
28
|
+
params: Record<string, any>;
|
29
|
+
};
|
30
|
+
export declare type IKgTableBeforeParseParameterEventListener = ((param: IKgTableBeforeParseParameterEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
31
|
+
export declare type IKgTableBeforeRequestEventListenerParameter = {
|
27
32
|
/** 查询接口请求参数. */
|
28
33
|
params: Record<string, any>;
|
29
34
|
/** 查询接口返回的数据, 调用者可以直接修改该数据, 从而实现手动提供表格数据. */
|
30
35
|
response: Ref;
|
31
36
|
};
|
32
|
-
export declare type
|
33
|
-
|
34
|
-
export declare type IKgTableBeforeSetDatasCbParam = {
|
37
|
+
export declare type IKgTableBeforeRequestEventListener = ((param: IKgTableBeforeRequestEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
38
|
+
export declare type IKgTableBeforeSetDatasEventListenerParameter = {
|
35
39
|
/** 列表数据. */
|
36
40
|
datas: Ref<Array<IKgTableRow>>;
|
37
41
|
};
|
38
|
-
export declare type
|
39
|
-
|
40
|
-
export declare type IKgTableAfterRequestCbParam = {
|
42
|
+
export declare type IKgTableBeforeSetDatasEventListener = ((param: IKgTableBeforeSetDatasEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
43
|
+
export declare type IKgTableAfterRequestEventListenerParameter = {
|
41
44
|
/** 查询接口请求参数. */
|
42
45
|
params: Record<string, any>;
|
43
46
|
/** 接口返回的分页数据. */
|
@@ -45,13 +48,14 @@ export declare type IKgTableAfterRequestCbParam = {
|
|
45
48
|
/** 列表数据. */
|
46
49
|
datas: Ref<Array<IKgTableRow>>;
|
47
50
|
};
|
48
|
-
export declare type
|
49
|
-
export declare type
|
50
|
-
export declare type
|
51
|
+
export declare type IKgTableAfterRequestEventListener = ((param: IKgTableAfterRequestEventListenerParameter) => Promise<boolean>) & IKgEventListener;
|
52
|
+
export declare type IKgTableEventListenerParameter = IKgTableReadyEventListenerParameter | IKgTableRowDoubleClickEventListenerParameter | IKgTableBeforeParseParameterEventListenerParameter | IKgTableBeforeRequestEventListenerParameter | IKgTableBeforeSetDatasEventListenerParameter | IKgTableAfterRequestEventListenerParameter;
|
53
|
+
export declare type IKgTableEventListener = IKgTableReadyEventListener | IKgTableRowDoubleClickEventListener | IKgTableBeforeParseParameterEventListener | IKgTableBeforeRequestEventListener | IKgTableBeforeSetDatasEventListener | IKgTableAfterRequestEventListener;
|
51
54
|
export interface IUseKgTableStoreState {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
+
afterRequestEventListenersMap: Map<string, Array<IKgTableAfterRequestEventListener>>;
|
56
|
+
beforeParseParameterEventListenersMap: Map<string, Array<IKgTableBeforeParseParameterEventListener>>;
|
57
|
+
beforeRequestEventListenersMap: Map<string, Array<IKgTableBeforeRequestEventListener>>;
|
58
|
+
beforeSetDatasEventListenersMap: Map<string, Array<IKgTableBeforeSetDatasEventListener>>;
|
55
59
|
/** 列表数据. */
|
56
60
|
datasMap: Map<String, Array<any>>;
|
57
61
|
/** 是否就绪: 配置初始完成, 组件渲染完成. */
|
@@ -72,20 +76,20 @@ export interface IUseKgTableStoreState {
|
|
72
76
|
* <li>是: 所有描述列显示的是描述,</li>
|
73
77
|
* <li>否: 所有描述列显示的是原始的值,</li>
|
74
78
|
* </ul>
|
75
|
-
* <p>描述列指的是显示类型为
|
79
|
+
* <p>描述列指的是显示类型为 KG_TABLE_CELL_DISPLAY_TYPE.DESC 的列.</p>
|
76
80
|
*
|
77
81
|
* @default true
|
78
82
|
*/
|
79
83
|
isShowDescriptionMap: Map<string, boolean>;
|
80
84
|
/** 事件监听函数列表: ready. */
|
81
|
-
|
85
|
+
onReadyEventListenersMap: Map<string, Array<IKgTableReadyEventListener>>;
|
82
86
|
/**
|
83
87
|
* <p>查询参数.</p>
|
84
88
|
* <p>此查询参数是最终传给后端接口的参数, 包含了查询条件, 还包含了表格中的排序和分页, 还包含了表格配置中的参数.</p>
|
85
89
|
*/
|
86
90
|
requestParamsMap: Map<string, Record<string, any>>;
|
87
91
|
/** '双击某行'事件监听函数列表. */
|
88
|
-
|
92
|
+
rowDoubleClickEventListenersMap: Map<string, Array<IKgTableRowDoubleClickEventListener>>;
|
89
93
|
/** 行高. */
|
90
94
|
rowHeightMap: Map<string, IKgTableRowHeight>;
|
91
95
|
/** 勾选的行的主键. */
|
@@ -134,7 +138,17 @@ export interface IUseKgTableStoreActions {
|
|
134
138
|
* @param event 事件名称.
|
135
139
|
* @param cb 回调函数.
|
136
140
|
*/
|
137
|
-
addEventListener(formID: string | null | undefined, event: IKgTableEvent, cb:
|
141
|
+
addEventListener(formID: string | null | undefined, event: IKgTableEvent, cb: IKgTableEventListener): void;
|
142
|
+
/**
|
143
|
+
* 修改「表格配置」的部分属性.
|
144
|
+
*
|
145
|
+
* @param formID 界面标识.
|
146
|
+
* @param param 其他参数.
|
147
|
+
* @param param.properties 要修改的部分属性.
|
148
|
+
*/
|
149
|
+
patchVarGridConfig(formID: string, param: {
|
150
|
+
properties: VarGridConfig;
|
151
|
+
}): Promise<void>;
|
138
152
|
/**
|
139
153
|
* 清空表格数据.
|
140
154
|
* @param formID 界面标识.
|
@@ -151,7 +165,7 @@ export interface IUseKgTableStoreActions {
|
|
151
165
|
* @param event 事件名称.
|
152
166
|
* @param param 数据.
|
153
167
|
*/
|
154
|
-
emit<T =
|
168
|
+
emit<T = IKgTableEventListenerParameter>(formID: string | null | undefined, event: IKgTableEvent, param: T): Promise<boolean>;
|
155
169
|
/**
|
156
170
|
* 刷新勾选的行. 表格列表数据变更之后, 需要同步到勾选的行.
|
157
171
|
* @param frmId 界面标识.
|
@@ -163,7 +177,7 @@ export interface IUseKgTableStoreActions {
|
|
163
177
|
* @param event 事件名称.
|
164
178
|
* @param cb 回调函数.
|
165
179
|
*/
|
166
|
-
removeEventListener(formID: string | null | undefined, event: IKgTableEvent, cb?:
|
180
|
+
removeEventListener(formID: string | null | undefined, event: IKgTableEvent, cb?: IKgTableEventListener): void;
|
167
181
|
/**
|
168
182
|
* 设置列表数据.
|
169
183
|
* @param param.frmId 界面标识.
|