Browse Source

优化

master
陈裕财 4 years ago
parent
commit
cb081b4425
  1. 5
      src/views/xm/core/components/XmIterationSelect.vue
  2. 2
      src/views/xm/core/components/XmProductSelect.vue
  3. 2
      src/views/xm/core/components/XmProjectSelect.vue
  4. 51
      src/views/xm/rpt/product/menuAttDist.vue

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

@ -212,6 +212,8 @@
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
this.rowClick(row) this.rowClick(row)
} }
}else{
this.clearSelectIteration()
} }
}else{ }else{
this.$notify({showClose: true, message: tips.msg, type: 'error' }); this.$notify({showClose: true, message: tips.msg, type: 'error' });
@ -247,6 +249,7 @@
this.$emit("close") this.$emit("close")
}, },
initData(){ initData(){
if(this.productId){ if(this.productId){
var xmIterations=map.get(this.productId); var xmIterations=map.get(this.productId);
if(xmIterations){ if(xmIterations){
@ -255,6 +258,8 @@
var row=this.xmIterations[0]; var row=this.xmIterations[0];
this.$refs.table.setCurrentRow(row); this.$refs.table.setCurrentRow(row);
this.rowClick(row) this.rowClick(row)
}else{
this.clearSelectIteration()
} }
}else{ }else{
this.searchXmIterations(); this.searchXmIterations();

2
src/views/xm/core/components/XmProductSelect.vue

@ -280,7 +280,7 @@
}, },
clearSelect(){ clearSelect(){
this.$refs.table.setCurrentRow(); this.$refs.table.setCurrentRow();
this.$emit("clear-select");
this.$emit("clear");
this.selectedProduct(null); this.selectedProduct(null);
this.productVisible=false; this.productVisible=false;
this.moreVisible=false; this.moreVisible=false;

2
src/views/xm/core/components/XmProjectSelect.vue

@ -282,7 +282,7 @@
}, },
clearSelect(){ clearSelect(){
this.$refs.table.setCurrentRow(); this.$refs.table.setCurrentRow();
this.$emit("clear-select");
this.$emit("clear");
this.selectedProduct(null); this.selectedProduct(null);
this.projectVisible=false; this.projectVisible=false;
this.moreVisible=false; this.moreVisible=false;

51
src/views/xm/rpt/product/menuAttDist.vue

@ -15,13 +15,15 @@
<el-select v-model="groupBy" @change="onXmMenuSomeFieldsChange('groupBy',$event)" clearable> <el-select v-model="groupBy" @change="onXmMenuSomeFieldsChange('groupBy',$event)" clearable>
<el-option v-for="i in this.groupBys" :label="i.name" :key="i.id" :value="i.id"></el-option> <el-option v-for="i in this.groupBys" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select> </el-select>
</el-form-item>
<el-form-item label="需求状态" prop="status">
</el-form-item>
<xm-product-select class="padding" v-if="!xmProduct && !xmIteration" ref="xmProductSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear-select="onProductClear"></xm-product-select>
<xm-iteration-select ref="xmIterationSelect" class="padding" v-if="!xmIteration || !xmIteration.id" :auto-select="false" :product-id="filters.product?filters.product.id:null" :link-project-id="xmProject?xmProject.id:null" placeholder="迭代" @row-click="onIterationSelected" @clear-select="onIterationClear"></xm-iteration-select>
<el-form-item label="需求状态" prop="status">
<el-select v-model="filters.status" @change="onXmMenuSomeFieldsChange('status',$event)" clearable> <el-select v-model="filters.status" @change="onXmMenuSomeFieldsChange('status',$event)" clearable>
<el-option v-for="i in this.dicts.menuStatus" :label="i.name" :key="i.id" :value="i.id"></el-option> <el-option v-for="i in this.dicts.menuStatus" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select> </el-select>
</el-form-item>
</el-form-item>
<el-form-item label="需求类型" prop="dtype" > <el-form-item label="需求类型" prop="dtype" >
<el-select v-model="filters.dtype" @change="onXmMenuSomeFieldsChange('dtype',$event)" clearable> <el-select v-model="filters.dtype" @change="onXmMenuSomeFieldsChange('dtype',$event)" clearable>
<el-option v-for="i in this.dicts.demandType" :label="i.name" :key="i.id" :value="i.id"></el-option> <el-option v-for="i in this.dicts.demandType" :label="i.name" :key="i.id" :value="i.id"></el-option>
@ -58,11 +60,16 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getXmMenuAttDist } from '@/api/xm/core/xmMenu'; import { getXmMenuAttDist } from '@/api/xm/core/xmMenu';
import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//
export default { export default {
components: { components: {
XmIterationSelect,XmProductSelect,
}, },
props:['xmProduct'],
props:['xmProduct','xmIteration','xmProject'],
computed: { computed: {
...mapGetters([ ...mapGetters([
'userInfo','roles' 'userInfo','roles'
@ -119,9 +126,8 @@
data() { data() {
return { return {
filters:{ filters:{
category:'',
product:null,
project:null,
product:null,
iteration:null,
}, },
groupBy:'status', groupBy:'status',
groupBys:[ groupBys:[
@ -162,12 +168,6 @@
} }
} }
return max; return max;
},
getXmMenuAttDist(){
var params={productId:'mmcloud-xm',orderBy:'biz_date asc'}
getXmMenuAttDist(params).then(res=>{
this.xmMenuAttDists=res.data.tips.isOk?res.data.data:this.xmMenuAttDists;
})
}, },
open(params){ open(params){
this.visible=true; this.visible=true;
@ -239,10 +239,33 @@
params.priority=this.filters.priority params.priority=this.filters.priority
} }
params.groupBy=this.groupBy params.groupBy=this.groupBy
if(this.filters.product){
params.productId=this.filters.product.id
}
if(this.filters.iteration){
params.iterationId=this.filters.iteration.id
}
getXmMenuAttDist(params).then(res=>{ getXmMenuAttDist(params).then(res=>{
this.xmMenuAttDists=res.data.data this.xmMenuAttDists=res.data.data
}) })
},
onProductSelected(product){
this.filters.product=product
},
onProductClear(){
this.filters.product=null
},
onIterationSelected(iteration){
this.filters.iteration=iteration
},
onIterationClear(){
this.filters.iteration=null
} }
},//end method },//end method
mounted() { mounted() {

Loading…
Cancel
Save