| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124 |
- <template>
- <div class="common-preview" :class="{ 'is-mobile': isMobile }">
- <div class="audit-content">
- <div ref="previewMain" class="main-container">
- <main :class="['preview-main', 'no-audit']" :style="computedCommonPreviewStyle">
- <div
- v-if="!isMobile"
- class="preview-left"
- :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"
- ></div>
- <CoursewarePreview
- ref="courseware"
- :is-show-group="isShowGroup"
- :group-show-all="groupShowAll"
- :group-row-list="groupRowList"
- :row-checked-list="rowCheckedList"
- :data="data"
- :courseware-id="curSelectId"
- :component-list="cList"
- :background="background"
- :can-remark="false"
- :show-remark="false"
- :component-remark-obj="{}"
- :project="project"
- :is-mobile="isMobile"
- @editNote="handEditNote"
- @saveCollect="saveCollect"
- @getTranslate="getTranslate"
- />
- <div
- v-if="!isMobile"
- class="preview-right"
- :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"
- ></div>
- </main>
- </div>
- </div>
- <ExplanatoryNoteDialog
- ref="explanatoryNote"
- :open.sync="editDialogOpen"
- :init-data="oldRichData"
- :title-text="dialogTitleText"
- :modal="false"
- @confirm="dialogSave"
- @cancel="dialogCancel"
- />
- <TranslateDialog
- :open.sync="showTranslate"
- :modal="false"
- :init-text="translateText"
- :book-id="id"
- title-text="翻译 (机器翻译)"
- />
- </div>
- </template>
- <script>
- import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
- import ExplanatoryNoteDialog from '@/components/ExplanatoryNoteDialog.vue';
- import TranslateDialog from '@/components/TranslateDialog.vue';
- import { isTrue } from '@/utils/validate';
- import { buildCoursewareStyle } from '@/views/book/courseware/preview/common/utils/coursewareStyle';
- import { updateBaseURL } from '@/utils/http';
- import {
- GetMyNoteList,
- AddMyCollect,
- GetMyCollectList,
- DeleteMyNote,
- UpdateMyNote,
- AddMyNote,
- AddCoursewareFeedback,
- DeleteCoursewareFeedback,
- GetCoursewareFeedbackList,
- } from '@/api/book';
- import { ensureExtendedFonts } from '@/common/data';
- const defaultBc = {
- background_image_url: '',
- background_position: {
- left: 0,
- top: 0,
- },
- background: {},
- };
- export default {
- name: 'BookEep',
- components: {
- CoursewarePreview,
- ExplanatoryNoteDialog,
- TranslateDialog,
- },
- provide() {
- return {
- getLang: () => this.lang,
- getChinese: () => this.chinese,
- getShowPinYin: () => this.showPinYin,
- getLangList: () => this.langList,
- convertText: this.convertText,
- getTitleList: () => this.title_list,
- getPermissionControl: () => this.permissionControl,
- };
- },
- props: {
- id: {
- type: String,
- default: '',
- },
- // 组件内容
- content: {
- type: String,
- default: '',
- },
- // 内容分组行列表
- contentGroupRowList: {
- type: String,
- default: '',
- },
- // 组件列表
- componentList: {
- type: Array,
- default: () => [],
- },
- // 教材背景
- bookBackground: {
- type: String,
- default: '',
- },
- permissControl: {
- type: Object,
- default: () => ({}),
- },
- // 外部传入组件用户答案,JSON 格式字符串
- componentUserAnswer: {
- type: String,
- default: '',
- },
- isShowGroup: {
- type: Boolean,
- default: false,
- },
- rowChecked: {
- type: String,
- default: '{}',
- },
- },
- data() {
- const isMobile = /android|iphone|ipad|ipod/i.test(navigator.userAgent || navigator.vendor || window.opera);
- return {
- background: this.bookBackground.length > 0 ? JSON.parse(this.bookBackground) : defaultBc,
- groupRowList: this.contentGroupRowList.length > 0 ? JSON.parse(this.contentGroupRowList) : [],
- data: this.content.length > 0 ? JSON.parse(this.content) : { row_list: [] },
- cList: this.handleComponentList(),
- curSelectId: this.id,
- isTrue,
- project: {
- editor: '', // 作者
- cover_image_file_id: null, // 封面图片ID
- cover_image_file_url: '', // 封面图片URL
- },
- title_list: [],
- node_list: [],
- permissionControl: {
- can_answer: true, // 可作答
- can_judge_correct: false, // 可判断对错(客观题)
- can_show_answer: false, // 可查看答案
- can_correct: false, // 可批改
- can_check_correct: false, // 可查看批改
- },
- popoverShow: false,
- is_can_edit: 'false', // 是否可以编辑
- allCollectList: [],
- newSelectedInfo: {}, // 新的选中信息
- allNoteList: [],
- oldRichData: {},
- editDialogOpen: false,
- dialogType: 0,
- lang: 'ZH',
- chinese: 'zh-Hans',
- showPinYin: 'false',
- langList: [],
- showTranslate: false,
- translateText: '',
- selectedInfo: null,
- allFeedbackList: [],
- drawerType: 1,
- isMobile,
- groupShowAll: false, // 是否显示全部分组内容
- };
- },
- computed: {
- computedCommonPreviewStyle() {
- return buildCoursewareStyle(this.background, 'commonPreview');
- },
- dialogTitleText() {
- if (this.dialogType === 2) return '反馈';
- return '笔记';
- },
- rowCheckedList() {
- const _rowChecked = this.rowChecked === '[]' ? '{}' : this.rowChecked;
- return _rowChecked ? JSON.parse(_rowChecked) : {};
- },
- },
- watch: {
- componentList: {
- handler(newVal) {
- if (newVal && newVal.length > 0) {
- this.cList = this.handleComponentList();
- this.applyComponentUserAnswer();
- }
- },
- deep: true,
- },
- bookBackground: {
- handler(newVal) {
- if (newVal && newVal.length > 0) {
- this.background = JSON.parse(newVal);
- } else {
- this.background = defaultBc;
- }
- },
- },
- content: {
- handler(newVal) {
- if (newVal && newVal.length > 0) {
- this.data = JSON.parse(newVal);
- }
- },
- },
- contentGroupRowList: {
- handler(newVal) {
- if (newVal && newVal.length > 0) {
- this.groupRowList = JSON.parse(newVal);
- }
- },
- },
- id: {
- handler(newVal) {
- if (newVal && newVal.length > 0) {
- this.curSelectId = newVal;
- }
- },
- },
- permissControl: {
- handler(newVal) {
- if (newVal && Object.keys(newVal).length > 0) {
- this.permissionControl = newVal;
- }
- },
- deep: true,
- immediate: true,
- },
- componentUserAnswer: {
- handler() {
- this.applyComponentUserAnswer();
- },
- deep: true,
- immediate: true,
- },
- rowCheckedList: {
- handler(val) {
- this.groupShowAll = Object.keys(val).length === 0;
- },
- deep: true,
- immediate: true,
- },
- },
- created() {
- const origin = window.location.origin;
- if (origin && origin.indexOf('localhost') === -1) {
- updateBaseURL(`${origin}/`);
- }
- },
- mounted() {
- this.applyComponentUserAnswer();
- // 自动注册扩展字体(惰性加载,与主应用共享 _extendedFontsLoaded 标记,仅首次请求)
- ensureExtendedFonts();
- },
- methods: {
- backTop() {
- this.$refs.previewMain.scrollTo({
- top: 0,
- left: 0,
- behavior: 'smooth',
- });
- },
- convertText(text) {
- return text;
- },
- handleComponentList() {
- const processHtmlString = this.processHtmlString;
- const cList = this.componentList || [];
- cList.forEach((x) => {
- if (x.component_type === 'audio') {
- let _c = JSON.parse(x.content);
- let p = _c.property || {};
- if (!p.file_name_display_mode) p.file_name_display_mode = 'true';
- if (p.view_method === 'independent' && !p.style_mode) {
- p.style_mode = 'middle';
- }
- if (!p.style_mode) p.style_mode = 'big';
- if (p.view_method === 'icon') {
- p.file_name_display_mode = 'false';
- p.view_method = 'independent';
- p.style_mode = 'small';
- }
- x.content = JSON.stringify(_c);
- } else if (x.component_type === 'richtext') {
- if (!processHtmlString) return;
- let _c = JSON.parse(x.content);
- let p = _c.property || {};
- let lev = Number(p.title_style_level);
- if (p.is_title !== 'true' || lev < 1 || !_c.content) return;
- let style = this.title_list.find((y) => y.level === lev) || {};
- if (style && style.style) {
- style = JSON.parse(style.style);
- let c_text = _c.content;
- const parser = new DOMParser();
- const doc = parser.parseFromString(c_text, 'text/html');
- const body = doc.body;
- const pElements = body.querySelectorAll('p');
- processHtmlString(pElements, style);
- _c.content = body.innerHTML;
- x.content = JSON.stringify(_c);
- }
- }
- });
- return cList;
- },
- /**
- * 获取所有组件的用户答案,供 UI 包使用者通过 ref 调用
- * @returns {Object} 以组件 id 为键的答案映射
- */
- getAllComponentUserAnswer() {
- const previewList = this.$refs?.courseware?.$refs?.preview || [];
- const answerMap = {};
- previewList.forEach((item) => {
- const id = item?.$el?.dataset?.id;
- if (!id || typeof item.getAnswer !== 'function') return;
- answerMap[id] = item.getAnswer();
- });
- const obj = {
- duration: 0,
- count_not_done: 0,
- count_right: 0,
- count_error: 0,
- content: JSON.stringify(answerMap),
- };
- return JSON.stringify(obj);
- },
- /**
- * 将外部传入的用户答案回填到组件
- */
- applyComponentUserAnswer() {
- if (!this.componentUserAnswer || this.componentUserAnswer.length === 0) return;
- this.$nextTick(() => {
- const previewList = this.$refs?.courseware?.$refs?.preview || [];
- if (!previewList.length) return;
- const answerMap = JSON.parse(this.componentUserAnswer || '{}');
- if (!answerMap || Object.keys(answerMap).length === 0) return;
- previewList.forEach((item) => {
- const id = item?.$el?.dataset?.id;
- if (!id || typeof item.showAnswer !== 'function') return;
- if (!Object.hasOwn(answerMap, id)) return;
- item.showAnswer(true, true, answerMap[id], true);
- });
- });
- },
- processHtmlString(pElements, styleConfig, isClear = false) {
- const _pElements = pElements || [];
- _pElements.forEach((pElement) => {
- if (pElement.innerHTML !== '<br data-mce-bogus="1">') {
- pElement.innerHTML = pElement.innerText;
- }
- if (isClear) {
- pElement.removeAttribute('style');
- pElement.removeAttribute('data-mce-style');
- } else {
- const style = pElement.style;
- if (styleConfig.font) style.fontFamily = styleConfig.font;
- if (styleConfig.font_size) style.fontSize = styleConfig.font_size;
- if (styleConfig.text_color) style.color = styleConfig.text_color;
- style.fontWeight = styleConfig.bold === 'true' ? 'bold' : 'normal';
- style.fontStyle = styleConfig.italic === 'true' ? 'italic' : 'normal';
- if (styleConfig.indent || styleConfig.indent === 0) style.marginLeft = `${styleConfig.indent}px`;
- }
- });
- },
- /**
- * 获取收藏列表
- * @param {Object} params - 参数对象
- * @param {number} params.type - 收藏类型(可选)
- */
- async getCollect(params) {
- if (params && params.type) this.drawerType = Number(params.type);
- this.allCollectList = [];
- await GetMyCollectList({ courseware_id: this.curSelectId }).then((res) => {
- if (res.status === 1) {
- res.collect_list.forEach((x) => {
- if (x.collect_desc) {
- let n = JSON.parse(x.collect_desc);
- let obj = {
- coursewareId: x.courseware_id,
- id: x.id,
- blockId: n.blockId,
- startIndex: n.startIndex,
- endIndex: n.endIndex,
- text: n.text,
- };
- this.allCollectList.push(obj);
- }
- });
- }
- });
- },
- /**
- * 保存收藏
- * @param {Object} collect - 收藏信息对象
- * @param {string} collect.coursewareId - 课件 ID
- * @param {string} collect.blockId - 区块 ID
- * @param {number} collect.startIndex - 起始索引
- * @param {number} collect.endIndex - 结束索引
- * @param {string} collect.text - 收藏文本
- */
- async saveCollect(collect) {
- if (this.allCollectList.length === 0) {
- await this.getCollect();
- }
- let old = this.allCollectList.find(
- (x) =>
- x.coursewareId === collect.coursewareId &&
- x.blockId === collect.blockId &&
- x.startIndex === collect.startIndex &&
- x.endIndex === collect.endIndex,
- );
- if (old) {
- this.$message({
- dangerouslyUseHTMLString: true,
- message: "<i class='el-icon-check' />已收藏",
- });
- return;
- }
- this.newSelectedInfo = collect;
- let collectInfo = {
- blockId: this.newSelectedInfo.blockId,
- startIndex: this.newSelectedInfo.startIndex,
- endIndex: this.newSelectedInfo.endIndex,
- text: this.newSelectedInfo.text,
- };
- let reqData = {
- courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
- component_id: 'WHOLE',
- collect_desc: JSON.stringify(collectInfo), // 位置描述
- };
- AddMyCollect(reqData)
- .then(() => {
- this.getCollect();
- })
- .then(() => {
- this.$message({
- dangerouslyUseHTMLString: true,
- message: "<i class='el-icon-check' />已收藏",
- });
- });
- },
- /**
- * 获取笔记列表
- * @param {Object} params - 参数对象
- */
- async getNote(params) {
- if (params && params.type) this.drawerType = Number(params.type);
- this.allNoteList = [];
- await GetMyNoteList({ courseware_id: this.curSelectId }).then((res) => {
- if (res.status === 1) {
- res.note_list.forEach((x) => {
- if (x.note_desc) {
- let n = JSON.parse(x.note_desc);
- let obj = {
- coursewareId: x.courseware_id,
- id: x.id,
- blockId: n.blockId,
- startIndex: n.startIndex,
- endIndex: n.endIndex,
- text: n.text,
- note: this.addImageMaxWidth(n.note),
- };
- this.allNoteList.push(obj);
- }
- });
- }
- });
- },
- async handEditNote(note) {
- this.oldRichData = {};
- if (this.allNoteList.length === 0) {
- await this.getNote();
- }
- let old = this.allNoteList.find(
- (x) =>
- x.coursewareId === note.coursewareId &&
- x.blockId === note.blockId &&
- x.startIndex === note.startIndex &&
- x.endIndex === note.endIndex,
- );
- if (old) {
- this.oldRichData = old;
- this.oldRichData.dataStr = old.note;
- }
- this.newSelectedInfo = note;
- this.editDialogOpen = true;
- this.dialogType = 1;
- },
- /**
- * 获取翻译
- * @param {Object} info - 翻译信息对象
- * @param {string} info.text - 需要翻译的文本
- */
- async getTranslate(info) {
- this.showTranslate = true;
- this.translateText = info.text;
- },
- dialogSave(obj) {
- if (this.dialogType === 1) return this.saveNote(obj);
- if (this.dialogType === 2) return this.saveFeedback(obj);
- },
- dialogCancel(id) {
- if (this.dialogType === 1) return this.delNote(id);
- if (this.dialogType === 2) return this.delFeedback(id);
- },
- /**
- * 保存笔记
- * @param {Object} note - 笔记信息对象
- * @param {string} note.dataStr - 笔记内容
- */
- saveNote(note) {
- let noteInfo = {
- blockId: this.newSelectedInfo.blockId,
- startIndex: this.newSelectedInfo.startIndex,
- endIndex: this.newSelectedInfo.endIndex,
- note: note.dataStr,
- text: this.newSelectedInfo.text,
- };
- let reqData = {
- courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
- component_id: 'WHOLE',
- note_desc: JSON.stringify(noteInfo), // 位置描述
- };
- if (note.id) {
- if (!noteInfo.note) {
- this.delNote(note.id);
- return;
- }
- let upDate = {
- id: note.id,
- note_desc: reqData.note_desc,
- };
- UpdateMyNote(upDate).then(() => {
- this.getNote();
- });
- } else {
- AddMyNote(reqData).then(() => {
- this.getNote();
- });
- }
- this.editDialogOpen = false;
- this.newSelectedInfo = null;
- this.selectedInfo = null;
- },
- delNote(id) {
- const noteId = id || (this.oldRichData && this.oldRichData.id);
- if (!noteId) return;
- DeleteMyNote({ id: noteId }).then(() => {
- this.allNoteList = this.allNoteList.filter((x) => x.id !== noteId);
- });
- },
- saveFeedback(feedBack) {
- if (feedBack.id) {
- this.delFeedback(feedBack.id);
- }
- if (feedBack.dataStr) {
- let feedBackInfo = {
- blockId: this.newSelectedInfo.blockId,
- startIndex: this.newSelectedInfo.startIndex,
- endIndex: this.newSelectedInfo.endIndex,
- feedBack: feedBack.dataStr,
- text: this.newSelectedInfo.text,
- };
- let reqData = {
- courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
- component_id: 'WHOLE',
- content: JSON.stringify(feedBackInfo),
- content_select: this.newSelectedInfo.text,
- };
- AddCoursewareFeedback(reqData).then(() => {
- this.getFeedback();
- });
- }
- this.editDialogOpen = false;
- this.newSelectedInfo = null;
- this.selectedInfo = null;
- },
- delFeedback(id) {
- const feedBackId = id || (this.oldRichData && this.oldRichData.id);
- if (!feedBackId) return;
- DeleteCoursewareFeedback({ id: feedBackId })
- .then(() => {
- this.allFeedbackList = this.allFeedbackList.filter((x) => x.id !== feedBackId);
- })
- .catch(() => {});
- },
- /**
- * 为HTML内容中的图片添加最大宽度限制
- * @param {string} html - HTML字符串
- * @returns {string} - 处理后的HTML字符串
- */
- addImageMaxWidth(html) {
- if (!html) return html;
- const regex = /<img([^>]*)>/gi;
- return html.replace(regex, (match, attributes) => {
- if (attributes.includes('style=')) {
- return match.replace(/style=["']([^"']*)["']/i, (styleMatch, styleValue) => {
- if (styleValue.includes('max-width')) {
- return styleMatch;
- }
- return `style="${styleValue}; max-width: 200px;"`;
- });
- }
- return `<img${attributes} style="max-width: 200px;">`;
- });
- },
- async getFeedback(params) {
- if (params && params.type) this.drawerType = Number(params.type);
- this.allFeedbackList = [];
- await GetCoursewareFeedbackList({ courseware_id: this.curSelectId }).then((res) => {
- if (res.status === 1 && res.feedback_list) {
- res.feedback_list.forEach((x) => {
- if (x.content) {
- let n = JSON.parse(x.content);
- let obj = {
- coursewareId: x.courseware_id,
- id: x.id,
- blockId: n.blockId,
- startIndex: n.startIndex,
- endIndex: n.endIndex,
- text: n.text,
- feedBack: this.addImageMaxWidth(n.feedBack),
- };
- this.allFeedbackList.push(obj);
- }
- });
- }
- });
- },
- submitPreviewGroupId() {
- return JSON.stringify(this.$refs.courseware.rowCheckList);
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- @use '@/styles/mixin.scss' as *;
- $total-width: $courseware-width + $courseware-left-margin + $courseware-right-margin;
- .common-preview {
- min-width: calc($total-width);
- // 移动端适配
- &.is-mobile {
- min-width: 100%;
- .main-container {
- min-width: 100%;
- }
- .audit-content {
- min-width: 100%;
- }
- main.preview-main {
- width: 100%;
- min-width: 100%;
- max-width: 100%;
- }
- }
- .main-container {
- position: relative;
- flex: 1;
- min-width: 1110px;
- padding: 15px;
- overflow: auto;
- background-color: #ececec;
- .catalogue-bar {
- position: absolute;
- top: 15px;
- left: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 54px;
- height: 54px;
- margin: -9px 6px 0 240px;
- cursor: pointer;
- background-color: #fff;
- border-radius: 2px;
- box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
- }
- .sidebar-bar {
- position: absolute;
- top: 0;
- right: 240px;
- display: flex;
- width: 60px;
- height: calc(100vh - 166px);
- .toolbar {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 60px;
- height: 100%;
- img {
- cursor: pointer;
- }
- &-special {
- display: flex;
- flex-direction: column;
- row-gap: 16px;
- align-items: center;
- width: 100%;
- margin-bottom: 24px;
- background-color: #fff;
- img {
- width: 36px;
- height: 36px;
- }
- }
- }
- }
- }
- .back-top {
- position: absolute;
- right: 240px;
- bottom: 0;
- display: flex;
- place-content: center center;
- align-items: center;
- width: 60px;
- height: 60px;
- cursor: pointer;
- background-color: #fff;
- }
- main.preview-main {
- display: flex;
- flex: 1;
- width: calc($total-width);
- min-width: calc($total-width);
- max-width: calc($total-width);
- min-height: 100%;
- margin: 0 auto;
- background-color: #fff;
- border-radius: 4px;
- box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
- .preview-left {
- width: $courseware-left-margin;
- min-width: $courseware-left-margin;
- max-width: $courseware-left-margin;
- }
- .preview-right {
- width: $courseware-right-margin;
- min-width: $courseware-right-margin;
- max-width: $courseware-right-margin;
- }
- &.no-audit {
- margin: 0 auto;
- }
- }
- .audit-content {
- display: flex;
- min-width: calc($total-width);
- .left-menu {
- display: flex;
- flex-direction: column;
- width: $catalogue-width;
- font-family: 'Microsoft YaHei', 'Arial', sans-serif;
- background-color: #fff;
- .courseware-info {
- display: flex;
- column-gap: 18px;
- width: 100%;
- height: 186px;
- padding: 6px 6px 24px;
- border-bottom: $border;
- .cover-image {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 111px;
- height: 157px;
- background-color: rgba(229, 229, 229, 100%);
- img {
- max-width: 111px;
- max-height: 157px;
- }
- }
- .info-content {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .catalogue-icon {
- text-align: right;
- .svg-icon {
- cursor: pointer;
- }
- }
- .courseware {
- width: 159px;
- height: 64px;
- font-size: 16px;
- .name {
- font-weight: bold;
- }
- .editor {
- display: -webkit-box;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-word;
- white-space: normal;
- -webkit-line-clamp: 2; /* 多行省略行数,按需调整 */
- -webkit-box-orient: vertical;
- }
- }
- }
- }
- }
- .sidebar {
- position: relative;
- display: flex;
- width: $sidebar-width;
- .toolbar {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 60px;
- height: 100%;
- background-color: rgba(247, 248, 250, 100%);
- img {
- cursor: pointer;
- }
- &-special {
- display: flex;
- flex-direction: column;
- row-gap: 16px;
- margin-bottom: 24px;
- }
- &-list {
- display: flex;
- flex-direction: column;
- row-gap: 16px;
- align-items: center;
- width: 100%;
- .sidebar-item {
- width: 100%;
- text-align: center;
- .sidebar-icon {
- width: 36px;
- height: 36px;
- cursor: pointer;
- }
- &.active {
- background-color: #4095e5;
- }
- }
- }
- }
- .content {
- flex: 1;
- background-color: #fff;
- .resource_box {
- height: 100%;
- overflow-y: auto;
- border: 1px solid #e5e5e5;
- h5 {
- position: fixed;
- z-index: 999;
- width: 240px;
- padding: 0 5px;
- margin: 0;
- font-size: 18px;
- line-height: 40px;
- background: #f2f3f5;
- }
- .scroll-container {
- display: flex;
- flex-direction: column;
- row-gap: 8px;
- margin: 6px;
- .list-item {
- display: flex;
- align-items: center;
- cursor: pointer;
- border: 1px solid #ccc;
- border-radius: 8px;
- :deep .el-slider {
- .el-slider__runway {
- background-color: #eee;
- }
- }
- .el-image {
- display: flex;
- width: 100%;
- min-width: 100%;
- height: 90px;
- background-color: #ccc;
- border-radius: 8px;
- }
- .video-play {
- width: 100%;
- min-width: 100%;
- }
- .text-box {
- word-break: break-word;
- }
- }
- }
- p {
- color: #999;
- text-align: center;
- }
- .card-box li {
- padding: 10px;
- border-bottom: 1px solid #ccc;
- .el-icon-notebook-2 {
- display: block;
- margin-bottom: 4px;
- font-size: 12px;
- color: grey;
- }
- }
- }
- }
- .back-top {
- position: absolute;
- bottom: 0;
- left: 0;
- display: flex;
- place-content: center center;
- align-items: center;
- width: 60px;
- height: 60px;
- cursor: pointer;
- }
- }
- }
- }
- :deep .scroll-container .audio-wrapper {
- width: 100% !important;
- .audio-middle {
- width: 100% !important;
- padding: 6px 8px !important;
- border: none;
- border-radius: 8px;
- .audio-name {
- text-align: left;
- }
- .slider-area {
- column-gap: 8px !important;
- }
- :deep .remark-dialog {
- .el-dialog__body {
- padding: 5px 20px;
- }
- }
- :deep .audit-dialog {
- .el-dialog__body {
- height: calc(100vh - 260px);
- padding: 5px 20px;
- }
- .mind-map-container .mind-map {
- height: calc(100vh - 310px);
- }
- }
- }
- }
- .mt10 {
- margin: 10px 0 0 !important;
- background-color: #eee;
- }
- .courseware-tree {
- display: flex;
- flex: 1;
- flex-direction: column;
- row-gap: 8px;
- max-height: calc(100vh - 200px);
- overflow: auto;
- .menu-item {
- display: flex;
- align-items: center;
- &:not(.courseware) {
- font-weight: bold;
- }
- &.courseware {
- &:hover {
- .name {
- background-color: #f3f3f3;
- }
- }
- }
- .svg-icon {
- margin-left: 4px;
- &.my-edit-task {
- color: $right-color;
- }
- }
- .name {
- flex: 1;
- padding: 4px 8px 4px 4px;
- border-radius: 4px;
- }
- &.active {
- .name {
- font-weight: bold;
- color: #4095e5;
- }
- }
- }
- }
- </style>
- <style lang="scss">
- .tox-tinymce-aux {
- z-index: 9999 !important;
- }
- </style>
|