Explorar o código

Merge branch 'dev' into dev_zyh

zhouyuhao hai 7 meses
pai
achega
8ecd2fa47b

+ 20 - 8
src/components/AIRobot/src/AIRobot.vue

@@ -142,6 +142,19 @@ const isShowLogin = () => {
   }, settimeouttime)
 }
 
+// 退出登录后隐藏icon
+const Logout = () => {
+  AIIconVisible.value = false
+  AIRobotHoverVisible.value = false
+  isShowDefault.value = false
+  isShowAIRobotTop.value = false
+}
+
+// 退出登录后隐藏icon
+const checknoPrompt = () => {
+  AIIconVisible.value = true
+}
+
 // 点击问题
 const handelClick = (item: any) => {
   emit('handelClickAIDefault', item.value)
@@ -154,10 +167,9 @@ const handelClick = (item: any) => {
 onMounted(() => {
   prepareGroups()
   emitter.on('login-success', isShowLogin)
-})
-
-onUnmounted(() => {
-  emitter.off('login-success', isShowLogin)
+  emitter.on('login-out', Logout)
+  emitter.on('checkPrompt', Logout)
+  emitter.on('checknoPrompt', checknoPrompt)
 })
 
 defineExpose({
@@ -168,7 +180,7 @@ defineExpose({
   <!-- 上方显示的弹窗 -->
   <div class="AIRobot-top" v-if="isShowDefault">
     <div class="flex_end" @click="HideAIRobotTop">
-      <div class="icon flex_center">
+      <div class="icon flex_center icon-AI">
         <span class="iconfont_icon icon_dark AI_icon">
           <svg class="iconfont" aria-hidden="true">
             <use xlink:href="#icon-icon_reject_b"></use>
@@ -210,7 +222,7 @@ defineExpose({
   </div>
   <div class="AIRobot-top" v-if="isShowAIRobotTop">
     <div class="flex_end" @click="HideAIRobotTopTwo">
-      <div class="icon flex_center">
+      <div class="icon flex_center icon-AI">
         <span class="iconfont_icon icon_dark AI_icon">
           <svg class="iconfont" aria-hidden="true">
             <use xlink:href="#icon-icon_reject_b"></use>
@@ -221,7 +233,7 @@ defineExpose({
     <div class="dialogue_title">Hi! I'm your Freight Assistant, always on call</div>
   </div>
   <!-- 悬浮icon -->
-  <div class="AIRobot flex_center">
+  <div class="AIRobot flex_center" v-if="AIIconVisible">
     <el-popover :visible="visible" placement="top-end" width="auto">
       <template #reference>
         <el-avatar
@@ -287,7 +299,7 @@ defineExpose({
   fill: var(--color-theme);
   cursor: pointer;
 }
-.icon {
+.icon-AI {
   width: 24px;
   height: 24px;
   background-color: var(--management-bg-color);

+ 17 - 2
src/components/ScoringGrade/src/ScoringGrade.vue

@@ -15,11 +15,13 @@ import happyPng2 from '../image/happy_2.png'
 import normalPng from '../image/score_normal.png'
 import submitsucessful from '../image/submit_successful.png'
 import { useUserStore } from '@/stores/modules/user'
+import emitter from '@/utils/bus'
 
 const userStore = useUserStore()
 
 // const isShow = ref(true)
 const visible = ref(false)
+const isShowScoring = ref(true)
 const isLoaded = ref(false)
 const isShowAngry = ref(false)
 const isShowHappy = ref(false)
@@ -273,9 +275,22 @@ const mouseout = (item: any) => {
   item.src = item.src1
 }
 const SubmitText = ref()
+
+// 切换隐藏icon
+const Logout = () => {
+  isShowScoring.value = false
+}
+// 切换隐藏icon
+const checknoPrompt = () => {
+  isShowScoring.value = true
+}
+onMounted(() => {
+  emitter.on('checkPrompt', Logout)
+  emitter.on('checknoPrompt', checknoPrompt)
+})
 </script>
 <template>
-  <div class="scoring">
+  <div class="scoring" v-if="isShowScoring">
     <el-popover
       :visible="visible"
       placement="left"
@@ -400,7 +415,7 @@ const SubmitText = ref()
   z-index: 2013;
   right: 20px;
   bottom: 80px;
-  display: none;
+  display: flex;
   align-items: center;
   justify-content: center;
 }

+ 2 - 0
src/views/Layout/src/components/Header/components/LogoutDialog.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import { useRouter } from 'vue-router'
+import emitter from '@/utils/bus'
 
 const router = useRouter()
 const dialogVisible = ref(false)
@@ -13,6 +14,7 @@ const handleLogout = () => {
   router.push('/login')
   sessionStorage.clear()
   localStorage.removeItem('user_type')
+  emitter.emit('login-out');
 }
 defineExpose({
   openDialog

+ 7 - 5
src/views/Layout/src/components/Menu/MenuView.vue

@@ -131,10 +131,15 @@ const isAllowJump = (path: any) => {
 router.afterEach(() => {
   activeMenu.value = (route.meta?.activeMenu as string) || route.path
 })
-const isVisible = ref(false)
-const emits = defineEmits(['changeVisible'])
+
 // 路由跳转函数
 const changeRouter = (path: any) => {
+  console.log(path)
+  if(path == '/PromptConfiguration') {
+    emitter.emit('checkPrompt');
+  } else {
+    emitter.emit('checknoPrompt');
+  }
   if (sessionStorage.getItem('searchTableQeury')) {
     sessionStorage.removeItem('searchTableQeury')
   }
@@ -152,9 +157,6 @@ const changeRouter = (path: any) => {
     localStorage.removeItem('loginAI')
     emitter.emit('login-success')
   }
-  isVisible.value = false
-  emits('changeVisible', isVisible.value)
-  isVisible.value = false
   let toPath = path
   if (path === '/tracking' && !userStore.userInfo?.uname) {
     toPath = '/public-tracking'