UserAnnouncementList.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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.sender"></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. <div class="table-operator">
  27. <a-button type="primary" @click="readAll" icon="book">全部标注已读</a-button>
  28. </div>
  29. <a-table
  30. ref="table"
  31. size="default"
  32. bordered
  33. rowKey="id"
  34. :columns="columns"
  35. :dataSource="dataSource"
  36. :pagination="ipagination"
  37. :loading="loading"
  38. @change="handleTableChange">
  39. <span slot="action" slot-scope="text, record">
  40. <a @click="showAnnouncement(record)">查看</a>
  41. </span>
  42. </a-table>
  43. <show-announcement ref="ShowAnnouncement"></show-announcement>
  44. <dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
  45. </a-card>
  46. </template>
  47. <script>
  48. import { filterObj } from '@/utils/util'
  49. import { getAction,putAction } from '@/api/manage'
  50. import ShowAnnouncement from '@/components/tools/ShowAnnouncement'
  51. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  52. import DynamicNotice from '../../components/tools/DynamicNotice'
  53. import Utils from '../../api/util.js';
  54. export default {
  55. name: "UserAnnouncementList",
  56. mixins: [JeecgListMixin],
  57. components: {
  58. DynamicNotice,
  59. ShowAnnouncement
  60. },
  61. data () {
  62. return {
  63. description: '系统通告表管理页面',
  64. queryParam: {},
  65. columns: [{
  66. title: '标题',
  67. align:"center",
  68. dataIndex: 'titile'
  69. },{
  70. title: '消息类型',
  71. align: "center",
  72. dataIndex: 'msgCategory',
  73. customRender: function (text) {
  74. if (text == '1') {
  75. return "通知公告";
  76. } else if (text == "2") {
  77. return "系统消息";
  78. } else {
  79. return text;
  80. }
  81. }
  82. },{
  83. title: '发布人',
  84. align:"center",
  85. dataIndex: 'sender'
  86. },{
  87. title: '发布时间',
  88. align:"center",
  89. dataIndex: 'sendTime'
  90. },{
  91. title: '优先级',
  92. align:"center",
  93. dataIndex: 'priority',
  94. customRender:function (text) {
  95. if(text=='L'){
  96. return "低";
  97. }else if(text=="M"){
  98. return "中";
  99. }else if(text=="H"){
  100. return "高";
  101. } else {
  102. return text;
  103. }
  104. }
  105. },{
  106. title: '阅读状态',
  107. align:"center",
  108. dataIndex: 'readFlag',
  109. customRender:function (text) {
  110. if(text=='0'){
  111. return "未读";
  112. }else if(text=="1"){
  113. return "已读";
  114. } else {
  115. return text;
  116. }
  117. }
  118. },{
  119. title: '操作',
  120. dataIndex: 'action',
  121. align:"center",
  122. scopedSlots: { customRender: 'action' },
  123. }],
  124. url: {
  125. list: "/sys/sysAnnouncementSend/getMyAnnouncementSend",
  126. editCementSend:"sys/sysAnnouncementSend/editByAnntIdAndUserId",
  127. readAllMsg:"sys/sysAnnouncementSend/readAll",
  128. },
  129. loading:false,
  130. openPath:'',
  131. formData: null
  132. }
  133. },
  134. methods: {
  135. handleDetail: function(record){
  136. this.$refs.sysAnnouncementModal.detail(record);
  137. this.$refs.sysAnnouncementModal.title="查看";
  138. },
  139. showAnnouncement(record){
  140. putAction(this.url.editCementSend,{anntId:record.anntId}).then((res)=>{
  141. if(res.success){
  142. this.loadData();
  143. Utils.$emit('demo','msg');
  144. }
  145. });
  146. if(record.openType==='component'){
  147. this.openPath = record.openPage;
  148. this.formData = {id:record.busId};
  149. this.$refs.showDynamNotice.detail();
  150. }else{
  151. this.$refs.ShowAnnouncement.detail(record);
  152. }
  153. },
  154. readAll(){
  155. var that = this;
  156. that.$confirm({
  157. title:"确认操作",
  158. content:"是否全部标注已读?",
  159. onOk: function(){
  160. putAction(that.url.readAllMsg).then((res)=>{
  161. if(res.success){
  162. that.$message.success(res.message);
  163. that.loadData();
  164. Utils.$emit('demo','msg');
  165. }
  166. });
  167. }
  168. });
  169. },
  170. }
  171. }
  172. </script>
  173. <style scoped>
  174. .ant-card-body .table-operator{
  175. margin-bottom: 18px;
  176. }
  177. .anty-row-operator button{margin: 0 5px}
  178. .ant-btn-danger{background-color: #ffffff}z
  179. .ant-modal-cust-warp{height: 100%}
  180. .ant-modal-cust-warp .ant-modal-body{height:calc(100% - 110px) !important;overflow-y: auto}
  181. .ant-modal-cust-warp .ant-modal-content{height:90% !important;overflow-y: hidden}
  182. </style>