商品共有元素 优化

dev
DongZeLiang 2024-03-07 10:50:11 +08:00
parent a1f08feb16
commit a6451848c3
1 changed files with 5 additions and 4 deletions

View File

@ -219,7 +219,8 @@
:props="{'value': 'id', 'label': 'name'}" :props="{'value': 'id', 'label': 'name'}"
:options="categoryOptions"></el-cascader> :options="categoryOptions"></el-cascader>
</el-form-item> </el-form-item>
<el-tabs v-model="activeName" type="border-card"> <el-empty v-show="categoryOptionValue.length === 0" description="请选择品类,在进行操作"></el-empty>
<el-tabs v-show="categoryOptionValue.length > 0" v-model="activeName" type="border-card">
<el-tab-pane label="商品属性组" name="attributeGroup"> <el-tab-pane label="商品属性组" name="attributeGroup">
<el-row style="overflow-x: auto; height: 300px;"> <el-row style="overflow-x: auto; height: 300px;">
<el-col :span="6" v-for="templateAttributeGroup in categoryCommonElement.templateAttributeGroupList"> <el-col :span="6" v-for="templateAttributeGroup in categoryCommonElement.templateAttributeGroupList">
@ -439,8 +440,7 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
attributeCheckedFun(checkedValue) { attributeCheckedFun() {
console.log(checkedValue)
// attributeIdCheckedList -> attributeCheckedList // attributeIdCheckedList -> attributeCheckedList
// 1 -> ID 1 : attributeCheckedList[] -> 1 // 1 -> ID 1 : attributeCheckedList[] -> 1
// 2 -> ID 3 : attributeCheckedList[1] -> 3 // 2 -> ID 3 : attributeCheckedList[1] -> 3
@ -457,7 +457,8 @@ export default {
// attributeIdCheckedList [3,5,9] : attributeCheckedList [3,5] -> [3,5,9] // attributeIdCheckedList [3,5,9] : attributeCheckedList [3,5] -> [3,5,9]
// attributeIdCheckedList [3,9] : attributeCheckedList [3,5,9] -> [3,9] // attributeIdCheckedList [3,9] : attributeCheckedList [3,5,9] -> [3,9]
// attributeCheckedList attributeIdCheckedList // attributeCheckedList attributeIdCheckedList
let attributeChecked = this.attributeCheckedList.find(attributeChecked => this.attributeIdCheckedList.indexOf(attributeChecked.id) === -1);
this.attributeCheckedList.splice(this.attributeCheckedList.indexOf(attributeChecked), 1);
} }
}, },