gangyj 2 سال پیش
والد
کامیت
0619e79daf
4فایلهای تغییر یافته به همراه177 افزوده شده و 4 حذف شده
  1. 11 0
      src/api/manager/wbsprivate.js
  2. 12 0
      src/api/manager/wbstree.js
  3. 78 2
      src/views/manager/projectinfo/tree.vue
  4. 76 2
      src/views/manager/wbsinfo/edit.vue

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

@@ -90,3 +90,14 @@ export const getNodeTabAndParam = (parentId,projectId,wbsId, params) => {
     }
   })
 }
+
+export const privateSubmitFullName = (pKeyId,fullNames) => {
+  return request({
+    url: '/api/blade-manager/wbsPrivate/submit-full-name',
+    method: 'post',
+    params: {
+      pKeyId,
+      fullNames
+    }
+  })
+}

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

@@ -271,3 +271,15 @@ export const getNodeTabAndParam = (id, params) => {
         }
     })
 }
+
+export const submitFullName = (id, fullNames, params) => {
+    return request({
+        url: '/api/blade-manager/wbsTree/submit-full-name',
+        method: 'post',
+        params: {
+            ...params,
+            id,
+            fullNames,
+        }
+    })
+}

+ 78 - 2
src/views/manager/projectinfo/tree.vue

@@ -608,7 +608,10 @@
           label="节点名称"
           prop="nodeName"
         >
-          <el-input v-model="nodeDetail.nodeName"></el-input>
+          <div class="flex">
+            <el-input v-model="nodeDetail.nodeName"></el-input>
+            <el-button class="mg-l-10" type="primary" @click="aliasShow">添加别名</el-button>
+          </div>
         </el-form-item>
         <el-form-item label="上级节点">
           <el-input
@@ -1331,6 +1334,36 @@
       </span>
     </el-dialog>
 
+    <el-dialog
+      title="别名"
+      :visible.sync="aliasVisible"
+      width="600px"
+      append-to-body
+      :close-on-click-modal="false"
+    >
+      <div>
+        <div class="flex">
+          <el-input v-model="aliasInput" placeholder="请输入内容"></el-input>
+          <el-button class="mg-l-20" type="primary" @click="addAlias">添加</el-button>
+        </div>
+        <div class="flex" style="flex-wrap:wrap">
+          <div class="mg-t-10" v-for="(tag,index) in aliasArr" :key="index">
+            <el-tag closable @close="delAlias(index)">
+              {{tag}}
+            </el-tag>
+            <span v-if="index != aliasArr.length-1">、</span>
+          </div>
+        </div>
+      </div>
+      <span
+        slot="footer"
+        class="dialog-footer"
+      >
+        <el-button @click="aliasVisible = false">取 消</el-button>
+        <el-button  type="primary" @click="saveAliasHandle">确 定</el-button>
+      </span>
+    </el-dialog>
+
   </basic-container>
 </template>
 
@@ -1345,7 +1378,7 @@ import {
   saveElement, remove as removeElement, updateBatchElements, getTemplate,
   importWbsElement
 } from "@/api/manager/wbsformelement";
-import { getLazytree, getDetail, update, findNodeTableByCondition as selectByNodeTable, removeTableByCondition as removeTableById, removePrivateTreeNode, wbsTreePrivateTableSort } from "@/api/manager/wbsprivate";
+import { getLazytree, getDetail, update, findNodeTableByCondition as selectByNodeTable, removeTableByCondition as removeTableById, removePrivateTreeNode, wbsTreePrivateTableSort ,privateSubmitFullName} 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";
@@ -1511,6 +1544,10 @@ export default {
 
       defaultExpandedKeys:[],
       expandName:this.$route.fullPath,
+
+      aliasVisible:false,//别名
+      aliasInput:'',
+      aliasArr:[],
     };
   },
   computed: {
@@ -2585,6 +2622,45 @@ export default {
         return;
       }
       this.setLeftType(4,this.curTreeData,this.curTreeNode);
+    },
+
+
+    //显示别名弹窗
+    aliasShow(){
+      this.aliasVisible = true;
+      if(this.nodeDetail.fullName){
+        this.aliasArr = this.nodeDetail.fullName.split(',');
+      }
+      this.aliasInput = '';
+    },
+
+    addAlias(){
+      if(this.aliasInput){
+        this.aliasArr.push(this.aliasInput);
+        this.aliasInput = '';
+      }
+    },
+    delAlias(index){
+      this.aliasArr.splice(index,1);
+    },
+
+    saveAliasHandle(){
+      this.nodeDetail.fullName = this.aliasArr.join(',');
+      if (this.editType == 1) {
+        //新增
+        this.aliasVisible = false;
+      } else if (this.editType == 2) {
+        //编辑 私有
+        privateSubmitFullName(
+          this.nodeDetail.pKeyId,this.nodeDetail.fullName
+        ).then(()=>{
+          this.$message({
+            type: 'success',
+            message: '保存成功',
+          })
+          this.aliasVisible = false;
+        })
+      }
     }
 
   },

