no message
This commit is contained in:
parent
8f04c30b2e
commit
0a9480d6e6
|
|
@ -562,6 +562,19 @@
|
||||||
loadManualRequests();
|
loadManualRequests();
|
||||||
// 添加闪烁动画效果
|
// 添加闪烁动画效果
|
||||||
triggerManualRequestBlink();
|
triggerManualRequestBlink();
|
||||||
|
|
||||||
|
// 触发父页面的菜单闪烁功能
|
||||||
|
try {
|
||||||
|
if (parent && parent.startMenuBlink && typeof parent.startMenuBlink === 'function') {
|
||||||
|
parent.startMenuBlink('客服系统', 5000);
|
||||||
|
console.log('[DEBUG] 已触发父页面客服系统菜单闪烁');
|
||||||
|
} else {
|
||||||
|
console.log('[DEBUG] 父页面菜单闪烁功能不可用');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('[ERROR] 调用父页面菜单闪烁功能失败:', e);
|
||||||
|
}
|
||||||
|
|
||||||
// 显示通知
|
// 显示通知
|
||||||
console.log('[DEBUG] 显示转人工请求通知...');
|
console.log('[DEBUG] 显示转人工请求通知...');
|
||||||
if (typeof $.modal !== 'undefined') {
|
if (typeof $.modal !== 'undefined') {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,37 @@
|
||||||
<link th:href="@{/css/style.min.css}" rel="stylesheet"/>
|
<link th:href="@{/css/style.min.css}" rel="stylesheet"/>
|
||||||
<link th:href="@{/css/skins.css}" rel="stylesheet"/>
|
<link th:href="@{/css/skins.css}" rel="stylesheet"/>
|
||||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.5}" rel="stylesheet"/>
|
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.5}" rel="stylesheet"/>
|
||||||
|
<style>
|
||||||
|
.lock-screen {
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
top: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 9999;
|
||||||
|
background: #fff;
|
||||||
|
color: #333;
|
||||||
|
line-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 菜单闪烁动画样式 */
|
||||||
|
@keyframes menuBlink {
|
||||||
|
0% { background-color: transparent; }
|
||||||
|
50% { background-color: #ff6b6b; color: #fff; }
|
||||||
|
100% { background-color: transparent; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-blink {
|
||||||
|
animation: menuBlink 1s ease-in-out infinite;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-blink-stop {
|
||||||
|
animation: none;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="fixed-sidebar full-height-layout gray-bg" th:classappend="${isMobile} ? 'canvas-menu'" style="overflow: hidden">
|
<body class="fixed-sidebar full-height-layout gray-bg" th:classappend="${isMobile} ? 'canvas-menu'" style="overflow: hidden">
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
|
|
@ -272,6 +303,117 @@
|
||||||
var ctx = [[@{/}]];
|
var ctx = [[@{/}]];
|
||||||
var lockscreen = [[${session.lockscreen}]];
|
var lockscreen = [[${session.lockscreen}]];
|
||||||
if(lockscreen){window.top.location=ctx+"lockscreen";}
|
if(lockscreen){window.top.location=ctx+"lockscreen";}
|
||||||
|
|
||||||
|
// 菜单闪烁控制变量
|
||||||
|
var blinkTimer = null;
|
||||||
|
var blinkingMenus = new Set();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始菜单闪烁
|
||||||
|
* @param {string} menuText - 菜单文本内容
|
||||||
|
* @param {number} duration - 闪烁持续时间(毫秒),默认5000ms
|
||||||
|
*/
|
||||||
|
function startMenuBlink(menuText, duration) {
|
||||||
|
duration = duration || 5000;
|
||||||
|
|
||||||
|
// 查找包含指定文本的菜单项
|
||||||
|
var menuItems = $('.nav-second-level a, .nav-third-level a, .nav li > a').filter(function() {
|
||||||
|
return $(this).text().trim() === menuText;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (menuItems.length > 0) {
|
||||||
|
menuItems.each(function() {
|
||||||
|
var $menu = $(this);
|
||||||
|
$menu.addClass('menu-blink');
|
||||||
|
blinkingMenus.add($menu[0]);
|
||||||
|
|
||||||
|
// 添加点击事件监听,点击后停止闪烁
|
||||||
|
$menu.off('click.blink').on('click.blink', function() {
|
||||||
|
stopMenuBlink(menuText);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 设置自动停止闪烁的定时器
|
||||||
|
setTimeout(function() {
|
||||||
|
stopMenuBlink(menuText);
|
||||||
|
}, duration);
|
||||||
|
|
||||||
|
console.log('菜单 "' + menuText + '" 开始闪烁,持续 ' + duration + 'ms');
|
||||||
|
} else {
|
||||||
|
console.warn('未找到菜单: ' + menuText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止菜单闪烁
|
||||||
|
* @param {string} menuText - 菜单文本内容
|
||||||
|
*/
|
||||||
|
function stopMenuBlink(menuText) {
|
||||||
|
var menuItems = $('.nav-second-level a, .nav-third-level a, .nav li > a').filter(function() {
|
||||||
|
return $(this).text().trim() === menuText;
|
||||||
|
});
|
||||||
|
|
||||||
|
menuItems.each(function() {
|
||||||
|
var $menu = $(this);
|
||||||
|
$menu.removeClass('menu-blink').addClass('menu-blink-stop');
|
||||||
|
blinkingMenus.delete($menu[0]);
|
||||||
|
|
||||||
|
// 移除点击事件监听
|
||||||
|
$menu.off('click.blink');
|
||||||
|
|
||||||
|
// 延迟移除停止样式类
|
||||||
|
setTimeout(function() {
|
||||||
|
$menu.removeClass('menu-blink-stop');
|
||||||
|
}, 300);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('菜单 "' + menuText + '" 停止闪烁');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止所有菜单闪烁
|
||||||
|
*/
|
||||||
|
function stopAllMenuBlink() {
|
||||||
|
$('.menu-blink').each(function() {
|
||||||
|
var $menu = $(this);
|
||||||
|
var menuText = $menu.text().trim();
|
||||||
|
stopMenuBlink(menuText);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WebSocket消息监听(示例)
|
||||||
|
* 当收到APP消息时触发菜单闪烁
|
||||||
|
*/
|
||||||
|
function initWebSocketForMenuBlink() {
|
||||||
|
// 这里是WebSocket连接的示例代码
|
||||||
|
// 实际使用时需要根据项目的WebSocket实现进行调整
|
||||||
|
/*
|
||||||
|
var ws = new WebSocket('ws://localhost:8080/websocket');
|
||||||
|
|
||||||
|
ws.onmessage = function(event) {
|
||||||
|
try {
|
||||||
|
var message = JSON.parse(event.data);
|
||||||
|
// 如果是APP消息通知
|
||||||
|
if (message.type === 'app_message' || message.type === 'new_message') {
|
||||||
|
// 触发消息管理菜单闪烁
|
||||||
|
startMenuBlink('消息管理', 5000);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('解析WebSocket消息失败:', e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
ws.onerror = function(error) {
|
||||||
|
console.error('WebSocket连接错误:', error);
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
// 全局暴露函数,方便外部调用
|
||||||
|
window.startMenuBlink = startMenuBlink;
|
||||||
|
window.stopMenuBlink = stopMenuBlink;
|
||||||
|
window.stopAllMenuBlink = stopAllMenuBlink;
|
||||||
// 皮肤缓存
|
// 皮肤缓存
|
||||||
var skin = storage.get("skin");
|
var skin = storage.get("skin");
|
||||||
// history(表示去掉地址的#)否则地址以"#"形式展示
|
// history(表示去掉地址的#)否则地址以"#"形式展示
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue