Bläddra i källkod

perf: 优化对话历史记录背景图片的展示

zhupei@smartai.com 1 år sedan
förälder
incheckning
40177ce23a
2 ändrade filer med 27 tillägg och 16 borttagningar
  1. 11 11
      src/modules/conversation-history/HistoryItem.vue
  2. 16 5
      src/views/ConversationHistory.vue

+ 11 - 11
src/modules/conversation-history/HistoryItem.vue

@@ -168,6 +168,17 @@ const handleDeleteSuccess = () => {
   color: var(--color-text-1);
 }
 
+.conversation-history-section-data:hover {
+  /* box-shadow: 0 0 5px var(--color-text-1); */
+  box-shadow: 0 0 5px var(--color-text-4);
+}
+.conversation-history-section-data:hover .history-item-time {
+  display: none;
+}
+.conversation-history-section-data:hover .history-item-delete {
+  display: inline-block;
+}
+
 .history-item-icon {
   width: 26px;
   height: 26px;
@@ -201,17 +212,6 @@ const handleDeleteSuccess = () => {
 .history-item-intro-desc {
 }
 
-.conversation-history-section-data:hover {
-  /* box-shadow: 0 0 5px var(--color-text-1); */
-  box-shadow: 0 0 5px var(--color-text-4);
-}
-.conversation-history-section-data:hover .history-item-time {
-  display: none;
-}
-.conversation-history-section-data:hover .history-item-delete {
-  display: inline-block;
-}
-
 .history-item-actions {
   min-width: 60px;
   flex-shrink: 0;

+ 16 - 5
src/views/ConversationHistory.vue

@@ -9,6 +9,7 @@
 </template>
 
 <script setup>
+import { computed } from 'vue';
 import { useRouter } from 'vue-router';
 
 import LayoutExperience from './layout/LayoutExperience.vue';
@@ -18,13 +19,23 @@ import ChatAsideMenu from './conversation/ChatAsideMenu.vue';
 
 import ConversationHistoryContainer from './conversation/ConversationHistoryContainer.vue';
 
+import { useThemeStore } from '../base/store/use-theme';
+
 const router = useRouter();
 
-const content_style = {
-  backgroundImage: 'url(../../../assets/chat/history-bg.png)',
-  backgroundRepeat: 'no-repeat',
-  backgroundSize: 'cover'
-};
+const theme = useThemeStore();
+
+const content_style = computed(() => {
+  if (theme.value === 'light') {
+    return {
+      backgroundImage: 'url(../../../assets/chat/history-bg.png)',
+      backgroundRepeat: 'no-repeat',
+      backgroundSize: 'cover'
+    };
+  } else {
+    return {};
+  }
+});
 
 const handleHistoryActive = ({ target_id, agent_id }) => {
   router.push({