From 45c6f80215d0a86bd4e7c4147db5b84d844aad1a Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期一, 15 十二月 2025 12:39:24 +0800
Subject: [PATCH] #
---
src/main/webapp/views/index.html | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index 86a8ab5..90597c8 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -335,6 +335,9 @@
var url = logout.getAttribute('href');
logout.setAttribute('href', baseUrl + "/login");
+ // AI鍔╂墜寮圭獥绱㈠紩
+ var aiLayerIndex = null;
+
// AI鍔╂墜鍥炬爣鎮诞鎻愮ず
$('#ai-assistant-btn').on('mouseenter', function(){
this.index = layer.tips('AI鍔╂墜', this, {
@@ -344,6 +347,23 @@
}).on('mouseleave', function(){
layer.close(this.index);
}).on('click', function () {
+ // 濡傛灉宸茬粡鎵撳紑杩囦笖鏈攢姣侊紝鐩存帴鏄剧ず
+ if (aiLayerIndex !== null && $('#layui-layer' + aiLayerIndex).length > 0) {
+ var $layero = $('#layui-layer' + aiLayerIndex);
+ var $shade = $('#layui-layer-shade' + aiLayerIndex);
+
+ // 鏄剧ず骞堕噸缃姸鎬�
+ $shade.show().css('opacity', 0.1);
+ $layero.show();
+
+ // 閲嶆柊瑙﹀彂杩涘叆鍔ㄧ敾
+ $layero.removeClass('ai-drawer-layer-close');
+ $layero.removeClass('ai-drawer-layer');
+ void $layero.get(0).offsetWidth; // 瑙﹀彂閲嶇粯
+ $layero.addClass('ai-drawer-layer');
+ return;
+ }
+
layer.open({
type: 2,
title: false, // 闅愯棌榛樿鏍囬鏍忥紝鏇寸畝娲�
@@ -357,6 +377,8 @@
skin: 'ai-drawer-layer', // 鑷畾涔夌毊鑲�
content: 'ai/diagnosis.html',
success: function(layero, index){
+ aiLayerIndex = index; // 璁板綍绱㈠紩
+
// 鑳屾櫙妯$硦鏁堟灉
var shadeId = layero.attr('id').replace('layui-layer', 'layui-layer-shade');
var $shade = $('#' + shadeId);
@@ -370,7 +392,9 @@
layero.addClass('ai-drawer-layer-close');
$shade.css('opacity', 0);
setTimeout(function(){
- layer.close(index);
+ // layer.close(index); // 涓嶉攢姣侊紝鏀逛负闅愯棌
+ layero.hide();
+ $shade.hide();
}, 400);
});
}
--
Gitblit v1.9.1