|
@@ -0,0 +1,78 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <!-- 参数区域 -->
|
|
|
+ <portal-param-view ref="paramViewForm" :pms="pms"></portal-param-view>
|
|
|
+ <!-- 组件区域 -->
|
|
|
+ <layout-view ref="optarea" :pageInfo="pageInfo"></layout-view>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {ajax, loopChartJson} from '@/common/biConfig'
|
|
|
+ import $ from 'jquery'
|
|
|
+ import { Loading } from "element-ui";
|
|
|
+ import LayoutView from './LayoutView.vue'
|
|
|
+ import PortalParamView from './PortalParamView.vue'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ reportId:null,
|
|
|
+ pageInfo:{},
|
|
|
+ pms:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ LayoutView,
|
|
|
+ PortalParamView
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ window.document.title = "报表打印";
|
|
|
+ this.reportId = this.$route.query.id;
|
|
|
+ this.getCfg();
|
|
|
+ },
|
|
|
+ beforeDestroy(){
|
|
|
+
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+
|
|
|
+ getCfg(){
|
|
|
+ ajax({
|
|
|
+ url:"portal/get.action",
|
|
|
+ data:{pageId:this.reportId},
|
|
|
+ type:"get",
|
|
|
+ success:(resp)=>{
|
|
|
+ this.pageInfo = JSON.parse(resp.rows);
|
|
|
+ //初始化参数字段
|
|
|
+ this.$refs['paramViewForm'].initReportParam(this.pageInfo.params);
|
|
|
+ this.getReport();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getReport(){
|
|
|
+ let loadingInstance = Loading.service({fullscreen:false, target:document.querySelector('.wrapper-content-nomargin')});
|
|
|
+ ajax({
|
|
|
+ url:"portal/view.action",
|
|
|
+ type:"GET",
|
|
|
+ data:{pageId:this.reportId},
|
|
|
+ success:(resp)=>{
|
|
|
+ //渲染组件
|
|
|
+ this.$refs['optarea'].setCompData(resp.rows);
|
|
|
+ this.pms = resp.rows.pms;
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ window.print();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, this, loadingInstance);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+
|
|
|
+</style>
|