b50641ec58197a7b3f7bff049be9404b0c737232.svn-base 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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 :span="6">
  8. <a-form-item label="标题">
  9. <a-input placeholder="请输入标题" v-model="queryParam.titile"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <!--<a-col :span="6">
  13. <a-form-item label="内容">
  14. <a-input placeholder="请输入内容" v-model="queryParam.msgContent"></a-input>
  15. </a-form-item>
  16. </a-col>-->
  17. <a-col :span="8">
  18. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  19. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21. </span>
  22. </a-col>
  23. </a-row>
  24. </a-form>
  25. </div>
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  29. <a-button type="primary" icon="download" @click="handleExportXls('系统通告')">导出</a-button>
  30. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  31. <a-button type="primary" icon="import">导入</a-button>
  32. </a-upload>
  33. <a-dropdown v-if="selectedRowKeys.length > 0">
  34. <a-menu slot="overlay">
  35. <a-menu-item key="1" @click="batchDel">
  36. <a-icon type="delete"/>
  37. 删除
  38. </a-menu-item>
  39. </a-menu>
  40. <a-button style="margin-left: 8px"> 批量操作
  41. <a-icon type="down"/>
  42. </a-button>
  43. </a-dropdown>
  44. </div>
  45. <!-- table区域-begin -->
  46. <div>
  47. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  48. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  49. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  50. </div>
  51. <a-table
  52. ref="table"
  53. size="middle"
  54. bordered
  55. rowKey="id"
  56. :columns="columns"
  57. :dataSource="dataSource"
  58. :pagination="ipagination"
  59. :loading="loading"
  60. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  61. @change="handleTableChange">
  62. <span slot="action" slot-scope="text, record">
  63. <a v-if="record.sendStatus == 0" @click="handleEdit(record)">编辑</a>
  64. <a-divider type="vertical" v-if="record.sendStatus == 0"/>
  65. <a-dropdown>
  66. <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
  67. <a-menu slot="overlay">
  68. <a-menu-item v-if="record.sendStatus != 1">
  69. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  70. <a>删除</a>
  71. </a-popconfirm>
  72. </a-menu-item>
  73. <a-menu-item v-if="record.sendStatus == 0">
  74. <a-popconfirm title="确定发布吗?" @confirm="() => releaseData(record.id)">
  75. <a>发布</a>
  76. </a-popconfirm>
  77. </a-menu-item>
  78. <!-- <a-menu-item v-if="record.sendStatus == 1">
  79. <a-popconfirm title="确定撤销吗?" @confirm="() => reovkeData(record.id)">
  80. <a>撤销</a>
  81. </a-popconfirm>
  82. </a-menu-item>
  83. -->
  84. <a-menu-item v-if="record.sendStatus == 1">
  85. <a @click="handleAlread(record)">通知情况</a>
  86. </a-menu-item>
  87. <a-menu-item>
  88. <a @click="handleDetail(record)">查看</a>
  89. </a-menu-item>
  90. </a-menu>
  91. </a-dropdown>
  92. </span>
  93. </a-table>
  94. </div>
  95. <!-- table区域-end -->
  96. <!-- 表单区域 -->
  97. <sysAnnouncement-modal ref="modalForm" @ok="modalFormOk"></sysAnnouncement-modal>
  98. <SysAlreadlyModal ref="Alreadly" ></SysAlreadlyModal>
  99. <!-- 查看详情 -->
  100. <j-modal class="detail-modal" :fullscreen="false"
  101. title="查看详情" :visible.sync="detailModal.visible" :top="50" :width="600" switchFullscreen :footer="null">
  102. <iframe v-if="detailModal.url" class="detail-iframe" :src="detailModal.url"/>
  103. </j-modal>
  104. </a-card>
  105. </template>
  106. <script>
  107. import SysAnnouncementModal from './modules/SysAnnouncementModal'
  108. import {doReleaseData, doReovkeData} from '@/api/api'
  109. import {getAction} from '@/api/manage'
  110. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  111. import { ACCESS_TOKEN } from '@/store/mutation-types'
  112. import SysAlreadlyModal from "@views/system/modules/SysAlreadlyModal";
  113. export default {
  114. name: "SysAnnouncementList",
  115. mixins: [JeecgListMixin],
  116. components: {
  117. SysAnnouncementModal,
  118. SysAlreadlyModal
  119. },
  120. data() {
  121. return {
  122. description: '系统通告表管理页面',
  123. // 查询条件
  124. queryParam: {},
  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: '标题',
  139. align: "center",
  140. dataIndex: 'titile'
  141. },
  142. {
  143. title: '消息类型',
  144. align: "center",
  145. dataIndex: 'msgCategory',
  146. customRender: function (text) {
  147. if (text == '1') {
  148. return "通知公告";
  149. } else if (text == "2") {
  150. return "系统消息";
  151. } else {
  152. return text;
  153. }
  154. }
  155. },
  156. /*{
  157. title: '开始时间',
  158. align: "center",
  159. dataIndex: 'startTime'
  160. },
  161. {
  162. title: '结束时间',
  163. align: "center",
  164. dataIndex: 'endTime'
  165. },*/
  166. {
  167. title: '发布人',
  168. align: "center",
  169. dataIndex: 'sender'
  170. },
  171. {
  172. title: '优先级',
  173. align: "center",
  174. dataIndex: 'priority',
  175. customRender: function (text) {
  176. if (text == 'L') {
  177. return "低";
  178. } else if (text == "M") {
  179. return "中";
  180. } else if (text == "H") {
  181. return "高";
  182. } else {
  183. return text;
  184. }
  185. }
  186. },
  187. {
  188. title: '通告对象',
  189. align: "center",
  190. dataIndex: 'msgType',
  191. customRender: function (text) {
  192. if (text == 'USER') {
  193. return "指定用户";
  194. } else if (text == "ALL") {
  195. return "全体用户";
  196. } else {
  197. return text;
  198. }
  199. }
  200. },
  201. {
  202. title: '发布状态',
  203. align: "center",
  204. dataIndex: 'sendStatus',
  205. customRender: function (text) {
  206. if (text == 0) {
  207. return "未发布";
  208. } else if (text == 1) {
  209. return "已发布";
  210. } else if (text == 2) {
  211. return "已撤销";
  212. } else {
  213. return text;
  214. }
  215. }
  216. },
  217. {
  218. title: '发布时间',
  219. align: "center",
  220. dataIndex: 'sendTime'
  221. },
  222. /*{
  223. title: '撤销时间',
  224. align: "center",
  225. dataIndex: 'cancelTime'
  226. },*/
  227. /*{
  228. title: '删除状态(0,正常,1已删除)',
  229. align:"center",
  230. dataIndex: 'delFlag'
  231. },*/
  232. {
  233. title: '操作',
  234. dataIndex: 'action',
  235. align: "center",
  236. scopedSlots: {customRender: 'action'},
  237. }
  238. ],
  239. detailModal: {visible: false, url: '',},
  240. url: {
  241. list: "/sys/annountCement/list",
  242. delete: "/sys/annountCement/delete",
  243. deleteBatch: "/sys/annountCement/deleteBatch",
  244. releaseDataUrl: "/sys/annountCement/doReleaseData",
  245. reovkeDataUrl: "sys/annountCement/doReovkeData",
  246. exportXlsUrl: "sys/annountCement/exportXls",
  247. importExcelUrl: "sys/annountCement/importExcel",
  248. },
  249. }
  250. },
  251. computed: {
  252. importExcelUrl: function(){
  253. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  254. }
  255. },
  256. methods: {
  257. handleAlread(record){
  258. this.$refs.Alreadly.edit(record);
  259. this.$refs.Alreadly.disableSubmit=true;
  260. },
  261. //执行发布操作
  262. releaseData: function (id) {
  263. console.log(id);
  264. var that = this;
  265. doReleaseData({id: id}).then((res) => {
  266. if (res.success) {
  267. that.$message.success(res.message);
  268. that.loadData(1);
  269. } else {
  270. that.$message.warning(res.message);
  271. }
  272. });
  273. },
  274. //执行撤销操作
  275. reovkeData: function (id) {
  276. var that = this;
  277. doReovkeData({id: id}).then((res) => {
  278. if (res.success) {
  279. that.$message.success(res.message);
  280. that.loadData(1);
  281. this.syncHeadNotic(id)
  282. } else {
  283. that.$message.warning(res.message);
  284. }
  285. });
  286. },
  287. syncHeadNotic(anntId){
  288. getAction("sys/annountCement/syncNotic",{anntId:anntId})
  289. },
  290. handleDetail:function(record){
  291. const domain = window._CONFIG['domianURL']
  292. const token = this.$ls.get(ACCESS_TOKEN)
  293. this.detailModal.url = `${domain}/sys/annountCement/show/${record.id}?token=${token}`
  294. this.detailModal.visible = true
  295. },
  296. }
  297. }
  298. </script>
  299. <style scoped lang="less">
  300. @import '~@assets/less/common.less';
  301. /** 查看详情弹窗的样式 */
  302. .detail-modal {
  303. .detail-iframe {
  304. border: 0;
  305. width: 100%;
  306. height: 88vh;
  307. min-height: 600px;
  308. }
  309. &.fullscreen .detail-iframe {
  310. height: 100%;
  311. }
  312. }
  313. .detail-modal /deep/ .ant-modal {
  314. top: 30px;
  315. .ant-modal-body {
  316. font-size: 0;
  317. padding: 0;
  318. }
  319. }
  320. .detail-modal.fullscreen /deep/ .ant-modal {
  321. top: 0;
  322. }
  323. </style>