| | |
| | | <div class="products"> |
| | | <div class="title">全部产品</div> |
| | | <div class="productList"> |
| | | <div class="productItem" v-for="(item, index) in productList" :key="index" @click="jump(item)"> |
| | | <div class="productItem" v-for="(item, index) in permissionMenuList" :key="index" @click="jump(item)"> |
| | | <img :src="item.icon" alt="" /> |
| | | <div class="name">{{ item.name }}</div> |
| | | </div> |
| | |
| | | return 0 |
| | | } |
| | | return parseInt((this.warningChecked / this.warningTotal) * 100) + "%" |
| | | }, |
| | | permissionMenuList() { |
| | | let user = JSON.parse(sessionStorage.getItem("userInfo")) |
| | | if (user.username == "Administrator") { |
| | | return this.productList |
| | | } |
| | | |
| | | return this.productList.filter(item => { |
| | | return user.permissions.indexOf(item.permission) >= 0 |
| | | }) |
| | | |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | icon: "/images/manageCenter/search.png", |
| | | openPath: "/dataView", |
| | | path: "/dataView", |
| | | permission: "statisticMng" |
| | | permission: "dataViewMng" |
| | | }, |
| | | |
| | | { |
| | |
| | | icon: "/images/manageCenter/manage2.png", |
| | | openPath: "/report", |
| | | path: "/report", |
| | | permission: "statisticMng" |
| | | permission: "dataPushMng" |
| | | }, |
| | | |
| | | { |
| | |
| | | icon: "/images/manageCenter/manage2.png", |
| | | openPath: "/video", |
| | | path: "/video", |
| | | permission: "statisticMng" |
| | | permission: "videoMng" |
| | | } |
| | | ], |
| | | cameraTree: [], |
| | |
| | | if (camereReq && camereReq.success) { |
| | | this.cameraTree = camereReq.data.treeMenu |
| | | |
| | | // 清理没有权限管理的摄像机, 后端修复后删除 |
| | | let userInfo = JSON.parse(sessionStorage.getItem("userInfo")) |
| | | |
| | | // 管理员权限 |
| | | if (userInfo.username == "Administrator") { |
| | | return |
| | | } |
| | | if (userInfo.username != "Administrator") { |
| | | // 清理没有权限管理的摄像机, 后端修复后删除 |
| | | let checkedCameras = userInfo.email |
| | | |
| | | let checkedCameras = userInfo.email |
| | | |
| | | // basic 为子账户默认的空字段,表示可管理的摄像机目录为空 |
| | | if (checkedCameras == "basic") { |
| | | this.cameraTree = [] |
| | | } else { |
| | | let cameraIds = checkedCameras.split(",") |
| | | this.authorizedCameras = cameraIds |
| | | this.TreeDataPool.removeNoAuthorizedNode(this.cameraTree, cameraIds) |
| | | } |
| | | // basic 为子账户默认的空字段,表示可管理的摄像机目录为空 |
| | | if (checkedCameras == "basic") { |
| | | this.cameraTree = ["basic"] |
| | | } else { |
| | | let cameraIds = checkedCameras.split(",") |
| | | this.authorizedCameras = cameraIds |
| | | this.TreeDataPool.removeNoAuthorizedNode(this.cameraTree, cameraIds) |
| | | } |
| | | } |
| | | |
| | | let tmpTree = JSON.parse(JSON.stringify(this.cameraTree)) |
| | | |