Browse Source

优化迭代

master
陈裕财 4 years ago
parent
commit
d8dea5fcf1
  1. 8
      src/views/xm/core/xmIteration/XmIterationInfo.vue
  2. 49
      src/views/xm/core/xmIteration/XmIterationInfoRoute.vue
  3. 5
      src/views/xm/core/xmIteration/XmIterationMng.vue

8
src/views/xm/core/xmIteration/XmIterationInfo.vue

@ -161,6 +161,7 @@
if(infotype=='返回'){ if(infotype=='返回'){
this.goBack() this.goBack()
} }
localStorage.setItem('iteration-infotype',infotype);
}, },
handleExport() { handleExport() {
this.downloadLoading = true this.downloadLoading = true
@ -276,6 +277,7 @@
} }
}, },
goBack(){ goBack(){
localStorage.setItem('iteration-infotype',"迭代概览");
this.$router.back() this.$router.back()
} }
@ -308,7 +310,11 @@
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
var infotype=localStorage.getItem('iteration-infotype');
if(infotype){
this.infotype=infotype
}
}); });
} }
} }

49
src/views/xm/core/xmIteration/XmIterationInfoRoute.vue

@ -9,6 +9,7 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import XmIterationInfo from './XmIterationInfo' import XmIterationInfo from './XmIterationInfo'
import { listXmIterationWithState } from '@/api/xm/core/xmIteration';
export default { export default {
computed: { computed: {
@ -26,7 +27,35 @@
} }
},//end data },//end data
methods: { methods: {
initByQueryId(){
if(this.$route.query && this.$route.query.id){
var localStorageIteration=localStorage.getItem("xm-iteration-info-route")
var iteration=null;
if(localStorageIteration){
iteration=JSON.parse(localStorageIteration)
if(iteration && iteration.id==this.$route.query.id){
this.xmIteration=iteration
this.showInfo=true;
}else{
this.getIteration(this.$route.query.id);
}
}else{
this.getIteration(this.$route.query.id);
}
}
},
getIteration(id){
listXmIterationWithState({id:id}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.xmIteration=res.data.data[0]
localStorage.setItem("xm-iteration-info-route",JSON.stringify(this.xmIteration))
this.showInfo=true;
}else{
}
})
}
},//end methods },//end methods
@ -35,24 +64,10 @@
// //
}, },
activated(){ activated(){
if(this.$route.params && this.$route.params.id){
this.xmIteration=this.$route.params
this.showInfo=true;
localStorage.setItem('xm-iteration-info-route',JSON.stringify(this.xmIteration));
}else{
this.xmIteration=JSON.parse(localStorage.getItem("xm-iteration-info-route"))
this.showInfo=true;
}
this.initByQueryId();
}, },
mounted() { mounted() {
if(this.$route.params && this.$route.params.id){
this.xmIteration=this.$route.params
this.showInfo=true;
localStorage.setItem('xm-iteration-info-route',JSON.stringify(this.xmIteration));
}else{
this.xmIteration=JSON.parse(localStorage.getItem("xm-iteration-info-route"))
this.showInfo=true;
}
this.initByQueryId();
} }
} }
</script> </script>

5
src/views/xm/core/xmIteration/XmIterationMng.vue

@ -329,8 +329,9 @@ import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue'
//info //info
intoInfo(row) { intoInfo(row) {
this.editForm = row;
this.$router.push({ name:'XmIterationInfoRoute', params: row })
this.editForm = row;
localStorage.setItem("xm-iteration-info-route",JSON.stringify(row))
this.$router.push({ name:'XmIterationInfoRoute', query: {id:row.id} })
//this.showInfo = true; //this.showInfo = true;
}, },
//xmIteration //xmIteration

Loading…
Cancel
Save