5de21968f08f8ec35b5eb9c7445c0468746cee2b.svn-base 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="法律法规名称">
  9. <a-input placeholder="请输入法律法规名称" v-model="queryParam.fvfgmc"></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="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  16. <!-- <a @click="handleToggleSearch" style="margin-left: 8px">-->
  17. <!-- {{ toggleSearchStatus ? '收起' : '展开' }}-->
  18. <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
  19. <!-- </a>-->
  20. </span>
  21. </a-col>
  22. </a-row>
  23. </a-form>
  24. </div>
  25. <!-- 查询区域-END -->
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleAdd" v-has="'fvfg:add'" type="primary" icon="plus">新增</a-button>
  29. <a-button v-has="'fvfg:dc'" type="primary" icon="download" @click="handleExportXls('法律法规')">导出</a-button>
  30. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
  31. :action="importExcelUrl" @change="handleImportExcel">
  32. <a-button v-has="'fvfg:dr'" 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 style="margin-left: 8px" v-has="'fvfg:pldelete'"> 批量操作
  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. :scroll="{x:true}"
  60. bordered
  61. rowKey="id"
  62. :columns="columns"
  63. :dataSource="dataSource"
  64. :pagination="ipagination"
  65. :loading="loading"
  66. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  67. class="j-table-force-nowrap"
  68. @change="handleTableChange">
  69. <template slot="fvfgmc" slot-scope="text,record">
  70. <a @click="handleDetail(record)">{{ text }}</a>
  71. </template>
  72. <template slot="htmlSlot" slot-scope="text">
  73. <div v-html="text"></div>
  74. </template>
  75. <template slot="imgSlot" slot-scope="text">
  76. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  77. <img v-else :src="getImgView(text)" height="25px" alt=""
  78. style="max-width:80px;font-size: 12px;font-style: italic;"/>
  79. </template>
  80. <template slot="fileSlot" slot-scope="text">
  81. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  82. <a-space v-else>
  83. <a-button
  84. v-if="text.endsWith('.pdf')"
  85. :ghost="true"
  86. type="primary"
  87. icon="eye"
  88. size="small"
  89. @click="previewPdfFile(text)">
  90. 预览
  91. </a-button>
  92. <a-button
  93. v-else-if="text.endsWith('.png')||text.endsWith('.jpg')||text.endsWith('.bmp')"
  94. :ghost="true"
  95. type="primary"
  96. icon="eye"
  97. size="small"
  98. @click="previewImgFile(text)">
  99. 预览
  100. </a-button>
  101. <a-button
  102. :ghost="true"
  103. type="primary"
  104. icon="download"
  105. size="small"
  106. @click="downloadFile(text)">
  107. 下载
  108. </a-button>
  109. <a-modal width="1200px" :visible="previewVisible" :footer="null" @cancel="handleCancel()">
  110. <img alt="example" style="width: 100%" :src="previewImage"/>
  111. </a-modal>
  112. </a-space>
  113. </template>
  114. <span slot="action" slot-scope="text, record">
  115. <a-space>
  116. <a-button @click='handleEdit(record)' v-has="'fvfg:bj'" size='small' type='primary'>编辑</a-button>
  117. <a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
  118. <a-button size='small' v-has="'fvfg:delete'" type='danger'>删除</a-button>
  119. </a-popconfirm>
  120. </a-space>
  121. </span>
  122. </a-table>
  123. </div>
  124. <rm-fvfg-modal ref="modalForm" @ok="modalFormOk"></rm-fvfg-modal>
  125. </a-card>
  126. </template>
  127. <script>
  128. import '@/assets/less/TableExpand.less'
  129. import {mixinDevice} from '@/utils/mixin'
  130. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  131. import RmFvfgModal from './modules/RmFvfgModal'
  132. export default {
  133. name: 'RmFvfgList',
  134. mixins: [JeecgListMixin, mixinDevice],
  135. components: {
  136. RmFvfgModal
  137. },
  138. data() {
  139. return {
  140. description: '法律法规管理页面',
  141. // 表头
  142. columns: [
  143. {
  144. title: '序号',
  145. dataIndex: '',
  146. key: 'rowIndex',
  147. width: 60,
  148. align: "center",
  149. customRender: function (t, r, index) {
  150. return parseInt(index) + 1;
  151. }
  152. },
  153. {
  154. title: '法律法规名称',
  155. align: "center",
  156. dataIndex: 'fvfgmc',
  157. scopedSlots: { customRender: 'fvfgmc'}
  158. },
  159. {
  160. title: '内容',
  161. align: "center",
  162. dataIndex: 'nr'
  163. },
  164. {
  165. title: '上传人',
  166. align: "center",
  167. dataIndex: 'scr'
  168. },
  169. {
  170. title: '上传时间',
  171. align: "center",
  172. dataIndex: 'scsj',
  173. customRender: function (text) {
  174. return !text ? "" : (text.length > 10 ? text.substr(0, 10) : text)
  175. }
  176. },
  177. {
  178. title: '文件',
  179. align: "center",
  180. dataIndex: 'wj',
  181. scopedSlots: {customRender: 'fileSlot'}
  182. },
  183. {
  184. title: '操作',
  185. dataIndex: 'action',
  186. align: "center",
  187. fixed: "right",
  188. width: 147,
  189. scopedSlots: {customRender: 'action'}
  190. }
  191. ],
  192. url: {
  193. list: "/hzz.xxgl.fvfg/rmFvfg/list",
  194. delete: "/hzz.xxgl.fvfg/rmFvfg/delete",
  195. deleteBatch: "/hzz.xxgl.fvfg/rmFvfg/deleteBatch",
  196. exportXlsUrl: "/hzz.xxgl.fvfg/rmFvfg/exportXls",
  197. importExcelUrl: "hzz.xxgl.fvfg/rmFvfg/importExcel",
  198. },
  199. dictOptions: {},
  200. superFieldList: [],
  201. previewVisible: false,
  202. previewImage: '',
  203. }
  204. },
  205. created() {
  206. this.getSuperFieldList();
  207. },
  208. computed: {
  209. importExcelUrl: function () {
  210. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  211. },
  212. },
  213. methods: {
  214. initDictConfig() {
  215. },
  216. getSuperFieldList() {
  217. let fieldList = [];
  218. fieldList.push({type: 'string', value: 'fvfgmc', text: '法律法规名称', dictCode: ''})
  219. fieldList.push({type: 'Text', value: 'nr', text: '内容', dictCode: ''})
  220. fieldList.push({type: 'string', value: 'scr', text: '上传人', dictCode: ''})
  221. fieldList.push({type: 'date', value: 'scsj', text: '上传时间'})
  222. fieldList.push({type: 'string', value: 'wj', text: '文件', dictCode: ''})
  223. this.superFieldList = fieldList
  224. },
  225. previewImgFile(text){
  226. if (!text) {
  227. this.$message.warning("未知的文件")
  228. return;
  229. }
  230. this.previewImage = this.getImgView(text);
  231. this.previewVisible = true;
  232. },
  233. handleCancel() {
  234. this.previewVisible = false;
  235. }
  236. }
  237. }
  238. </script>
  239. <style scoped>
  240. @import '~@assets/less/common.less';
  241. </style>