Przeglądaj źródła

私有树的元素表修改排序

gangyj 3 lat temu
rodzic
commit
a4c245f854

+ 8 - 0
src/api/manager/wbsprivate.js

@@ -69,3 +69,11 @@ export const removePrivateTreeNode = (pKeyId) => {
     }
   })
 }
+
+export const wbsTreePrivateTableSort = (data) => {
+  return request({
+    url: '/api/blade-manager/wbsPrivate/wbsTreePrivateTableSort',
+    method: 'post',
+    data:data
+  })
+}

+ 72 - 1
src/views/manager/projectinfo/tree.vue

@@ -213,6 +213,12 @@
               style="color:#409EFF;cursor: pointer;"
               @click="editEditElementForm()"
             ></i>
+            <i
+              class="el-icon-sort marleft10"
+              size="26"
+              @click="privateTableSort()"
+              style="color:#409EFF;cursor: pointer;"
+            ></i>
           </p>
           <el-table
             :data="formData"
@@ -439,6 +445,30 @@
       </span>
     </el-dialog>
 
+    <!-- 元素表排序 -->
+    <el-dialog
+      title="调整排序"
+      :visible="excelSortTag"
+      width="50%"
+      append-to-body
+    >
+      <ManualSorting
+        v-if="excelSortTag2"
+        @bianhua='bianhua2()'
+        :sort='tableSortList'
+      />
+      <span
+        slot="footer"
+        class="dialog-footer"
+      >
+        <el-button @click="excelSortTag=false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="editPrivateSort()"
+        >确 定</el-button>
+      </span>
+    </el-dialog>
+
     <!-- 关联清表 -->
     <el-dialog
       title="关联清表"
@@ -1359,7 +1389,7 @@ import {
   saveElement, remove as removeElement, updateBatchElements, getTemplate,
   importWbsElement
 } from "@/api/manager/wbsformelement";
-import { getLazytree, getDetail, update, findNodeTableByCondition as selectByNodeTable, removeTableByCondition as removeTableById ,removePrivateTreeNode} from "@/api/manager/wbsprivate";
+import { getLazytree, getDetail, update, findNodeTableByCondition as selectByNodeTable, removeTableByCondition as removeTableById ,removePrivateTreeNode,wbsTreePrivateTableSort} from "@/api/manager/wbsprivate";
 import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
 import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
 import { getDictionary } from "@/api/system/dict";
@@ -1478,6 +1508,10 @@ export default {
       namelists: [],
 
       infoNameVisible: false,
+
+      excelSortTag:false,
+      excelSortTag2:false,
+      tableSortList:[],
       //#endregion
     };
   },
@@ -1966,6 +2000,43 @@ export default {
       this.$set(data, 'moreShow', value)
     },
 
+    bianhua2 () {
+      this.excelSortTag2 = false
+      this.$nextTick(() => {
+        this.excelSortTag2 = true
+      })
+    },
+    //私有树的元素表修改排序
+    privateTableSort(){
+      if(!this.curTreeData.id){
+        this.$message({
+          type: "warning",
+          message: "请先选择需要排序的节点"
+        })
+        return;
+      }
+      this.tableSortList = this.formData.map((form,index)=>{
+        return{
+          sort:index+1,
+          deptName:form.tableName,
+          pkeyId:form.pkeyId,
+        }
+      })
+      this.excelSortTag = true
+      this.excelSortTag2 = true
+    },
+    editPrivateSort(){
+      wbsTreePrivateTableSort(this.tableSortList).then(()=>{
+        this.updateNodeTable();
+        this.$message({
+          type: "success",
+          message: "排序成功!"
+        });
+        this.excelSortTag = false;
+        this.excelSortTag2 = false;
+      })
+    },
+
     getDeptCategorylist () {
       if (this.deptCategorylist.length > 1) {
         return;