import { reactive } from "vue"
import router from "@/router"

/** 维护其他系统过来的特殊字段  这里用来记录，以免其他系统传过来的参数混乱 不好维护 */
export type queryParamsType = {
  hideFullScreen: boolean
  fromType: "PLATFORM" | "TEACHER" | "CLASS"
}
const queryParams = reactive<queryParamsType>({
  hideFullScreen: false, // 隐藏预览时候的全屏按钮
  fromType: "TEACHER"
})

export function initQueryParams() {
  const query = router.currentRoute.value.query
  queryParams.hideFullScreen = !!query.hideFullScreen
  query.fromType && (queryParams.fromType = query.fromType as any)
}

export default queryParams
