管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-05-08 a79e85a2de679cc4886d82eb70d0b90d3e2a8861
src/views/datamanage/layerManagement.vue
@@ -438,19 +438,24 @@
          if (currentId != 0) {
            const tempChildrenNodex1 = pchildNodes[currentId - 1];
            const tempChildrenNodex2 = pchildNodes[currentId];
            tempChildrenNodex2.orderNum =
              pchildNodes[currentId - 1].data.orderNum;
            tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum;
            // tempChildrenNodex2.orderNum =
            //   pchildNodes[currentId - 1].data.orderNum;
            // tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum;
            var arr = [];
            this.oriData.filter((res) => {
              if (res.id == tempChildrenNodex2.data.id) {
                res.orderNum = tempChildrenNodex2.orderNum;
                // res.orderNum = tempChildrenNodex2.orderNum;
                arr.push(res);
              } else if (res.id == tempChildrenNodex1.data.id) {
                res.orderNum = tempChildrenNodex1.orderNum;
                // res.orderNum = tempChildrenNodex1.orderNum;
                arr.push(res);
              }
            });
            const orderNum = arr[1].orderNum
            arr[1].orderNum = arr[0].orderNum
            arr[0].orderNum = orderNum
            this.newData = arr;
            this.sendChange();
          } else {
@@ -464,19 +469,22 @@
          if (currentId < pchildNodes.length - 1) {
            const tempChildrenNodex1 = pchildNodes[currentId + 1];
            const tempChildrenNodex2 = pchildNodes[currentId];
            tempChildrenNodex2.orderNum =
              pchildNodes[currentId + 1].data.orderNum;
            tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum;
            // tempChildrenNodex2.orderNum =
            //   pchildNodes[currentId + 1].data.orderNum;
            // tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum;
            var arr = [];
            this.oriData.filter((res) => {
              if (res.id == tempChildrenNodex2.data.id) {
                res.orderNum = tempChildrenNodex2.orderNum;
                // res.orderNum = tempChildrenNodex2.orderNum;
                arr.push(res);
              } else if (res.id == tempChildrenNodex1.data.id) {
                res.orderNum = tempChildrenNodex1.orderNum;
                // res.orderNum = tempChildrenNodex1.orderNum;
                arr.push(res);
              }
            });
            const orderNum = arr[1].orderNum
            arr[1].orderNum = arr[0].orderNum
            arr[0].orderNum = orderNum
            this.newData = arr;
            this.sendChange();
          } else {
@@ -622,13 +630,17 @@
      });
    },
    layerFormInline(res) {
      var val = JSON.parse(JSON.stringify(res))
      this.backUpData = JSON.stringify(res)
      this.currentData = JSON.stringify(res)
      this.formInline = val;
      this.formInline.type = val.type.toString();
      this.formInline.isShow = val.isShow.toString();
      this.formInline.isProject = val.isProject.toString();
      var data = this.$refs.tree.getNode(val.id).data;
      this.backUpData = JSON.stringify(data)
      this.currentData = JSON.stringify(data)
      this.formInline = data;
      this.formInline.type = data.type.toString();
      this.formInline.isShow = data.isShow.toString();
      this.formInline.isProject = data.isProject.toString();
    },
    //图层列表点击事件
    handleNodeClick(data, node) {
@@ -643,7 +655,7 @@
          branchArr.sort(function (a, b) {
            return b.orderNum - a.orderNum
            return a.orderNum - b.orderNum
          })
        }