| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <template>
- <div id="skMain" v-loading='exportLoading'>
- <el-row style="margin-bottom:5px;">
- <el-col :span="24">
- <div class="grid-content bg-purple-light">
- <div style="padding:15px 5px 5px 5px;">
- <span style="font-size: 12px;margin-left: 10px;">名称:</span>
- <el-input style="width:150px;" class="kjr-input" size="mini" v-model="model_ydb_name"
- placeholder="请输入名称查询" @keydown.enter.native="searchByName" clearable>
- </el-input>
-
- <el-button @click="searchByName" size="mini" type="primary">查询</el-button>
- <el-button @click="exPort" size="mini" type="success">导出</el-button>
- </div>
- <div style="padding:5px;">
- <el-col :span="5">
- <div style="height: 500px;overflow: auto">
- <provTreeList :rootCode="rootCode" :rootType="rootType"
- @provTreeSelectChange="provTreeSelectChangeHandler"
- >
- </provTreeList>
- </div>
- </el-col>
- <el-col :span="19">
- <el-table :data="tableData_ydbList" v-loading="loading" height="500" border stripe style="width: 100%">
- <el-table-column type="index" width="50" label="序号" align="center" :index="indexMethod_country">
- </el-table-column>
- <el-table-column prop="nm" label="工程名称" min-width="130" align="center" show-overflow-tooltip></el-table-column>
- <el-table-column prop="code" label="工程编码" min-width="100" align="center"></el-table-column>
- <el-table-column prop="type" label="工程类型" min-width="100" align="center"></el-table-column>
- <el-table-column prop="locat" label="工程位置" min-width="150" align="center" show-overflow-tooltip>
- </el-table-column>
- <el-table-column fixed="right" label="操作" min-width="200" align="center">
- <template slot-scope="scope">
- <el-button type="text" size="small" @click="ydbInfo(scope.row,'location')">定位</el-button>
- <el-button type="text" size="small" @click="ydbInfo(scope.row,'baseInfo')">基础信息</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div class="block">
- <el-pagination background @size-change="handleSizeChange_ydb"
- @current-change="handleCurrentChange_ydb" :page-sizes="[10,50, 100, 200]"
- :page-size="15" layout="total,sizes, prev, pager, next" :pager-count="5"
- :total="recordTotal_ydb">
- </el-pagination>
- </div>
- </el-col>
- </div>
- </div>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import provTreeList from '../../../widgets/provTreeListAndChina'
- import request from '../../../utils/gw_ajax_request.js';
- import {exportModel} from "@util/gw_exportModel";
- import {getBasePage} from '../../../api/zhxxAPI.js'
- export default {
- name: "resevoirList",
- components:{
- provTreeList
- },
- props:["dcztDisabled","currentAdCode"],
- data() {
- return {
- rootCode:'000000',
- rootType:'2',
- model_ydb_name:'',
- dczt:'',
- tableData_ydbList:[],
- recordTotal_ydb:0,
- pageSize_ydb: 10,
- pageIndex_ydb: 1,
- loading: false,
- isDczt:false,
- adCode:'',
- exportLoading:false,
- }
- },
- computed: {
- recPersId() {
- return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
- }
- },
- mounted(){
- let _this = this;
-
- _this.loadTableYdb();
- },
- methods:{
- indexMethod_country(index) {
- return (index + 1) + this.pageSize_ydb * (this.pageIndex_ydb - 1)
- },
- provTreeSelectChangeHandler(params) {
- this.adCode = params.code;
- if(this.adCode == "000000000000"){
- this.adCode = '';
- }
- this.$nextTick(()=>{
- this.pageSize_ydb = 10;
- this.pageIndex_ydb = 1;
- this.loadTableYdb();
- })
- },
- searchByName() {
- this.loadTableYdb();
- },
- async exPort(){
- // let _self = this;
- // this.exportLoading = true;
- // let data = {};
- // data.name = _self.model_ydb_name;
- // data.adCode = _self.adCode;
- // data.objType = '11';
- // data.pageNum = _self.pageIndex_ydb;
- // data.pageSize = _self.pageSize_ydb;
- // data.isExport = '1';
- // let datas = JSON.stringify(data);
- // let url = `/pdcApi/dc/general/info/getBasePage`;
- // let downloadName = "全部淤地坝.xls";
- // let type = "post";
- // let result = await exportModel(type,url,downloadName,datas);
- // this.exportLoading = result;
- this.exportLoading = true;
- let url = '/pdcApi/dc/general/info/getBasePage?objType=11&adCode='+this.adCode+'&pageNum='+this.pageIndex_ydb+'&pageSize='+this.pageSize_ydb+'&name='+this.model_ydb_name+'&isExport=1';
- let downloadName = "全部淤地坝.xls";
- let type = "get";
- let result = await exportModel(type,url,downloadName);
- this.exportLoading = result;
- },
- loadTableYdb() {
- let _this = this;
- _this.loading = true;
- getBasePage('11',_this.adCode,_this.pageIndex_ydb,_this.pageSize_ydb,_this.model_ydb_name).then((res)=>{
- if (res.success) {
- _this.$nextTick()
- _this.loading = false;
- var obj = res.data;
- _this.tableData_ydbList = obj.list;
- _this.recordTotal_ydb = obj.total;
- }
- })
- },
- handleSizeChange_ydb (pageSize) {
- this.pageSize_ydb = pageSize;
- this.loadTableYdb();
- },
- handleCurrentChange_ydb (pageNum) {
- this.pageIndex_ydb = pageNum;
- this.loadTableYdb();
- },
- bShuikuStatistic(){
- },
- ydbInfo(row,info){
- this.$emit('allYdbInfo',row,info);
- },
- formatGateType:function(row, column){
- return row.type == "1" ? '水库'
- : row.type == "2" ? '湖泊'
- : row.type == "3" ? '河流'
- :row.type == "9" ? '其他':'';
- },
- },
- watch:{
-
- currentAdCode(n,o){
- this.adCode = n;
- this.loadTableYdb();
- }
- }
- }
- </script>
- <style>
- #skMain .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
- background-color: #558ed0;
- }
- </style>
|