ffeb0b07c627f0b80cbe10326d42ab80c049fd0e.svn-base 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <el-container style="height:100%;">
  3. <el-header style="display:flex;align-items:center;" v-if="vShow">
  4. </el-header>
  5. <el-main id="dcjhMain">
  6. <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="false">
  7. <iframe ref="myIframe" id="frameMainSlgc" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  8. </div>
  9. </el-main>
  10. </el-container>
  11. </template>
  12. <script>
  13. import request from '../../../utils/gw_ajax_request.js';
  14. import {dateFormat} from '../../../utils/gw_date.js';
  15. export default {
  16. props: ['show','objId','regId','heightStr','widthStr','dxdcMainHeightStr'],
  17. components: {
  18. },
  19. data() {
  20. return {
  21. loading:true,
  22. reportSrc:'/demo/reportJsp/showInput.jsp?sht=sztb.sht', // @todo 此处换上问题填报的报表链接就行了
  23. excelName:'工程问题填报表',
  24. dxdcMainHeight: window.innerHeight - 120,
  25. windowHeight:window.innerHeight - 120,
  26. windowWidth:window.innerWidth - 10,
  27. vShow:true,
  28. }
  29. },
  30. computed:{
  31. userId:function(){
  32. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  33. },
  34. },
  35. watch:{
  36. },
  37. mounted(){
  38. if(this.show != undefined){
  39. this.vShow = this.show;
  40. }
  41. if(this.heightStr != undefined){
  42. this.windowHeight = this.heightStr;
  43. }
  44. if(this.widthStr != undefined){
  45. this.windowWidth = this.widthStr;
  46. }
  47. if(this.dxdcMainHeightStr != undefined){
  48. this.dxdcMainHeight = this.dxdcMainHeightStr;
  49. }
  50. this.searchExecl();
  51. },
  52. methods:{
  53. // 获取Excel数据
  54. searchExecl(){
  55. this.loading = true;
  56. let _this = this;
  57. let iframe = document.getElementById("frameMainSlgc");
  58. let src = this.reportSrc;
  59. iframe.src= src
  60. + "&width=" + this.windowWidth
  61. + "&height=" + this.windowHeight
  62. + "&excelName=" + this.excelName
  63. + "&objId=" + this.objId
  64. + "&regId=" + this.regId
  65. if (iframe.attachEvent){
  66. iframe.attachEvent("onload", function(){
  67. _this.loading = false;
  68. });
  69. } else {
  70. iframe.onload = function(){
  71. _this.loading = false;
  72. };
  73. }
  74. },
  75. // 导出Excel数据
  76. exportExecl(){
  77. v = window.frames["frameMainSlgc"];
  78. v.contentWindow.report1_saveAsExcel();
  79. },
  80. },
  81. activated() {
  82. }
  83. }
  84. </script>
  85. <style>
  86. #dcjhMain {
  87. /* overflow: hidden; */
  88. padding:0;
  89. }
  90. </style>