szld-libs 0.2.56 → 0.2.58
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/dist/szld-components.es.js +5851 -5797
- package/dist/szld-components.umd.js +43 -43
- package/es/components/DynamicForm/index.js +10 -2
- package/es/components/DynamicForm/myCascader/index.d.ts +4 -1
- package/es/components/DynamicForm/myCascader/index.js +7 -3
- package/es/components/DynamicForm/myCheckbox/index.d.ts +3 -0
- package/es/components/DynamicForm/myCheckbox/index.js +7 -3
- package/es/components/DynamicForm/myRadio/index.d.ts +3 -0
- package/es/components/DynamicForm/myRadio/index.js +7 -3
- package/es/components/DynamicForm/mySelect/index.d.ts +4 -1
- package/es/components/DynamicForm/mySelect/index.js +7 -3
- package/es/components/DynamicForm/myUpload/index.d.ts +1 -0
- package/es/components/DynamicForm/myUpload/index.js +3 -2
- package/es/components/DynamicForm/useDynamicForm.d.ts +5 -1
- package/es/components/DynamicForm/useDynamicForm.js +19 -2
- package/es/utils/method.d.ts +28 -4
- package/es/utils/method.js +27 -11
- package/lib/components/DynamicForm/index.js +10 -2
- package/lib/components/DynamicForm/myCascader/index.d.ts +4 -1
- package/lib/components/DynamicForm/myCascader/index.js +7 -3
- package/lib/components/DynamicForm/myCheckbox/index.d.ts +3 -0
- package/lib/components/DynamicForm/myCheckbox/index.js +7 -3
- package/lib/components/DynamicForm/myRadio/index.d.ts +3 -0
- package/lib/components/DynamicForm/myRadio/index.js +7 -3
- package/lib/components/DynamicForm/mySelect/index.d.ts +4 -1
- package/lib/components/DynamicForm/mySelect/index.js +7 -3
- package/lib/components/DynamicForm/myUpload/index.d.ts +1 -0
- package/lib/components/DynamicForm/myUpload/index.js +3 -2
- package/lib/components/DynamicForm/useDynamicForm.d.ts +5 -1
- package/lib/components/DynamicForm/useDynamicForm.js +19 -2
- package/lib/utils/method.d.ts +28 -4
- package/lib/utils/method.js +27 -11
- package/package.json +1 -1
|
@@ -18,7 +18,11 @@ const DynamicForm = forwardRef((props, ref) => {
|
|
|
18
18
|
commonRequest,
|
|
19
19
|
formItemStyle = [],
|
|
20
20
|
radioAlign = "horizontal",
|
|
21
|
-
interfaceTypeChildren = "YLLRDetailAttrlist"
|
|
21
|
+
interfaceTypeChildren = "YLLRDetailAttrlist",
|
|
22
|
+
interfaceTypeDict = "YLZDDictList",
|
|
23
|
+
relatedidKey = "relatedid",
|
|
24
|
+
actionUrlKey = "action-url",
|
|
25
|
+
actionUrlExtraParams = {}
|
|
22
26
|
} = props;
|
|
23
27
|
const delFileListRef = useRef([]);
|
|
24
28
|
const updateDelFileList = (file) => {
|
|
@@ -31,7 +35,11 @@ const DynamicForm = forwardRef((props, ref) => {
|
|
|
31
35
|
setFormConfig,
|
|
32
36
|
updateDelFileList,
|
|
33
37
|
formConfig,
|
|
34
|
-
interfaceTypeChildren
|
|
38
|
+
interfaceTypeChildren,
|
|
39
|
+
interfaceTypeDict,
|
|
40
|
+
relatedidKey,
|
|
41
|
+
actionUrlKey,
|
|
42
|
+
actionUrlExtraParams
|
|
35
43
|
});
|
|
36
44
|
useImperativeHandle(ref, () => ({
|
|
37
45
|
getDelFileList: () => {
|
|
@@ -8,6 +8,9 @@ interface MyCascaderProps {
|
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
10
10
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
11
|
+
interfaceTypeDict: string;
|
|
12
|
+
actionUrlKey: string;
|
|
13
|
+
actionUrlExtraParams: object;
|
|
11
14
|
}
|
|
12
|
-
declare const MyCascader: ({ item, readonly, value, onChange, style, commonRequestWidthParams, commonRequest, }: MyCascaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const MyCascader: ({ item, readonly, value, onChange, style, commonRequestWidthParams, commonRequest, interfaceTypeDict, actionUrlKey, actionUrlExtraParams, }: MyCascaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
export default MyCascader;
|
|
@@ -8,7 +8,10 @@ const MyCascader = ({
|
|
|
8
8
|
onChange,
|
|
9
9
|
style,
|
|
10
10
|
commonRequestWidthParams,
|
|
11
|
-
commonRequest
|
|
11
|
+
commonRequest,
|
|
12
|
+
interfaceTypeDict,
|
|
13
|
+
actionUrlKey,
|
|
14
|
+
actionUrlExtraParams
|
|
12
15
|
}) => {
|
|
13
16
|
const [options, setOptions] = useState([]);
|
|
14
17
|
const [loading, setLoading] = useState(false);
|
|
@@ -33,7 +36,7 @@ const MyCascader = ({
|
|
|
33
36
|
if (item.classify) {
|
|
34
37
|
setLoading(true);
|
|
35
38
|
try {
|
|
36
|
-
const response = await commonRequest(
|
|
39
|
+
const response = await commonRequest(interfaceTypeDict, {
|
|
37
40
|
asctypeid: item.classify
|
|
38
41
|
});
|
|
39
42
|
if (((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.list) && Array.isArray(response.data.list)) {
|
|
@@ -83,7 +86,8 @@ const MyCascader = ({
|
|
|
83
86
|
return;
|
|
84
87
|
}
|
|
85
88
|
const params = {
|
|
86
|
-
|
|
89
|
+
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
90
|
+
...actionUrlExtraParams
|
|
87
91
|
};
|
|
88
92
|
if (targetOption) {
|
|
89
93
|
searchFields.forEach((field) => {
|
|
@@ -10,6 +10,9 @@ export interface IMYRadio {
|
|
|
10
10
|
handleUrlOptions: (val: any, delimiter: string, list: any[]) => string;
|
|
11
11
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
12
12
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
13
|
+
interfaceTypeDict: string;
|
|
14
|
+
actionUrlKey: string;
|
|
15
|
+
actionUrlExtraParams: object;
|
|
13
16
|
}
|
|
14
17
|
declare const MyCheckbox: (props: IMYRadio) => import("react/jsx-runtime").JSX.Element;
|
|
15
18
|
export default MyCheckbox;
|
|
@@ -11,7 +11,10 @@ const MyCheckbox = (props) => {
|
|
|
11
11
|
commonRequestWidthParams,
|
|
12
12
|
commonRequest,
|
|
13
13
|
handleUrlOptions,
|
|
14
|
-
value
|
|
14
|
+
value,
|
|
15
|
+
interfaceTypeDict,
|
|
16
|
+
actionUrlKey,
|
|
17
|
+
actionUrlExtraParams
|
|
15
18
|
} = props;
|
|
16
19
|
const { message } = App.useApp();
|
|
17
20
|
const [list, setList] = useState([]);
|
|
@@ -31,7 +34,7 @@ const MyCheckbox = (props) => {
|
|
|
31
34
|
if (!id) {
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
34
|
-
const res = await commonRequest(
|
|
37
|
+
const res = await commonRequest(interfaceTypeDict, { asctypeid: id });
|
|
35
38
|
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
36
39
|
const arr = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [];
|
|
37
40
|
setList(
|
|
@@ -58,7 +61,8 @@ const MyCheckbox = (props) => {
|
|
|
58
61
|
InterfaceType: ""
|
|
59
62
|
},
|
|
60
63
|
{
|
|
61
|
-
|
|
64
|
+
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
65
|
+
...actionUrlExtraParams
|
|
62
66
|
}
|
|
63
67
|
);
|
|
64
68
|
if (response == null ? void 0 : response.data) {
|
|
@@ -11,6 +11,9 @@ export interface IMYRadio {
|
|
|
11
11
|
handleUrlOptions: (val: any, delimiter: string, list: any[]) => string;
|
|
12
12
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
13
13
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
14
|
+
interfaceTypeDict: string;
|
|
15
|
+
actionUrlKey: string;
|
|
16
|
+
actionUrlExtraParams: object;
|
|
14
17
|
}
|
|
15
18
|
declare const MyRadio: (props: IMYRadio) => import("react/jsx-runtime").JSX.Element;
|
|
16
19
|
export default MyRadio;
|
|
@@ -11,7 +11,10 @@ const MyRadio = (props) => {
|
|
|
11
11
|
commonRequestWidthParams,
|
|
12
12
|
commonRequest,
|
|
13
13
|
handleUrlOptions,
|
|
14
|
-
value
|
|
14
|
+
value,
|
|
15
|
+
interfaceTypeDict,
|
|
16
|
+
actionUrlKey,
|
|
17
|
+
actionUrlExtraParams
|
|
15
18
|
} = props;
|
|
16
19
|
const { message } = App.useApp();
|
|
17
20
|
const [list, setList] = useState([]);
|
|
@@ -30,7 +33,7 @@ const MyRadio = (props) => {
|
|
|
30
33
|
if (!id) {
|
|
31
34
|
return;
|
|
32
35
|
}
|
|
33
|
-
const res = await commonRequest(
|
|
36
|
+
const res = await commonRequest(interfaceTypeDict, { asctypeid: id });
|
|
34
37
|
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
35
38
|
const arr = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [];
|
|
36
39
|
setList(
|
|
@@ -59,7 +62,8 @@ const MyRadio = (props) => {
|
|
|
59
62
|
InterfaceType: ""
|
|
60
63
|
},
|
|
61
64
|
{
|
|
62
|
-
|
|
65
|
+
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
66
|
+
...actionUrlExtraParams
|
|
63
67
|
}
|
|
64
68
|
);
|
|
65
69
|
if (response == null ? void 0 : response.data) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ijson } from '../index.d';
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
|
-
declare const MySelect: ({ item, readonly, style, handleUrlOptions, commonRequestWidthParams, commonRequest, value, onChange, }: {
|
|
3
|
+
declare const MySelect: ({ item, readonly, style, handleUrlOptions, commonRequestWidthParams, commonRequest, value, onChange, interfaceTypeDict, actionUrlKey, actionUrlExtraParams, }: {
|
|
4
4
|
item: Ijson;
|
|
5
5
|
readonly?: boolean | undefined;
|
|
6
6
|
style?: any;
|
|
@@ -9,5 +9,8 @@ declare const MySelect: ({ item, readonly, style, handleUrlOptions, commonReques
|
|
|
9
9
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
10
10
|
value: string | number | (string | number)[];
|
|
11
11
|
onChange: (val: string | number | (string | number)[]) => void;
|
|
12
|
+
interfaceTypeDict: string;
|
|
13
|
+
actionUrlKey: string;
|
|
14
|
+
actionUrlExtraParams: object;
|
|
12
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
export default MySelect;
|
|
@@ -9,7 +9,10 @@ const MySelect = ({
|
|
|
9
9
|
commonRequestWidthParams,
|
|
10
10
|
commonRequest,
|
|
11
11
|
value,
|
|
12
|
-
onChange
|
|
12
|
+
onChange,
|
|
13
|
+
interfaceTypeDict,
|
|
14
|
+
actionUrlKey,
|
|
15
|
+
actionUrlExtraParams
|
|
13
16
|
}) => {
|
|
14
17
|
const { message } = App.useApp();
|
|
15
18
|
const [options, setOptions] = useState([]);
|
|
@@ -34,7 +37,7 @@ const MySelect = ({
|
|
|
34
37
|
if (item.classify) {
|
|
35
38
|
setLoading(true);
|
|
36
39
|
try {
|
|
37
|
-
const response = await commonRequest(
|
|
40
|
+
const response = await commonRequest(interfaceTypeDict, {
|
|
38
41
|
asctypeid: item.classify
|
|
39
42
|
});
|
|
40
43
|
if (((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.list) && Array.isArray(response.data.list)) {
|
|
@@ -65,7 +68,8 @@ const MySelect = ({
|
|
|
65
68
|
InterfaceType: ""
|
|
66
69
|
},
|
|
67
70
|
{
|
|
68
|
-
|
|
71
|
+
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
72
|
+
...actionUrlExtraParams
|
|
69
73
|
}
|
|
70
74
|
);
|
|
71
75
|
if (response == null ? void 0 : response.data) {
|
|
@@ -22,7 +22,8 @@ const MyUpload = (props) => {
|
|
|
22
22
|
uploadText = "上传文件",
|
|
23
23
|
onRemove,
|
|
24
24
|
list = [],
|
|
25
|
-
uploadType
|
|
25
|
+
uploadType,
|
|
26
|
+
relatedidKey
|
|
26
27
|
} = props;
|
|
27
28
|
const { message } = App.useApp();
|
|
28
29
|
const accept = (item == null ? void 0 : item["upload-accept"]) || "*";
|
|
@@ -74,7 +75,7 @@ const MyUpload = (props) => {
|
|
|
74
75
|
accept,
|
|
75
76
|
fileList,
|
|
76
77
|
onPreview: handlePreview,
|
|
77
|
-
data: { relatedid },
|
|
78
|
+
data: { [relatedidKey]: relatedid },
|
|
78
79
|
maxCount,
|
|
79
80
|
onChange: handleChange,
|
|
80
81
|
onRemove,
|
|
@@ -7,8 +7,12 @@ interface IDynamicFormProps {
|
|
|
7
7
|
uploadAction: (PageName?: string | undefined) => string;
|
|
8
8
|
formConfig?: IformConfigItem[];
|
|
9
9
|
setFormConfig?: (config: IformConfigItem[]) => void;
|
|
10
|
-
interfaceTypeChildren?: string;
|
|
11
10
|
updateDelFileList: (file: UploadFile) => void;
|
|
11
|
+
interfaceTypeChildren?: string;
|
|
12
|
+
interfaceTypeDict: string;
|
|
13
|
+
relatedidKey: string;
|
|
14
|
+
actionUrlKey: string;
|
|
15
|
+
actionUrlExtraParams: object;
|
|
12
16
|
}
|
|
13
17
|
declare function useDynamicForm(props: IDynamicFormProps): {
|
|
14
18
|
handleRenderItem: ({ item, readonly, colNum, instructionShowMode, relatedid, form, defaultWidth, formItemStyle, radioAlign, }: {
|
|
@@ -21,8 +21,12 @@ function useDynamicForm(props) {
|
|
|
21
21
|
commonRequest,
|
|
22
22
|
formConfig,
|
|
23
23
|
setFormConfig,
|
|
24
|
+
updateDelFileList,
|
|
24
25
|
interfaceTypeChildren,
|
|
25
|
-
|
|
26
|
+
interfaceTypeDict,
|
|
27
|
+
relatedidKey,
|
|
28
|
+
actionUrlKey,
|
|
29
|
+
actionUrlExtraParams
|
|
26
30
|
} = props;
|
|
27
31
|
const formConfigRef = useRef([]);
|
|
28
32
|
const { message } = App.useApp();
|
|
@@ -377,6 +381,9 @@ function useDynamicForm(props) {
|
|
|
377
381
|
commonRequestWidthParams,
|
|
378
382
|
commonRequest,
|
|
379
383
|
value: formatValue,
|
|
384
|
+
interfaceTypeDict,
|
|
385
|
+
actionUrlKey,
|
|
386
|
+
actionUrlExtraParams,
|
|
380
387
|
onChange: (val) => {
|
|
381
388
|
form.setFieldValue(item.attrid, val);
|
|
382
389
|
}
|
|
@@ -439,6 +446,9 @@ function useDynamicForm(props) {
|
|
|
439
446
|
options: params,
|
|
440
447
|
handleUrlOptions,
|
|
441
448
|
value: formatValue,
|
|
449
|
+
interfaceTypeDict,
|
|
450
|
+
actionUrlKey,
|
|
451
|
+
actionUrlExtraParams,
|
|
442
452
|
onChange: (e) => {
|
|
443
453
|
form.setFieldValue(item.attrid, e.target.value);
|
|
444
454
|
}
|
|
@@ -456,6 +466,9 @@ function useDynamicForm(props) {
|
|
|
456
466
|
options: params,
|
|
457
467
|
value: formatValue,
|
|
458
468
|
handleUrlOptions,
|
|
469
|
+
interfaceTypeDict,
|
|
470
|
+
actionUrlKey,
|
|
471
|
+
actionUrlExtraParams,
|
|
459
472
|
onChange: (val) => {
|
|
460
473
|
form.setFieldValue(item.attrid, val.join(","));
|
|
461
474
|
}
|
|
@@ -474,6 +487,7 @@ function useDynamicForm(props) {
|
|
|
474
487
|
list: formatValue,
|
|
475
488
|
readonly,
|
|
476
489
|
relatedid,
|
|
490
|
+
relatedidKey,
|
|
477
491
|
onRemove: (file) => handleOnRemove(file)
|
|
478
492
|
}
|
|
479
493
|
);
|
|
@@ -485,7 +499,10 @@ function useDynamicForm(props) {
|
|
|
485
499
|
commonRequest,
|
|
486
500
|
item: item.json,
|
|
487
501
|
value: item.attrvalue,
|
|
488
|
-
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style }
|
|
502
|
+
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style },
|
|
503
|
+
interfaceTypeDict,
|
|
504
|
+
actionUrlKey,
|
|
505
|
+
actionUrlExtraParams
|
|
489
506
|
}
|
|
490
507
|
);
|
|
491
508
|
case "radio-card":
|
package/es/utils/method.d.ts
CHANGED
|
@@ -1,24 +1,48 @@
|
|
|
1
1
|
export declare function getJson(jsonStr: string): any;
|
|
2
2
|
export declare function base64ToString(base64Str: string): string;
|
|
3
3
|
export declare function isBase64(str: string): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* 处理表单提交数据,将表单值合并到原始数据attrvalue中
|
|
6
|
+
* @param originalData 原始数据
|
|
7
|
+
* @param allValues 表单提交值
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
4
10
|
export declare const handleSubmitForm: (originalData: any, allValues: any) => {
|
|
5
11
|
updatedData: any;
|
|
6
12
|
uploadedFiles: any[];
|
|
7
13
|
};
|
|
8
14
|
export declare const handleAttrList: (attrList: any[]) => any[];
|
|
9
|
-
export declare const handleFormConfig: ({ number, key, sourceNumber, guidInterfaceName, SelPCParamInterfaceName, servicerAttrListInterfaceName, accepterAttrListInterfaceName, defaultAttrListInterfaceName, commonRequest, }: {
|
|
15
|
+
export declare const handleFormConfig: ({ number, key, sourceNumber, guidInterfaceName, SelPCParamInterfaceName, servicerAttrListInterfaceName, accepterAttrListInterfaceName, defaultAttrListInterfaceName, commonRequest, guidParams, pcParam, attrReqKey, attrListExtraParams, }: {
|
|
10
16
|
number: string | number;
|
|
11
17
|
key: string;
|
|
12
18
|
guidInterfaceName: string;
|
|
13
19
|
SelPCParamInterfaceName: string;
|
|
14
|
-
servicerAttrListInterfaceName
|
|
15
|
-
accepterAttrListInterfaceName
|
|
16
|
-
defaultAttrListInterfaceName
|
|
20
|
+
servicerAttrListInterfaceName?: string | undefined;
|
|
21
|
+
accepterAttrListInterfaceName?: string | undefined;
|
|
22
|
+
defaultAttrListInterfaceName?: string | undefined;
|
|
17
23
|
sourceNumber?: string | number | undefined;
|
|
18
24
|
commonRequest: any;
|
|
25
|
+
guidParams?: {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
} | undefined;
|
|
28
|
+
pcParam?: {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
} | undefined;
|
|
31
|
+
attrListExtraParams?: {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
} | undefined;
|
|
34
|
+
attrReqKey?: string | undefined;
|
|
19
35
|
}) => Promise<{
|
|
20
36
|
baseData: any;
|
|
21
37
|
newGUID: string;
|
|
22
38
|
attrListConfigs: any[];
|
|
23
39
|
selPCParam: any;
|
|
24
40
|
}>;
|
|
41
|
+
/**
|
|
42
|
+
* 保存或者删除文件
|
|
43
|
+
* @param params 操作文件接口参数
|
|
44
|
+
* @param data 操作文件接口数据
|
|
45
|
+
* @param commonRequestWidthParams 操作文件接口请求函数
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
export declare const handleOperationFile: (params: any, data: any, commonRequestWidthParams: any) => Promise<any>;
|
package/es/utils/method.js
CHANGED
|
@@ -136,33 +136,44 @@ const handleFormConfig = async ({
|
|
|
136
136
|
servicerAttrListInterfaceName,
|
|
137
137
|
accepterAttrListInterfaceName,
|
|
138
138
|
defaultAttrListInterfaceName,
|
|
139
|
-
commonRequest
|
|
139
|
+
commonRequest,
|
|
140
|
+
guidParams,
|
|
141
|
+
pcParam,
|
|
142
|
+
attrReqKey = "asid",
|
|
143
|
+
attrListExtraParams = {}
|
|
140
144
|
}) => {
|
|
141
145
|
return new Promise(async (resolve, reject) => {
|
|
142
146
|
var _a, _b, _c, _d;
|
|
143
147
|
let newGUID = "", attrListConfigs = [], baseData = {}, selPCParam = {};
|
|
144
|
-
const guidRes = await commonRequest(
|
|
145
|
-
"
|
|
146
|
-
|
|
148
|
+
const guidRes = await commonRequest(
|
|
149
|
+
guidInterfaceName || "FWDXGLCreateGUID",
|
|
150
|
+
guidParams || {
|
|
151
|
+
"source-number": sourceNumber
|
|
152
|
+
}
|
|
153
|
+
);
|
|
147
154
|
if ((guidRes == null ? void 0 : guidRes.ReturnValue) === 1 && ((_a = guidRes == null ? void 0 : guidRes.data) == null ? void 0 : _a.GUID)) {
|
|
148
155
|
newGUID = guidRes.data.GUID;
|
|
149
156
|
} else {
|
|
150
157
|
reject("获取GUID失败");
|
|
151
158
|
}
|
|
152
|
-
const res = await commonRequest(
|
|
153
|
-
"
|
|
154
|
-
|
|
159
|
+
const res = await commonRequest(
|
|
160
|
+
SelPCParamInterfaceName || "FWDXGLSelPCParam",
|
|
161
|
+
pcParam || {
|
|
162
|
+
"source-number": sourceNumber
|
|
163
|
+
}
|
|
164
|
+
);
|
|
155
165
|
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
156
166
|
const asid = (_b = res.data[number]) == null ? void 0 : _b[key];
|
|
157
167
|
const propertiesType = (_c = res.data[number]) == null ? void 0 : _c["properties-type"];
|
|
158
168
|
const propertiesTypeMap = {
|
|
159
|
-
server: servicerAttrListInterfaceName,
|
|
160
|
-
accepter: accepterAttrListInterfaceName
|
|
169
|
+
server: servicerAttrListInterfaceName || "",
|
|
170
|
+
accepter: accepterAttrListInterfaceName || ""
|
|
161
171
|
};
|
|
162
172
|
selPCParam = res.data;
|
|
163
173
|
const res2 = await commonRequest(propertiesTypeMap[propertiesType] || defaultAttrListInterfaceName, {
|
|
164
|
-
asid,
|
|
165
|
-
"source-number": sourceNumber
|
|
174
|
+
[attrReqKey]: asid,
|
|
175
|
+
"source-number": sourceNumber,
|
|
176
|
+
...attrListExtraParams
|
|
166
177
|
});
|
|
167
178
|
if ((res2 == null ? void 0 : res2.ReturnValue) === 1 && res2.data) {
|
|
168
179
|
const attrList = ((_d = res2.data) == null ? void 0 : _d["attr_list"]) || [];
|
|
@@ -185,11 +196,16 @@ const handleFormConfig = async ({
|
|
|
185
196
|
}
|
|
186
197
|
});
|
|
187
198
|
};
|
|
199
|
+
const handleOperationFile = async (params, data, commonRequestWidthParams) => {
|
|
200
|
+
const response = await commonRequestWidthParams(params, data);
|
|
201
|
+
return response;
|
|
202
|
+
};
|
|
188
203
|
export {
|
|
189
204
|
base64ToString,
|
|
190
205
|
getJson,
|
|
191
206
|
handleAttrList,
|
|
192
207
|
handleFormConfig,
|
|
208
|
+
handleOperationFile,
|
|
193
209
|
handleSubmitForm,
|
|
194
210
|
isBase64
|
|
195
211
|
};
|
|
@@ -19,7 +19,11 @@ const DynamicForm = react.forwardRef((props, ref) => {
|
|
|
19
19
|
commonRequest,
|
|
20
20
|
formItemStyle = [],
|
|
21
21
|
radioAlign = "horizontal",
|
|
22
|
-
interfaceTypeChildren = "YLLRDetailAttrlist"
|
|
22
|
+
interfaceTypeChildren = "YLLRDetailAttrlist",
|
|
23
|
+
interfaceTypeDict = "YLZDDictList",
|
|
24
|
+
relatedidKey = "relatedid",
|
|
25
|
+
actionUrlKey = "action-url",
|
|
26
|
+
actionUrlExtraParams = {}
|
|
23
27
|
} = props;
|
|
24
28
|
const delFileListRef = react.useRef([]);
|
|
25
29
|
const updateDelFileList = (file) => {
|
|
@@ -32,7 +36,11 @@ const DynamicForm = react.forwardRef((props, ref) => {
|
|
|
32
36
|
setFormConfig,
|
|
33
37
|
updateDelFileList,
|
|
34
38
|
formConfig,
|
|
35
|
-
interfaceTypeChildren
|
|
39
|
+
interfaceTypeChildren,
|
|
40
|
+
interfaceTypeDict,
|
|
41
|
+
relatedidKey,
|
|
42
|
+
actionUrlKey,
|
|
43
|
+
actionUrlExtraParams
|
|
36
44
|
});
|
|
37
45
|
react.useImperativeHandle(ref, () => ({
|
|
38
46
|
getDelFileList: () => {
|
|
@@ -8,6 +8,9 @@ interface MyCascaderProps {
|
|
|
8
8
|
style?: React.CSSProperties;
|
|
9
9
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
10
10
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
11
|
+
interfaceTypeDict: string;
|
|
12
|
+
actionUrlKey: string;
|
|
13
|
+
actionUrlExtraParams: object;
|
|
11
14
|
}
|
|
12
|
-
declare const MyCascader: ({ item, readonly, value, onChange, style, commonRequestWidthParams, commonRequest, }: MyCascaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const MyCascader: ({ item, readonly, value, onChange, style, commonRequestWidthParams, commonRequest, interfaceTypeDict, actionUrlKey, actionUrlExtraParams, }: MyCascaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
export default MyCascader;
|
|
@@ -9,7 +9,10 @@ const MyCascader = ({
|
|
|
9
9
|
onChange,
|
|
10
10
|
style,
|
|
11
11
|
commonRequestWidthParams,
|
|
12
|
-
commonRequest
|
|
12
|
+
commonRequest,
|
|
13
|
+
interfaceTypeDict,
|
|
14
|
+
actionUrlKey,
|
|
15
|
+
actionUrlExtraParams
|
|
13
16
|
}) => {
|
|
14
17
|
const [options, setOptions] = react.useState([]);
|
|
15
18
|
const [loading, setLoading] = react.useState(false);
|
|
@@ -34,7 +37,7 @@ const MyCascader = ({
|
|
|
34
37
|
if (item.classify) {
|
|
35
38
|
setLoading(true);
|
|
36
39
|
try {
|
|
37
|
-
const response = await commonRequest(
|
|
40
|
+
const response = await commonRequest(interfaceTypeDict, {
|
|
38
41
|
asctypeid: item.classify
|
|
39
42
|
});
|
|
40
43
|
if (((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.list) && Array.isArray(response.data.list)) {
|
|
@@ -84,7 +87,8 @@ const MyCascader = ({
|
|
|
84
87
|
return;
|
|
85
88
|
}
|
|
86
89
|
const params = {
|
|
87
|
-
|
|
90
|
+
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
91
|
+
...actionUrlExtraParams
|
|
88
92
|
};
|
|
89
93
|
if (targetOption) {
|
|
90
94
|
searchFields.forEach((field) => {
|
|
@@ -10,6 +10,9 @@ export interface IMYRadio {
|
|
|
10
10
|
handleUrlOptions: (val: any, delimiter: string, list: any[]) => string;
|
|
11
11
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
12
12
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
13
|
+
interfaceTypeDict: string;
|
|
14
|
+
actionUrlKey: string;
|
|
15
|
+
actionUrlExtraParams: object;
|
|
13
16
|
}
|
|
14
17
|
declare const MyCheckbox: (props: IMYRadio) => import("react/jsx-runtime").JSX.Element;
|
|
15
18
|
export default MyCheckbox;
|
|
@@ -12,7 +12,10 @@ const MyCheckbox = (props) => {
|
|
|
12
12
|
commonRequestWidthParams,
|
|
13
13
|
commonRequest,
|
|
14
14
|
handleUrlOptions,
|
|
15
|
-
value
|
|
15
|
+
value,
|
|
16
|
+
interfaceTypeDict,
|
|
17
|
+
actionUrlKey,
|
|
18
|
+
actionUrlExtraParams
|
|
16
19
|
} = props;
|
|
17
20
|
const { message } = antd.App.useApp();
|
|
18
21
|
const [list, setList] = react.useState([]);
|
|
@@ -32,7 +35,7 @@ const MyCheckbox = (props) => {
|
|
|
32
35
|
if (!id) {
|
|
33
36
|
return;
|
|
34
37
|
}
|
|
35
|
-
const res = await commonRequest(
|
|
38
|
+
const res = await commonRequest(interfaceTypeDict, { asctypeid: id });
|
|
36
39
|
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
37
40
|
const arr = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [];
|
|
38
41
|
setList(
|
|
@@ -59,7 +62,8 @@ const MyCheckbox = (props) => {
|
|
|
59
62
|
InterfaceType: ""
|
|
60
63
|
},
|
|
61
64
|
{
|
|
62
|
-
|
|
65
|
+
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
66
|
+
...actionUrlExtraParams
|
|
63
67
|
}
|
|
64
68
|
);
|
|
65
69
|
if (response == null ? void 0 : response.data) {
|
|
@@ -11,6 +11,9 @@ export interface IMYRadio {
|
|
|
11
11
|
handleUrlOptions: (val: any, delimiter: string, list: any[]) => string;
|
|
12
12
|
commonRequestWidthParams: (params: object, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
13
13
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
14
|
+
interfaceTypeDict: string;
|
|
15
|
+
actionUrlKey: string;
|
|
16
|
+
actionUrlExtraParams: object;
|
|
14
17
|
}
|
|
15
18
|
declare const MyRadio: (props: IMYRadio) => import("react/jsx-runtime").JSX.Element;
|
|
16
19
|
export default MyRadio;
|
|
@@ -12,7 +12,10 @@ const MyRadio = (props) => {
|
|
|
12
12
|
commonRequestWidthParams,
|
|
13
13
|
commonRequest,
|
|
14
14
|
handleUrlOptions,
|
|
15
|
-
value
|
|
15
|
+
value,
|
|
16
|
+
interfaceTypeDict,
|
|
17
|
+
actionUrlKey,
|
|
18
|
+
actionUrlExtraParams
|
|
16
19
|
} = props;
|
|
17
20
|
const { message } = antd.App.useApp();
|
|
18
21
|
const [list, setList] = react.useState([]);
|
|
@@ -31,7 +34,7 @@ const MyRadio = (props) => {
|
|
|
31
34
|
if (!id) {
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
34
|
-
const res = await commonRequest(
|
|
37
|
+
const res = await commonRequest(interfaceTypeDict, { asctypeid: id });
|
|
35
38
|
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
36
39
|
const arr = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) || [];
|
|
37
40
|
setList(
|
|
@@ -60,7 +63,8 @@ const MyRadio = (props) => {
|
|
|
60
63
|
InterfaceType: ""
|
|
61
64
|
},
|
|
62
65
|
{
|
|
63
|
-
|
|
66
|
+
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
67
|
+
...actionUrlExtraParams
|
|
64
68
|
}
|
|
65
69
|
);
|
|
66
70
|
if (response == null ? void 0 : response.data) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ijson } from '../index.d';
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
|
-
declare const MySelect: ({ item, readonly, style, handleUrlOptions, commonRequestWidthParams, commonRequest, value, onChange, }: {
|
|
3
|
+
declare const MySelect: ({ item, readonly, style, handleUrlOptions, commonRequestWidthParams, commonRequest, value, onChange, interfaceTypeDict, actionUrlKey, actionUrlExtraParams, }: {
|
|
4
4
|
item: Ijson;
|
|
5
5
|
readonly?: boolean | undefined;
|
|
6
6
|
style?: any;
|
|
@@ -9,5 +9,8 @@ declare const MySelect: ({ item, readonly, style, handleUrlOptions, commonReques
|
|
|
9
9
|
commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>;
|
|
10
10
|
value: string | number | (string | number)[];
|
|
11
11
|
onChange: (val: string | number | (string | number)[]) => void;
|
|
12
|
+
interfaceTypeDict: string;
|
|
13
|
+
actionUrlKey: string;
|
|
14
|
+
actionUrlExtraParams: object;
|
|
12
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
export default MySelect;
|
|
@@ -10,7 +10,10 @@ const MySelect = ({
|
|
|
10
10
|
commonRequestWidthParams,
|
|
11
11
|
commonRequest,
|
|
12
12
|
value,
|
|
13
|
-
onChange
|
|
13
|
+
onChange,
|
|
14
|
+
interfaceTypeDict,
|
|
15
|
+
actionUrlKey,
|
|
16
|
+
actionUrlExtraParams
|
|
14
17
|
}) => {
|
|
15
18
|
const { message } = antd.App.useApp();
|
|
16
19
|
const [options, setOptions] = react.useState([]);
|
|
@@ -35,7 +38,7 @@ const MySelect = ({
|
|
|
35
38
|
if (item.classify) {
|
|
36
39
|
setLoading(true);
|
|
37
40
|
try {
|
|
38
|
-
const response = await commonRequest(
|
|
41
|
+
const response = await commonRequest(interfaceTypeDict, {
|
|
39
42
|
asctypeid: item.classify
|
|
40
43
|
});
|
|
41
44
|
if (((_a = response == null ? void 0 : response.data) == null ? void 0 : _a.list) && Array.isArray(response.data.list)) {
|
|
@@ -66,7 +69,8 @@ const MySelect = ({
|
|
|
66
69
|
InterfaceType: ""
|
|
67
70
|
},
|
|
68
71
|
{
|
|
69
|
-
|
|
72
|
+
[actionUrlKey]: item == null ? void 0 : item["action-url"],
|
|
73
|
+
...actionUrlExtraParams
|
|
70
74
|
}
|
|
71
75
|
);
|
|
72
76
|
if (response == null ? void 0 : response.data) {
|