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.
Files changed (33) hide show
  1. package/dist/szld-components.es.js +5851 -5797
  2. package/dist/szld-components.umd.js +43 -43
  3. package/es/components/DynamicForm/index.js +10 -2
  4. package/es/components/DynamicForm/myCascader/index.d.ts +4 -1
  5. package/es/components/DynamicForm/myCascader/index.js +7 -3
  6. package/es/components/DynamicForm/myCheckbox/index.d.ts +3 -0
  7. package/es/components/DynamicForm/myCheckbox/index.js +7 -3
  8. package/es/components/DynamicForm/myRadio/index.d.ts +3 -0
  9. package/es/components/DynamicForm/myRadio/index.js +7 -3
  10. package/es/components/DynamicForm/mySelect/index.d.ts +4 -1
  11. package/es/components/DynamicForm/mySelect/index.js +7 -3
  12. package/es/components/DynamicForm/myUpload/index.d.ts +1 -0
  13. package/es/components/DynamicForm/myUpload/index.js +3 -2
  14. package/es/components/DynamicForm/useDynamicForm.d.ts +5 -1
  15. package/es/components/DynamicForm/useDynamicForm.js +19 -2
  16. package/es/utils/method.d.ts +28 -4
  17. package/es/utils/method.js +27 -11
  18. package/lib/components/DynamicForm/index.js +10 -2
  19. package/lib/components/DynamicForm/myCascader/index.d.ts +4 -1
  20. package/lib/components/DynamicForm/myCascader/index.js +7 -3
  21. package/lib/components/DynamicForm/myCheckbox/index.d.ts +3 -0
  22. package/lib/components/DynamicForm/myCheckbox/index.js +7 -3
  23. package/lib/components/DynamicForm/myRadio/index.d.ts +3 -0
  24. package/lib/components/DynamicForm/myRadio/index.js +7 -3
  25. package/lib/components/DynamicForm/mySelect/index.d.ts +4 -1
  26. package/lib/components/DynamicForm/mySelect/index.js +7 -3
  27. package/lib/components/DynamicForm/myUpload/index.d.ts +1 -0
  28. package/lib/components/DynamicForm/myUpload/index.js +3 -2
  29. package/lib/components/DynamicForm/useDynamicForm.d.ts +5 -1
  30. package/lib/components/DynamicForm/useDynamicForm.js +19 -2
  31. package/lib/utils/method.d.ts +28 -4
  32. package/lib/utils/method.js +27 -11
  33. 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
- updateDelFileList
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":
@@ -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: string;
15
- accepterAttrListInterfaceName: string;
16
- defaultAttrListInterfaceName: string;
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>;
@@ -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(guidInterfaceName || "FWDXGLCreateGUID", {
147
- "source-number": sourceNumber
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(SelPCParamInterfaceName || "FWDXGLSelPCParam", {
155
- "source-number": sourceNumber
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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.56",
4
+ "version": "0.2.58",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",