UserAnnouncementList.vue 6.1 KB

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