diff --git a/src/UI/MaterialEditor/GoodsList.tsx b/src/UI/MaterialEditor/GoodsList.tsx index e3a5a216d..fcc518ba9 100644 --- a/src/UI/MaterialEditor/GoodsList.tsx +++ b/src/UI/MaterialEditor/GoodsList.tsx @@ -88,20 +88,18 @@ export class GoodsList extends React.Component { { this.goods.map(v => { - let mat = v.goods_param.find(p => p.id === 3); - let color = v.goods_param.find(p => p.id === 4); - let specification = v.goods_param.find(p => p.id === 6); - let thick = v.goods_param.find(p => p.id === 2); - - let matName = mat ? mat.value : ""; + let matName = v.goods_param.find(p => p.id === 3)?.value ?? ""; + let colorName = v.goods_param.find(p => p.id === 4)?.value ?? ""; + let goods_spec = v.goods_param.find(p => p.id === 6)?.value ?? ""; + let thick = v.goods_param.find(p => p.id === 2)?.value ?? ""; + //品牌 + let brand = v.goods_param.find(p => p.id === 5)?.value ?? ""; //纹路 let waveline = v.goods_param.find(t => t.id === 7)?.value == 1 ? '有' : '无'; //是否打包 let isPack = v.goods_param.find(t => t.id === 8)?.value == 1 ? "是" : "否"; - let colorName = color ? color.value : ""; - let goods_spec = specification ? specification.value : ""; let info = { goods_id: v.goods_id, name: v.goods_name, @@ -110,9 +108,6 @@ export class GoodsList extends React.Component { specification: goods_spec, }; - //品牌 - let brand = v.goods_param.find(p => p.name === "品牌").value; - return this.props.select(info)} @@ -122,7 +117,7 @@ export class GoodsList extends React.Component { - {thick ? thick.value : ""} + {thick} {waveline} {isPack}