From 0175cda6150656bc74b34c6f6c71edd1e1fc653c Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@iotlink.com> Date: 星期四, 04 二月 2021 18:22:54 +0800 Subject: [PATCH] treee, 修复tab切换时树的选中状态.添加区域 --- src/pages/cameraAccess/index/VideoManage.vue | 67 +++++++++++++++------------------ 1 files changed, 30 insertions(+), 37 deletions(-) diff --git a/src/pages/cameraAccess/index/VideoManage.vue b/src/pages/cameraAccess/index/VideoManage.vue index 5e2ba7e..c5b7296 100644 --- a/src/pages/cameraAccess/index/VideoManage.vue +++ b/src/pages/cameraAccess/index/VideoManage.vue @@ -10,21 +10,21 @@ <el-tab-pane :label="firstLabeName" name="camera-info" - v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('VIDEOCAMERA:camera:info')" + v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('cameraAccess:cameraInfo')" > <camera-info ref="cameraInfo" /> </el-tab-pane> <el-tab-pane :label="firstLabeName" name="camera-info" - v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('VIDEOCAMERA:dataStack:stackInfo')" + v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('dataStack:cameraInfo')" > <data-stack-info ref="dataStackInfo" /> </el-tab-pane> <el-tab-pane label="鐙珛鍦烘櫙" name="separate-rule" - v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('VIDEOCAMERA:camera:selfRule')" + v-if="this.TreeDataPool.treeActiveName == 'camera' && isShow('cameraAccess:selfRule')" > <separate-rules ref="sepRule" /> <!-- <local-separate ref="localSeparate" v-else></local-separate> --> @@ -32,7 +32,7 @@ <el-tab-pane label="鐙珛鍦烘櫙" name="separate-rule" - v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('VIDEOCAMERA:dataStack:selfRule')" + v-if="this.TreeDataPool.treeActiveName == 'dataStack' && isShow('dataStack:selfRule')" > <separate-rules ref="sepRule" /> <!-- <local-separate ref="localSeparate" v-else></local-separate> --> @@ -40,7 +40,7 @@ <el-tab-pane label="鑱斿姩鍦烘櫙" name="linkage-rule" - v-if="(isShow('VIDEOCAMERA:camera:linkRule') || isShow('VIDEOCAMERA:dataStack:linkRule')) && this.TreeDataPool.treeActiveName == 'camera'" + v-if="(isShow('cameraAccess:linkRule')) && this.TreeDataPool.treeActiveName == 'camera'" > <linkage-rule ref="linkRule" /> </el-tab-pane> @@ -65,7 +65,7 @@ DataStackInfo, SeparateRules, LinkageRule }, - data() { + data () { return { activeName: "camera-info", buttonAuthority: sessionStorage.getItem("buttonAuthoritys") || [], @@ -73,7 +73,7 @@ }; }, computed: { - isAdmin() { + isAdmin () { if ( sessionStorage.getItem("userInfo") && sessionStorage.getItem("userInfo") !== "" @@ -81,9 +81,10 @@ let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username; return loginName === "superadmin" || loginName === "basic"; } + return false; }, - firstLabeName() { + firstLabeName () { return this.TreeDataPool.treeActiveName === "camera" ? "鎽勫儚鏈轰俊鎭�" : "鏁版嵁鏍堜俊鎭�" } }, @@ -105,7 +106,7 @@ } }, "TreeDataPool.selectedNodes": { - handler(nodes) { + handler (nodes) { if (this.activeName == "linkage-rule") { this.$refs.linkRule.initCameraData(); } @@ -113,7 +114,7 @@ deep: true }, "DataStackPool.selectedDir": { - handler(node, oldNode) { + handler (node, oldNode) { if (this.TreeDataPool.treeActiveName !== 'dataStack') { return } @@ -129,28 +130,23 @@ }, }, - created() { + created () { if (this.TreeDataPool.treeActiveName == 'camera') { - if (this.isShow('VIDEOCAMERA:camera:info')) { + if (this.isShow('cameraAccess:cameraInfo')) { this.activeName = "camera-info" - } else if (this.isShow('VIDEOCAMERA:camera:selfRule') || this.isShow('VIDEOCAMERA:datastack:selfRule')) { + } else if (this.isShow('cameraAccess:selfRule')) { this.activeName = "separate-rule" - } else if (this.isShow('VIDEOCAMERA:camera:linkRule') || this.isShow('VIDEOCAMERA:datastack:linkRule')) { + } else if (this.isShow('cameraAccess:linkRule')) { this.activeName = "linkage-rule" - } else if (this.isShow('VIDEOCAMERA:camera:resourceCalc') || this.isShow('VIDEOCAMERA:datastack:resourceCalc')) { - this.activeName = "poll-setting" } } else { - if (this.isShow('VIDEOCAMERA:camera:info')) { + if (this.isShow('dataStack:cameraInfo')) { this.activeName = "camera-info" - } else if (this.isShow('VIDEOCAMERA:camera:selfRule') || this.isShow('VIDEOCAMERA:datastack:selfRule')) { + } else if (this.isShow('dataStack:selfRule')) { this.activeName = "separate-rule" - } else if (this.isShow('VIDEOCAMERA:camera:linkRule') || this.isShow('VIDEOCAMERA:datastack:linkRule')) { - this.activeName = "linkage-rule" - } else if (this.isShow('VIDEOCAMERA:camera:resourceCalc') || this.isShow('VIDEOCAMERA:datastack:resourceCalc')) { - this.activeName = "poll-setting" } } + this.TreeDataPool.readonly = true; this.TreeDataPool.gbReadonly = true; this.TreeDataPool.multiple = false; @@ -158,11 +154,11 @@ this.selectedNodes = []; this.VideoManageData.init(); }, - beforeDestroy() { + beforeDestroy () { clearInterval(this.intervalTimer); //this.TreeDataPool.treeActiveName = "camera"; }, - mounted() { + mounted () { this.$nextTick(() => { bus.$on("addCameraOnTree", node => { this.handAddDevice(node); @@ -180,32 +176,24 @@ }, 10000) }, methods: { - isShow(authority) { - if (this.isAdmin) { - return true; - } else if (this.buttonAuthority.indexOf("," + authority + ",") > -1) { - return true; - } else if ("videoCamera:pollSetting" === authority) { - return true; - } else { - return false; - } + isShow (authority) { + return this.isAdmin || this.buttonAuthority.indexOf("," + authority + ",") > -1 }, - handAddDevice(node) { + handAddDevice (node) { let _this = this; setTimeout(() => { _this.$refs.cameraInfo.addDevice(node); _this.activeName = "camera-info"; }, 100); }, - handAddDIr(node) { + handAddDIr (node) { let _this = this; setTimeout(() => { _this.$refs.dataStackInfo.addDir(node); _this.activeName = "camera-info"; }, 100); }, - handleClick(tab, event) { + handleClick (tab, event) { this.TreeDataPool.multiple = tab.name === "linkage-rule"; if (tab.name === "camera-info") { if (this.TreeDataPool.treeActiveName == 'camera') { @@ -298,6 +286,11 @@ overflow-y: auto; padding: 0; } + .video-tab > .el-tabs__content::-webkit-scrollbar { + /*婊氬姩鏉℃暣浣撴牱寮�*/ + width: 6px; /*楂樺鍒嗗埆瀵瑰簲妯珫婊氬姩鏉$殑灏哄*/ + height: 6px; + } .el-tab-pane { width: 100%; //height: 100%; -- Gitblit v1.8.0