c849001baf594c5a9680b320bb5b78178e59e4a8.svn-base 10 KB

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