Quellcode durchsuchen

Merge branch 'master' of http://gitlab.smartai.com/zhupei/smartai2dian0

张涛 vor 1 Jahr
Ursprung
Commit
118596196d
3 geänderte Dateien mit 55 neuen und 17 gelöschten Zeilen
  1. 28 1
      src/App.vue
  2. 11 11
      src/modules/conversation-history/HistoryItem.vue
  3. 16 5
      src/views/ConversationHistory.vue

+ 28 - 1
src/App.vue

@@ -1,3 +1,30 @@
 <template>
-  <router-view />
+  <a-config-provider :locale="locale">
+    <router-view />
+  </a-config-provider>
 </template>
+
+<script setup>
+import { ref, computed } from 'vue';
+import { useLocaleStore } from './base/store/use-locale';
+
+/**
+ * @see https://arco.design/vue/component/config-provider
+ */
+import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
+import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
+
+const locales = {
+  zh: zhCN,
+  en: enUS
+};
+
+const localStore = useLocaleStore();
+
+/**
+ * 多语言
+ */
+const locale = computed(() => {
+  return locales[localStore.value] || zhCN;
+});
+</script>

+ 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({