| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <template>
-
- <el-container style="height:100%;">
- <el-header style="display:flex;align-items:center;" v-if="vShow">
- <p>水库名称</p>
- <el-input v-model="rsName" 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="rsType" :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>
- <!-- <span style="margin-left:15px;">(<b style="color:red;">注意:Excel文件导入操作会覆盖本页所有数据,请谨慎操作。</b>)</span> -->
- </el-header>
- <el-main id="dcjhMain">
- <div :style="{'height':dxdcMainHeight + 'px','padding':'0','width':'100%','overflow':'hidden'}" v-loading="loading">
- <iframe ref="myIframe" id="frameMainSk" 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'
- // 造数据
- const options = [{
- value: "'1'",
- label: '山丘水库'
- }, {
- value: "'2'",
- label: '平原水库'
- },{
- value: "'3'",
- label: '地下水库'
- }];
- export default {
- props: ['show','rsNameStr','rsTypeStr','pageStr','heightStr','widthStr','dxdcMainHeightStr','admDiv'],
- components: {
-
- },
- data() {
- return {
- loading:false,
- // 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=',
- reportSrc:'/demo/reportJsp/showInput.jsp?sht=xsk_baseInfo_line_jb.sht',
- excelName:'水库基础信息表',
- dxdcMainHeight: window.innerHeight - 130,
- windowHeight:window.innerHeight - 130,
- windowWidth:window.innerWidth - 10,
- vShow:true,
- rsName: '',
- rsType: '',
- 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.rsNameStr != undefined){
- this.rsName = this.rsNameStr;
- }
- if(this.rsTypeStr != undefined){
- this.rsType = this.rsTypeStr;
- }
- 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("frameMainSk");
- let src = this.reportSrc;
- let _rsName = this.rsName == '' ? 'all' : this.rsName;
- let _rsType = this.rsType == '' ? 'all' : this.rsType;
- let _page = this.page;
- let _admDiv = this.admDiv;
- iframe.src= src
- + "&width=" + this.windowWidth
- + "&height=" + this.windowHeight
- + "&excelName=" + this.excelName
- + "&rsName=" + _rsName
- + "&rsType=" + _rsType
- + "&page=" + _page
- + "&admDiv=" + _admDiv
-
- if (iframe.attachEvent){
- iframe.attachEvent("onload", function(){
- _this.loading = false;
- });
- } else {
- iframe.onload = function(){
- _this.loading = false;
- };
- }
- },
- // 导出Excel数据
- exportExecl(){
- v = window.frames["frameMainSk"];
- v.contentWindow.report1_saveAsExcel();
- },
- },
- activated() {
- }
- }
- </script>
- <style>
- #dcjhMain {
- overflow: hidden;
- padding:0;
- }
- </style>
|