فهرست منبع

菜单修复:修复从菜单切换到报表样式激活未清除问题

dengshaobo 3 هفته پیش
والد
کامیت
2db814bd9e
2فایلهای تغییر یافته به همراه5 افزوده شده و 7 حذف شده
  1. 1 0
      src/views/exam/components/aside.vue
  2. 4 7
      src/views/exam/components/stepItem.vue

+ 1 - 0
src/views/exam/components/aside.vue

@@ -51,6 +51,7 @@ const GotoReport=()=>{
     return
   }
   isReportActive.value = true
+  analysisStore.setChildMenuPath('')//清空子菜单选中状态
   router.push('/exam/analysis/reportDownload')//跳转到批量下载报表页面
 }
 

+ 4 - 7
src/views/exam/components/stepItem.vue

@@ -34,13 +34,12 @@ import { ElMessage } from 'element-plus'
 
 const examStore = useExamStore()
 const analysisStore = useAnalysisStore()
-const getChildMenuPath = computed(() => analysisStore?.childMenuPath || '');
 // --- 响应式数据 ---
 const route = useRoute()//读取当前路由对象
 const router = useRouter()//访问全局路由方法
 
 const stepOnIndex = ref<number>(0)//步骤索引
-const childMenuPath = ref<string>(getChildMenuPath.value)//子级菜单路径
+const childMenuPath = computed(() => analysisStore?.childMenuPath || '')//子级菜单路径
 const menuListRaw = ref<any[]>([]) // 用于存储计算后的菜单列表,以便 watch 能检测到变化(如果需要)
 
 // --- 计算属性 ---
@@ -200,7 +199,7 @@ const MenuChange = (index: number, item: any) => {
     return
   }
   stepOnIndex.value = index
-  childMenuPath.value = ''
+  analysisStore.setChildMenuPath('')//清空子菜单选中状态
   emit('menuChange')
   router.push('/exam/'+item.path)
 }
@@ -213,8 +212,7 @@ const MenuSelect = (menu: any) => {
     return
   }
   stepOnIndex.value = 2;
-  childMenuPath.value = menu.path;
-  analysisStore.setChildMenuPath(menu.path);
+  analysisStore.setChildMenuPath(menu.path);//设置子级菜单选中状态
   emit('menuChange')
   // 执行路由跳转
   router.push(`/exam/analysis/${menu.path}`)
@@ -255,13 +253,12 @@ onMounted(async () => {
 <style lang="scss" scoped>
 .step_exam_item {
   position: relative;
-  height: 100%;
   .left_line {
     position: absolute;
     top: 0;
     left: 15.55px;
     z-index: 6;
-    height: 480px;
+    height: 100%;
     width: 0;
     border-left: 1px dashed #C0C4CC;
   }