!12279 菜单跳转

Merge pull request !12279 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-07-02 02:59:15 +00:00
committed by Gitee
2 changed files with 54 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
/* sun_badge_menu — 菜单角标样式 */
/* 此模块在菜单名称后注入 .menu-badge 元素,需此文件提供定位样式 */
/* 菜单项容器相对定位,供角标绝对定位参照 */
.o_app_menu_item,
.o_navbar_apps_menu_item,
.show_dropdown_menu .dropdown-item {
position: relative;
}
/* 角标基础样式 */
.menu-badge {
position: absolute;
top: 2px;
right: 4px;
min-width: 18px;
height: 18px;
padding: 0 5px;
border-radius: 9px;
background: #dc3545;
color: #fff;
font-size: 11px;
font-weight: 600;
line-height: 18px;
text-align: center;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
z-index: 1;
}
@@ -0,0 +1,25 @@
/** @odoo-module **/
import { Component } from "@odoo/owl";
import { registry } from "@web/core/registry";
/**
* Client Action: 打开浮动 AI 聊天框
*
* 由 ai.rule 的 action_test_guide() 按钮触发,
* 创建测试消息后返回此 action,自动弹出浮动聊天面板。
*/
class AiChatOpen extends Component {
async setup() {
super.setup();
// 派发自定义事件,通知浮动聊天模块打开并刷新
// ai_floating.js 监听此事件
window.dispatchEvent(new CustomEvent("yuthon:ai_open_chat", {
detail: { forceOpen: true },
}));
}
}
AiChatOpen.template = "yuthon_ai_agent.AiChatOpenTemplate";
registry.category("actions").add("yuthon_ai_chat_open", AiChatOpen);