Browse Source

优化

master
陈裕财 3 years ago
parent
commit
45b0eda2b1
  1. 11
      src/views/xm/core/xmTestPlan/XmTestPlanInfo.vue
  2. 28
      src/views/xm/rpt/CompsCard.vue
  3. 12
      src/views/xm/rpt/index.vue

11
src/views/xm/core/xmTestPlan/XmTestPlanInfo.vue

@ -43,11 +43,11 @@
</el-row> </el-row>
<el-row v-if="subPage=='testRpt'"> <el-row v-if="subPage=='testRpt'">
<xm-test-plan-rpt ref="rpt" :xm-test-casedb="xmTestCasedb" :xm-test-plan="xmTestPlan" :xm-product="{id:xmTestCasedb.productId,productName:xmTestCasedb.productName}" :xm-project="{id:xmTestPlan.projectId,name:xmTestPlan.projectName}" category="测试级"></xm-test-plan-rpt >
<xm-test-plan-rpt key="rpt" ref="rpt" :xm-test-casedb="xmTestCasedb" :xm-test-plan="xmTestPlan" :xm-product="{id:xmTestCasedb.productId,productName:xmTestCasedb.productName}" :xm-project="{id:xmTestPlan.projectId,name:xmTestPlan.projectName}" category="测试级" :is-rpt-show="true"></xm-test-plan-rpt >
</el-row> </el-row>
<el-row v-if="subPage=='xmReport'"> <el-row v-if="subPage=='xmReport'">
<xm-report ref="xmReport" :xm-test-casedb="xmTestCasedb" :xm-test-plan="xmTestPlan" :xm-product="{id:xmTestCasedb.productId,productName:xmTestCasedb.productName}" :xm-project="{id:xmTestPlan.projectId,name:xmTestPlan.projectName}" category="测试级"></xm-report >
<xm-report key="xmReport" ref="xmReport" :xm-test-casedb="xmTestCasedb" :xm-test-plan="xmTestPlan" :xm-product="{id:xmTestCasedb.productId,productName:xmTestCasedb.productName}" :xm-project="{id:xmTestPlan.projectId,name:xmTestPlan.projectName}" category="测试级"></xm-report >
</el-row> </el-row>
</el-row> </el-row>
<xm-test-plan-mng v-else @select="onTestPlanSelect" :xm-test-casedb="xmTestCasedb"> </xm-test-plan-mng> <xm-test-plan-mng v-else @select="onTestPlanSelect" :xm-test-casedb="xmTestCasedb"> </xm-test-plan-mng>
@ -147,10 +147,12 @@ export default {
this.xmTestPlan=row this.xmTestPlan=row
}, },
showRptConfig(){ showRptConfig(){
this.$refs['rpt'].rptConfigVisible=true
this.$refs['rpt'].isRptCfg=true
}, },
print(){ print(){
this.$refs['rpt'].isRptShow=true
this.$refs['rpt'].showPrint() this.$refs['rpt'].showPrint()
}, },
calcRptData(){ calcRptData(){
var row=this.xmTestPlan var row=this.xmTestPlan
@ -168,8 +170,7 @@ export default {
},//end methods },//end methods
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
initDicts(this)
initDicts(this)
}); });
} }
} }

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

