Просмотр исходного кода

AI助手功能增加是否开放配置

cyy 2 дней назад
Родитель
Сommit
38f036b230

+ 7 - 2
src/layout/header-aside/components/components/ai-assistant/index.vue

@@ -2,6 +2,7 @@
   <div class="ai-assistant">
     <!-- 右下角悬浮图标 -->
     <div
+      v-if="showTF"
       class="ai-assistant__fab"
       :style="fabStyle"
       @mousedown.prevent="startDrag"
@@ -116,6 +117,7 @@
 
 <script>
 import { computed } from 'vue'
+import { getSetting } from '@/utils/query'
 
 export default {
   name: 'AiAssistant',
@@ -141,7 +143,8 @@ export default {
           content: '您好!我是金源信通助手,有什么可以帮您的?',
           time: this.formatTime()
         }
-      ]
+      ],
+      showTF: false
     }
   },
   computed: {
@@ -156,7 +159,9 @@ export default {
       }
     }
   },
-  mounted() {
+  async mounted() {
+    const { show } = await getSetting('assistantAI')
+    this.showTF = show || false
     this.$nextTick(() => {
       const vw = window.innerWidth
       const vh = window.innerHeight