CommonPreview.vue 68 KB

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