From ad43be8dc3263cf0e5e3e2cb8374ef6c95b912e6 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期四, 25 十二月 2025 12:50:31 +0800
Subject: [PATCH] #
---
src/main/webapp/views/index.html | 94 ++++++++++++++---------------------------------
1 files changed, 28 insertions(+), 66 deletions(-)
diff --git a/src/main/webapp/views/index.html b/src/main/webapp/views/index.html
index e9ea1c7..90597c8 100644
--- a/src/main/webapp/views/index.html
+++ b/src/main/webapp/views/index.html
@@ -146,71 +146,6 @@
<!-- 鍙充笅瑙扴VG鍔ㄧ敾 -->
<div id="ai-assistant-btn" style="position: fixed; bottom: 40px; right: 20px; z-index: 9999; cursor: pointer;">
- <svg
- width="48"
- height="48"
- viewBox="0 0 64 64"
- xmlns="http://www.w3.org/2000/svg">
-
- <!-- 閫忔槑鑳屾櫙锛氫笉鐢讳换浣曞簳鑹插嵆鍙� -->
-
- <!-- 涓�鐐规煍鍜屽彂鍏夋晥鏋� -->
- <defs>
- <filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
- <feGaussianBlur stdDeviation="2.5" result="blur"/>
- <feMerge>
- <feMergeNode in="blur"/>
- <feMergeNode in="SourceGraphic"/>
- </feMerge>
- </filter>
-
- <style>
- /* 鏁翠釜鍥炬爣鏃嬭浆鍔ㄧ敾 */
- .spinner {
- animation: spin 2.8s linear infinite;
- transform-origin: 50% 50%;
- }
-
- @keyframes spin {
- from { transform: rotate(0deg); }
- to { transform: rotate(360deg); }
- }
- </style>
- </defs>
-
- <!-- 鏃嬭浆缁� -->
- <g class="spinner" filter="url(#glow)">
- <!-- 姣忎竴鏉″僵鑹层�屽皬寮潯銆� -->
- <!-- 鍙互閫氳繃璋冩暣 rx/ry銆亀idth/height 鏉ユ敼绮楃粏鍜屽集搴� -->
- <!-- 1. 绱壊 -->
- <rect x="30" y="10" width="6" height="14" rx="3" ry="3" fill="#8b5cf6" />
-
- <!-- 2. 绮夎壊锛堥『鏃堕拡鏃嬭浆60掳锛� -->
- <g transform="rotate(60 32 32)">
- <rect x="30" y="10" width="6" height="14" rx="3" ry="3" fill="#f472b6" />
- </g>
-
- <!-- 3. 姗欒壊 -->
- <g transform="rotate(120 32 32)">
- <rect x="30" y="10" width="6" height="14" rx="3" ry="3" fill="#fb923c" />
- </g>
-
- <!-- 4. 閲戦粍 -->
- <g transform="rotate(180 32 32)">
- <rect x="30" y="10" width="6" height="14" rx="3" ry="3" fill="#fbbf24" />
- </g>
-
- <!-- 5. 闈掕壊 -->
- <g transform="rotate(240 32 32)">
- <rect x="30" y="10" width="6" height="14" rx="3" ry="3" fill="#22d3ee" />
- </g>
-
- <!-- 6. 钃濊壊 -->
- <g transform="rotate(300 32 32)">
- <rect x="30" y="10" width="6" height="14" rx="3" ry="3" fill="#3b82f6" />
- </g>
- </g>
- </svg>
</div>
<script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
@@ -220,6 +155,9 @@
<script>
console.log('%c 涓壃绔嬪簱骞冲彴 %c 1.0.0','background-color:rgb(53,73,94);color: #fff;border-radius:2px 0 0 2px;padding:2px 4px;','background-color:rgb(25,190,107);color: #fff;border-radius:0 2px 2px 0;padding:2px 4px;font: 9pt "Apercu Regular", Georgia, "Times New Roman", Times, serif;');
$(function () {
+ // 娉ㄥ叆AI鍔╂墜鍥炬爣
+ $('#ai-assistant-btn').html(getAiIconHtml(60, 60));
+
if ("" === localStorage.getItem('token')) {
top.location.href = baseUrl + "/login";
}
@@ -397,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, {
@@ -406,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, // 闅愯棌榛樿鏍囬鏍忥紝鏇寸畝娲�
@@ -419,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);
@@ -432,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