diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/message/example/MessageSendExample.java b/src/main/java/com/budwk/app/zhgh/dayofficework/message/example/MessageSendExample.java new file mode 100644 index 00000000..c68db162 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/message/example/MessageSendExample.java @@ -0,0 +1,50 @@ +package com.budwk.app.zhgh.dayofficework.message.example; + +import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService; +import lombok.extern.slf4j.Slf4j; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; + +import java.util.Arrays; +import java.util.List; + +/** + * 全局消息发送使用示例 + * 展示如何使用简化的API发送消息 + */ +@IocBean +@Slf4j +public class MessageSendExample { + + @Inject + private GlobalMessageSendService globalMessageSendService; + + /** + * 示例1:发送简单的系统通知(自动发送到所有启用的渠道) + */ + public void sendSimpleNotification() { + String title = "系统维护通知"; + String content = "系统将于今晚22:00-24:00进行维护,请提前保存工作内容。"; + List receiverIds = Arrays.asList("user1", "user2", "user3"); + + // 最简单的调用方式,自动发送到所有启用的渠道 + globalMessageSendService.sendMessage(title, content, receiverIds); + + log.info("简单系统通知发送完成"); + } + + /** + * 示例2:发送待办通知(自动发送到所有启用的渠道) + */ + public void sendTodoNotification() { + String title = "审批待办"; + String content = "您有一个新的审批任务需要处理,请及时登录系统查看。"; + List receiverIds = Arrays.asList("manager1", "manager2"); + + // 自动发送到所有启用的渠道 + globalMessageSendService.sendMessage(title, content, 2, receiverIds, null); + + log.info("待办通知发送完成"); + } + +} diff --git a/src/main/resources/views/layouts/platform.html b/src/main/resources/views/layouts/platform.html index 444d5f7f..7a90c3ce 100644 --- a/src/main/resources/views/layouts/platform.html +++ b/src/main/resources/views/layouts/platform.html @@ -115,22 +115,82 @@ layout("/layouts/v4/baseLayout.html"){ height: 100%; } + + /* 悬浮菜单按钮样式 */ + .menu-toggle-btn { + display: none; + position: fixed; + bottom: 20px; + right: 20px; + width: 50px; + height: 50px; + border-radius: 50%; + background-color: rgb(64 109 157); + color: white; + text-align: center; + line-height: 50px; + font-size: 24px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + z-index: 1000; + cursor: pointer; + transition: all 0.3s ease; + } + + .menu-toggle-btn:hover { + background-color: rgb(54 99 147); + transform: scale(1.05); + } + + .menu-toggle-btn.active { + background-color: #d9534f; + } + + /* 菜单遮罩层样式 */ + .menu-overlay { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + z-index: 998; + } + @media (max-width: 768px) { - .sub-app-container { - flex-direction: column; - } - .sidebar-menu { - width: 100%; + position: fixed; + top: 64px; + left: -100%; + width: 40%; + z-index: 999; + transition: left 0.3s ease; + box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2); } - .sub-app-container-main-content { + .sidebar-menu.show { + left: 0; + } + + .menu-toggle-btn { + display: block; + } + + .menu-overlay.show { + display: block; + } + + .main-content { padding: 20px; + width: 100%; } }
+ + +