b9d54934de8a0adfcb7806655960e2d8acb8a52d.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <el-row>
  3. <el-col :span="3">
  4. <provTreeList :rootCode="rootCode" :rootType="rootType"
  5. @provTreeSelectChange="provTreeSelectChangeHandler"
  6. :style="{'height': dxdcAsideHeight + 'px'}"
  7. >
  8. </provTreeList>
  9. </el-col>
  10. <el-col :span="21">
  11. <el-card class="ducha_form" :body-style="{'padding':'20px 5px'}">
  12. <el-form :inline="true" :model="formInline" class="sh-form-inline">
  13. <el-form-item label="行政区" style="margin-left: 5px">
  14. <el-input v-model="formInline.adName" placeholder="请输入区划编码或名称" clearable></el-input>
  15. </el-form-item>
  16. <!--<el-form-item label="行政区划名称">-->
  17. <!--<el-input v-model="formInline.adName" :placeholder="autoInput" clearable></el-input>-->
  18. <!--</el-form-item>-->
  19. <el-form-item label="级别">
  20. <el-select v-model="formInline.adGrad" placeholder="省、市、县、乡镇、村" multiple collapse-tags clearable
  21. >
  22. <el-option v-for="item in adGradOptions"
  23. :key="item.value"
  24. :label="item.label"
  25. :value="item.value"
  26. ></el-option>
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item label="是否贫困">
  30. <el-select v-model="formInline.isPoveryt" placeholder="请选择" clearable>
  31. <el-option v-for="item in isPoverytOptions"
  32. :key="item.value"
  33. :label="item.label"
  34. :value="item.value"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item style="margin: 0 5px">
  39. <el-button type="primary" @click="onSearch" icon="el-icon-search">查询</el-button>
  40. </el-form-item>
  41. <el-form-item style="margin: 0">
  42. <el-button type="info" plain @click="empty" icon="el-icon-refresh">重置</el-button>
  43. </el-form-item>
  44. <el-form-item style="margin: 0 5px">
  45. <el-button type="success" @click="exportExcel" icon="el-icon-sort-up">导出Excel</el-button>
  46. </el-form-item>
  47. </el-form>
  48. </el-card>
  49. <el-card class="ducha_table" :body-style="{ 'padding': '0 5px' }">
  50. <el-main style="margin: 0 -5px;padding: 0">
  51. <el-table :data="tableList" style="width: 100%;"
  52. ref="singleTable"
  53. v-loading="tableLoading"
  54. border
  55. :height="dxdcMainHeight+'px'"
  56. :render-header="renderHeader"
  57. tooltip-effect="dark"
  58. >
  59. <el-table-column type="index" min-width="100" :index="getIndex" label="序号" show-overflow-tooltip></el-table-column>
  60. <!--<el-table-column min-width="80" label="数据来源" prop="src" show-overflow-tooltip></el-table-column>-->
  61. <!--<el-table-column min-width="80" label="备注" prop="remark" show-overflow-tooltip></el-table-column>-->
  62. <!--<el-table-column min-width="80" label="序号" prop="lgtd" show-overflow-tooltip></el-table-column>-->
  63. <!--<el-table-column min-width="80" label="序号" prop="lttd" show-overflow-tooltip></el-table-column>-->
  64. <!--<el-table-column min-width="80" label="序号" prop="lgtdpc" show-overflow-tooltip></el-table-column>-->
  65. <!--<el-table-column min-width="80" label="序号" prop="lttdpc" show-overflow-tooltip></el-table-column>-->
  66. <!--<el-table-column min-width="80" label="主键GUID" prop="guid" show-overflow-tooltip></el-table-column>-->
  67. <el-table-column min-width="80" label="行政区划编码" prop="adCode" show-overflow-tooltip align="center"></el-table-column>
  68. <el-table-column min-width="80" label="行政区划名称" prop="adName" show-overflow-tooltip align="center"></el-table-column>
  69. <!--<el-table-column min-width="80" label="左下角经度" prop="lowLeftLong" show-overflow-tooltip></el-table-column>-->
  70. <!--<el-table-column min-width="80" label="左下角维度" prop="lowLeftLat" show-overflow-tooltip></el-table-column>-->
  71. <!--<el-table-column min-width="80" label="右上角经度" prop="upRightLong" show-overflow-tooltip></el-table-column>-->
  72. <!--<el-table-column min-width="80" label="右上角维度" prop="upRightLat" show-overflow-tooltip></el-table-column>-->
  73. <el-table-column min-width="80" label="行政区划等级" prop="adGrad"
  74. show-overflow-tooltip :formatter="adGradFormatter" align="center"
  75. ></el-table-column>
  76. <!--<el-table-column min-width="80" label="行政区划简称" prop="adAbbrName"-->
  77. <!--show-overflow-tooltip align="center"-->
  78. <!--&gt;</el-table-column>-->
  79. <!--<el-table-column min-width="80" label="序号" prop="adStat" show-overflow-tooltip></el-table-column>-->
  80. <!--<el-table-column min-width="80" label="面积" prop="adArea" show-overflow-tooltip></el-table-column>-->
  81. <el-table-column min-width="130" label="行政区划全称" prop="adFullName" show-overflow-tooltip align="center"></el-table-column>
  82. <!--<el-table-column min-width="80" label="备注" prop="note" show-overflow-tooltip></el-table-column>-->
  83. <!--<el-table-column min-width="80" label="序号" prop="effDate" show-overflow-tooltip></el-table-column>-->
  84. <!--<el-table-column min-width="80" label="序号" prop="exprDate" show-overflow-tooltip></el-table-column>-->
  85. <!--<el-table-column min-width="80" label="序号" prop="adStatLong" show-overflow-tooltip></el-table-column>-->
  86. <!--<el-table-column min-width="80" label="序号" prop="adStatLat" show-overflow-tooltip></el-table-column>-->
  87. <!--<el-table-column min-width="80" label="序号" prop="domainCode" show-overflow-tooltip></el-table-column>-->
  88. <!--<el-table-column min-width="80" label="序号" prop="adSign" show-overflow-tooltip></el-table-column>-->
  89. <!--<el-table-column min-width="80" label="序号" prop="modifierPeople" show-overflow-tooltip></el-table-column>-->
  90. <!--<el-table-column min-width="80" label="序号" prop="updDate" show-overflow-tooltip></el-table-column>-->
  91. <!--<el-table-column min-width="80" label="序号" prop="isReport" show-overflow-tooltip></el-table-column>-->
  92. <el-table-column min-width="80" label="上级行政区划编码" prop="adFcode" show-overflow-tooltip align="center"></el-table-column>
  93. <el-table-column min-width="80" label="上级行政区划名称" prop="upAdName" show-overflow-tooltip align="center"></el-table-column>
  94. <el-table-column min-width="80" label="是否贫困" prop="isPoveryt" show-overflow-tooltip :formatter="formatIsPoveryt"></el-table-column>
  95. </el-table>
  96. </el-main>
  97. <el-footer class="el-footer-style">
  98. <el-pagination
  99. style="text-align:center;"
  100. small
  101. background
  102. :current-page.sync="page.pageNum"
  103. :page-size="page.pageSize"
  104. :page-sizes="[10, 20, 30, 40, 50, 100]"
  105. layout="sizes, total,prev, pager, next,jumper"
  106. :total="showResultCount"
  107. @current-change="pageIndexChange"
  108. @size-change="handleSizeChange"
  109. ></el-pagination>
  110. </el-footer>
  111. </el-card>
  112. </el-col>
  113. </el-row>
  114. </template>
  115. <style>
  116. .ducha_form {
  117. width: 100%;
  118. height: 70px;
  119. }
  120. .ducha_form .el-input {
  121. width: 180px !important;
  122. }
  123. .ducha_table{
  124. border: 1px solid #ebeef5;
  125. transition: .3s;
  126. }
  127. .el-footer-style {
  128. text-align: center;
  129. width:100%;
  130. }
  131. </style>
  132. <script>
  133. const adGradOptions = [{
  134. value:'',
  135. label:'所有'
  136. },{
  137. value:'2',
  138. label:'省级'
  139. },{
  140. value:'3',
  141. label:'地市级'
  142. },{
  143. value:'4',
  144. label:'县级'
  145. },{
  146. value:'5',
  147. label:'乡级'
  148. },{
  149. value:'6',
  150. label:'村'
  151. }];
  152. const isPoverytOptions = [{
  153. value:'1',
  154. label:'是'
  155. },{
  156. value:'0',
  157. label:'否'
  158. }];
  159. import provTreeList from '../../../widgets/provTreeList'
  160. import request from '../../../utils/gw_ajax_request.js';
  161. import { exportModel } from "@util/gw_exportModel";
  162. export default {
  163. name: "xingZhengQuHua",
  164. components:{
  165. provTreeList
  166. },
  167. data() {
  168. return {
  169. rootCode:'000000',
  170. rootType:'2',
  171. dxdcMainHeight: window.innerHeight - 197,
  172. dxdcAsideHeight: window.innerHeight - 90,
  173. tableList:[],
  174. page: {
  175. pageNum: 1,
  176. pageSize: 20,
  177. },
  178. showResultCount: 0,
  179. tableLoading: true,
  180. autoInput:'请输入',
  181. formInline:{
  182. adCode:'',
  183. adName:'',
  184. adGrad:[],
  185. isPoveryt:'',
  186. },
  187. adGradOptions:adGradOptions,
  188. isPoverytOptions:isPoverytOptions,
  189. }
  190. },
  191. mounted() {
  192. this.getTableList();
  193. },
  194. activated(){
  195. this.getTableList()
  196. },
  197. methods: {
  198. empty(){
  199. this.formInline.adGrad = [];
  200. this.formInline.adCode = '';
  201. this.formInline.adName = '';
  202. this.formInline.isPoveryt = '';
  203. },
  204. provTreeSelectChangeHandler: function(params) {
  205. this.formInline.adCode = params.likeCode;
  206. this.getTableList();
  207. },
  208. // 查询列表
  209. getTableList() {
  210. let params = {
  211. 'pageSize': this.page.pageSize,
  212. 'pageNum': this.page.pageNum,
  213. 'adCode':this.formInline.adCode,
  214. 'adName':this.formInline.adName,
  215. 'adGrad':this.formInline.adGrad.toString().replace(/,/g,''),
  216. 'isPoveryt':this.formInline.isPoveryt
  217. };
  218. request.post('/dc/att/adXBase/getTableListByPage', params).then((res) => {
  219. let data = res.data;
  220. this.tableList = data.list;
  221. this.showResultCount = data.total;
  222. this.tableLoading = false
  223. })
  224. },
  225. renderHeader() {
  226. },
  227. pageIndexChange(val) {
  228. this.page.pageNum = val;
  229. this.getTableList();
  230. },
  231. handleSizeChange(val){
  232. this.page.pageSize = val;
  233. this.getTableList();
  234. },
  235. getIndex(index) {
  236. return (index + this.page.pageSize * (this.page.pageNum - 1)) + 1
  237. },
  238. formatIsPoveryt:function(row, column){
  239. return row.isPoveryt == 1 ? '是' : '否';
  240. },
  241. adGradFormatter: function(row, column) {
  242. return row.adGrad == 1
  243. ? "国家级"
  244. : row.adGrad == 2
  245. ? "省级"
  246. : row.adGrad == 3
  247. ? "地市级"
  248. : row.adGrad == 4
  249. ? "县级"
  250. : row.adGrad == 5
  251. ? "乡级"
  252. : row.adGrad == 6
  253. ? "村"
  254. : "村组";
  255. },
  256. onSearch(){
  257. this.getTableList();
  258. },
  259. getStrParams(obj) {
  260. let str = '?';
  261. for(let key of Object.keys(obj)) {
  262. str += `${key}=${obj[key]}&`;
  263. }
  264. str = str.slice(0, str.length - 1);
  265. return str;
  266. },
  267. // 导出Excel
  268. async exportExcel(){
  269. this.tableLoading = true;
  270. let type = "get";
  271. let url = `/pdcApi/dc/export/attAdXBase${this.getStrParams(Object.assign(this.formInline, this.page))}`;
  272. let downloadName = "Excel.xls";
  273. await exportModel(type,url,downloadName).catch((err) => {
  274. this.$message.error("导出失败");
  275. this.tableLoading = false;
  276. })
  277. this.$message.success("导出成功");
  278. this.tableLoading = false;
  279. }
  280. },
  281. computed: {
  282. },
  283. watch: {
  284. },
  285. }
  286. </script>