aad7a530cdbb930eaa4cb6dae29b22f3ab7adf31.svn-base 7.6 KB

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