Commit 47dd5aad authored by 武广's avatar 武广

fix: 修改自定义属性字数

parent 7f667c1b
......@@ -429,6 +429,7 @@ class goodsManage extends Component {
}
});
const attributeApplyList = [];
let isMaxLength = false;
if (values.attributeApplyList && values.attributeApplyList.length) {
values.attributeApplyList.forEach(item => {
const key = Object.keys(item)[0];
......@@ -442,6 +443,9 @@ class goodsManage extends Component {
attrs.push(json);
}
} catch {
if (attr && attr.length > 30) {
isMaxLength = true;
}
attrs.push({ attributeValueName: attr });
}
});
......@@ -452,9 +456,18 @@ class goodsManage extends Component {
attrs = [json];
}
} catch {
if (item[key] && item[key].length > 30) {
isMaxLength = true;
}
attrs = [{ attributeValueName: item[key] }];
}
}
if (isMaxLength) {
notification.error({
message: '自定义属性不能超过30个字符',
});
return;
}
attributeApplyList.push({
attributeId: key.replace('attr', ''),
attributeApplyValueList: attrs,
......
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