From 3dc2c715158eb69c6c7a2c0a39463305f6a10a30 Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 29 Jul 2024 17:44:33 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20add=E8=BD=A6=E9=97=B4=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=8E=86=E5=8F=B2=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysNoticeController.java | 5 +- .../mapper/system/SysNoticeMapper.xml | 2 +- hw-ui/src/components/workshopNotice/index.vue | 221 +++++++++++++++--- hw-ui/src/utils/notice.js | 18 +- 4 files changed, 206 insertions(+), 40 deletions(-) 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(); // 手动关闭通知 } }, - } + }, };