From 2379a27a8b2e4368dc2079557525aeed6a11c631 Mon Sep 17 00:00:00 2001
From: hanbaoshan <hanbaoshan@aiotlink.com>
Date: 星期四, 22 十月 2020 14:10:31 +0800
Subject: [PATCH] 修复目录树切换数据栈treeNodes传入空串的bug
---
src/components/LeftNav.vue | 90 ++++++++++++++++++++++++++-------------------
1 files changed, 52 insertions(+), 38 deletions(-)
diff --git a/src/components/LeftNav.vue b/src/components/LeftNav.vue
index 6f97a2a..421a4e1 100644
--- a/src/components/LeftNav.vue
+++ b/src/components/LeftNav.vue
@@ -118,7 +118,7 @@
</el-submenu>
<el-submenu index="1">
<template slot="title">
- <i class="iconfont iconGBx"></i>
+ <i class="iconfont iconGBx" style="margin-left:-4px;"></i>
<b class="tree-font">GB28181</b>
</template>
@@ -126,7 +126,8 @@
<div class="tree-edit gb-refresh" v-show="!TreeDataPool.gbReadonly">
<el-tooltip content="鍒锋柊" placement="top" popper-class="atooltip">
<button @click="refreshGB">
- <i class="el-icon-refresh" style="font-size:16px"></i>
+ <i v-if="loadingGBTree" class="el-icon-loading" style="font-size:16px"></i>
+ <i v-else class="el-icon-refresh" style="font-size:16px"></i>
</button>
</el-tooltip>
</div>
@@ -188,6 +189,10 @@
></i>
</el-input>
</div>
+ </div>
+ <div class="top-menu" style="margin:0 0 10px;text-align:left;">
+ <span class="iconfont iconjiqun" style="font-size:20px;"></span>
+ <span style="font-size:14px; margin-left: 5px;font-weight: 600;">{{clusterName}}</span>
</div>
<div class="cluster-list">
<tree-menu
@@ -311,6 +316,7 @@
import LocalVedioList from '@/components/subComponents/LocalVedioList';
import FileUpload from '@/components/subComponents/FileUpload/index';
import XLSX from 'xlsx'
+import { findCluster } from "@/api/clusterManage";
export default {
components: {
@@ -334,17 +340,17 @@
},
computed: {
- showTab () {
+ showTab() {
return true;
},
- showCam () {
+ showCam() {
return this.appName === "Camera" || this.appName === 'Cluster' || (this.appName === "Search" && (this.buttonAuthority.indexOf("search:camera") >= 0 || this.isAdmin));
},
- showCluster () {
+ showCluster() {
return this.appName === "Cluster";
},
// 鏁版嵁鏍堥厤缃繀椤绘樉绀恒�� 妫�绱㈤�氳繃鏉冮檺鎺у埗鏄剧ず, 鏈畨瑁呮暟鎹爤涔熶笉鏄剧ず
- showDataStack () {
+ showDataStack() {
if (this.appName === "DataStack") {
return true;
}
@@ -364,10 +370,10 @@
return false;
},
- showLock () {
+ showLock() {
return this.edit;
},
- openeds () {
+ openeds() {
let arry = [];
for (let i = 0; i < this.TreeDataPool.openeds.length; i++) {
if (this.TreeDataPool.openeds[i]) {
@@ -378,7 +384,7 @@
}
return arry;
},
- isAdmin () {
+ isAdmin() {
if (
sessionStorage.getItem("userInfo") &&
sessionStorage.getItem("userInfo") !== ""
@@ -389,7 +395,7 @@
return false;
}
},
- data () {
+ data() {
return {
cameraAuth: "videoMonitor:camera",
dataStack: "videoMonitor:dataStack",
@@ -441,10 +447,11 @@
fileUploadBox: false,
loadingGBTree: false,
importAreaId: "",
- menuLoading: false
+ menuLoading: false,
+ clusterName: ''
};
},
- created () {
+ created() {
console.log(this.appName)
console.log(this.showCam)
if (this.showCam) {
@@ -459,47 +466,54 @@
if (this.showCluster) {
this.TreeDataPool.treeActiveName = "cluster"
this.TreeDataPool.fetchClusterTree();
+ findCluster().then(res => {
+ if (res.success) {
+ debugger
+ this.clusterName = res.data.clusterName;
+ }
+
+ })
}
},
methods: {
- searchAreaData () {
+ searchAreaData() {
this.TreeDataPool.fetchTreeData();
},
- searchDataStack () {
+ searchDataStack() {
this.DataStackPool.fetchFiles();
},
- searchClusterData () {
+ searchClusterData() {
this.TreeDataPool.fetchClusterTree();
},
- lockSwitch () {
+ lockSwitch() {
this.TreeDataPool.readonly = !this.TreeDataPool.readonly;
},
- gbLockSwitch () {
+ gbLockSwitch() {
this.TreeDataPool.gbReadonly = !this.TreeDataPool.gbReadonly;
},
- dataStackLockSwitch () {
+ dataStackLockSwitch() {
this.DataStackPool.readonly = !this.DataStackPool.readonly;
},
- closeTree () {
+ closeTree() {
this.TreeDataPool.showTreeBox = false;
bus.$emit('refreshCompareImg')
},
- addNode (event) {
+ addNode(event) {
this.$refs.tree.addNode(event, { id: 0 });
},
- addCamera (node) {
+ addCamera(node) {
bus.$emit("addCameraOnTree", node);
},
- addDir (node) {
+ addDir(node) {
bus.$emit("addDirOnTree", node);
},
- menuOpen (index) {
+ menuOpen(index) {
this.TreeDataPool.openeds[index] = true;
},
- menuClose (index) {
+ menuClose(index) {
this.TreeDataPool.openeds[index] = false;
},
- refreshGB () {
+ refreshGB() {
// 闃叉閲嶅鍒锋柊
if (this.loadingGBTree) {
return;
@@ -513,7 +527,7 @@
this.loadingGBTree = false;
}, 1000 * 60);
},
- querySearchAsync (type) {
+ querySearchAsync(type) {
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
if (type === "camera") {
@@ -524,7 +538,7 @@
}
}, 500);
},
- handleClick (event) {
+ handleClick(event) {
if (event.name == 'dataStack') {
this.DataStackPool.fetchFiles();
this.DataStackPool.clean();
@@ -533,7 +547,7 @@
this.TreeDataPool.treeActiveName = event.name
console.log("褰撳墠婵�娲籲ame锛�", this.TreeDataPool.treeActiveName)
},
- async changeEnable () {
+ async changeEnable() {
if (this.PollData.localVideo === 0) {
this.$notify({
title: "澶辫触",
@@ -549,13 +563,13 @@
console.log(res, '鍒囨崲鏈湴鏂囦欢鍒嗘瀽寮�鍏�')
}
},
- getCheckedFiles () {
+ getCheckedFiles() {
let list1 = this.TreeDataPool.localVedioList.filter(i => {
return i.checkStatus
})
return list1
},
- async stopVedio (status) {
+ async stopVedio(status) {
// let list1 = this.getCheckedFiles();
if (this.TreeDataPool.checkedLocalVedio.length == 0) {
this.$notify({
@@ -578,7 +592,7 @@
console.log(res, '寮�鍚殏鍋滃弬鏁�')
}
},
- async deleteLocalFiles () {
+ async deleteLocalFiles() {
let list1 = this.getCheckedFiles();
console.log(list1, '宸插嬀閫夌殑瑙嗛')
if (list1.length == 0) {
@@ -600,16 +614,16 @@
}
},
- refrash (current, pageSize) {
+ refrash(current, pageSize) {
this.TreeDataPool.localCurrentPage = current;
},
- importCameras (area) {
+ importCameras(area) {
this.importAreaId = area
this.$refs["import-btn"].click()
},
- async uploadFile (params) {
+ async uploadFile(params) {
const _file = params.file;
const fileReader = new FileReader();
fileReader.onload = (ev) => {
@@ -667,14 +681,14 @@
};
fileReader.readAsBinaryString(_file);
},
- exceed () {
+ exceed() {
this.$message.error("鏈�澶氬彧鑳戒笂浼�1涓獂ls鏂囦欢");
},
//鍒犻櫎鏂囦欢
- remove () {
+ remove() {
},
- newCamera () {
+ newCamera() {
return {
latitude: 0,
rtsp: "",
@@ -950,7 +964,7 @@
color: #606266;
}
}
-.flex-box{
+.flex-box {
display: flex;
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0