hanbaoshan
2020-10-17 0e65c5001ad3623d6e4d8e023689ddd3708889a5
src/components/LeftNav.vue
@@ -156,7 +156,52 @@
          name="cluster"
          :style="`height:${height - 56}px;`"
          v-if="showCluster"
        ></el-tab-pane>
        >
          <div class="local-vedio-area">
            <!-- 搜索 -->
            <div class="navTopSelect">
              <div class="search-input flex-box">
                <el-select
                  v-model="TreeDataPool.searchCamType"
                  placeholder="请选择"
                  @change="searchClusterData"
                >
                  <el-option
                    v-for="item in searchTypeOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
                <span style="display: inline-block;padding: 0px 3px;"></span>
                <el-input
                  v-model="TreeDataPool.searchInput"
                  placeholder="搜索"
                  clearable
                  @input="querySearchAsync('cluster')"
                >
                  <i
                    class="el-icon-search el-input__icon"
                    style="color:#DCDFE6"
                    slot="prefix"
                    @click="searchClusterData"
                  ></i>
                </el-input>
              </div>
            </div>
            <div class="cluster-list">
              <tree-menu
                ref="tree"
                :app="appName"
                :treeName="'localTree'"
                :node="TreeDataPool.clusterData"
                :height="height"
                @addDevice="addCamera"
                @import="importCameras"
              />
            </div>
          </div>
        </el-tab-pane>
        <el-tab-pane
          label="数据栈"
          name="dataStack"
@@ -293,7 +338,7 @@
      return true;
    },
    showCam() {
      return this.appName === "Camera" || (this.appName === "Search" && (this.buttonAuthority.indexOf("search:camera") >= 0 || this.isAdmin));
      return this.appName === "Camera" || this.appName === 'Cluster' || (this.appName === "Search" && (this.buttonAuthority.indexOf("search:camera") >= 0 || this.isAdmin));
    },
    showCluster() {
      return this.appName === "Cluster";
@@ -400,6 +445,8 @@
    };
  },
  created() {
    console.log(this.appName)
    console.log(this.showCam)
    if (this.showCam) {
      this.TreeDataPool.treeActiveName = "camera"
      this.TreeDataPool.fetchTreeData();
@@ -409,6 +456,10 @@
      this.DataStackPool.fetchFiles();
    }
    if (this.showCluster) {
      this.TreeDataPool.treeActiveName = "cluster"
      this.TreeDataPool.fetchClusterTree();
    }
  },
  methods: {
    searchAreaData() {
@@ -416,6 +467,9 @@
    },
    searchDataStack() {
      this.DataStackPool.fetchFiles();
    },
    searchClusterData () {
      this.TreeDataPool.fetchClusterTree();
    },
    lockSwitch() {
      this.TreeDataPool.readonly = !this.TreeDataPool.readonly;
@@ -896,4 +950,7 @@
    color: #606266;
  }
}
.flex-box{
  display: flex;
}
</style>