@hzab/form-render 1.4.0 → 1.4.1

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/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- # @hzab/form-render@1.4.0-beta
1
+ # @hzab/form-render@1.4.1
2
+
3
+ fix: Upload 修复历史遗留问题,解决 单项上传始终解析为 对象/字符串 无法切换会数组的情况
4
+
5
+ # @hzab/form-render@1.4.0
2
6
 
3
7
  break: location-list-picker 添加多区域规划
4
8
  fix: LocationListPicker 点位信息弹窗位置问题修复
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/form-render",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -51,4 +51,4 @@
51
51
  "directories": {
52
52
  "lib": "lib"
53
53
  }
54
- }
54
+ }
@@ -4,35 +4,14 @@ import { useGlobalPropsContext } from "../../common/global-props-context";
4
4
  export const Upload = (props) => {
5
5
  // 组件外部传入的 props
6
6
  const globalProps = useGlobalPropsContext() || {};
7
- const { field = {}, onChange, value } = props;
8
- const { name, mode, componentProps = {} } = field;
9
- const { multiple } = componentProps;
10
-
11
- async function onUploadChange(files) {
12
- let _files = files;
13
- if (field?.autoUpload && props.fieldsConf[name]?.onUpload) {
14
- _files = await props.fieldsConf[name]?.onUpload(files);
15
- if (!_files) {
16
- return;
17
- }
18
- }
19
- // 若单选模式,默认只返回对应数据,而非嵌套一层数组
20
- if (!multiple && _files && _files.length === 1) {
21
- _files = _files[0];
22
- }
23
- onChange && onChange(_files);
24
- }
25
7
 
26
8
  const _props = {
27
- mode: mode,
28
- ...props,
29
- value: typeof value === "string" ? [value] : value,
30
9
  axios: globalProps?.axios,
31
10
  axiosConf: globalProps?.axiosConf,
32
- ...componentProps,
11
+ ...props,
33
12
  };
34
13
 
35
- return <UploaderCom {..._props} onChange={onUploadChange} />;
14
+ return <UploaderCom {..._props} />;
36
15
  };
37
16
 
38
17
  export default Upload;