| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <template>
- <el-container style="height:100%;">
- <el-header style="display:flex;align-items:center;" v-if="vShow">
- </el-header>
- <el-main id="dcjhMain">
- <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="false">
- <iframe ref="myIframe" id="frameMainSlgc" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
- </div>
- </el-main>
- </el-container>
- </template>
- <script>
- import request from '../../../utils/gw_ajax_request.js';
- import {dateFormat} from '../../../utils/gw_date.js';
- export default {
- props: ['show','objId','regId','heightStr','widthStr','dxdcMainHeightStr'],
- components: {
- },
- data() {
- return {
- loading:true,
- reportSrc:'/demo/reportJsp/showInput.jsp?sht=sztb.sht', // @todo 此处换上问题填报的报表链接就行了
- excelName:'工程问题填报表',
- dxdcMainHeight: window.innerHeight - 120,
- windowHeight:window.innerHeight - 120,
- windowWidth:window.innerWidth - 10,
- vShow:true,
- }
- },
- computed:{
- userId:function(){
- return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
- },
- },
- watch:{
- },
- mounted(){
- if(this.show != undefined){
- this.vShow = this.show;
- }
- if(this.heightStr != undefined){
- this.windowHeight = this.heightStr;
- }
- if(this.widthStr != undefined){
- this.windowWidth = this.widthStr;
- }
- if(this.dxdcMainHeightStr != undefined){
- this.dxdcMainHeight = this.dxdcMainHeightStr;
- }
- this.searchExecl();
- },
- methods:{
- // 获取Excel数据
- searchExecl(){
- this.loading = true;
- let _this = this;
- let iframe = document.getElementById("frameMainSlgc");
- let src = this.reportSrc;
-
- iframe.src= src
- + "&width=" + this.windowWidth
- + "&height=" + this.windowHeight
- + "&excelName=" + this.excelName
- + "&objId=" + this.objId
- + "®Id=" + this.regId
- if (iframe.attachEvent){
- iframe.attachEvent("onload", function(){
- _this.loading = false;
- });
- } else {
- iframe.onload = function(){
- _this.loading = false;
- };
- }
- },
- // 导出Excel数据
- exportExecl(){
- v = window.frames["frameMainSlgc"];
- v.contentWindow.report1_saveAsExcel();
- },
- },
- activated() {
- }
- }
- </script>
- <style>
- #dcjhMain {
- /* overflow: hidden; */
- padding:0;
- }
- </style>
|