f4fc21c465381db088cbc6d192858440494006b8.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <a-card :bordered="false" :class="'cust-erp-sub-tab'">
  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="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="断面桩号">
  9. <a-input placeholder="请输入断面桩号" v-model="queryParam.dmzh"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  14. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  15. <a-button type="primary" @click="searchResetCurrent" icon="reload" style="margin-left: 8px">重置</a-button>
  16. </span>
  17. </a-col>
  18. </a-row>
  19. </a-form>
  20. </div>
  21. <!-- 操作按钮区域 -->
  22. <div class="table-operator" v-if="mainId">
  23. <a-button @click="handleAdd" v-has="'hdm:add'" type="primary" icon="plus">新增</a-button>
  24. <a-button type="primary" v-has="'hdm:exp'" icon="download" @click="handleExportXls('横断面信息')">导出</a-button>
  25. <a-upload
  26. name="file"
  27. :showUploadList="false"
  28. :multiple="false"
  29. :headers="tokenHeader"
  30. :action="importExcelUrl"
  31. @change="handleImportExcel">
  32. <a-button v-has="'hdm:imp'" type="primary" icon="import">导入</a-button>
  33. </a-upload>
  34. <!-- 高级查询区域 -->
  35. <j-super-query :fieldList="superFieldList" ref="superQueryModal"
  36. @handleSuperQuery="handleSuperQuery"></j-super-query>
  37. <a-dropdown v-if="selectedRowKeys.length > 0">
  38. <a-menu slot="overlay">
  39. <a-menu-item key="1" @click="batchDel">
  40. <a-icon type="delete"/>
  41. 删除
  42. </a-menu-item>
  43. </a-menu>
  44. <a-button v-has="'hdm:batchDel'" style="margin-left: 8px"> 批量操作
  45. <a-icon type="down"/>
  46. </a-button>
  47. </a-dropdown>
  48. </div>
  49. <!-- table区域-begin -->
  50. <div>
  51. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  52. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
  53. style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  54. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  55. </div>
  56. <a-table
  57. ref="table"
  58. size="middle"
  59. bordered
  60. rowKey="id"
  61. :scroll="{x:true}"
  62. :columns="columns"
  63. :dataSource="dataSource"
  64. :pagination="ipagination"
  65. :loading="loading"
  66. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  67. @change="handleTableChange">
  68. <template slot="dmzhslot" slot-scope="text,record">
  69. <span v-if="!record.hdmtp">{{ text }}</span>
  70. <a v-else @click="handleDmt(record.hdmtp)">{{ text }}</a>
  71. </template>
  72. <template slot="dmmcslot" slot-scope="text,record">
  73. <a @click="handleDetail(record)">{{ text }}</a>
  74. </template>
  75. <template slot="htmlSlot" slot-scope="text">
  76. <div v-html="text"></div>
  77. </template>
  78. <template slot="imgSlot" slot-scope="text">
  79. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  80. <img v-else :src="getImgView(text)" height="25px" alt=""
  81. style="max-width:80px;font-size: 12px;font-style: italic;"/>
  82. </template>
  83. <template slot="fileSlot" slot-scope="text">
  84. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  85. <a-button
  86. v-else
  87. :ghost="true"
  88. type="primary"
  89. icon="download"
  90. size="small"
  91. @click="downloadFile(text)">
  92. 下载
  93. </a-button>
  94. </template>
  95. <span slot="action" slot-scope="text, record">
  96. <a-space>
  97. <a-button @click='handleEdit(record)' v-has="'hdm:edit'" size='small'
  98. type='primary'>编辑</a-button>
  99. <a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
  100. <a-button size='small' v-has="'hdm:del'" type='danger'>删除</a-button>
  101. </a-popconfirm>
  102. </a-space>
  103. </span>
  104. </a-table>
  105. <a-modal width="1200px" :visible="previewVisible" :footer="null" @cancel="handleCancel()">
  106. <img alt="example" style="width: 100%" :src="previewImage"/>
  107. </a-modal>
  108. </div>
  109. <rmPmtxx-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId" :hdmc="hdmc"></rmPmtxx-modal>
  110. </a-card>
  111. </template>
  112. <script>
  113. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  114. import RmPmtxxModal from './modules/RmPmtxxModal'
  115. export default {
  116. name: "RmPmtxxList",
  117. mixins: [JeecgListMixin],
  118. components: {RmPmtxxModal},
  119. props: {
  120. mainId: {
  121. type: String,
  122. default: '',
  123. required: false
  124. },
  125. hdmc: {
  126. type: String,
  127. default: '',
  128. required: false
  129. }
  130. },
  131. watch: {
  132. mainId: {
  133. immediate: true,
  134. handler(val) {
  135. if (!this.mainId) {
  136. this.clearList()
  137. } else {
  138. this.queryParam['rvid'] = val;
  139. this.loadData(1);
  140. }
  141. }
  142. }
  143. },
  144. data() {
  145. return {
  146. description: '河道明细表管理页面',
  147. disableMixinCreated: true,
  148. // 表头
  149. columns: [
  150. {
  151. title: '序号',
  152. dataIndex: '',
  153. key: 'rowIndex',
  154. width: 60,
  155. align: "center",
  156. customRender: function (t, r, index) {
  157. return parseInt(index) + 1;
  158. }
  159. },
  160. {
  161. title: '河道名称',
  162. align: "center",
  163. dataIndex: 'hdmc'
  164. },
  165. {
  166. title: '断面桩号',
  167. align: "center",
  168. dataIndex: 'dmzh',
  169. scopedSlots: {customRender: 'dmzhslot'}
  170. },
  171. // {
  172. // title: '断面名称',
  173. // align: "center",
  174. // dataIndex: 'dmmc',
  175. // scopedSlots: {customRender: 'dmmcslot'}
  176. // },
  177. {
  178. title: '断面别名',
  179. align: "center",
  180. dataIndex: 'dmbm',
  181. scopedSlots: {customRender: 'dmmcslot'}
  182. },
  183. {
  184. title: '流域面积',
  185. align: "center",
  186. dataIndex: 'lymj'
  187. },
  188. {
  189. title: '防洪标准',
  190. align: "center",
  191. dataIndex: 'fhbz'
  192. },
  193. {
  194. title: '除涝标准',
  195. align: "center",
  196. dataIndex: 'clbz'
  197. },
  198. {
  199. title: '防洪流量',
  200. align: "center",
  201. dataIndex: 'fhll'
  202. },
  203. {
  204. title: '除涝流量',
  205. align: "center",
  206. dataIndex: 'clll'
  207. },
  208. {
  209. title: '操作',
  210. dataIndex: 'action',
  211. align: "center",
  212. fixed: "right",
  213. width: 147,
  214. scopedSlots: {customRender: 'action'},
  215. }
  216. ],
  217. url: {
  218. list: "/hzz.xxgl.hdmx/rmHdmxb/listRmPmtxxByMainId",
  219. delete: "/hzz.xxgl.hdmx/rmHdmxb/deleteRmPmtxx",
  220. deleteBatch: "/hzz.xxgl.hdmx/rmHdmxb/deleteBatchRmPmtxx",
  221. exportXlsUrl: "/hzz.xxgl.hdmx/rmHdmxb/exportRmPmtxx",
  222. importUrl: "/hzz.xxgl.hdmx/rmHdmxb/importRmPmtxx",
  223. },
  224. dictOptions: {
  225. hllb: [],
  226. },
  227. superFieldList: [],
  228. previewVisible: false,
  229. previewImage: '',
  230. isorter: {
  231. column: 'yxjxs',
  232. order: 'asc',
  233. },
  234. }
  235. },
  236. created() {
  237. this.getSuperFieldList();
  238. },
  239. computed: {
  240. importExcelUrl() {
  241. return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
  242. }
  243. },
  244. methods: {
  245. clearList() {
  246. this.dataSource = []
  247. this.selectedRowKeys = []
  248. this.ipagination.current = 1
  249. },
  250. getSuperFieldList() {
  251. let fieldList = [];
  252. fieldList.push({type: 'string', value: 'hlbm', text: '河流编码', dictCode: ''})
  253. fieldList.push({type: 'string', value: 'hlmc', text: '河流名称', dictCode: ''})
  254. fieldList.push({type: 'string', value: 'hllb', text: '河流类别', dictCode: 'hllb'})
  255. fieldList.push({type: 'double', value: 'lymj', text: '流域面积(km²)', dictCode: ''})
  256. fieldList.push({type: 'double', value: 'jnhlcd', text: '境内河流长度(km)', dictCode: ''})
  257. fieldList.push({type: 'string', value: 'ljxsq', text: '流经县(市、区)', dictCode: ''})
  258. fieldList.push({type: 'string', value: 'yfhbhdx', text: '有防洪保护对象(目标)或规划设计中有防洪任务', dictCode: 'whether'})
  259. fieldList.push({type: 'string', value: 'yplsydczhnt', text: '有排涝受益的村庄和农田', dictCode: 'whether'})
  260. fieldList.push({type: 'string', value: 'sfydf', text: '是否有堤防', dictCode: 'whether'})
  261. fieldList.push({type: 'string', value: 'bz', text: '备注', dictCode: ''})
  262. this.superFieldList = fieldList
  263. },
  264. previewImgFile(text) {
  265. if (!text) {
  266. this.$message.warning("未知的文件")
  267. return;
  268. }
  269. this.previewImage = this.getImgView(text);
  270. this.previewVisible = true;
  271. },
  272. handleCancel() {
  273. this.previewVisible = false;
  274. },
  275. handleDmt(hdmtp) {
  276. this.previewImgFile(hdmtp);
  277. },
  278. searchResetCurrent() {
  279. this.queryParam = {}
  280. if (this.mainId) {
  281. this.queryParam['rvid'] = this.mainId;
  282. }
  283. this.loadData(1);
  284. }
  285. }
  286. }
  287. </script>
  288. <style scoped>
  289. @import '~@assets/less/common.less';
  290. </style>