CommonPreview.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610
  1. <template>
  2. <div class="common-preview">
  3. <div class="common-preview__header">
  4. <div class="menu-container">
  5. {{ courseware_info.book_name }}
  6. </div>
  7. <div class="courseware">
  8. <span class="name-path">{{ courseware_info.name_path }}</span>
  9. <span class="flow-nodename">{{ courseware_info.cur_audit_flow_node_name }}</span>
  10. <slot name="middle" :courseware="courseware_info"></slot>
  11. <div class="group">
  12. <el-checkbox v-model="isShowGroup">显示分组</el-checkbox>
  13. <el-checkbox v-model="groupShowAll">分组显示全部</el-checkbox>
  14. <el-checkbox v-model="isJudgeCorrect">判断对错</el-checkbox>
  15. <el-checkbox v-model="isShowAnswer" :disabled="!isJudgeCorrect">显示答案</el-checkbox>
  16. </div>
  17. <span class="link">
  18. <el-select v-model="lang" placeholder="请选择语言" size="mini" class="lang-select">
  19. <el-option v-for="item in langList" :key="item.type" :label="item.name" :value="item.type" />
  20. </el-select>
  21. </span>
  22. <div class="operator">
  23. <slot name="operator" :courseware="courseware_info" :project-id="projectId"></slot>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="audit-content">
  28. <!-- 左侧菜单栏 -->
  29. <aside v-if="navigationShow" class="left-menu">
  30. <div class="courseware-info">
  31. <div class="cover-image">
  32. <img v-if="project.cover_image_file_url.length > 0" :src="project.cover_image_file_url" alt="cover-image" />
  33. </div>
  34. <div class="info-content">
  35. <div class="catalogue-icon" @click="toggleNavigationShow">
  36. <SvgIcon icon-class="catalogue" size="54" />
  37. </div>
  38. <div class="courseware">
  39. <div class="name nowrap-ellipsis" :title="courseware_info.book_name">
  40. {{ courseware_info.book_name }}
  41. </div>
  42. <div class="editor" :title="project.editor">
  43. {{ project.editor }}
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <!-- 教材章节树 -->
  49. <div class="courseware-tree">
  50. <div
  51. v-for="{ id: nodeId, name, deep, is_leaf_chapter } in node_list"
  52. :key="nodeId"
  53. :class="['menu-item', { active: curSelectId === nodeId }, { courseware: isTrue(is_leaf_chapter) }]"
  54. :style="computedNameStyle(deep, isTrue(is_leaf_chapter))"
  55. @click="selectChapterNode(nodeId, isTrue(is_leaf_chapter))"
  56. >
  57. <span class="name nowrap-ellipsis" :title="name">
  58. {{ name }}
  59. </span>
  60. </div>
  61. </div>
  62. </aside>
  63. <div
  64. ref="previewMain"
  65. class="main-container"
  66. :style="{ paddingLeft: navigationShow ? '15px' : '315px', paddingRight: sidebarShow ? '15px' : '315px' }"
  67. >
  68. <!-- 左侧菜单栏 - 收缩 -->
  69. <div v-if="!navigationShow" class="catalogue-bar" @click="toggleNavigationShow">
  70. <SvgIcon icon-class="catalogue" size="54" />
  71. </div>
  72. <main :class="['preview-main', { 'no-audit': !isShowAudit }]">
  73. <div class="preview-left"></div>
  74. <CoursewarePreview
  75. v-if="courseware_info.book_name"
  76. ref="courserware"
  77. :is-show-group="isShowGroup"
  78. :group-show-all="groupShowAll"
  79. :group-row-list="content_group_row_list"
  80. :data="data"
  81. :courseware-id="curSelectId"
  82. :component-list="component_list"
  83. :background="background"
  84. :can-remark="isTrue(courseware_info.is_my_audit_task) && isTrue(courseware_info.is_can_add_audit_remark)"
  85. :show-remark="isShowAudit"
  86. :component-remark-obj="remark_list_obj"
  87. :project="project"
  88. @computeScroll="computeScroll"
  89. @addRemark="addRemark"
  90. @editNote="handEditNote"
  91. @saveCollect="saveCollect"
  92. />
  93. <div class="preview-right"></div>
  94. </main>
  95. <!-- 右侧菜单栏 - 收缩 -->
  96. <aside v-if="!sidebarShow" class="sidebar-bar">
  97. <aside class="toolbar">
  98. <div class="toolbar-special">
  99. <!-- <img :src="require('@/assets/icon/sidebar-fullscreen.png')" alt="全屏" />
  100. <img :src="require('@/assets/icon/sidebar-toolkit.png')" alt="工具箱" /> -->
  101. <img :src="require(`@/assets/icon/arrow-down.png`)" alt="伸缩" @click="toggleSidebarShow" />
  102. </div>
  103. </aside>
  104. </aside>
  105. </div>
  106. <div v-if="!sidebarShow" class="back-top" @click="backTop">
  107. <img :src="require(`@/assets/icon/back-top.png`)" alt="返回顶部" />
  108. </div>
  109. <!-- 右侧工具栏 -->
  110. <aside v-if="sidebarShow" ref="sidebarMenu" class="sidebar">
  111. <aside class="toolbar">
  112. <div class="toolbar-special">
  113. <!-- <img :src="require('@/assets/icon/sidebar-fullscreen.png')" alt="全屏" />
  114. <img :src="require('@/assets/icon/sidebar-toolkit.png')" alt="工具箱" /> -->
  115. </div>
  116. <div v-if="sidebarShow" class="toolbar-list">
  117. <div
  118. v-for="{ icon, title, handle, param } in sidebarIconList"
  119. :key="icon"
  120. :class="['sidebar-item', { active: curToolbarIcon === icon }]"
  121. :title="title"
  122. @click="handleSidebarClick(handle, param, icon)"
  123. >
  124. <div
  125. class="sidebar-icon icon-mask"
  126. :style="{
  127. backgroundColor: curToolbarIcon === icon ? '#fff' : '#1E2129',
  128. maskImage: `url(${require(`@/assets/icon/sidebar-${icon}.png`)})`,
  129. }"
  130. ></div>
  131. </div>
  132. </div>
  133. <div class="adjustable" @click="toggleSidebarShow">
  134. <img :src="require(`@/assets/icon/arrow-up.png`)" alt="伸缩" />
  135. </div>
  136. </aside>
  137. <div class="content">
  138. <div v-if="curToolbarIcon === 'search'" class="resource_box">
  139. <h5>{{ drawerTitle }}</h5>
  140. <div style="height: 40px"></div>
  141. <el-row :gutter="10" style="margin: 5px -5px">
  142. <el-col :span="16">
  143. <el-input v-model="searchContent" placeholder="请输入文本内容" clearable />
  144. </el-col>
  145. <el-col :span="4">
  146. <el-button type="primary" @click="querySearchList"> 查询 </el-button>
  147. </el-col>
  148. </el-row>
  149. <div>
  150. <el-table :data="searchList" :show-header="false">
  151. <!-- <el-table-column prop="courseware_name" label="课件" />
  152. <el-table-column prop="component_type" label="组件" /> -->
  153. <el-table-column>
  154. <template #default="{ row }">
  155. {{ row.courseware_name + ' / ' + row.component_type_name }}
  156. </template>
  157. </el-table-column>
  158. <el-table-column label="" width="50">
  159. <template #default="{ row }">
  160. <el-link type="primary" @click="handleLocation(row, 3)">定位</el-link>
  161. </template>
  162. </el-table-column>
  163. </el-table>
  164. </div>
  165. </div>
  166. <template v-if="curToolbarIcon === 'audit'">
  167. <AuditRemark :remark-list="remark_list" :is-audit="isShowAudit" @deleteRemarks="deleteRemarks" />
  168. </template>
  169. <div v-if="['image', 'audio', 'video'].includes(curToolbarIcon)" class="resource_box">
  170. <h5>{{ drawerTitle }}</h5>
  171. <div style="height: 40px"></div>
  172. <ul
  173. v-infinite-scroll="loadMore"
  174. class="scroll-container"
  175. infinite-scroll-disabled="disabled"
  176. :infinite-scroll-immediate="false"
  177. >
  178. <li
  179. v-for="(item, index) in file_list"
  180. :key="index"
  181. class="list-item"
  182. @click="handleFileClick(item?.courseware_id, item?.component_id)"
  183. >
  184. <template v-if="parseInt(drawerType) === 0">
  185. <el-image :src="item.file_url" fit="contain" />
  186. </template>
  187. <template v-else-if="parseInt(drawerType) === 1">
  188. <AudioPlay
  189. view-size="middle"
  190. :file-id="item.file_id"
  191. :file-name="item.file_name.slice(0, item.file_name.lastIndexOf('.'))"
  192. :show-slider="true"
  193. :audio-index="index"
  194. />
  195. </template>
  196. <template v-else-if="parseInt(drawerType) === 2">
  197. <VideoPlay view-size="small" :file-id="item.file_id" :video-index="index" />
  198. </template>
  199. </li>
  200. </ul>
  201. <p v-if="loading">加载中...</p>
  202. <p v-if="noMore">没有更多了</p>
  203. </div>
  204. <div v-if="curToolbarIcon === 'note'" class="resource_box">
  205. <h5>{{ drawerTitle }}</h5>
  206. <div style="height: 40px"></div>
  207. <ul v-if="allNoteList.length > 0" class="card-box">
  208. <li v-for="item in allNoteList" :key="item.id">
  209. <span class="el-icon-notebook-2"> 原文</span>
  210. <span>{{ item.text }}</span>
  211. <el-divider class="mt10" />
  212. <span v-html="item.note"></span>
  213. <div class="remark-bottom">
  214. <el-button type="text" class="el-icon-edit" @click="handEditNote(item)"> 编辑</el-button>
  215. <el-divider direction="vertical" />
  216. <el-button type="text" class="el-icon-delete" @click="handDelNote(item.id)"> 删除</el-button>
  217. <el-divider direction="vertical" />
  218. <el-button type="text" class="el-icon-place" @click="handleLocation(item, 1)"> 定位</el-button>
  219. </div>
  220. </li>
  221. </ul>
  222. </div>
  223. <div v-if="curToolbarIcon === 'collect'" class="resource_box">
  224. <h5>{{ drawerTitle }}</h5>
  225. <div style="height: 40px"></div>
  226. <ul v-if="allCottectList.length > 0" class="card-box">
  227. <li v-for="item in allCottectList" :key="item.id">
  228. <span class="el-icon-notebook-2"> 原文</span>
  229. <span>{{ item.text }}</span>
  230. <div class="remark-bottom">
  231. <el-button type="text" class="el-icon-delete" @click="handDelCollect(item.id)"> 删除</el-button>
  232. <el-divider direction="vertical" />
  233. <el-button type="text" class="el-icon-place" @click="handleLocation(item, 2)"> 定位</el-button>
  234. </div>
  235. </li>
  236. </ul>
  237. </div>
  238. </div>
  239. <div class="back-top" @click="backTop">
  240. <img :src="require(`@/assets/icon/back-top.png`)" alt="返回顶部" />
  241. </div>
  242. </aside>
  243. </div>
  244. <el-dialog
  245. title="添加课件审校批注"
  246. :visible="visible"
  247. width="680px"
  248. :close-on-click-modal="false"
  249. class="remark-dialog"
  250. @close="dialogClose('')"
  251. >
  252. <RichText
  253. v-model="remark_content"
  254. toolbar="fontselect fontsizeselect forecolor backcolor | underline | bold italic strikethrough alignleft aligncenter alignright"
  255. :wordlimit-num="false"
  256. :height="240"
  257. page-from="audit"
  258. />
  259. <div slot="footer">
  260. <el-button @click="dialogClose('')">取消</el-button>
  261. <el-button type="primary" :loading="submit_loading" @click="addCoursewareAuditRemark(select_node)">
  262. 确定
  263. </el-button>
  264. </div>
  265. </el-dialog>
  266. <el-dialog title="" :visible="visibleMindMap" width="1100px" class="audit-dialog" @close="dialogClose('MindMap')">
  267. <MindMap
  268. v-if="isChildDataLoad"
  269. ref="mindMapRef"
  270. :project-id="projectId"
  271. :mind-map-json-data="mindMapJsonData"
  272. @child-click="handleNodeClick"
  273. />
  274. </el-dialog>
  275. <el-dialog
  276. title=""
  277. :visible="visibleVisNetwork"
  278. width="1100px"
  279. class="audit-dialog"
  280. :close-on-click-modal="false"
  281. @close="dialogClose('VisNetwork')"
  282. >
  283. <VisNetwork ref="visNetworkRef" :book-id="projectId" @child-click="handleNodeClick" />
  284. </el-dialog>
  285. <ExplanatoryNoteDialog
  286. ref="explanatoryNote"
  287. :open.sync="editDialogOpen"
  288. :init-data="oldRichData"
  289. title-text="笔记"
  290. @confirm="saveNote"
  291. @cancel="delNote"
  292. />
  293. </div>
  294. </template>
  295. <script>
  296. import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
  297. import RichText from '@/components/RichText.vue';
  298. import { isTrue } from '@/utils/validate';
  299. import MindMap from '@/components/MindMap.vue';
  300. import VisNetwork from '@/components/VisNetwork.vue';
  301. import VideoPlay from '@/views/book/courseware/preview/components/common/VideoPlay.vue';
  302. import AudioPlay from '@/views/book/courseware/preview/components/common/AudioPlay.vue';
  303. import AuditRemark from '@/components/AuditRemark.vue';
  304. import ExplanatoryNoteDialog from '@/components/ExplanatoryNoteDialog.vue';
  305. import * as OpenCC from 'opencc-js';
  306. import {
  307. GetBookCoursewareInfo,
  308. GetProjectBaseInfo,
  309. GetCoursewareAuditRemarkList,
  310. AddCoursewareAuditRemark,
  311. DeleteCoursewareAuditRemarkList,
  312. GetProjectInfo,
  313. } from '@/api/project';
  314. import {
  315. ContentGetCoursewareContent_View,
  316. ChapterGetBookChapterStructExpandList,
  317. GetBookBaseInfo,
  318. MangerGetBookMindMap,
  319. PageQueryBookResourceList,
  320. GetLanguageTypeList,
  321. GetBookUnifiedAttrib,
  322. GetMyNoteList,
  323. DeleteMyNote,
  324. AddMyNote,
  325. UpdateMyNote,
  326. AddMyCollect,
  327. GetMyCollectList,
  328. DeleteMyCollect,
  329. SearchBookContentText,
  330. } from '@/api/book';
  331. export default {
  332. name: 'CommonPreview',
  333. components: {
  334. CoursewarePreview,
  335. RichText,
  336. MindMap,
  337. AudioPlay,
  338. VideoPlay,
  339. AuditRemark,
  340. ExplanatoryNoteDialog,
  341. VisNetwork,
  342. },
  343. provide() {
  344. return {
  345. getLang: () => this.lang,
  346. getChinese: () => this.chinese,
  347. getLangList: () => this.langList,
  348. convertText: this.convertText,
  349. };
  350. },
  351. props: {
  352. projectId: {
  353. type: String,
  354. required: true,
  355. },
  356. id: {
  357. type: String,
  358. default: '',
  359. },
  360. // 是否是审校页面
  361. isAudit: {
  362. type: Boolean,
  363. default: false,
  364. },
  365. isShowAudit: {
  366. type: Boolean,
  367. default: true,
  368. },
  369. isBook: {
  370. type: Boolean,
  371. default: false,
  372. },
  373. },
  374. data() {
  375. const sidebarIconList = [
  376. // { icon: 'search', title: '搜索', handle: '', param: {} },
  377. { icon: 'mindmap', title: '思维导图', handle: 'openMindMap', param: {} },
  378. { icon: 'knowledge', title: '知识图谱', handle: 'openVisNetwork', param: {} },
  379. // { icon: 'totalResources', title: '总资源', handle: '', param: {} },
  380. { icon: 'search', title: '搜索', handle: 'getSearch', param: { type: '5' } },
  381. { icon: 'collect', title: '收藏', handle: 'getCollect', param: { type: '3' } },
  382. { icon: 'audio', title: '音频', handle: 'openDrawer', param: { type: '1' } },
  383. { icon: 'image', title: '图片', handle: 'openDrawer', param: { type: '0' } },
  384. { icon: 'video', title: '视频', handle: 'openDrawer', param: { type: '2' } },
  385. { icon: 'note', title: '笔记', handle: 'getNote', param: { type: '4' } },
  386. // { icon: 'translate', title: '翻译', handle: '', param: {} },
  387. // { icon: 'setting', title: '设置', handle: '', param: {} },
  388. ];
  389. if (this.isShowAudit) {
  390. sidebarIconList.push({ icon: 'audit', title: '审校批注', handle: 'openAudit', param: {} });
  391. }
  392. return {
  393. select_node: this.id,
  394. courseware_info: {
  395. book_name: '',
  396. is_can_start_edit: 'false',
  397. is_can_submit_audit: 'false',
  398. is_can_audit_pass: 'false',
  399. is_can_audit_reject: 'false',
  400. is_can_add_audit_remark: 'false',
  401. is_can_finish_audit: 'false',
  402. is_can_request_shangjia_book: 'false',
  403. is_can_request_rollback_project: 'false',
  404. is_can_shangjia_book: 'false',
  405. is_can_rollback_project: 'false',
  406. },
  407. background: {
  408. background_image_url: '',
  409. background_position: {
  410. left: 0,
  411. top: 0,
  412. },
  413. },
  414. node_list: [],
  415. data: { row_list: [] },
  416. component_list: [],
  417. content_group_row_list: [],
  418. remark_list: [],
  419. remark_list_obj: {}, // 存放以组件为对象的批注数组
  420. searchList: [],
  421. searchContent: '',
  422. visible: false,
  423. remark_content: '',
  424. submit_loading: false,
  425. isTrue,
  426. menuPosition: {
  427. x: -1,
  428. y: -1,
  429. componentId: 'WHOLE',
  430. },
  431. curToolbarIcon: this.isShowAudit ? 'audit' : '',
  432. sidebarIconList,
  433. visibleMindMap: false,
  434. visibleVisNetwork: false,
  435. isChildDataLoad: false,
  436. mindMapJsonData: {}, // 思维导图json数据
  437. drawerType: '', // 抽屉类型
  438. page_capacity: 10,
  439. cur_page: 1,
  440. file_list: [],
  441. total_count: 0,
  442. loading: false,
  443. lastLoadTime: 0,
  444. minLoadInterval: 3 * 1000,
  445. isShowGroup: false,
  446. groupShowAll: true,
  447. opencc: OpenCC.Converter({ from: 'cn', to: 'tw' }),
  448. langList: [],
  449. lang: 'ZH',
  450. chinese: 'zh-Hans',
  451. isJudgeCorrect: false,
  452. isShowAnswer: false,
  453. unified_attrib: {},
  454. curSelectId: this.id,
  455. navigationShow: true,
  456. sidebarShow: true,
  457. project: {
  458. editor: '', // 作者
  459. cover_image_file_id: null, // 封面图片ID
  460. cover_image_file_url: '', // 封面图片URL
  461. },
  462. allNoteList: [],
  463. editDialogOpen: false,
  464. oldRichData: {},
  465. newSelectedInfo: null,
  466. allCottectList: [],
  467. book_id: '',
  468. };
  469. },
  470. computed: {
  471. disabled() {
  472. const result = this.loading || this.noMore;
  473. return result;
  474. },
  475. noMore() {
  476. const result = this.file_list.length >= this.total_count;
  477. return result;
  478. },
  479. drawerTitle() {
  480. const titleMap = {
  481. 0: '图片资源',
  482. 1: '音频资源',
  483. 2: '视频资源',
  484. 3: '收藏列表',
  485. 4: '笔记列表',
  486. 5: '搜索结果',
  487. };
  488. return titleMap[this.drawerType] || '资源列表';
  489. },
  490. },
  491. watch: {
  492. isJudgeCorrect(newVal) {
  493. if (!newVal) {
  494. this.isShowAnswer = false;
  495. }
  496. this.simulateAnswer(newVal);
  497. },
  498. isShowAnswer() {
  499. this.simulateAnswer();
  500. },
  501. curSelectId() {
  502. if (this.curToolbarIcon === 'note') {
  503. this.getNote();
  504. } else if (this.curToolbarIcon === 'collect') {
  505. this.getCollect();
  506. }
  507. },
  508. },
  509. created() {
  510. if (this.id) {
  511. this.getBookCoursewareInfo(this.id);
  512. this.getCoursewareComponentContent_View(this.id);
  513. this.getCoursewareAuditRemarkList(this.id);
  514. } else {
  515. this.isBook ? this.getBookBaseInfo() : this.getProjectBaseInfo();
  516. }
  517. this.getBookChapterStructExpandList();
  518. this.getBookUnifiedAttr();
  519. if (!this.isBook) {
  520. this.getProjectInfo();
  521. }
  522. },
  523. methods: {
  524. getProjectBaseInfo() {
  525. GetProjectBaseInfo({ id: this.projectId }).then(({ project_info }) => {
  526. this.courseware_info = { ...project_info, book_name: project_info.name };
  527. });
  528. },
  529. getBookBaseInfo() {
  530. GetBookBaseInfo({ id: this.projectId }).then(({ book_info }) => {
  531. this.courseware_info = { ...this.courseware_info, ...book_info, book_name: book_info.name };
  532. this.project = {
  533. editor: book_info.editor,
  534. cover_image_file_id: book_info.cover_image_file_id,
  535. cover_image_file_url: book_info.cover_image_file_url,
  536. };
  537. });
  538. },
  539. getProjectInfo() {
  540. GetProjectInfo({ id: this.projectId }).then(({ project_info }) => {
  541. if (project_info.cover_image_file_url) {
  542. this.project = project_info;
  543. }
  544. });
  545. },
  546. /**
  547. * 得到教材课件信息
  548. * @param {string} id - 课件ID
  549. */
  550. getBookCoursewareInfo(id) {
  551. GetBookCoursewareInfo({ id, is_contain_producer: 'true', is_contain_auditor: 'true' }).then(
  552. ({ courseware_info }) => {
  553. this.courseware_info = { ...this.courseware_info, ...courseware_info };
  554. this.getLangList();
  555. },
  556. );
  557. },
  558. /**
  559. * 得到课件内容(展示内容)
  560. * @param {string} id - 课件ID
  561. */
  562. getCoursewareComponentContent_View(id) {
  563. ContentGetCoursewareContent_View({ id }).then(({ content, component_list, content_group_row_list }) => {
  564. if (content) {
  565. const _content = JSON.parse(content);
  566. this.data = _content;
  567. this.background = {
  568. background_image_url: _content.background_image_url,
  569. background_position: _content.background_position,
  570. };
  571. } else {
  572. this.data = { row_list: [] };
  573. }
  574. if (component_list) this.component_list = component_list;
  575. if (content_group_row_list) this.content_group_row_list = JSON.parse(content_group_row_list) || [];
  576. });
  577. },
  578. getLangList() {
  579. GetLanguageTypeList({ book_id: this.courseware_info.book_id, is_contain_zh: 'true' }).then(
  580. ({ language_type_list }) => {
  581. this.langList = language_type_list;
  582. },
  583. );
  584. },
  585. /**
  586. * 得到教材章节结构展开列表
  587. */
  588. getBookChapterStructExpandList() {
  589. ChapterGetBookChapterStructExpandList({
  590. book_id: this.projectId,
  591. node_deep_mode: 0,
  592. is_contain_producer: 'true',
  593. is_contain_auditor: 'true',
  594. }).then(({ node_list }) => {
  595. this.node_list = node_list;
  596. });
  597. },
  598. getBookUnifiedAttr() {
  599. GetBookUnifiedAttrib({ book_id: this.projectId }).then(({ content }) => {
  600. if (content) {
  601. this.unified_attrib = JSON.parse(content);
  602. }
  603. });
  604. },
  605. /**
  606. * 选择节点
  607. * @param {string} nodeId - 节点ID
  608. */
  609. selectNode(nodeId) {
  610. this.getCoursewareComponentContent_View(nodeId);
  611. this.getBookCoursewareInfo(nodeId);
  612. this.getCoursewareAuditRemarkList(nodeId);
  613. this.select_node = nodeId;
  614. },
  615. // 审校批注列表
  616. getCoursewareAuditRemarkList(id) {
  617. this.remark_list = [];
  618. GetCoursewareAuditRemarkList({
  619. courseware_id: id,
  620. }).then(({ remark_list }) => {
  621. this.remark_list = remark_list;
  622. if (!remark_list) return;
  623. this.remark_list_obj = remark_list.reduce((acc, item) => {
  624. if (!acc[item.component_id]) {
  625. acc[item.component_id] = [];
  626. }
  627. acc[item.component_id].push(item);
  628. return acc;
  629. }, {});
  630. });
  631. },
  632. addRemark(selectNode, x, y, componentId) {
  633. this.remark_content = '';
  634. this.visible = true;
  635. if (selectNode) {
  636. this.menuPosition = {
  637. x,
  638. y,
  639. componentId,
  640. };
  641. } else {
  642. this.menuPosition = {
  643. x: -1,
  644. y: -1,
  645. componentId: 'WHOLE',
  646. };
  647. }
  648. },
  649. dialogClose(type) {
  650. this[`visible${type}`] = false;
  651. },
  652. // 添加审校批注
  653. addCoursewareAuditRemark(id) {
  654. this.submit_loading = true;
  655. AddCoursewareAuditRemark({
  656. courseware_id: id || this.id,
  657. content: this.remark_content,
  658. component_id: this.menuPosition.componentId,
  659. position_x: this.menuPosition.x,
  660. position_y: this.menuPosition.y,
  661. })
  662. .then(() => {
  663. this.submit_loading = false;
  664. this.visible = false;
  665. this.getCoursewareAuditRemarkList(id || this.id);
  666. })
  667. .catch(() => {
  668. this.submit_loading = false;
  669. });
  670. },
  671. // 删除批注
  672. deleteRemarks(id) {
  673. this.$confirm('确定要删除此条批注吗?', '提示', {
  674. confirmButtonText: '确定',
  675. cancelButtonText: '取消',
  676. type: 'warning',
  677. })
  678. .then(() => {
  679. DeleteCoursewareAuditRemarkList({ id }).then(() => {
  680. this.getCoursewareAuditRemarkList(this.select_node ? this.select_node : this.id);
  681. this.$message.success('删除成功!');
  682. });
  683. })
  684. .catch(() => {});
  685. },
  686. // 计算previewMain滑动距离
  687. computeScroll() {
  688. this.$refs.courserware.handleResult(
  689. this.$refs.previewMain.scrollTop,
  690. this.$refs.previewMain.scrollLeft,
  691. this.select_node,
  692. );
  693. },
  694. /**
  695. * 处理侧边栏图标点击事件
  696. * @param {string} handle - 处理函数名
  697. * @param {any} param - 处理函数参数
  698. * @param {string} icon - 图标名称
  699. */
  700. handleSidebarClick(handle, param, icon) {
  701. if (typeof handle === 'string' && handle && typeof this[handle] === 'function') {
  702. this[handle](param);
  703. }
  704. this.curToolbarIcon = icon;
  705. },
  706. openMindMap() {
  707. MangerGetBookMindMap({ book_id: this.projectId }).then(({ content }) => {
  708. if (content) {
  709. this.mindMapJsonData = JSON.parse(content);
  710. this.isChildDataLoad = true;
  711. }
  712. });
  713. this.visibleMindMap = true;
  714. },
  715. async handleNodeClick(data) {
  716. let [nodeId, componentId] = data.split('#');
  717. if (nodeId) this.selectNode(nodeId);
  718. if (componentId) {
  719. let node = await this.$refs.courserware.findChildComponentByKey(componentId);
  720. if (node) {
  721. await this.$nextTick();
  722. this.$refs.previewMain.scrollTo({
  723. top: node.$el.offsetTop - 50,
  724. left: node.$el.offsetLeft - 50,
  725. behavior: 'smooth',
  726. });
  727. }
  728. }
  729. this.visibleMindMap = false;
  730. this.visibleVisNetwork = false;
  731. },
  732. async openVisNetwork() {
  733. this.visibleVisNetwork = true;
  734. },
  735. /**
  736. * 打开抽屉并初始化加载
  737. * @param {Object} param - 抽屉参数
  738. * @param {string} param.type - 抽屉类型(0: 图片, 1: 音频, 2: 视频)
  739. */
  740. openDrawer({ type }) {
  741. if (this.drawerType === type) {
  742. this.drawerType = '';
  743. return;
  744. }
  745. // 重置所有加载状态
  746. this.resetLoadState();
  747. this.drawerType = type;
  748. this.$nextTick(() => {
  749. // 确保DOM更新后触发加载
  750. this.loadMore();
  751. });
  752. },
  753. openAudit() {
  754. this.drawerType = '';
  755. },
  756. resetLoadState() {
  757. this.cur_page = 1;
  758. this.file_list = [];
  759. this.total_count = 0;
  760. this.loading = false;
  761. this.lastLoadTime = 0; // 重置时间戳,允许立即加载
  762. this.loadCount = 0;
  763. },
  764. // 加载更多数据
  765. async loadMore() {
  766. const now = Date.now();
  767. // 只有当lastLoadTime不为0(不是第一次)且时间间隔太短时才return
  768. if (this.lastLoadTime > 0 && now - this.lastLoadTime < this.minLoadInterval) {
  769. return;
  770. }
  771. if (this.disabled || this.loading) {
  772. if (this.lastLoadTime > 0) {
  773. return;
  774. }
  775. }
  776. this.loading = true;
  777. const params = {
  778. page_capacity: this.page_capacity,
  779. cur_page: this.cur_page,
  780. book_id: this.projectId,
  781. type: parseInt(this.drawerType),
  782. };
  783. await PageQueryBookResourceList(params)
  784. .then(({ total_count, resource_list }) => {
  785. this.total_count = total_count;
  786. // 记录加载前的滚动高度
  787. const scrollContainer = this.$el.querySelector('.scroll-container');
  788. const isAtBottom = this.isScrollAtBottom(scrollContainer);
  789. this.file_list = this.cur_page === 1 ? resource_list : [...this.file_list, ...resource_list];
  790. if (!resource_list || resource_list.length === 0) {
  791. return;
  792. }
  793. this.cur_page += 1;
  794. // 只有当前已经在底部时才微调滚动位置
  795. if (isAtBottom) {
  796. this.$nextTick(() => {
  797. // 轻微向上滚动,创造滚动空间
  798. scrollContainer.scrollTop -= 5;
  799. });
  800. }
  801. })
  802. .finally(() => {
  803. this.loading = false;
  804. this.lastLoadTime = now;
  805. });
  806. },
  807. isScrollAtBottom(container) {
  808. if (!container) return false;
  809. return container.scrollHeight - container.scrollTop <= container.clientHeight + 5;
  810. },
  811. async handleFileClick(courseware_id, component_id) {
  812. if (courseware_id) this.selectNode(courseware_id);
  813. if (component_id) {
  814. let node = await this.$refs.courserware.findChildComponentByKey(component_id);
  815. if (node) {
  816. await this.$nextTick();
  817. this.$refs.previewMain.scrollTo({
  818. top: node.offsetTop - 50,
  819. left: node.offsetLeft - 50,
  820. behavior: 'smooth',
  821. });
  822. }
  823. }
  824. },
  825. /**
  826. * 文本转换
  827. * @param {string} text - 要转换的文本
  828. * @returns {string} - 转换后的文本
  829. */
  830. convertText(text) {
  831. if (this.chinese === 'zh-Hant' && this.opencc) {
  832. return this.opencc(text);
  833. }
  834. return text;
  835. },
  836. simulateAnswer(disabled = true) {
  837. this.$refs.courserware.simulateAnswer(this.isJudgeCorrect, this.isShowAnswer, disabled);
  838. },
  839. /**
  840. * 选择节点
  841. * @param {string} nodeId - 节点ID
  842. * @param {boolean} isLeaf - 是否是叶子节点
  843. */
  844. selectChapterNode(nodeId, isLeaf) {
  845. if (!isLeaf) return;
  846. if (this.curSelectId === nodeId) return;
  847. this.curSelectId = nodeId;
  848. this.selectNode(nodeId);
  849. },
  850. /**
  851. * 计算章节名称样式
  852. * @param {number} deep - 节点深度
  853. * @param {boolean} isLeaf - 是否是叶子节点
  854. * @returns {Object} - 样式对象
  855. */
  856. computedNameStyle(deep, isLeaf) {
  857. return {
  858. 'padding-left': `${(deep - 1) * 8}px`,
  859. cursor: isLeaf ? 'pointer' : 'auto',
  860. };
  861. },
  862. /**
  863. * 切换左侧导航栏显示与隐藏
  864. */
  865. toggleNavigationShow() {
  866. this.navigationShow = !this.navigationShow;
  867. },
  868. /**
  869. * 切换右侧工具栏显示与隐藏
  870. */
  871. toggleSidebarShow() {
  872. this.sidebarShow = !this.sidebarShow;
  873. },
  874. backTop() {
  875. this.$refs.previewMain.scrollTo({
  876. top: 0,
  877. left: 0,
  878. behavior: 'smooth',
  879. });
  880. },
  881. handleLocation(item, type) {
  882. if (type === 3) {
  883. let did = `${item.courseware_id}#${item.component_id}`;
  884. this.handleNodeClick(did);
  885. return;
  886. }
  887. if (this.$refs.courserware && this.$refs.courserware.handleLocation) {
  888. item.type = type;
  889. this.$refs.courserware.handleLocation(item);
  890. }
  891. },
  892. async getNote(params) {
  893. if (params && params.type) this.drawerType = Number(params.type);
  894. this.allNoteList = [];
  895. await GetMyNoteList({ courseware_id: this.curSelectId }).then((res) => {
  896. if (res.status === 1) {
  897. res.note_list.forEach((x) => {
  898. if (x.note_desc) {
  899. let n = JSON.parse(x.note_desc);
  900. let obj = {
  901. coursewareId: x.courseware_id,
  902. id: x.id,
  903. blockId: n.blockId,
  904. startIndex: n.startIndex,
  905. endIndex: n.endIndex,
  906. text: n.text,
  907. note: n.note,
  908. };
  909. this.allNoteList.push(obj);
  910. }
  911. });
  912. }
  913. });
  914. },
  915. async handEditNote(note) {
  916. this.oldRichData = {};
  917. if (this.allNoteList.length === 0) {
  918. await this.getNote();
  919. }
  920. let old = this.allNoteList.find(
  921. (x) =>
  922. x.coursewareId === note.coursewareId &&
  923. x.blockId === note.blockId &&
  924. x.startIndex === note.startIndex &&
  925. x.endIndex === note.endIndex,
  926. );
  927. if (old) {
  928. this.oldRichData = old;
  929. }
  930. this.newSelectedInfo = note;
  931. this.editDialogOpen = true;
  932. },
  933. saveNote(note) {
  934. let noteInfo = {
  935. blockId: this.newSelectedInfo.blockId,
  936. startIndex: this.newSelectedInfo.startIndex,
  937. endIndex: this.newSelectedInfo.endIndex,
  938. note: note.note,
  939. text: this.newSelectedInfo.text,
  940. };
  941. let reqData = {
  942. courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
  943. component_id: 'WHOLE',
  944. note_desc: JSON.stringify(noteInfo), // 位置描述
  945. };
  946. if (note.id) {
  947. if (!noteInfo.note) {
  948. this.delNote(note.id);
  949. return;
  950. }
  951. let upDate = {
  952. id: note.id,
  953. note_desc: reqData.note_desc,
  954. };
  955. UpdateMyNote(upDate).then(() => {
  956. this.getNote();
  957. });
  958. } else {
  959. AddMyNote(reqData).then(() => {
  960. this.getNote();
  961. });
  962. }
  963. this.editDialogOpen = false;
  964. this.newSelectedInfo = null;
  965. this.selectedInfo = null;
  966. },
  967. handDelNote(id) {
  968. this.$confirm('确定要删除此条笔记吗?', '提示', {
  969. confirmButtonText: '确定',
  970. cancelButtonText: '取消',
  971. type: 'warning',
  972. })
  973. .then(() => {
  974. this.delNote(id);
  975. })
  976. .catch(() => {});
  977. },
  978. delNote(id) {
  979. const noteId = id || (this.oldRichData && this.oldRichData.id);
  980. if (!noteId) return;
  981. DeleteMyNote({ id: noteId }).then(() => {
  982. this.allNoteList = this.allNoteList.filter((x) => x.id !== noteId);
  983. });
  984. },
  985. async getCollect(params) {
  986. if (params && params.type) this.drawerType = Number(params.type);
  987. this.allCottectList = [];
  988. await GetMyCollectList({ courseware_id: this.curSelectId }).then((res) => {
  989. if (res.status === 1) {
  990. res.collect_list.forEach((x) => {
  991. if (x.collect_desc) {
  992. let n = JSON.parse(x.collect_desc);
  993. let obj = {
  994. coursewareId: x.courseware_id,
  995. id: x.id,
  996. blockId: n.blockId,
  997. startIndex: n.startIndex,
  998. endIndex: n.endIndex,
  999. text: n.text,
  1000. };
  1001. this.allCottectList.push(obj);
  1002. }
  1003. });
  1004. }
  1005. });
  1006. },
  1007. async saveCollect(collect) {
  1008. if (this.allCottectList.length === 0) {
  1009. await this.getCollect();
  1010. }
  1011. let old = this.allCottectList.find(
  1012. (x) =>
  1013. x.coursewareId === collect.coursewareId &&
  1014. x.blockId === collect.blockId &&
  1015. x.startIndex === collect.startIndex &&
  1016. x.endIndex === collect.endIndex,
  1017. );
  1018. if (old) {
  1019. this.$message({
  1020. dangerouslyUseHTMLString: true,
  1021. message: "<i class='el-icon-check' />已收藏",
  1022. });
  1023. return;
  1024. }
  1025. this.newSelectedInfo = collect;
  1026. let collectInfo = {
  1027. blockId: this.newSelectedInfo.blockId,
  1028. startIndex: this.newSelectedInfo.startIndex,
  1029. endIndex: this.newSelectedInfo.endIndex,
  1030. text: this.newSelectedInfo.text,
  1031. };
  1032. let reqData = {
  1033. courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
  1034. component_id: 'WHOLE',
  1035. collect_desc: JSON.stringify(collectInfo), // 位置描述
  1036. };
  1037. AddMyCollect(reqData)
  1038. .then(() => {
  1039. this.getCollect();
  1040. })
  1041. .then(() => {
  1042. this.$message({
  1043. dangerouslyUseHTMLString: true,
  1044. message: "<i class='el-icon-check' />已收藏",
  1045. });
  1046. });
  1047. },
  1048. handDelCollect(id) {
  1049. this.$confirm('确定要删除此条收藏吗?', '提示', {
  1050. confirmButtonText: '确定',
  1051. cancelButtonText: '取消',
  1052. type: 'warning',
  1053. })
  1054. .then(() => {
  1055. DeleteMyCollect({ id }).then(() => {
  1056. this.allCottectList = this.allCottectList.filter((x) => x.id !== id);
  1057. });
  1058. })
  1059. .catch(() => {});
  1060. },
  1061. getSearch(params) {
  1062. if (params && params.type) this.drawerType = Number(params.type);
  1063. },
  1064. async querySearchList() {
  1065. this.searchList = [];
  1066. if (!this.searchContent) return;
  1067. await SearchBookContentText({ book_id: this.projectId, text: this.searchContent }).then((res) => {
  1068. if (res.status === 1) {
  1069. this.searchList = res.courseware_component_list;
  1070. }
  1071. });
  1072. },
  1073. },
  1074. };
  1075. </script>
  1076. <style lang="scss" scoped>
  1077. @use '@/styles/mixin.scss' as *;
  1078. $total-width: $courseware-width + $courseware-left-margin + $courseware-right-margin;
  1079. .common-preview {
  1080. &__header {
  1081. position: sticky;
  1082. top: 56px;
  1083. left: 0;
  1084. z-index: 9;
  1085. display: flex;
  1086. align-items: center;
  1087. height: 40px;
  1088. padding: 6px 4px;
  1089. margin-bottom: 5px;
  1090. background-color: #fff;
  1091. border-top: $border;
  1092. border-bottom: $border;
  1093. > .menu-container {
  1094. display: flex;
  1095. justify-content: space-between;
  1096. width: 360px;
  1097. padding: 4px 8px;
  1098. border-right: $border;
  1099. }
  1100. > .courseware {
  1101. display: flex;
  1102. flex-grow: 1;
  1103. column-gap: 16px;
  1104. align-items: center;
  1105. justify-content: space-between;
  1106. height: 40px;
  1107. .name-path {
  1108. min-width: 200px;
  1109. height: 40px;
  1110. padding: 4px 8px;
  1111. font-size: 14px;
  1112. line-height: 32px;
  1113. border-right: $border;
  1114. }
  1115. .lang-select {
  1116. :deep .el-input {
  1117. width: 100px;
  1118. }
  1119. :deep .el-input__inner {
  1120. height: 24px;
  1121. line-height: 24px;
  1122. background-color: #fff;
  1123. }
  1124. :deep .el-input__icon {
  1125. line-height: 24px;
  1126. }
  1127. }
  1128. .flow-nodename {
  1129. flex: 1;
  1130. }
  1131. .group {
  1132. display: flex;
  1133. align-items: center;
  1134. }
  1135. .operator {
  1136. display: flex;
  1137. column-gap: 8px;
  1138. align-items: center;
  1139. .link {
  1140. + .link {
  1141. margin-left: 0;
  1142. &::before {
  1143. margin-right: 8px;
  1144. color: #999;
  1145. content: '|';
  1146. }
  1147. }
  1148. }
  1149. }
  1150. }
  1151. }
  1152. .main-container {
  1153. position: relative;
  1154. flex: 1;
  1155. min-width: 1110px;
  1156. padding: 15px 0;
  1157. overflow: auto;
  1158. background-color: #ececec;
  1159. .catalogue-bar {
  1160. position: absolute;
  1161. top: 15px;
  1162. left: 0;
  1163. display: flex;
  1164. align-items: center;
  1165. justify-content: center;
  1166. width: 54px;
  1167. height: 54px;
  1168. margin: -9px 6px 0 240px;
  1169. cursor: pointer;
  1170. background-color: #fff;
  1171. border-radius: 2px;
  1172. box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
  1173. }
  1174. .sidebar-bar {
  1175. position: absolute;
  1176. top: 0;
  1177. right: 240px;
  1178. display: flex;
  1179. width: 60px;
  1180. height: calc(100vh - 166px);
  1181. .toolbar {
  1182. display: flex;
  1183. flex-direction: column;
  1184. align-items: center;
  1185. width: 60px;
  1186. height: 100%;
  1187. img {
  1188. cursor: pointer;
  1189. }
  1190. &-special {
  1191. display: flex;
  1192. flex-direction: column;
  1193. row-gap: 16px;
  1194. align-items: center;
  1195. width: 100%;
  1196. margin-bottom: 24px;
  1197. background-color: #fff;
  1198. img {
  1199. width: 36px;
  1200. height: 36px;
  1201. }
  1202. }
  1203. }
  1204. }
  1205. }
  1206. .back-top {
  1207. position: absolute;
  1208. right: 240px;
  1209. bottom: 0;
  1210. display: flex;
  1211. place-content: center center;
  1212. align-items: center;
  1213. width: 60px;
  1214. height: 60px;
  1215. cursor: pointer;
  1216. background-color: #fff;
  1217. }
  1218. main.preview-main {
  1219. display: flex;
  1220. flex: 1;
  1221. width: calc($total-width);
  1222. min-width: calc($total-width);
  1223. max-width: calc($total-width);
  1224. min-height: 100%;
  1225. margin: 0 auto;
  1226. background-color: #fff;
  1227. border-radius: 4px;
  1228. box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
  1229. .preview-left {
  1230. width: $courseware-left-margin;
  1231. min-width: $courseware-left-margin;
  1232. max-width: $courseware-left-margin;
  1233. background-color: $courseware-bgColor;
  1234. }
  1235. .preview-right {
  1236. width: $courseware-right-margin;
  1237. min-width: $courseware-right-margin;
  1238. max-width: $courseware-right-margin;
  1239. background-color: $courseware-bgColor;
  1240. }
  1241. &.no-audit {
  1242. margin: 0 auto;
  1243. }
  1244. }
  1245. .audit-content {
  1246. display: flex;
  1247. min-width: 1810px;
  1248. height: calc(100vh - 166px);
  1249. .left-menu {
  1250. display: flex;
  1251. flex-direction: column;
  1252. width: $catalogue-width;
  1253. font-family: 'Microsoft YaHei', 'Arial', sans-serif;
  1254. background-color: #fff;
  1255. .courseware-info {
  1256. display: flex;
  1257. column-gap: 18px;
  1258. width: 100%;
  1259. height: 186px;
  1260. padding: 6px 6px 24px;
  1261. border-bottom: $border;
  1262. .cover-image {
  1263. display: flex;
  1264. align-items: center;
  1265. justify-content: center;
  1266. width: 111px;
  1267. height: 157px;
  1268. background-color: rgba(229, 229, 229, 100%);
  1269. img {
  1270. max-width: 111px;
  1271. max-height: 157px;
  1272. }
  1273. }
  1274. .info-content {
  1275. display: flex;
  1276. flex-direction: column;
  1277. justify-content: space-between;
  1278. .catalogue-icon {
  1279. text-align: right;
  1280. .svg-icon {
  1281. cursor: pointer;
  1282. }
  1283. }
  1284. .courseware {
  1285. width: 159px;
  1286. height: 64px;
  1287. font-size: 16px;
  1288. .name {
  1289. font-weight: bold;
  1290. }
  1291. .editor {
  1292. display: -webkit-box;
  1293. overflow: hidden;
  1294. text-overflow: ellipsis;
  1295. word-break: break-word;
  1296. white-space: normal;
  1297. -webkit-line-clamp: 2; /* 多行省略行数,按需调整 */
  1298. -webkit-box-orient: vertical;
  1299. }
  1300. }
  1301. }
  1302. }
  1303. .courseware-tree {
  1304. display: flex;
  1305. flex: 1;
  1306. flex-direction: column;
  1307. row-gap: 8px;
  1308. padding: 12px;
  1309. margin-top: 12px;
  1310. overflow: auto;
  1311. .menu-item {
  1312. display: flex;
  1313. align-items: center;
  1314. &:not(.courseware) {
  1315. font-weight: bold;
  1316. }
  1317. &.courseware {
  1318. &:hover {
  1319. .name {
  1320. background-color: #f3f3f3;
  1321. }
  1322. }
  1323. }
  1324. .svg-icon {
  1325. margin-left: 4px;
  1326. &.my-edit-task {
  1327. color: $right-color;
  1328. }
  1329. }
  1330. .name {
  1331. flex: 1;
  1332. padding: 4px 8px 4px 4px;
  1333. border-radius: 4px;
  1334. }
  1335. &.active {
  1336. .name {
  1337. font-weight: bold;
  1338. color: #4095e5;
  1339. }
  1340. }
  1341. }
  1342. }
  1343. }
  1344. .sidebar {
  1345. position: relative;
  1346. display: flex;
  1347. width: $sidebar-width;
  1348. .toolbar {
  1349. display: flex;
  1350. flex-direction: column;
  1351. align-items: center;
  1352. width: 60px;
  1353. height: 100%;
  1354. background-color: rgba(247, 248, 250, 100%);
  1355. img {
  1356. cursor: pointer;
  1357. }
  1358. &-special {
  1359. display: flex;
  1360. flex-direction: column;
  1361. row-gap: 16px;
  1362. margin-bottom: 24px;
  1363. }
  1364. &-list {
  1365. display: flex;
  1366. flex-direction: column;
  1367. row-gap: 16px;
  1368. align-items: center;
  1369. width: 100%;
  1370. .sidebar-item {
  1371. width: 100%;
  1372. text-align: center;
  1373. .sidebar-icon {
  1374. width: 36px;
  1375. height: 36px;
  1376. cursor: pointer;
  1377. }
  1378. &.active {
  1379. background-color: #4095e5;
  1380. }
  1381. }
  1382. }
  1383. }
  1384. .content {
  1385. flex: 1;
  1386. background-color: #fff;
  1387. .resource_box {
  1388. height: 100%;
  1389. overflow-y: auto;
  1390. border: 1px solid #e5e5e5;
  1391. h5 {
  1392. position: fixed;
  1393. z-index: 999;
  1394. width: 240px;
  1395. padding: 0 5px;
  1396. margin: 0;
  1397. font-size: 18px;
  1398. line-height: 40px;
  1399. background: #f2f3f5;
  1400. }
  1401. .scroll-container {
  1402. display: flex;
  1403. flex-direction: column;
  1404. row-gap: 8px;
  1405. margin: 6px;
  1406. .list-item {
  1407. display: flex;
  1408. align-items: center;
  1409. cursor: pointer;
  1410. border: 1px solid #ccc;
  1411. border-radius: 8px;
  1412. :deep .el-slider {
  1413. .el-slider__runway {
  1414. background-color: #eee;
  1415. }
  1416. }
  1417. .el-image {
  1418. display: flex;
  1419. width: 100%;
  1420. min-width: 100%;
  1421. height: 90px;
  1422. background-color: #ccc;
  1423. border-radius: 8px;
  1424. }
  1425. .video-play {
  1426. width: 100%;
  1427. min-width: 100%;
  1428. }
  1429. .text-box {
  1430. word-break: break-word;
  1431. }
  1432. }
  1433. }
  1434. p {
  1435. color: #999;
  1436. text-align: center;
  1437. }
  1438. .card-box li {
  1439. padding: 10px;
  1440. border-bottom: 1px solid #ccc;
  1441. .el-icon-notebook-2 {
  1442. display: block;
  1443. margin-bottom: 4px;
  1444. font-size: 12px;
  1445. color: grey;
  1446. }
  1447. }
  1448. }
  1449. }
  1450. .back-top {
  1451. position: absolute;
  1452. bottom: 0;
  1453. left: 0;
  1454. display: flex;
  1455. place-content: center center;
  1456. align-items: center;
  1457. width: 60px;
  1458. height: 60px;
  1459. cursor: pointer;
  1460. }
  1461. }
  1462. }
  1463. }
  1464. :deep .scroll-container .audio-wrapper {
  1465. width: 100% !important;
  1466. .audio-middle {
  1467. width: 100% !important;
  1468. padding: 6px 8px !important;
  1469. border: none;
  1470. border-radius: 8px;
  1471. .audio-name {
  1472. text-align: left;
  1473. }
  1474. .slider-area {
  1475. column-gap: 8px !important;
  1476. }
  1477. :deep .remark-dialog {
  1478. .el-dialog__body {
  1479. padding: 5px 20px;
  1480. }
  1481. }
  1482. :deep .audit-dialog {
  1483. .el-dialog__body {
  1484. height: calc(100vh - 260px);
  1485. padding: 5px 20px;
  1486. }
  1487. .mind-map-container .mind-map {
  1488. height: calc(100vh - 310px);
  1489. }
  1490. }
  1491. }
  1492. }
  1493. .mt10 {
  1494. margin: 10px 0 0 !important;
  1495. background-color: #eee;
  1496. }
  1497. </style>
  1498. <style lang="scss">
  1499. .tox-tinymce-aux {
  1500. z-index: 9999 !important;
  1501. }
  1502. </style>