import { defineComponent, toRefs, ref, PropType, reactive, toRef } from 'vue'; import styles from './pen.module.less'; import { ToolType } from '../../index'; import { NButton, NModal, NSpace } from 'naive-ui'; import { iframeDislableKeyboard } from '/src/utils'; import useDrag from '@/hooks/useDrag'; import Dragbom from '@/hooks/useDrag/dragbom'; import { useUserStore } from '@/store/modules/users'; export default defineComponent({ name: 'pen-page', props: { show: { type: Boolean, default: false }, type: { type: String as PropType, default: 'pen' }, close: { type: Function, default: () => ({}) }, callStudents: { type: Array, default: () => [] }, imagePos: { type: String, default: 'left' }, isDrag: { type: Boolean, default: false } }, setup(props) { const { show, type } = toRefs(props); // const modelAttendStatus = ref(false); const penIframeRefId = `penIframeRef${+new Date()}`; const modal = reactive({ status: false, title: type.value === 'pen' ? '退出批注' : '退出白板', content: type.value === 'pen' ? '确认是否退出批注?' : '确认是否退出白板?' }); const firstRender = ref(true); const origin = /(localhost|192)/.test(location.host) ? 'https://test.lexiaoya.cn/' : // 'http://localhost:5002/' location.origin; let src = `${origin}/classroom-whiteboard?t=${+new Date()}`; if (props.type === 'call') { src = `${origin}/roll-call/index.html?t=${+new Date()}&platform=modal&imagePos=${ props.imagePos }`; } // 拖动 let penBoxDragData: any; let penBoxClass: string; if (props.isDrag) { const users = useUserStore(); penBoxClass = 'penBoxClass_drag'; penBoxDragData = useDrag( [`${penBoxClass}>.n-card-header`, `${penBoxClass} .bom_drag`], penBoxClass, toRef(modal, 'status'), users.info.id ); } return () => (
{props.type !== 'call' && (
(modal.status = true)}>
)} {/* 布置作业 */}

{modal.content}

{/*
{data.modalAttendMessage}
*/} { modal.status = false; }}> 取消 { // data.modelTrainStatus = true; modal.status = false; props.close(); }}> 确认 {props.isDrag && }
); } });