diff --git a/src/views/product/info/index.vue b/src/views/product/info/index.vue index a69600e..e3b250f 100644 --- a/src/views/product/info/index.vue +++ b/src/views/product/info/index.vue @@ -241,9 +241,9 @@ - - - + + + @@ -278,9 +278,9 @@ 选择属性 - - - + + + {{attribute.name}} @@ -291,9 +291,9 @@ - - - + + + @@ -396,6 +396,7 @@ export default { }, customPropertiesFormStatus: false, + attributeIdCheckedList: [], attributeCheckedList: [], categoryCommonElement: { templateAttributeGroupList: [], @@ -438,6 +439,28 @@ export default { this.getList(); }, methods: { + attributeCheckedFun(checkedValue) { + console.log(checkedValue) + // attributeIdCheckedList -> attributeCheckedList 不在 + // 1 -> ID 1 : attributeCheckedList[] -> 1 + // 2 -> ID 3 : attributeCheckedList[1] -> 3 + let attributeId =this.attributeIdCheckedList + .find(attributeId => + this.attributeCheckedList.map(attributeChecked => attributeChecked.id).indexOf(attributeId) === -1 + ) + if (attributeId !== undefined){ + let attributeInfo = this.categoryCommonElement.attributeList.find(attributeInfo => attributeInfo.id === attributeId); + this.attributeCheckedList.push(attributeInfo); + }else { + // attributeIdCheckedList [3] : attributeCheckedList [] -> [3] + // attributeIdCheckedList [3,5] : attributeCheckedList [3] -> [3,5] + // attributeIdCheckedList [3,5,9] : attributeCheckedList [3,5] -> [3,5,9] + // attributeIdCheckedList [3,9] : attributeCheckedList [3,5,9] -> [3,9] + // attributeCheckedList 集合 不在 attributeIdCheckedList 集合的元素,然后删除 + + } + + }, initRuleList(){ listRule({"params[isPage]": false}).then(response => { this.ruleList = response.data;