Selaa lähdekoodia

独立表单库排序

duy 2 vuotta sitten
vanhempi
commit
75b27a4136
2 muutettua tiedostoa jossa 29 lisäystä ja 12 poistoa
  1. 10 0
      src/api/manager/wbsinfo.js
  2. 19 12
      src/views/manager/projectinfo/independent.vue

+ 10 - 0
src/api/manager/wbsinfo.js

@@ -48,3 +48,13 @@ export const update = (row) => {
   })
 }
 
+//元素库、独立库节点排序
+export const wbsInfotabSort = (primaryKeyIds) => {
+  return request({
+      url: '/api/blade-manager/wbsInfo/tab-sort',
+      method: 'post',
+      params: {
+        primaryKeyIds,
+      }
+  })
+}

+ 19 - 12
src/views/manager/projectinfo/independent.vue

@@ -32,7 +32,7 @@
               <el-link :underline="false">
                 <i
                   class="el-icon-sort"
-                  @click="sortpai(data, node)"
+                  @click.stop="sortpai(data, node)"
                   v-if="node.level == 2"
                   title="调整排序"
                 ></i>
@@ -223,6 +223,7 @@
 <script>
 import {tabTypeLazyTree,delAprojectTab} from "@/api/manager/wbsprivate";
 import {selectPrivateFormElements} from "@/api/manager/wbstree";
+import {wbsInfotabSort} from "@/api/manager/wbsinfo";
 import {getExcelHtml} from "@/api/exctab/excelmodel"
 import Qute from "./qutediaolog/qute1.vue";//引入元素库
 import Relation from './qutediaolog/relation.vue'//关联清表
@@ -398,6 +399,7 @@ export default {
       curNode:{},
       sortTag: false,
       sortTag2: false,
+      sort:[]
 
 
     };
@@ -409,12 +411,15 @@ export default {
   methods: {
  async sortpai(data,node) {
       console.log(data,node);
+      this.curNode=node;
+      this.curTreeData=data
+      
       await this.findWbsTreePrivateSameLevel(node,data)
       this.sortTag = true;
       this.sortTag2 = true;
     },
     editSort() {
-      this.wbsTreePrivateSort();
+      this.wbsInfotabSort();
     },
     bianhua() {
       this.sortTag2 = false;
@@ -422,15 +427,18 @@ export default {
         this.sortTag2 = true;
       });
     },
-    async wbsTreePrivateSort() {
-      //wbs私有树节点手动排序
-      // const { data: res } = await wbsTreePrivateSort(this.sort);
-      // console.log(res);
-      // if (res.code == 200) {
-      //   this.sortTag = false;
-      //   this.sortTag2 = false;
-      //   this. treeLoad1();
-      // }
+    async wbsInfotabSort() {
+      //元素库、独立库节点排序
+      console.log(this.sort,'this.sort');
+     var newArr=this.sort.map((v)=>{return v.id})
+     newArr=newArr.join(',')
+      const { data: res } = await wbsInfotabSort(newArr);
+      if (res.code == 200) {
+        this.$message.success('操作成功')
+        this.sortTag = false;
+        this.sortTag2 = false;
+        this. refreshTree();
+      }
     },
     async findWbsTreePrivateSameLevel(node,data) {
       const { data: res } =await tabTypeLazyTree({parentId:node.data.parentId,projectId:this.projectid,current:1,size:1000})
@@ -715,7 +723,6 @@ export default {
           
           });
       }else{
-
         this.updateTreeNewNode()
       }
     },