BookEep.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  1. <template>
  2. <div class="common-preview" :class="{ 'is-mobile': isMobile }">
  3. <div class="audit-content">
  4. <div ref="previewMain" class="main-container">
  5. <main :class="['preview-main', 'no-audit']" :style="computedCommonPreviewStyle">
  6. <div
  7. v-if="!isMobile"
  8. class="preview-left"
  9. :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"
  10. ></div>
  11. <CoursewarePreview
  12. ref="courseware"
  13. :is-show-group="false"
  14. :group-show-all="true"
  15. :group-row-list="groupRowList"
  16. :data="data"
  17. :courseware-id="curSelectId"
  18. :component-list="cList"
  19. :background="background"
  20. :can-remark="false"
  21. :show-remark="false"
  22. :component-remark-obj="{}"
  23. :project="project"
  24. :is-mobile="isMobile"
  25. @editNote="handEditNote"
  26. @saveCollect="saveCollect"
  27. @getTranslate="getTranslate"
  28. />
  29. <div
  30. v-if="!isMobile"
  31. class="preview-right"
  32. :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"
  33. ></div>
  34. </main>
  35. </div>
  36. </div>
  37. <ExplanatoryNoteDialog
  38. ref="explanatoryNote"
  39. :open.sync="editDialogOpen"
  40. :init-data="oldRichData"
  41. :title-text="dialogTitleText"
  42. :modal="false"
  43. @confirm="dialogSave"
  44. @cancel="dialogCancel"
  45. />
  46. <TranslateDialog
  47. :open.sync="showTranslate"
  48. :modal="false"
  49. :init-text="translateText"
  50. :book-id="id"
  51. title-text="翻译 (机器翻译)"
  52. />
  53. </div>
  54. </template>
  55. <script>
  56. import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
  57. import ExplanatoryNoteDialog from '@/components/ExplanatoryNoteDialog.vue';
  58. import TranslateDialog from '@/components/TranslateDialog.vue';
  59. import { isTrue } from '@/utils/validate';
  60. import { buildCoursewareStyle } from '@/views/book/courseware/preview/common/utils/coursewareStyle';
  61. import { updateBaseURL } from '@/utils/http';
  62. import {
  63. GetMyNoteList,
  64. AddMyCollect,
  65. GetMyCollectList,
  66. DeleteMyNote,
  67. UpdateMyNote,
  68. AddMyNote,
  69. AddCoursewareFeedback,
  70. DeleteCoursewareFeedback,
  71. GetCoursewareFeedbackList,
  72. } from '@/api/book';
  73. export default {
  74. name: 'BookEep',
  75. components: {
  76. CoursewarePreview,
  77. ExplanatoryNoteDialog,
  78. TranslateDialog,
  79. },
  80. provide() {
  81. return {
  82. getLang: () => this.lang,
  83. getChinese: () => this.chinese,
  84. getShowPinYin: () => this.showPinYin,
  85. getLangList: () => this.langList,
  86. convertText: this.convertText,
  87. getTitleList: () => this.title_list,
  88. getPermissionControl: () => this.permissionControl,
  89. };
  90. },
  91. props: {
  92. id: {
  93. type: String,
  94. default: '',
  95. },
  96. // 组件内容
  97. content: {
  98. type: String,
  99. default: '',
  100. },
  101. // 内容分组行列表
  102. contentGroupRowList: {
  103. type: String,
  104. default: '',
  105. },
  106. // 组件列表
  107. componentList: {
  108. type: Array,
  109. default: () => [],
  110. },
  111. // 教材背景
  112. bookBackground: {
  113. type: String,
  114. default: '',
  115. },
  116. permissControl: {
  117. type: Object,
  118. default: () => ({}),
  119. },
  120. // 外部传入组件用户答案,JSON 格式字符串
  121. componentUserAnswer: {
  122. type: String,
  123. default: '',
  124. },
  125. },
  126. data() {
  127. const isMobile = /android|iphone|ipad|ipod/i.test(navigator.userAgent || navigator.vendor || window.opera);
  128. return {
  129. background: this.bookBackground.length > 0 ? JSON.parse(this.bookBackground) : {},
  130. groupRowList: this.contentGroupRowList.length > 0 ? JSON.parse(this.contentGroupRowList) : [],
  131. data: this.content.length > 0 ? JSON.parse(this.content) : { row_list: [] },
  132. cList: this.handleComponentList(),
  133. curSelectId: this.id,
  134. isTrue,
  135. project: {
  136. editor: '', // 作者
  137. cover_image_file_id: null, // 封面图片ID
  138. cover_image_file_url: '', // 封面图片URL
  139. },
  140. title_list: [],
  141. node_list: [],
  142. permissionControl: {
  143. can_answer: true, // 可作答
  144. can_judge_correct: false, // 可判断对错(客观题)
  145. can_show_answer: false, // 可查看答案
  146. can_correct: false, // 可批改
  147. can_check_correct: false, // 可查看批改
  148. },
  149. popoverShow: false,
  150. is_can_edit: 'false', // 是否可以编辑
  151. allCollectList: [],
  152. newSelectedInfo: {}, // 新的选中信息
  153. allNoteList: [],
  154. oldRichData: {},
  155. editDialogOpen: false,
  156. dialogType: 0,
  157. lang: 'ZH',
  158. chinese: 'zh-Hans',
  159. showPinYin: 'false',
  160. langList: [],
  161. showTranslate: false,
  162. translateText: '',
  163. selectedInfo: null,
  164. allFeedbackList: [],
  165. drawerType: 1,
  166. isMobile,
  167. };
  168. },
  169. computed: {
  170. computedCommonPreviewStyle() {
  171. return buildCoursewareStyle(this.background, 'commonPreview');
  172. },
  173. dialogTitleText() {
  174. if (this.dialogType === 2) return '反馈';
  175. return '笔记';
  176. },
  177. },
  178. watch: {
  179. componentList: {
  180. handler(newVal) {
  181. if (newVal && newVal.length > 0) {
  182. this.cList = this.handleComponentList();
  183. this.applyComponentUserAnswer();
  184. }
  185. },
  186. deep: true,
  187. },
  188. bookBackground: {
  189. handler(newVal) {
  190. if (newVal && newVal.length > 0) {
  191. this.background = JSON.parse(newVal);
  192. }
  193. },
  194. },
  195. content: {
  196. handler(newVal) {
  197. if (newVal && newVal.length > 0) {
  198. this.data = JSON.parse(newVal);
  199. }
  200. },
  201. },
  202. contentGroupRowList: {
  203. handler(newVal) {
  204. if (newVal && newVal.length > 0) {
  205. this.groupRowList = JSON.parse(newVal);
  206. }
  207. },
  208. },
  209. id: {
  210. handler(newVal) {
  211. if (newVal && newVal.length > 0) {
  212. this.curSelectId = newVal;
  213. }
  214. },
  215. },
  216. permissControl: {
  217. handler(newVal) {
  218. if (newVal && Object.keys(newVal).length > 0) {
  219. this.permissionControl = newVal;
  220. }
  221. },
  222. deep: true,
  223. immediate: true,
  224. },
  225. componentUserAnswer: {
  226. handler() {
  227. this.applyComponentUserAnswer();
  228. },
  229. deep: true,
  230. immediate: true,
  231. },
  232. },
  233. created() {
  234. const origin = window.location.origin;
  235. if (origin && origin.indexOf('localhost') === -1) {
  236. updateBaseURL(`${origin}/`);
  237. }
  238. },
  239. mounted() {
  240. this.applyComponentUserAnswer();
  241. },
  242. methods: {
  243. backTop() {
  244. this.$refs.previewMain.scrollTo({
  245. top: 0,
  246. left: 0,
  247. behavior: 'smooth',
  248. });
  249. },
  250. convertText(text) {
  251. return text;
  252. },
  253. handleComponentList() {
  254. const processHtmlString = this.processHtmlString;
  255. const cList = this.componentList || [];
  256. cList.forEach((x) => {
  257. if (x.component_type === 'audio') {
  258. let _c = JSON.parse(x.content);
  259. let p = _c.property || {};
  260. if (!p.file_name_display_mode) p.file_name_display_mode = 'true';
  261. if (p.view_method === 'independent' && !p.style_mode) {
  262. p.style_mode = 'middle';
  263. }
  264. if (!p.style_mode) p.style_mode = 'big';
  265. if (p.view_method === 'icon') {
  266. p.file_name_display_mode = 'false';
  267. p.view_method = 'independent';
  268. p.style_mode = 'small';
  269. }
  270. x.content = JSON.stringify(_c);
  271. } else if (x.component_type === 'richtext') {
  272. if (!processHtmlString) return;
  273. let _c = JSON.parse(x.content);
  274. let p = _c.property || {};
  275. let lev = Number(p.title_style_level);
  276. if (p.is_title !== 'true' || lev < 1 || !_c.content) return;
  277. let style = this.title_list.find((y) => y.level === lev) || {};
  278. if (style && style.style) {
  279. style = JSON.parse(style.style);
  280. let c_text = _c.content;
  281. const parser = new DOMParser();
  282. const doc = parser.parseFromString(c_text, 'text/html');
  283. const body = doc.body;
  284. const pElements = body.querySelectorAll('p');
  285. processHtmlString(pElements, style);
  286. _c.content = body.innerHTML;
  287. x.content = JSON.stringify(_c);
  288. }
  289. }
  290. });
  291. return cList;
  292. },
  293. /**
  294. * 获取所有组件的用户答案,供 UI 包使用者通过 ref 调用
  295. * @returns {Object} 以组件 id 为键的答案映射
  296. */
  297. getAllComponentUserAnswer() {
  298. const previewList = this.$refs?.courseware?.$refs?.preview || [];
  299. const answerMap = {};
  300. previewList.forEach((item) => {
  301. const id = item?.$el?.dataset?.id;
  302. if (!id || typeof item.getAnswer !== 'function') return;
  303. answerMap[id] = item.getAnswer();
  304. });
  305. const obj = {
  306. duration: 0,
  307. count_not_done: 0,
  308. count_right: 0,
  309. count_error: 0,
  310. content: JSON.stringify(answerMap),
  311. };
  312. return JSON.stringify(obj);
  313. },
  314. /**
  315. * 将外部传入的用户答案回填到组件
  316. */
  317. applyComponentUserAnswer() {
  318. if (!this.componentUserAnswer || this.componentUserAnswer.length === 0) return;
  319. this.$nextTick(() => {
  320. const previewList = this.$refs?.courseware?.$refs?.preview || [];
  321. if (!previewList.length) return;
  322. const answerMap = JSON.parse(this.componentUserAnswer || '{}');
  323. if (!answerMap || Object.keys(answerMap).length === 0) return;
  324. previewList.forEach((item) => {
  325. const id = item?.$el?.dataset?.id;
  326. if (!id || typeof item.showAnswer !== 'function') return;
  327. if (!Object.hasOwn(answerMap, id)) return;
  328. item.showAnswer(true, true, answerMap[id], true);
  329. });
  330. });
  331. },
  332. processHtmlString(pElements, styleConfig, isClear = false) {
  333. const _pElements = pElements || [];
  334. _pElements.forEach((pElement) => {
  335. if (pElement.innerHTML !== '<br data-mce-bogus="1">') {
  336. pElement.innerHTML = pElement.innerText;
  337. }
  338. if (isClear) {
  339. pElement.removeAttribute('style');
  340. pElement.removeAttribute('data-mce-style');
  341. } else {
  342. const style = pElement.style;
  343. if (styleConfig.font) style.fontFamily = styleConfig.font;
  344. if (styleConfig.font_size) style.fontSize = styleConfig.font_size;
  345. if (styleConfig.text_color) style.color = styleConfig.text_color;
  346. style.fontWeight = styleConfig.bold === 'true' ? 'bold' : 'normal';
  347. style.fontStyle = styleConfig.italic === 'true' ? 'italic' : 'normal';
  348. if (styleConfig.indent || styleConfig.indent === 0) style.marginLeft = `${styleConfig.indent}px`;
  349. }
  350. });
  351. },
  352. /**
  353. * 获取收藏列表
  354. * @param {Object} params - 参数对象
  355. * @param {number} params.type - 收藏类型(可选)
  356. */
  357. async getCollect(params) {
  358. if (params && params.type) this.drawerType = Number(params.type);
  359. this.allCollectList = [];
  360. await GetMyCollectList({ courseware_id: this.curSelectId }).then((res) => {
  361. if (res.status === 1) {
  362. res.collect_list.forEach((x) => {
  363. if (x.collect_desc) {
  364. let n = JSON.parse(x.collect_desc);
  365. let obj = {
  366. coursewareId: x.courseware_id,
  367. id: x.id,
  368. blockId: n.blockId,
  369. startIndex: n.startIndex,
  370. endIndex: n.endIndex,
  371. text: n.text,
  372. };
  373. this.allCollectList.push(obj);
  374. }
  375. });
  376. }
  377. });
  378. },
  379. /**
  380. * 保存收藏
  381. * @param {Object} collect - 收藏信息对象
  382. * @param {string} collect.coursewareId - 课件 ID
  383. * @param {string} collect.blockId - 区块 ID
  384. * @param {number} collect.startIndex - 起始索引
  385. * @param {number} collect.endIndex - 结束索引
  386. * @param {string} collect.text - 收藏文本
  387. */
  388. async saveCollect(collect) {
  389. if (this.allCollectList.length === 0) {
  390. await this.getCollect();
  391. }
  392. let old = this.allCollectList.find(
  393. (x) =>
  394. x.coursewareId === collect.coursewareId &&
  395. x.blockId === collect.blockId &&
  396. x.startIndex === collect.startIndex &&
  397. x.endIndex === collect.endIndex,
  398. );
  399. if (old) {
  400. this.$message({
  401. dangerouslyUseHTMLString: true,
  402. message: "<i class='el-icon-check' />已收藏",
  403. });
  404. return;
  405. }
  406. this.newSelectedInfo = collect;
  407. let collectInfo = {
  408. blockId: this.newSelectedInfo.blockId,
  409. startIndex: this.newSelectedInfo.startIndex,
  410. endIndex: this.newSelectedInfo.endIndex,
  411. text: this.newSelectedInfo.text,
  412. };
  413. let reqData = {
  414. courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
  415. component_id: 'WHOLE',
  416. collect_desc: JSON.stringify(collectInfo), // 位置描述
  417. };
  418. AddMyCollect(reqData)
  419. .then(() => {
  420. this.getCollect();
  421. })
  422. .then(() => {
  423. this.$message({
  424. dangerouslyUseHTMLString: true,
  425. message: "<i class='el-icon-check' />已收藏",
  426. });
  427. });
  428. },
  429. /**
  430. * 获取笔记列表
  431. * @param {Object} params - 参数对象
  432. */
  433. async getNote(params) {
  434. if (params && params.type) this.drawerType = Number(params.type);
  435. this.allNoteList = [];
  436. await GetMyNoteList({ courseware_id: this.curSelectId }).then((res) => {
  437. if (res.status === 1) {
  438. res.note_list.forEach((x) => {
  439. if (x.note_desc) {
  440. let n = JSON.parse(x.note_desc);
  441. let obj = {
  442. coursewareId: x.courseware_id,
  443. id: x.id,
  444. blockId: n.blockId,
  445. startIndex: n.startIndex,
  446. endIndex: n.endIndex,
  447. text: n.text,
  448. note: this.addImageMaxWidth(n.note),
  449. };
  450. this.allNoteList.push(obj);
  451. }
  452. });
  453. }
  454. });
  455. },
  456. async handEditNote(note) {
  457. this.oldRichData = {};
  458. if (this.allNoteList.length === 0) {
  459. await this.getNote();
  460. }
  461. let old = this.allNoteList.find(
  462. (x) =>
  463. x.coursewareId === note.coursewareId &&
  464. x.blockId === note.blockId &&
  465. x.startIndex === note.startIndex &&
  466. x.endIndex === note.endIndex,
  467. );
  468. if (old) {
  469. this.oldRichData = old;
  470. this.oldRichData.dataStr = old.note;
  471. }
  472. this.newSelectedInfo = note;
  473. this.editDialogOpen = true;
  474. this.dialogType = 1;
  475. },
  476. /**
  477. * 获取翻译
  478. * @param {Object} info - 翻译信息对象
  479. * @param {string} info.text - 需要翻译的文本
  480. */
  481. async getTranslate(info) {
  482. this.showTranslate = true;
  483. this.translateText = info.text;
  484. },
  485. dialogSave(obj) {
  486. if (this.dialogType === 1) return this.saveNote(obj);
  487. if (this.dialogType === 2) return this.saveFeedback(obj);
  488. },
  489. dialogCancel(id) {
  490. if (this.dialogType === 1) return this.delNote(id);
  491. if (this.dialogType === 2) return this.delFeedback(id);
  492. },
  493. /**
  494. * 保存笔记
  495. * @param {Object} note - 笔记信息对象
  496. * @param {string} note.dataStr - 笔记内容
  497. */
  498. saveNote(note) {
  499. let noteInfo = {
  500. blockId: this.newSelectedInfo.blockId,
  501. startIndex: this.newSelectedInfo.startIndex,
  502. endIndex: this.newSelectedInfo.endIndex,
  503. note: note.dataStr,
  504. text: this.newSelectedInfo.text,
  505. };
  506. let reqData = {
  507. courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
  508. component_id: 'WHOLE',
  509. note_desc: JSON.stringify(noteInfo), // 位置描述
  510. };
  511. if (note.id) {
  512. if (!noteInfo.note) {
  513. this.delNote(note.id);
  514. return;
  515. }
  516. let upDate = {
  517. id: note.id,
  518. note_desc: reqData.note_desc,
  519. };
  520. UpdateMyNote(upDate).then(() => {
  521. this.getNote();
  522. });
  523. } else {
  524. AddMyNote(reqData).then(() => {
  525. this.getNote();
  526. });
  527. }
  528. this.editDialogOpen = false;
  529. this.newSelectedInfo = null;
  530. this.selectedInfo = null;
  531. },
  532. delNote(id) {
  533. const noteId = id || (this.oldRichData && this.oldRichData.id);
  534. if (!noteId) return;
  535. DeleteMyNote({ id: noteId }).then(() => {
  536. this.allNoteList = this.allNoteList.filter((x) => x.id !== noteId);
  537. });
  538. },
  539. saveFeedback(feedBack) {
  540. if (feedBack.id) {
  541. this.delFeedback(feedBack.id);
  542. }
  543. if (feedBack.dataStr) {
  544. let feedBackInfo = {
  545. blockId: this.newSelectedInfo.blockId,
  546. startIndex: this.newSelectedInfo.startIndex,
  547. endIndex: this.newSelectedInfo.endIndex,
  548. feedBack: feedBack.dataStr,
  549. text: this.newSelectedInfo.text,
  550. };
  551. let reqData = {
  552. courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
  553. component_id: 'WHOLE',
  554. content: JSON.stringify(feedBackInfo),
  555. content_select: this.newSelectedInfo.text,
  556. };
  557. AddCoursewareFeedback(reqData).then(() => {
  558. this.getFeedback();
  559. });
  560. }
  561. this.editDialogOpen = false;
  562. this.newSelectedInfo = null;
  563. this.selectedInfo = null;
  564. },
  565. delFeedback(id) {
  566. const feedBackId = id || (this.oldRichData && this.oldRichData.id);
  567. if (!feedBackId) return;
  568. DeleteCoursewareFeedback({ id: feedBackId })
  569. .then(() => {
  570. this.allFeedbackList = this.allFeedbackList.filter((x) => x.id !== feedBackId);
  571. })
  572. .catch(() => {});
  573. },
  574. /**
  575. * 为HTML内容中的图片添加最大宽度限制
  576. * @param {string} html - HTML字符串
  577. * @returns {string} - 处理后的HTML字符串
  578. */
  579. addImageMaxWidth(html) {
  580. if (!html) return html;
  581. const regex = /<img([^>]*)>/gi;
  582. return html.replace(regex, (match, attributes) => {
  583. if (attributes.includes('style=')) {
  584. return match.replace(/style=["']([^"']*)["']/i, (styleMatch, styleValue) => {
  585. if (styleValue.includes('max-width')) {
  586. return styleMatch;
  587. }
  588. return `style="${styleValue}; max-width: 200px;"`;
  589. });
  590. }
  591. return `<img${attributes} style="max-width: 200px;">`;
  592. });
  593. },
  594. async getFeedback(params) {
  595. if (params && params.type) this.drawerType = Number(params.type);
  596. this.allFeedbackList = [];
  597. await GetCoursewareFeedbackList({ courseware_id: this.curSelectId }).then((res) => {
  598. if (res.status === 1 && res.feedback_list) {
  599. res.feedback_list.forEach((x) => {
  600. if (x.content) {
  601. let n = JSON.parse(x.content);
  602. let obj = {
  603. coursewareId: x.courseware_id,
  604. id: x.id,
  605. blockId: n.blockId,
  606. startIndex: n.startIndex,
  607. endIndex: n.endIndex,
  608. text: n.text,
  609. feedBack: this.addImageMaxWidth(n.feedBack),
  610. };
  611. this.allFeedbackList.push(obj);
  612. }
  613. });
  614. }
  615. });
  616. },
  617. },
  618. };
  619. </script>
  620. <style lang="scss" scoped>
  621. @use '@/styles/mixin.scss' as *;
  622. $total-width: $courseware-width + $courseware-left-margin + $courseware-right-margin;
  623. .common-preview {
  624. min-width: calc($total-width);
  625. // 移动端适配
  626. &.is-mobile {
  627. min-width: 100%;
  628. .main-container {
  629. min-width: 100%;
  630. }
  631. .audit-content {
  632. min-width: 100%;
  633. }
  634. main.preview-main {
  635. width: 100%;
  636. min-width: 100%;
  637. max-width: 100%;
  638. }
  639. }
  640. .main-container {
  641. position: relative;
  642. flex: 1;
  643. min-width: 1110px;
  644. padding: 15px;
  645. overflow: auto;
  646. background-color: #ececec;
  647. .catalogue-bar {
  648. position: absolute;
  649. top: 15px;
  650. left: 0;
  651. display: flex;
  652. align-items: center;
  653. justify-content: center;
  654. width: 54px;
  655. height: 54px;
  656. margin: -9px 6px 0 240px;
  657. cursor: pointer;
  658. background-color: #fff;
  659. border-radius: 2px;
  660. box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
  661. }
  662. .sidebar-bar {
  663. position: absolute;
  664. top: 0;
  665. right: 240px;
  666. display: flex;
  667. width: 60px;
  668. height: calc(100vh - 166px);
  669. .toolbar {
  670. display: flex;
  671. flex-direction: column;
  672. align-items: center;
  673. width: 60px;
  674. height: 100%;
  675. img {
  676. cursor: pointer;
  677. }
  678. &-special {
  679. display: flex;
  680. flex-direction: column;
  681. row-gap: 16px;
  682. align-items: center;
  683. width: 100%;
  684. margin-bottom: 24px;
  685. background-color: #fff;
  686. img {
  687. width: 36px;
  688. height: 36px;
  689. }
  690. }
  691. }
  692. }
  693. }
  694. .back-top {
  695. position: absolute;
  696. right: 240px;
  697. bottom: 0;
  698. display: flex;
  699. place-content: center center;
  700. align-items: center;
  701. width: 60px;
  702. height: 60px;
  703. cursor: pointer;
  704. background-color: #fff;
  705. }
  706. main.preview-main {
  707. display: flex;
  708. flex: 1;
  709. width: calc($total-width);
  710. min-width: calc($total-width);
  711. max-width: calc($total-width);
  712. min-height: 100%;
  713. margin: 0 auto;
  714. background-color: #fff;
  715. border-radius: 4px;
  716. box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
  717. .preview-left {
  718. width: $courseware-left-margin;
  719. min-width: $courseware-left-margin;
  720. max-width: $courseware-left-margin;
  721. background-color: $courseware-bgColor;
  722. }
  723. .preview-right {
  724. width: $courseware-right-margin;
  725. min-width: $courseware-right-margin;
  726. max-width: $courseware-right-margin;
  727. background-color: $courseware-bgColor;
  728. }
  729. &.no-audit {
  730. margin: 0 auto;
  731. }
  732. }
  733. .audit-content {
  734. display: flex;
  735. min-width: calc($total-width);
  736. .left-menu {
  737. display: flex;
  738. flex-direction: column;
  739. width: $catalogue-width;
  740. font-family: 'Microsoft YaHei', 'Arial', sans-serif;
  741. background-color: #fff;
  742. .courseware-info {
  743. display: flex;
  744. column-gap: 18px;
  745. width: 100%;
  746. height: 186px;
  747. padding: 6px 6px 24px;
  748. border-bottom: $border;
  749. .cover-image {
  750. display: flex;
  751. align-items: center;
  752. justify-content: center;
  753. width: 111px;
  754. height: 157px;
  755. background-color: rgba(229, 229, 229, 100%);
  756. img {
  757. max-width: 111px;
  758. max-height: 157px;
  759. }
  760. }
  761. .info-content {
  762. display: flex;
  763. flex-direction: column;
  764. justify-content: space-between;
  765. .catalogue-icon {
  766. text-align: right;
  767. .svg-icon {
  768. cursor: pointer;
  769. }
  770. }
  771. .courseware {
  772. width: 159px;
  773. height: 64px;
  774. font-size: 16px;
  775. .name {
  776. font-weight: bold;
  777. }
  778. .editor {
  779. display: -webkit-box;
  780. overflow: hidden;
  781. text-overflow: ellipsis;
  782. word-break: break-word;
  783. white-space: normal;
  784. -webkit-line-clamp: 2; /* 多行省略行数,按需调整 */
  785. -webkit-box-orient: vertical;
  786. }
  787. }
  788. }
  789. }
  790. }
  791. .sidebar {
  792. position: relative;
  793. display: flex;
  794. width: $sidebar-width;
  795. .toolbar {
  796. display: flex;
  797. flex-direction: column;
  798. align-items: center;
  799. width: 60px;
  800. height: 100%;
  801. background-color: rgba(247, 248, 250, 100%);
  802. img {
  803. cursor: pointer;
  804. }
  805. &-special {
  806. display: flex;
  807. flex-direction: column;
  808. row-gap: 16px;
  809. margin-bottom: 24px;
  810. }
  811. &-list {
  812. display: flex;
  813. flex-direction: column;
  814. row-gap: 16px;
  815. align-items: center;
  816. width: 100%;
  817. .sidebar-item {
  818. width: 100%;
  819. text-align: center;
  820. .sidebar-icon {
  821. width: 36px;
  822. height: 36px;
  823. cursor: pointer;
  824. }
  825. &.active {
  826. background-color: #4095e5;
  827. }
  828. }
  829. }
  830. }
  831. .content {
  832. flex: 1;
  833. background-color: #fff;
  834. .resource_box {
  835. height: 100%;
  836. overflow-y: auto;
  837. border: 1px solid #e5e5e5;
  838. h5 {
  839. position: fixed;
  840. z-index: 999;
  841. width: 240px;
  842. padding: 0 5px;
  843. margin: 0;
  844. font-size: 18px;
  845. line-height: 40px;
  846. background: #f2f3f5;
  847. }
  848. .scroll-container {
  849. display: flex;
  850. flex-direction: column;
  851. row-gap: 8px;
  852. margin: 6px;
  853. .list-item {
  854. display: flex;
  855. align-items: center;
  856. cursor: pointer;
  857. border: 1px solid #ccc;
  858. border-radius: 8px;
  859. :deep .el-slider {
  860. .el-slider__runway {
  861. background-color: #eee;
  862. }
  863. }
  864. .el-image {
  865. display: flex;
  866. width: 100%;
  867. min-width: 100%;
  868. height: 90px;
  869. background-color: #ccc;
  870. border-radius: 8px;
  871. }
  872. .video-play {
  873. width: 100%;
  874. min-width: 100%;
  875. }
  876. .text-box {
  877. word-break: break-word;
  878. }
  879. }
  880. }
  881. p {
  882. color: #999;
  883. text-align: center;
  884. }
  885. .card-box li {
  886. padding: 10px;
  887. border-bottom: 1px solid #ccc;
  888. .el-icon-notebook-2 {
  889. display: block;
  890. margin-bottom: 4px;
  891. font-size: 12px;
  892. color: grey;
  893. }
  894. }
  895. }
  896. }
  897. .back-top {
  898. position: absolute;
  899. bottom: 0;
  900. left: 0;
  901. display: flex;
  902. place-content: center center;
  903. align-items: center;
  904. width: 60px;
  905. height: 60px;
  906. cursor: pointer;
  907. }
  908. }
  909. }
  910. }
  911. :deep .scroll-container .audio-wrapper {
  912. width: 100% !important;
  913. .audio-middle {
  914. width: 100% !important;
  915. padding: 6px 8px !important;
  916. border: none;
  917. border-radius: 8px;
  918. .audio-name {
  919. text-align: left;
  920. }
  921. .slider-area {
  922. column-gap: 8px !important;
  923. }
  924. :deep .remark-dialog {
  925. .el-dialog__body {
  926. padding: 5px 20px;
  927. }
  928. }
  929. :deep .audit-dialog {
  930. .el-dialog__body {
  931. height: calc(100vh - 260px);
  932. padding: 5px 20px;
  933. }
  934. .mind-map-container .mind-map {
  935. height: calc(100vh - 310px);
  936. }
  937. }
  938. }
  939. }
  940. .mt10 {
  941. margin: 10px 0 0 !important;
  942. background-color: #eee;
  943. }
  944. .courseware-tree {
  945. display: flex;
  946. flex: 1;
  947. flex-direction: column;
  948. row-gap: 8px;
  949. max-height: calc(100vh - 200px);
  950. overflow: auto;
  951. .menu-item {
  952. display: flex;
  953. align-items: center;
  954. &:not(.courseware) {
  955. font-weight: bold;
  956. }
  957. &.courseware {
  958. &:hover {
  959. .name {
  960. background-color: #f3f3f3;
  961. }
  962. }
  963. }
  964. .svg-icon {
  965. margin-left: 4px;
  966. &.my-edit-task {
  967. color: $right-color;
  968. }
  969. }
  970. .name {
  971. flex: 1;
  972. padding: 4px 8px 4px 4px;
  973. border-radius: 4px;
  974. }
  975. &.active {
  976. .name {
  977. font-weight: bold;
  978. color: #4095e5;
  979. }
  980. }
  981. }
  982. }
  983. </style>
  984. <style lang="scss">
  985. .tox-tinymce-aux {
  986. z-index: 9999 !important;
  987. }
  988. </style>