+ 76 - 2
src/views/manager/wbsinfo/edit.vue

@@ -553,7 +553,7 @@
         > 
           <div class="flex">
             <el-input v-model="nodeDetail.nodeName"></el-input>
-            <!-- <el-button class="mg-l-10" type="primary">添加别名</el-button> -->
+            <el-button class="mg-l-10" type="primary" @click="aliasShow">添加别名</el-button>
           </div>
         </el-form-item>
         <el-form-item label="上级节点">
@@ -1557,6 +1557,36 @@
       </span>
     </el-dialog>
 
+    <el-dialog
+      title="别名"
+      :visible.sync="aliasVisible"
+      width="600px"
+      append-to-body
+      :close-on-click-modal="false"
+    >
+      <div>
+        <div class="flex">
+          <el-input v-model="aliasInput" placeholder="请输入内容"></el-input>
+          <el-button class="mg-l-20" type="primary" @click="addAlias">添加</el-button>
+        </div>
+        <div class="flex" style="flex-wrap:wrap">
+          <div class="mg-t-10" v-for="(tag,index) in aliasArr" :key="index">
+            <el-tag closable @close="delAlias(index)">
+              {{tag}}
+            </el-tag>
+            <span v-if="index != aliasArr.length-1">、</span>
+          </div>
+        </div>
+      </div>
+      <span
+        slot="footer"
+        class="dialog-footer"
+      >
+        <el-button @click="aliasVisible = false">取 消</el-button>
+        <el-button  type="primary" @click="saveAliasHandle">确 定</el-button>
+      </span>
+    </el-dialog>
+
   </basic-container>
 </template>
 
@@ -1565,7 +1595,7 @@ import ManualSorting from '@/components/WbsTree/ManualSorting'
 import {
   getLazytree, getDetail, update, selectByNodeTable, getAlltree,
   saveFormAndElement, selectFormElements, removeTableById, findWbsTreeSameLevel, wbsTreeSort, findWbsTreeTableSameLevel, wbsTreeTableSort, parameters, saveOrUpdateBatch, keymap, importwbsTreeFormBatch, exportBatchTemplate, updateBatchNodeTableInfo,
-  importWbsTree, exportTemplate, remove as removeTreeNode
+  importWbsTree, exportTemplate, remove as removeTreeNode,submitFullName
 } from "@/api/manager/wbstree";
 import {
   saveElement, remove as removeElement, updateBatchElements, getTemplate,
@@ -1709,6 +1739,10 @@ export default {
 
       defaultExpandedKeys:[],
       expandName:this.$route.fullPath,
+
+      aliasVisible:false,//别名
+      aliasInput:'',
+      aliasArr:[],
     };
   },
   computed: {
@@ -2817,7 +2851,47 @@ export default {
         return;
       }
       this.setLeftType(4,this.curTreeData,this.curTreeNode);
+    },
+
+    //显示别名弹窗
+    aliasShow(){
+      this.aliasVisible = true;
+      if(this.nodeDetail.fullName){
+        this.aliasArr = this.nodeDetail.fullName.split(',');
+      }
+      this.aliasInput = '';
+    },
+
+    addAlias(){
+      if(this.aliasInput){
+        this.aliasArr.push(this.aliasInput);
+        this.aliasInput = '';
+      }
+    },
+    delAlias(index){
+      this.aliasArr.splice(index,1);
+    },
+
+    saveAliasHandle(){
+      this.nodeDetail.fullName = this.aliasArr.join(',');
+      if (this.editType == 1) {
+        //新增
+        this.aliasVisible = false;
+      } else if (this.editType == 2) {
+        //编辑 公有
+        submitFullName(
+          this.nodeDetail.id,this.nodeDetail.fullName
+        ).then(()=>{
+          this.$message({
+            type: 'success',
+            message: '保存成功',
+          })
+          this.aliasVisible = false;
+        })
+      }
     }
+
+
   },
   components: {
     ManualSorting,