From 75731a87e276663b724594a15f65cea5ac7a477d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Mon, 14 Mar 2022 12:17:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/xm/core/xmMenu.js | 4 ++ src/views/xm/core/xmMenu/XmMenuMng.vue | 59 +++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/api/xm/core/xmMenu.js b/src/api/xm/core/xmMenu.js index 50926fdb..6716ea59 100644 --- a/src/api/xm/core/xmMenu.js +++ b/src/api/xm/core/xmMenu.js @@ -40,3 +40,7 @@ export const batchAddXmMenu = params => { return axios.post(`${base}/xm/core/xmM export const batchEditXmMenu = params => { return axios.post(`${base}/xm/core/xmMenu/batchEdit`, params); }; +export const batchChangeParentMenu = params => { return axios.post(`${base}/xm/core/xmMenu/batchChangeParentMenu`, params); }; + + + diff --git a/src/views/xm/core/xmMenu/XmMenuMng.vue b/src/views/xm/core/xmMenu/XmMenuMng.vue index 73b8718c..d6ae6c48 100644 --- a/src/views/xm/core/xmMenu/XmMenuMng.vue +++ b/src/views/xm/core/xmMenu/XmMenuMng.vue @@ -44,6 +44,7 @@ 需求 + 更换上级 删除 汇总进度 @@ -237,6 +238,22 @@ + + + + + @@ -245,7 +262,7 @@ import treeTool from '@/common/js/treeTool';//全局公共库 //import Sticky from '@/components/Sticky' // 粘性header组件 //import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 - import { listXmMenu, delXmMenu, batchDelXmMenu,batchAddXmMenu,batchEditXmMenu,listXmMenuWithState,listXmMenuWithPlan } from '@/api/xm/core/xmMenu'; + import { listXmMenu, delXmMenu, batchDelXmMenu,batchAddXmMenu,batchEditXmMenu,listXmMenuWithState,listXmMenuWithPlan,batchChangeParentMenu } from '@/api/xm/core/xmMenu'; import { batchRelTasksWithMenu } from '@/api/xm/core/xmTask'; import { loadTasksToXmMenuState} from '@/api/xm/core/xmMenuState'; @@ -261,6 +278,8 @@ import XmTaskListForMenu from '../xmTask/XmTaskListForMenu'; import XmIterationMng from '../xmIteration/XmIterationSelect';//修改界面 import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; + + import XmMenuSelect from "../xmMenu/XmMenuSelect"; import TagMng from "@/views/mdp/arc/tag/TagMng"; import {sn} from '@/common/js/sequence' @@ -372,6 +391,7 @@ pickerOptions: util.pickerOptions('datarange'), productVisible:false, tagSelectVisible:false, + parentMenuVisible:false, maps:new Map(), /**begin 自定义属性请在下面加 请加备注**/ @@ -863,7 +883,41 @@ this.filters.tags=tags } this.searchXmMenus(); - } + }, + showParentMenu(){ + if(this.filters.product && this.filters.product.id){ + if(this.sels.length==0){ + this.$notify({showClose:true,message:'请先选择一个或者多个需求',type:'warning'}) + return; + } + this.parentMenuVisible=true; + }else{ + this.$notify({showClose:true,message:'请先选择产品',type:'warning'}) + return; + } + + }, + onParentMenuSelected(menu){ + + if(!menu||!menu.menuId){ + this.$notify({showClose:true,message:'请先选择一个上级需求',type:'warning'}) + return; + } + this.parentMenuVisible=false; + var params={ + menuIds:this.sels.map(i=>i.menuId), + pmenuId:menu.menuId + } + batchChangeParentMenu(params).then(res=>{ + var tips = res.data.tips; + if(tips.isOk){ + this.searchXmMenus(); + var rows=[...this.sels,{menuId:'',pmenuId:menu.menuId}] + treeTool.reloadAllChildren(this.$refs.table,this.maps,rows,'pmenuId',this.loadXmMenusLazy) + } + this.$notify({showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) + }) + } },//end methods components: { 'xm-menu-add':XmMenuAdd, @@ -878,6 +932,7 @@ UsersSelect, XmMenuMngBatch, TagMng, + XmMenuSelect, //在下面添加其它组件 }, mounted() {