index.vue 64 KB

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