2f508b41f0325eae8b4e8560d5cab71f9b966954.svn-base 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.js';
  26. import request from "@util/gw_ajax_request";
  27. export default {
  28. props: ['ids', 'newYear', 'type'],
  29. data() {
  30. return {
  31. pid: '000',
  32. pidNodes: [],
  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_wrws_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. mounted(){
  51. },
  52. computed: {
  53. userId: function () {
  54. return localStorage.getItem("userid")
  55. ? localStorage.getItem("userid")
  56. : "1098101939614724096";
  57. },
  58. hostUrl: function () {
  59. return hostUrl
  60. }
  61. },
  62. methods: {
  63. // 获取Excel数据
  64. searchExecl(id) {
  65. if (id !== undefined){
  66. $('input[name="ids"]').val(id);
  67. this.ids = id;
  68. } else {
  69. $('input[name="ids"]').val(this.ids);
  70. }
  71. this.loading = true;
  72. // 使用form表单post提交,彻底解决参数值过长的问题
  73. this.$refs.formMain1.submit();
  74. // 使用_this
  75. let _this = this;
  76. this.$refs.frameMain1.onload = function () {
  77. _this.loading = false;
  78. };
  79. },
  80. // 导出Excel数据
  81. exportExecl() {
  82. v = window.frames["frameMain1"];
  83. // v.contentWindow.report1_saveAsExcel();
  84. v.report1_saveAsExcel();
  85. },
  86. },
  87. watch: {
  88. findTime(n, o) {
  89. if (!n) {
  90. this.sttm = "";
  91. this.ettm = "";
  92. } else {
  93. this.sttm = n[0];
  94. this.ettm = n[1];
  95. }
  96. }
  97. },
  98. activated() {
  99. this.searchExecl();
  100. }
  101. }
  102. </script>
  103. <style scoped>
  104. </style>