Browse Source

优化

master
陈裕财 3 years ago
parent
commit
4c18b8b1b6
  1. 52
      src/views/xm/rpt/CompsCard.vue
  2. 3
      src/views/xm/rpt/index.vue
  3. 5
      src/views/xm/rpt/product/menuAgeDist.vue

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

@ -7,7 +7,13 @@
<el-col :span="18">
<el-row class="padding">
<span style="float:right;">
<el-button type="text" @click="cancelExport" icon="el-icon-close"></el-button>
<el-button type="primary" v-if="isRptShow==false && isRptCfg==false" @click="isRptShow=true">查看报告</el-button>
<el-button type="warning" v-if="isRptShow==true" @click="undoRptShow">退出报告</el-button>
<el-button type="primary" v-if="isRptCfg==false&&isRptShow==false" @click="toRptCfg">制作报告</el-button>
<el-button type="primary" v-if="isRptCfg==true" @click="undoRptCfg">取消制作</el-button>
<el-button type="warning" v-if="isRptCfg==true" @click="finishRptCfg">保存报告</el-button>
<el-button type="text" v-if="paramsVisible==true" @click="paramsVisible=false">隐藏过滤条件</el-button>
<el-button type="text" v-if="paramsVisible==false" @click="paramsVisible=true">显示过滤条件</el-button>
<el-button type="text" v-print="{id:'printBody',popTitle:rptConfigParamsCpd.name+'-报告'}" icon="el-icon-printer"></el-button>
<el-button type="text" @click="exportToPdf">pdf</el-button>
</span>
@ -104,7 +110,7 @@ export default {
xmBranchMenuDayAccumulate:()=>import('./branch/menuDayAccumulate.vue'),
},
props:['xmTestCasedb','xmTestPlan','xmProduct','xmProject','xmIteration','showToolBar','category','showParams','isRptCfg','isRptShow'],
props:['xmTestCasedb','xmTestPlan','xmProduct','xmProject','xmIteration','showToolBar','category','showParams'],
computed: {
...mapGetters(['userInfo']),
compIds(){
@ -176,6 +182,8 @@ export default {
data() {
return {
isRptCfg:false,
isRptShow:false,
xmRptConfig:null,
compCfgList:[],
maxTableHeight:300,
@ -196,6 +204,32 @@ export default {
}
},
undoRptCfg(){
this.xmRptConfig=null;
this.isRptCfg=false;
},
undoRptShow(){
this.isRptShow=false;
this.xmRptConfig=null;
},
toRptCfg(){
this.isRptCfg=true;
this.$message.success("切换到报告制作模式成功。请选择报表加入报告中。")
},
finishRptCfg(){
this.submitXmPrtConfig((res)=>{
var tips = res.data.tips;
if(tips.isOk){
this.isRptCfg=false
this.xmRptConfig=null;
this.$message.success("报告保存成功。将退出报告制作模式")
}else{
this.$message.error(tips.msg)
}
});
},
getXmRptConfig(){
if(!this.toLoadXmRptConfigCpd){
return;
@ -270,7 +304,7 @@ export default {
xmRptConfig.cfg=JSON.stringify(compCfgList)
addXmRptConfig(xmRptConfig).then(res=>{
this.xmRptConfig=xmRptConfig;
callback()
callback(res)
})
}else{
var xmRptConfig={...this.xmRptConfig,cfg:[]}
@ -291,7 +325,7 @@ export default {
xmRptConfig.cfg=JSON.stringify(compCfgList)
editXmRptConfig(xmRptConfig).then(res=>{
this.xmRptConfig=xmRptConfig;
callback()
callback(res)
})
}
},
@ -302,11 +336,7 @@ export default {
}
},
sizeAutoChange(k){
if(this.$refs[k.id] && this.$refs[k.id][0].$refs && this.$refs[k.id][0].$refs[k.id]){
this.$refs[k.id][0].$refs[k.id].sizeAutoChange();
}else{
this.$refs[k.id][0].sizeAutoChange();
}
},
exportToPdf(){
@ -316,10 +346,6 @@ export default {
})
},
cancelExport(){
this.exportToolBarVisible=false
this.paramsVisible=this.showParams
}
},

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

@ -1,8 +1,5 @@
<template>
<section>
<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>
<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=" isRptCfg || !isRptShow" :is-rpt-cfg="isRptCfg" :is-rpt-show="isRptShow"/>
</el-row>

5
src/views/xm/rpt/product/menuAgeDist.vue

@ -18,11 +18,6 @@
<el-form :model="params" class="padding" :style="{width:'100%',overflow: 'auto'}" ref="filtersRef">
<el-row>
<el-col :span="15">
<el-form-item label="分组属性">
<el-select style="width:100px;" size="small" v-model="params.groupBy" @change="onXmMenuSomeFieldsChange('groupBy',$event)">
<el-option v-for="i in this.groupBys" :label="i.name" :key="i.id" :value="i.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="归属产品" >
<xm-product-select v-if="!xmProductCpd || !xmProductCpd.id" ref="xmProductSelect" style="display:inline;" :auto-select="false" :link-project-id="xmProject?xmProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProductClear"></xm-product-select>
<span v-else>{{xmProductCpd.id}} <span v-if="xmProductCpd.productName"><br/>{{ xmProductCpd.productName }} </span> </span>

Loading…
Cancel
Save