index.tsx 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  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. ];
  353. // 单独判断个人信息页面[学校设置]有引导
  354. if (route.path === '/setting') {
  355. return helpNoteList.baseListTab === 'school' ? true : false;
  356. } else {
  357. return hidePath.includes(routePath) ? false : true;
  358. }
  359. });
  360. const startClassStatus = computed(() => {
  361. const routePath = route.path;
  362. console.log(routePath, 'routePath', routePath);
  363. const hidePath = ['/prepare-lessons'];
  364. return hidePath.includes(routePath) ? false : true;
  365. });
  366. onMounted(() => {
  367. initMoveable();
  368. // // initMoveableClass();
  369. const subdEl = document.getElementById(`moveNPopover`) as HTMLDivElement;
  370. // // const classEl = document.getElementById(
  371. // // `moveNPopover2`
  372. // // ) as HTMLDivElement;
  373. // // initBoxRectInfo(classEl, classBoundaryInfo);
  374. initBoundaryWrap(subdEl, boxBoundaryInfo);
  375. initBoxRectInfo(subdEl, boxBoundaryInfo);
  376. // // initBoundaryWrap(classEl, classBoundaryInfo);
  377. window.addEventListener('resize', resetSize);
  378. eventGlobal.on('base-setting-emit', (val: string) => {
  379. helpNoteList.baseListTab = val;
  380. });
  381. });
  382. const resetSize = () => {
  383. const subdEl = document.getElementById(`moveNPopover`) as HTMLDivElement;
  384. subdEl.style.display = 'none';
  385. // const boxBoundaryInfo = reactive({
  386. // isBoundary: true,
  387. // isBoundaryType: 'right' as any,
  388. // mainWidth: '' as any,
  389. // mainHeight: '' as any,
  390. // subWidth: '' as any,
  391. // subHeight: '' as any
  392. // });
  393. // boxBoundaryInfo.isBoundary = true;
  394. // boxBoundaryInfo.isBoundaryType= 'right'
  395. if (NPopoverRef.value) {
  396. NPopoverRef.value.setShow(false);
  397. }
  398. setTimeout(() => {
  399. subdEl.style.transition = '';
  400. initBoxRectInfo(subdEl, boxBoundaryInfo);
  401. initBoundaryWrap(subdEl, boxBoundaryInfo);
  402. console.log('resize');
  403. subdEl.style.display = 'block';
  404. }, 100);
  405. };
  406. onUnmounted(() => {
  407. window.removeEventListener('resize', resetSize);
  408. });
  409. const initBoundaryWrap = (target: any, wrapInfo: any) => {
  410. target.addEventListener('mouseover', () => {
  411. if (wrapInfo.isBoundary) {
  412. // 如果在边框 就得还原 元素位置 还原完毕后 去除transition
  413. if (wrapInfo.isBoundaryType == 'left') {
  414. target.style.left = '2px';
  415. } else if (wrapInfo.isBoundaryType == 'right') {
  416. target.style.left = `${wrapInfo.mainWidth - 2}px`;
  417. } else if (wrapInfo.isBoundaryType == 'top') {
  418. target.style.top = `${2}px`;
  419. } else if (wrapInfo.isBoundaryType == 'bottom') {
  420. target.style.top = `${wrapInfo.mainHeight - 2}px`;
  421. }
  422. }
  423. rate(target, 0);
  424. });
  425. target.addEventListener('mouseout', () => {
  426. if (wrapInfo.isBoundary) {
  427. // 如果在边框 就得还原 元素位置 还原完毕后 去除transition
  428. if (wrapInfo.isBoundaryType == 'left') {
  429. actionEnd(target, 'left');
  430. } else if (wrapInfo.isBoundaryType == 'right') {
  431. actionEnd(target, 'right');
  432. } else if (wrapInfo.isBoundaryType == 'top') {
  433. actionEnd(target, 'top');
  434. } else if (wrapInfo.isBoundaryType == 'bottom') {
  435. actionEnd(target, 'bottom');
  436. }
  437. }
  438. // rate(target, 0)
  439. });
  440. // target.addEventListener('contextmenu', (event: any) => {
  441. // event.preventDefault();
  442. // dialog.warning({
  443. // title: '提示',
  444. // content: '是否收入托盘',
  445. // positiveText: '确定',
  446. // negativeText: '取消',
  447. // onPositiveClick: () => {
  448. // console.log('确定');
  449. // },
  450. // onNegativeClick: () => {
  451. // console.log('取消');
  452. // }
  453. // });
  454. // });
  455. // actionEnd(target, 'right');
  456. };
  457. const startShowModal = (
  458. val:
  459. | 'setTimeIcon'
  460. | 'beatIcon'
  461. | 'toneIcon'
  462. | 'iconWhiteBorad'
  463. | 'iconPen'
  464. | 'iconNote'
  465. ) => {
  466. if (val == 'setTimeIcon') {
  467. showModalTime.value = true;
  468. }
  469. if (val == 'beatIcon') {
  470. showModalBeat.value = true;
  471. }
  472. if (val == 'toneIcon') {
  473. showModalTone.value = true;
  474. }
  475. if (val == 'iconNote') {
  476. if (NPopoverRef.value) {
  477. NPopoverRef.value.setShow(false);
  478. }
  479. console.log(route.name, 'guideInfo');
  480. eventGlobal.emit('teacher-guideInfo', route.name);
  481. }
  482. if (val == 'iconWhiteBorad') {
  483. studyData.whiteboardShow = true;
  484. studyData.type = 'whiteboard';
  485. studyData.homeStatus = false;
  486. if (NPopoverRef.value) {
  487. NPopoverRef.value.setShow(false);
  488. }
  489. }
  490. if (val == 'iconPen') {
  491. studyData.penShow = true;
  492. studyData.type = 'pen';
  493. studyData.homeStatus = false;
  494. if (NPopoverRef.value) {
  495. NPopoverRef.value.setShow(false);
  496. }
  497. }
  498. };
  499. // const moveTargetBoundary = (target: any, type: any) => {
  500. // console.log('moveTargetBoundary', target, type);
  501. // };
  502. // 这里是旋转
  503. const rate = (target: any, rate: any) => {
  504. target.style.transform = ' rotate(' + rate + ')';
  505. };
  506. // 这里是选装的方式
  507. const actionEnd = (target: any, type: any) => {
  508. switch (type) {
  509. case 'left':
  510. rate(target, '90deg');
  511. target!.style.left = `${2 - boxBoundaryInfo.subWidth / 2}px`;
  512. target!.style.top = `${top}px`;
  513. break;
  514. case 'right':
  515. rate(target, '-90deg');
  516. target!.style.left = `${
  517. boxBoundaryInfo.mainWidth - 2 + boxBoundaryInfo.subWidth / 2
  518. }px`;
  519. target!.style.top = `${top}px`;
  520. break;
  521. case 'top':
  522. target!.style.top = `${2 - boxBoundaryInfo.subHeight / 2}px`;
  523. rate(target, '-180deg');
  524. break;
  525. case 'bottom':
  526. target!.style.top = `${
  527. boxBoundaryInfo.mainHeight - 2 + boxBoundaryInfo.subHeight / 2
  528. }px`;
  529. break;
  530. default:
  531. rate(target, '-0');
  532. break;
  533. }
  534. };
  535. const initBoxRectInfo = (target: any, wrapInfo: any) => {
  536. // const subdEl = document.getElementById(`moveNPopover`) as HTMLDivElement;
  537. // console.log(subdEl, "subdEl", "drag");
  538. const subdElStyle = getComputedStyle(target, null);
  539. const RectInfo = {
  540. left: Number(subdElStyle.left.replace('px', '')),
  541. top: Number(subdElStyle.top.replace('px', '')),
  542. width: Number(subdElStyle.width.replace('px', '')),
  543. height: Number(subdElStyle.height.replace('px', ''))
  544. };
  545. // target.style.transition = ''
  546. const mainWidth =
  547. parseInt(
  548. window.getComputedStyle(document.querySelector('.wrap') as Element)
  549. .width
  550. ) - RectInfo.width;
  551. const mainHeight =
  552. parseInt(
  553. window.getComputedStyle(document.querySelector('.wrap') as Element)
  554. .height
  555. ) - RectInfo.height;
  556. // boxBoundaryInfo.isBoundary = false;
  557. // boxBoundaryInfo.isBoundaryType = '';
  558. wrapInfo.mainHeight = mainHeight;
  559. wrapInfo.mainWidth = mainWidth;
  560. wrapInfo.subWidth = RectInfo.width;
  561. wrapInfo.subHeight = RectInfo.height;
  562. target.style.transition = '.3s .3s';
  563. };
  564. /** 教学数据 */
  565. const studyData = reactive({
  566. homeStatus: true, // 是否显示首页
  567. type: '',
  568. penShow: false,
  569. whiteboardShow: false
  570. });
  571. return () => (
  572. <div class={[styles.wrap, 'wrap']}>
  573. <div>
  574. <LayoutSilder></LayoutSilder>
  575. </div>
  576. <div class={styles.Wrapcore}>
  577. <LayoutTop></LayoutTop>
  578. <div class={styles.WrapcoreView} id="WrapcoreViewWrap">
  579. {/* <div class={styles.WrapcoreViewInfo}> */}
  580. <router-view>
  581. {(obj: any) => (
  582. <Transition name="fade-slide" mode="out-in">
  583. <obj.Component />
  584. </Transition>
  585. )}
  586. </router-view>
  587. {/* </div> */}
  588. </div>
  589. </div>
  590. {/* <img
  591. src={toolStartClass}
  592. id="moveNPopover2"
  593. style={{
  594. display: ['/', '/home', '/classList', '/prepare-lessons'].includes(
  595. route.path
  596. )
  597. ? 'none'
  598. : 'block'
  599. }}
  600. class={[
  601. styles.toolClassImg,
  602. 'moveNPopover2',
  603. isDragIng.value ? styles.isDragIng : ''
  604. ]}
  605. alt=""
  606. /> */}
  607. <NPopover
  608. raw
  609. trigger="click"
  610. ref={NPopoverRef}
  611. show-arrow={false}
  612. placement={directionType.value as 'left' | 'right'}
  613. v-slots={{
  614. trigger: () => (
  615. // 首页不显示工具箱 ['/', '/home'].includes(route.path) ||
  616. <img
  617. // src={isDragIng.value ? dragingBoxIcon : toolbox}
  618. src={toolbox}
  619. id="moveNPopover"
  620. style={{
  621. display: !studyData.homeStatus ? 'none' : 'block'
  622. }}
  623. class={[
  624. styles.toolboxImg,
  625. 'moveNPopover',
  626. isDragIng.value ? styles.isDragIng : ''
  627. ]}
  628. alt=""
  629. />
  630. )
  631. }}>
  632. <div class={styles.booxToolWrap}>
  633. <div>
  634. <div
  635. class={styles.booxToolItem}
  636. onClick={() => startShowModal('beatIcon')}>
  637. <img src={beatIcon} alt="" />
  638. 节拍器
  639. </div>
  640. <div
  641. class={styles.booxToolItem}
  642. onClick={() => startShowModal('toneIcon')}>
  643. <img src={toneIcon} alt="" />
  644. 调音器
  645. </div>
  646. <div
  647. class={styles.booxToolItem}
  648. onClick={() => startShowModal('setTimeIcon')}>
  649. <img src={setTimeIcon} alt="" />
  650. 计时器
  651. </div>
  652. <div
  653. class={[
  654. styles.booxToolItem,
  655. !startClassStatus.value && styles.booxToolDisabled
  656. ]}
  657. onClick={() => {
  658. if (!startClassStatus.value) return;
  659. showClass.value = true;
  660. }}>
  661. <img
  662. src={toolStartClass}
  663. class={[styles.toolClassImg]}
  664. alt=""
  665. />
  666. 开始上课
  667. </div>
  668. </div>
  669. <div>
  670. <div
  671. class={[
  672. styles.booxToolItem,
  673. !helpNoteStatus.value && styles.booxToolDisabled
  674. ]}
  675. onClick={() => {
  676. if (!helpNoteStatus.value) return;
  677. startShowModal('iconNote');
  678. }}>
  679. <img src={iconNote} alt="" />
  680. 帮助指引
  681. </div>
  682. <div
  683. class={styles.booxToolItem}
  684. onClick={() => startShowModal('iconPen')}>
  685. <img src={iconWhiteBorad} alt="" />
  686. 批注
  687. </div>
  688. <div
  689. class={styles.booxToolItem}
  690. onClick={() => startShowModal('iconWhiteBorad')}>
  691. <img src={iconPen} alt="" />
  692. 白板
  693. </div>
  694. </div>
  695. </div>
  696. </NPopover>
  697. {/* 批注 */}
  698. {studyData.penShow && (
  699. <Pen
  700. show={studyData.type === 'pen'}
  701. type={studyData.type as any}
  702. close={() => {
  703. studyData.type = 'init';
  704. studyData.homeStatus = true;
  705. }}
  706. />
  707. )}
  708. {studyData.whiteboardShow && (
  709. <Pen
  710. show={studyData.type === 'whiteboard'}
  711. type={studyData.type as any}
  712. close={() => {
  713. studyData.type = 'init';
  714. studyData.homeStatus = true;
  715. }}
  716. />
  717. )}
  718. <NModal
  719. class={['modalTitle background']}
  720. style={{ width: '687px' }}
  721. title={'节拍器'}
  722. preset="card"
  723. v-model:show={showModalBeat.value}>
  724. <div class={styles.modeWrap}>
  725. <iframe
  726. src={`${vaildUrl()}/metronome/?id=${new Date().getTime()}`}
  727. scrolling="no"
  728. frameborder="0"
  729. width="100%"
  730. height={'650px'}></iframe>
  731. </div>
  732. </NModal>
  733. <NModal v-model:show={showModalTone.value} class={['background']}>
  734. {/* <div
  735. onClick={() => {
  736. showModalTone.value = false;
  737. }}>
  738. <NImage
  739. src={toneImage}
  740. previewDisabled
  741. class={styles.beatImage}></NImage>
  742. </div> */}
  743. <div>
  744. <PlaceholderTone
  745. onClose={() => {
  746. showModalTone.value = false;
  747. }}></PlaceholderTone>
  748. </div>
  749. </NModal>
  750. <NModal
  751. v-model:show={showModalTime.value}
  752. class={['modalTitle background']}
  753. title={'计时器'}
  754. preset="card"
  755. style={{ width: px2vw(772) }}>
  756. <div>
  757. <TimerMeter></TimerMeter>
  758. </div>
  759. </NModal>
  760. <NModal
  761. v-model:show={showClass.value}
  762. class={['modalTitle background', styles.showClass]}
  763. preset="card"
  764. title={'开始上课'}>
  765. <AttendClass
  766. onClose={() => (showClass.value = false)}
  767. type="change"
  768. onConfirm={(item: any) => {
  769. showClass.value = false;
  770. router.push({
  771. path: '/prepare-lessons',
  772. query: {
  773. ...item
  774. }
  775. });
  776. }}
  777. />
  778. </NModal>
  779. {/* 弹窗查看 */}
  780. <PreviewWindow
  781. v-model:show={previewModal.value}
  782. type="attend"
  783. params={previewItem.value}
  784. />
  785. </div>
  786. );
  787. }
  788. });