CommonPreview.vue 64 KB

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