Răsfoiți Sursa

[Mod 0000]header添加数据点选助手全选控制,修改悬浮按钮样式

wangkeyi 3 săptămâni în urmă
părinte
comite
bcf5f7d25c

+ 1 - 1
src/layouts/default/header/index.vue

@@ -70,7 +70,7 @@
       <WeatherBroadcast v-if="sysOrgCode != 'sdmtjtgsd' && isShowQy && portValue != '8062' && hasPermission('show:weather')" />
       <VoiceBroadcast v-if="sysOrgCode != 'sdmtjtgsd' && portValue != '8062'" />
       <AIChat v-if="hasPermission('show:AIChat')" />
-      <div style="width: 24px; height: 24px; cursor: pointer; user-select: none; margin: 0 3px">
+      <div v-if="hasPermission('show:AIDiAssistant')" style="width: 24px; height: 24px; cursor: pointer; user-select: none; margin: 0 3px">
         <img
           :src="dataPickerHoverEnabled ? AIOpenIcon : AICloseIcon"
           :title="dataPickerHoverEnabled ? '关闭AI解读' : '开启AI解读'"

+ 26 - 7
src/views/ventAI/dataPicker/useDataPicker.ts

@@ -3,7 +3,8 @@ import Antd from 'ant-design-vue';
 import { fetchTunnelInterpretation, fetchDeviceInterpretation } from './api';
 import type { TodoItem, ToolCallRecord, SSERawEvent } from './types';
 import DataPickerModal from './components/DataPickerModal.vue';
-import aiIcon from '@/assets/images/ventAI/dataPicker/AI-icon.svg';
+import aiCloseIcon from '@/assets/images/ventAI/dataPicker/AI-close.svg';
+import aiOpenIcon from '@/assets/images/ventAI/dataPicker/AI-open.svg';
 import { getActions } from '/@/qiankun/state';
 
 // ─── 全局开关:控制悬停模式浮动按钮是否启用 ─────────────────────────────────
@@ -43,20 +44,26 @@ function createButtonEl(): HTMLElement {
   const btn = document.createElement('div');
   btn.className = BUTTON_CLASS;
   btn.title = '数据解读';
-  btn.innerHTML = `<img src="${aiIcon}" width="24" height="24" alt="数据解读" />`;
+  const img = document.createElement('img');
+  img.src = aiCloseIcon;
+  img.width = 24;
+  img.height = 24;
+  img.alt = '数据解读';
+  btn.appendChild(img);
   Object.assign(btn.style, {
     position: 'fixed',
     zIndex: '99999',
-    padding: '8px',
-    background: 'linear-gradient(135deg, #1e90ff, #4da6ff)',
-    borderRadius: '50%',
+    padding: '4px 6px 8px 6px',
+    background: '#0E4F8D',
+    borderRadius: '8px',
     cursor: 'pointer',
     display: 'none',
     pointerEvents: 'auto',
-    transition: 'transform 0.15s ease-out, opacity 0.15s ease-out',
+    transition: 'transform 0.15s ease-out, opacity 0.15s ease-out, border 0.15s ease-out',
     transform: 'scale(0.9)',
     opacity: '0',
-    boxShadow: '0 0 10px rgba(30,144,255,0.4)',
+    border: '2px solid transparent',
+    boxSizing: 'border-box',
   });
   btn.addEventListener('mouseenter', () => {
     const owner = (btn as any).__di_owner;
@@ -64,10 +71,22 @@ function createButtonEl(): HTMLElement {
       owner.cancelLeave();
       owner.clearHideTimer();
     }
+    img.src = aiOpenIcon;
+    btn.style.border = '2px solid #1e90ff';
   });
   btn.addEventListener('mouseleave', () => {
     const owner = (btn as any).__di_owner;
     if (owner) owner.startHideTimer();
+    img.src = aiCloseIcon;
+    btn.style.border = '2px solid transparent';
+  });
+  btn.addEventListener('mousedown', () => {
+    img.src = aiOpenIcon;
+    btn.style.border = '2px solid #1e90ff';
+  });
+  btn.addEventListener('mouseup', () => {
+    img.src = aiOpenIcon;
+    btn.style.border = '2px solid #1e90ff';
   });
   return btn;
 }