@ -124,7 +124,7 @@ export default {
xmBranchMenuDayAccumulate:()=>import('./branch/menuDayAccumulate.vue'), xmBranchMenuDayAccumulate:()=>import('./branch/menuDayAccumulate.vue'),
}, },
props:['xmTestCasedb','xmTestPlan','xmProduct','xmProject','xmIteration','showToolBar','category','showParams','isRptCfg','printVisible'],
props:['xmTestCasedb','xmTestPlan','xmProduct','xmProject','xmIteration','showToolBar','category','showParams','isRptCfg','printVisible','isRptShow'],
computed: { computed: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
compIds(){ compIds(){
@ -165,6 +165,9 @@ export default {
return params; return params;
} }
return params; return params;
},
toLoadXmRptConfigCpd(){
return this.isRptCfg || this.isRptShow
} }
}, },
@ -176,18 +179,16 @@ export default {
}, },
deep:true, deep:true,
}, },
isRptCfg(){
if(this.isRptCfg==true){
this.$nextTick(()=>{
this.compCfgList.forEach(k=>{
this.sizeAutoChange(k);
})
toLoadXmRptConfigCpd(){
this.getXmRptConfig();
this.$nextTick(()=>{
this.compCfgList.forEach(k=>{
this.sizeAutoChange(k);
}) })
}
})
}, },
rptConfigParamsCpd(){ rptConfigParamsCpd(){
if(this.isRptCfg){
if(this.isRptCfg ||this.isRptShow){
this.getXmRptConfig() this.getXmRptConfig()
} }
} }
@ -226,11 +227,12 @@ export default {
initData(){ initData(){
this.getXmRptConfig(); this.getXmRptConfig();
}, },
getXmRptConfig(){
if(!this.isRptCfg){
getXmRptConfig(){
if(!this.toLoadXmRptConfigCpd){
return; return;
} }
listXmRptConfig(this.rptConfigParamsCpd).then(res=>{
var params={bizType:this.rptConfigParamsCpd.bizType,bizId:this.rptConfigParamsCpd.bizId}
listXmRptConfig(params).then(res=>{
this.xmRptConfig=res.data.data[0] this.xmRptConfig=res.data.data[0]
}) })
}, },

12
src/views/xm/rpt/index.vue

@ -1,10 +1,10 @@
<template> <template>
<section> <section>
<el-row v-if="rptConfigVisible">
<span style="float:right;"> <el-button @click="rptConfigVisible=false">取消配置</el-button><el-button @click="saveXmRptConfig" type="primary">保存配置</el-button></span>
<el-row v-if="isRptCfg">
<span style="float:right;"> <el-button @click="isRptCfg=false">取消配置</el-button><el-button @click="saveXmRptConfig" type="primary">保存配置</el-button></span>
</el-row> </el-row>
<el-row> <el-row>
<comps-card ref="compsCard" :category="category" :xm-test-plan="xmTestPlan" :xm-product="xmProduct" :xm-project="xmProject" :xm-iteration="xmIteration" :xm-test-casedb="xmTestCasedb" :show-params="true" :show-tool-bar="true" :is-rpt-cfg="rptConfigVisible"/>
<comps-card ref="compsCard" :category="category" :xm-test-plan="xmTestPlan" :xm-product="xmProduct" :xm-project="xmProject" :xm-iteration="xmIteration" :xm-test-casedb="xmTestCasedb" :show-params="true" :show-tool-bar="true" :is-rpt-cfg="isRptCfg" :is-rpt-show="isRptShow"/>
</el-row> </el-row>
</section> </section>
</template> </template>
@ -18,7 +18,7 @@ import { mapGetters } from 'vuex'
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
props:['xmProduct','xmIteration','xmProject','xmTestCasedb','xmTestPlan','category'],
props:['xmProduct','xmIteration','xmProject','xmTestCasedb','xmTestPlan','category','isRptShow'],
components: {compsSet, compsCard}, components: {compsSet, compsCard},
computed: { computed: {
...mapGetters([ ...mapGetters([
@ -31,14 +31,14 @@ export default {
data() { data() {
return { return {
rptConfigVisible:false,
isRptCfg:false,
} }
}, },
methods: { methods: {
saveXmRptConfig(){ saveXmRptConfig(){
var callback=()=>{ var callback=()=>{
this.rptConfigVisible=false;
this.isRptCfg=false;
} }
this.$refs['compsCard'].submitXmPrtConfig(callback) this.$refs['compsCard'].submitXmPrtConfig(callback)
}, },

Loading…
Cancel
Save