瀏覽代碼

Merge branch 'master' of http://47.110.251.215:3000/web/saber into master

yangyj 2 年之前
父節點
當前提交
c0f10caabd

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

@@ -293,6 +293,14 @@ export const updateBatchNodeTableInfo2 = (data) => {
         data
     })
 }
+// 元素库编辑表单
+export const updateBatchNodeTableInfoElement = (data) => {
+    return request({
+        url: '/api/blade-manager/tableinfo/update-batch-tableInfo',
+        method: 'post',
+        data
+    })
+}
 
 export const updateStatus = (params) => {
     return request({

+ 5 - 0
src/main.js

@@ -35,6 +35,11 @@ import tenantPackage from './views/system/tenantpackage';
 import "@/styles/icon/index.scss"
 //自定义指令按钮
 import preventClick from './util/preventClick'
+import * as filters from "./util/filter"   //新增过滤器
+// register global utility filters 注册全局过滤 此处是新添加内容002
+Object.keys(filters).forEach(key => {
+  Vue.filter(key, filters[key]);
+})
 Vue.use(preventClick)
 // 注册全局crud驱动
 window.$crudCommon = crudCommon;

+ 88 - 1
src/views/exctab/excelmodel/excelmodel.vue

@@ -61,6 +61,13 @@
                   class="el-icon-delete marleft10"
                   @click.stop="deleteExcelM(data,node)"
                 ></i>
+                <!-- 调整排序 -->
+                <i
+                  class="el-icon-sort"
+                  @click="sortpai(data, node)"
+                  v-if="node.level != 1"
+                  title="调整排序"
+                ></i>
               </span>
             </div>
           </span>
@@ -104,6 +111,13 @@
                 <i
                   class="el-icon-delete marleft10"
                   @click.stop="deleteExcelM(data,node)"
+                ></i>
+                   <!-- 调整排序 -->
+                <i
+                  class="el-icon-sort"
+                  @click="sortpai(data, node)"
+                  v-if="node.level == 3"
+                  title="调整排序"
                 ></i>
               </span>
             </div>
@@ -356,13 +370,32 @@
         >确定</el-button>
       </div>
     </el-dialog>
+      <!-- 私有wbs树排序弹框 -->
+    <el-dialog
+      title="调整排序"
+      :visible.sync="sortTag"
+      width="50%"
+      append-to-body
+    >
+      <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="(sortTag = false), (sortTag2 = false)"
+          >取 消</el-button
+        >
+        <el-button type="primary" @click="editSort()">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { detailExcel, excelType, tabLazytree, getWbsTypeList, wbstree, selectByNodeTable, Excelmodify, uploadExcel, deleteExcelshu, deleteExcel ,tabLazytreeAll,
-          uploadcoverfileExcel,downExcelFile} from '@/api/exctab/excelmodel'
+          uploadcoverfileExcel,downExcelFile} from '@/api/exctab/excelmodel';
+import ManualSorting from '@/components/WbsTree/ManualSorting'
 export default {
+  components: {
+    ManualSorting,
+  },
   data () {
     return {
       excelId:'',
@@ -453,9 +486,63 @@ export default {
       //#endregion
 
       saveExcelLoad:false,
+      sortTag: false,
+      sortTag2: false,
     }
   },
   methods: {
+    //#region  调整排序排序
+    async sortpai(data,node) {
+      console.log(data,node);
+      await this.findWbsTreePrivateSameLevel(node,data)
+      this.sortTag = true;
+      this.sortTag2 = true;
+    },
+    editSort() {
+      this.wbsTreePrivateSort();
+    },
+    bianhua() {
+      this.sortTag2 = false;
+      this.$nextTick(() => {
+        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.getLazytreessss();
+      // }
+    },
+    async findWbsTreePrivateSameLevel(node,data) {
+     const { data: res } = await tabLazytree(
+       {
+         parentId:data.parentId,
+         modeId:this.$route.params.id
+       })
+      if (res.code == 200) {
+        res.data.forEach((item)=>{
+          item.tableName=item.name
+        })
+        this.sort =res.data
+      }
+    },
+    async getLazytreessss() {
+      const { data: res } = await tabLazytree(
+       {
+         parentId:0,
+         modeId:this.$route.params.id
+       }
+      );
+      console.log(res);
+      if (res.code == 200) {
+        this.data = res.data;
+        this.allTreeData=res.data
+      }
+    },
     //#region 接口
     async tabLazytree (parentId, modeId) {//清表树
       const { data: res } = await tabLazytree({ parentId, modeId })

+ 16 - 1
src/views/manager/archivetree.vue

@@ -19,7 +19,9 @@
             v-model="filterText"
           >
           </el-input>
-          <el-tree
+          <div  class="scrollClass" style="height:358px ;">
+             <el-scrollbar style="height:100%">
+             <el-tree
             v-show="!filterText"
             ref="trees1"
             :props="props"
@@ -35,6 +37,15 @@
               style="box-sizing: border-box;width:100%;"
             >
               <span>{{ data.title }}</span>
+                 <!--知识点过长处理,鼠标悬浮文字弹框显示全部内容-->
+            <!-- <span  class="custom-tree-node">
+                      <el-tooltip class="item" effect="light" :content="data.title" placement="top-start">
+                        <span > {{ data.title | ellipsis(25) }} </span>
+                      </el-tooltip>
+                  <div>
+                  </div>
+             </span> -->
+
               <span
                 class="marleft10"
                 v-show="data.moreShow"
@@ -66,6 +77,10 @@
               </span>
             </span>
           </el-tree>
+          </el-scrollbar>
+          </div>
+         
+         
           <el-tree
             v-show="filterText"
             :default-expanded-keys='defaultExpanded'

+ 106 - 22
src/views/manager/projectinfo/independent.vue

@@ -27,9 +27,14 @@
             >
               <div style="width:100%;">
                 <span style="text-overflow: ellipsis;"> {{ data.title }} </span>
-                <!-- <span> {{ node}} </span> -->
-                <!-- 添加 -->
-            
+              
+              <!-- 调整排序 -->
+                <i
+                  class="el-icon-sort"
+                  @click="sortpai(data, node)"
+                  v-if="node.level == 2"
+                  title="调整排序"
+                ></i>
               </div>
             </span>
           </el-tree>
@@ -82,11 +87,9 @@
                     </el-input>
                 </template>
                 <template slot-scope="{type,size,row}" slot="menu">
-                      <el-button  :size="size" :type="type" @click="Associationlist(row)">关联清表</el-button>
-                      <el-button  :size="size" :type="type" @click="rightClick(
-                          row
-                        )">编辑元素</el-button>
-                      <el-button  :size="size" :type="type" @click="adjustExcel(row.id,row.primaryKeyId)">调整表单</el-button>
+                      <el-button  :size="size" :type="type" :disabled="row.excelIds == -1"  @click="Associationlist(row)">关联清表</el-button>
+                      <el-button  :size="size" :type="type"  @click="rightClick(row)">编辑元素</el-button>
+                      <el-button  :size="size" :type="type"  :disabled="row.excelIds == -1" @click="adjustExcel(row.id,row.primaryKeyId)">调整表单</el-button>
                       <el-button  :size="size" :type="type" @click="handleEditFormula(row)">编辑公式</el-button>
                       
                 </template>
@@ -96,7 +99,7 @@
       </div>
     </div>
     <Qute ref="Qute" :projectid="projectid" :wbsid="wbsid" :onLoad1="onLoad1" :refreshTree="refreshTree"> </Qute>
-    <Relation ref="Relation" :GLExcelFrom="GLExcelFrom" :wbsid="wbsid"></Relation>
+    <Relation ref="Relation" :GLExcelFrom="GLExcelFrom" :wbsid="wbsid"  :onLoad1="onLoad1"></Relation>
     <!-- 编辑元素 -->
        <!-- 编辑元素 -->
     <el-dialog
@@ -113,6 +116,7 @@
         :pid="editElementQuery.pid"
         :wbsid="editElementQuery.wbsid"
         :nodeid="editElementQuery.nodeid"
+         :initTableId="editElementQuery.initTableId"
         @hideDialog="editElementVisible = false"
         v-if="editElementVisible"
       ></EditElement>
@@ -192,22 +196,38 @@
         v-if="formulaCompVisible"
       ></FormulaEdit>
     </el-dialog>
+      <!-- 排序弹框 -->
+    <el-dialog
+      title="调整排序"
+      :visible.sync="sortTag"
+      width="50%"
+      append-to-body
+    >
+      <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="(sortTag = false), (sortTag2 = false)"
+          >取 消</el-button
+        >
+        <el-button type="primary" @click="editSort()">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import {tabTypeLazyTree,delAprojectTab} from "@/api/manager/wbsprivate";
-import {selectFormElements,selectPrivateFormElements} from "@/api/manager/wbstree";
+import {selectPrivateFormElements} from "@/api/manager/wbstree";
 import {getExcelHtml} from "@/api/exctab/excelmodel"
 import Qute from "./qutediaolog/qute1.vue";//引入元素库
 import Relation from './qutediaolog/relation.vue'//关联清表
 import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";//编辑元素
 import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
 import FormulaEdit from "@/views/formula/edit.vue";
+import ManualSorting from '@/components/WbsTree/ManualSorting'
 
 
 export default {
-   components: { dynamicExcel, EditElement, Qute,Relation,FormulaEdit },
+   components: { dynamicExcel, EditElement, Qute,Relation,FormulaEdit,ManualSorting },
   computed:{
      ids () {
       let ids = [];
@@ -339,6 +359,7 @@ export default {
           ids: "",
           excelId: "",
           initTableName: "",
+          initTableId:'',
       },
       //编辑元素弹窗
       editElementVisible: false, //编辑元素弹框
@@ -364,8 +385,9 @@ export default {
       curTreeData: {},
       projectid:'',
       treeId:"",
-      curNode:{}
-
+      curNode:{},
+      sortTag: false,
+      sortTag2: false,
 
 
     };
@@ -377,7 +399,44 @@ export default {
     //  this.treeLoad1()
   },
   methods: {
-
+ async sortpai(data,node) {
+      console.log(data,node);
+      await this.findWbsTreePrivateSameLevel(node,data)
+      this.sortTag = true;
+      this.sortTag2 = true;
+    },
+    editSort() {
+      this.wbsTreePrivateSort();
+    },
+    bianhua() {
+      this.sortTag2 = false;
+      this.$nextTick(() => {
+        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 findWbsTreePrivateSameLevel(node,data) {
+      const { data: res } =await tabTypeLazyTree({parentId:node.data.parentId,projectId:this.projectid,current:1,size:1000})
+      if (res.code == 200) {
+        console.log(res.data,'res1111111');
+        let tabArr=res.data.records
+        tabArr.forEach((item)=>{
+          item.tableName=item.title
+        })
+        console.log(tabArr,'tabArr');
+        this.sort =tabArr
+      }
+    },
+   
      async treeLoad1 () {
       let id = 12345678910
       let das = await this.tabTypeLazyTree(id, this.projectid,this.page.current,this.page.size)
@@ -396,7 +455,7 @@ export default {
     },
     loadNode(node, resolve) {
       const parentId = (node.level === 0) ? 12345678910 : node.data.id;
-      tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:200}).then(res => {
+      tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:1000}).then(res => {
           resolve(res.data.data.records.map(item => {
               return {
                 ...item,
@@ -426,13 +485,33 @@ export default {
         })
       }
     },
-   onLoad1(){
-      if(this.treeId){
+  //  onLoad1(){
+  //     if(this.treeId){
+  //        this.tabTypeLazyTree(this.treeId,this.projectid, this.page.current,this.page.size).then((res)=>{
+  //         this.loadData=res.records
+  //          this.page.total=res.total
+  //       })
+  //     }
+  //   },
+     //编辑后刷新
+    onLoad1(){
+      // console.log(this.level,'1111111111');
+      if(this.curNode.level===1&&this.curNode.data.hasChildren){
          this.tabTypeLazyTree(this.treeId,this.projectid, this.page.current,this.page.size).then((res)=>{
           this.loadData=res.records
            this.page.total=res.total
         })
+      }else{
+          this.tabTypeLazyTree(this.treeId,this.projectid, this.page.current,this.page.size).then((res)=>{
+           let faArr=res.records;
+           this.loadData=faArr.filter((item)=>{
+             if(item.id===this.treeId){
+               return item
+             }
+           })
+          })
       }
+      // this.refreshTreeData()
     },
     resetChange(item){
       console.log(item);
@@ -447,6 +526,7 @@ export default {
         console.log(data,node,'treedata');
         this.curNode=node
         this.treeId=data.id
+        this.curTreeData=data
         if(data.hasChildren){
            this.tabTypeLazyTree(data.id, this.projectid,this.page.current,this.page.size).then((res)=>{
           console.log(res.records);
@@ -518,12 +598,16 @@ export default {
       this.GLExcelFrom.id = row.primaryKeyId;
       this.GLExcelFrom.excelId =row.excelIds;
       this.GLExcelFrom.ids = row.id;
-      this.GLExcelFrom.initTableName =row.initTableName
+      this.GLExcelFrom.initTableName =row.initTableName;
+      this.GLExcelFrom.initTableId =row.initTableId;
+      this.GLExcelFrom.nodeid =this.curTreeData.id
+
+
     },
        //#region 编辑元素
     async rightClick(row) {
       console.log(row,'编辑元素');
-      await this.getExcelHtml2(row.id);
+      await this.getExcelHtml2(row.primaryKeyId);
       // console.log('编辑元素');
       this.editElementQuery.pkeyId = row.primaryKeyId;
       this.editElementQuery.excelId = row.excelIds;
@@ -531,8 +615,8 @@ export default {
       this.editElementQuery.initTableName =row. initTableName;
       this.editElementQuery.pid = this.$route.query.pid;
       this.editElementQuery.wbsid = this.$route.query.wbsid;
-      // this.editElementQuery.nodeid = this.curTreeData.id;
-
+        this.editElementQuery.initTableId = row.initTableId;
+       this.editElementQuery.nodeid = this.curTreeData.id;
       this.editElementVisible = true;
     },
     async getExcelHtml2(pkeyId) {
@@ -598,7 +682,7 @@ export default {
     refreshTree(){
         //刷新左边树形数据
        const parentId =12345678910 
-          tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:200}).then(res => {
+          tabTypeLazyTree({parentId,projectId:this.projectid,current:1,size:1000}).then(res => {
             this.data=res.data.data.records;
              this.$nextTick(()=>{
                if(this.curNode.level==2){

+ 8 - 5
src/views/manager/projectinfo/qutediaolog/qute1.vue

@@ -10,14 +10,14 @@
     >
       
       <div  class="flexStar" > 
-        <div class="boxswai" style="width:30%;padding-left:0px;">
-           <div class="boxnei" style="display: flex;flex-direction: column;height:550px">
+        <div class="boxswai" style="width:30%;padding-left:0px;height:547px">
+           <div class="boxnei" style="display: flex;flex-direction: column;">
              <div style="overflow: auto;flex:1">
-                <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" ></avue-tree>
+                <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"   style="display: inline-block;min-width: 100%;"></avue-tree>
              </div>
            </div>
         </div>
-         <div class="boxswai" style="width:70%;padding-left:0px;padding-right:0px;">
+         <div class="boxswai" style="width:70%;padding-left:0px;padding-right:0px;height:547px">
             <div class="boxnei"  style="flex:1;">
              
                 <avue-crud
@@ -59,6 +59,9 @@ export default {
         treeOption:{
           filter:false,
           addBtn:false,
+          indexFixed:false,
+          selectionFixed:false,
+          expandFixed:false,
           props:{
             labelText:'标题',
             label:'title',
@@ -68,7 +71,7 @@ export default {
           lazy: true,
           treeLoad: function (node, resolve) {
           const parentId = (node.level === 0) ? 12345678910 : node.data.id;
-          tabTypeLazyTreeAll({parentId,current:1,size:200}).then(res => {
+          tabTypeLazyTreeAll({parentId,current:1,size:1000}).then(res => {
               resolve(res.data.data.records.map(item => {
                   return {
                     ...item,

+ 13 - 9
src/views/manager/projectinfo/qutediaolog/relation.vue

@@ -73,6 +73,7 @@
             :excelId="editElementQuery.excelId"
             :id="editElementQuery.id"
             :initTableName="editElementQuery.initTableName"
+            :initTableId="editElementQuery.initTableId"
             :pid="editElementQuery.pid"
             :wbsid="editElementQuery.wbsid"
             :nodeid="editElementQuery.nodeid"
@@ -85,12 +86,13 @@
 </template>
 
 <script>
-import {getList, tabLazytreeAll, saveLinkTab, getExcelHtml, savelinktableInfo,} from "@/api/exctab/excelmodel";
+import {getList,tabLazytreeAll,saveLinkTab, getExcelHtml,} from "@/api/exctab/excelmodel";
 import EditElement from "@/views/manager/projectinfo/editElement/editElement.vue";
 import {findNodeTableByCondition as selectByNodeTable} from "@/api/manager/wbsprivate";
 export default {
     props:{
-        GLExcelFrom:Object
+        GLExcelFrom:Object,
+        onLoad1:Function
     },
     components:{EditElement},
     data(){
@@ -214,7 +216,7 @@ export default {
                     }
                 },
                 //#region 编辑元素
-            async rightClick(pkeyId, excelId, id, initTableName) {
+            async rightClick(pkeyId, excelId, id, initTableName,initTableId,nodeid) {
                 await this.getExcelHtml2(pkeyId);
                 this.editElementQuery.pkeyId = pkeyId;
                 this.editElementQuery.excelId = excelId;
@@ -222,7 +224,8 @@ export default {
                 this.editElementQuery.initTableName = initTableName;
                 this.editElementQuery.pid = this.$route.query.pid;
                 this.editElementQuery.wbsid = this.$route.query.wbsid;
-                // this.editElementQuery.nodeid = this.curTreeData.id;
+                this.editElementQuery.initTableId = initTableId;
+                this.editElementQuery.nodeid =nodeid;
 
                 this.editElementVisible = true;
             },
@@ -251,10 +254,9 @@ export default {
                     }
                     console.log(node.id,'node.id');
                     console.log(this.GLExcelFrom.id,'this.GLExcelFrom.id');
-                    const { data: res } = await savelinktableInfo({
+                    const { data: res } = await saveLinkTab({
                     exceTabId: node.id,
-                    tabId: this.GLExcelFrom.id,
-                   
+                    tabId: this.GLExcelFrom.id
                     });
                     console.log(res);
                     if (res.code === 200) {
@@ -263,13 +265,15 @@ export default {
                         message: "关联清表成功",
                     });
                     // selectByNodeTable刷新表单列表
-                    // this.updateNodeTable();
+                    this.onLoad1();
                     this.GLExcel = false;
                     this.rightClick(
                         this.GLExcelFrom.id,
                         this.GLExcelFrom.excelId,
                         this.GLExcelFrom.ids,
-                        this.GLExcelFrom.initTableName
+                        this.GLExcelFrom.initTableName,
+                        this.GLExcelFrom.initTableId,
+                        this.GLExcelFrom.nodeid 
                     );
                     }
                 } else {

+ 45 - 27
src/views/manager/wbsinfo/PublicWbs.vue

@@ -250,6 +250,7 @@ export default {
                 this.AssociatedPublicTap=true;
                 this.addElementForm.nodeName=this.from.title;
                  this.addElementForm.tableType=this.from.tableType+''
+                  this.addElementForm.tableOwner = this.from.tableOwner
                  //清除数据
                 this.filterText1 = "";
                 this.exceldata = [];
@@ -260,7 +261,7 @@ export default {
 
                 //清理之前填写的数据
                 this.addElementForm.wbsId = "";
-                this.addElementForm.tableOwner = "";
+                // this.addElementForm.tableOwner = "";
                 this.getWbsTypeList();
                 console.log(this.from,'点击节点数据');
                 this.excelType();
@@ -407,7 +408,7 @@ export default {
                 row.loading = true;
                 if (type == "关联") {
                     // saveRelation(row.id, this.from.id, this.tableData)
-                   savelinktableInfo({
+                   this.savelinktableInfo1({
                     linkids: row.id,
                     tabId: this.from.id,
                     type:1
@@ -420,9 +421,10 @@ export default {
                         row.loading = false;
                     });
                 } else {
-                    cancelRelation({
-                    id: row.id,
-                    excelTabId: this.from.id,
+                   this. savelinktableInfo1({
+                    linkids: row.id,
+                    tabId: this.from.id,
+                    type:4
                     })
                     .then(() => {
                         row.checknd = false;
@@ -470,21 +472,14 @@ export default {
                 if (this.addElementForm.wbsId) {
                     console.log(this.tableData,'this.tableData');
                     if (this.activeName == "link") {
-                    this.submitExcelRelationWbsTreeAndElement({
-                        excelTabId: this.from.id,
-                        elementList: this.tableData,
-                        submitStatus: 1,
-                    });
+                       this.AssociatedPublicTap = false;
+                       this.AssociatedPublicClose();
                     } else {
                     if (
                         this.addElementForm.nodeName &&
                         this.addElementForm.tableType &&
                         this.addElementForm.tableOwner
                     ) {
-                        // let nodeIds = this.$refs.tree.getCheckedKeys();
-                        // let nodeIds1 = this.$refs.treeall1.getCheckedKeys();
-                        // console.log(nodeIds,'nodeIds');
-                        // console.log(nodeIds1,'nodeIds1');
                         if( this.$refs.tree){
                         this.nodeIds = this.$refs.tree.getCheckedKeys();
                         }
@@ -502,13 +497,11 @@ export default {
                         });
                         return;
                         }
-                       savelinktableInfo({
+                        this.selectNodeIds= this.selectNodeIds.join(',')
+                        this.savelinktableInfo({
                         linkids: this.selectNodeIds,
                         tabId: this.from.id,
                         type:2
-                        }).then((res)=>{
-                          console.log(res,'添加元素表');
-
                         })
                        
                         // this.submitExcelRelationWbsTreeAndElement({
@@ -593,15 +586,27 @@ export default {
                     this.dataType = res.data;
                 }
             },
-             async submitExcelRelationWbsTreeAndElement(da) {
-                 console.log(da,'新增元素信息表');
-                //保存接口
-                da.elementList.forEach((ele) => {
-                    ele.eName = ele.textInfo;
-                    ele.eType = ele.textElementType;
-                    ele.eAllowDeviation = ele.textDeviation;
-                });
-                const { data: res } = await submitExcelRelationWbsTreeAndElement(da);
+            //  async submitExcelRelationWbsTreeAndElement(da) {
+            //      console.log(da,'新增元素信息表');
+            //     //保存接口
+            //     da.elementList.forEach((ele) => {
+            //         ele.eName = ele.textInfo;
+            //         ele.eType = ele.textElementType;
+            //         ele.eAllowDeviation = ele.textDeviation;
+            //     });
+            //     const { data: res } = await submitExcelRelationWbsTreeAndElement(da);
+            //     if (res.code == 200) {
+            //         this.$message({
+            //         type: "success",
+            //         message: "设置成功",
+            //         });
+            //         this.AssociatedPublicTap = false;
+            //         this.AssociatedPublicClose();
+            //     }
+            // },
+            async savelinktableInfo(da) {
+              console.log('新增元素表',da);
+                const { data: res } = await savelinktableInfo(da)
                 if (res.code == 200) {
                     this.$message({
                     type: "success",
@@ -611,6 +616,19 @@ export default {
                     this.AssociatedPublicClose();
                 }
             },
+            //选择关联取消关联修改
+           async savelinktableInfo1(da) {
+              console.log('选择关联',da);
+                const { data: res } = await savelinktableInfo(da)
+                if (res.code == 200) {
+                    this.$message({
+                    type: "success",
+                    message: "设置成功",
+                    });
+                    // this.AssociatedPublicTap = false;
+                    // this.AssociatedPublicClose();
+                }
+            },
        
             async getColByTabId() {
                 //获取字段信息

+ 130 - 23
src/views/manager/wbsinfo/element.vue

@@ -9,7 +9,35 @@
     >
       <div class="boxnei" style="display: flex;flex-direction: column;">
         <div style="overflow: auto;flex:1">
-          <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"  ref="avueTree"></avue-tree>
+          <avue-tree 
+          :option="treeOption" 
+          :data="treeData"
+           @node-click="nodeClick" 
+           ref="avueTree"   
+           style="display: inline-block;min-width: 100%;">
+             <span
+            class="custom-tree-node"
+            slot-scope="{ data ,node }"
+            @mouseover.stop="mouseOver(data)"
+            @mouseleave.stop="mouseLeave(data)"
+            style="box-sizing: border-box;padding-right:70px!important;;"
+          >
+            <div style="width:100%;">
+              <span style="text-overflow: ellipsis;"> {{ data.title }} </span>
+              <!-- <span> {{ node}} </span> -->
+              <!-- 添加 -->
+              <span>
+               <!-- 调整排序 -->
+                <i
+                  class="el-icon-sort"
+                  @click="sortpai(data, node)"
+                  v-if="node.level == 2"
+                  title="调整排序"
+                ></i>
+              </span>
+            </div>
+          </span>
+           </avue-tree>
 
         </div>
       </div>
@@ -440,14 +468,29 @@
         >确 定</el-button>
       </span>
     </el-dialog>
+     <!-- 私有wbs树排序弹框 -->
+    <el-dialog
+      title="调整排序"
+      :visible.sync="sortTag"
+      width="50%"
+      append-to-body
+    >
+      <ManualSorting v-if="sortTag2" @bianhua="bianhua()" :sort="sort" />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="(sortTag = false), (sortTag2 = false)"
+          >取 消</el-button
+        >
+        <el-button type="primary" @click="editSort()">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 
 </template>
 
 <script>
-import { detailExcel, excelType,wbstree, getWbsTypeList,} from '@/api/exctab/excelmodel';
+import { excelType} from '@/api/exctab/excelmodel';
 import {
-  updateBatchNodeTableInfo,
+  updateBatchNodeTableInfoElement,
   selectByNodeTable,
   selectFormElements,
   selectPrivateFormElements
@@ -458,11 +501,13 @@ import FormulaEdit from "@/views/formula/edit.vue";
 import PublicWbs from './PublicWbs.vue'
 import { searchNodeTables, } from "@/api/exctab/excelmodel";
 import { getDictionary } from "@/api/system/dict";
+import ManualSorting from '@/components/WbsTree/ManualSorting'
 
 export default {
   components:{
     FormulaEdit,
-    PublicWbs
+    PublicWbs,
+    ManualSorting
   },
   data () {
     return {
@@ -583,7 +628,6 @@ export default {
           id:2
         }
       ],
-
       curEleTable:{},
       eleReg: /(-|>|<|≥|≤|±|【】)?([^≥≤±【】]*)/,
       editEleList:[],
@@ -647,6 +691,7 @@ export default {
       loadData:[],
       treeOption:{
        defaultExpandedKeys:[],
+       currentNode:{},
         filter:false,
         addBtn:false,
         props:{
@@ -655,12 +700,12 @@ export default {
           value:'id',
           children:'children'
         },
+       
         lazy: true,
         treeLoad: function (node, resolve) {
-          console.log(node);
            const parentId = (node.level === 0) ? 12345678910 : node.data.id;
 
-          tabTypeLazyTreeAll({parentId,current:1,size:200}).then(res => {
+          tabTypeLazyTreeAll({parentId,current:1,size:1000}).then(res => {
             resolve(res.data.data.records.map(item => {
               return {
                 ...item,
@@ -675,6 +720,8 @@ export default {
       projectid:"",
       curNode:{},
       defaultExpandKey:[],//默认展开的节点
+      sortTag: false,
+      sortTag2: false,
     }
   },
   computed:{
@@ -687,6 +734,55 @@ export default {
     }
   },
   methods: {
+        //#region  树形控件外层左侧事件
+    mouseLeave (data) {
+      if (data.moreShow) {
+        this.$set(data, 'moreShow', false)
+      }
+    },
+    mouseOver (data) {
+      if (!data.moreShow) {
+        this.$set(data, 'moreShow', true)
+      }
+    },
+    async sortpai(data,node) {
+      console.log(data,node);
+      await this.findWbsTreePrivateSameLevel(node,data)
+      this.sortTag = true;
+      this.sortTag2 = true;
+    },
+    editSort() {
+      this.wbsTreePrivateSort();
+    },
+    bianhua() {
+      this.sortTag2 = false;
+      this.$nextTick(() => {
+        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. refreshTreeData();
+      // }
+    },
+    async findWbsTreePrivateSameLevel(node,data) {
+       const { data: res } =await tabTypeLazyTreeAll({parentId:node.data.parentId,current:1,size:1000});
+      if (res.code == 200) {
+        console.log(res.data,'res1111111');
+        let tabArr=res.data.records
+        tabArr.forEach((item)=>{
+          item.tableName=item.title
+        })
+        console.log(tabArr,'tabArr');
+        this.sort =tabArr
+      }
+    },
+   
     addEleRow (list) {
       list.push({});
     },
@@ -724,10 +820,10 @@ export default {
       return cellValue;
       //console.log(cellValue)
     },
-    formatOwner(row, column, cellValue) {
+    formatOwner( cellValue) {
       for (let i = 0; i < this.ownerTypeList.length; i++) {
-        if (this.ownerTypeList[i].dictKey == cellValue) {
-          return this.ownerTypeList[i].dictValue;
+        if (this.ownerTypeList[i].dictValue == cellValue) {
+          return this.ownerTypeList[i].dictKey;
         }
       }
       return cellValue;
@@ -810,7 +906,7 @@ export default {
            })
           })
       }
-      this.refreshTreeData()
+      // this.refreshTreeData()
     },
         //搜索
     searchChange(){
@@ -861,12 +957,24 @@ export default {
     //刷新左边树形数据
     refreshTreeData(){
       const parentId =12345678910
-      tabTypeLazyTreeAll({parentId,current:1,size:200}).then(res => {
+      tabTypeLazyTreeAll({parentId,current:1,siez:1000}).then(res => {
         this.treeData=res.data.data.records;
           this.$nextTick(()=>{
           //树默认展开
-            this.treeOption.defaultExpandedKeys.push(this.curNode.data.parentId);
-            //  this.$refs.avueTree.setCurrentKey(this.curNode.data.parentId)
+          if(this.curNode.level===1){
+             this.treeOption.defaultExpandedKeys.push(this.curNode.data.id);
+             this.$refs.avueTree.setCurrentKey(this.curNode.data.id)
+           
+          }else{
+             this.treeOption.defaultExpandedKeys.push(this.curNode.data.parentId);
+              // 设置选中的节点
+              this.treeOption.currentNode =this.curNode.data.id
+              this.$refs.avueTree.setCurrentKey(this.curNode.data.id)
+              
+             
+          }
+           
+          
         })
       });
     },
@@ -886,9 +994,7 @@ export default {
           element.allow = RegExp.$1 ? RegExp.$1 : '';
           element.deviation = RegExp.$2 ? RegExp.$2 : '';
         })
-
         this.editEleList = res.data.data;
-        
       })
       this.editEleVisible = true;
     },
@@ -898,10 +1004,14 @@ export default {
     },
     //分配节点
     distribution(row){
+      console.log(row);
       this.from.id=row.id;
       this.from.title=row.title;
       this.from.tableType=row.tabType
       this.from.tableType=this.formatTableType(this.from.tableType);
+      this.from.tableOwner=row.tabOwner
+      this.from.tableOwner=this.formatOwner(this.from.tableOwner);
+      // console.log( this.formatOwner(this.from.tableOwner),' this.from.tableOwner');
        this.$refs.PublicWbs.show();
       // this.AssociatedPublicTap = true;
     },
@@ -925,10 +1035,7 @@ export default {
       row.eAllowDeviation = (row.allow ? row.allow : '') + (row.deviation ? row.deviation : '');
       row.fId = this.curEleTable.id;
       row.initTableName = this.curEleTable.initTableName;
-      // if (row.eType == 4) {
-      //   this.$set(row, 'eLength', 0);
-      //   //row.eLength = 0;
-      // } else
+
       if (!row.eLength) {
         this.$message({
           type: "warning",
@@ -1136,7 +1243,7 @@ export default {
         }
       })
       if (tag) {
-        this.updateBatchNodeTableInfo(da)
+        this.updateBatchNodeTableInfoElement(da)
       } else {
         this.$message({
           type: 'success',
@@ -1144,9 +1251,9 @@ export default {
         })
       }
     },
-    async updateBatchNodeTableInfo (da) {//共有编辑元素
+    async updateBatchNodeTableInfoElement (da) {//共有编辑元素
     console.log(da,'编辑表单');
-      const { data: res } = await updateBatchNodeTableInfo(da)
+      const { data: res } = await updateBatchNodeTableInfoElement(da)
       //console.log(res);
       if (res.code == 200) {
         this.$message.success('操作成功');

+ 2 - 2
vue.config.js

@@ -27,11 +27,11 @@ module.exports = {
             '/api': {
                 //本地服务接口地址
                 // target: 'http://192.168.3.64',
-                target: 'http://localhost:8090',
+                // target: 'http://localhost:8090',
                 // target: 'http://192.168.1.179',
                 // target: 'http://192.168.31.96',
                 //远程演示服务地址,可用于直接启动项目
-                //target: 'https://saber.bladex.vip/api',
+                target: 'http://47.110.251.215:8090',
                 ws: true,
                 pathRewrite: {
                     '^/api': '/'