Selaa lähdekoodia

Merge branch 'dev' into dev_zyh

zhouyuhao 5 kuukautta sitten
vanhempi
commit
1eef153464

+ 1 - 2
src/auto-imports.d.ts

@@ -3,7 +3,6 @@
 // @ts-nocheck
 // noinspection JSUnusedGlobalSymbols
 // Generated by unplugin-auto-import
-// biome-ignore lint: disable
 export {}
 declare global {
   const $api: typeof import('@/api/index')['default']
@@ -69,6 +68,6 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 5 - 2
src/components/AIRobot/src/AIRobot.vue

@@ -34,9 +34,12 @@ const AvatarMouseLeave = () => {
     AIRobotHoverVisible.value = false
   }
 }
-const emit = defineEmits(['AvatarClick', 'handelClickAIDefault'])
+const emit = defineEmits(['AvatarClick', 'handelClickAIDefault','handelclickaiinit'])
 // 点击AIRobot图标
 const AvatarClick = () => {
+  if(clicked.value == false) {
+    emit('handelclickaiinit')
+  }
   clicked.value = true
   AIRobotHoverVisible.value = false
   isShowDefault.value = false
@@ -59,7 +62,6 @@ const prepareGroups = () => {
   const groups = []
   let currentGroup = []
   let currentHeight = 0
-
   DeQuestions.value.forEach((item) => {
     const itemHeight = item.isLong ? 2 : 1
 
@@ -105,6 +107,7 @@ const Logout = () => {
   AIRobotHoverVisible.value = false
   isShowDefault.value = false
   isShowAIRobotTop.value = false
+  clicked.value = false
 }
 
 // 退出登录后隐藏icon

+ 7 - 5
src/components/ScoringGrade/src/ScoringGrade.vue

@@ -299,7 +299,7 @@ onMounted(() => {
       popper-class="popver_class"
     >
       <template #reference>
-        <el-avatar @click="avatarClick" :size="46" shape="square" :src="clickSrc" />
+        <el-avatar class="avatar_bg" @click="avatarClick" :size="46" shape="square" :src="clickSrc" />
       </template>
       <div class="score_flex">
         <el-popover
@@ -418,10 +418,12 @@ div.scoring {
   display: flex;
   align-items: center;
   justify-content: center;
-  img {
-    width: 36px;
-    height: 36px;
-    margin: 3px 0 0 4px;
+  .avatar_bg {
+    img {
+      width: 36px;
+      height: 36px;
+      margin: 3px 0 0 4px;
+    }
   }
 }
 .el-avatar {

+ 2 - 0
src/utils/axios.ts

@@ -2,6 +2,7 @@ import axios, { type AxiosInstance, type AxiosRequestConfig, type AxiosResponse
 import router from '@/router'
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { useUserStore } from '@/stores/modules/user'
+import emitter from '@/utils/bus'
 
 interface codeMessage {
   [key: number]: string
@@ -61,6 +62,7 @@ class HttpAxios {
           message: 'Please log in to use this feature.',
           grouping: true
         })
+        emitter.emit('login-out');
       } else if (response.data.code !== 200 && response.data.code !== 400) {
         ElMessageBox.alert(
           response.data?.data?.msg || 'The request failed. Please try again later',

+ 7 - 1
src/views/AIRobotChat/src/AIRobotChat.vue

@@ -334,11 +334,17 @@ const handleLiabilityExeDialog = () => {
   liabilityExeDialog.value = true
 }
 
+const handelclckaiinit = () => {
+  AIQuestion.value.AIRobotInit() 
+}
+
 defineExpose({
   handleSend,
   handleOpen,
-  clearData
+  clearData,
+  handelclckaiinit
 })
+
 </script>
 
 <template>

+ 5 - 1
src/views/Layout/src/LayoutView.vue

@@ -55,6 +55,10 @@ const getPrompt = () => {
     }
   })
 }
+
+const handelclickaiinit = () => {
+  AIRobotChatref.value?.handelclckaiinit()
+}
 onMounted(() => {
   getPrompt()
 })
@@ -87,7 +91,7 @@ onMounted(() => {
         <router-view />
       </el-main>
     </el-container>
-    <AIRobot @AvatarClick="AvatarClick" @handelClickAIDefault="handelClickAIDefault"></AIRobot>
+    <AIRobot @AvatarClick="AvatarClick" @handelClickAIDefault="handelClickAIDefault" @handelclickaiinit=handelclickaiinit></AIRobot>
     <AIRobotChat
       ref="AIRobotChatref"
       v-show="isShowAIRobotChat"