Browse Source

优化

master
陈裕财 3 years ago
parent
commit
c684e4d9fb
  1. 35
      src/views/xm/core/components/XmIterationSelect.vue
  2. 81
      src/views/xm/core/xmMenu/XmEpicFeatures.vue
  3. 37
      src/views/xm/core/xmMenu/XmEpicFeaturesSelect.vue
  4. 4
      src/views/xm/core/xmMenu/XmMenuAdd.vue
  5. 42
      src/views/xm/core/xmMenu/XmMenuBox.vue
  6. 53
      src/views/xm/core/xmMenu/XmMenuMng.vue
  7. 35
      src/views/xm/core/xmMenu/XmMenuSelect.vue

35
src/views/xm/core/components/XmIterationSelect.vue

@ -141,7 +141,6 @@
import { listXmIteration,listXmIterationWithState, delXmIteration, batchDelXmIteration } from '@/api/xm/core/xmIteration';
import { loadTasksToXmIterationState } from '@/api/xm/core/xmIterationState';
const map=new Map();
import { mapGetters } from 'vuex'
import MdpSelectUserXm from "@/views/xm/core/components/MdpSelectUserXm/index";
@ -280,11 +279,15 @@
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmIterations = res.data.data;
var key=""
if(this.productId){
map.set(this.productId,this.xmIterations)
key='xm-iteration-select-list-prd-'+this.productId
sessionStorage.setItem(key,JSON.stringify(this.xmIterations))
}else if(this.linkProjectId){
map.set(this.linkProjectId,this.xmIterations)
key='xm-iteration-select-list-prj'+this.linkProjectId
sessionStorage.setItem(key,JSON.stringify(this.xmIterations))
}
if(this.autoSelect===true&&this.xmIterations.length>0){
if(this.autoSelect!==false&&this.xmIterations.length>0 && this.iterationVisible==false){
var row=this.xmIterations[0];
@ -332,11 +335,17 @@
this.$emit("close")
},
initData(){
var key=""
if(this.productId){
var xmIterations=map.get(this.productId);
if(xmIterations){
this.xmIterations=xmIterations;
key='xm-iteration-select-list-prd-'+this.productId
}else if(this.linkProjectId){
key='xm-iteration-select-list-prj'+this.linkProjectId
}
if(key){
var xmIterationStr=sessionStorage.getItem(key);
if(xmIterationStr && xmIterationStr!='null' && xmIterationStr!='undefined'){
this.xmIterations=JSON.parse(xmIterationStr);
if(this.autoSelect!==false&&this.xmIterations.length>0 && this.iterationVisible==false){
var row=this.xmIterations[0];
this.$refs.table.setCurrentRow(row);
@ -347,18 +356,6 @@
}else{
this.searchXmIterations();
}
}else if(this.linkProjectId){
var xmIterations=map.get(this.linkProjectId);
if(xmIterations){
this.xmIterations=xmIterations;
if(this.autoSelect!==false&&this.xmIterations.length>0 && this.iterationVisible==false){
var row=this.xmIterations[0];
this.$refs.table.setCurrentRow(row);
this.rowClick(row)
}
}else{
this.searchXmIterations();
}
}else{
this.searchXmIterations();
}

81
src/views/xm/core/xmMenu/XmEpicFeatures.vue

@ -3,7 +3,7 @@
<el-row>
<el-col :span="24">
<el-row >
<xm-product-select ref="xmProductSelect1" v-if="!((xmProduct && xmProduct.id) || (xmIteration && !xmIteration.id))" style="display:inline;" :auto-select="true" :link-project-id="selProject?selProject.id:null" @row-click="onProductSelected" @clear="onProductClearSelect" ></xm-product-select>
<xm-product-select ref="xmProductSelect1" v-if=" !xmProduct || !xmProduct.id" style="display:inline;" :auto-select="true" :link-project-id="selProject?selProject.id:null" @row-click="onProductSelected" @clear="onProductClearSelect" ></xm-product-select>
<span style="float:right;">
<el-popover
placement="top-start"
@ -136,7 +136,7 @@
<tag-dialog ref="tagDialog" :tagIds="filters.tags?filters.tags.map(i=>i.tagId):[]" :jump="true" @select-confirm="onTagSelected">
</tag-dialog>
<el-dialog append-to-body width="60%" top="20px" :visible.sync="parentMenuVisible">
<xm-epic-features-select :xm-product="xmProduct" @select="onParentMenuSelected"></xm-epic-features-select>
<xm-epic-features-select v-if="parentMenuVisible" :xm-product="xmProduct?xmProduct:filters.product" @select="onParentMenuSelected"></xm-epic-features-select>
</el-dialog>
</section>
</template>
@ -167,7 +167,7 @@
import { mapGetters } from 'vuex'
export default {
props:['selProject','xmIteration','xmProduct','disabledMng'],
props:['selProject','xmProduct','disabledMng'],
computed: {
...mapGetters([
'userInfo','roles'
@ -180,18 +180,10 @@
},
},
watch:{
xmIteration:function(){
this.filters.iterationFilterType="join-curr-iteration"
this.filters.iteration=this.xmIteration
this.getXmMenus()
},
xmProduct:function(){
this.filters.product=this.xmProduct
this.getXmMenus()
},
selProject:function(){
this.getXmMenus();
}
},
data() {
const beginDate = new Date();
@ -203,8 +195,6 @@
key: '',
product:null,
mmUser:null,
iterationFilterType:'',//joinnot-join''
taskFilterType:'',//joinnot-join''
tags:[],
status:'',
iteration:null,
@ -229,17 +219,6 @@
sels: [],//
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:"已删除"},
],
dclass:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
@ -325,41 +304,7 @@
if(this.filters.mmUser){
params.mmUserid=this.filters.mmUser.userid;
}
if(this.filters.iterationFilterType){
params.iterationFilterType=this.filters.iterationFilterType
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
if(params.taskFilterType==='not-join-curr-project'){
params.projectId=this.selProject.id
}
if(params.taskFilterType==='join-curr-project'){
params.projectId=this.selProject.id
}
params.ntype="0"
}
if(this.selProject && this.selProject.id){
params.linkProjectId=this.selProject.id
}
}
if(this.filters.product){
params.productId=this.filters.product.id
}
@ -392,12 +337,6 @@
if(this.filters.dclasss){
params.dclasss=this.filters.dclasss
}
if(this.filters.menuId){
params.menuId=this.filters.menuId
}
if(this.filters.productId){
params.productId=this.filters.productId
}
return params;
},
// XmMenu xm_project_menu
@ -416,10 +355,10 @@
}
params.orderBy= orderBys.join(",")
}
if( this.filters.product && this.filters.product.id){
params.productId=this.filters.product.id
}
params=this.getParams(params);
if(!params.productId){
return;
}
let callback= (res)=>{
var tips=res.data.tips;
if(tips.isOk){
@ -432,11 +371,7 @@
this.load.list = false;
}
this.load.list = true;
if(!this.selProject){
listXmMenuWithState(params).then( callback ).catch( err => this.load.list = false );
}else{
listXmMenuWithPlan(params).then( callback ).catch( err => this.load.list = false );
}
listXmMenuWithState(params).then( callback ).catch( err => this.load.list = false );
},
// XmMenu xm_project_menu

37
src/views/xm/core/xmMenu/XmEpicFeaturesSelect.vue

@ -77,20 +77,41 @@
let xmMenus = JSON.parse(JSON.stringify(this.xmMenus || []));
let xmMenusTreeData = treeTool.translateDataToTree(xmMenus,"pmenuId","menuId");
return xmMenusTreeData;
},
},
toSearchCpd(){
debugger;
var key={iterationId:'',projectId:'',productId:''};
if(this.xmIteration&&this.xmIteration.id){
key.iterationId=this.xmIteration.id
key.productId=this.xmIteration.productId
}else{
key.iterationId=''
}
if(this.xmProduct&&this.xmProduct.id){
key.productId=this.xmProduct.id
}else{
key.productId=''
}
if(this.selProject&&this.selProject.id){
key.projectId=this.selProject.id
}else{
key.projectId=''
}
return key.iterationId+key.projectId+key.productId
}
},
watch:{
xmIteration:function(){
this.filters.iterationFilterType="join-curr-iteration"
this.filters.iteration=this.xmIteration
this.getXmMenus()
this.filters.iteration=this.xmIteration
},
"xmProduct.id":function(){
this.filters.product=this.xmProduct
this.getXmMenus()
xmProduct:function(){
this.filters.product=this.xmProduct
},
selProject:function(){
this.getXmMenus();
selProject:function(){
},
toSearchCpd:function(){
this.searchXmMenus();
}
},
data() {

4
src/views/xm/core/xmMenu/XmMenuAdd.vue

@ -16,8 +16,8 @@
<el-row class="label-font-color"><span v-if="addForm.productName">归属产品{{ addForm.productName}} &nbsp;&nbsp;|&nbsp;&nbsp;</span><span v-if="addForm.productId"> 产品编号{{ addForm.productId }}&nbsp;&nbsp;|&nbsp;&nbsp;</span><span v-if=" addForm.iterationName ">迭代名称:{{addForm.iterationName}}&nbsp;&nbsp;|&nbsp;&nbsp;</span><span v-if="addForm.iterationId">迭代编号{{addForm.iterationId}}</span></el-row>
</el-form-item>
<el-row class="padding">
<el-col :span="8">
<mdp-field-x v-if="(!parentMenu || !parentMenu.menuId) && (!xmMenu || !xmMenu.pmenuId)" v-model="addForm.pmenuName" :label="addForm.dclass==='3'?'归属特性':(addForm.dclass==='2'?'归属史诗':'归属')" :icon="addForm.dclass==='2'?'el-icon-s-promotion':'el-icon-s-flag'" :color="addForm.dclass==='2'?'rgb(255, 153, 51)':'rgb(0, 153, 51)'">
<el-col :span="8" v-if="xmMenu.dclass!='1'">
<mdp-field-x v-if="(!parentMenu || !parentMenu.menuId) && (!xmMenu || !xmMenu.pmenuId) " v-model="addForm.pmenuName" :label="addForm.dclass==='3'?'归属特性':(addForm.dclass==='2'?'归属史诗':'归属')" :icon="addForm.dclass==='2'?'el-icon-s-promotion':'el-icon-s-flag'" :color="addForm.dclass==='2'?'rgb(255, 153, 51)':'rgb(0, 153, 51)'">
<el-button slot="oper"
@click="parentMenuSelectVisible=true"
title="选择上级"

42
src/views/xm/core/xmMenu/XmMenuBox.vue

@ -7,10 +7,16 @@
<xm-product-select ref="xmProductSelect1" style="display:inline;" :auto-select="true" :link-project-id="selProject?selProject.id:null" @row-click="onProductSelected" @clear="onProductClearSelect" ></xm-product-select>
</el-row>
-->
<xm-epic-features :xm-product="xmProduct" :sel-project="selProject" @row-click="onEpicFeaturesRowClick" @product-selected="onProductSelected" @product-clear="onProductClearSelect"></xm-epic-features>
<xm-epic-features :xm-product="xmProductCpd" :sel-project="selProject" @row-click="onEpicFeaturesRowClick" @product-selected="onProductSelected" @product-clear="onProductClearSelect"></xm-epic-features>
</el-col>
<el-col :span="16" v-if="filters.xmProduct && filters.xmProduct.id">
<xm-menu-mng class="padding-left" :xm-product="filters.xmProduct" :sel-project="selProject" :parent-menu="parentMenu" :xm-iteration="xmIteration" ></xm-menu-mng>
<el-col :span="16" v-if="xmProductCpd && xmProductCpd.id">
<xm-menu-mng class="padding-left" :xm-product="xmProductCpd" :sel-project="selProject" :parent-menu="parentMenu" :xm-iteration="xmIteration" ></xm-menu-mng>
</el-col>
<el-col :span="16" v-else-if="filters.xmProduct && filters.xmProduct.id">
<xm-menu-mng class="padding-left" :xm-product="filters.xmProduct" :sel-project="selProject" :parent-menu="parentMenu" :xm-iteration="xmIteration" ></xm-menu-mng>
</el-col>
</el-row>
</section>
@ -33,25 +39,19 @@
...mapGetters([
'userInfo','roles'
]),
xmProductCpd(){
if(this.xmProduct && this.xmProduct.id){
return this.xmProduct
}
if(this.xmIteration && this.xmIteration.id && this.xmIteration.productId){
return {id:this.xmIteration.productId,productName:this.xmIteration.productName}
}
return null;
}
},
watch: {
xmProduct:{
handler(){
this.filters.xmProduct={...this.xmProduct}
},
deep:true,
},
xmIteration:{
handler(){
if(this.xmProduct && this.xmProduct.id){
return;
}
this.filters.xmProduct={id:this.xmIteration.productId,productName:this.xmIteration.productName}
},
deep:true,
}
},
data() {
return {
@ -69,10 +69,12 @@
this.parentMenu=menu
},
onProductSelected(product){
this.filters.xmProduct=product
this.filters.xmProduct=product
this.parentMenu=null
},
onProductClearSelect(){
this.filters.xmProduct=null;
this.parentMenu=null
}
},//end method
mounted() {

53
src/views/xm/core/xmMenu/XmMenuMng.vue

@ -440,7 +440,7 @@
import MdpSelectUserXm from "@/views/xm/core/components/MdpSelectUserXm/index";
export default {
props:[ 'xmIteration','xmProduct','disabledMng','parentMenu','paddingTop','selProject'],
props:[ 'xmIteration','xmProduct','disabledMng','parentMenu','selProject'],
computed: {
...mapGetters([
'userInfo','roles'
@ -449,22 +449,42 @@
xmMenusTreeData() {
return this.xmMenus;
},
toSearchCpd(){
var key={iterationId:'',projectId:'',productId:'',pmenuId:''};
if(this.xmIteration&&this.xmIteration.id){
key.iterationId=this.xmIteration.id
key.productId=this.xmIteration.productId
}else{
key.iterationId=''
}
if(this.xmProduct&&this.xmProduct.id){
key.productId=this.xmProduct.id
}else{
key.productId=''
}
if(this.selProject&&this.selProject.id){
key.projectId=this.selProject.id
}else{
key.projectId=''
}
if(this.parentMenu&&this.parentMenu.menuId){
key.pmenuId=this.parentMenu.menuId
key.productId=this.parentMenu.productId
}else{
key.pmenuId=''
}
return key.iterationId+key.projectId+key.productId+key.pmenuId
}
},
watch:{
xmIteration:function(){
this.filters.iterationFilterType="join-curr-iteration"
this.filters.iteration=this.xmIteration
this.getXmMenus()
this.filters.iteration=this.xmIteration
},
xmProduct:function(){
this.filters.product=this.xmProduct
this.getXmMenus()
},
selProject:function(){
this.getXmMenus();
}
,
"parentMenu.menuId":function(){
this.filters.product=this.xmProduct
},
toSearchCpd:function(){
this.searchXmMenus();
}
},
@ -508,17 +528,6 @@
sels: [],//
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:"已删除"},
],
dclass:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}

35
src/views/xm/core/xmMenu/XmMenuSelect.vue

@ -221,11 +221,32 @@ import XmEpicFeatures from './XmEpicFeaturesSelect.vue';
xmMenusTreeData(){
return this.xmMenus
},
toSearchCpd(){
var key={iterationId:'',projectId:'',productId:''};
if(this.xmIteration&&this.xmIteration.id){
key.iterationId=this.xmIteration.id
key.productId=this.xmIteration.productId
}else{
key.iterationId=''
}
if(this.xmProduct&&this.xmProduct.id){
key.productId=this.xmProduct.id
}else{
key.productId=''
}
if(this.selProject&&this.selProject.id){
key.projectId=this.selProject.id
}else{
key.projectId=''
}
return key.iterationId+key.projectId+key.productId
}
},
watch:{
visible:function(visible){
if(visible==true){
this.searchXmMenus();
//this.searchXmMenus();
}
},
"xmIteration"(){
@ -234,17 +255,17 @@ import XmEpicFeatures from './XmEpicFeaturesSelect.vue';
}
if(this.xmIteration){
this.filters.iteration=this.xmIteration
}
this.searchXmMenus();
}
},
"xmProduct"(){
this.filters.product=this.xmProduct
this.searchXmMenus();
this.filters.product=this.xmProduct
},
"selProject"(){
},
"selProject"(){
toSearchCpd:function(){
this.searchXmMenus();
}
}
},
data() {
const beginDate = new Date();

Loading…
Cancel
Save