5807923f60e1301f9e14885c54ca15eed2dafe12.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="5" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="河流名称">
  9. <a-input placeholder="请输入河流名称" v-model="queryParam.hlmc"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="5" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="河流类别">
  14. <j-dict-select-tag placeholder="请选择河流类别" v-model="queryParam.hllb" dictCode="hllb"/>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :xl="8" :lg="11" :md="12" :sm="24">
  18. <a-form-item label="流域面积(km²)">
  19. <a-input placeholder="请输入最小值" class="query-group-cust"
  20. v-model="queryParam.lymj_begin"></a-input>
  21. <span class="query-group-split-cust"></span>
  22. <a-input placeholder="请输入最大值" class="query-group-cust"
  23. v-model="queryParam.lymj_end"></a-input>
  24. </a-form-item>
  25. </a-col>
  26. <a-col :xl="5" :lg="7" :md="8" :sm="24">
  27. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  28. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  29. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  30. </span>
  31. </a-col>
  32. </a-row>
  33. </a-form>
  34. </div>
  35. <!-- 查询区域-END -->
  36. <!-- 操作按钮区域 -->
  37. <div class="table-operator">
  38. <a-button @click="handleAdd" v-has="'hdmx:add'" type="primary" icon="plus">新增</a-button>
  39. <a-button type="primary" icon="download" v-has="'hdmx:exp'" @click="handleExportXls('河道明细表')">导出</a-button>
  40. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
  41. :action="importExcelUrl" @change="handleImportExcel">
  42. <a-button type="primary" v-has="'hdmx:imp'" icon="import">导入</a-button>
  43. </a-upload>
  44. <!-- 高级查询区域 -->
  45. <j-super-query :fieldList="superFieldList" ref="superQueryModal"
  46. @handleSuperQuery="handleSuperQuery"></j-super-query>
  47. </div>
  48. <!-- table区域-begin -->
  49. <div>
  50. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  51. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
  52. style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  53. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  54. </div>
  55. <a-table
  56. ref="table"
  57. size="middle"
  58. bordered
  59. rowKey="id"
  60. class="j-table-force-nowrap"
  61. :scroll="{x:true}"
  62. :columns="columns"
  63. :dataSource="dataSource"
  64. :pagination="ipagination"
  65. :loading="loading"
  66. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
  67. :customRow="clickThenSelect"
  68. @change="handleTableChange">
  69. <template slot="htmlSlot" slot-scope="text">
  70. <div v-html="text"></div>
  71. </template>
  72. <template slot="imgSlot" slot-scope="text">
  73. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  74. <img v-else :src="getImgView(text)" height="25px" alt=""
  75. style="max-width:80px;font-size: 12px;font-style: italic;"/>
  76. </template>
  77. <template slot="fileSlot" slot-scope="text">
  78. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  79. <a-button
  80. v-else
  81. :ghost="true"
  82. type="primary"
  83. icon="download"
  84. size="small"
  85. @click="downloadFile(text)">
  86. 下载
  87. </a-button>
  88. </template>
  89. <span slot="action" slot-scope="text, record">
  90. <a-space>
  91. <a-button @click='handleEdit(record)' v-has="'hdmx:edit'" size='small' type='primary'>编辑</a-button>
  92. <a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
  93. <a-button size='small' v-has="'hdmx:del'" type='danger'>删除</a-button>
  94. </a-popconfirm>
  95. </a-space>
  96. </span>
  97. </a-table>
  98. </div>
  99. <a-tabs defaultActiveKey="1">
  100. <a-tab-pane tab="横断面信息" key="1">
  101. <RmPmtxxList :mainId="selectedMainId" :hdmc="selectedHlmc"/>
  102. </a-tab-pane>
  103. <a-tab-pane tab="纵断面信息" key="2" forceRender>
  104. <RmZdmxxglList :mainId="selectedMainId" :hdmx-info="selectedHlmxInfo"/>
  105. </a-tab-pane>
  106. </a-tabs>
  107. <rmHdmxb-modal ref="modalForm" @ok="modalFormOk"></rmHdmxb-modal>
  108. </a-card>
  109. </template>
  110. <script>
  111. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  112. import RmHdmxbModal from './modules/RmHdmxbModal'
  113. import {getAction} from '@/api/manage'
  114. import RmPmtxxList from './RmPmtxxList'
  115. import RmZdmxxglList from './RmZdmxxglList'
  116. import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  117. import '@/assets/less/TableExpand.less'
  118. export default {
  119. name: "RmHdmxbList",
  120. mixins: [JeecgListMixin],
  121. components: {
  122. RmPmtxxList,
  123. RmZdmxxglList,
  124. RmHdmxbModal
  125. },
  126. data() {
  127. return {
  128. description: '河道明细表管理页面',
  129. // 表头
  130. columns: [
  131. {
  132. title: '河流名称',
  133. align: "center",
  134. dataIndex: 'hlmc'
  135. },
  136. {
  137. title: '河流编码',
  138. align: "center",
  139. dataIndex: 'hlbm'
  140. },
  141. {
  142. title: '河流类别',
  143. align: "center",
  144. dataIndex: 'hllb_dictText',
  145. },
  146. {
  147. title: '流域面积(km²)',
  148. align: "center",
  149. dataIndex: 'lymj'
  150. },
  151. {
  152. title: '境内河流长度(km)',
  153. align: "center",
  154. dataIndex: 'jnhlcd'
  155. },
  156. {
  157. title: '流经县(市、区)',
  158. align: "center",
  159. dataIndex: 'ljxsq'
  160. },
  161. {
  162. title: '有防洪保护对象(目标)或规划设计中有防洪任务',
  163. align: "center",
  164. dataIndex: 'yfhbhdx_dictText'
  165. },
  166. {
  167. title: '有排涝受益的村庄和农田',
  168. align: "center",
  169. dataIndex: 'yplsydczhnt_dictText'
  170. },
  171. {
  172. title: '是否有堤防',
  173. align: "center",
  174. dataIndex: 'sfydf_dictText'
  175. },
  176. {
  177. title: '操作',
  178. dataIndex: 'action',
  179. align: "center",
  180. fixed: "right",
  181. width: 147,
  182. scopedSlots: {customRender: 'action'},
  183. }
  184. ],
  185. url: {
  186. list: "/hzz.xxgl.hdmx/rmHdmxb/list",
  187. delete: "/hzz.xxgl.hdmx/rmHdmxb/delete",
  188. deleteBatch: "/hzz.xxgl.hdmx/rmHdmxb/deleteBatch",
  189. exportXlsUrl: "/hzz.xxgl.hdmx/rmHdmxb/exportXls",
  190. importExcelUrl: "hzz.xxgl.hdmx/rmHdmxb/importExcel",
  191. },
  192. dictOptions: {
  193. hllb: [],
  194. },
  195. /* 分页参数 */
  196. ipagination: {
  197. current: 1,
  198. pageSize: 5,
  199. pageSizeOptions: ['5', '10', '50'],
  200. showTotal: (total, range) => {
  201. return range[0] + "-" + range[1] + " 共" + total + "条"
  202. },
  203. showQuickJumper: true,
  204. showSizeChanger: true,
  205. total: 0
  206. },
  207. selectedMainId: '',
  208. selectedHlmc:'',
  209. selectedHlmxInfo:{},
  210. superFieldList: [],
  211. isorter: {
  212. column: 'hllb',
  213. order: 'asc',
  214. },
  215. }
  216. },
  217. created() {
  218. this.getSuperFieldList();
  219. },
  220. computed: {
  221. importExcelUrl: function () {
  222. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  223. }
  224. },
  225. methods: {
  226. initDictConfig() {
  227. initDictOptions('hllb').then((res) => {
  228. if (res.success) {
  229. this.$set(this.dictOptions, 'hllb', res.result)
  230. }
  231. })
  232. },
  233. clickThenSelect(record) {
  234. return {
  235. on: {
  236. click: () => {
  237. this.onSelectChange(record.id.split(","), [record]);
  238. }
  239. }
  240. }
  241. },
  242. onClearSelected() {
  243. this.selectedRowKeys = [];
  244. this.selectionRows = [];
  245. this.selectedMainId = '';
  246. this.selectedHlmc='';
  247. this.selectedHlmxInfo = {};
  248. },
  249. onSelectChange(selectedRowKeys, selectionRows) {
  250. this.selectedMainId = selectedRowKeys[0];
  251. this.selectedHlmc = selectionRows[0].hlmc;
  252. this.selectedHlmxInfo = {
  253. hdmc:selectionRows[0].hlmc,
  254. hdbm:selectionRows[0].hlbm,
  255. lymj:selectionRows[0].lymj
  256. };
  257. this.selectedRowKeys = selectedRowKeys;
  258. this.selectionRows = selectionRows;
  259. },
  260. loadData(arg) {
  261. if (!this.url.list) {
  262. this.$message.error("请设置url.list属性!")
  263. return
  264. }
  265. //加载数据 若传入参数1则加载第一页的内容
  266. if (arg === 1) {
  267. this.ipagination.current = 1;
  268. }
  269. this.onClearSelected()
  270. var params = this.getQueryParams();//查询条件
  271. this.loading = true;
  272. getAction(this.url.list, params).then((res) => {
  273. if (res.success) {
  274. this.dataSource = res.result.records;
  275. this.ipagination.total = parseInt(res.result.total) ;
  276. }
  277. if (res.code === 510) {
  278. this.$message.warning(res.message)
  279. }
  280. this.loading = false;
  281. })
  282. },
  283. getSuperFieldList() {
  284. let fieldList = [];
  285. fieldList.push({type: 'string', value: 'hlmc', text: '河流名称', dictCode: ''})
  286. fieldList.push({type: 'string', value: 'hlbm', text: '河流编码', dictCode: ''})
  287. fieldList.push({type: 'string', value: 'hllb', text: '河流类别', dictCode: 'hllb'})
  288. fieldList.push({type: 'double', value: 'lymj', text: '流域面积(km²)', dictCode: ''})
  289. fieldList.push({type: 'double', value: 'jnhlcd', text: '境内河流长度(km)', dictCode: ''})
  290. fieldList.push({type: 'string', value: 'ljxsq', text: '流经县(市、区)', dictCode: ''})
  291. fieldList.push({type: 'string', value: 'yfhbhdx', text: '有防洪保护对象(目标)或规划设计中有防洪任务', dictCode: 'whether'})
  292. fieldList.push({type: 'string', value: 'yplsydczhnt', text: '有排涝受益的村庄和农田', dictCode: 'whether'})
  293. fieldList.push({type: 'string', value: 'sfydf', text: '是否有堤防', dictCode: 'whether'})
  294. fieldList.push({type: 'string', value: 'bz', text: '备注', dictCode: ''})
  295. this.superFieldList = fieldList
  296. }
  297. }
  298. }
  299. </script>
  300. <style scoped>
  301. @import '~@assets/less/common.less';
  302. </style>