CommonPreview.vue 61 KB

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