UserAnnouncementList.vue 6.3 KB

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