cnhis-design-vue 3.1.15-beta.6 → 3.1.15-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/packages/form-render/index.d.ts +6 -6
- package/es/packages/form-render/src/FormRender.vue.d.ts +6 -6
- package/es/packages/form-render/src/components/renderer/date.d.ts +2 -2
- package/es/packages/form-render/src/components/renderer/select.js +1 -1
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +2 -2
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +3 -3
- package/es/packages/form-render/src/hooks/useFormContext.js +4 -4
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +4 -4
- package/es/packages/form-render/src/types/index.d.ts +2 -2
- package/es/packages/shortcut-setter/index.d.ts +6 -6
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +6 -6
- package/package.json +1 -1
|
@@ -112,8 +112,8 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
112
112
|
lifeCycle: {
|
|
113
113
|
type: import("vue").PropType<Partial<{
|
|
114
114
|
onSetup(): void;
|
|
115
|
-
beforeRequest(params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
116
|
-
afterRequest(payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
115
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
116
|
+
afterRequest(fieldKey: string, payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
117
117
|
}>>;
|
|
118
118
|
};
|
|
119
119
|
}, {
|
|
@@ -227,8 +227,8 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
227
227
|
lifeCycle: {
|
|
228
228
|
type: import("vue").PropType<Partial<{
|
|
229
229
|
onSetup(): void;
|
|
230
|
-
beforeRequest(params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
231
|
-
afterRequest(payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
230
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
231
|
+
afterRequest(fieldKey: string, payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
232
232
|
}>>;
|
|
233
233
|
};
|
|
234
234
|
}>> & {
|
|
@@ -1729,8 +1729,8 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1729
1729
|
lifeCycle: {
|
|
1730
1730
|
type: import("vue").PropType<Partial<{
|
|
1731
1731
|
onSetup(): void;
|
|
1732
|
-
beforeRequest(params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
1733
|
-
afterRequest(payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
1732
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
1733
|
+
afterRequest(fieldKey: string, payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
1734
1734
|
}>>;
|
|
1735
1735
|
};
|
|
1736
1736
|
}>> & {
|
|
@@ -112,8 +112,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
112
112
|
lifeCycle: {
|
|
113
113
|
type: PropType<Partial<{
|
|
114
114
|
onSetup(): void;
|
|
115
|
-
beforeRequest(params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
|
|
116
|
-
afterRequest(payload?: AnyObject[] | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject[]>;
|
|
115
|
+
beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
|
|
116
|
+
afterRequest(fieldKey: string, payload?: AnyObject[] | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject[]>;
|
|
117
117
|
}>>;
|
|
118
118
|
};
|
|
119
119
|
}, {
|
|
@@ -227,8 +227,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
227
227
|
lifeCycle: {
|
|
228
228
|
type: PropType<Partial<{
|
|
229
229
|
onSetup(): void;
|
|
230
|
-
beforeRequest(params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
|
|
231
|
-
afterRequest(payload?: AnyObject[] | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject[]>;
|
|
230
|
+
beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
|
|
231
|
+
afterRequest(fieldKey: string, payload?: AnyObject[] | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject[]>;
|
|
232
232
|
}>>;
|
|
233
233
|
};
|
|
234
234
|
}>> & {
|
|
@@ -1729,8 +1729,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1729
1729
|
lifeCycle: {
|
|
1730
1730
|
type: PropType<Partial<{
|
|
1731
1731
|
onSetup(): void;
|
|
1732
|
-
beforeRequest(params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
|
|
1733
|
-
afterRequest(payload?: AnyObject[] | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject[]>;
|
|
1732
|
+
beforeRequest(fieldKey: string, params?: AnyObject | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject>;
|
|
1733
|
+
afterRequest(fieldKey: string, payload?: AnyObject[] | undefined): void | import("../../../../es/src/types").WithUndefined<AnyObject[]>;
|
|
1734
1734
|
}>>;
|
|
1735
1735
|
};
|
|
1736
1736
|
}>> & {
|
|
@@ -5,7 +5,7 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
5
5
|
validate: {
|
|
6
6
|
type: PropType<Partial<{
|
|
7
7
|
[key: string]: any;
|
|
8
|
-
obj_type: "password" | "sex" | "age" | "email" | "
|
|
8
|
+
obj_type: "password" | "sex" | "age" | "email" | "birthday" | "id_card" | "age_unit" | "mobile" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
|
|
9
9
|
vali_obj: string;
|
|
10
10
|
max_value: string | number;
|
|
11
11
|
min_value: string | number;
|
|
@@ -22,7 +22,7 @@ export declare const DATE: import("vue").DefineComponent<{
|
|
|
22
22
|
validate: {
|
|
23
23
|
type: PropType<Partial<{
|
|
24
24
|
[key: string]: any;
|
|
25
|
-
obj_type: "password" | "sex" | "age" | "email" | "
|
|
25
|
+
obj_type: "password" | "sex" | "age" | "email" | "birthday" | "id_card" | "age_unit" | "mobile" | "telephone" | "bank_card" | "website" | "gestational_weeks" | "gestational_stage" | "customer_name";
|
|
26
26
|
vali_obj: string;
|
|
27
27
|
max_value: string | number;
|
|
28
28
|
min_value: string | number;
|
|
@@ -64,7 +64,7 @@ const script = defineComponent({
|
|
|
64
64
|
if (remoteOptions.value)
|
|
65
65
|
return;
|
|
66
66
|
remoteOptions.value = await asyncQueue.addAsync({
|
|
67
|
-
...createParams(configFor(props), field.value,
|
|
67
|
+
...createParams(configFor(props), field.value, fieldKey.value)
|
|
68
68
|
});
|
|
69
69
|
function createParams(config, field2, key) {
|
|
70
70
|
const _params = {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AnyObject, WithUndefined } from '../../../../../es/src/types';
|
|
2
2
|
import { FormAsyncQueueItem } from '../types';
|
|
3
3
|
declare type ProcessorOption = Partial<{
|
|
4
|
-
afterRequest(payload?: AnyObject[]): WithUndefined<AnyObject[]> | void;
|
|
5
|
-
beforeRequest(params?: AnyObject): WithUndefined<AnyObject> | void;
|
|
4
|
+
afterRequest(key: string, payload?: AnyObject[]): WithUndefined<AnyObject[]> | void;
|
|
5
|
+
beforeRequest(key: string, params?: AnyObject): WithUndefined<AnyObject> | void;
|
|
6
6
|
}>;
|
|
7
7
|
interface EntryCallback {
|
|
8
8
|
(err?: any, result?: any): void;
|
|
@@ -108,7 +108,7 @@ function useAsyncQueue() {
|
|
|
108
108
|
return new AsyncQueue({
|
|
109
109
|
name: "FormRenderAsyncQueue",
|
|
110
110
|
parallelism,
|
|
111
|
-
async processor({ method = "post", params, url }, cb, removeCache) {
|
|
111
|
+
async processor({ key, method = "post", params, url }, cb, removeCache) {
|
|
112
112
|
var _a, _b;
|
|
113
113
|
const http = getHttpInstance();
|
|
114
114
|
if (!http) {
|
|
@@ -119,7 +119,7 @@ function useAsyncQueue() {
|
|
|
119
119
|
}
|
|
120
120
|
try {
|
|
121
121
|
if (option && isFunction(option.beforeRequest)) {
|
|
122
|
-
params = (_a = option.beforeRequest(params)) != null ? _a : {};
|
|
122
|
+
params = (_a = option.beforeRequest(key, params)) != null ? _a : {};
|
|
123
123
|
}
|
|
124
124
|
const res = await http[method](url, params);
|
|
125
125
|
const { data, success } = res;
|
|
@@ -127,7 +127,7 @@ function useAsyncQueue() {
|
|
|
127
127
|
throw res;
|
|
128
128
|
let payload = Array.isArray(data) ? data : [];
|
|
129
129
|
if (option && isFunction(option.afterRequest)) {
|
|
130
|
-
payload = (_b = option.afterRequest(payload)) != null ? _b : [];
|
|
130
|
+
payload = (_b = option.afterRequest(key, payload)) != null ? _b : [];
|
|
131
131
|
}
|
|
132
132
|
cb(void 0, payload);
|
|
133
133
|
} catch (e) {
|
|
@@ -12,13 +12,13 @@ import { InjectAsyncQueue, InjectionSchemaField, InjectionBusinessCollector, Inj
|
|
|
12
12
|
function useFormContext(props) {
|
|
13
13
|
const { callLifeCycle } = useFormRenderLifeCycle(props);
|
|
14
14
|
const asyncQueue = injectOrProvide(InjectAsyncQueue, () => useAsyncQueue().create(props.parallelism, {
|
|
15
|
-
beforeRequest(
|
|
15
|
+
beforeRequest(...args) {
|
|
16
16
|
var _a;
|
|
17
|
-
return (_a = callLifeCycle("beforeRequest",
|
|
17
|
+
return (_a = callLifeCycle("beforeRequest", cloneDeep(args))) != null ? _a : args[1];
|
|
18
18
|
},
|
|
19
|
-
afterRequest(
|
|
19
|
+
afterRequest(...args) {
|
|
20
20
|
var _a;
|
|
21
|
-
return (_a = callLifeCycle("afterRequest",
|
|
21
|
+
return (_a = callLifeCycle("afterRequest", cloneDeep(args))) != null ? _a : args[1];
|
|
22
22
|
}
|
|
23
23
|
}));
|
|
24
24
|
const SchemaField = injectOrProvide(InjectionSchemaField, () => createSchemaField({
|
|
@@ -3,11 +3,11 @@ import { FormRenderLifeCycle, FormRenderProps } from '../../../../../es/packages
|
|
|
3
3
|
export declare function useFormRenderLifeCycle(props: FormRenderProps): {
|
|
4
4
|
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
5
5
|
onSetup(): void;
|
|
6
|
-
beforeRequest(params?: import("../../../../../es/src/types").AnyObject | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject>;
|
|
7
|
-
afterRequest(payload?: import("../../../../../es/src/types").AnyObject[] | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject[]>;
|
|
6
|
+
beforeRequest(fieldKey: string, params?: import("../../../../../es/src/types").AnyObject | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject>;
|
|
7
|
+
afterRequest(fieldKey: string, payload?: import("../../../../../es/src/types").AnyObject[] | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject[]>;
|
|
8
8
|
}>>[T]> | undefined) => WithUndefined<ReturnType<Required<Partial<{
|
|
9
9
|
onSetup(): void;
|
|
10
|
-
beforeRequest(params?: import("../../../../../es/src/types").AnyObject | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject>;
|
|
11
|
-
afterRequest(payload?: import("../../../../../es/src/types").AnyObject[] | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject[]>;
|
|
10
|
+
beforeRequest(fieldKey: string, params?: import("../../../../../es/src/types").AnyObject | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject>;
|
|
11
|
+
afterRequest(fieldKey: string, payload?: import("../../../../../es/src/types").AnyObject[] | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject[]>;
|
|
12
12
|
}>>[T]>>;
|
|
13
13
|
};
|
|
@@ -54,8 +54,8 @@ export declare type FormBusinessFilter = (payload: {
|
|
|
54
54
|
export declare type DependKeyType = ArrayAble<string> | Record<string, string> | ArrayAble<Record<'paramName' | 'paramValue', string>>;
|
|
55
55
|
export declare type FormRenderLifeCycle = Partial<{
|
|
56
56
|
onSetup(): void;
|
|
57
|
-
beforeRequest(params?: AnyObject): WithUndefined<AnyObject> | void;
|
|
58
|
-
afterRequest(payload?: AnyObject[]): WithUndefined<AnyObject[]> | void;
|
|
57
|
+
beforeRequest(fieldKey: string, params?: AnyObject): WithUndefined<AnyObject> | void;
|
|
58
|
+
afterRequest(fieldKey: string, payload?: AnyObject[]): WithUndefined<AnyObject[]> | void;
|
|
59
59
|
}>;
|
|
60
60
|
export declare type FormRenderProps = Partial<{
|
|
61
61
|
fieldList: FieldItem[];
|
|
@@ -4397,8 +4397,8 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4397
4397
|
lifeCycle: {
|
|
4398
4398
|
type: import("vue").PropType<Partial<{
|
|
4399
4399
|
onSetup(): void;
|
|
4400
|
-
beforeRequest(params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
4401
|
-
afterRequest(payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
4400
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
4401
|
+
afterRequest(fieldKey: string, payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
4402
4402
|
}>>;
|
|
4403
4403
|
};
|
|
4404
4404
|
}, {
|
|
@@ -4512,8 +4512,8 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
4512
4512
|
lifeCycle: {
|
|
4513
4513
|
type: import("vue").PropType<Partial<{
|
|
4514
4514
|
onSetup(): void;
|
|
4515
|
-
beforeRequest(params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
4516
|
-
afterRequest(payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
4515
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
4516
|
+
afterRequest(fieldKey: string, payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
4517
4517
|
}>>;
|
|
4518
4518
|
};
|
|
4519
4519
|
}>> & {
|
|
@@ -6014,8 +6014,8 @@ declare const ShortcutSetter: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
6014
6014
|
lifeCycle: {
|
|
6015
6015
|
type: import("vue").PropType<Partial<{
|
|
6016
6016
|
onSetup(): void;
|
|
6017
|
-
beforeRequest(params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
6018
|
-
afterRequest(payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
6017
|
+
beforeRequest(fieldKey: string, params?: import("../../../es/src/types").AnyObject | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject>;
|
|
6018
|
+
afterRequest(fieldKey: string, payload?: import("../../../es/src/types").AnyObject[] | undefined): void | import("../../../es/src/types").WithUndefined<import("../../../es/src/types").AnyObject[]>;
|
|
6019
6019
|
}>>;
|
|
6020
6020
|
};
|
|
6021
6021
|
}>> & {
|
|
@@ -4397,8 +4397,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4397
4397
|
lifeCycle: {
|
|
4398
4398
|
type: import("vue").PropType<Partial<{
|
|
4399
4399
|
onSetup(): void;
|
|
4400
|
-
beforeRequest(params?: import("../../../src/types").AnyObject | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject>;
|
|
4401
|
-
afterRequest(payload?: import("../../../src/types").AnyObject[] | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject[]>;
|
|
4400
|
+
beforeRequest(fieldKey: string, params?: import("../../../src/types").AnyObject | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject>;
|
|
4401
|
+
afterRequest(fieldKey: string, payload?: import("../../../src/types").AnyObject[] | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject[]>;
|
|
4402
4402
|
}>>;
|
|
4403
4403
|
};
|
|
4404
4404
|
}, {
|
|
@@ -4512,8 +4512,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4512
4512
|
lifeCycle: {
|
|
4513
4513
|
type: import("vue").PropType<Partial<{
|
|
4514
4514
|
onSetup(): void;
|
|
4515
|
-
beforeRequest(params?: import("../../../src/types").AnyObject | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject>;
|
|
4516
|
-
afterRequest(payload?: import("../../../src/types").AnyObject[] | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject[]>;
|
|
4515
|
+
beforeRequest(fieldKey: string, params?: import("../../../src/types").AnyObject | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject>;
|
|
4516
|
+
afterRequest(fieldKey: string, payload?: import("../../../src/types").AnyObject[] | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject[]>;
|
|
4517
4517
|
}>>;
|
|
4518
4518
|
};
|
|
4519
4519
|
}>> & {
|
|
@@ -6014,8 +6014,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6014
6014
|
lifeCycle: {
|
|
6015
6015
|
type: import("vue").PropType<Partial<{
|
|
6016
6016
|
onSetup(): void;
|
|
6017
|
-
beforeRequest(params?: import("../../../src/types").AnyObject | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject>;
|
|
6018
|
-
afterRequest(payload?: import("../../../src/types").AnyObject[] | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject[]>;
|
|
6017
|
+
beforeRequest(fieldKey: string, params?: import("../../../src/types").AnyObject | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject>;
|
|
6018
|
+
afterRequest(fieldKey: string, payload?: import("../../../src/types").AnyObject[] | undefined): void | import("../../../src/types").WithUndefined<import("../../../src/types").AnyObject[]>;
|
|
6019
6019
|
}>>;
|
|
6020
6020
|
};
|
|
6021
6021
|
}>> & {
|