import { reactive } from "vue" import router from "@/router" /** 维护其他系统过来的特殊字段 这里用来记录,以免其他系统传过来的参数混乱 不好维护 */ export type queryParamsType = { hideFullScreen: boolean fromType: "PLATFORM" | "TEACHER" | "CLASS" instrumentId: string lessonCoursewareKnowledgeId: string } const queryParams = reactive({ hideFullScreen: false, // 隐藏预览时候的全屏按钮 fromType: "TEACHER", // 用于区分老师端 平台,或者学生端 lessonCoursewareKnowledgeId: "", // 课件id 老师端带过来查相关课件 instrumentId: "" // 传过来的乐器值,用于ppt里面云教练带什么乐器 }) export function initQueryParams() { const query = router.currentRoute.value.query queryParams.hideFullScreen = !!query.hideFullScreen query.fromType && (queryParams.fromType = query.fromType as any) query.lessonCoursewareKnowledgeId && (queryParams.lessonCoursewareKnowledgeId = query.lessonCoursewareKnowledgeId as any) query.instrumentId && (queryParams.instrumentId = query.instrumentId as any) console.log(queryParams, "携带参数") } export default queryParams