Commit 99ae6c14 authored by 武广's avatar 武广

fix: 修改属性为数字不传的问题

parent 0a3152f9
...@@ -439,8 +439,15 @@ class goodsManage extends Component { ...@@ -439,8 +439,15 @@ class goodsManage extends Component {
item[key].forEach(attr => { item[key].forEach(attr => {
try { try {
const json = JSON.parse(attr); const json = JSON.parse(attr);
if (this.checkInAttrList(json.attributeValueId)) { if (typeof json === 'object') {
attrs.push(json); if (this.checkInAttrList(json.attributeValueId)) {
attrs.push(json);
}
} else {
if (`${json}` && `${json}`.length > 30) {
isMaxLength = true;
}
attrs.push({ attributeValueName: json });
} }
} catch { } catch {
if (attr && attr.length > 30) { if (attr && attr.length > 30) {
...@@ -452,8 +459,15 @@ class goodsManage extends Component { ...@@ -452,8 +459,15 @@ class goodsManage extends Component {
} else { } else {
try { try {
const json = JSON.parse(item[key]); const json = JSON.parse(item[key]);
if (this.checkInAttrList(json.attributeValueId)) { if (typeof json === 'object') {
attrs = [json]; if (this.checkInAttrList(json.attributeValueId)) {
attrs = [json];
}
} else {
if (`${json}` && `${json}`.length > 30) {
isMaxLength = true;
}
attrs.push({ attributeValueName: json });
} }
} catch { } catch {
if (item[key] && item[key].length > 30) { if (item[key] && item[key].length > 30) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment