index.tsx 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  1. import {
  2. Transition,
  3. defineComponent,
  4. onMounted,
  5. ref,
  6. reactive,
  7. onUnmounted,
  8. watch,
  9. computed
  10. } from 'vue';
  11. import LayoutSilder from './layoutSilder';
  12. import LayoutTop from './layoutTop';
  13. import styles from './index.module.less';
  14. import { NButton, NImage, NModal, NPopover, NSpace, useDialog } from 'naive-ui';
  15. import Moveable from 'moveable';
  16. import toolStartClass from './images/toolStartClass.png';
  17. import toolbox from './images/toolbox.png';
  18. import setTimeIcon from './images/setTimeIcon.png';
  19. import beatIcon from './images/beatIcon.png';
  20. import toneIcon from './images/toneIcon.png';
  21. import iconWhiteBorad from './images/icon-whiteborad.png';
  22. import iconPen from './images/icon-pen.png';
  23. import iconNote from './images/icon-note.png';
  24. import beatImage from './images/beatImage.png';
  25. import toneImage from './images/toneImage.png';
  26. import setTimeImage from './images/setTimeImage.png';
  27. import dragingBoxIcon from './images/dragingBoxIcon.png';
  28. import TimerMeter from '../timerMeter';
  29. import { useRoute, useRouter } from 'vue-router';
  30. import { vaildUrl } from '/src/utils/urlUtils';
  31. import ChioseModal from '/src/views/home/modals/chioseModal';
  32. import { eventGlobal, px2vw, px2vwH } from '@/utils/index';
  33. import PlaceholderTone from './modals/placeholderTone';
  34. import { state } from '/src/state';
  35. import PreviewWindow from '/src/views/preview-window';
  36. import { fscreen } from '@/utils/index';
  37. import AttendClass from '/src/views/prepare-lessons/model/attend-class';
  38. import Pen from '/src/views/attend-class/component/tools/pen';
  39. import study from '/src/views/home/components/study';
  40. export default defineComponent({
  41. name: 'layoutView',
  42. setup() {
  43. const router = useRouter();
  44. const previewModal = ref(false);
  45. const previewItem = ref({});
  46. const directionType = ref('left');
  47. const showClass = ref(false);
  48. const showModalBeat = ref(false);
  49. const showModalTone = ref(false);
  50. const showModalTime = ref(false);
  51. const showBoxConent = ref(false);
  52. const dialog = useDialog();
  53. const boxBoundaryInfo = reactive({
  54. isBoundary: false,
  55. isBoundaryType: '' as any,
  56. mainWidth: '' as any,
  57. mainHeight: '' as any,
  58. subWidth: '' as any,
  59. subHeight: '' as any
  60. });
  61. const classBoundaryInfo = reactive({
  62. isBoundary: true,
  63. isBoundaryType: 'right' as any,
  64. mainWidth: '' as any,
  65. mainHeight: '' as any,
  66. subWidth: '' as any,
  67. subHeight: '' as any
  68. });
  69. const route = useRoute();
  70. const isDragIng = ref(false);
  71. const NPopoverRef = ref();
  72. const initMoveable = async () => {
  73. if (document.querySelector('.wrap')) {
  74. const moveable = new Moveable(document.querySelector('.wrap') as any, {
  75. target: document.querySelector('#moveNPopover') as any,
  76. // If the container is null, the position is fixed. (default: parentElement(document.body))
  77. container: document.querySelector('.wrap') as any,
  78. // snappable: true,
  79. // bounds: {"left":100,"top":100,"right":100,"bottom":100},
  80. draggable: true,
  81. resizable: false,
  82. scalable: false,
  83. rotatable: false,
  84. warpable: false,
  85. pinchable: false, // ["resizable", "scalable", "rotatable"]
  86. origin: false,
  87. keepRatio: false,
  88. // Resize, Scale Events at edges.
  89. edge: false,
  90. throttleDrag: 0,
  91. throttleResize: 0,
  92. throttleScale: 0,
  93. throttleRotate: 0
  94. });
  95. moveable
  96. // .on('dragStart', ({ target, clientX, clientY }) => {
  97. // console.log('dragStart');
  98. // })
  99. .on(
  100. 'drag',
  101. ({
  102. target,
  103. // transform,
  104. left,
  105. top,
  106. right,
  107. bottom
  108. // beforeDelta,
  109. // beforeDist,
  110. // delta,
  111. // dist,
  112. // clientX,
  113. // clientY
  114. }) => {
  115. isDragIng.value = true;
  116. if (NPopoverRef.value) {
  117. NPopoverRef.value.setShow(false);
  118. }
  119. const subdEl = document.getElementById(
  120. `moveNPopover`
  121. ) as HTMLDivElement;
  122. // console.log(subdEl, "subdEl", "drag");
  123. const subdElStyle = getComputedStyle(subdEl, null);
  124. const RectInfo = {
  125. left: Number(subdElStyle.left.replace('px', '')),
  126. top: Number(subdElStyle.top.replace('px', '')),
  127. width: Number(subdElStyle.width.replace('px', '')),
  128. height: Number(subdElStyle.height.replace('px', ''))
  129. };
  130. // target.style.transition = ''
  131. const mainWidth =
  132. parseInt(
  133. window.getComputedStyle(
  134. document.querySelector('.wrap') as Element
  135. ).width
  136. ) - RectInfo.width;
  137. const mainHeight =
  138. parseInt(
  139. window.getComputedStyle(
  140. document.querySelector('.wrap') as Element
  141. ).height
  142. ) - RectInfo.height;
  143. subdEl.style.transition = '';
  144. boxBoundaryInfo.isBoundary = false;
  145. boxBoundaryInfo.isBoundaryType = '';
  146. boxBoundaryInfo.mainHeight = mainHeight;
  147. boxBoundaryInfo.mainWidth = mainWidth;
  148. boxBoundaryInfo.subWidth = RectInfo.width;
  149. boxBoundaryInfo.subHeight = RectInfo.height;
  150. if (left < 0) {
  151. left = 2;
  152. boxBoundaryInfo.isBoundary = true;
  153. boxBoundaryInfo.isBoundaryType = 'left';
  154. }
  155. if (top < 0) {
  156. top = 2;
  157. boxBoundaryInfo.isBoundary = true;
  158. boxBoundaryInfo.isBoundaryType = 'top';
  159. }
  160. if (right < 0) {
  161. right = 2;
  162. }
  163. if (bottom < 0) {
  164. bottom = 2;
  165. }
  166. if (left > mainWidth - 2) {
  167. left = mainWidth - 2;
  168. // top = 2;
  169. boxBoundaryInfo.isBoundary = true;
  170. boxBoundaryInfo.isBoundaryType = 'right';
  171. }
  172. if (top > mainHeight - 2) {
  173. top = mainHeight - 2;
  174. boxBoundaryInfo.isBoundary = true;
  175. boxBoundaryInfo.isBoundaryType = 'bottom';
  176. }
  177. target!.style.left = `${left}px`;
  178. target!.style.top = `${top}px`;
  179. }
  180. )
  181. .on(
  182. 'dragEnd',
  183. async ({
  184. target,
  185. // isDrag,
  186. clientX
  187. // clientY
  188. }) => {
  189. if (document.body.clientWidth / 2 - clientX > 0) {
  190. // 往左出
  191. directionType.value = 'right';
  192. } else {
  193. // 往又出
  194. directionType.value = 'left';
  195. }
  196. isDragIng.value = false;
  197. // 在这里进行动画
  198. if (boxBoundaryInfo.isBoundary) {
  199. // 这里说明贴边了
  200. target.style.transition = '.3s';
  201. actionEnd(target, boxBoundaryInfo.isBoundaryType);
  202. }
  203. }
  204. );
  205. }
  206. };
  207. const initMoveableClass = async () => {
  208. if (document.querySelector('.wrap')) {
  209. const moveable = new Moveable(document.querySelector('.wrap') as any, {
  210. target: document.querySelector('#moveNPopover2') as any,
  211. // If the container is null, the position is fixed. (default: parentElement(document.body))
  212. container: document.querySelector('.wrap') as any,
  213. // snappable: true,
  214. // bounds: {"left":100,"top":100,"right":100,"bottom":100},
  215. draggable: true,
  216. resizable: false,
  217. scalable: false,
  218. rotatable: false,
  219. warpable: false,
  220. pinchable: false, // ["resizable", "scalable", "rotatable"]
  221. origin: false,
  222. keepRatio: false,
  223. // Resize, Scale Events at edges.
  224. edge: false,
  225. throttleDrag: 0,
  226. throttleResize: 0,
  227. throttleScale: 0,
  228. throttleRotate: 0
  229. });
  230. moveable
  231. .on(
  232. 'drag',
  233. ({
  234. target,
  235. // transform,
  236. left,
  237. top,
  238. right,
  239. bottom
  240. }) => {
  241. isDragIng.value = true;
  242. const subdEl = document.getElementById(
  243. `moveNPopover2`
  244. ) as HTMLDivElement;
  245. // console.log(subdEl, "subdEl", "drag");
  246. const subdElStyle = getComputedStyle(subdEl, null);
  247. const RectInfo = {
  248. left: Number(subdElStyle.left.replace('px', '')),
  249. top: Number(subdElStyle.top.replace('px', '')),
  250. width: Number(subdElStyle.width.replace('px', '')),
  251. height: Number(subdElStyle.height.replace('px', ''))
  252. };
  253. const mainWidth =
  254. parseInt(
  255. window.getComputedStyle(
  256. document.querySelector('.wrap') as Element
  257. ).width
  258. ) - RectInfo.width;
  259. const mainHeight =
  260. parseInt(
  261. window.getComputedStyle(
  262. document.querySelector('.wrap') as Element
  263. ).height
  264. ) - RectInfo.height;
  265. subdEl.style.transition = '';
  266. classBoundaryInfo.isBoundary = false;
  267. classBoundaryInfo.isBoundaryType = '';
  268. classBoundaryInfo.mainHeight = mainHeight;
  269. classBoundaryInfo.mainWidth = mainWidth;
  270. classBoundaryInfo.subWidth = RectInfo.width;
  271. classBoundaryInfo.subHeight = RectInfo.height;
  272. if (left < 0) {
  273. left = 2;
  274. classBoundaryInfo.isBoundary = true;
  275. classBoundaryInfo.isBoundaryType = 'left';
  276. }
  277. if (top < 0) {
  278. top = 2;
  279. classBoundaryInfo.isBoundary = true;
  280. classBoundaryInfo.isBoundaryType = 'top';
  281. }
  282. if (right < 0) {
  283. right = 2;
  284. }
  285. if (bottom < 0) {
  286. bottom = 2;
  287. }
  288. if (left > mainWidth - 2) {
  289. left = mainWidth - 2;
  290. // top = 2;
  291. classBoundaryInfo.isBoundary = true;
  292. classBoundaryInfo.isBoundaryType = 'right';
  293. }
  294. if (top > mainHeight - 2) {
  295. top = mainHeight - 2;
  296. classBoundaryInfo.isBoundary = true;
  297. classBoundaryInfo.isBoundaryType = 'bottom';
  298. }
  299. target!.style.left = `${left}px`;
  300. target!.style.top = `${top}px`;
  301. }
  302. )
  303. .on(
  304. 'dragEnd',
  305. async ({
  306. target,
  307. // isDrag,
  308. clientX
  309. // clientY
  310. }) => {
  311. if (document.body.clientWidth / 2 - clientX > 0) {
  312. // 往左出
  313. directionType.value = 'right';
  314. } else {
  315. // 往又出
  316. directionType.value = 'left';
  317. }
  318. if (classBoundaryInfo.isBoundary) {
  319. // 这里说明贴边了
  320. target.style.transition = '.3s';
  321. actionEnd(target, classBoundaryInfo.isBoundaryType);
  322. }
  323. isDragIng.value = false;
  324. }
  325. )
  326. .on('click', () => {
  327. showClass.value = true;
  328. });
  329. }
  330. };
  331. watch(
  332. () => route.path,
  333. (val: any) => {
  334. const elDoc = document.getElementById('WrapcoreViewWrap') as any;
  335. if (elDoc) {
  336. elDoc.scrollTo(0, 0);
  337. window.scrollTo(0, 0);
  338. }
  339. }
  340. );
  341. // 帮助指引状态
  342. const helpNoteList = reactive({
  343. baseListTab: ''
  344. });
  345. const helpNoteStatus = computed(() => {
  346. const routePath = route.path;
  347. const hidePath = [
  348. '/classDetail',
  349. '/classStudentDetail',
  350. '/notation',
  351. '/xiaoku-ai',
  352. '/classStudentRecode',
  353. '/afterWorkDetail'
  354. ];
  355. // 单独判断个人信息页面[学校设置]有引导
  356. if (route.path === '/setting') {
  357. return helpNoteList.baseListTab === 'school' ? true : false;
  358. } else {
  359. return hidePath.includes(routePath) ? false : true;
  360. }
  361. });
  362. const startClassStatus = computed(() => {
  363. const routePath = route.path;
  364. console.log(routePath, 'routePath', routePath);
  365. const hidePath = ['/prepare-lessons'];
  366. return hidePath.includes(routePath) ? false : true;
  367. });
  368. onMounted(() => {
  369. initMoveable();
  370. // // initMoveableClass();
  371. const subdEl = document.getElementById(`moveNPopover`) as HTMLDivElement;
  372. // // const classEl = document.getElementById(
  373. // // `moveNPopover2`
  374. // // ) as HTMLDivElement;
  375. // // initBoxRectInfo(classEl, classBoundaryInfo);
  376. initBoundaryWrap(subdEl, boxBoundaryInfo);
  377. initBoxRectInfo(subdEl, boxBoundaryInfo);
  378. // // initBoundaryWrap(classEl, classBoundaryInfo);
  379. window.addEventListener('resize', resetSize);
  380. eventGlobal.on('base-setting-emit', (val: string) => {
  381. helpNoteList.baseListTab = val;
  382. });
  383. });
  384. const resetSize = () => {
  385. const subdEl = document.getElementById(`moveNPopover`) as HTMLDivElement;
  386. subdEl.style.display = 'none';
  387. // const boxBoundaryInfo = reactive({
  388. // isBoundary: true,
  389. // isBoundaryType: 'right' as any,
  390. // mainWidth: '' as any,
  391. // mainHeight: '' as any,
  392. // subWidth: '' as any,
  393. // subHeight: '' as any
  394. // });
  395. // boxBoundaryInfo.isBoundary = true;
  396. // boxBoundaryInfo.isBoundaryType= 'right'
  397. if (NPopoverRef.value) {
  398. NPopoverRef.value.setShow(false);
  399. }
  400. setTimeout(() => {
  401. subdEl.style.transition = '';
  402. initBoxRectInfo(subdEl, boxBoundaryInfo);
  403. initBoundaryWrap(subdEl, boxBoundaryInfo);
  404. console.log('resize');
  405. subdEl.style.display = 'block';
  406. }, 100);
  407. };
  408. onUnmounted(() => {
  409. window.removeEventListener('resize', resetSize);
  410. });
  411. const initBoundaryWrap = (target: any, wrapInfo: any) => {
  412. target.addEventListener('mouseover', () => {
  413. if (wrapInfo.isBoundary) {
  414. // 如果在边框 就得还原 元素位置 还原完毕后 去除transition
  415. if (wrapInfo.isBoundaryType == 'left') {
  416. target.style.left = '2px';
  417. } else if (wrapInfo.isBoundaryType == 'right') {
  418. target.style.left = `${wrapInfo.mainWidth - 2}px`;
  419. } else if (wrapInfo.isBoundaryType == 'top') {
  420. target.style.top = `${2}px`;
  421. } else if (wrapInfo.isBoundaryType == 'bottom') {
  422. target.style.top = `${wrapInfo.mainHeight - 2}px`;
  423. }
  424. }
  425. rate(target, 0);
  426. });
  427. target.addEventListener('mouseout', () => {
  428. if (wrapInfo.isBoundary) {
  429. // 如果在边框 就得还原 元素位置 还原完毕后 去除transition
  430. if (wrapInfo.isBoundaryType == 'left') {
  431. actionEnd(target, 'left');
  432. } else if (wrapInfo.isBoundaryType == 'right') {
  433. actionEnd(target, 'right');
  434. } else if (wrapInfo.isBoundaryType == 'top') {
  435. actionEnd(target, 'top');
  436. } else if (wrapInfo.isBoundaryType == 'bottom') {
  437. actionEnd(target, 'bottom');
  438. }
  439. }
  440. // rate(target, 0)
  441. });
  442. // target.addEventListener('contextmenu', (event: any) => {
  443. // event.preventDefault();
  444. // dialog.warning({
  445. // title: '提示',
  446. // content: '是否收入托盘',
  447. // positiveText: '确定',
  448. // negativeText: '取消',
  449. // onPositiveClick: () => {
  450. // console.log('确定');
  451. // },
  452. // onNegativeClick: () => {
  453. // console.log('取消');
  454. // }
  455. // });
  456. // });
  457. // actionEnd(target, 'right');
  458. };
  459. const startShowModal = (
  460. val:
  461. | 'setTimeIcon'
  462. | 'beatIcon'
  463. | 'toneIcon'
  464. | 'iconWhiteBorad'
  465. | 'iconPen'
  466. | 'iconNote'
  467. ) => {
  468. if (val == 'setTimeIcon') {
  469. showModalTime.value = true;
  470. }
  471. if (val == 'beatIcon') {
  472. showModalBeat.value = true;
  473. }
  474. if (val == 'toneIcon') {
  475. showModalTone.value = true;
  476. }
  477. if (val == 'iconNote') {
  478. if (NPopoverRef.value) {
  479. NPopoverRef.value.setShow(false);
  480. }
  481. console.log(route.name, 'guideInfo');
  482. eventGlobal.emit('teacher-guideInfo', route.name);
  483. }
  484. if (val == 'iconWhiteBorad') {
  485. studyData.whiteboardShow = true;
  486. studyData.type = 'whiteboard';
  487. studyData.homeStatus = false;
  488. if (NPopoverRef.value) {
  489. NPopoverRef.value.setShow(false);
  490. }
  491. }
  492. if (val == 'iconPen') {
  493. studyData.penShow = true;
  494. studyData.type = 'pen';
  495. studyData.homeStatus = false;
  496. if (NPopoverRef.value) {
  497. NPopoverRef.value.setShow(false);
  498. }
  499. }
  500. };
  501. // const moveTargetBoundary = (target: any, type: any) => {
  502. // console.log('moveTargetBoundary', target, type);
  503. // };
  504. // 这里是旋转
  505. const rate = (target: any, rate: any) => {
  506. target.style.transform = ' rotate(' + rate + ')';
  507. };
  508. // 这里是选装的方式
  509. const actionEnd = (target: any, type: any) => {
  510. switch (type) {
  511. case 'left':
  512. rate(target, '90deg');
  513. target!.style.left = `${2 - boxBoundaryInfo.subWidth / 2}px`;
  514. target!.style.top = `${top}px`;
  515. break;
  516. case 'right':
  517. rate(target, '-90deg');
  518. target!.style.left = `${
  519. boxBoundaryInfo.mainWidth - 2 + boxBoundaryInfo.subWidth / 2
  520. }px`;
  521. target!.style.top = `${top}px`;
  522. break;
  523. case 'top':
  524. target!.style.top = `${2 - boxBoundaryInfo.subHeight / 2}px`;
  525. rate(target, '-180deg');
  526. break;
  527. case 'bottom':
  528. target!.style.top = `${
  529. boxBoundaryInfo.mainHeight - 2 + boxBoundaryInfo.subHeight / 2
  530. }px`;
  531. break;
  532. default:
  533. rate(target, '-0');
  534. break;
  535. }
  536. };
  537. const initBoxRectInfo = (target: any, wrapInfo: any) => {
  538. // const subdEl = document.getElementById(`moveNPopover`) as HTMLDivElement;
  539. // console.log(subdEl, "subdEl", "drag");
  540. const subdElStyle = getComputedStyle(target, null);
  541. const RectInfo = {
  542. left: Number(subdElStyle.left.replace('px', '')),
  543. top: Number(subdElStyle.top.replace('px', '')),
  544. width: Number(subdElStyle.width.replace('px', '')),
  545. height: Number(subdElStyle.height.replace('px', ''))
  546. };
  547. // target.style.transition = ''
  548. const mainWidth =
  549. parseInt(
  550. window.getComputedStyle(document.querySelector('.wrap') as Element)
  551. .width
  552. ) - RectInfo.width;
  553. const mainHeight =
  554. parseInt(
  555. window.getComputedStyle(document.querySelector('.wrap') as Element)
  556. .height
  557. ) - RectInfo.height;
  558. // boxBoundaryInfo.isBoundary = false;
  559. // boxBoundaryInfo.isBoundaryType = '';
  560. wrapInfo.mainHeight = mainHeight;
  561. wrapInfo.mainWidth = mainWidth;
  562. wrapInfo.subWidth = RectInfo.width;
  563. wrapInfo.subHeight = RectInfo.height;
  564. target.style.transition = '.3s .3s';
  565. };
  566. /** 教学数据 */
  567. const studyData = reactive({
  568. homeStatus: true, // 是否显示首页
  569. type: '',
  570. penShow: false,
  571. whiteboardShow: false
  572. });
  573. return () => (
  574. <div class={[styles.wrap, 'wrap']}>
  575. <div>
  576. <LayoutSilder></LayoutSilder>
  577. </div>
  578. <div class={styles.Wrapcore}>
  579. <LayoutTop></LayoutTop>
  580. <div class={styles.WrapcoreView} id="WrapcoreViewWrap">
  581. {/* <div class={styles.WrapcoreViewInfo}> */}
  582. <router-view>
  583. {(obj: any) => (
  584. <Transition name="fade-slide" mode="out-in">
  585. <obj.Component />
  586. </Transition>
  587. )}
  588. </router-view>
  589. {/* </div> */}
  590. </div>
  591. </div>
  592. {/* <img
  593. src={toolStartClass}
  594. id="moveNPopover2"
  595. style={{
  596. display: ['/', '/home', '/classList', '/prepare-lessons'].includes(
  597. route.path
  598. )
  599. ? 'none'
  600. : 'block'
  601. }}
  602. class={[
  603. styles.toolClassImg,
  604. 'moveNPopover2',
  605. isDragIng.value ? styles.isDragIng : ''
  606. ]}
  607. alt=""
  608. /> */}
  609. <NPopover
  610. raw
  611. trigger="click"
  612. ref={NPopoverRef}
  613. show-arrow={false}
  614. placement={directionType.value as 'left' | 'right'}
  615. v-slots={{
  616. trigger: () => (
  617. // 首页不显示工具箱 ['/', '/home'].includes(route.path) ||
  618. <img
  619. // src={isDragIng.value ? dragingBoxIcon : toolbox}
  620. src={toolbox}
  621. id="moveNPopover"
  622. style={{
  623. display: !studyData.homeStatus ? 'none' : 'block'
  624. }}
  625. class={[
  626. styles.toolboxImg,
  627. 'moveNPopover',
  628. isDragIng.value ? styles.isDragIng : ''
  629. ]}
  630. alt=""
  631. />
  632. )
  633. }}>
  634. <div class={styles.booxToolWrap}>
  635. <div>
  636. <div
  637. class={styles.booxToolItem}
  638. onClick={() => startShowModal('beatIcon')}>
  639. <img src={beatIcon} alt="" />
  640. 节拍器
  641. </div>
  642. <div
  643. class={styles.booxToolItem}
  644. onClick={() => startShowModal('toneIcon')}>
  645. <img src={toneIcon} alt="" />
  646. 调音器
  647. </div>
  648. <div
  649. class={styles.booxToolItem}
  650. onClick={() => startShowModal('setTimeIcon')}>
  651. <img src={setTimeIcon} alt="" />
  652. 计时器
  653. </div>
  654. <div
  655. class={[
  656. styles.booxToolItem,
  657. !startClassStatus.value && styles.booxToolDisabled
  658. ]}
  659. onClick={() => {
  660. if (!startClassStatus.value) return;
  661. showClass.value = true;
  662. }}>
  663. <img
  664. src={toolStartClass}
  665. class={[styles.toolClassImg]}
  666. alt=""
  667. />
  668. 开始上课
  669. </div>
  670. </div>
  671. <div>
  672. <div
  673. class={[
  674. styles.booxToolItem,
  675. !helpNoteStatus.value && styles.booxToolDisabled
  676. ]}
  677. onClick={() => {
  678. if (!helpNoteStatus.value) return;
  679. startShowModal('iconNote');
  680. }}>
  681. <img src={iconNote} alt="" />
  682. 帮助指引
  683. </div>
  684. <div
  685. class={styles.booxToolItem}
  686. onClick={() => startShowModal('iconPen')}>
  687. <img src={iconWhiteBorad} alt="" />
  688. 批注
  689. </div>
  690. <div
  691. class={styles.booxToolItem}
  692. onClick={() => startShowModal('iconWhiteBorad')}>
  693. <img src={iconPen} alt="" />
  694. 白板
  695. </div>
  696. </div>
  697. </div>
  698. </NPopover>
  699. {/* 批注 */}
  700. {studyData.penShow && (
  701. <Pen
  702. show={studyData.type === 'pen'}
  703. type={studyData.type as any}
  704. close={() => {
  705. studyData.type = 'init';
  706. studyData.homeStatus = true;
  707. }}
  708. />
  709. )}
  710. {studyData.whiteboardShow && (
  711. <Pen
  712. show={studyData.type === 'whiteboard'}
  713. type={studyData.type as any}
  714. close={() => {
  715. studyData.type = 'init';
  716. studyData.homeStatus = true;
  717. }}
  718. />
  719. )}
  720. <NModal
  721. class={['modalTitle background']}
  722. style={{ width: '687px' }}
  723. title={'节拍器'}
  724. preset="card"
  725. v-model:show={showModalBeat.value}>
  726. <div class={styles.modeWrap}>
  727. <iframe
  728. src={`${vaildUrl()}/metronome/?id=${new Date().getTime()}`}
  729. scrolling="no"
  730. frameborder="0"
  731. width="100%"
  732. height={'650px'}></iframe>
  733. </div>
  734. </NModal>
  735. <NModal v-model:show={showModalTone.value} class={['background']}>
  736. {/* <div
  737. onClick={() => {
  738. showModalTone.value = false;
  739. }}>
  740. <NImage
  741. src={toneImage}
  742. previewDisabled
  743. class={styles.beatImage}></NImage>
  744. </div> */}
  745. <div>
  746. <PlaceholderTone
  747. onClose={() => {
  748. showModalTone.value = false;
  749. }}></PlaceholderTone>
  750. </div>
  751. </NModal>
  752. <NModal
  753. v-model:show={showModalTime.value}
  754. class={['modalTitle background']}
  755. title={'计时器'}
  756. preset="card"
  757. style={{ width: px2vw(772) }}>
  758. <div>
  759. <TimerMeter></TimerMeter>
  760. </div>
  761. </NModal>
  762. <NModal
  763. v-model:show={showClass.value}
  764. class={['modalTitle background', styles.showClass]}
  765. preset="card"
  766. title={'开始上课'}>
  767. <AttendClass
  768. onClose={() => (showClass.value = false)}
  769. type="change"
  770. onConfirm={(item: any) => {
  771. showClass.value = false;
  772. router.push({
  773. path: '/prepare-lessons',
  774. query: {
  775. ...item
  776. }
  777. });
  778. }}
  779. />
  780. </NModal>
  781. {/* 弹窗查看 */}
  782. <PreviewWindow
  783. v-model:show={previewModal.value}
  784. type="attend"
  785. params={previewItem.value}
  786. />
  787. </div>
  788. );
  789. }
  790. });