|
@@ -25,14 +25,18 @@
|
|
|
import { ref, computed, onMounted, watch } from 'vue'
|
|
import { ref, computed, onMounted, watch } from 'vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import { useExamStore } from '@/store/exam'
|
|
import { useExamStore } from '@/store/exam'
|
|
|
|
|
+import { useAnalysisStore } from '@/store/analysis'
|
|
|
|
|
|
|
|
const examStore = useExamStore()
|
|
const examStore = useExamStore()
|
|
|
|
|
+const analysisStore = useAnalysisStore()
|
|
|
|
|
+const getChildMenuPath = computed(() => analysisStore?.childMenuPath || '');
|
|
|
|
|
+console.log(getChildMenuPath.value,2333)
|
|
|
// --- 响应式数据 ---
|
|
// --- 响应式数据 ---
|
|
|
const route = useRoute()//读取当前路由对象
|
|
const route = useRoute()//读取当前路由对象
|
|
|
const router = useRouter()//访问全局路由方法
|
|
const router = useRouter()//访问全局路由方法
|
|
|
|
|
|
|
|
const stepOnIndex = ref<number>(0)//步骤索引
|
|
const stepOnIndex = ref<number>(0)//步骤索引
|
|
|
-const childMenuPath = ref<string>('')//子级菜单路径
|
|
|
|
|
|
|
+const childMenuPath = ref<string>(getChildMenuPath.value)//子级菜单路径
|
|
|
const menuListRaw = ref<any[]>([]) // 用于存储计算后的菜单列表,以便 watch 能检测到变化(如果需要)
|
|
const menuListRaw = ref<any[]>([]) // 用于存储计算后的菜单列表,以便 watch 能检测到变化(如果需要)
|
|
|
|
|
|
|
|
// --- 计算属性 ---
|
|
// --- 计算属性 ---
|
|
@@ -184,6 +188,7 @@ const MenuSelect = (menu: any) => {
|
|
|
console.log('选择的子菜单', menu)
|
|
console.log('选择的子菜单', menu)
|
|
|
stepOnIndex.value = 2;
|
|
stepOnIndex.value = 2;
|
|
|
childMenuPath.value = menu.path;
|
|
childMenuPath.value = menu.path;
|
|
|
|
|
+ analysisStore.setChildMenuPath(menu.path);
|
|
|
// 执行路由跳转
|
|
// 执行路由跳转
|
|
|
router.push(`/exam/analysis/${menu.path}`)
|
|
router.push(`/exam/analysis/${menu.path}`)
|
|
|
}
|
|
}
|