heyujie
2021-03-16 959895b80e8915cacb17e4f36830254c6c271572
Merge branch 'master' of http://192.168.5.5:10010/r/vue-smart-ai
2个文件已修改
49 ■■■■ 已修改文件
src/Pool/TreeData.ts 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/giantTree/index.vue 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Pool/TreeData.ts
@@ -282,7 +282,7 @@
      // vue-js-tree 默认展开,控制部分折叠. z-tree 默认折叠, 控制部分展开
      if (this.foldNodeList[n.id]) {
        if (this.zTree) {
          n.open = true
          n.open = false
        } else {
          n.opened = false
        }
@@ -326,6 +326,9 @@
    node.forEach(n => {
      if (n.children && n.children.length > 0) {
        if (this.zTree) {
          n.open = true
        }
        this.sortTreeData(n.children)
      }
    })
src/components/giantTree/index.vue
@@ -68,7 +68,7 @@
      default: 0
    }
  },
  data () {
  data() {
    return {
      hoverNodeId: "",
      showDialog: false,
@@ -86,7 +86,7 @@
      curNodeTid: '',
    };
  },
  created () {
  created() {
    // console.log(this.height, '树高度')
    this.TreeDataPool.zTree = true;
@@ -134,7 +134,7 @@
      }
    },
    findTidByIdFromArr (arr) {
    findTidByIdFromArr(arr) {
      let len = arr.length;
      let _this = this;
      for (var i = 0; i < len; i++) {
@@ -142,13 +142,13 @@
          _this.curNodeTid = arr[i].tId;
          break;
        }
        if(arr[i].children){
        if (arr[i].children) {
          this.findTidByIdFromArr(arr[i].children);
        }
      }
    },
    onDblClick (evt, treeId, item) {
    onDblClick(evt, treeId, item) {
      if (item.type !== "4" || this.app !== "Camera") {
        return;
      }
@@ -207,13 +207,13 @@
        this.TreeDataPool.activeVideoIndex = nullVideoIndex;
      }
    },
    addCamera (node) {
    addCamera(node) {
      this.$emit("addDevice", node);
    },
    importCameras (node) {
    importCameras(node) {
      this.$emit("import", node);
    },
    addNode (node) {
    addNode(node) {
      this.dialogForm = {
        text: "",
        method: "add",
@@ -221,7 +221,7 @@
      };
      this.showDialogBox(event);
    },
    editNode (node) {
    editNode(node) {
      this.dialogForm = {
        text: node.name,
        method: "edit",
@@ -231,10 +231,10 @@
      };
      this.showDialogBox(event);
    },
    delNode (node) {
    delNode(node) {
      this.TreeDataPool.del(node.id);
    },
    submitForm () {
    submitForm() {
      // 提交新增或者编辑区域节点表单
      this.$refs.dialogForm.validate(valid => {
        if (valid) {
@@ -254,18 +254,18 @@
      });
      this.hideDialogBox();
    },
    hideDialogBox () {
    hideDialogBox() {
      this.showDialog = false;
      this.dialogForm = { text: "" };
    },
    showDialogBox (event) {
    showDialogBox(event) {
      let { clientX = 0, offsetY = 0 } = event;
      // this.clientX = clientX - 120;
      this.clientX = 50;
      this.clientY = offsetY;
      this.showDialog = true;
    },
    itemClick (evt, treeId, treeNode) {
    itemClick(evt, treeId, treeNode) {
      console.log(evt, treeId)
      this.TreeDataPool.selectedNode = treeNode;
@@ -293,7 +293,7 @@
    //   this.TreeDataPool.updateZTreeCheckNodes([treeNode]);
    // },
    itemCheck (evt, treeId, treeNode) {
    itemCheck(evt, treeId, treeNode) {
      this.TreeDataPool.selectedNode = treeNode;
      this.TreeDataPool.treeType = this.treeName;
@@ -303,14 +303,14 @@
      this.TreeDataPool.updateZTreeCheckNodes(checkedNodes);
    },
    //展开
    itemExpand (e, id, node) {
      this.TreeDataPool.foldNodeList[node.id] = true
    },
    // 折叠
    itemCollapse (e, id, node) {
    itemExpand(e, id, node) {
      delete this.TreeDataPool.foldNodeList[node.id]
    },
    dropNode (node, item, draggedItem, e) {
    // 折叠
    itemCollapse(e, id, node) {
      this.TreeDataPool.foldNodeList[node.id] = true
    },
    dropNode(node, item, draggedItem, e) {
      // console.log('dropNode', node, item, draggedItem);
      this.TreeDataPool.dropNode(draggedItem.id, item.id)
    }