管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-06 531b6d25d21474f8df88bd484b901111e048837d
src/views/datamanage/catalogueManage.vue
@@ -237,6 +237,7 @@
      old_dirDat: [], //el树数据(拖动前)
      newData: [], //拖动后原始数据
      itemdetail: {},
      itemaName: null,
      backUpData: '',
      formLabelWidth: '150px',
      delChildID: '',
@@ -271,13 +272,18 @@
          this.oriData = res.result;
          this.newData = res.result;
          this.dirList = this.treeData(res.result);
          //  this.$nextTick(() => {
          if (this.itemdetail.id != null) {
          //    this.expandData=[15]
          //    this.$refs.tree.setCurrentKey(15);
          //   });
          if (this.itemaName != null) {
            this.$nextTick(() => {
              // this.expandData=[1]
              // this.$refs.tree.setCurrentKey(this.itemdetail.id);
              // document.getElementById(this.itemdetail.id).click();
              this.expandData = [this.itemaName]
              this.$refs.tree.setCurrentKey(this.itemaName);
            });
          }
@@ -378,12 +384,10 @@
      if (res == 1) {//新增同级
        id = this.itemdetail.pid;
        orderNum = this.getMaxOrderNum(this.newNode.parent.childNodes)
        lever = this.itemdetail.level;
      } else if (res == 2) {//新增子级
        id = this.itemdetail.id;
        orderNum = this.getMaxOrderNum(this.newNode.childNodes)
        lever = this.itemdetail.level + 1;
      }
@@ -428,12 +432,13 @@
              .then((res) => {
                setTimeout(() => {
                  this.fullscreenLoading = false;
                  if (res.code == 200) {
                    this.$message({
                      message: '添加成功',
                      type: 'success',
                    });
                    this.itemaName = res.result;
                    this.itemdetail = {};
                    this.ruleForm = {};
                    this.dialogFormVisible = false;
@@ -456,6 +461,8 @@
      });
    },
    remove(node, data) {
      this.itemaName =node.parent.data.id;
      this.$confirm('此操作将删除该节点, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
@@ -484,6 +491,7 @@
                  message: '删除成功!',
                });
                this.itemdetail = {};
                this.getDirTree();
              } else if (res[0].code == 200) {
                this.$message.error('删除成功,位置调整失败');
@@ -601,6 +609,7 @@
    },
    handleNodeClick(data, node) {
      // console.log(data);
      this.newNode = node;
      this.backUpData = JSON.stringify(data);
      this.itemdetail = JSON.parse(JSON.stringify(data));