Forráskód Böngészése

Merge branch 'dev' of http://git.dayaedu.com/huangqiyong/classroom into staging

黄琪勇 9 hónapja
szülő
commit
28ee4631e6

+ 6 - 0
src/assets/elementTheme.scss

@@ -51,3 +51,9 @@
       }
    }
 }
+
+// 下拉选择框 给最大高度,高度自适应
+.el-cascader-panel .el-cascader-menu__wrap.el-scrollbar__wrap {
+   height: 100%;
+   max-height: 204px;
+}

+ 7 - 1
src/views/cloudTextbooks/cloudTextbooks.vue

@@ -11,7 +11,7 @@
                <dictionary
                   v-if="albumOpt.length > 1"
                   class="albumOpt"
-                  :popper-class="'classTypePopper'"
+                  :popper-class="'classTypePopperAlbum'"
                   v-model="albumId"
                   :width="200"
                   :height="40"
@@ -313,4 +313,10 @@ function handleClick(id: string) {
       min-width: auto;
    }
 }
+.classTypePopperAlbum.el-cascader__dropdown.el-popper {
+   .el-cascader-menu {
+      width: 200px;
+      min-width: auto;
+   }
+}
 </style>

+ 2 - 0
src/views/coursewarePlay/components/practiceForm/index.ts

@@ -0,0 +1,2 @@
+import practiceForm from "./practiceForm.vue"
+export default practiceForm

+ 54 - 0
src/views/coursewarePlay/components/practiceForm/practiceForm.vue

@@ -0,0 +1,54 @@
+<!--
+* @FileDescription: 去练习 弹窗
+* @Author: 黄琪勇
+* @Date:2024-09-05 19:13:16
+-->
+<template>
+   <el-dialog modal-class="practiceFormClass" class="practiceForm" v-bind="$attrs" :fullscreen="true" :show-close="false">
+      <iframe v-if="practiceUrl" class="penIframe" frameborder="0" :src="practiceUrl"></iframe>
+   </el-dialog>
+</template>
+
+<script setup lang="ts">
+import { onUnmounted } from "vue"
+defineProps<{
+   practiceUrl: string
+}>()
+const emits = defineEmits<{
+   (e: "close"): void
+}>()
+
+// 监听iframe传来的关闭弹窗事件
+window.addEventListener("message", messageClose)
+function messageClose(event: MessageEvent<any>) {
+   const { api } = event.data
+   if (api === "api_YjtClose") {
+      emits("close")
+   }
+}
+onUnmounted(() => {
+   window.removeEventListener("message", messageClose)
+})
+</script>
+<style lang="scss">
+.practiceForm.el-dialog {
+   padding: 0;
+   background-color: initial;
+   .el-dialog__header {
+      padding: 0;
+   }
+   .el-dialog__body {
+      width: 100%;
+      height: 100%;
+      background-color: #fff;
+      .penIframe {
+         display: block;
+         width: 100%;
+         height: 100%;
+      }
+   }
+}
+.practiceFormClass.el-overlay {
+   background-color: initial;
+}
+</style>

+ 11 - 1
src/views/coursewarePlay/coursewarePlay.vue

@@ -114,6 +114,7 @@
          "
          v-model="whitePenShow"
       />
+      <practiceForm v-model="isPracticeShow" :practiceUrl="practiceUrl" @close="handlePracticeClose" />
    </div>
 </template>
 
@@ -129,6 +130,7 @@ import { ElMessageBox } from "element-plus"
 import courseCollapse from "./components/courseCollapse"
 import pen from "./components/pen"
 import playRecordTime from "./components/playRecordTime"
+import practiceForm from "./components/practiceForm"
 import useDialogConfirm from "@/hooks/useDialogConfirm"
 import { getRecentCourseSchedule_gym } from "@/api/homePage.api"
 import { getToken } from "@/libs/auth"
@@ -403,6 +405,8 @@ const activeCoursewareResourceId = computed<string | undefined>(() => {
    const materialRefs = activeCourseware.value?.materialRefs
    return materialRefs ? (["GYM", "KLX"].includes(userStoreHook.roles!) ? materialRefs[0]?.resourceIdStr : materialRefs[0]?.resourceId) : undefined
 })
+const isPracticeShow = ref(false)
+const practiceUrl = ref("")
 function handleGoPracticeBtn(activeCoursewareResourceId: string) {
    //  GYM,GYT,KLX 区分   云教练
    const urlObj = {
@@ -410,7 +414,13 @@ function handleGoPracticeBtn(activeCoursewareResourceId: string) {
       GYM: `${URL_TEACH_GYM}#/detail/${activeCoursewareResourceId}?Authorization=${getToken()}&platform=web&liveConfig=1&isYjt=1`,
       KLX: `${URL_TEACH_KLX}??Authorization=${getToken()}&id=${activeCoursewareResourceId}&limitModel=practice&isYjt=1`
    }
-   window.open(urlObj[userStoreHook.roles!], "_blank")
+   isPracticeShow.value = true
+   practiceUrl.value = urlObj[userStoreHook.roles!]
+   //window.open(urlObj[userStoreHook.roles!], "_blank")
+}
+function handlePracticeClose() {
+   isPracticeShow.value = false
+   practiceUrl.value = ""
 }
 </script>