| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- <template>
- <el-row>
- <el-col :span="3">
- <provTreeList :rootCode="rootCode" :rootType="rootType"
- @provTreeSelectChange="provTreeSelectChangeHandler"
- :style="{'height': dxdcAsideHeight + 'px'}"
- >
- </provTreeList>
- </el-col>
- <el-col :span="21">
- <el-card class="ducha_form" :body-style="{'padding':'20px 5px'}">
- <el-form :inline="true" :model="formInline" class="sh-form-inline">
- <el-form-item label="行政区" style="margin-left: 5px">
- <el-input v-model="formInline.adName" placeholder="请输入区划编码或名称" clearable></el-input>
- </el-form-item>
- <!--<el-form-item label="行政区划名称">-->
- <!--<el-input v-model="formInline.adName" :placeholder="autoInput" clearable></el-input>-->
- <!--</el-form-item>-->
- <el-form-item label="级别">
- <el-select v-model="formInline.adGrad" placeholder="省、市、县、乡镇、村" multiple collapse-tags clearable
- >
- <el-option v-for="item in adGradOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="是否贫困">
- <el-select v-model="formInline.isPoveryt" placeholder="请选择" clearable>
- <el-option v-for="item in isPoverytOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item style="margin: 0 5px">
- <el-button type="primary" @click="onSearch" icon="el-icon-search">查询</el-button>
- </el-form-item>
- <el-form-item style="margin: 0">
- <el-button type="info" plain @click="empty" icon="el-icon-refresh">重置</el-button>
- </el-form-item>
- <el-form-item style="margin: 0 5px">
- <el-button type="success" @click="exportExcel" icon="el-icon-sort-up">导出Excel</el-button>
- </el-form-item>
- </el-form>
- </el-card>
- <el-card class="ducha_table" :body-style="{ 'padding': '0 5px' }">
- <el-main style="margin: 0 -5px;padding: 0">
- <el-table :data="tableList" style="width: 100%;"
- ref="singleTable"
- v-loading="tableLoading"
- border
- :height="dxdcMainHeight+'px'"
- :render-header="renderHeader"
- tooltip-effect="dark"
- >
- <el-table-column type="index" min-width="100" :index="getIndex" label="序号" show-overflow-tooltip></el-table-column>
- <!--<el-table-column min-width="80" label="数据来源" prop="src" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="备注" prop="remark" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="lgtd" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="lttd" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="lgtdpc" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="lttdpc" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="主键GUID" prop="guid" show-overflow-tooltip></el-table-column>-->
- <el-table-column min-width="80" label="行政区划编码" prop="adCode" show-overflow-tooltip align="center"></el-table-column>
- <el-table-column min-width="80" label="行政区划名称" prop="adName" show-overflow-tooltip align="center"></el-table-column>
- <!--<el-table-column min-width="80" label="左下角经度" prop="lowLeftLong" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="左下角维度" prop="lowLeftLat" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="右上角经度" prop="upRightLong" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="右上角维度" prop="upRightLat" show-overflow-tooltip></el-table-column>-->
- <el-table-column min-width="80" label="行政区划等级" prop="adGrad"
- show-overflow-tooltip :formatter="adGradFormatter" align="center"
- ></el-table-column>
- <!--<el-table-column min-width="80" label="行政区划简称" prop="adAbbrName"-->
- <!--show-overflow-tooltip align="center"-->
- <!--></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="adStat" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="面积" prop="adArea" show-overflow-tooltip></el-table-column>-->
- <el-table-column min-width="130" label="行政区划全称" prop="adFullName" show-overflow-tooltip align="center"></el-table-column>
- <!--<el-table-column min-width="80" label="备注" prop="note" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="effDate" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="exprDate" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="adStatLong" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="adStatLat" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="domainCode" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="adSign" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="modifierPeople" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="updDate" show-overflow-tooltip></el-table-column>-->
- <!--<el-table-column min-width="80" label="序号" prop="isReport" show-overflow-tooltip></el-table-column>-->
- <el-table-column min-width="80" label="上级行政区划编码" prop="adFcode" show-overflow-tooltip align="center"></el-table-column>
- <el-table-column min-width="80" label="上级行政区划名称" prop="upAdName" show-overflow-tooltip align="center"></el-table-column>
- <el-table-column min-width="80" label="是否贫困" prop="isPoveryt" show-overflow-tooltip :formatter="formatIsPoveryt"></el-table-column>
- </el-table>
- </el-main>
- <el-footer class="el-footer-style">
- <el-pagination
- style="text-align:center;"
- small
- background
- :current-page.sync="page.pageNum"
- :page-size="page.pageSize"
- :page-sizes="[10, 20, 30, 40, 50, 100]"
- layout="sizes, total,prev, pager, next,jumper"
- :total="showResultCount"
- @current-change="pageIndexChange"
- @size-change="handleSizeChange"
- ></el-pagination>
- </el-footer>
- </el-card>
- </el-col>
- </el-row>
- </template>
- <style>
- .ducha_form {
- width: 100%;
- height: 70px;
- }
- .ducha_form .el-input {
- width: 180px !important;
- }
- .ducha_table{
- border: 1px solid #ebeef5;
- transition: .3s;
- }
- .el-footer-style {
- text-align: center;
- width:100%;
- }
- </style>
- <script>
- const adGradOptions = [{
- value:'',
- label:'所有'
- },{
- value:'2',
- label:'省级'
- },{
- value:'3',
- label:'地市级'
- },{
- value:'4',
- label:'县级'
- },{
- value:'5',
- label:'乡级'
- },{
- value:'6',
- label:'村'
- }];
- const isPoverytOptions = [{
- value:'1',
- label:'是'
- },{
- value:'0',
- label:'否'
- }];
- import provTreeList from '../../../widgets/provTreeList'
- import request from '../../../utils/gw_ajax_request.js';
- import { exportModel } from "@util/gw_exportModel";
- export default {
- name: "xingZhengQuHua",
- components:{
- provTreeList
- },
- data() {
- return {
- rootCode:'000000',
- rootType:'2',
- dxdcMainHeight: window.innerHeight - 197,
- dxdcAsideHeight: window.innerHeight - 90,
- tableList:[],
- page: {
- pageNum: 1,
- pageSize: 20,
- },
- showResultCount: 0,
- tableLoading: true,
- autoInput:'请输入',
- formInline:{
- adCode:'',
- adName:'',
- adGrad:[],
- isPoveryt:'',
- },
- adGradOptions:adGradOptions,
- isPoverytOptions:isPoverytOptions,
- }
- },
- mounted() {
- this.getTableList();
- },
- activated(){
- this.getTableList()
- },
- methods: {
- empty(){
- this.formInline.adGrad = [];
- this.formInline.adCode = '';
- this.formInline.adName = '';
- this.formInline.isPoveryt = '';
- },
- provTreeSelectChangeHandler: function(params) {
- this.formInline.adCode = params.likeCode;
- this.getTableList();
- },
- // 查询列表
- getTableList() {
- let params = {
- 'pageSize': this.page.pageSize,
- 'pageNum': this.page.pageNum,
- 'adCode':this.formInline.adCode,
- 'adName':this.formInline.adName,
- 'adGrad':this.formInline.adGrad.toString().replace(/,/g,''),
- 'isPoveryt':this.formInline.isPoveryt
- };
- request.post('/dc/att/adXBase/getTableListByPage', params).then((res) => {
- let data = res.data;
- this.tableList = data.list;
- this.showResultCount = data.total;
- this.tableLoading = false
- })
- },
- renderHeader() {
- },
- pageIndexChange(val) {
- this.page.pageNum = val;
- this.getTableList();
- },
- handleSizeChange(val){
- this.page.pageSize = val;
- this.getTableList();
- },
- getIndex(index) {
- return (index + this.page.pageSize * (this.page.pageNum - 1)) + 1
- },
- formatIsPoveryt:function(row, column){
- return row.isPoveryt == 1 ? '是' : '否';
- },
- adGradFormatter: function(row, column) {
- return row.adGrad == 1
- ? "国家级"
- : row.adGrad == 2
- ? "省级"
- : row.adGrad == 3
- ? "地市级"
- : row.adGrad == 4
- ? "县级"
- : row.adGrad == 5
- ? "乡级"
- : row.adGrad == 6
- ? "村"
- : "村组";
- },
- onSearch(){
- this.getTableList();
- },
- getStrParams(obj) {
- let str = '?';
- for(let key of Object.keys(obj)) {
- str += `${key}=${obj[key]}&`;
- }
- str = str.slice(0, str.length - 1);
- return str;
- },
- // 导出Excel
- async exportExcel(){
- this.tableLoading = true;
- let type = "get";
- let url = `/pdcApi/dc/export/attAdXBase${this.getStrParams(Object.assign(this.formInline, this.page))}`;
- let downloadName = "Excel.xls";
- await exportModel(type,url,downloadName).catch((err) => {
- this.$message.error("导出失败");
- this.tableLoading = false;
- })
- this.$message.success("导出成功");
- this.tableLoading = false;
- }
- },
- computed: {
- },
- watch: {
- },
- }
- </script>
|