de7de6357f242bca43d807d49b305cb225e9543f.svn-base 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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="rsName" 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="rsType" :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. <!-- <span style="margin-left:15px;">(<b style="color:red;">注意:Excel文件导入操作会覆盖本页所有数据,请谨慎操作。</b>)</span> -->
  17. </el-header>
  18. <el-main id="dcjhMain">
  19. <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="loading">
  20. <iframe ref="myIframe" id="frameMainSk" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
  21. </div>
  22. </el-main>
  23. </el-container>
  24. </template>
  25. <script>
  26. import request from '../../../utils/gw_ajax_request.js';
  27. import {dateFormat} from '../../../utils/gw_date.js'
  28. // 造数据
  29. const options = [{
  30. value: "'1'",
  31. label: '山丘水库'
  32. }, {
  33. value: "'2'",
  34. label: '平原水库'
  35. },{
  36. value: "'3'",
  37. label: '地下水库'
  38. }];
  39. export default {
  40. props: ['show','rsNameStr','rsTypeStr','pageStr','heightStr','widthStr','dxdcMainHeightStr','admDiv'],
  41. components: {
  42. },
  43. data() {
  44. return {
  45. loading:false,
  46. // reportSrc:'/TbReport/previewInput.jsp?sht=%2Fxsk_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%2Fxsk&dfxHome=',
  47. reportSrc:'/demo/reportJsp/showInput.jsp?sht=xsk_baseInfo_line_jb.sht',
  48. excelName:'水库基础信息表',
  49. dxdcMainHeight: window.innerHeight - 130,
  50. windowHeight:window.innerHeight - 130,
  51. windowWidth:window.innerWidth - 10,
  52. vShow:true,
  53. rsName: '',
  54. rsType: '',
  55. page: '',
  56. options: options,
  57. autoSort: '请选择',
  58. }
  59. },
  60. computed:{
  61. userId:function(){
  62. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  63. },
  64. },
  65. watch:{
  66. },
  67. mounted(){
  68. if(this.show != undefined){
  69. this.vShow = this.show;
  70. }
  71. if(this.rsNameStr != undefined){
  72. this.rsName = this.rsNameStr;
  73. }
  74. if(this.rsTypeStr != undefined){
  75. this.rsType = this.rsTypeStr;
  76. }
  77. if(this.pageStr != undefined){
  78. this.page = this.pageStr;
  79. }
  80. if(this.heightStr != undefined){
  81. this.windowHeight = this.heightStr;
  82. }
  83. if(this.widthStr != undefined){
  84. this.windowWidth = this.widthStr;
  85. }
  86. if(this.dxdcMainHeightStr != undefined){
  87. this.dxdcMainHeight = this.dxdcMainHeightStr;
  88. }
  89. this.searchExecl();
  90. },
  91. methods:{
  92. // 获取Excel数据
  93. searchExecl(){
  94. // this.loading = true;
  95. let _this = this;
  96. let iframe = document.getElementById("frameMainSk");
  97. let src = this.reportSrc;
  98. let _rsName = this.rsName == '' ? 'all' : this.rsName;
  99. let _rsType = this.rsType == '' ? 'all' : this.rsType;
  100. let _page = this.page;
  101. let _admDiv = this.admDiv;
  102. iframe.src= src
  103. + "&width=" + this.windowWidth
  104. + "&height=" + this.windowHeight
  105. + "&excelName=" + this.excelName
  106. + "&rsName=" + _rsName
  107. + "&rsType=" + _rsType
  108. + "&page=" + _page
  109. + "&admDiv=" + _admDiv
  110. if (iframe.attachEvent){
  111. iframe.attachEvent("onload", function(){
  112. _this.loading = false;
  113. });
  114. } else {
  115. iframe.onload = function(){
  116. _this.loading = false;
  117. };
  118. }
  119. },
  120. // 导出Excel数据
  121. exportExecl(){
  122. v = window.frames["frameMainSk"];
  123. v.contentWindow.report1_saveAsExcel();
  124. },
  125. },
  126. activated() {
  127. }
  128. }
  129. </script>
  130. <style>
  131. #dcjhMain {
  132. overflow: hidden;
  133. padding:0;
  134. }
  135. </style>