<!--
 * @Author: lixg lixg@dongwu-inc.com
 * @Date: 2022-11-24 16:39:48
 * @LastEditors: lixg lixg@dongwu-inc.com
 * @LastEditTime: 2022-11-29 18:31:34
 * @FilePath: /fe-manage/src/components/Modals/addOnlineCourse.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <!-- 新建在线课弹窗 -->
  <div>
    <a-modal
      :visible="addOnlineCoursevisible"
      :footer="null"
      :closable="false"
      wrapClassName="modalStyle addOnlineCourseStyle"
      :zIndex="9999"
      @cancel="closeModal"
    >
      <iframe
        id="iframe"
        style="width: 100%; height: 100%"
        :src="iframeUrl + '/course/manages'"
        name="myframe"
        sandbox="allow-forms allow-scripts allow-downloads allow-same-origin allow-popups"
      ></iframe>
    </a-modal>
  </div>
</template>

<script>
import { reactive, toRefs } from "vue";
// import {getTask} from "../../api/indexTaskadd"
// import dayjs from "dayjs";
// import {message} from "ant-design-vue"
import { iframeUrl } from "@/api/method";

export default {
  name: "addOnlineCourse",
  props: {
    addOnlineCoursevisible: {
      type: Boolean,
      default: false,
    },
    closeOnlineModal: {
      type: Function,
      default: () => {},
    },
  },
  setup(props, ctx) {
    // console.log("学习路径", props.addOnlineCoursevisible, ctx);
    const state = reactive({
      iframeUrl: iframeUrl,
    });
    const closeModal = () => {
      ctx.emit("update:addOnlineCoursevisible", false);
      props.closeOnlineModal();
    };
    return {
      ...toRefs(state),
      closeModal,
    };
  },
};
</script>

<style lang="scss" >
.addOnlineCourseStyle {
  .ant-modal {
    width: 80% !important;
  }
}
</style>