7726073196733d9039ddecfa9752d32e4fed9fb7.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <el-container style="height:100%;">
  3. <el-header style="display:flex;align-items:center;" v-if="vShow">
  4. <p>水库名称</p>
  5. <el-input v-model="gateName" clearable style="width: 150px;margin-left:10px;margin-right:15px"></el-input>
  6. <p>水库类型</p>
  7. <el-select style="width: 150px;margin-left:10px;margin-right:15px" v-model="gateType" :placeholder="autoSort" clearable >
  8. <el-option v-for="item in options"
  9. :key="item.value"
  10. :label="item.label"
  11. :value="item.value"
  12. >
  13. </el-option>
  14. </el-select>
  15. <el-button type="primary" icon="el-icon-search" style="margin-left:5px;" plain @click="searchExecl">查询</el-button>
  16. </el-header>
  17. <el-main id="dcjhMain">
  18. <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="loading">
  19. <iframe ref="myIframe" id="frameMainSz" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  20. </div>
  21. </el-main>
  22. </el-container>
  23. </template>
  24. <script>
  25. import request from '../../../utils/gw_ajax_request.js';
  26. import {dateFormat} from '../../../utils/gw_date.js';
  27. // 水闸类型 1:分(泄)洪闸;2:节制闸;3:排(退)水闸;4:引(进)水闸;5:挡潮闸;6:船闸;9:其他
  28. const options = [{
  29. value: '1',
  30. label: '分(泄)洪闸'
  31. }, {
  32. value: '2',
  33. label: '节制闸'
  34. },{
  35. value: '3',
  36. label: '排(退)水闸'
  37. },{
  38. value: '4',
  39. label: '引(进)水闸'
  40. },{
  41. value: '5',
  42. label: '挡潮闸'
  43. },{
  44. value: '6',
  45. label: '船闸'
  46. },{
  47. value: '9',
  48. label: '其他'
  49. }];
  50. export default {
  51. props: ['show','gateNameStr','gateTypeStr','pageStr','heightStr','widthStr','dxdcMainHeightStr','adCode'],
  52. components: {
  53. },
  54. data() {
  55. return {
  56. loading:false,
  57. // reportSrc:'/TbReport/previewInput.jsp?sht=%2Fsz_baseInfo_line_jb.sht&rpxHome=D%3A%2F1%2Freport%2F%E5%A1%AB%E6%8A%A5%E8%A1%A8%2F%E8%A1%8C%E5%BC%8F%E5%A1%AB%E6%8A%A5%E8%A1%A8%2Fsz&dfxHome=',
  58. reportSrc:'/demo/reportJsp/showInput.jsp?sht=sz_baseInfo_line_jb.sht',
  59. excelName:'水闸基础信息表',
  60. dxdcMainHeight: window.innerHeight - 130,
  61. windowHeight:window.innerHeight - 130,
  62. windowWidth:window.innerWidth - 10,
  63. vShow:true,
  64. gateName:'',
  65. gateType:'',
  66. page:'',
  67. options:options,
  68. autoSort: '请选择',
  69. }
  70. },
  71. computed:{
  72. userId:function(){
  73. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  74. },
  75. },
  76. watch:{
  77. },
  78. mounted(){
  79. if(this.show != undefined){
  80. this.vShow = this.show;
  81. }
  82. if(this.gateNameStr != undefined){
  83. this.gateName = this.gateNameStr;
  84. }
  85. if(this.gateTypeStr != undefined){
  86. this.gateType = this.gateTypeStr;
  87. }
  88. if(this.pageStr != undefined){
  89. this.page = this.pageStr;
  90. }
  91. if(this.heightStr != undefined){
  92. this.windowHeight = this.heightStr;
  93. }
  94. if(this.widthStr != undefined){
  95. this.windowWidth = this.widthStr;
  96. }
  97. if(this.dxdcMainHeightStr != undefined){
  98. this.dxdcMainHeight = this.dxdcMainHeightStr;
  99. }
  100. this.searchExecl();
  101. },
  102. methods:{
  103. // 获取Excel数据
  104. searchExecl(){
  105. // this.loading = true;
  106. let _this = this;
  107. let iframe = document.getElementById("frameMainSz");
  108. let src = this.reportSrc;
  109. let _gateName = this.gateName == '' ? 'all' : this.gateName;
  110. let _geteType = this.gateType == '' ? 'all' : this.gateType;
  111. let _page = this.page;
  112. let _adCode = this.adCode;
  113. iframe.src= src
  114. + "&width=" + this.windowWidth
  115. + "&height=" + this.windowHeight
  116. + "&excelName=" + this.excelName
  117. + "&gateName=" + _gateName
  118. + "&gateType=" + _geteType
  119. + "&page=" + _page
  120. + "&adCode=" + _adCode
  121. if (iframe.attachEvent){
  122. iframe.attachEvent("onload", function(){
  123. _this.loading = false;
  124. });
  125. } else {
  126. iframe.onload = function(){
  127. _this.loading = false;
  128. };
  129. }
  130. },
  131. // 导出Excel数据
  132. exportExecl(){
  133. v = window.frames["frameMainSz"];
  134. v.contentWindow.report1_saveAsExcel();
  135. },
  136. },
  137. activated() {
  138. }
  139. }
  140. </script>
  141. <style>
  142. #dcjhMain {
  143. overflow: hidden;
  144. padding:0;
  145. }
  146. </style>