| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024 |
- <template>
- <div class="common-preview">
- <div class="common-preview__header">
- <div class="menu-container">
- {{ courseware_info.book_name }}
- </div>
- <div class="courseware">
- <span class="name-path">{{ courseware_info.name_path }}</span>
- <span class="flow-nodename">{{ courseware_info.cur_audit_flow_node_name }}</span>
- <slot name="middle" :courseware="courseware_info"></slot>
- <template v-if="type === 'edit_preview'">
- <i class="el-icon-setting" style="cursor: pointer" @click="openSimulateAnswerPermissionControl()"></i>
- <span class="link" @click="createCoursewarePreviewURL()">生成课件预览链接</span>
- </template>
- <div class="group">
- <el-checkbox v-model="isShowGroup">显示分组</el-checkbox>
- <el-checkbox v-model="groupShowAll">分组显示全部</el-checkbox>
- <el-checkbox v-model="isJudgeCorrect">判断对错</el-checkbox>
- </div>
- <span class="link">
- <el-select v-model="lang" placeholder="请选择语言" size="mini" class="lang-select">
- <el-option v-for="item in langList" :key="item.type" :label="item.name" :value="item.type" />
- </el-select>
- </span>
- <span class="link">
- <el-checkbox v-model="chinese" true-label="zh-Hant" false-label="zh-Hans">繁体</el-checkbox>
- </span>
- <span v-if="false" class="link">
- <el-checkbox v-model="showPinYin" true-label="true" false-label="false">拼音</el-checkbox>
- </span>
- <div class="operator">
- <slot name="operator" :courseware="courseware_info" :project-id="projectId"></slot>
- </div>
- </div>
- </div>
- <div class="audit-content">
- <!-- 左侧菜单栏 -->
- <aside v-if="navigationShow" class="left-menu">
- <div class="courseware-info">
- <div class="cover-image">
- <img v-if="project.cover_image_file_url.length > 0" :src="project.cover_image_file_url" alt="cover-image" />
- </div>
- <div class="info-content">
- <div class="catalogue-icon" @click="toggleNavigationShow">
- <SvgIcon icon-class="catalogue" size="54" />
- </div>
- <div class="courseware">
- <div class="name nowrap-ellipsis" :title="courseware_info.book_name">
- {{ courseware_info.book_name }}
- </div>
- <div class="editor" :title="project.editor">
- {{ project.editor }}
- </div>
- </div>
- </div>
- </div>
- <!-- 教材章节树 -->
- <div class="courseware-tree">
- <div
- v-for="{ id: nodeId, name, status_name, deep, is_leaf_chapter } in node_list"
- :key="nodeId"
- :class="['menu-item', { active: curSelectId === nodeId }, { courseware: isTrue(is_leaf_chapter) }]"
- :style="computedNameStyle(deep, isTrue(is_leaf_chapter))"
- @click="selectChapterNode(nodeId, isTrue(is_leaf_chapter))"
- >
- <span class="name nowrap-ellipsis" :title="name">
- {{ name }}
- </span>
- <span v-if="['audit', 'edit_preview'].includes(type)" class="status">{{ status_name }}</span>
- </div>
- </div>
- </aside>
- <div
- ref="previewMain"
- class="main-container"
- :style="{ paddingLeft: navigationShow ? '15px' : '315px', paddingRight: sidebarShow ? '15px' : '315px' }"
- >
- <!-- 左侧菜单栏 - 收缩 -->
- <div v-if="!navigationShow && !isFullScreen" class="catalogue-bar" @click="toggleNavigationShow">
- <SvgIcon icon-class="catalogue" size="54" />
- </div>
- <main :class="['preview-main', { 'no-audit': !isShowAudit }]">
- <div class="preview-left"></div>
- <CoursewarePreview
- v-if="courseware_info.book_name"
- ref="courserware"
- :is-show-group="isShowGroup"
- :group-show-all="groupShowAll"
- :group-row-list="content_group_row_list"
- :data="data"
- :courseware-id="curSelectId"
- :component-list="component_list"
- :background="background"
- :can-remark="isTrue(courseware_info.is_my_audit_task) && isTrue(courseware_info.is_can_add_audit_remark)"
- :show-remark="isShowAudit"
- :component-remark-obj="remark_list_obj"
- :project="project"
- @computeScroll="computeScroll"
- @addRemark="addRemark"
- @editNote="handEditNote"
- @saveCollect="saveCollect"
- />
- <div class="preview-right"></div>
- </main>
- <!-- 右侧菜单栏 - 收缩 -->
- <aside v-if="!sidebarShow && !isFullScreen" class="sidebar-bar">
- <aside class="toolbar">
- <div class="toolbar-special">
- <img :src="require('@/assets/icon/sidebar-fullscreen.png')" alt="全屏" @click="fullScreen" />
- <img :src="require('@/assets/icon/sidebar-toolkit.png')" alt="工具箱" />
- <img :src="require(`@/assets/icon/arrow-down.png`)" alt="伸缩" @click="toggleSidebarShow" />
- </div>
- </aside>
- </aside>
- </div>
- <div v-if="!sidebarShow" class="back-top" @click="backTop">
- <img :src="require(`@/assets/icon/back-top.png`)" alt="返回顶部" />
- </div>
- <!-- 右侧工具栏 -->
- <aside v-if="sidebarShow" ref="sidebarMenu" class="sidebar">
- <aside class="toolbar">
- <div class="toolbar-special">
- <img :src="require('@/assets/icon/sidebar-fullscreen.png')" alt="全屏" @click="fullScreen" />
- <img :src="require('@/assets/icon/sidebar-toolkit.png')" alt="工具箱" />
- </div>
- <div v-if="sidebarShow" class="toolbar-list">
- <div
- v-for="{ icon, title, handle, param, children } in sidebarIconList"
- :key="icon"
- :class="['sidebar-item', { active: curToolbarIcon === icon }]"
- :title="title"
- @click="handleSidebarClick(handle, param, icon, children)"
- >
- <div
- class="sidebar-icon icon-mask"
- :style="{
- backgroundColor: curToolbarIcon === icon ? '#fff' : '#1E2129',
- maskImage: `url(${require(`@/assets/icon/sidebar-${icon}.svg`)})`,
- }"
- ></div>
- </div>
- </div>
- <div class="adjustable" @click="toggleSidebarShow">
- <img :src="require(`@/assets/icon/arrow-up.png`)" alt="伸缩" />
- </div>
- </aside>
- <div class="content">
- <div v-if="curToolbarIcon === 'search'" class="resource_box">
- <h5>{{ drawerTitle }}</h5>
- <div style="height: 40px"></div>
- <el-row :gutter="10" style="margin: 5px">
- <el-col :span="16">
- <el-input v-model="searchContent" placeholder="请输入文本内容" clearable />
- </el-col>
- <el-col :span="4">
- <el-button type="primary" @click="querySearchList"> 查询 </el-button>
- </el-col>
- </el-row>
- <div>
- <el-table :data="searchList" :show-header="false">
- <!-- <el-table-column prop="courseware_name" label="课件" />
- <el-table-column prop="component_type" label="组件" /> -->
- <el-table-column>
- <template #default="{ row }">
- {{ row.courseware_name + ' / ' + row.component_type_name }}
- </template>
- </el-table-column>
- <el-table-column label="" width="50">
- <template #default="{ row }">
- <el-link type="primary" @click="handleLocation(row, 0)">定位</el-link>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- <div v-if="curToolbarIcon === 'totalResources'" class="resource_box"></div> -->
- <div v-if="['image', 'audio', 'video', 'text'].includes(twoCurToolbarIcon)" class="resource_box">
- <div class="source-toolbar-list">
- <div
- v-for="{ icon, title, handle, param } in twoSidebarList"
- :key="icon"
- :class="['sidebar-item', { active: twoCurToolbarIcon === icon }]"
- :title="title"
- @click="handleSidebarClick(handle, param, icon, '', 2)"
- >
- <div
- class="sidebar-icon icon-mask"
- :style="{
- backgroundColor: twoCurToolbarIcon === icon ? '#fff' : '#1E2129',
- maskImage: `url(${require(`@/assets/icon/sidebar-${icon}.svg`)})`,
- }"
- ></div>
- </div>
- </div>
- <div style="height: 40px"></div>
- <div style="margin: 5px">
- <span>全部显示 </span>
- <el-switch v-model="multimediaIsAllShow" :active-value="true" :inactive-value="false" />
- </div>
- <el-collapse v-model="activeBookChapterId" accordion @change="multimediaHandleChange">
- <el-collapse-item
- v-for="chapter in bookChapterList"
- :key="chapter.id"
- :name="chapter.id"
- :title="chapter.name"
- >
- <!-- 加载状态 -->
- <div v-if="multimediaLoadingStates" class="loading-text">加载中...</div>
- <!-- 加载完成显示数据 -->
- <div v-else-if="chapter.data">
- <ul
- :class="parseInt(drawerType) == 5 ? 'scroll-container file-list' : 'scroll-container'"
- infinite-scroll-disabled="disabled"
- :infinite-scroll-immediate="false"
- >
- <li v-for="(item, index) in chapter.data" :key="`${chapter.id}-${index}`" class="list-item">
- <template v-if="parseInt(drawerType) === 0">
- <el-image v-if="shouldMediaShowItem(chapter, item)" :src="item.file_url" fit="contain" />
- </template>
- <template v-else-if="parseInt(drawerType) === 1">
- <AudioPlay
- v-if="shouldMediaShowItem(chapter, item)"
- view-size="middle"
- :file-id="item.file_id"
- :file-name="item.file_name.slice(0, item.file_name.lastIndexOf('.'))"
- :show-slider="true"
- :audio-index="index"
- />
- </template>
- <template v-else-if="parseInt(drawerType) === 2">
- <VideoPlay
- v-if="shouldMediaShowItem(chapter, item)"
- view-size="small"
- :file-id="item.file_id"
- :video-index="index"
- />
- </template>
- <template v-else-if="parseInt(drawerType) === 3"> </template>
- <template v-else-if="parseInt(drawerType) === 4"> </template>
- <template v-else-if="parseInt(drawerType) === 5">
- <div class="file-name">
- <el-link>
- <span @click="openFile(item)">
- <SvgIcon icon-class="file" size="24" />
- <p>
- <span>{{ item.file_name }}</span>
- </p>
- </span>
- </el-link>
- </div>
- </template>
- <!-- 资源底部的操作 -->
- <div class="file-handle-info">
- <span v-if="![1, 5].includes(parseInt(drawerType))" class="word">{{ item.file_name }}</span>
- <div class="mark">
- <el-checkbox
- v-model="item.is_hided"
- :disabled="!item.is_can_edit"
- size="small"
- @change="handleMediaShowChange(item)"
- >
- 隐藏
- </el-checkbox>
- <el-link type="primary" class="el-icon-place linkLocation" @click="handleLocation(item, 0)" />
- </div>
- </div>
- </li>
- </ul>
- </div>
- <!-- 加载失败或未加载 -->
- <div v-else class="error-text">没有资源</div>
- </el-collapse-item>
- </el-collapse>
- </div>
- <div v-if="curToolbarIcon === 'collect'" class="resource_box">
- <h5>{{ drawerTitle }}</h5>
- <div style="height: 40px"></div>
- <ul v-if="allCottectList.length > 0" class="card-box">
- <li v-for="item in allCottectList" :key="item.id">
- <span class="el-icon-notebook-2"> 原文</span>
- <span>{{ item.text }}</span>
- <div>
- <el-button type="text" class="el-icon-delete" @click="handDelCollect(item.id)"> 删除</el-button>
- <el-divider direction="vertical" />
- <el-button type="text" class="el-icon-place" @click="handleLocation(item, 12)"> 定位</el-button>
- </div>
- </li>
- </ul>
- </div>
- <div v-if="curToolbarIcon === 'note'" class="resource_box">
- <h5>{{ drawerTitle }}</h5>
- <div style="height: 40px"></div>
- <ul v-if="allNoteList.length > 0" class="card-box">
- <li v-for="item in allNoteList" :key="item.id">
- <span class="el-icon-notebook-2"> 原文</span>
- <span>{{ item.text }}</span>
- <el-divider class="mt10" />
- <span v-html="item.note"></span>
- <div>
- <el-button type="text" class="el-icon-edit" @click="handEditNote(item)"> 编辑</el-button>
- <el-divider direction="vertical" />
- <el-button type="text" class="el-icon-delete" @click="handDelNote(item.id)"> 删除</el-button>
- <el-divider direction="vertical" />
- <el-button type="text" class="el-icon-place" @click="handleLocation(item, 11)"> 定位</el-button>
- </div>
- </li>
- </ul>
- </div>
- <template v-if="curToolbarIcon === 'audit'">
- <AuditRemark :remark-list="remark_list" :is-audit="isShowAudit" @deleteRemarks="deleteRemarks" />
- </template>
- </div>
- <div class="back-top" @click="backTop">
- <img :src="require(`@/assets/icon/back-top.png`)" alt="返回顶部" />
- </div>
- </aside>
- </div>
- <el-dialog
- title="添加课件审校批注"
- :visible="visible"
- width="680px"
- :close-on-click-modal="false"
- class="remark-dialog"
- @close="dialogClose('')"
- >
- <RichText
- v-model="remark_content"
- toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright image media link"
- :wordlimit-num="false"
- :height="240"
- page-from="audit"
- />
- <div slot="footer">
- <el-button @click="dialogClose('')">取消</el-button>
- <el-button type="primary" :loading="submit_loading" @click="addCoursewareAuditRemark(select_node)">
- 确定
- </el-button>
- </div>
- </el-dialog>
- <el-dialog title="" :visible="visibleMindMap" width="1100px" class="audit-dialog" @close="dialogClose('MindMap')">
- <MindMap
- v-if="isChildDataLoad"
- ref="mindMapRef"
- :project-id="projectId"
- :mind-map-json-data="mindMapJsonData"
- @child-click="handleNodeClick"
- />
- </el-dialog>
- <el-dialog
- title=""
- :visible="visibleVisNetwork"
- width="1100px"
- class="audit-dialog"
- :close-on-click-modal="false"
- @close="dialogClose('VisNetwork')"
- >
- <VisNetwork ref="visNetworkRef" :book-id="projectId" @child-click="handleNodeClick" />
- </el-dialog>
- <ExplanatoryNoteDialog
- ref="explanatoryNote"
- :open.sync="editDialogOpen"
- :init-data="oldRichData"
- title-text="笔记"
- @confirm="saveNote"
- @cancel="delNote"
- />
- <SimAnswerPermissionControl :visible.sync="visiblePermissionControl" :permission-control.sync="permissionControl" />
- <PreviewURL :url="preview_url" :visible.sync="visiblePreviewURL" />
- </div>
- </template>
- <script>
- import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
- import RichText from '@/components/RichText.vue';
- import MindMap from '@/components/MindMap.vue';
- import VisNetwork from '@/components/VisNetwork.vue';
- import VideoPlay from '@/views/book/courseware/preview/components/common/VideoPlay.vue';
- import AudioPlay from '@/views/book/courseware/preview/components/common/AudioPlay.vue';
- import AuditRemark from '@/components/AuditRemark.vue';
- import ExplanatoryNoteDialog from '@/components/ExplanatoryNoteDialog.vue';
- import SimAnswerPermissionControl from '@/components/SimAnswerPermissionControl.vue';
- import PreviewURL from '@/views/project_manage/common/PreviewURL.vue';
- import {
- GetBookCoursewareInfo,
- GetProjectBaseInfo,
- GetCoursewareAuditRemarkList,
- AddCoursewareAuditRemark,
- DeleteCoursewareAuditRemarkList,
- GetProjectInfo,
- } from '@/api/project';
- import {
- ContentGetCoursewareContent_View,
- ChapterGetBookChapterStructExpandList,
- GetBookBaseInfo,
- MangerGetBookMindMap,
- GetBookChapterStructExpandList,
- PageQueryBookResourceList,
- GetLanguageTypeList,
- GetMyNoteList,
- DeleteMyNote,
- AddMyNote,
- UpdateMyNote,
- AddMyCollect,
- GetMyCollectList,
- DeleteMyCollect,
- SearchBookContentText,
- SetBookResourceHide,
- } from '@/api/book';
- import { toggleFullScreen } from '@/utils/common';
- import * as OpenCC from 'opencc-js';
- import { isTrue } from '@/utils/validate';
- import { CreateCoursewarePreviewURL } from '@/api/app';
- export default {
- name: 'CommonPreview',
- components: {
- CoursewarePreview,
- RichText,
- MindMap,
- AudioPlay,
- VideoPlay,
- AuditRemark,
- ExplanatoryNoteDialog,
- VisNetwork,
- SimAnswerPermissionControl,
- PreviewURL,
- },
- provide() {
- return {
- getLang: () => this.lang,
- getChinese: () => this.chinese,
- getShowPinYin: () => this.showPinYin,
- getLangList: () => this.langList,
- convertText: this.convertText,
- getTitleList: () => this.title_list,
- getPermissionControl: () => this.permissionControl,
- };
- },
- inject: ['processHtmlString'],
- props: {
- projectId: {
- type: String,
- required: true,
- },
- id: {
- type: String,
- default: '',
- },
- // 是否是审校页面
- isAudit: {
- type: Boolean,
- default: false,
- },
- isShowAudit: {
- type: Boolean,
- default: true,
- },
- isBook: {
- type: Boolean,
- default: false,
- },
- type: {
- type: String,
- default: '',
- },
- },
- data() {
- const sidebarIconList = [
- { icon: 'search', title: '搜索', handle: 'getSearch', param: { type: '13' } },
- { icon: 'mindmap', title: '思维导图', handle: 'openMindMap', param: {} },
- { icon: 'knowledge', title: '知识图谱', handle: 'openVisNetwork', param: {} },
- {
- icon: 'totalResources',
- title: '总资源',
- handle: '',
- param: {},
- children: [
- { icon: 'audio', title: '音频', handle: 'openDrawer', param: { type: '1' } },
- { icon: 'image', title: '图片', handle: 'openDrawer', param: { type: '0' } },
- { icon: 'video', title: '视频', handle: 'openDrawer', param: { type: '2' } },
- { icon: 'text', title: '文本', handle: 'openDrawer', param: { type: '5' } },
- ],
- },
- { icon: 'collect', title: '收藏', handle: 'getCollect', param: { type: '11' } },
- { icon: 'note', title: '笔记', handle: 'getNote', param: { type: '12' } },
- { icon: 'translate', title: '翻译', handle: '', param: {} },
- { icon: 'setting', title: '设置', handle: '', param: {} },
- ];
- if (this.isShowAudit) {
- sidebarIconList.push({ icon: 'audit', title: '审校批注', handle: 'openAudit', param: {} });
- }
- return {
- select_node: this.id,
- courseware_info: {
- book_name: '',
- is_can_start_edit: 'false',
- is_can_submit_audit: 'false',
- is_can_audit_pass: 'false',
- is_can_audit_reject: 'false',
- is_can_add_audit_remark: 'false',
- is_can_finish_audit: 'false',
- is_can_request_shangjia_book: 'false',
- is_can_request_rollback_project: 'false',
- is_can_shangjia_book: 'false',
- is_can_rollback_project: 'false',
- },
- background: {
- background_image_url: '',
- background_position: {
- left: 0,
- top: 0,
- },
- },
- node_list: [],
- data: { row_list: [] },
- component_list: [],
- content_group_row_list: [],
- remark_list: [],
- remark_list_obj: {}, // 存放以组件为对象的批注数组
- searchList: [],
- searchContent: '',
- visible: false,
- remark_content: '',
- submit_loading: false,
- isTrue,
- menuPosition: {
- x: -1,
- y: -1,
- componentId: 'WHOLE',
- },
- curToolbarIcon: this.isShowAudit ? 'audit' : '',
- sidebarIconList,
- twoSidebarList: [],
- twoCurToolbarIcon: '',
- visibleMindMap: false,
- visibleVisNetwork: false,
- isChildDataLoad: false,
- mindMapJsonData: {}, // 思维导图json数据
- drawerType: '', // 抽屉类型
- page_capacity: 10,
- cur_page: 1,
- file_list: [],
- total_count: 0,
- loading: false,
- lastLoadTime: 0,
- minLoadInterval: 3 * 1000,
- isShowGroup: false,
- groupShowAll: true,
- opencc: OpenCC.Converter({ from: 'cn', to: 'tw' }),
- langList: [],
- lang: 'ZH',
- chinese: 'zh-Hans', // 语言简体中文zh-Hans,繁体中文zh-Hant
- showPinYin: 'false',
- isJudgeCorrect: false,
- isShowAnswer: false,
- curSelectId: this.id,
- navigationShow: true,
- sidebarShow: true,
- project: {
- editor: '', // 作者
- cover_image_file_id: null, // 封面图片ID
- cover_image_file_url: '', // 封面图片URL
- },
- allNoteList: [],
- editDialogOpen: false,
- oldRichData: {},
- newSelectedInfo: null,
- allCottectList: [],
- bookChapterList: [],
- book_id: '',
- activeBookChapterId: '',
- multimediaLoadingStates: true,
- multimediaIsAllShow: false,
- isFullScreen: false, // 是否全屏状态
- title_list: [],
- visiblePermissionControl: false, // 模拟答题权限控制弹窗显示状态
- permissionControl: {
- can_answer: true, // 可作答
- can_judge_correct: false, // 可判断对错(客观题)
- can_show_answer: false, // 可查看答案
- can_correct: false, // 可批改
- can_check_correct: false, // 可查看批改
- },
- preview_url: '', // 课件预览链接
- visiblePreviewURL: false, // 预览链接弹窗显示状态
- };
- },
- computed: {
- disabled() {
- const result = this.loading || this.noMore;
- return result;
- },
- noMore() {
- const result = this.file_list.length >= this.total_count;
- return result;
- },
- drawerTitle() {
- const titleMap = {
- 0: '图片资源',
- 1: '音频资源',
- 2: '视频资源',
- 5: '文本资源',
- 11: '收藏列表',
- 12: '笔记列表',
- 13: '搜索结果',
- };
- return titleMap[this.drawerType] || '资源列表';
- },
- shouldMediaShowItem() {
- return (chapter, item) => {
- return this.activeBookChapterId === chapter.id && item && item.file_id;
- };
- },
- },
- watch: {
- isJudgeCorrect(newVal) {
- if (!newVal) {
- this.isShowAnswer = false;
- }
- this.simulateAnswer(newVal);
- },
- isShowAnswer() {
- this.simulateAnswer();
- },
- curSelectId() {
- if (this.curToolbarIcon === 'note') {
- this.getNote();
- } else if (this.curToolbarIcon === 'collect') {
- this.getCollect();
- }
- },
- multimediaIsAllShow(newVal) {
- // 切换显示全部,需清空所有数据,全部重新加载
- this.bookChapterList.forEach((x) => {
- this.$set(x, 'data', null);
- });
- this.multimediaHandleChange();
- },
- },
- created() {
- if (this.id) {
- this.getBookCoursewareInfo(this.id);
- this.getCoursewareComponentContent_View(this.id);
- this.getCoursewareAuditRemarkList(this.id);
- } else {
- this.isBook ? this.getBookBaseInfo() : this.getProjectBaseInfo();
- }
- this.getBookChapterStructExpandList();
- if (!this.isBook) {
- this.getProjectInfo();
- }
- // 监听全屏事件
- document.addEventListener('fullscreenchange', () => {
- if (document.fullscreenElement) {
- this.isFullScreen = true;
- } else {
- this.isFullScreen = false;
- }
- });
- },
- beforeDestroy() {
- document.removeEventListener('fullscreenchange', () => {});
- },
- methods: {
- getProjectBaseInfo() {
- GetProjectBaseInfo({ id: this.projectId }).then(({ project_info }) => {
- this.courseware_info = { ...project_info, book_name: project_info.name };
- });
- },
- getBookBaseInfo() {
- GetBookBaseInfo({ id: this.projectId }).then(({ book_info }) => {
- this.courseware_info = { ...this.courseware_info, ...book_info, book_name: book_info.name };
- this.project = {
- editor: book_info.editor,
- cover_image_file_id: book_info.cover_image_file_id,
- cover_image_file_url: book_info.cover_image_file_url,
- };
- });
- },
- getProjectInfo() {
- GetProjectInfo({ id: this.projectId }).then(({ project_info }) => {
- if (project_info.cover_image_file_url) {
- this.project = project_info;
- }
- });
- },
- /**
- * 得到教材课件信息
- * @param {string} id - 课件ID
- */
- getBookCoursewareInfo(id) {
- GetBookCoursewareInfo({ id, is_contain_producer: 'true', is_contain_auditor: 'true' }).then(
- ({ courseware_info }) => {
- this.courseware_info = { ...this.courseware_info, ...courseware_info };
- this.getLangList();
- },
- );
- },
- /**
- * 得到课件内容(展示内容)
- * @param {string} id - 课件ID
- */
- getCoursewareComponentContent_View(id) {
- ContentGetCoursewareContent_View({ id }).then(
- ({ content, component_list, content_group_row_list, title_list }) => {
- if (title_list) this.title_list = title_list || [];
- if (content) {
- const _content = JSON.parse(content);
- this.data = _content;
- this.background = {
- background_image_url: _content.background_image_url,
- background_position: _content.background_position,
- };
- } else {
- this.data = { row_list: [] };
- }
- let processHtmlString = typeof this.processHtmlString === 'function' ? this.processHtmlString : null;
- if (component_list) this.component_list = component_list;
- this.component_list.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);
- }
- }
- });
- if (content_group_row_list) this.content_group_row_list = JSON.parse(content_group_row_list) || [];
- },
- );
- },
- getLangList() {
- GetLanguageTypeList({ book_id: this.courseware_info.book_id, is_contain_zh: 'true' }).then(
- ({ language_type_list }) => {
- this.langList = language_type_list;
- },
- );
- },
- /**
- * 得到教材章节结构展开列表
- */
- getBookChapterStructExpandList() {
- ChapterGetBookChapterStructExpandList({
- book_id: this.projectId,
- node_deep_mode: 0,
- is_contain_producer: 'true',
- is_contain_auditor: 'true',
- }).then(({ node_list }) => {
- this.node_list = node_list;
- });
- },
- /**
- * 选择节点
- * @param {string} nodeId - 节点ID
- */
- selectNode(nodeId) {
- this.getCoursewareComponentContent_View(nodeId);
- this.getBookCoursewareInfo(nodeId);
- this.getCoursewareAuditRemarkList(nodeId);
- this.select_node = nodeId;
- },
- // 审校批注列表
- getCoursewareAuditRemarkList(id) {
- this.remark_list = [];
- GetCoursewareAuditRemarkList({
- courseware_id: id,
- }).then(({ remark_list }) => {
- this.remark_list = remark_list;
- if (!remark_list) return;
- this.remark_list_obj = remark_list.reduce((acc, item) => {
- if (!acc[item.component_id]) {
- acc[item.component_id] = [];
- }
- acc[item.component_id].push(item);
- return acc;
- }, {});
- });
- },
- addRemark(selectNode, x, y, componentId, content_select) {
- this.remark_content = '';
- this.visible = true;
- if (selectNode) {
- this.menuPosition = {
- x,
- y,
- componentId,
- content_select,
- };
- } else {
- this.menuPosition = {
- x: -1,
- y: -1,
- componentId: 'WHOLE',
- content_select,
- };
- }
- },
- dialogClose(type) {
- this[`visible${type}`] = false;
- },
- // 添加审校批注
- addCoursewareAuditRemark(id) {
- this.submit_loading = true;
- AddCoursewareAuditRemark({
- courseware_id: id || this.id,
- content: this.remark_content,
- component_id: this.menuPosition.componentId,
- position_x: this.menuPosition.x,
- position_y: this.menuPosition.y,
- content_select: this.menuPosition.content_select,
- })
- .then(() => {
- this.submit_loading = false;
- this.visible = false;
- this.getCoursewareAuditRemarkList(id || this.id);
- })
- .catch(() => {
- this.submit_loading = false;
- });
- },
- // 删除批注
- deleteRemarks(id) {
- this.$confirm('确定要删除此条批注吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- DeleteCoursewareAuditRemarkList({ id }).then(() => {
- this.getCoursewareAuditRemarkList(this.select_node ? this.select_node : this.id);
- this.$message.success('删除成功!');
- });
- })
- .catch(() => {});
- },
- // 计算previewMain滑动距离
- computeScroll() {
- this.$refs.courserware.handleResult(
- this.$refs.previewMain.scrollTop,
- this.$refs.previewMain.scrollLeft,
- this.select_node,
- );
- },
- /**
- * 处理侧边栏图标点击事件
- * @param {string} handle - 处理函数名
- * @param {any} param - 处理函数参数
- * @param {string} icon - 图标名称
- */
- handleSidebarClick(handle, param, icon, children, barLevel) {
- if (typeof handle === 'string' && handle && typeof this[handle] === 'function') {
- this[handle](param);
- }
- if (barLevel === 2) {
- this.twoCurToolbarIcon = icon;
- } else {
- this.curToolbarIcon = icon;
- this.twoCurToolbarIcon = '';
- }
- if (children && children.length > 0 && Array.isArray(children)) {
- this.twoSidebarList = children;
- this.twoCurToolbarIcon = children[0].icon;
- this.openDrawer(children[0].param);
- }
- },
- openMindMap() {
- MangerGetBookMindMap({ book_id: this.projectId }).then(({ content }) => {
- if (content) {
- this.mindMapJsonData = JSON.parse(content);
- this.isChildDataLoad = true;
- }
- });
- this.visibleMindMap = true;
- },
- async handleNodeClick(data) {
- let [nodeId, componentId] = data.split('#');
- if (nodeId) this.selectNode(nodeId);
- if (componentId) {
- let node = await this.$refs.courserware.findChildComponentByKey(componentId);
- if (node) {
- await this.$nextTick();
- this.$refs.previewMain.scrollTo({
- top: node.$el.offsetTop - 50,
- left: node.$el.offsetLeft - 50,
- behavior: 'smooth',
- });
- }
- }
- this.visibleMindMap = false;
- this.visibleVisNetwork = false;
- },
- /**
- * 打开知识图谱
- */
- async openVisNetwork() {
- this.visibleVisNetwork = true;
- },
- /**
- * 打开抽屉并初始化加载
- * @param {Object} param - 抽屉参数
- * @param {string} param.type - 抽屉类型(0: 图片, 1: 音频, 2: 视频, 3:H5 游戏,4:3D 模型,5:文本)
- */
- openDrawer({ type }) {
- if (this.drawerType === type) {
- this.drawerType = '';
- return;
- }
- this.activeBookChapterId = '';
- this.multimediaIsAllShow = true;
- // 重置所有加载状态
- this.resetLoadState();
- this.drawerType = type;
- this.$nextTick(() => {
- // 确保DOM更新后触发加载
- this.loadBookChapterStructExpandList();
- });
- },
- openAudit() {
- this.drawerType = '';
- },
- resetLoadState() {
- this.cur_page = 1;
- this.file_list = [];
- this.total_count = 0;
- this.loading = false;
- this.lastLoadTime = 0; // 重置时间戳,允许立即加载
- this.loadCount = 0;
- },
- /**
- * 加载章节
- */
- async loadBookChapterStructExpandList() {
- const params = {
- book_id: this.projectId,
- node_deep_mode: 3, // 节点深度模式 0【全部】,1【只查询章节】2【只查询非叶子章节】3【只查询第一层】
- is_contain_root_node: 'false', // 是否包含根节点(把教材作为根节点)
- is_contain_producer: 'false', // 是否包含制作人信息
- is_contain_auditor: 'false', // 是否包含审核人信息
- };
- await GetBookChapterStructExpandList(params).then(({ node_list }) => {
- this.bookChapterList = node_list || [];
- });
- },
- /**
- * 加载章节下的资源
- */
- async loadmultimediaList() {
- const params = {
- page_capacity: this.page_capacity,
- cur_page: this.cur_page,
- book_id: this.projectId,
- book_chapter_node_id: this.activeBookChapterId,
- type: parseInt(this.drawerType),
- scope: this.multimediaIsAllShow ? -1 : 0,
- };
- await PageQueryBookResourceList(params)
- .then(({ total_count, resource_list }) => {
- this.total_count = total_count;
- this.file_list = resource_list || [];
- this.file_list.forEach((x, i) => {
- this.$set(x, 'is_can_edit', x.is_can_edit === 'true');
- this.$set(x, 'is_hided', x.is_hided === 'true');
- });
- })
- .finally(() => {
- this.loading = false;
- });
- },
- /**
- * 点击章节,切换数据
- */
- async multimediaHandleChange(id) {
- const item = this.bookChapterList.find((item) => item.id === this.activeBookChapterId);
- if (item) {
- this.multimediaLoadingStates = true;
- if ((!item.data && !item.error) || !id) {
- await this.loadmultimediaList();
- let tmpList = this.file_list && this.file_list.length > 0 ? [...this.file_list] : null;
- this.$set(item, 'data', tmpList);
- this.multimediaLoadingStates = false;
- } else {
- this.multimediaLoadingStates = false;
- }
- }
- },
- /**
- * 切换资源显示隐藏
- */
- handleMediaShowChange(item) {
- const params = { id: item.id, is_hided: item.is_hided ? 'true' : 'false' };
- SetBookResourceHide(params).then((res) => {
- // 如果不是显示全部资源,则需要重新加载
- if (!this.multimediaIsAllShow) {
- this.multimediaHandleChange();
- }
- });
- },
- isScrollAtBottom(container) {
- if (!container) return false;
- return container.scrollHeight - container.scrollTop <= container.clientHeight + 5;
- },
- async handleFileClick(courseware_id, component_id) {
- if (courseware_id) this.selectNode(courseware_id);
- if (component_id) {
- let node = await this.$refs.courserware.findChildComponentByKey(component_id);
- if (node) {
- await this.$nextTick();
- this.$refs.previewMain.scrollTo({
- top: node.offsetTop - 50,
- left: node.offsetLeft - 50,
- behavior: 'smooth',
- });
- }
- }
- },
- /**
- * 文本转换
- * @param {string} text - 要转换的文本
- * @returns {string} - 转换后的文本
- */
- convertText(text) {
- if (this.chinese === 'zh-Hant' && this.opencc) {
- try {
- if (/<[a-z][\s\S]*>/i.test(text)) {
- return this.convertHtmlPreserveAttributes(text);
- }
- } catch (e) {
- return text;
- }
- return this.opencc(text);
- }
- return text;
- },
- /**
- * 使用OpenCC解析HTML并仅转换文本节点,保留属性(包括内联样式/font-family)保持不变。防止字体名称像“微软雅黑' 正在转换为'微軟雅黑'.
- */
- convertHtmlPreserveAttributes(html) {
- try {
- const parser = new DOMParser();
- const doc = parser.parseFromString(html, 'text/html'); // 解析HTML字符串,返回Document对象
- // 跳过 script 和 style 标签
- const skipTags = new Set(['SCRIPT', 'STYLE']);
- const walker = doc.createTreeWalker(doc.body, NodeFilter.SHOW_TEXT);
- let node = walker.nextNode();
- while (node) {
- const parent = node.parentNode;
- if (parent && !skipTags.has(parent.nodeName)) {
- const v = node.nodeValue;
- if (v && v.trim()) {
- node.nodeValue = this.opencc(v);
- }
- }
- node = walker.nextNode();
- }
- return doc.body.innerHTML;
- } catch (err) {
- try {
- return this.opencc(html);
- } catch (e) {
- return html;
- }
- }
- },
- simulateAnswer(disabled = true) {
- this.$refs.courserware.simulateAnswer(this.isJudgeCorrect, this.isShowAnswer, disabled);
- },
- /**
- * 选择节点
- * @param {string} nodeId - 节点ID
- * @param {boolean} isLeaf - 是否是叶子节点
- */
- selectChapterNode(nodeId, isLeaf) {
- if (!isLeaf) return;
- if (this.curSelectId === nodeId) return;
- this.curSelectId = nodeId;
- this.selectNode(nodeId);
- },
- /**
- * 计算章节名称样式
- * @param {number} deep - 节点深度
- * @param {boolean} isLeaf - 是否是叶子节点
- * @returns {Object} - 样式对象
- */
- computedNameStyle(deep, isLeaf) {
- return {
- 'padding-left': `${(deep - 1) * 8}px`,
- cursor: isLeaf ? 'pointer' : 'auto',
- };
- },
- /**
- * 切换左侧导航栏显示与隐藏
- */
- toggleNavigationShow() {
- this.navigationShow = !this.navigationShow;
- },
- /**
- * 切换右侧工具栏显示与隐藏
- */
- toggleSidebarShow() {
- this.sidebarShow = !this.sidebarShow;
- },
- backTop() {
- this.$refs.previewMain.scrollTo({
- top: 0,
- left: 0,
- behavior: 'smooth',
- });
- },
- /**
- * 定位到对应位置
- * @param {Object} item - 位置对象
- * @param {number} type - 定位类型(11: 笔记定位, 12: 收藏定位, 0: 资源定位)
- */
- handleLocation(item, type) {
- if (type === 0) {
- let did = `${item.courseware_id}#${item.component_id}`;
- this.handleNodeClick(did);
- this.curSelectId = item.courseware_id;
- return;
- }
- if (this.$refs.courserware && this.$refs.courserware.handleLocation) {
- item.type = type;
- this.$refs.courserware.handleLocation(item);
- }
- },
- openFile(file) {
- if (file && file.file_url) {
- window.open(file.file_url);
- }
- },
- /**
- * 获取笔记列表
- * @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: 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.newSelectedInfo = note;
- this.editDialogOpen = true;
- },
- saveNote(note) {
- let noteInfo = {
- blockId: this.newSelectedInfo.blockId,
- startIndex: this.newSelectedInfo.startIndex,
- endIndex: this.newSelectedInfo.endIndex,
- note: note.note,
- 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;
- },
- handDelNote(id) {
- this.$confirm('确定要删除此条笔记吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- this.delNote(id);
- })
- .catch(() => {});
- },
- 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);
- });
- },
- async getCollect(params) {
- if (params && params.type) this.drawerType = Number(params.type);
- this.allCottectList = [];
- 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.allCottectList.push(obj);
- }
- });
- }
- });
- },
- async saveCollect(collect) {
- if (this.allCottectList.length === 0) {
- await this.getCollect();
- }
- let old = this.allCottectList.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' />已收藏",
- });
- });
- },
- handDelCollect(id) {
- this.$confirm('确定要删除此条收藏吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- DeleteMyCollect({ id }).then(() => {
- this.allCottectList = this.allCottectList.filter((x) => x.id !== id);
- });
- })
- .catch(() => {});
- },
- getSearch(params) {
- if (params && params.type) this.drawerType = Number(params.type);
- },
- async querySearchList() {
- this.searchList = [];
- if (!this.searchContent) return;
- await SearchBookContentText({ book_id: this.projectId, text: this.searchContent }).then((res) => {
- if (res.status === 1) {
- this.searchList = res.courseware_component_list;
- }
- });
- },
- fullScreen() {
- toggleFullScreen(this.$refs.previewMain);
- },
- // 打开模拟答题权限控制弹窗
- openSimulateAnswerPermissionControl() {
- this.visiblePermissionControl = true;
- },
- // 创建课件预览链接
- createCoursewarePreviewURL() {
- CreateCoursewarePreviewURL({ courseware_id: this.select_node, valid_day_count: 20 }).then(({ url }) => {
- this.preview_url = url;
- this.visiblePreviewURL = true;
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- @use '@/styles/mixin.scss' as *;
- $total-width: $courseware-width + $courseware-left-margin + $courseware-right-margin;
- .common-preview {
- &__header {
- position: sticky;
- top: 56px;
- left: 0;
- z-index: 9;
- display: flex;
- align-items: center;
- height: 40px;
- padding: 6px 4px;
- margin-bottom: 5px;
- background-color: #fff;
- border-top: $border;
- border-bottom: $border;
- > .menu-container {
- display: flex;
- justify-content: space-between;
- width: 360px;
- padding: 4px 8px;
- border-right: $border;
- }
- > .courseware {
- display: flex;
- flex-grow: 1;
- column-gap: 16px;
- align-items: center;
- justify-content: space-between;
- height: 40px;
- .name-path {
- min-width: 200px;
- height: 40px;
- padding: 4px 8px;
- font-size: 14px;
- line-height: 32px;
- border-right: $border;
- }
- .lang-select {
- :deep .el-input {
- width: 100px;
- }
- :deep .el-input__inner {
- height: 24px;
- line-height: 24px;
- background-color: #fff;
- }
- :deep .el-input__icon {
- line-height: 24px;
- }
- }
- .flow-nodename {
- flex: 1;
- }
- .group {
- display: flex;
- align-items: center;
- }
- .operator {
- display: flex;
- column-gap: 8px;
- align-items: center;
- .link {
- + .link {
- margin-left: 0;
- &::before {
- margin-right: 8px;
- color: #999;
- content: '|';
- }
- }
- }
- }
- }
- }
- .main-container {
- position: relative;
- flex: 1;
- min-width: 1110px;
- padding: 15px 0;
- 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;
- background-color: $courseware-bgColor;
- }
- .preview-right {
- width: $courseware-right-margin;
- min-width: $courseware-right-margin;
- max-width: $courseware-right-margin;
- background-color: $courseware-bgColor;
- }
- &.no-audit {
- margin: 0 auto;
- }
- }
- .audit-content {
- display: flex;
- min-width: 1810px;
- height: calc(100vh - 166px);
- .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;
- }
- }
- }
- }
- .courseware-tree {
- display: flex;
- flex: 1;
- flex-direction: column;
- row-gap: 8px;
- padding: 12px;
- margin-top: 12px;
- overflow: auto;
- .menu-item {
- display: flex;
- align-items: center;
- &:not(.courseware) {
- font-weight: bold;
- }
- &.courseware {
- &:hover {
- .name,
- .status {
- 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;
- }
- .status {
- height: 32px;
- padding: 4px 8px 4px 4px;
- font-size: 12px;
- line-height: 24px;
- color: #f00004;
- border-radius: 4px;
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- }
- &.active {
- .name {
- font-weight: bold;
- color: #4095e5;
- }
- }
- }
- }
- }
- .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;
- .source-toolbar-list {
- position: fixed;
- z-index: 999;
- display: flex;
- width: 240px;
- background: #f2f3f5;
- .sidebar-item {
- width: 100%;
- padding-top: 5px;
- text-align: center;
- border-right: 1px solid #ccc;
- .sidebar-icon {
- width: 26px;
- height: 26px;
- cursor: pointer;
- }
- &.active {
- background-color: #4095e5;
- }
- }
- }
- 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 {
- align-items: center;
- 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 {
- max-width: 140px;
- color: #999;
- text-align: center;
- word-break: break-all;
- }
- .card-box li {
- padding: 10px;
- border-bottom: 1px solid #ccc;
- .el-icon-notebook-2 {
- display: block;
- margin-bottom: 4px;
- font-size: 12px;
- color: grey;
- }
- }
- .file-handle-info {
- margin: 0 5px;
- .mark {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 3px;
- .linkLocation {
- cursor: pointer;
- }
- }
- .word {
- flex: 1;
- word-break: break-all;
- }
- }
- ::v-deep .el-collapse-item__header {
- margin-left: 5px;
- }
- ::v-deep .el-collapse-item__content {
- padding-bottom: 5px;
- }
- .loading-text {
- padding: 5px;
- color: #999;
- text-align: center;
- }
- .error-text {
- padding: 5px;
- color: #999;
- text-align: center;
- }
- }
- }
- .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;
- margin-left: 0;
- 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;
- }
- .file-list {
- display: flex;
- flex-direction: column;
- row-gap: 5px;
- li {
- align-items: center;
- .file-name {
- display: flex;
- column-gap: 14px;
- align-items: center;
- justify-content: space-between;
- max-width: 500px;
- padding: 8px 12px;
- font-size: 14px;
- color: #1d2129;
- background-color: #f7f8fa;
- border-radius: 8px;
- p {
- margin: 0;
- }
- span,
- div {
- display: flex;
- align-items: center;
- }
- }
- .svg-icon {
- cursor: pointer;
- }
- }
- }
- </style>
- <style lang="scss">
- .tox-tinymce-aux {
- z-index: 9999 !important;
- }
- </style>
|