4ad23bea75e50e7e522c1c2a77695d03a9e23c25.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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'],
  28. data() {
  29. return {
  30. pid: '000',
  31. pidNodes: [],
  32. type: '055',
  33. dxdcMainHeight: window.innerHeight - 200,
  34. dxdcAsideHeight: window.innerHeight - 180,
  35. windowHeight: window.innerHeight - 200,
  36. windowWidth: window.innerWidth - 350,
  37. reportSrc: '/demo/reportJsp/showReport.jsp?rpx=dc_wtgt_02.rpx',
  38. radioTable: 1,
  39. loading: true,
  40. leftCol: 4,
  41. rightCol: 20,
  42. excelName: '取水许可管理对象核实-河道外',
  43. findTime: [getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'), dateFormat(new Date(), 'yyyy-MM-dd')],
  44. sttm: getFirstDayOfMonth(new Date(), 'yyyy-MM-dd'),
  45. ettm: dateFormat(new Date(), 'yyyy-MM-dd'),
  46. treeWidth: 250,
  47. dcType: '0',
  48. }
  49. },
  50. computed: {
  51. userId: function () {
  52. return localStorage.getItem("userid")
  53. ? localStorage.getItem("userid")
  54. : "1098101939614724096";
  55. },
  56. hostUrl: function () {
  57. return hostUrl
  58. }
  59. },
  60. methods: {
  61. // 获取Excel数据
  62. searchExecl(id) {
  63. if (id !== undefined){
  64. $('input[name="ids"]').val(id);
  65. this.ids = id;
  66. } else {
  67. $('input[name="ids"]').val(this.ids);
  68. }
  69. this.loading = true;
  70. // 使用form表单post提交,彻底解决参数值过长的问题
  71. this.$refs.formMain1.submit();
  72. // 使用_this
  73. let _this = this;
  74. this.$refs.frameMain1.onload = function () {
  75. _this.loading = false;
  76. };
  77. },
  78. // 导出Excel数据
  79. exportExecl() {
  80. v = window.frames["frameMain1"];
  81. // v.contentWindow.report1_saveAsExcel();
  82. v.report1_saveAsExcel();
  83. },
  84. },
  85. watch: {
  86. findTime(n, o) {
  87. if (!n) {
  88. this.sttm = "";
  89. this.ettm = "";
  90. } else {
  91. this.sttm = n[0];
  92. this.ettm = n[1];
  93. }
  94. }
  95. },
  96. activated() {
  97. this.searchExecl();
  98. }
  99. }
  100. </script>
  101. <style scoped>
  102. </style>