haoxuan
2023-09-01 1e1e5f612f252d66b0d0386cf52873bb1f3f7d7b
src/components/LeftNav.vue
@@ -118,18 +118,19 @@
            </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>
              <!-- 国标刷新图标 -->
              <div class="tree-edit gb-refresh" v-show="!TreeDataPool.gbReadonly">
              <!-- <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>
              </div>-->
              <div class="tree-edit gb-lock" v-show="showLock">
                <button @click="gbLockSwitch">
                  <i v-if="TreeDataPool.gbReadonly" class="el-icon-lock" style="font-size:16px"></i>
@@ -189,6 +190,10 @@
                </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
                ref="tree"
@@ -202,12 +207,7 @@
            </div>
          </div>
        </el-tab-pane>
        <el-tab-pane
          label="数据栈"
          name="dataStack"
          :style="`height:${height - 56}px;`"
          v-if="showDataStack"
        >
        <el-tab-pane label="数据栈" name="dataStack" v-if="showDataStack">
          <div class="local-vedio-area">
            <!-- 搜索 -->
            <div class="search-input">
@@ -233,7 +233,7 @@
                size="small"
                clearable
                @input="querySearchAsync('dir')"
                :style="'width:103px;'"
                :style="'width:148px;'"
              >
                <i
                  class="el-icon-search el-input__icon"
@@ -307,10 +307,12 @@
} from "@/api/camera";
import bus from "@/plugin/bus"
import TreeMenu from "@/components/treeMenu/index";
// import TreeMenu from "@/components/treeMenu/index";
import TreeMenu from "@/components/giantTree/index";
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 +336,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 +366,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 +380,7 @@
      }
      return arry;
    },
    isAdmin () {
    isAdmin() {
      if (
        sessionStorage.getItem("userInfo") &&
        sessionStorage.getItem("userInfo") !== ""
@@ -389,7 +391,7 @@
      return false;
    }
  },
  data () {
  data() {
    return {
      cameraAuth: "videoMonitor:camera",
      dataStack: "videoMonitor:dataStack",
@@ -441,10 +443,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 +462,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,18 +522,21 @@
        this.loadingGBTree = false;
      }, 1000 * 60);
    },
    querySearchAsync (type) {
    querySearchAsync(type) {
      clearTimeout(this.timeout);
      this.timeout = setTimeout(() => {
        if (type === "camera") {
          this.TreeDataPool.fetchTreeData();
        }
        if (type === "cluster") {
          this.TreeDataPool.fetchClusterTree();
        }
        if (type === "dir") {
          this.DataStackPool.fetchFiles();
        }
      }, 500);
    },
    handleClick (event) {
    handleClick(event) {
      if (event.name == 'dataStack') {
        this.DataStackPool.fetchFiles();
        this.DataStackPool.clean();
@@ -533,7 +545,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 +561,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 +590,7 @@
        console.log(res, '开启暂停参数')
      }
    },
    async deleteLocalFiles () {
    async deleteLocalFiles() {
      let list1 = this.getCheckedFiles();
      console.log(list1, '已勾选的视频')
      if (list1.length == 0) {
@@ -600,16 +612,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 +679,14 @@
      };
      fileReader.readAsBinaryString(_file);
    },
    exceed () {
    exceed() {
      this.$message.error("最多只能上传1个xls文件");
    },
    //删除文件
    remove () {
    remove() {
    },
    newCamera () {
    newCamera() {
      return {
        latitude: 0,
        rtsp: "",
@@ -855,15 +867,17 @@
    }
    .dev-vedio-list {
      padding: 0 15px;
      max-height: 740px;
      box-sizing: border-box;
      height: calc(100vh - 80px);
      //max-height: 740px;
      overflow-x: hidden;
      overflow-y: auto;
      @media screen and (max-height: 720px) {
        max-height: 580px;
      }
      @media screen and (min-height: 900px) {
        max-height: 740px;
      }
      // @media screen and (max-height: 720px) {
      //   max-height: 580px;
      // }
      // @media screen and (min-height: 900px) {
      //   max-height: 740px;
      // }
    }
    .dev-vedio-list::-webkit-scrollbar {
      /*滚动条整体样式*/
@@ -883,7 +897,7 @@
}
.tree-edit {
  z-index: 1;
  z-index: 2;
  font-size: 16px;
  position: absolute;
  top: 56px;
@@ -950,7 +964,7 @@
    color: #606266;
  }
}
.flex-box{
.flex-box {
  display: flex;
}
</style>