diff --git a/src/views/xm/core/xmMenu/XmMenuMng.vue b/src/views/xm/core/xmMenu/XmMenuMng.vue index 2c9c7c00..e7786f6b 100644 --- a/src/views/xm/core/xmMenu/XmMenuMng.vue +++ b/src/views/xm/core/xmMenu/XmMenuMng.vue @@ -4,6 +4,36 @@ + + + {{filters.product?filters.product.productName:'选择产品'}} + + + + + {{filters.iteration?filters.iteration.iterationName:'选择迭代'}} + + + + + + + + + + + + + + @@ -13,39 +43,21 @@ - - - - - - - - - - - - - - - + 标签条件 + {{filters.tags[0].tagName.substr(0,5)}}等({{filters.tags.length}})个 - - - - {{filters.product?filters.product.productName:'选择产品'}} - + + + + 查询 - 标签 - {{filters.tags[0].tagName.substr(0,5)}}等({{filters.tags.length}})个 + 需求 - 批量修改 + 批量修改 更换上级 删除 @@ -141,7 +153,21 @@ - + + @@ -222,13 +248,9 @@ - - - - - + - + @@ -240,17 +262,7 @@ :with-header="false" size="80%"> - - - - - + @@ -294,6 +306,7 @@ import { batchRelTasksWithMenu } from '@/api/xm/core/xmTask'; import { loadTasksToXmMenuState} from '@/api/xm/core/xmMenuState'; + import { batchDelXmIterationMenu,batchAddXmIterationMenu } from '@/api/xm/core/xmIterationMenu'; import XmMenuAdd from './XmMenuAdd';//新增界面 import XmMenuEdit from './XmMenuEdit';//修改界面 @@ -304,7 +317,7 @@ import XmTaskList from '../xmTask/XmTaskList'; import XmTaskMng from '../xmTask/XmTaskMng'; import XmTaskListForMenu from '../xmTask/XmTaskListForMenu'; - import XmIterationMng from '../xmIteration/XmIterationSelect';//修改界面 + import XmIterationSelect from '../xmIteration/XmIterationSelect';//修改界面 import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; import XmMenuSelect from "../xmMenu/XmMenuSelect"; @@ -325,19 +338,12 @@ let xmMenus = JSON.parse(JSON.stringify(this.xmMenus || [])); let xmMenusTreeData = treeTool.translateDataToTree(xmMenus,"pmenuId","menuId"); return xmMenusTreeData; - }, - isPmUser(){ - if(this.filters.product){ - if(this.userInfo.userid==this.filters.product.pmUserid){ - return true; - } - } - return false; - } + }, }, watch:{ xmIteration:function(){ this.filters.iterationFilterType="join-curr-iteration" + this.filters.iteration=this.xmIteration this.getXmMenus() }, xmProduct:function(){ @@ -360,26 +366,14 @@ mmUser:null, iterationFilterType:'',//join、not-join、'' taskFilterType:'',//join、not-join、'' - tags:[], - parentMenu:null, - parentMenuList:[], + tags:[], status:'', - }, - dicts:{ - menuStatus:[ - - {id:"0", name:"初始"}, - {id:"1", name:"待评审"}, - {id:"2", name:"待设计"}, - {id:"3", name:"待开发"}, - {id:"4", name:"待SIT"}, - {id:"5", name:"待UAT"}, - {id:"6", name:"待上线"}, - {id:"7", name:"运行中"}, - {id:"8", name:"已下线"}, - {id:"9", name:"已删除"}, - ] - }, + iteration:null, + dlvl:'', + dtype:'', + priority:'', + source:'', + }, xmMenus: [],//查询结果 pageInfo:{//分页数据 total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 @@ -436,6 +430,7 @@ tagSelectVisible:false, parentMenuVisible:false, maps:new Map(), + linkIterationPopoverVisible:false, /**begin 自定义属性请在下面加 请加备注**/ /**end 自定义属性请在上面加 请加备注**/ @@ -468,11 +463,7 @@ this.pageInfo.count=true; this.getXmMenus(); }, - getParams(params){ - - if(!params.productId){ - params.branchId=this.userInfo.branchId - } + getParams(params){ if( this.filters.key){ params.key="%"+this.filters.key+"%" @@ -483,26 +474,53 @@ } if(this.filters.iterationFilterType){ params.iterationFilterType=this.filters.iterationFilterType - } - if(this.xmIteration){ - params.filterIterationId=this.xmIteration.id + if(params.iterationFilterType==='not-join-any-iteration'){ + + }else if(params.iterationFilterType==='join-any-iteration'){ + + }else if(params.iterationFilterType==='not-join-curr-iteration'){ + params.filterIterationId=this.filters.iteration.id + }else if(params.iterationFilterType==='join-curr-iteration'){ + params.filterIterationId=this.filters.iteration.id + } + params.ntype="0" + }else{ + if(this.filters.iteration){ + params.iterationId=this.filters.iteration.id + } + } + if(this.xmIteration && this.xmIteration.id){ + params.linkIterationId=this.xmIteration.id } if(this.filters.taskFilterType){ - params.taskFilterType=this.filters.taskFilterType + params.taskFilterType=this.filters.taskFilterType + params.projectId=this.selProject.id + params.ntype="0" + } + if(this.selProject && this.selProject.id){ + params.linkProjectId=this.selProject.id } - if(this.selProject){ - params.projectId=this.selProject.id - } - if(this.filters.product){ params.productId=this.filters.product.id + } + if(this.filters.status){ + params.status=this.filters.status } - if(this.filters.parentMenu){ - params.pmenuId=this.filters.parentMenu.menuId + + if(this.filters.dlvl){ + params.dlvl=this.filters.dlvl } - if(this.filters.status){ - params.status=this.filters.status + if(this.filters.dtype){ + params.dtype=this.filters.dtype + } + + if(this.filters.priority){ + params.priority=this.filters.priority + } + + if(this.filters.source){ + params.source=this.filters.source } if( this.dateRanger && this.dateRanger.length==2){ params.ctimeStart=this.dateRanger[0] @@ -510,10 +528,7 @@ } if(this.filters.tags && this.filters.tags.length>0){ params.tagIdList=this.filters.tags.map(i=>i.tagId) - } - if(!(params.ctimeStart||params.pmenuId||params.projectId||params.filterIterationId||params.iterationFilterType||params.mmUserid||params.key||params.taskFilterType||params.tagIdList||params.status)){ - params.isTop="1" - } + } return params; }, loadXmMenusLazy(tree, treeNode, resolve) { @@ -556,11 +571,7 @@ } if( this.filters.product && this.filters.product.id){ params.productId=this.filters.product.id - }else { - //this.$notify({showClose: true, message: "请先选择产品", type: 'warning'}); - return; - } - + } params=this.getParams(params); params.withParents="1" //params.isTop="1" @@ -619,13 +630,29 @@ this.sels = sels; }, onProductSelected:function(product){ - this.filters.product=product - this.filters.parentMenu=null; - this.filters.parentMenuList=[]; + this.filters.product=product this.productVisible=false; this.xmMenus=[] this.getXmMenus() }, + onProductClearSelect:function(){ + this.filters.product=null + this.productVisible=false; + this.xmMenus=[] + this.getXmMenus() + }, + onIterationSelected:function(iteration){ + this.filters.iteration=iteration + this.iterationVisible=false; + this.xmMenus=[] + this.getXmMenus() + }, + onIterationClearSelect:function(){ + this.filters.iteration=null + this.iterationVisible=false; + this.xmMenus=[] + this.getXmMenus() + }, //删除xmMenu handleDel: function (row,index) { this.$confirm('确认删除该记录吗?', '提示', { @@ -888,30 +915,10 @@ toSelectProduct(){ this.productVisible=true; }, - searchSubMenus(row,index){ - - this.filters.parentMenu=row - this.filters.parentMenuList.push(row); + searchSubMenus(row,index){ this.pageInfo.count=true; this.searchXmMenus(); - }, - clearParentMenu(menu,index){ - if(index==0){ - this.filters.parentMenu=null; - this.filters.parentMenuList=[]; - }else{ - this.filters.parentMenu=this.filters.parentMenuList[index-1]; - this.filters.parentMenuList.splice(index,this.filters.parentMenuList.length-index) - } - this.pageInfo.count=true - this.searchXmMenus(); - }, - onParentMenuClick(menu,index){ - this.filters.parentMenu=this.filters.parentMenuList[index]; - this.filters.parentMenuList.splice(index+1,this.filters.parentMenuList.length-index) - this.pageInfo.count=true - this.searchXmMenus(); - }, + }, clearFiltersTag(tag){ var index=this.filters.tags.findIndex(i=>i.tagId==tag.tagId) this.filters.tags.splice(index,1); @@ -979,6 +986,41 @@ var item=dict.find(i=>i.id==cellValue) return item?item.name:cellValue; } + }, + doBatchDelXmIterationMenu(){ + if(this.sels.length==0){ + this.$notify({showClose:true,message:"请选择一个或者多个需求进行操作",type:'warning'}) + return; + } + var params={ + menuIds:this.sels.map(i=>i.menuId), + iterationId:this.xmIteration.id + } + batchDelXmIterationMenu(params).then(res=>{ + var tips =res.data.tips; + if(tips.isOk){ + this.searchXmMenus(); + } + this.$notify({showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) + }) + }, + doBatchAddXmIterationMenu(){ + if(this.sels.length==0){ + this.$notify({showClose:true,message:"请选择一个或者多个需求进行操作",type:'warning'}) + return; + } + var params={ + menuIds:this.sels.map(i=>i.menuId), + iterationId:this.xmIteration.id + } + batchAddXmIterationMenu(params).then(res=>{ + var tips =res.data.tips; + if(tips.isOk){ + this.searchXmMenus(); + } + this.$notify({showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) + + }) } },//end methods components: { @@ -990,7 +1032,7 @@ XmTaskList, XmTaskMng, XmTaskListForMenu, - XmIterationMng, + XmIterationSelect, UsersSelect, XmMenuMngBatch, TagMng, @@ -1011,6 +1053,7 @@ if(this.xmIteration && this.xmIteration.id){ this.filters.iterationFilterType='join-curr-iteration' + this.filters.iteration=this.xmIteration } this.$nextTick(() => { this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);