Browse Source

打印

master
陈裕财 3 years ago
parent
commit
f537053876
  1. 5
      src/views/xm/core/xmTestPlan/XmTestPlanInfo.vue
  2. 13
      src/views/xm/core/xmTestPlan/rpt/CompsCard.vue
  3. 3
      src/views/xm/core/xmTestPlan/rpt/index.vue

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

@ -26,6 +26,8 @@
</span> </span>
<span v-if="subPage=='testRpt'"> <span v-if="subPage=='testRpt'">
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-button @click="print">打印</el-button>
<el-button @click="showRptConfig" icon="el-icon-s-tools">配置报告</el-button> <el-button @click="showRptConfig" icon="el-icon-s-tools">配置报告</el-button>
</span> </span>
</span> </span>
@ -138,6 +140,9 @@ export default {
}, },
showRptConfig(){ showRptConfig(){
this.$refs['rpt'].rptConfigVisible=true this.$refs['rpt'].rptConfigVisible=true
},
print(){
this.$refs['rpt'].showPrint()
} }
},//end methods },//end methods

13
src/views/xm/core/xmTestPlan/rpt/CompsCard.vue

@ -1,6 +1,6 @@
<template> <template>
<section> <section>
<el-row class="page-center border">
<el-row class="page-center border" v-if="printVisible==false">
<el-col :span="6" :style="{height:maxTableHeight+'px',overflow:'auto'}"> <el-col :span="6" :style="{height:maxTableHeight+'px',overflow:'auto'}">
<comps-set v-if="rptConfigVisible" :comp-ids="compIds" @row-click="onCompSelect"></comps-set> <comps-set v-if="rptConfigVisible" :comp-ids="compIds" @row-click="onCompSelect"></comps-set>
</el-col> </el-col>
@ -36,6 +36,16 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="printVisible" class="page-center border" style="width:1000px;">
<el-row>
<span style="float:right;"><el-button @click="printVisible=false">取消打印</el-button> <el-button v-print="'#printBody'">打印</el-button></span>
</el-row>
<el-row id="printBody">
<el-row v-for="(item,index) in compCfgList" :key="index">
<component :is="item.compId" :xm-test-plan="xmTestPlan" :comp-cfg="item" :ref="item.id" @delete="doDelete"></component>
</el-row>
</el-row>
</el-row>
</section> </section>
</template> </template>
@ -124,6 +134,7 @@ export default {
], ],
// //
layoutColNum: 12, layoutColNum: 12,
printVisible:false,
} }
}, },

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

@ -41,6 +41,9 @@ export default {
this.rptConfigVisible=false; this.rptConfigVisible=false;
} }
this.$refs['compsCard'].submitXmPrtConfig(callback) this.$refs['compsCard'].submitXmPrtConfig(callback)
},
showPrint(){
this.$refs.compsCard.printVisible=true;
} }
}, },

Loading…
Cancel
Save