| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
-
- <el-container style="height:100%;">
- <el-header style="display:flex;align-items:center;" v-if="vShow">
- <p>水库名称</p>
- <el-input v-model="gateName" clearable style="width: 150px;margin-left:10px;margin-right:15px"></el-input>
- <p>水库类型</p>
- <el-select style="width: 150px;margin-left:10px;margin-right:15px" v-model="gateType" :placeholder="autoSort" clearable >
- <el-option v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- <el-button type="primary" icon="el-icon-search" style="margin-left:5px;" plain @click="searchExecl">查询</el-button>
- </el-header>
- <el-main id="dcjhMain">
- <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="loading">
- <iframe ref="myIframe" id="frameMainSz" src="" frameborder="0" width="100%" height="100%" style="overflow: auto"></iframe>
- </div>
- </el-main>
- </el-container>
- </template>
- <script>
- import request from '../../../utils/gw_ajax_request.js';
- import {dateFormat} from '../../../utils/gw_date.js';
- // 水闸类型 1:分(泄)洪闸;2:节制闸;3:排(退)水闸;4:引(进)水闸;5:挡潮闸;6:船闸;9:其他
- const options = [{
- value: '1',
- label: '分(泄)洪闸'
- }, {
- value: '2',
- label: '节制闸'
- },{
- value: '3',
- label: '排(退)水闸'
- },{
- value: '4',
- label: '引(进)水闸'
- },{
- value: '5',
- label: '挡潮闸'
- },{
- value: '6',
- label: '船闸'
- },{
- value: '9',
- label: '其他'
- }];
- export default {
- props: ['show','gateNameStr','gateTypeStr','pageStr','heightStr','widthStr','dxdcMainHeightStr','adCode'],
- components: {
-
- },
- data() {
- return {
- loading:false,
- // 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=',
- reportSrc:'/demo/reportJsp/showInput.jsp?sht=sz_baseInfo_line_jb.sht',
- excelName:'水闸基础信息表',
- dxdcMainHeight: window.innerHeight - 130,
- windowHeight:window.innerHeight - 130,
- windowWidth:window.innerWidth - 10,
- vShow:true,
- gateName:'',
- gateType:'',
- page:'',
- options:options,
- autoSort: '请选择',
- }
- },
-
- computed:{
- userId:function(){
- return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
- },
- },
- watch:{
- },
- mounted(){
- if(this.show != undefined){
- this.vShow = this.show;
- }
- if(this.gateNameStr != undefined){
- this.gateName = this.gateNameStr;
- }
- if(this.gateTypeStr != undefined){
- this.gateType = this.gateTypeStr;
- }
- if(this.pageStr != undefined){
- this.page = this.pageStr;
- }
- if(this.heightStr != undefined){
- this.windowHeight = this.heightStr;
- }
- if(this.widthStr != undefined){
- this.windowWidth = this.widthStr;
- }
- if(this.dxdcMainHeightStr != undefined){
- this.dxdcMainHeight = this.dxdcMainHeightStr;
- }
- this.searchExecl();
- },
- methods:{
- // 获取Excel数据
- searchExecl(){
- // this.loading = true;
- let _this = this;
- let iframe = document.getElementById("frameMainSz");
- let src = this.reportSrc;
- let _gateName = this.gateName == '' ? 'all' : this.gateName;
- let _geteType = this.gateType == '' ? 'all' : this.gateType;
- let _page = this.page;
- let _adCode = this.adCode;
-
- iframe.src= src
- + "&width=" + this.windowWidth
- + "&height=" + this.windowHeight
- + "&excelName=" + this.excelName
- + "&gateName=" + _gateName
- + "&gateType=" + _geteType
- + "&page=" + _page
- + "&adCode=" + _adCode
-
- if (iframe.attachEvent){
- iframe.attachEvent("onload", function(){
- _this.loading = false;
- });
- } else {
- iframe.onload = function(){
- _this.loading = false;
- };
- }
- },
- // 导出Excel数据
- exportExecl(){
- v = window.frames["frameMainSz"];
- v.contentWindow.report1_saveAsExcel();
- },
- },
- activated() {
- }
- }
- </script>
- <style>
- #dcjhMain {
- overflow: hidden;
- padding:0;
- }
- </style>
|