1a358fb3820e2613853990c4cb3599b57717ba46.svn-base 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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 :md="6" :sm="8">
  8. <a-form-item label="消息标题">
  9. <a-input placeholder="请输入消息标题" v-model="queryParam.esTitle"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <a-form-item label="发送内容">
  14. <a-input placeholder="请输入发送内容" v-model="queryParam.esContent"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <a-col :md="6" :sm="8">
  19. <a-form-item label="接收人">
  20. <a-input placeholder="请输入接收人" v-model="queryParam.esReceiver"></a-input>
  21. </a-form-item>
  22. </a-col>
  23. </template>
  24. <a-col :md="6" :sm="8">
  25. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  26. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  27. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  28. <a @click="handleToggleSearch" style="margin-left: 8px">
  29. {{ toggleSearchStatus ? '收起' : '展开' }}
  30. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  31. </a>
  32. </span>
  33. </a-col>
  34. </a-row>
  35. </a-form>
  36. </div>
  37. <!-- 操作按钮区域 -->
  38. <div class="table-operator">
  39. <a-button @click="handleAdd" v-show="show" type="primary" icon="plus">新增</a-button>
  40. <a-button type="primary" v-show="show" icon="download" @click="handleExportXls('消息')">导出</a-button>
  41. <a-upload v-show="show" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
  42. @change="handleImportExcel">
  43. <a-button type="primary" icon="import">导入</a-button>
  44. </a-upload>
  45. <a-dropdown v-if="selectedRowKeys.length > 0">
  46. <a-menu slot="overlay">
  47. <a-menu-item key="1" @click="batchDel">
  48. <a-icon type="delete"/>
  49. 删除
  50. </a-menu-item>
  51. </a-menu>
  52. <a-button style="margin-left: 8px"> 批量操作
  53. <a-icon type="down"/>
  54. </a-button>
  55. </a-dropdown>
  56. </div>
  57. <!-- table区域-begin -->
  58. <div>
  59. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  60. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
  61. selectedRowKeys.length }}</a>项
  62. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  63. </div>
  64. <a-table
  65. ref="table"
  66. size="middle"
  67. bordered
  68. rowKey="id"
  69. :columns="columns"
  70. :dataSource="dataSource"
  71. :pagination="ipagination"
  72. :loading="loading"
  73. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  74. @change="handleTableChange">
  75. <!-- 字符串超长截取省略号显示-->
  76. <span slot="esContent" slot-scope="text">
  77. <j-ellipsis :value="text" :length="10" />
  78. </span>
  79. <span slot="action" slot-scope="text, record">
  80. <a href="javascript:;" @click="handleDetail(record)">详情</a>
  81. <a-divider type="vertical"/>
  82. <a-dropdown>
  83. <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
  84. <a-menu slot="overlay">
  85. <a-menu-item v-show="show">
  86. <a @click="handleEdit(record)">编辑</a>
  87. </a-menu-item>
  88. <a-menu-item>
  89. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  90. <a>删除</a>
  91. </a-popconfirm>
  92. </a-menu-item>
  93. </a-menu>
  94. </a-dropdown>
  95. </span>
  96. </a-table>
  97. </div>
  98. <!-- table区域-end -->
  99. <!-- 表单区域 -->
  100. <sysMessage-modal ref="modalForm" @ok="modalFormOk"></sysMessage-modal>
  101. </a-card>
  102. </template>
  103. <script>
  104. import SysMessageModal from './modules/SysMessageModal'
  105. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  106. import JEllipsis from "@/components/jeecg/JEllipsis";
  107. export default {
  108. name: "SysMessageList",
  109. mixins: [JeecgListMixin],
  110. components: {
  111. JEllipsis,
  112. SysMessageModal
  113. },
  114. data() {
  115. return {
  116. description: '消息管理页面',
  117. // 新增修改按钮是否显示
  118. show: false,
  119. // 表头
  120. columns: [
  121. {
  122. title: '#',
  123. dataIndex: '',
  124. key: 'rowIndex',
  125. width: 60,
  126. align: "center",
  127. customRender: function (t, r, index) {
  128. return parseInt(index) + 1;
  129. }
  130. },
  131. {
  132. title: '消息标题',
  133. align: "center",
  134. dataIndex: 'esTitle'
  135. },
  136. {
  137. title: '发送内容',
  138. align: "center",
  139. dataIndex: 'esContent',
  140. scopedSlots: {customRender: 'esContent'},
  141. },
  142. {
  143. title: '接收人',
  144. align: "center",
  145. dataIndex: 'esReceiver'
  146. },
  147. {
  148. title: '发送次数',
  149. align: "center",
  150. dataIndex: 'esSendNum'
  151. },
  152. {
  153. title: '发送状态',
  154. align: 'center',
  155. dataIndex: 'esSendStatus_dictText'
  156. },
  157. {
  158. title: '发送时间',
  159. align: "center",
  160. dataIndex: 'esSendTime'
  161. },
  162. {
  163. title: '发送方式',
  164. align: 'center',
  165. dataIndex: 'esType_dictText'
  166. },
  167. {
  168. title: '操作',
  169. dataIndex: 'action',
  170. align: "center",
  171. scopedSlots: {customRender: 'action'},
  172. }
  173. ],
  174. url: {
  175. list: "/sys/message/sysMessage/list",
  176. delete: "/sys/message/sysMessage/delete",
  177. deleteBatch: "/sys/message/sysMessage/deleteBatch",
  178. exportXlsUrl: "sys/message/sysMessage/exportXls",
  179. importExcelUrl: "sys/message/sysMessage/importExcel",
  180. },
  181. }
  182. },
  183. computed: {
  184. importExcelUrl: function () {
  185. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  186. }
  187. },
  188. methods: {}
  189. }
  190. </script>
  191. <style lang="less" scoped>
  192. /** Button按钮间距 */
  193. .ant-btn {
  194. margin-left: 3px
  195. }
  196. .ant-card-body .table-operator {
  197. margin-bottom: 18px;
  198. }
  199. .ant-table-tbody .ant-table-row td {
  200. padding-top: 15px;
  201. padding-bottom: 15px;
  202. }
  203. .anty-row-operator button {
  204. margin: 0 5px
  205. }
  206. .ant-btn-danger {
  207. background-color: #ffffff
  208. }
  209. .ant-modal-cust-warp {
  210. height: 100%
  211. }
  212. .ant-modal-cust-warp .ant-modal-body {
  213. height: calc(100% - 110px) !important;
  214. overflow-y: auto
  215. }
  216. .ant-modal-cust-warp .ant-modal-content {
  217. height: 90% !important;
  218. overflow-y: hidden
  219. }
  220. </style>