CommonPreview.vue 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180
  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. <template v-if="type === 'edit_preview'">
  12. <i class="el-icon-setting" style="cursor: pointer" @click="openSimulateAnswerPermissionControl()"></i>
  13. <span class="link" @click="createCoursewarePreviewURL()">生成课件预览链接</span>
  14. </template>
  15. <div class="group">
  16. <el-checkbox v-model="isJudgeCorrect">判断对错</el-checkbox>
  17. </div>
  18. <div v-if="isShowGroup">
  19. <span class="link" @click="isShowGroup = false">取消显示分组</span>
  20. <span
  21. class="link"
  22. @click="
  23. groupShowAll = false;
  24. isShowGroup = false;
  25. "
  26. >完成选择</span
  27. >
  28. </div>
  29. <span
  30. v-else
  31. class="link"
  32. @click="
  33. isShowGroup = true;
  34. groupShowAll = true;
  35. "
  36. >显示分组</span
  37. >
  38. <span class="link">
  39. <el-checkbox v-model="chinese" true-label="zh-Hant" false-label="zh-Hans">繁体</el-checkbox>
  40. </span>
  41. <span v-if="false" class="link">
  42. <el-checkbox v-model="showPinYin" true-label="true" false-label="false">拼音</el-checkbox>
  43. </span>
  44. <div class="operator">
  45. <slot name="operator" :courseware="courseware_info" :project-id="projectId"></slot>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="audit-content">
  50. <!-- 左侧菜单栏 -->
  51. <aside v-if="navigationShow" class="left-menu">
  52. <div class="courseware-info">
  53. <div class="cover-image">
  54. <img v-if="project.cover_image_file_url.length > 0" :src="project.cover_image_file_url" alt="cover-image" />
  55. </div>
  56. <div class="info-content">
  57. <div class="catalogue-icon" @click="toggleNavigationShow">
  58. <SvgIcon icon-class="catalogue" size="54" />
  59. </div>
  60. <div class="courseware">
  61. <div class="name nowrap-ellipsis" :title="courseware_info.book_name">
  62. {{ courseware_info.book_name }}
  63. </div>
  64. <div class="editor" :title="project.editor">
  65. {{ project.editor }}
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <!-- 教材章节树 -->
  71. <div class="courseware-tree">
  72. <div
  73. v-for="{ id: nodeId, name, status_name, deep, is_leaf_chapter } in node_list"
  74. :key="nodeId"
  75. :class="['menu-item', { active: curSelectId === nodeId }, { courseware: isTrue(is_leaf_chapter) }]"
  76. :style="computedNameStyle(deep, isTrue(is_leaf_chapter))"
  77. @click="selectChapterNode(nodeId, isTrue(is_leaf_chapter))"
  78. >
  79. <span class="name nowrap-ellipsis" :title="name">
  80. {{ name }}
  81. </span>
  82. <span v-if="['audit', 'edit_preview'].includes(type)" class="status">{{ status_name }}</span>
  83. </div>
  84. </div>
  85. </aside>
  86. <div
  87. ref="previewMain"
  88. class="main-container"
  89. :style="{
  90. paddingLeft: !isFullScreen && navigationShow ? '15px' : '315px',
  91. paddingRight: !isFullScreen && sidebarShow ? '15px' : '315px',
  92. }"
  93. >
  94. <!-- 左侧菜单栏 - 收缩 -->
  95. <div v-if="!navigationShow && !isFullScreen" class="catalogue-bar" @click="toggleNavigationShow">
  96. <SvgIcon icon-class="catalogue" size="54" />
  97. </div>
  98. <main :class="['preview-main', { 'no-audit': !isShowAudit }]">
  99. <div class="preview-left"></div>
  100. <!-- <div
  101. id="selectable-area-preview"
  102. @mousedown="startSelection"
  103. @mousemove="updateSelection"
  104. @mouseup="endSelection"
  105. @mouseleave="endSelection"
  106. > -->
  107. <CoursewarePreview
  108. v-if="courseware_info.book_name"
  109. ref="courserware"
  110. :is-show-group="isShowGroup"
  111. :group-show-all="groupShowAll"
  112. :group-row-list="content_group_row_list"
  113. :data="data"
  114. :courseware-id="curSelectId"
  115. :component-list="component_list"
  116. :background="background"
  117. :can-remark="isTrue(courseware_info.is_my_audit_task) && isTrue(courseware_info.is_can_add_audit_remark)"
  118. :show-remark="isShowAudit"
  119. :component-remark-obj="remark_list_obj"
  120. :project="project"
  121. @computeScroll="computeScroll"
  122. @addRemark="addRemark"
  123. @editNote="handEditNote"
  124. @saveCollect="saveCollect"
  125. />
  126. <!-- <div
  127. v-if="isSelecting"
  128. :style="{
  129. position: 'absolute',
  130. top: `${menuPosition.startY}px`,
  131. left: `${menuPosition.startX}px`,
  132. width: `${menuPosition.endX - menuPosition.startX}px`,
  133. height: `${menuPosition.endY - menuPosition.startY}px`,
  134. border: '2px solid #165DFF',
  135. }"
  136. ></div>
  137. </div> -->
  138. <div class="preview-right"></div>
  139. </main>
  140. <!-- 右侧菜单栏 - 收缩 -->
  141. <aside v-if="!sidebarShow && !isFullScreen" class="sidebar-bar">
  142. <aside class="toolbar">
  143. <div class="toolbar-special">
  144. <img :src="require('@/assets/icon/sidebar-fullscreen.png')" alt="全屏" @click="fullScreen" />
  145. <img :src="require('@/assets/icon/sidebar-toolkit.png')" alt="工具箱" />
  146. <img :src="require(`@/assets/icon/arrow-down.png`)" alt="伸缩" @click="toggleSidebarShow" />
  147. </div>
  148. </aside>
  149. </aside>
  150. </div>
  151. <div v-if="!sidebarShow" class="back-top" @click="backTop">
  152. <img :src="require(`@/assets/icon/back-top.png`)" alt="返回顶部" />
  153. </div>
  154. <!-- 右侧工具栏 -->
  155. <aside v-if="sidebarShow" ref="sidebarMenu" class="sidebar">
  156. <aside class="toolbar">
  157. <div class="toolbar-special">
  158. <img :src="require('@/assets/icon/sidebar-fullscreen.png')" alt="全屏" @click="fullScreen" />
  159. <img :src="require('@/assets/icon/sidebar-toolkit.png')" alt="工具箱" />
  160. </div>
  161. <div v-if="sidebarShow" class="toolbar-list">
  162. <div
  163. v-for="{ icon, title, handle, param, children } in sidebarIconList"
  164. :key="icon"
  165. :class="['sidebar-item', { active: curToolbarIcon === icon }]"
  166. :title="title"
  167. @click="handleSidebarClick(handle, param, icon, children)"
  168. >
  169. <div
  170. class="sidebar-icon icon-mask"
  171. :style="{
  172. backgroundColor: curToolbarIcon === icon ? '#fff' : '#1E2129',
  173. maskImage: `url(${require(`@/assets/icon/sidebar-${icon}.svg`)})`,
  174. }"
  175. ></div>
  176. </div>
  177. </div>
  178. <div class="adjustable" @click="toggleSidebarShow">
  179. <img :src="require(`@/assets/icon/arrow-up.png`)" alt="伸缩" />
  180. </div>
  181. </aside>
  182. <div class="content">
  183. <div v-if="curToolbarIcon === 'search'" class="resource_box">
  184. <h5>{{ drawerTitle }}</h5>
  185. <div style="height: 40px"></div>
  186. <el-row :gutter="10" style="margin: 5px">
  187. <el-col :span="16">
  188. <el-input v-model="searchContent" placeholder="请输入文本内容" clearable />
  189. </el-col>
  190. <el-col :span="4">
  191. <el-button type="primary" @click="querySearchList"> 查询 </el-button>
  192. </el-col>
  193. </el-row>
  194. <div>
  195. <el-table :data="searchList" :show-header="false">
  196. <!-- <el-table-column prop="courseware_name" label="课件" />
  197. <el-table-column prop="component_type" label="组件" /> -->
  198. <el-table-column>
  199. <template #default="{ row }">
  200. {{ row.courseware_name + ' / ' + row.component_type_name }}
  201. </template>
  202. </el-table-column>
  203. <el-table-column label="" width="50">
  204. <template #default="{ row }">
  205. <el-link type="primary" @click="handleLocation(row, 0)">定位</el-link>
  206. </template>
  207. </el-table-column>
  208. </el-table>
  209. </div>
  210. </div>
  211. <!-- <div v-if="curToolbarIcon === 'totalResources'" class="resource_box"></div> -->
  212. <div v-if="['image', 'audio', 'video', 'text'].includes(twoCurToolbarIcon)" class="resource_box">
  213. <div class="source-toolbar-list">
  214. <div
  215. v-for="{ icon, title, handle, param } in twoSidebarList"
  216. :key="icon"
  217. :class="['sidebar-item', { active: twoCurToolbarIcon === icon }]"
  218. :title="title"
  219. @click="handleSidebarClick(handle, param, icon, '', 2)"
  220. >
  221. <div
  222. class="sidebar-icon icon-mask"
  223. :style="{
  224. backgroundColor: twoCurToolbarIcon === icon ? '#fff' : '#1E2129',
  225. maskImage: `url(${require(`@/assets/icon/sidebar-${icon}.svg`)})`,
  226. }"
  227. ></div>
  228. </div>
  229. </div>
  230. <div style="height: 40px"></div>
  231. <div style="margin: 5px">
  232. <span>全部显示 </span>
  233. <el-switch v-model="multimediaIsAllShow" :active-value="true" :inactive-value="false" />
  234. </div>
  235. <el-collapse v-model="activeBookChapterId" accordion @change="multimediaHandleChange">
  236. <el-collapse-item
  237. v-for="chapter in bookChapterList"
  238. :key="chapter.id"
  239. :name="chapter.id"
  240. :title="chapter.name"
  241. >
  242. <!-- 加载状态 -->
  243. <div v-if="multimediaLoadingStates" class="loading-text">加载中...</div>
  244. <!-- 加载完成显示数据 -->
  245. <div v-else-if="chapter.data">
  246. <ul
  247. :class="parseInt(drawerType) == 5 ? 'scroll-container file-list' : 'scroll-container'"
  248. infinite-scroll-disabled="disabled"
  249. :infinite-scroll-immediate="false"
  250. >
  251. <li v-for="(item, index) in chapter.data" :key="`${chapter.id}-${index}`" class="list-item">
  252. <template v-if="parseInt(drawerType) === 0">
  253. <el-image v-if="shouldMediaShowItem(chapter, item)" :src="item.file_url" fit="contain" />
  254. </template>
  255. <template v-else-if="parseInt(drawerType) === 1">
  256. <AudioPlay
  257. v-if="shouldMediaShowItem(chapter, item)"
  258. view-size="middle"
  259. :file-id="item.file_id"
  260. :file-name="item.file_name.slice(0, item.file_name.lastIndexOf('.'))"
  261. :show-slider="true"
  262. :audio-index="index"
  263. />
  264. </template>
  265. <template v-else-if="parseInt(drawerType) === 2">
  266. <VideoPlay
  267. v-if="shouldMediaShowItem(chapter, item)"
  268. view-size="small"
  269. :file-id="item.file_id"
  270. :video-index="index"
  271. />
  272. </template>
  273. <template v-else-if="parseInt(drawerType) === 3"> </template>
  274. <template v-else-if="parseInt(drawerType) === 4"> </template>
  275. <template v-else-if="parseInt(drawerType) === 5">
  276. <div class="file-name">
  277. <el-link>
  278. <span @click="openFile(item)">
  279. <SvgIcon icon-class="file" size="24" />
  280. <p>
  281. <span>{{ item.file_name }}</span>
  282. </p>
  283. </span>
  284. </el-link>
  285. </div>
  286. </template>
  287. <!-- 资源底部的操作 -->
  288. <div class="file-handle-info">
  289. <span v-if="![1, 5].includes(parseInt(drawerType))" class="word">{{ item.file_name }}</span>
  290. <div class="mark">
  291. <el-checkbox
  292. v-model="item.is_hided"
  293. :disabled="!item.is_can_edit"
  294. size="small"
  295. @change="handleMediaShowChange(item)"
  296. >
  297. 隐藏
  298. </el-checkbox>
  299. <el-link type="primary" class="el-icon-place linkLocation" @click="handleLocation(item, 0)" />
  300. </div>
  301. </div>
  302. </li>
  303. </ul>
  304. </div>
  305. <!-- 加载失败或未加载 -->
  306. <div v-else class="error-text">没有资源</div>
  307. </el-collapse-item>
  308. </el-collapse>
  309. </div>
  310. <div v-if="curToolbarIcon === 'collect'" class="resource_box">
  311. <h5>{{ drawerTitle }}</h5>
  312. <div style="height: 40px"></div>
  313. <ul v-if="allCottectList.length > 0" class="card-box">
  314. <li v-for="item in allCottectList" :key="item.id">
  315. <span class="el-icon-notebook-2"> 原文</span>
  316. <span>{{ item.text }}</span>
  317. <div>
  318. <el-button type="text" class="el-icon-delete" @click="handDelCollect(item.id)"> 删除</el-button>
  319. <el-divider direction="vertical" />
  320. <el-button type="text" class="el-icon-place" @click="handleLocation(item, 12)"> 定位</el-button>
  321. </div>
  322. </li>
  323. </ul>
  324. </div>
  325. <div v-if="curToolbarIcon === 'note'" class="resource_box">
  326. <h5>{{ drawerTitle }}</h5>
  327. <div style="height: 40px"></div>
  328. <ul v-if="allNoteList.length > 0" class="card-box">
  329. <li v-for="item in allNoteList" :key="item.id">
  330. <span class="el-icon-notebook-2"> 原文</span>
  331. <span>{{ item.text }}</span>
  332. <el-divider class="mt10" />
  333. <span v-html="item.note"></span>
  334. <div>
  335. <el-button type="text" class="el-icon-edit" @click="handEditNote(item)"> 编辑</el-button>
  336. <el-divider direction="vertical" />
  337. <el-button type="text" class="el-icon-delete" @click="handDelNote(item.id)"> 删除</el-button>
  338. <el-divider direction="vertical" />
  339. <el-button type="text" class="el-icon-place" @click="handleLocation(item, 11)"> 定位</el-button>
  340. </div>
  341. </li>
  342. </ul>
  343. </div>
  344. <template v-if="curToolbarIcon === 'audit'">
  345. <AuditRemark
  346. :remark-list="remark_list"
  347. :is-audit="isShowAudit"
  348. @deleteRemarks="deleteRemarks"
  349. @handleLocationRemarks="handleLocationRemarks"
  350. />
  351. </template>
  352. </div>
  353. <div class="back-top" @click="backTop">
  354. <img :src="require(`@/assets/icon/back-top.png`)" alt="返回顶部" />
  355. </div>
  356. </aside>
  357. </div>
  358. <el-dialog
  359. title="添加课件审核批注"
  360. :visible="visible"
  361. width="680px"
  362. :close-on-click-modal="false"
  363. class="remark-dialog"
  364. @close="dialogClose('')"
  365. >
  366. <Remark :remark="remark" :project-id="projectId" :courseware-id="select_node ? select_node : id" />
  367. <div slot="footer">
  368. <el-button @click="dialogClose('')">取消</el-button>
  369. <el-button type="primary" :loading="submit_loading" @click="addCoursewareAuditRemark(select_node)">
  370. 确定
  371. </el-button>
  372. </div>
  373. </el-dialog>
  374. <el-dialog title="" :visible="visibleMindMap" width="1100px" class="audit-dialog" @close="dialogClose('MindMap')">
  375. <MindMap
  376. v-if="isChildDataLoad"
  377. ref="mindMapRef"
  378. :project-id="projectId"
  379. :mind-map-json-data="mindMapJsonData"
  380. @child-click="handleNodeClick"
  381. />
  382. </el-dialog>
  383. <el-dialog
  384. title=""
  385. :visible="visibleVisNetwork"
  386. width="1100px"
  387. class="audit-dialog"
  388. :close-on-click-modal="false"
  389. @close="dialogClose('VisNetwork')"
  390. >
  391. <VisNetwork ref="visNetworkRef" :book-id="projectId" @child-click="handleNodeClick" />
  392. </el-dialog>
  393. <ExplanatoryNoteDialog
  394. ref="explanatoryNote"
  395. :open.sync="editDialogOpen"
  396. :init-data="oldRichData"
  397. title-text="笔记"
  398. @confirm="saveNote"
  399. @cancel="delNote"
  400. />
  401. <SimAnswerPermissionControl :visible.sync="visiblePermissionControl" :permission-control.sync="permissionControl" />
  402. <PreviewURL :url="preview_url" :visible.sync="visiblePreviewURL" />
  403. <el-dialog
  404. title="翻译"
  405. width="240px"
  406. :close-on-click-modal="false"
  407. :visible="visibleTranslate"
  408. @close="dialogClose('Translate')"
  409. >
  410. <el-select v-model="lang" placeholder="请选择语言" size="mini" class="lang-select">
  411. <el-option v-for="item in langList" :key="item.type" :label="item.name" :value="item.type" />
  412. </el-select>
  413. </el-dialog>
  414. </div>
  415. </template>
  416. <script>
  417. import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
  418. import MindMap from '@/components/MindMap.vue';
  419. import VisNetwork from '@/components/VisNetwork.vue';
  420. import VideoPlay from '@/views/book/courseware/preview/components/common/VideoPlay.vue';
  421. import AudioPlay from '@/views/book/courseware/preview/components/common/AudioPlay.vue';
  422. import AuditRemark from '@/components/AuditRemark.vue';
  423. import ExplanatoryNoteDialog from '@/components/ExplanatoryNoteDialog.vue';
  424. import SimAnswerPermissionControl from '@/components/SimAnswerPermissionControl.vue';
  425. import PreviewURL from '@/views/project_manage/common/PreviewURL.vue';
  426. import Remark from './Remark.vue';
  427. import {
  428. GetBookCoursewareInfo,
  429. GetProjectBaseInfo,
  430. GetCoursewareAuditRemarkList,
  431. AddCoursewareAuditRemark,
  432. DeleteCoursewareAuditRemarkList,
  433. GetProjectInfo,
  434. } from '@/api/project';
  435. import {
  436. ContentGetCoursewareContent_View,
  437. ChapterGetBookChapterStructExpandList,
  438. GetBookBaseInfo,
  439. MangerGetBookMindMap,
  440. GetBookChapterStructExpandList,
  441. PageQueryBookResourceList,
  442. GetLanguageTypeList,
  443. GetMyNoteList,
  444. DeleteMyNote,
  445. AddMyNote,
  446. UpdateMyNote,
  447. AddMyCollect,
  448. GetMyCollectList,
  449. DeleteMyCollect,
  450. SearchBookContentText,
  451. SetBookResourceHide,
  452. } from '@/api/book';
  453. import { toggleFullScreen } from '@/utils/common';
  454. import * as OpenCC from 'opencc-js';
  455. import { isTrue } from '@/utils/validate';
  456. import { CreateCoursewarePreviewURL } from '@/api/app';
  457. export default {
  458. name: 'CommonPreview',
  459. components: {
  460. CoursewarePreview,
  461. MindMap,
  462. AudioPlay,
  463. VideoPlay,
  464. AuditRemark,
  465. ExplanatoryNoteDialog,
  466. VisNetwork,
  467. SimAnswerPermissionControl,
  468. PreviewURL,
  469. Remark,
  470. },
  471. provide() {
  472. return {
  473. getLang: () => this.lang,
  474. getChinese: () => this.chinese,
  475. getShowPinYin: () => this.showPinYin,
  476. getLangList: () => this.langList,
  477. convertText: this.convertText,
  478. getTitleList: () => this.title_list,
  479. getPermissionControl: () => this.permissionControl,
  480. };
  481. },
  482. inject: ['processHtmlString'],
  483. props: {
  484. projectId: {
  485. type: String,
  486. required: true,
  487. },
  488. id: {
  489. type: String,
  490. default: '',
  491. },
  492. // 是否是审核页面
  493. isAudit: {
  494. type: Boolean,
  495. default: false,
  496. },
  497. isShowAudit: {
  498. type: Boolean,
  499. default: true,
  500. },
  501. isBook: {
  502. type: Boolean,
  503. default: false,
  504. },
  505. type: {
  506. type: String,
  507. default: '',
  508. },
  509. },
  510. data() {
  511. const sidebarIconList = [
  512. { icon: 'search', title: '搜索', handle: 'getSearch', param: { type: '13' } },
  513. { icon: 'mindmap', title: '思维导图', handle: 'openMindMap', param: {} },
  514. { icon: 'knowledge', title: '知识图谱', handle: 'openVisNetwork', param: {} },
  515. {
  516. icon: 'totalResources',
  517. title: '总资源',
  518. handle: '',
  519. param: {},
  520. children: [
  521. { icon: 'audio', title: '音频', handle: 'openDrawer', param: { type: '1' } },
  522. { icon: 'image', title: '图片', handle: 'openDrawer', param: { type: '0' } },
  523. { icon: 'video', title: '视频', handle: 'openDrawer', param: { type: '2' } },
  524. { icon: 'text', title: '文本', handle: 'openDrawer', param: { type: '5' } },
  525. ],
  526. },
  527. { icon: 'collect', title: '收藏', handle: 'getCollect', param: { type: '11' } },
  528. { icon: 'note', title: '笔记', handle: 'getNote', param: { type: '12' } },
  529. { icon: 'translate', title: '翻译', handle: 'openTranslate', param: {} },
  530. { icon: 'setting', title: '设置', handle: '', param: {} },
  531. ];
  532. if (this.isShowAudit) {
  533. sidebarIconList.push({ icon: 'audit', title: '审核批注', handle: 'openAudit', param: {} });
  534. }
  535. return {
  536. select_node: this.id,
  537. courseware_info: {
  538. book_name: '',
  539. is_can_start_edit: 'false',
  540. is_can_submit_audit: 'false',
  541. is_can_audit_pass: 'false',
  542. is_can_audit_reject: 'false',
  543. is_can_add_audit_remark: 'false',
  544. is_can_finish_audit: 'false',
  545. is_can_request_shangjia_book: 'false',
  546. is_can_request_rollback_project: 'false',
  547. is_can_shangjia_book: 'false',
  548. is_can_rollback_project: 'false',
  549. },
  550. background: {
  551. background_image_url: '',
  552. background_position: {
  553. left: 0,
  554. top: 0,
  555. },
  556. background: {},
  557. },
  558. node_list: [],
  559. data: { row_list: [] },
  560. component_list: [],
  561. content_group_row_list: [],
  562. remark_list: [],
  563. remark_list_obj: {}, // 存放以组件为对象的批注数组
  564. searchList: [],
  565. searchContent: '',
  566. visible: false,
  567. remark: {
  568. remark_content: '',
  569. file_id_list: [],
  570. },
  571. submit_loading: false,
  572. isTrue,
  573. menuPosition: {
  574. x: -1,
  575. y: -1,
  576. componentId: 'WHOLE',
  577. startX: null,
  578. startY: null,
  579. endX: null,
  580. endY: null,
  581. },
  582. isSelecting: false,
  583. curToolbarIcon: this.isShowAudit ? 'audit' : '',
  584. sidebarIconList,
  585. twoSidebarList: [],
  586. twoCurToolbarIcon: '',
  587. visibleMindMap: false,
  588. visibleVisNetwork: false,
  589. isChildDataLoad: false,
  590. mindMapJsonData: {}, // 思维导图json数据
  591. drawerType: '', // 抽屉类型
  592. visibleTranslate: false, // 翻译弹窗显示状态
  593. page_capacity: 10,
  594. cur_page: 1,
  595. file_list: [],
  596. total_count: 0,
  597. loading: false,
  598. lastLoadTime: 0,
  599. minLoadInterval: 3 * 1000,
  600. isShowGroup: false,
  601. groupShowAll: true,
  602. opencc: OpenCC.Converter({ from: 'cn', to: 'tw' }),
  603. langList: [],
  604. lang: 'ZH',
  605. chinese: 'zh-Hans', // 语言简体中文zh-Hans,繁体中文zh-Hant
  606. showPinYin: 'false',
  607. isJudgeCorrect: false,
  608. isShowAnswer: false,
  609. curSelectId: this.id,
  610. navigationShow: true,
  611. sidebarShow: true,
  612. project: {
  613. editor: '', // 作者
  614. cover_image_file_id: null, // 封面图片ID
  615. cover_image_file_url: '', // 封面图片URL
  616. },
  617. allNoteList: [],
  618. editDialogOpen: false,
  619. oldRichData: {},
  620. newSelectedInfo: null,
  621. allCottectList: [],
  622. bookChapterList: [],
  623. book_id: '',
  624. activeBookChapterId: '',
  625. multimediaLoadingStates: true,
  626. multimediaIsAllShow: false,
  627. isFullScreen: false, // 是否全屏状态
  628. title_list: [],
  629. visiblePermissionControl: false, // 模拟答题权限控制弹窗显示状态
  630. permissionControl: {
  631. can_answer: true, // 可作答
  632. can_judge_correct: false, // 可判断对错(客观题)
  633. can_show_answer: false, // 可查看答案
  634. can_correct: false, // 可批改
  635. can_check_correct: false, // 可查看批改
  636. },
  637. preview_url: '', // 课件预览链接
  638. visiblePreviewURL: false, // 预览链接弹窗显示状态
  639. };
  640. },
  641. computed: {
  642. disabled() {
  643. const result = this.loading || this.noMore;
  644. return result;
  645. },
  646. noMore() {
  647. const result = this.file_list.length >= this.total_count;
  648. return result;
  649. },
  650. drawerTitle() {
  651. const titleMap = {
  652. 0: '图片资源',
  653. 1: '音频资源',
  654. 2: '视频资源',
  655. 5: '文本资源',
  656. 11: '收藏列表',
  657. 12: '笔记列表',
  658. 13: '搜索结果',
  659. };
  660. return titleMap[this.drawerType] || '资源列表';
  661. },
  662. shouldMediaShowItem() {
  663. return (chapter, item) => {
  664. return this.activeBookChapterId === chapter.id && item && item.file_id;
  665. };
  666. },
  667. },
  668. watch: {
  669. isJudgeCorrect(newVal) {
  670. if (!newVal) {
  671. this.isShowAnswer = false;
  672. }
  673. this.simulateAnswer(newVal);
  674. },
  675. isShowAnswer() {
  676. this.simulateAnswer();
  677. },
  678. curSelectId() {
  679. if (this.curToolbarIcon === 'note') {
  680. this.getNote();
  681. } else if (this.curToolbarIcon === 'collect') {
  682. this.getCollect();
  683. }
  684. },
  685. multimediaIsAllShow() {
  686. // 切换显示全部,需清空所有数据,全部重新加载
  687. this.bookChapterList.forEach((x) => {
  688. this.$set(x, 'data', null);
  689. });
  690. this.multimediaHandleChange();
  691. },
  692. },
  693. created() {
  694. if (this.id) {
  695. this.getBookCoursewareInfo(this.id);
  696. this.getCoursewareComponentContent_View(this.id);
  697. this.getCoursewareAuditRemarkList(this.id);
  698. } else {
  699. this.isBook ? this.getBookBaseInfo() : this.getProjectBaseInfo();
  700. }
  701. this.getBookChapterStructExpandList();
  702. if (!this.isBook) {
  703. this.getProjectInfo();
  704. }
  705. // 监听全屏事件
  706. document.addEventListener('fullscreenchange', () => {
  707. if (document.fullscreenElement) {
  708. this.isFullScreen = true;
  709. } else {
  710. this.isFullScreen = false;
  711. }
  712. });
  713. },
  714. beforeDestroy() {
  715. document.removeEventListener('fullscreenchange', () => {});
  716. },
  717. methods: {
  718. getProjectBaseInfo() {
  719. GetProjectBaseInfo({ id: this.projectId }).then(({ project_info }) => {
  720. this.courseware_info = { ...project_info, book_name: project_info.name };
  721. });
  722. },
  723. getBookBaseInfo() {
  724. GetBookBaseInfo({ id: this.projectId }).then(({ book_info }) => {
  725. this.courseware_info = { ...this.courseware_info, ...book_info, book_name: book_info.name };
  726. this.project = {
  727. editor: book_info.editor,
  728. cover_image_file_id: book_info.cover_image_file_id,
  729. cover_image_file_url: book_info.cover_image_file_url,
  730. };
  731. });
  732. },
  733. getProjectInfo() {
  734. GetProjectInfo({ id: this.projectId }).then(({ project_info }) => {
  735. if (project_info.cover_image_file_url) {
  736. this.project = project_info;
  737. }
  738. });
  739. },
  740. /**
  741. * 更新背景信息
  742. * @param {Object} background - 背景信息对象
  743. */
  744. updateBackground(background) {
  745. this.background = background;
  746. },
  747. /**
  748. * 得到教材课件信息
  749. * @param {string} id - 课件ID
  750. */
  751. getBookCoursewareInfo(id) {
  752. GetBookCoursewareInfo({ id, is_contain_producer: 'true', is_contain_auditor: 'true' }).then(
  753. ({ courseware_info }) => {
  754. this.courseware_info = { ...this.courseware_info, ...courseware_info };
  755. this.getLangList();
  756. },
  757. );
  758. },
  759. /**
  760. * 得到课件内容(展示内容)
  761. * @param {string} id - 课件ID
  762. */
  763. getCoursewareComponentContent_View(id) {
  764. ContentGetCoursewareContent_View({ id }).then(
  765. ({ content, component_list, content_group_row_list, title_list, background }) => {
  766. if (title_list) this.title_list = title_list || [];
  767. if (background) {
  768. this.background = JSON.parse(background);
  769. this.$emit('updateBackground', this.background);
  770. }
  771. if (content) {
  772. const _content = JSON.parse(content);
  773. this.data = _content;
  774. } else {
  775. this.data = { row_list: [] };
  776. }
  777. let processHtmlString = typeof this.processHtmlString === 'function' ? this.processHtmlString : null;
  778. if (component_list) this.component_list = component_list;
  779. this.component_list.forEach((x) => {
  780. if (x.component_type === 'audio') {
  781. let _c = JSON.parse(x.content);
  782. let p = _c.property || {};
  783. if (!p.file_name_display_mode) p.file_name_display_mode = 'true';
  784. if (p.view_method === 'independent' && !p.style_mode) {
  785. p.style_mode = 'middle';
  786. }
  787. if (!p.style_mode) p.style_mode = 'big';
  788. if (p.view_method === 'icon') {
  789. p.file_name_display_mode = 'false';
  790. p.view_method = 'independent';
  791. p.style_mode = 'small';
  792. }
  793. x.content = JSON.stringify(_c);
  794. } else if (x.component_type === 'richtext') {
  795. if (!processHtmlString) return;
  796. let _c = JSON.parse(x.content);
  797. let p = _c.property || {};
  798. let lev = Number(p.title_style_level);
  799. if (p.is_title !== 'true' || lev < 1 || !_c.content) return;
  800. let style = this.title_list.find((y) => y.level === lev) || {};
  801. if (style && style.style) {
  802. style = JSON.parse(style.style);
  803. let c_text = _c.content;
  804. const parser = new DOMParser();
  805. const doc = parser.parseFromString(c_text, 'text/html');
  806. const body = doc.body;
  807. const pElements = body.querySelectorAll('p');
  808. processHtmlString(pElements, style);
  809. _c.content = body.innerHTML;
  810. x.content = JSON.stringify(_c);
  811. }
  812. }
  813. });
  814. if (content_group_row_list) this.content_group_row_list = JSON.parse(content_group_row_list) || [];
  815. },
  816. );
  817. },
  818. getLangList() {
  819. GetLanguageTypeList({ book_id: this.courseware_info.book_id, is_contain_zh: 'true' }).then(
  820. ({ language_type_list }) => {
  821. this.langList = language_type_list;
  822. },
  823. );
  824. },
  825. /**
  826. * 得到教材章节结构展开列表
  827. */
  828. getBookChapterStructExpandList() {
  829. ChapterGetBookChapterStructExpandList({
  830. book_id: this.projectId,
  831. node_deep_mode: 0,
  832. is_contain_producer: 'true',
  833. is_contain_auditor: 'true',
  834. }).then(({ node_list }) => {
  835. this.node_list = node_list;
  836. });
  837. },
  838. /**
  839. * 选择节点
  840. * @param {string} nodeId - 节点ID
  841. */
  842. selectNode(nodeId) {
  843. this.getCoursewareComponentContent_View(nodeId);
  844. this.getBookCoursewareInfo(nodeId);
  845. this.getCoursewareAuditRemarkList(nodeId);
  846. this.select_node = nodeId;
  847. },
  848. // 审核批注列表
  849. getCoursewareAuditRemarkList(id) {
  850. this.remark_list = [];
  851. GetCoursewareAuditRemarkList({
  852. courseware_id: id,
  853. }).then(({ remark_list }) => {
  854. this.remark_list = remark_list;
  855. if (!remark_list) return;
  856. this.remark_list_obj = remark_list.reduce((acc, item) => {
  857. if (!acc[item.component_id]) {
  858. acc[item.component_id] = [];
  859. }
  860. acc[item.component_id].push(item);
  861. return acc;
  862. }, {});
  863. });
  864. },
  865. addRemark(selectNode, x, y, componentId, content_select) {
  866. this.remark = {
  867. remark_content: '',
  868. file_id_list: [],
  869. };
  870. this.visible = true;
  871. if (selectNode) {
  872. this.menuPosition = {
  873. x,
  874. y,
  875. componentId,
  876. content_select,
  877. };
  878. } else {
  879. this.menuPosition = {
  880. x: -1,
  881. y: -1,
  882. componentId: 'WHOLE',
  883. content_select,
  884. };
  885. }
  886. },
  887. dialogClose(type) {
  888. this[`visible${type}`] = false;
  889. },
  890. // 添加审核批注
  891. addCoursewareAuditRemark(id) {
  892. this.submit_loading = true;
  893. AddCoursewareAuditRemark({
  894. courseware_id: id || this.id,
  895. content: this.remark.remark_content,
  896. component_id: this.menuPosition.componentId,
  897. position_x: this.menuPosition.x,
  898. position_y: this.menuPosition.y,
  899. content_select: this.menuPosition.content_select,
  900. file_id_list: this.remark.file_id_list,
  901. })
  902. .then(() => {
  903. this.submit_loading = false;
  904. this.visible = false;
  905. this.getCoursewareAuditRemarkList(id || this.id);
  906. })
  907. .catch(() => {
  908. this.submit_loading = false;
  909. });
  910. },
  911. // 删除批注
  912. deleteRemarks(id) {
  913. this.$confirm('确定要删除此条批注吗?', '提示', {
  914. confirmButtonText: '确定',
  915. cancelButtonText: '取消',
  916. type: 'warning',
  917. })
  918. .then(() => {
  919. DeleteCoursewareAuditRemarkList({ id }).then(() => {
  920. this.getCoursewareAuditRemarkList(this.select_node ? this.select_node : this.id);
  921. this.$message.success('删除成功!');
  922. });
  923. })
  924. .catch(() => {});
  925. },
  926. // 定位批注
  927. async handleLocationRemarks(componentId) {
  928. if (componentId) {
  929. let node = await this.$refs.courserware.findChildComponentByKey(componentId);
  930. if (node) {
  931. await this.$nextTick();
  932. this.$refs.previewMain.scrollTo({
  933. top: node.$el.offsetTop - 50,
  934. left: node.$el.offsetLeft - 50,
  935. behavior: 'smooth',
  936. });
  937. }
  938. }
  939. },
  940. // 计算previewMain滑动距离
  941. computeScroll() {
  942. this.$refs.courserware.handleResult(
  943. this.$refs.previewMain.scrollTop,
  944. this.$refs.previewMain.scrollLeft,
  945. this.select_node,
  946. );
  947. },
  948. /**
  949. * 处理侧边栏图标点击事件
  950. * @param {string} handle - 处理函数名
  951. * @param {any} param - 处理函数参数
  952. * @param {string} icon - 图标名称
  953. */
  954. handleSidebarClick(handle, param, icon, children, barLevel) {
  955. if (typeof handle === 'string' && handle && typeof this[handle] === 'function') {
  956. this[handle](param);
  957. }
  958. if (barLevel === 2) {
  959. this.twoCurToolbarIcon = icon;
  960. } else {
  961. this.curToolbarIcon = icon;
  962. this.twoCurToolbarIcon = '';
  963. }
  964. if (children && children.length > 0 && Array.isArray(children)) {
  965. this.twoSidebarList = children;
  966. this.twoCurToolbarIcon = children[0].icon;
  967. this.openDrawer(children[0].param);
  968. }
  969. },
  970. openMindMap() {
  971. MangerGetBookMindMap({ book_id: this.projectId }).then(({ content }) => {
  972. if (content) {
  973. this.mindMapJsonData = JSON.parse(content);
  974. this.isChildDataLoad = true;
  975. }
  976. });
  977. this.visibleMindMap = true;
  978. },
  979. async handleNodeClick(data) {
  980. let [nodeId, componentId] = data.split('#');
  981. if (nodeId) this.selectNode(nodeId);
  982. if (componentId) {
  983. let node = await this.$refs.courserware.findChildComponentByKey(componentId);
  984. if (node) {
  985. await this.$nextTick();
  986. this.$refs.previewMain.scrollTo({
  987. top: node.$el.offsetTop - 50,
  988. left: node.$el.offsetLeft - 50,
  989. behavior: 'smooth',
  990. });
  991. }
  992. }
  993. this.visibleMindMap = false;
  994. this.visibleVisNetwork = false;
  995. },
  996. /**
  997. * 打开知识图谱
  998. */
  999. async openVisNetwork() {
  1000. this.visibleVisNetwork = true;
  1001. },
  1002. /**
  1003. * 打开选择语言弹窗
  1004. */
  1005. openTranslate() {
  1006. this.visibleTranslate = true;
  1007. },
  1008. /**
  1009. * 打开抽屉并初始化加载
  1010. * @param {Object} param - 抽屉参数
  1011. * @param {string} param.type - 抽屉类型(0: 图片, 1: 音频, 2: 视频, 3:H5 游戏,4:3D 模型,5:文本)
  1012. */
  1013. openDrawer({ type }) {
  1014. if (this.drawerType === type) {
  1015. this.drawerType = '';
  1016. return;
  1017. }
  1018. this.activeBookChapterId = '';
  1019. this.multimediaIsAllShow = true;
  1020. // 重置所有加载状态
  1021. this.resetLoadState();
  1022. this.drawerType = type;
  1023. this.$nextTick(() => {
  1024. // 确保DOM更新后触发加载
  1025. this.loadBookChapterStructExpandList();
  1026. });
  1027. },
  1028. openAudit() {
  1029. this.drawerType = '';
  1030. },
  1031. resetLoadState() {
  1032. this.cur_page = 1;
  1033. this.file_list = [];
  1034. this.total_count = 0;
  1035. this.loading = false;
  1036. this.lastLoadTime = 0; // 重置时间戳,允许立即加载
  1037. this.loadCount = 0;
  1038. },
  1039. /**
  1040. * 加载章节
  1041. */
  1042. async loadBookChapterStructExpandList() {
  1043. const params = {
  1044. book_id: this.projectId,
  1045. node_deep_mode: 3, // 节点深度模式 0【全部】,1【只查询章节】2【只查询非叶子章节】3【只查询第一层】
  1046. is_contain_root_node: 'false', // 是否包含根节点(把教材作为根节点)
  1047. is_contain_producer: 'false', // 是否包含制作人信息
  1048. is_contain_auditor: 'false', // 是否包含审核人信息
  1049. };
  1050. await GetBookChapterStructExpandList(params).then(({ node_list }) => {
  1051. this.bookChapterList = node_list || [];
  1052. });
  1053. },
  1054. /**
  1055. * 加载章节下的资源
  1056. */
  1057. async loadmultimediaList() {
  1058. const params = {
  1059. page_capacity: this.page_capacity,
  1060. cur_page: this.cur_page,
  1061. book_id: this.projectId,
  1062. book_chapter_node_id: this.activeBookChapterId,
  1063. type: parseInt(this.drawerType),
  1064. scope: this.multimediaIsAllShow ? -1 : 0,
  1065. };
  1066. await PageQueryBookResourceList(params)
  1067. .then(({ total_count, resource_list }) => {
  1068. this.total_count = total_count;
  1069. this.file_list = resource_list || [];
  1070. this.file_list.forEach((x, i) => {
  1071. this.$set(x, 'is_can_edit', x.is_can_edit === 'true');
  1072. this.$set(x, 'is_hided', x.is_hided === 'true');
  1073. });
  1074. })
  1075. .finally(() => {
  1076. this.loading = false;
  1077. });
  1078. },
  1079. /**
  1080. * 点击章节,切换数据
  1081. */
  1082. async multimediaHandleChange(id) {
  1083. const item = this.bookChapterList.find((item) => item.id === this.activeBookChapterId);
  1084. if (item) {
  1085. this.multimediaLoadingStates = true;
  1086. if ((!item.data && !item.error) || !id) {
  1087. await this.loadmultimediaList();
  1088. let tmpList = this.file_list && this.file_list.length > 0 ? [...this.file_list] : null;
  1089. this.$set(item, 'data', tmpList);
  1090. this.multimediaLoadingStates = false;
  1091. } else {
  1092. this.multimediaLoadingStates = false;
  1093. }
  1094. }
  1095. },
  1096. /**
  1097. * 切换资源显示隐藏
  1098. */
  1099. handleMediaShowChange(item) {
  1100. const params = { id: item.id, is_hided: item.is_hided ? 'true' : 'false' };
  1101. SetBookResourceHide(params).then((res) => {
  1102. // 如果不是显示全部资源,则需要重新加载
  1103. if (!this.multimediaIsAllShow) {
  1104. this.multimediaHandleChange();
  1105. }
  1106. });
  1107. },
  1108. isScrollAtBottom(container) {
  1109. if (!container) return false;
  1110. return container.scrollHeight - container.scrollTop <= container.clientHeight + 5;
  1111. },
  1112. async handleFileClick(courseware_id, component_id) {
  1113. if (courseware_id) this.selectNode(courseware_id);
  1114. if (component_id) {
  1115. let node = await this.$refs.courserware.findChildComponentByKey(component_id);
  1116. if (node) {
  1117. await this.$nextTick();
  1118. this.$refs.previewMain.scrollTo({
  1119. top: node.offsetTop - 50,
  1120. left: node.offsetLeft - 50,
  1121. behavior: 'smooth',
  1122. });
  1123. }
  1124. }
  1125. },
  1126. /**
  1127. * 文本转换
  1128. * @param {string} text - 要转换的文本
  1129. * @returns {string} - 转换后的文本
  1130. */
  1131. convertText(text) {
  1132. if (this.chinese === 'zh-Hant' && this.opencc) {
  1133. try {
  1134. if (/<[a-z][\s\S]*>/i.test(text)) {
  1135. return this.convertHtmlPreserveAttributes(text);
  1136. }
  1137. } catch (e) {
  1138. return text;
  1139. }
  1140. return this.opencc(text);
  1141. }
  1142. return text;
  1143. },
  1144. /**
  1145. * 使用OpenCC解析HTML并仅转换文本节点,保留属性(包括内联样式/font-family)保持不变。防止字体名称像“微软雅黑' 正在转换为'微軟雅黑'.
  1146. */
  1147. convertHtmlPreserveAttributes(html) {
  1148. try {
  1149. const parser = new DOMParser();
  1150. const doc = parser.parseFromString(html, 'text/html'); // 解析HTML字符串,返回Document对象
  1151. // 跳过 script 和 style 标签
  1152. const skipTags = new Set(['SCRIPT', 'STYLE']);
  1153. const walker = doc.createTreeWalker(doc.body, NodeFilter.SHOW_TEXT);
  1154. let node = walker.nextNode();
  1155. while (node) {
  1156. const parent = node.parentNode;
  1157. if (parent && !skipTags.has(parent.nodeName)) {
  1158. const v = node.nodeValue;
  1159. if (v && v.trim()) {
  1160. node.nodeValue = this.opencc(v);
  1161. }
  1162. }
  1163. node = walker.nextNode();
  1164. }
  1165. return doc.body.innerHTML;
  1166. } catch (err) {
  1167. try {
  1168. return this.opencc(html);
  1169. } catch (e) {
  1170. return html;
  1171. }
  1172. }
  1173. },
  1174. simulateAnswer(disabled = true) {
  1175. this.$refs.courserware.simulateAnswer(this.isJudgeCorrect, this.isShowAnswer, disabled);
  1176. },
  1177. /**
  1178. * 选择节点
  1179. * @param {string} nodeId - 节点ID
  1180. * @param {boolean} isLeaf - 是否是叶子节点
  1181. */
  1182. selectChapterNode(nodeId, isLeaf) {
  1183. if (!isLeaf) return;
  1184. if (this.curSelectId === nodeId) return;
  1185. this.curSelectId = nodeId;
  1186. this.selectNode(nodeId);
  1187. this.isShowGroup = false;
  1188. this.groupShowAll = true;
  1189. this.$refs.courserware.clearRowCheckList();
  1190. },
  1191. /**
  1192. * 计算章节名称样式
  1193. * @param {number} deep - 节点深度
  1194. * @param {boolean} isLeaf - 是否是叶子节点
  1195. * @returns {Object} - 样式对象
  1196. */
  1197. computedNameStyle(deep, isLeaf) {
  1198. return {
  1199. 'padding-left': `${(deep - 1) * 8}px`,
  1200. cursor: isLeaf ? 'pointer' : 'auto',
  1201. };
  1202. },
  1203. /**
  1204. * 切换左侧导航栏显示与隐藏
  1205. */
  1206. toggleNavigationShow() {
  1207. this.navigationShow = !this.navigationShow;
  1208. },
  1209. /**
  1210. * 切换右侧工具栏显示与隐藏
  1211. */
  1212. toggleSidebarShow() {
  1213. this.sidebarShow = !this.sidebarShow;
  1214. },
  1215. backTop() {
  1216. this.$refs.previewMain.scrollTo({
  1217. top: 0,
  1218. left: 0,
  1219. behavior: 'smooth',
  1220. });
  1221. },
  1222. /**
  1223. * 定位到对应位置
  1224. * @param {Object} item - 位置对象
  1225. * @param {number} type - 定位类型(11: 笔记定位, 12: 收藏定位, 0: 资源定位)
  1226. */
  1227. handleLocation(item, type) {
  1228. if (type === 0) {
  1229. let did = `${item.courseware_id}#${item.component_id}`;
  1230. this.handleNodeClick(did);
  1231. this.curSelectId = item.courseware_id;
  1232. return;
  1233. }
  1234. if (this.$refs.courserware && this.$refs.courserware.handleLocation) {
  1235. item.type = type;
  1236. this.$refs.courserware.handleLocation(item);
  1237. }
  1238. },
  1239. openFile(file) {
  1240. if (file && file.file_url) {
  1241. window.open(file.file_url);
  1242. }
  1243. },
  1244. /**
  1245. * 获取笔记列表
  1246. * @param {Object} params - 参数对象
  1247. */
  1248. async getNote(params) {
  1249. if (params && params.type) this.drawerType = Number(params.type);
  1250. this.allNoteList = [];
  1251. await GetMyNoteList({ courseware_id: this.curSelectId }).then((res) => {
  1252. if (res.status === 1) {
  1253. res.note_list.forEach((x) => {
  1254. if (x.note_desc) {
  1255. let n = JSON.parse(x.note_desc);
  1256. let obj = {
  1257. coursewareId: x.courseware_id,
  1258. id: x.id,
  1259. blockId: n.blockId,
  1260. startIndex: n.startIndex,
  1261. endIndex: n.endIndex,
  1262. text: n.text,
  1263. note: n.note,
  1264. };
  1265. this.allNoteList.push(obj);
  1266. }
  1267. });
  1268. }
  1269. });
  1270. },
  1271. async handEditNote(note) {
  1272. this.oldRichData = {};
  1273. if (this.allNoteList.length === 0) {
  1274. await this.getNote();
  1275. }
  1276. let old = this.allNoteList.find(
  1277. (x) =>
  1278. x.coursewareId === note.coursewareId &&
  1279. x.blockId === note.blockId &&
  1280. x.startIndex === note.startIndex &&
  1281. x.endIndex === note.endIndex,
  1282. );
  1283. if (old) {
  1284. this.oldRichData = old;
  1285. }
  1286. this.newSelectedInfo = note;
  1287. this.editDialogOpen = true;
  1288. },
  1289. saveNote(note) {
  1290. let noteInfo = {
  1291. blockId: this.newSelectedInfo.blockId,
  1292. startIndex: this.newSelectedInfo.startIndex,
  1293. endIndex: this.newSelectedInfo.endIndex,
  1294. note: note.note,
  1295. text: this.newSelectedInfo.text,
  1296. };
  1297. let reqData = {
  1298. courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
  1299. component_id: 'WHOLE',
  1300. note_desc: JSON.stringify(noteInfo), // 位置描述
  1301. };
  1302. if (note.id) {
  1303. if (!noteInfo.note) {
  1304. this.delNote(note.id);
  1305. return;
  1306. }
  1307. let upDate = {
  1308. id: note.id,
  1309. note_desc: reqData.note_desc,
  1310. };
  1311. UpdateMyNote(upDate).then(() => {
  1312. this.getNote();
  1313. });
  1314. } else {
  1315. AddMyNote(reqData).then(() => {
  1316. this.getNote();
  1317. });
  1318. }
  1319. this.editDialogOpen = false;
  1320. this.newSelectedInfo = null;
  1321. this.selectedInfo = null;
  1322. },
  1323. handDelNote(id) {
  1324. this.$confirm('确定要删除此条笔记吗?', '提示', {
  1325. confirmButtonText: '确定',
  1326. cancelButtonText: '取消',
  1327. type: 'warning',
  1328. })
  1329. .then(() => {
  1330. this.delNote(id);
  1331. })
  1332. .catch(() => {});
  1333. },
  1334. delNote(id) {
  1335. const noteId = id || (this.oldRichData && this.oldRichData.id);
  1336. if (!noteId) return;
  1337. DeleteMyNote({ id: noteId }).then(() => {
  1338. this.allNoteList = this.allNoteList.filter((x) => x.id !== noteId);
  1339. });
  1340. },
  1341. async getCollect(params) {
  1342. if (params && params.type) this.drawerType = Number(params.type);
  1343. this.allCottectList = [];
  1344. await GetMyCollectList({ courseware_id: this.curSelectId }).then((res) => {
  1345. if (res.status === 1) {
  1346. res.collect_list.forEach((x) => {
  1347. if (x.collect_desc) {
  1348. let n = JSON.parse(x.collect_desc);
  1349. let obj = {
  1350. coursewareId: x.courseware_id,
  1351. id: x.id,
  1352. blockId: n.blockId,
  1353. startIndex: n.startIndex,
  1354. endIndex: n.endIndex,
  1355. text: n.text,
  1356. };
  1357. this.allCottectList.push(obj);
  1358. }
  1359. });
  1360. }
  1361. });
  1362. },
  1363. async saveCollect(collect) {
  1364. if (this.allCottectList.length === 0) {
  1365. await this.getCollect();
  1366. }
  1367. let old = this.allCottectList.find(
  1368. (x) =>
  1369. x.coursewareId === collect.coursewareId &&
  1370. x.blockId === collect.blockId &&
  1371. x.startIndex === collect.startIndex &&
  1372. x.endIndex === collect.endIndex,
  1373. );
  1374. if (old) {
  1375. this.$message({
  1376. dangerouslyUseHTMLString: true,
  1377. message: "<i class='el-icon-check' />已收藏",
  1378. });
  1379. return;
  1380. }
  1381. this.newSelectedInfo = collect;
  1382. let collectInfo = {
  1383. blockId: this.newSelectedInfo.blockId,
  1384. startIndex: this.newSelectedInfo.startIndex,
  1385. endIndex: this.newSelectedInfo.endIndex,
  1386. text: this.newSelectedInfo.text,
  1387. };
  1388. let reqData = {
  1389. courseware_id: this.newSelectedInfo.coursewareId, // 课件 ID
  1390. component_id: 'WHOLE',
  1391. collect_desc: JSON.stringify(collectInfo), // 位置描述
  1392. };
  1393. AddMyCollect(reqData)
  1394. .then(() => {
  1395. this.getCollect();
  1396. })
  1397. .then(() => {
  1398. this.$message({
  1399. dangerouslyUseHTMLString: true,
  1400. message: "<i class='el-icon-check' />已收藏",
  1401. });
  1402. });
  1403. },
  1404. handDelCollect(id) {
  1405. this.$confirm('确定要删除此条收藏吗?', '提示', {
  1406. confirmButtonText: '确定',
  1407. cancelButtonText: '取消',
  1408. type: 'warning',
  1409. })
  1410. .then(() => {
  1411. DeleteMyCollect({ id }).then(() => {
  1412. this.allCottectList = this.allCottectList.filter((x) => x.id !== id);
  1413. });
  1414. })
  1415. .catch(() => {});
  1416. },
  1417. getSearch(params) {
  1418. if (params && params.type) this.drawerType = Number(params.type);
  1419. },
  1420. async querySearchList() {
  1421. this.searchList = [];
  1422. if (!this.searchContent) return;
  1423. await SearchBookContentText({ book_id: this.projectId, text: this.searchContent }).then((res) => {
  1424. if (res.status === 1) {
  1425. this.searchList = res.courseware_component_list;
  1426. }
  1427. });
  1428. },
  1429. fullScreen() {
  1430. toggleFullScreen(this.$refs.previewMain);
  1431. },
  1432. // 打开模拟答题权限控制弹窗
  1433. openSimulateAnswerPermissionControl() {
  1434. this.visiblePermissionControl = true;
  1435. },
  1436. // 创建课件预览链接
  1437. createCoursewarePreviewURL() {
  1438. CreateCoursewarePreviewURL({ courseware_id: this.select_node, valid_day_count: 20 }).then(({ url }) => {
  1439. this.preview_url = url;
  1440. this.visiblePreviewURL = true;
  1441. });
  1442. },
  1443. /**
  1444. * 计算选中分组行的课件信息
  1445. * @returns {object} 选中分组行的课件信息
  1446. */
  1447. computedSelectedGroupCoursewareInfo() {
  1448. return this.$refs.courserware.computedSelectedGroupCoursewareInfo();
  1449. },
  1450. startSelection(event) {
  1451. if (
  1452. this.isTrue(this.courseware_info.is_my_audit_task) &&
  1453. this.isTrue(this.courseware_info.is_can_add_audit_remark)
  1454. ) {
  1455. this.isSelecting = true;
  1456. let clientRect = document.getElementById(`selectable-area-preview`).getBoundingClientRect();
  1457. this.menuPosition.startX = event.clientX - clientRect.left;
  1458. this.menuPosition.startY = event.clientY - clientRect.top;
  1459. }
  1460. },
  1461. updateSelection(event) {
  1462. if (!this.isSelecting) return;
  1463. let clientRect = document.getElementById(`selectable-area-preview`).getBoundingClientRect();
  1464. this.menuPosition.endX = event.clientX - clientRect.left;
  1465. this.menuPosition.endY = event.clientY - clientRect.top;
  1466. },
  1467. endSelection() {
  1468. if (!this.isSelecting || this.menuPosition.startX === this.menuPosition.endX || !this.menuPosition.endX) return;
  1469. this.isSelecting = false;
  1470. const width = Math.abs(this.menuPosition.endX - this.menuPosition.startX);
  1471. const height = Math.abs(this.menuPosition.endY - this.menuPosition.startY);
  1472. const x =
  1473. this.menuPosition.endX > this.menuPosition.startX
  1474. ? `${this.menuPosition.startX}px`
  1475. : `${this.menuPosition.endX}px`;
  1476. const y =
  1477. this.menuPosition.endY > this.menuPosition.startY
  1478. ? `${this.menuPosition.startY}px`
  1479. : `${this.menuPosition.endY}px`;
  1480. let obj = {
  1481. id: Math.random().toString(36).substring(2, 10),
  1482. width: `${width}px`,
  1483. height: `${height}px`,
  1484. x,
  1485. y,
  1486. text: '',
  1487. };
  1488. this.menuPosition.startX = null;
  1489. this.menuPosition.endX = null;
  1490. this.menuPosition.startY = null;
  1491. this.menuPosition.endY = null;
  1492. if (width && height && this.isText) {
  1493. this.data.text_list.push(obj);
  1494. this.activeType = 'text';
  1495. this.activeIndex = this.data.text_list.length - 1;
  1496. this.hotspotsActiveIndex = this.data.text_list.length - 1;
  1497. } else if (width && height && !this.isText) {
  1498. this.data.input_list.push(obj);
  1499. this.activeType = 'input';
  1500. this.activeIndex = this.data.input_list.length - 1;
  1501. this.inputActiveIndex = this.data.input_list.length - 1;
  1502. }
  1503. },
  1504. },
  1505. };
  1506. </script>
  1507. <style lang="scss" scoped>
  1508. @use '@/styles/mixin.scss' as *;
  1509. $total-width: $courseware-width + $courseware-left-margin + $courseware-right-margin;
  1510. .common-preview {
  1511. &__header {
  1512. position: sticky;
  1513. top: 56px;
  1514. left: 0;
  1515. z-index: 9;
  1516. display: flex;
  1517. align-items: center;
  1518. height: 40px;
  1519. padding: 6px 4px;
  1520. margin-bottom: 5px;
  1521. background-color: #fff;
  1522. border-top: $border;
  1523. border-bottom: $border;
  1524. > .menu-container {
  1525. display: flex;
  1526. justify-content: space-between;
  1527. width: 360px;
  1528. padding: 4px 8px;
  1529. border-right: $border;
  1530. }
  1531. > .courseware {
  1532. display: flex;
  1533. flex-grow: 1;
  1534. column-gap: 16px;
  1535. align-items: center;
  1536. justify-content: space-between;
  1537. height: 40px;
  1538. .name-path {
  1539. min-width: 200px;
  1540. height: 40px;
  1541. padding: 4px 8px;
  1542. font-size: 14px;
  1543. line-height: 32px;
  1544. border-right: $border;
  1545. }
  1546. .lang-select {
  1547. :deep .el-input {
  1548. width: 100px;
  1549. }
  1550. :deep .el-input__inner {
  1551. height: 24px;
  1552. line-height: 24px;
  1553. background-color: #fff;
  1554. }
  1555. :deep .el-input__icon {
  1556. line-height: 24px;
  1557. }
  1558. }
  1559. .flow-nodename {
  1560. flex: 1;
  1561. }
  1562. .group {
  1563. display: flex;
  1564. align-items: center;
  1565. }
  1566. .operator {
  1567. display: flex;
  1568. column-gap: 8px;
  1569. align-items: center;
  1570. .link {
  1571. + .link {
  1572. margin-left: 0;
  1573. &::before {
  1574. margin-right: 8px;
  1575. color: #999;
  1576. content: '|';
  1577. }
  1578. }
  1579. }
  1580. }
  1581. }
  1582. }
  1583. .main-container {
  1584. position: relative;
  1585. flex: 1;
  1586. min-width: 1110px;
  1587. padding: 15px 0;
  1588. overflow: auto;
  1589. background-color: #ececec;
  1590. .catalogue-bar {
  1591. position: absolute;
  1592. top: 15px;
  1593. left: 0;
  1594. display: flex;
  1595. align-items: center;
  1596. justify-content: center;
  1597. width: 54px;
  1598. height: 54px;
  1599. margin: -9px 6px 0 240px;
  1600. cursor: pointer;
  1601. background-color: #fff;
  1602. border-radius: 2px;
  1603. box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
  1604. }
  1605. .sidebar-bar {
  1606. position: absolute;
  1607. top: 0;
  1608. right: 240px;
  1609. display: flex;
  1610. width: 60px;
  1611. height: calc(100vh - 166px);
  1612. .toolbar {
  1613. display: flex;
  1614. flex-direction: column;
  1615. align-items: center;
  1616. width: 60px;
  1617. height: 100%;
  1618. img {
  1619. cursor: pointer;
  1620. }
  1621. &-special {
  1622. display: flex;
  1623. flex-direction: column;
  1624. row-gap: 16px;
  1625. align-items: center;
  1626. width: 100%;
  1627. margin-bottom: 24px;
  1628. background-color: #fff;
  1629. img {
  1630. width: 36px;
  1631. height: 36px;
  1632. }
  1633. }
  1634. }
  1635. }
  1636. }
  1637. .back-top {
  1638. position: absolute;
  1639. right: 240px;
  1640. bottom: 0;
  1641. display: flex;
  1642. place-content: center center;
  1643. align-items: center;
  1644. width: 60px;
  1645. height: 60px;
  1646. cursor: pointer;
  1647. background-color: #fff;
  1648. }
  1649. main.preview-main {
  1650. display: flex;
  1651. flex: 1;
  1652. width: calc($total-width);
  1653. min-width: calc($total-width);
  1654. max-width: calc($total-width);
  1655. min-height: 100%;
  1656. margin: 0 auto;
  1657. background-color: #fff;
  1658. border-radius: 4px;
  1659. box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
  1660. .preview-left {
  1661. width: $courseware-left-margin;
  1662. min-width: $courseware-left-margin;
  1663. max-width: $courseware-left-margin;
  1664. background-color: $courseware-bgColor;
  1665. }
  1666. .preview-right {
  1667. width: $courseware-right-margin;
  1668. min-width: $courseware-right-margin;
  1669. max-width: $courseware-right-margin;
  1670. background-color: $courseware-bgColor;
  1671. }
  1672. &.no-audit {
  1673. margin: 0 auto;
  1674. }
  1675. }
  1676. .audit-content {
  1677. display: flex;
  1678. min-width: 1810px;
  1679. height: calc(100vh - 166px);
  1680. .left-menu {
  1681. display: flex;
  1682. flex-direction: column;
  1683. width: $catalogue-width;
  1684. font-family: 'Microsoft YaHei', 'Arial', sans-serif;
  1685. background-color: #fff;
  1686. .courseware-info {
  1687. display: flex;
  1688. column-gap: 18px;
  1689. width: 100%;
  1690. height: 186px;
  1691. padding: 6px 6px 24px;
  1692. border-bottom: $border;
  1693. .cover-image {
  1694. display: flex;
  1695. align-items: center;
  1696. justify-content: center;
  1697. width: 111px;
  1698. height: 157px;
  1699. background-color: rgba(229, 229, 229, 100%);
  1700. img {
  1701. max-width: 111px;
  1702. max-height: 157px;
  1703. }
  1704. }
  1705. .info-content {
  1706. display: flex;
  1707. flex-direction: column;
  1708. justify-content: space-between;
  1709. .catalogue-icon {
  1710. text-align: right;
  1711. .svg-icon {
  1712. cursor: pointer;
  1713. }
  1714. }
  1715. .courseware {
  1716. width: 159px;
  1717. height: 64px;
  1718. font-size: 16px;
  1719. .name {
  1720. font-weight: bold;
  1721. }
  1722. .editor {
  1723. display: -webkit-box;
  1724. overflow: hidden;
  1725. text-overflow: ellipsis;
  1726. word-break: break-word;
  1727. white-space: normal;
  1728. -webkit-line-clamp: 2; /* 多行省略行数,按需调整 */
  1729. -webkit-box-orient: vertical;
  1730. }
  1731. }
  1732. }
  1733. }
  1734. .courseware-tree {
  1735. display: flex;
  1736. flex: 1;
  1737. flex-direction: column;
  1738. row-gap: 8px;
  1739. padding: 12px;
  1740. margin-top: 12px;
  1741. overflow: auto;
  1742. .menu-item {
  1743. display: flex;
  1744. align-items: center;
  1745. &:not(.courseware) {
  1746. font-weight: bold;
  1747. }
  1748. &.courseware {
  1749. &:hover {
  1750. .name,
  1751. .status {
  1752. background-color: #f3f3f3;
  1753. }
  1754. }
  1755. }
  1756. .svg-icon {
  1757. margin-left: 4px;
  1758. &.my-edit-task {
  1759. color: $right-color;
  1760. }
  1761. }
  1762. .name {
  1763. flex: 1;
  1764. padding: 4px 8px 4px 4px;
  1765. border-radius: 4px;
  1766. }
  1767. .status {
  1768. height: 32px;
  1769. padding: 4px 8px 4px 4px;
  1770. font-size: 12px;
  1771. line-height: 24px;
  1772. color: #f00004;
  1773. border-radius: 4px;
  1774. border-top-left-radius: 0;
  1775. border-bottom-left-radius: 0;
  1776. }
  1777. &.active {
  1778. .name {
  1779. font-weight: bold;
  1780. color: #4095e5;
  1781. }
  1782. }
  1783. }
  1784. }
  1785. }
  1786. .sidebar {
  1787. position: relative;
  1788. display: flex;
  1789. width: $sidebar-width;
  1790. .toolbar {
  1791. display: flex;
  1792. flex-direction: column;
  1793. align-items: center;
  1794. width: 60px;
  1795. height: 100%;
  1796. background-color: rgba(247, 248, 250, 100%);
  1797. img {
  1798. cursor: pointer;
  1799. }
  1800. &-special {
  1801. display: flex;
  1802. flex-direction: column;
  1803. row-gap: 16px;
  1804. margin-bottom: 24px;
  1805. }
  1806. &-list {
  1807. display: flex;
  1808. flex-direction: column;
  1809. row-gap: 16px;
  1810. align-items: center;
  1811. width: 100%;
  1812. .sidebar-item {
  1813. width: 100%;
  1814. text-align: center;
  1815. .sidebar-icon {
  1816. width: 36px;
  1817. height: 36px;
  1818. cursor: pointer;
  1819. }
  1820. &.active {
  1821. background-color: #4095e5;
  1822. }
  1823. }
  1824. }
  1825. }
  1826. .content {
  1827. flex: 1;
  1828. background-color: #fff;
  1829. .resource_box {
  1830. height: 100%;
  1831. overflow-y: auto;
  1832. border: 1px solid #e5e5e5;
  1833. .source-toolbar-list {
  1834. position: fixed;
  1835. z-index: 999;
  1836. display: flex;
  1837. width: 240px;
  1838. background: #f2f3f5;
  1839. .sidebar-item {
  1840. width: 100%;
  1841. padding-top: 5px;
  1842. text-align: center;
  1843. border-right: 1px solid #ccc;
  1844. .sidebar-icon {
  1845. width: 26px;
  1846. height: 26px;
  1847. cursor: pointer;
  1848. }
  1849. &.active {
  1850. background-color: #4095e5;
  1851. }
  1852. }
  1853. }
  1854. h5 {
  1855. position: fixed;
  1856. z-index: 999;
  1857. width: 240px;
  1858. padding: 0 5px;
  1859. margin: 0;
  1860. font-size: 18px;
  1861. line-height: 40px;
  1862. background: #f2f3f5;
  1863. }
  1864. .scroll-container {
  1865. display: flex;
  1866. flex-direction: column;
  1867. row-gap: 8px;
  1868. margin: 6px;
  1869. .list-item {
  1870. align-items: center;
  1871. border: 1px solid #ccc;
  1872. border-radius: 8px;
  1873. :deep .el-slider {
  1874. .el-slider__runway {
  1875. background-color: #eee;
  1876. }
  1877. }
  1878. .el-image {
  1879. display: flex;
  1880. width: 100%;
  1881. min-width: 100%;
  1882. height: 90px;
  1883. background-color: #ccc;
  1884. border-radius: 8px;
  1885. }
  1886. .video-play {
  1887. width: 100%;
  1888. min-width: 100%;
  1889. }
  1890. .text-box {
  1891. word-break: break-word;
  1892. }
  1893. }
  1894. }
  1895. p {
  1896. max-width: 140px;
  1897. color: #999;
  1898. text-align: center;
  1899. word-break: break-all;
  1900. }
  1901. .card-box li {
  1902. padding: 10px;
  1903. border-bottom: 1px solid #ccc;
  1904. .el-icon-notebook-2 {
  1905. display: block;
  1906. margin-bottom: 4px;
  1907. font-size: 12px;
  1908. color: grey;
  1909. }
  1910. }
  1911. .file-handle-info {
  1912. margin: 0 5px;
  1913. .mark {
  1914. display: flex;
  1915. align-items: center;
  1916. justify-content: space-between;
  1917. padding: 3px;
  1918. .linkLocation {
  1919. cursor: pointer;
  1920. }
  1921. }
  1922. .word {
  1923. flex: 1;
  1924. word-break: break-all;
  1925. }
  1926. }
  1927. ::v-deep .el-collapse-item__header {
  1928. margin-left: 5px;
  1929. }
  1930. ::v-deep .el-collapse-item__content {
  1931. padding-bottom: 5px;
  1932. }
  1933. .loading-text {
  1934. padding: 5px;
  1935. color: #999;
  1936. text-align: center;
  1937. }
  1938. .error-text {
  1939. padding: 5px;
  1940. color: #999;
  1941. text-align: center;
  1942. }
  1943. }
  1944. }
  1945. .back-top {
  1946. position: absolute;
  1947. bottom: 0;
  1948. left: 0;
  1949. display: flex;
  1950. place-content: center center;
  1951. align-items: center;
  1952. width: 60px;
  1953. height: 60px;
  1954. cursor: pointer;
  1955. }
  1956. }
  1957. }
  1958. }
  1959. :deep .scroll-container .audio-wrapper {
  1960. width: 100% !important;
  1961. .audio-middle {
  1962. width: 100% !important;
  1963. padding: 6px 8px !important;
  1964. margin-left: 0;
  1965. border: none;
  1966. border-radius: 8px;
  1967. .audio-name {
  1968. text-align: left;
  1969. }
  1970. .slider-area {
  1971. column-gap: 8px !important;
  1972. }
  1973. :deep .remark-dialog {
  1974. .el-dialog__body {
  1975. padding: 5px 20px;
  1976. }
  1977. }
  1978. :deep .audit-dialog {
  1979. .el-dialog__body {
  1980. height: calc(100vh - 260px);
  1981. padding: 5px 20px;
  1982. }
  1983. .mind-map-container .mind-map {
  1984. height: calc(100vh - 310px);
  1985. }
  1986. }
  1987. }
  1988. }
  1989. .mt10 {
  1990. margin: 10px 0 0 !important;
  1991. background-color: #eee;
  1992. }
  1993. .file-list {
  1994. display: flex;
  1995. flex-direction: column;
  1996. row-gap: 5px;
  1997. li {
  1998. align-items: center;
  1999. .file-name {
  2000. display: flex;
  2001. column-gap: 14px;
  2002. align-items: center;
  2003. justify-content: space-between;
  2004. max-width: 500px;
  2005. padding: 8px 12px;
  2006. font-size: 14px;
  2007. color: #1d2129;
  2008. background-color: #f7f8fa;
  2009. border-radius: 8px;
  2010. p {
  2011. margin: 0;
  2012. }
  2013. span,
  2014. div {
  2015. display: flex;
  2016. align-items: center;
  2017. }
  2018. }
  2019. .svg-icon {
  2020. cursor: pointer;
  2021. }
  2022. }
  2023. }
  2024. </style>
  2025. <style lang="scss">
  2026. .tox-tinymce-aux {
  2027. z-index: 9999 !important;
  2028. }
  2029. </style>