Browse Source

优化

master
陈裕财 3 years ago
parent
commit
7ab317288c
  1. 49
      src/views/xm/rpt/CompsCard.vue

49
src/views/xm/rpt/CompsCard.vue

@ -132,25 +132,39 @@ export default {
}, },
rptConfigParamsCpd(){ rptConfigParamsCpd(){
//1-2-3-4-5- //1-2-3-4-5-
var params={bizType:'5',bizId:this.userInfo.branchId}
var params={bizType:'5',bizId:this.userInfo.branchId,name:''}
if(this.category=='企业级'){ if(this.category=='企业级'){
params.bizType='5'; params.bizType='5';
params.bizId=this.userInfo.branchId params.bizId=this.userInfo.branchId
params.name=this.userInfo.branchName
}else if(this.category=='产品级'){ }else if(this.category=='产品级'){
params.bizType='1'; params.bizType='1';
params.bizId=this.userInfo.branchId
params.bizId=this.xmProduct.id
params.name=this.xmProduct.productName
}else if(this.category=='迭代级'){ }else if(this.category=='迭代级'){
params.bizType='2'; params.bizType='2';
params.bizId=this.userInfo.branchId
params.bizId=this.xmIteration.id
params.name=this.xmIteration.iterationName
}else if(this.category=='项目级'){ }else if(this.category=='项目级'){
params.bizType='4'; params.bizType='4';
params.bizId=this.userInfo.branchId
params.bizId=this.xmProject.id
params.name=this.xmProject.name
}else if(this.category=='测试级'){ }else if(this.category=='测试级'){
if(this.xmTestPlan && this.xmTestPlan.id){
params.bizType='3'; params.bizType='3';
params.bizId=this.userInfo.branchId
params.bizId=this.xmTestPlan.id
params.name=this.xmTestPlan.name
}else{
params.bizType='6';
params.bizId=this.xmTestCasedb.id
params.name=this.xmTestCasedb.name
}
}else { }else {
return params; return params;
} }
return params;
} }
}, },
@ -264,15 +278,20 @@ export default {
} }
}, },
submitXmPrtConfig(callback){ submitXmPrtConfig(callback){
if(this.xmRptConfig==null){ if(this.xmRptConfig==null){
var xmRptConfig={name:this.xmTestPlan.name,bizId:this.xmTestPlan.id,cfg:[]}
var xmRptConfig={...this.rptConfigParamsCpd,cfg:[]}
var compCfgList=JSON.parse(JSON.stringify(this.compCfgList)) var compCfgList=JSON.parse(JSON.stringify(this.compCfgList))
compCfgList.forEach(k=>{ compCfgList.forEach(k=>{
if(this.$refs[k.id] && this.$refs[k.id][0].$refs && this.$refs[k.id][0].$refs[k.id]){ if(this.$refs[k.id] && this.$refs[k.id][0].$refs && this.$refs[k.id][0].$refs[k.id]){
k.params=this.$refs[k.id][0].$refs[k.id].filters
var com=this.$refs[k.id][0].$refs[k.id]
k.params=com.params
k.title=com.title
k.remark=com.remark
}else{ }else{
k.params=this.$refs[k.id][0].filters
var com=this.$refs[k.id][0]
k.params=com.params
k.title=com.title
k.remark=com.remark
} }
}) })
@ -282,13 +301,19 @@ export default {
callback() callback()
}) })
}else{ }else{
var xmRptConfig={id:this.xmRptConfig.id,name:this.xmTestPlan.name,bizId:this.xmTestPlan.id,cfg:[]}
var xmRptConfig={...this.xmRptConfig,cfg:[]}
var compCfgList=JSON.parse(JSON.stringify(this.compCfgList)) var compCfgList=JSON.parse(JSON.stringify(this.compCfgList))
compCfgList.forEach(k=>{ compCfgList.forEach(k=>{
if(this.$refs[k.id] && this.$refs[k.id][0].$refs && this.$refs[k.id][0].$refs[k.id]){ if(this.$refs[k.id] && this.$refs[k.id][0].$refs && this.$refs[k.id][0].$refs[k.id]){
k.params=this.$refs[k.id][0].$refs[k.id].filters
var com=this.$refs[k.id][0].$refs[k.id]
k.params=com.params
k.title=com.title
k.remark=com.remark
}else{ }else{
k.params=this.$refs[k.id][0].filters
var com=this.$refs[k.id][0]
k.params=com.params
k.title=com.title
k.remark=com.remark
} }
}) })
xmRptConfig.cfg=JSON.stringify(compCfgList) xmRptConfig.cfg=JSON.stringify(compCfgList)

Loading…
Cancel
Save