zhangzengfei
2020-11-03 a75952451bb376a4c5624e62c744930f91f4401b
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,53 @@
    if (this.showCluster) {
      this.TreeDataPool.treeActiveName = "cluster"
      this.TreeDataPool.fetchClusterTree();
      findCluster().then(res => {
        if (res.success) {
          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 +526,7 @@
        this.loadingGBTree = false;
      }, 1000 * 60);
    },
    querySearchAsync (type) {
    querySearchAsync(type) {
      clearTimeout(this.timeout);
      this.timeout = setTimeout(() => {
        if (type === "camera") {
@@ -524,7 +537,7 @@
        }
      }, 500);
    },
    handleClick (event) {
    handleClick(event) {
      if (event.name == 'dataStack') {
        this.DataStackPool.fetchFiles();
        this.DataStackPool.clean();
@@ -533,7 +546,7 @@
      this.TreeDataPool.treeActiveName = event.name
      console.log("当前激活name:", this.TreeDataPool.treeActiveName)
    },
    async changeEnable () {
    async changeEnable() {
      if (this.PollData.localVideo === 0) {
        this.$notify({
          title: "失败",
@@ -549,13 +562,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 +591,7 @@
        console.log(res, '开启暂停参数')
      }
    },
    async deleteLocalFiles () {
    async deleteLocalFiles() {
      let list1 = this.getCheckedFiles();
      console.log(list1, '已勾选的视频')
      if (list1.length == 0) {
@@ -600,16 +613,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 +680,14 @@
      };
      fileReader.readAsBinaryString(_file);
    },
    exceed () {
    exceed() {
      this.$message.error("最多只能上传1个xls文件");
    },
    //删除文件
    remove () {
    remove() {
    },
    newCamera () {
    newCamera() {
      return {
        latitude: 0,
        rtsp: "",
@@ -950,7 +963,7 @@
    color: #606266;
  }
}
.flex-box{
.flex-box {
  display: flex;
}
</style>