diff --git a/front/src/views/personalCenter/components/PurchaseVehicle.vue b/front/src/views/personalCenter/components/PurchaseVehicle.vue index f557a4b3..6fd1634f 100644 --- a/front/src/views/personalCenter/components/PurchaseVehicle.vue +++ b/front/src/views/personalCenter/components/PurchaseVehicle.vue @@ -312,18 +312,18 @@ // ) let scArr = [] if (checkedListAbility.value.length === 0) { - message.error('请选择需要收藏的数据') + message.warning('请选择需要收藏的数据') } else { list.value.forEach((val) => { if (val.children) { val.children.map((item) => { - if (item.resourceId == '8888888880000000001') { - message.warning('摄像头无法添加收藏!') - } else { - if ( - checkedListAbility.value.indexOf(item.id) > -1 && - item.delFlag == 0 - ) { + if ( + checkedListAbility.value.indexOf(item.id) > -1 && + item.delFlag == 0 + ) { + if (item.resourceId == '8888888880000000001') { + message.warning('摄像头无法添加收藏!') + } else { scArr.push({ resourceId: item.resourceId }) } } @@ -338,7 +338,7 @@ } }) } else { - message.error('下架的数据无法收藏') + message.warning('下架的数据无法收藏') } } } @@ -750,7 +750,7 @@ // 删除按钮 const delList = () => { if (checkedListAbility.value.length == 0) { - message.error('请先选择需要操作的数据!') + message.warning('请先选择需要操作的数据!') } else { sgcDel({ ids: checkedListAbility.value, @@ -807,36 +807,34 @@ } // 一键申请 const apply = () => { - // list.value.forEach((val) => { - // if (checkedList.value.indexOf(val.deptId) !== -1) { - // if (val.delFlag != 0) { - // checkedList.value.splice(checkedList.value.indexOf(val.deptId), 1) - // val.checked = false - // message.error('已下架的能力无法申请!') - // } - // } - // }) if (checkedListAbility.value.length == 0) { - message.error('请先选择需要申请的数据!') + message.warning('请先选择需要申请的数据!') } else { let arr = [] + let delArr = [] list.value.map((val) => { val.arr = val.children.filter((item) => { console.log('选择的数据=============>', item) - if ( - checkedListAbility.value.indexOf(item.id) > -1 && - item.delFlag != 0 - ) { - return item + if (checkedListAbility.value.indexOf(item.id) > -1) { + if (item.delFlag == 0) { + return item + } else { + delArr.push(item) + } } }) }) arr = list.value.filter((val) => val.arr.length !== 0) - console.log('一键申请===================>', arr) - localStorage.setItem('applyList', JSON.stringify(arr)) - router.push({ - path: '/apply', - }) + if (delArr.length > 0) { + message.warning('已经下架的能力无法申请!') + } + if (arr.length > 0) { + console.log('一键申请===================>', arr) + localStorage.setItem('applyList', JSON.stringify(arr)) + router.push({ + path: '/apply', + }) + } } }