前端:商品编辑,部分逻辑,解决 sku 编辑的 bug 。

This commit is contained in:
YunaiV
2019-05-02 20:33:03 +08:00
parent 91d475034c
commit 942d2c0634
2 changed files with 23 additions and 6 deletions

View File

@@ -42,9 +42,17 @@ export default class ProductSkuAddOrUpdateTable extends PureComponent {
// debugger;
// console.log('ProductSkuAddOrUpdateTable');
const {attrTree, skus, dispatch} = this.props;
let columns = [];
// 排除空选项的规格
let newAttrTree = [];
for (let i in attrTree) {
let attr = attrTree[i];
if (attr && attr.values && attr.values.length > 0) {
newAttrTree.push(attr);
}
}
let columns = [];
for (let i in newAttrTree) {
let attr = newAttrTree[i];
columns.push({
title: attr.name,
dataIndex: 'attrs[i]',