@hzab/form-render 1.7.0 → 1.7.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,3 +1,6 @@
1
+ # @hzab/form-render@1.7.1
2
+ feat: 文件上传组件删除后重走数据处理逻辑
3
+
1
4
  # @hzab/form-render@1.7.0
2
5
 
3
6
  refactor: upload 接入 @hzab/utils upload utils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/form-render",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -184,7 +184,7 @@ export const handleInputItem = (data, opt: IHandlerOpt) => {
184
184
  if (typeof _data === "string") {
185
185
  const obj = getFileNameObj(_data);
186
186
  file.id = obj?.id;
187
- file.uid = file.id;
187
+ file.uid = file.id || nanoidNumALetters();
188
188
  file.url = _data;
189
189
  file.storeUrl = _data;
190
190
  file.name = getFullFileName(file.url);
@@ -109,8 +109,8 @@ export function Uploader({ onChange, ...props }) {
109
109
  typeof promiseRes === "object"
110
110
  ? promiseRes.url
111
111
  : promiseRes || _file.ossUrl || typeof _file === "string"
112
- ? _file
113
- : "";
112
+ ? _file
113
+ : "";
114
114
 
115
115
  if (typeof _file.url === "string") {
116
116
  _files[i].url = _file.url;
@@ -153,8 +153,13 @@ export function Uploader({ onChange, ...props }) {
153
153
  }, [value]);
154
154
 
155
155
  const onRemove = (file) => {
156
- const files = (fileList || []).filter((v) => v.url !== file.url);
157
- onChange && onChange(files);
156
+ const files = (fileList || []).filter((v) => v.uid !== file.uid);
157
+ let _files = [...files];
158
+ // 处理出参格式
159
+ _files = handleOutputFileList(_files, {
160
+ ...fileListConf,
161
+ });
162
+ onChange && onChange(_files);
158
163
  };
159
164
 
160
165
  // 自定义请求逻辑