zhangzengfei
2020-09-17 68fe1629ea048cf3b806b700f9934f990aa4bfdf
可视化摄像机树排序,取消图标隐藏
4个文件已修改
77 ■■■■ 已修改文件
src/pages/visual/Pool/TreeData.ts 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/visual/components/LeftNav.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/visual/components/TopNav.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/visual/index/home.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/visual/Pool/TreeData.ts
@@ -119,6 +119,29 @@
    }
  }
  sortTreeData(node) {
    if (!node) {
      return
    }
    node.sort(function (obj1: any, obj2: any) {
      var val1 = obj1.name;
      var val2 = obj2.name;
      if (val1 < val2) {
        return -1;
      } else if (val1 > val2) {
        return 1;
      } else {
        return 0;
      }
    });
    node.forEach(n => {
      if (n.children && n.children.length > 0) {
        this.sortTreeData(n.children)
      }
    })
  }
  async fetchLocalTree() {
    const rsp: any = await getLocalCameraTree({
      searchType: this.searchCamType,
@@ -127,19 +150,12 @@
    });
    if (rsp && rsp.success) {
      this.treeData = rsp.data
      this.treeData.sort(function (obj1: any, obj2: any) {
        var val1 = obj1.id;
        var val2 = obj2.id;
        if (val1 < val2) {
          return -1;
        } else if (val1 > val2) {
          return 1;
        } else {
          return 0;
        }
      });
      this.treeData = rsp.data ? rsp.data : []
      if (this.treeData && this.treeData.length > 0) {
        this.sortTreeData(this.treeData)
      }
      // 设置禁止拖拽摄像机到摄像机节点
      this.treeDataPure = JSON.parse(JSON.stringify(this.treeData));
    }
  }
@@ -152,17 +168,9 @@
    if (rsp && rsp.success) {
      this.gb28181Data = rsp.data
      this.gb28181Data.sort(function (obj1: any, obj2: any) {
        var val1 = obj1.id;
        var val2 = obj2.id;
        if (val1 < val2) {
          return -1;
        } else if (val1 > val2) {
          return 1;
        } else {
          return 0;
        }
      });
      if (this.gb28181Data && this.gb28181Data.length > 0) {
        this.sortTreeData(this.gb28181Data)
      }
      this.gb28181DataPure = JSON.parse(JSON.stringify(this.gb28181Data));
    }
src/pages/visual/components/LeftNav.vue
@@ -213,10 +213,6 @@
    },
    closeTree() {
      this.TreeDataPool.showTreeBox = false;
      this.CategoryData.isShow = false;
      this.$nextTick(() => {
        this.CategoryData.isShow = true;
      });
    },
    addNode(event) {
      this.$refs.tree.addNode(event, { id: 0 });
src/pages/visual/components/TopNav.vue
@@ -22,7 +22,6 @@
  },
  methods: {
    slideLeft() {
      this.CategoryData.isShow = false;
      this.TreeDataPool.showTreeBox = !this.TreeDataPool.showTreeBox;
    },
  }
src/pages/visual/index/home.vue
@@ -48,18 +48,14 @@
          </div>
        </div>
        <div v-if="radioType === '1'" id="category" class="category-parent">
          <category
            v-if="CategoryData.isShow"
            :xAxisData="CategoryData.xAxisArray"
            :seriesData="CategoryData.seriesArray"
          ></category>
          <category :xAxisData="CategoryData.xAxisArray" :seriesData="CategoryData.seriesArray"></category>
        </div>
        <div v-if="radioType === '2'" class="div-realTime">
          <realTimeList></realTimeList>
        </div>
      </div>
      <div v-if="radioType === '1'" id="category" class="category-parent">
        <category v-if="CategoryData.isShow"></category>
        <category></category>
      </div>
      <div v-if="radioType === '2'" class="div-realTime">
        <realTimeList></realTimeList>
@@ -142,7 +138,7 @@
          </div>
        </div>
        <div class="div-pie">
          <mutPie v-if="CategoryData.isShow"></mutPie>
          <mutPie></mutPie>
        </div>
        <div class="bottom-title">
          <span class="s-1">摄像机</span>
@@ -159,7 +155,6 @@
          <div class="div-pie" v-if="CategoryData.dataStatus==='default'">
            <span>预警事件</span>
            <pie
              v-if="CategoryData.isShow"
              :seriesName="CategoryData.pieName"
              :radiusType="radiusType"
              :seriesData="CategoryData.pieData"
@@ -240,12 +235,7 @@
    // 监听窗口
    document.addEventListener("visibilitychange", this.visibilitychange, false);
    window.addEventListener('resize', this.windowSizeChange)
    this.CategoryData.isShow = false;
    this.$nextTick(() => {
      // let height = document.getElementById('category').clientHeight
      // console.log(height,'category的高度')
      this.CategoryData.isShow = true;
    })
    this.timer = setInterval(() => {
      this.VideoPhotoData.capture()
      this.CategoryData.realTimeCapture();