@ecoding/components.antd 0.5.16 → 0.5.17

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.
@@ -157,7 +157,8 @@ const MultipleUpload = (props) => {
157
157
  }
158
158
  if (value && value.length > 0) {
159
159
  const temp = [];
160
- value.forEach((item, index) => {
160
+ const tempValue = JSON.parse(JSON.stringify(value));
161
+ tempValue.forEach((item, index) => {
161
162
  isInnerDone.current.push(true);
162
163
  if (typeof item === "string" && item) {
163
164
  // 防止重复拼接domain
@@ -227,7 +227,8 @@ const MultipleImgUpload = (props) => {
227
227
  }
228
228
  if (value && value.length > 0) {
229
229
  const temp = [];
230
- value.forEach((item, index) => {
230
+ const tempValue = JSON.parse(JSON.stringify(value));
231
+ tempValue.forEach((item, index) => {
231
232
  if (typeof item === "string" && item) {
232
233
  // 防止重复拼接domain
233
234
  item = domain ? item.replace(domain, "") : item;
@@ -101,10 +101,11 @@ const SingleFileUpload = (props) => {
101
101
  item = props.domain ? item.replace(props.domain, "") : item;
102
102
  setFileUrl(item);
103
103
  }
104
- if (((item === null || item === void 0 ? void 0 : item.url) || (item === null || item === void 0 ? void 0 : item.url) == '') && fileUrl != item.url) {
104
+ const temp = Object.assign({}, item);
105
+ if (((temp === null || temp === void 0 ? void 0 : temp.url) || (temp === null || temp === void 0 ? void 0 : temp.url) == '') && fileUrl != temp.url) {
105
106
  // 防止重复拼接domain
106
- item.url = props.domain ? item.url.replace(props.domain, "") : item.url;
107
- setFileUrl(item.url);
107
+ temp.url = props.domain ? temp.url.replace(props.domain, "") : temp.url;
108
+ setFileUrl(temp.url);
108
109
  }
109
110
  }, [props.value]);
110
111
  return (React.createElement(Space.Compact, { block: true },
@@ -174,10 +174,11 @@ const ImgUpload = (props) => {
174
174
  item = props.domain ? item.replace(props.domain, "") : item;
175
175
  setImageUrl(item);
176
176
  }
177
- if (item === null || item === void 0 ? void 0 : item.url) {
177
+ const temp = Object.assign({}, item);
178
+ if (temp === null || temp === void 0 ? void 0 : temp.url) {
178
179
  // 防止重复拼接domain
179
- item.url = props.domain ? item.url.replace(props.domain, "") : item.url;
180
- setImageUrl(item.url);
180
+ temp.url = props.domain ? temp.url.replace(props.domain, "") : temp.url;
181
+ setImageUrl(temp.url);
181
182
  }
182
183
  }, [props.value]);
183
184
  return (React.createElement(Flex, { style: { fontSize: 0 } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/components.antd",
3
- "version": "0.5.16",
3
+ "version": "0.5.17",
4
4
  "author": "cxc",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -47,5 +47,5 @@
47
47
  "antd": "^6.0.0",
48
48
  "axios": "^1.1.2"
49
49
  },
50
- "gitHead": "078ccdbbe6892e97efd42efdd2afbe123be1daef"
50
+ "gitHead": "5a1de779ccf48290bf89c9dd0c4c350e5b100571"
51
51
  }