diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/controller/SysNoticeController.java b/hw-modules/hw-system/src/main/java/com/hw/system/controller/SysNoticeController.java index 63c257d..4592e5b 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/controller/SysNoticeController.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/controller/SysNoticeController.java @@ -98,10 +98,11 @@ public class SysNoticeController extends BaseController * @return */ @GetMapping("/workshopNoticeList") - public AjaxResult workshopNoticeList(SysNotice notice) + public TableDataInfo workshopNoticeList(SysNotice notice) { + startPage(); List list = noticeService.workshopNoticeList(notice); - return success(list); + return getDataTable(list); } /** diff --git a/hw-modules/hw-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/hw-modules/hw-system/src/main/resources/mapper/system/SysNoticeMapper.xml index cd0e3f1..9999d76 100644 --- a/hw-modules/hw-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ b/hw-modules/hw-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND b.user_id = #{userId} - + AND b.check_status = #{checkStatus} diff --git a/hw-ui/src/components/workshopNotice/index.vue b/hw-ui/src/components/workshopNotice/index.vue index dd163da..0c112a6 100644 --- a/hw-ui/src/components/workshopNotice/index.vue +++ b/hw-ui/src/components/workshopNotice/index.vue @@ -1,42 +1,99 @@ + diff --git a/hw-ui/src/utils/notice.js b/hw-ui/src/utils/notice.js index 56303b4..1412f41 100644 --- a/hw-ui/src/utils/notice.js +++ b/hw-ui/src/utils/notice.js @@ -13,9 +13,15 @@ export const noticeData = { }; }, mounted() { - setInterval(() => { + setInterval(() => this.workshopNoticeTasks(), 5000 * 1000) + }, + methods: { + workshopNoticeTasks() { + if (this.notificationInstance) { + this.notificationInstance.close(); // 手动关闭通知 + } workshopNoticeList({noticeType: '1', checkStatus: '0'}).then(res => { - this.noticeList = res.data; + this.noticeList = res.rows; if (this.noticeList.length > 0) { this.notificationInstance = this.$notify.info({ title: '通知', @@ -35,9 +41,9 @@ export const noticeData = { }); } }); - }, 60 * 1000) - }, - methods: { + }, + + //点击查看弹窗逻辑 handleNotificationClick() { this.noticeListData = this.noticeList[0]; let userNotice = this.noticeListData.sysUserNoticeList[0]; @@ -51,7 +57,7 @@ export const noticeData = { this.notificationInstance.close(); // 手动关闭通知 } }, - } + }, };