132e19736d2a6a1aa45df23aa3b069bef7c2748b.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <el-row>
  3. <el-col :span="24">
  4. <el-card :body-style="{'height':dxdcMainHeight + 'px','padding':'0'}">
  5. <form ref="formMain1" id="formMain1" target="frameMain1" :action="reportSrc" method="post">
  6. <input type="hidden" name="width" v-model="windowWidth">
  7. <input type="hidden" name="height" v-model="windowHeight">
  8. <input type="hidden" name="ids">
  9. <input type="hidden" name="host" v-model="hostUrl">
  10. <input type="hidden" name="excelName" v-model="excelName">
  11. <input type="hidden" id="sttm" name="sttm" v-model="sttm">
  12. <input type="hidden" id="ettm" name="ettm" v-model="ettm">
  13. <input type="hidden" name="state" v-model="dcType">
  14. </form>
  15. <div style="width: 100%;height: 100%;" v-loading="loading">
  16. <iframe ref="frameMain1" id="frameMain1" name="frameMain1" src="" frameborder="0" width="100%" height="100%"
  17. style="overflow: auto"></iframe>
  18. </div>
  19. </el-card>
  20. </el-col>
  21. </el-row>
  22. </template>
  23. <script>
  24. import {dateFormat, getFirstDayOfMonth} from '@util/gw_date.js';
  25. import {hostUrl} from "@util/global_variable";
  26. export default {
  27. props: ['ids', 'newYear', 'type'],
  28. data() {
  29. return {
  30. pid: '000',
  31. pidNodes: [],
  32. dxdcMainHeight: window.innerHeight - 200,
  33. dxdcAsideHeight: window.innerHeight - 180,
  34. windowHeight: window.innerHeight - 200,
  35. windowWidth: window.innerWidth - 350,
  36. reportSrc: '/demo/reportJsp/showReport.jsp?rpx=dc_wtgth_01.rpx',
  37. radioTable: 1,
  38. loading: true,
  39. leftCol: 4,
  40. rightCol: 20,
  41. excelName: '取水许可管理对象核实-水电站',
  42. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  43. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  44. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  45. treeWidth: 250,
  46. dcType: '0',
  47. }
  48. },
  49. computed: {
  50. userId: function () {
  51. return localStorage.getItem("userid")
  52. ? localStorage.getItem("userid")
  53. : "1098101939614724096";
  54. },
  55. hostUrl: function () {
  56. return hostUrl
  57. }
  58. },
  59. methods: {
  60. // 获取Excel数据
  61. searchExecl(id) {
  62. if (id !== undefined){
  63. $('input[name="ids"]').val(id);
  64. this.ids = id;
  65. } else {
  66. $('input[name="ids"]').val(this.ids);
  67. }
  68. this.loading = true;
  69. // 使用form表单post提交,彻底解决参数值过长的问题
  70. this.$refs.formMain1.submit();
  71. // 使用_this
  72. let _this = this;
  73. this.$refs.frameMain1.onload = function () {
  74. _this.loading = false;
  75. };
  76. },
  77. // 导出Excel数据
  78. exportExecl() {
  79. v = window.frames["frameMain1"];
  80. // v.contentWindow.report1_saveAsExcel();
  81. v.report1_saveAsExcel();
  82. },
  83. },
  84. watch: {
  85. findTime(n, o) {
  86. if (!n) {
  87. this.sttm = "";
  88. this.ettm = "";
  89. } else {
  90. this.sttm = n[0];
  91. this.ettm = n[1];
  92. }
  93. }
  94. },
  95. activated() {
  96. this.searchExecl();
  97. }
  98. }
  99. </script>
  100. <style scoped>
  101. </style>