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
|
@@ -23,7 +23,8 @@ const MyUpload = (props) => {
|
|
|
23
23
|
uploadText = "上传文件",
|
|
24
24
|
onRemove,
|
|
25
25
|
list = [],
|
|
26
|
-
uploadType
|
|
26
|
+
uploadType,
|
|
27
|
+
relatedidKey
|
|
27
28
|
} = props;
|
|
28
29
|
const { message } = antd.App.useApp();
|
|
29
30
|
const accept = (item == null ? void 0 : item["upload-accept"]) || "*";
|
|
@@ -75,7 +76,7 @@ const MyUpload = (props) => {
|
|
|
75
76
|
accept,
|
|
76
77
|
fileList,
|
|
77
78
|
onPreview: handlePreview,
|
|
78
|
-
data: { relatedid },
|
|
79
|
+
data: { [relatedidKey]: relatedid },
|
|
79
80
|
maxCount,
|
|
80
81
|
onChange: handleChange,
|
|
81
82
|
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, }: {
|
|
@@ -22,8 +22,12 @@ function useDynamicForm(props) {
|
|
|
22
22
|
commonRequest,
|
|
23
23
|
formConfig,
|
|
24
24
|
setFormConfig,
|
|
25
|
+
updateDelFileList,
|
|
25
26
|
interfaceTypeChildren,
|
|
26
|
-
|
|
27
|
+
interfaceTypeDict,
|
|
28
|
+
relatedidKey,
|
|
29
|
+
actionUrlKey,
|
|
30
|
+
actionUrlExtraParams
|
|
27
31
|
} = props;
|
|
28
32
|
const formConfigRef = react.useRef([]);
|
|
29
33
|
const { message } = antd.App.useApp();
|
|
@@ -378,6 +382,9 @@ function useDynamicForm(props) {
|
|
|
378
382
|
commonRequestWidthParams,
|
|
379
383
|
commonRequest,
|
|
380
384
|
value: formatValue,
|
|
385
|
+
interfaceTypeDict,
|
|
386
|
+
actionUrlKey,
|
|
387
|
+
actionUrlExtraParams,
|
|
381
388
|
onChange: (val) => {
|
|
382
389
|
form.setFieldValue(item.attrid, val);
|
|
383
390
|
}
|
|
@@ -440,6 +447,9 @@ function useDynamicForm(props) {
|
|
|
440
447
|
options: params,
|
|
441
448
|
handleUrlOptions,
|
|
442
449
|
value: formatValue,
|
|
450
|
+
interfaceTypeDict,
|
|
451
|
+
actionUrlKey,
|
|
452
|
+
actionUrlExtraParams,
|
|
443
453
|
onChange: (e) => {
|
|
444
454
|
form.setFieldValue(item.attrid, e.target.value);
|
|
445
455
|
}
|
|
@@ -457,6 +467,9 @@ function useDynamicForm(props) {
|
|
|
457
467
|
options: params,
|
|
458
468
|
value: formatValue,
|
|
459
469
|
handleUrlOptions,
|
|
470
|
+
interfaceTypeDict,
|
|
471
|
+
actionUrlKey,
|
|
472
|
+
actionUrlExtraParams,
|
|
460
473
|
onChange: (val) => {
|
|
461
474
|
form.setFieldValue(item.attrid, val.join(","));
|
|
462
475
|
}
|
|
@@ -475,6 +488,7 @@ function useDynamicForm(props) {
|
|
|
475
488
|
list: formatValue,
|
|
476
489
|
readonly,
|
|
477
490
|
relatedid,
|
|
491
|
+
relatedidKey,
|
|
478
492
|
onRemove: (file) => handleOnRemove(file)
|
|
479
493
|
}
|
|
480
494
|
);
|
|
@@ -486,7 +500,10 @@ function useDynamicForm(props) {
|
|
|
486
500
|
commonRequest,
|
|
487
501
|
item: item.json,
|
|
488
502
|
value: item.attrvalue,
|
|
489
|
-
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style }
|
|
503
|
+
style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style },
|
|
504
|
+
interfaceTypeDict,
|
|
505
|
+
actionUrlKey,
|
|
506
|
+
actionUrlExtraParams
|
|
490
507
|
}
|
|
491
508
|
);
|
|
492
509
|
case "radio-card":
|
package/lib/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/lib/utils/method.js
CHANGED
|
@@ -138,33 +138,44 @@ const handleFormConfig = async ({
|
|
|
138
138
|
servicerAttrListInterfaceName,
|
|
139
139
|
accepterAttrListInterfaceName,
|
|
140
140
|
defaultAttrListInterfaceName,
|
|
141
|
-
commonRequest
|
|
141
|
+
commonRequest,
|
|
142
|
+
guidParams,
|
|
143
|
+
pcParam,
|
|
144
|
+
attrReqKey = "asid",
|
|
145
|
+
attrListExtraParams = {}
|
|
142
146
|
}) => {
|
|
143
147
|
return new Promise(async (resolve, reject) => {
|
|
144
148
|
var _a, _b, _c, _d;
|
|
145
149
|
let newGUID = "", attrListConfigs = [], baseData = {}, selPCParam = {};
|
|
146
|
-
const guidRes = await commonRequest(
|
|
147
|
-
"
|
|
148
|
-
|
|
150
|
+
const guidRes = await commonRequest(
|
|
151
|
+
guidInterfaceName || "FWDXGLCreateGUID",
|
|
152
|
+
guidParams || {
|
|
153
|
+
"source-number": sourceNumber
|
|
154
|
+
}
|
|
155
|
+
);
|
|
149
156
|
if ((guidRes == null ? void 0 : guidRes.ReturnValue) === 1 && ((_a = guidRes == null ? void 0 : guidRes.data) == null ? void 0 : _a.GUID)) {
|
|
150
157
|
newGUID = guidRes.data.GUID;
|
|
151
158
|
} else {
|
|
152
159
|
reject("获取GUID失败");
|
|
153
160
|
}
|
|
154
|
-
const res = await commonRequest(
|
|
155
|
-
"
|
|
156
|
-
|
|
161
|
+
const res = await commonRequest(
|
|
162
|
+
SelPCParamInterfaceName || "FWDXGLSelPCParam",
|
|
163
|
+
pcParam || {
|
|
164
|
+
"source-number": sourceNumber
|
|
165
|
+
}
|
|
166
|
+
);
|
|
157
167
|
if ((res == null ? void 0 : res.ReturnValue) === 1) {
|
|
158
168
|
const asid = (_b = res.data[number]) == null ? void 0 : _b[key];
|
|
159
169
|
const propertiesType = (_c = res.data[number]) == null ? void 0 : _c["properties-type"];
|
|
160
170
|
const propertiesTypeMap = {
|
|
161
|
-
server: servicerAttrListInterfaceName,
|
|
162
|
-
accepter: accepterAttrListInterfaceName
|
|
171
|
+
server: servicerAttrListInterfaceName || "",
|
|
172
|
+
accepter: accepterAttrListInterfaceName || ""
|
|
163
173
|
};
|
|
164
174
|
selPCParam = res.data;
|
|
165
175
|
const res2 = await commonRequest(propertiesTypeMap[propertiesType] || defaultAttrListInterfaceName, {
|
|
166
|
-
asid,
|
|
167
|
-
"source-number": sourceNumber
|
|
176
|
+
[attrReqKey]: asid,
|
|
177
|
+
"source-number": sourceNumber,
|
|
178
|
+
...attrListExtraParams
|
|
168
179
|
});
|
|
169
180
|
if ((res2 == null ? void 0 : res2.ReturnValue) === 1 && res2.data) {
|
|
170
181
|
const attrList = ((_d = res2.data) == null ? void 0 : _d["attr_list"]) || [];
|
|
@@ -187,9 +198,14 @@ const handleFormConfig = async ({
|
|
|
187
198
|
}
|
|
188
199
|
});
|
|
189
200
|
};
|
|
201
|
+
const handleOperationFile = async (params, data, commonRequestWidthParams) => {
|
|
202
|
+
const response = await commonRequestWidthParams(params, data);
|
|
203
|
+
return response;
|
|
204
|
+
};
|
|
190
205
|
exports.base64ToString = base64ToString;
|
|
191
206
|
exports.getJson = getJson;
|
|
192
207
|
exports.handleAttrList = handleAttrList;
|
|
193
208
|
exports.handleFormConfig = handleFormConfig;
|
|
209
|
+
exports.handleOperationFile = handleOperationFile;
|
|
194
210
|
exports.handleSubmitForm = handleSubmitForm;
|
|
195
211
|
exports.isBase64 = isBase64;
|