index.tsx 26 KB

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