From 0d110a5af6f09f32088a964a7199c8b14a0572b0 Mon Sep 17 00:00:00 2001 From: "851673013@qq.com" <851673013@qq.com> Date: Fri, 1 Jul 2022 18:20:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=AE=BE=E6=96=BD-bug414?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/views/home/infrastructurePage.vue | 46 +++++++++++---------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/front/src/views/home/infrastructurePage.vue b/front/src/views/home/infrastructurePage.vue index e357fa94..0704d43b 100644 --- a/front/src/views/home/infrastructurePage.vue +++ b/front/src/views/home/infrastructurePage.vue @@ -118,6 +118,7 @@ import { getCategoryTreePage } from '@/api/personalCenter' import { dataType } from 'element-plus/es/components/table-v2/src/common' import { useRouter } from 'vue-router' + import { message } from 'ant-design-vue' import { ref, reactive, onMounted } from 'vue' import { getCameraByParentId, @@ -125,7 +126,6 @@ getCameraAllLabel, } from '@/api/videoSurveillance' import { sgcInsert } from '@/api/home' - import { message } from 'ant-design-vue' import mybus from '@/myplugins/mybus' const router = useRouter() const options = reactive({ @@ -350,26 +350,30 @@ dept.deptName = infrastructure.deptName } const apply = () => { - console.log('一键申请', selectedList.value) - let arr = [ - { - arr: [ - { - description: '', - note1: JSON.stringify(selectedList.value), - resourceId: '1522550195055828996', - resourceName: '摄像头列表', - type: '基础设施', - }, - ], - deptId: dept.deptId, - deptName: dept.deptName, - }, - ] - localStorage.setItem('applyList', JSON.stringify(arr)) - router.push({ - path: '/apply', - }) + if (selectedRowKeys.value.length != 0) { + console.log('一键申请', selectedList.value) + let arr = [ + { + arr: [ + { + description: '', + note1: JSON.stringify(selectedList.value), + resourceId: '1522550195055828996', + resourceName: '摄像头列表', + type: '基础设施', + }, + ], + deptId: dept.deptId, + deptName: dept.deptName, + }, + ] + localStorage.setItem('applyList', JSON.stringify(arr)) + router.push({ + path: '/apply', + }) + } else { + message.error('请选择需要申请的数据') + } } // 添加至购物车 const addShopCar = () => {