BookEep.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <div class="common-preview">
  3. <div class="audit-content" >
  4. <div ref="previewMain" class="main-container" :style="{ paddingLeft: '0', paddingRight: '0' }">
  5. <main :class="['preview-main', 'no-audit']" :style="computedCommonPreviewStyle">
  6. <div class="preview-left" :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"></div>
  7. <CoursewarePreview
  8. ref="courseware"
  9. :is-show-group="false"
  10. :group-show-all="true"
  11. :group-row-list="contentGroupRowList"
  12. :data="data"
  13. :courseware-id="curSelectId"
  14. :component-list="componentList"
  15. :background="background"
  16. :can-remark="false"
  17. :show-remark="false"
  18. :component-remark-obj="{}"
  19. :project="project"
  20. />
  21. <div class="preview-right" :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"></div>
  22. </main>
  23. </div>
  24. <div v-if="!sidebarShow" class="back-top" @click="backTop">
  25. <img :src="require(`@/assets/icon/back-top.png`)" alt="返回顶部" />
  26. </div>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
  32. import { isTrue } from '@/utils/validate';
  33. import { buildCoursewareStyle } from '@/views/book/courseware/preview/common/utils/coursewareStyle';
  34. export default {
  35. name: 'CommonPreview',
  36. components: {
  37. CoursewarePreview,
  38. },
  39. provide() {
  40. return {
  41. getLang: () => this.lang,
  42. getChinese: () => this.chinese,
  43. getShowPinYin: () => this.showPinYin,
  44. getLangList: () => this.langList,
  45. convertText: this.convertText,
  46. getTitleList: () => this.title_list,
  47. getPermissionControl: () => this.permissionControl,
  48. };
  49. },
  50. props: {
  51. id: {
  52. type: String,
  53. default: '',
  54. },
  55. // 内容分组行列表
  56. contentGroupRowList: {
  57. type: Array,
  58. default: () => [],
  59. },
  60. // 组件列表
  61. componentList: {
  62. type: Array,
  63. default: () => [],
  64. },
  65. // 教材背景
  66. background: {
  67. type: Object,
  68. default: () => ({}),
  69. },
  70. },
  71. data() {
  72. return {
  73. data: { row_list: [] },
  74. curSelectId: this.id,
  75. isTrue,
  76. sidebarShow: true,
  77. project: {
  78. editor: '', // 作者
  79. cover_image_file_id: null, // 封面图片ID
  80. cover_image_file_url: '', // 封面图片URL
  81. },
  82. title_list: [],
  83. node_list: [],
  84. permissionControl: {
  85. can_answer: true, // 可作答
  86. can_judge_correct: false, // 可判断对错(客观题)
  87. can_show_answer: false, // 可查看答案
  88. can_correct: false, // 可批改
  89. can_check_correct: false, // 可查看批改
  90. },
  91. popoverShow: false,
  92. is_can_edit: 'false', // 是否可以编辑
  93. };
  94. },
  95. computed: {
  96. computedCommonPreviewStyle() {
  97. return buildCoursewareStyle(this.background, 'commonPreview');
  98. },
  99. },
  100. methods: {
  101. backTop() {
  102. this.$refs.previewMain.scrollTo({
  103. top: 0,
  104. left: 0,
  105. behavior: 'smooth',
  106. });
  107. },
  108. convertText(text) {
  109. return text;
  110. },
  111. },
  112. };
  113. </script>
  114. <style lang="scss" scoped>
  115. @use '@/styles/mixin.scss' as *;
  116. $total-width: $courseware-width + $courseware-left-margin + $courseware-right-margin;
  117. .common-preview {
  118. .main-container {
  119. position: relative;
  120. flex: 1;
  121. min-width: 1110px;
  122. padding: 15px 0;
  123. overflow: auto;
  124. background-color: #ececec;
  125. .catalogue-bar {
  126. position: absolute;
  127. top: 15px;
  128. left: 0;
  129. display: flex;
  130. align-items: center;
  131. justify-content: center;
  132. width: 54px;
  133. height: 54px;
  134. margin: -9px 6px 0 240px;
  135. cursor: pointer;
  136. background-color: #fff;
  137. border-radius: 2px;
  138. box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
  139. }
  140. .sidebar-bar {
  141. position: absolute;
  142. top: 0;
  143. right: 240px;
  144. display: flex;
  145. width: 60px;
  146. height: calc(100vh - 166px);
  147. .toolbar {
  148. display: flex;
  149. flex-direction: column;
  150. align-items: center;
  151. width: 60px;
  152. height: 100%;
  153. img {
  154. cursor: pointer;
  155. }
  156. &-special {
  157. display: flex;
  158. flex-direction: column;
  159. row-gap: 16px;
  160. align-items: center;
  161. width: 100%;
  162. margin-bottom: 24px;
  163. background-color: #fff;
  164. img {
  165. width: 36px;
  166. height: 36px;
  167. }
  168. }
  169. }
  170. }
  171. }
  172. .back-top {
  173. position: absolute;
  174. right: 240px;
  175. bottom: 0;
  176. display: flex;
  177. place-content: center center;
  178. align-items: center;
  179. width: 60px;
  180. height: 60px;
  181. cursor: pointer;
  182. background-color: #fff;
  183. }
  184. main.preview-main {
  185. display: flex;
  186. flex: 1;
  187. width: calc($total-width);
  188. min-width: calc($total-width);
  189. max-width: calc($total-width);
  190. min-height: 100%;
  191. margin: 0 auto;
  192. background-color: #fff;
  193. border-radius: 4px;
  194. box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 40%);
  195. .preview-left {
  196. width: $courseware-left-margin;
  197. min-width: $courseware-left-margin;
  198. max-width: $courseware-left-margin;
  199. background-color: $courseware-bgColor;
  200. }
  201. .preview-right {
  202. width: $courseware-right-margin;
  203. min-width: $courseware-right-margin;
  204. max-width: $courseware-right-margin;
  205. background-color: $courseware-bgColor;
  206. }
  207. &.no-audit {
  208. margin: 0 auto;
  209. }
  210. }
  211. .audit-content {
  212. display: flex;
  213. min-width: 1810px;
  214. height: calc(100vh - 166px);
  215. &_org {
  216. height: calc(100vh - 126px);
  217. }
  218. .left-menu {
  219. display: flex;
  220. flex-direction: column;
  221. width: $catalogue-width;
  222. font-family: 'Microsoft YaHei', 'Arial', sans-serif;
  223. background-color: #fff;
  224. .courseware-info {
  225. display: flex;
  226. column-gap: 18px;
  227. width: 100%;
  228. height: 186px;
  229. padding: 6px 6px 24px;
  230. border-bottom: $border;
  231. .cover-image {
  232. display: flex;
  233. align-items: center;
  234. justify-content: center;
  235. width: 111px;
  236. height: 157px;
  237. background-color: rgba(229, 229, 229, 100%);
  238. img {
  239. max-width: 111px;
  240. max-height: 157px;
  241. }
  242. }
  243. .info-content {
  244. display: flex;
  245. flex-direction: column;
  246. justify-content: space-between;
  247. .catalogue-icon {
  248. text-align: right;
  249. .svg-icon {
  250. cursor: pointer;
  251. }
  252. }
  253. .courseware {
  254. width: 159px;
  255. height: 64px;
  256. font-size: 16px;
  257. .name {
  258. font-weight: bold;
  259. }
  260. .editor {
  261. display: -webkit-box;
  262. overflow: hidden;
  263. text-overflow: ellipsis;
  264. word-break: break-word;
  265. white-space: normal;
  266. -webkit-line-clamp: 2; /* 多行省略行数,按需调整 */
  267. -webkit-box-orient: vertical;
  268. }
  269. }
  270. }
  271. }
  272. }
  273. .sidebar {
  274. position: relative;
  275. display: flex;
  276. width: $sidebar-width;
  277. .toolbar {
  278. display: flex;
  279. flex-direction: column;
  280. align-items: center;
  281. width: 60px;
  282. height: 100%;
  283. background-color: rgba(247, 248, 250, 100%);
  284. img {
  285. cursor: pointer;
  286. }
  287. &-special {
  288. display: flex;
  289. flex-direction: column;
  290. row-gap: 16px;
  291. margin-bottom: 24px;
  292. }
  293. &-list {
  294. display: flex;
  295. flex-direction: column;
  296. row-gap: 16px;
  297. align-items: center;
  298. width: 100%;
  299. .sidebar-item {
  300. width: 100%;
  301. text-align: center;
  302. .sidebar-icon {
  303. width: 36px;
  304. height: 36px;
  305. cursor: pointer;
  306. }
  307. &.active {
  308. background-color: #4095e5;
  309. }
  310. }
  311. }
  312. }
  313. .content {
  314. flex: 1;
  315. background-color: #fff;
  316. .resource_box {
  317. height: 100%;
  318. overflow-y: auto;
  319. border: 1px solid #e5e5e5;
  320. h5 {
  321. position: fixed;
  322. z-index: 999;
  323. width: 240px;
  324. padding: 0 5px;
  325. margin: 0;
  326. font-size: 18px;
  327. line-height: 40px;
  328. background: #f2f3f5;
  329. }
  330. .scroll-container {
  331. display: flex;
  332. flex-direction: column;
  333. row-gap: 8px;
  334. margin: 6px;
  335. .list-item {
  336. display: flex;
  337. align-items: center;
  338. cursor: pointer;
  339. border: 1px solid #ccc;
  340. border-radius: 8px;
  341. :deep .el-slider {
  342. .el-slider__runway {
  343. background-color: #eee;
  344. }
  345. }
  346. .el-image {
  347. display: flex;
  348. width: 100%;
  349. min-width: 100%;
  350. height: 90px;
  351. background-color: #ccc;
  352. border-radius: 8px;
  353. }
  354. .video-play {
  355. width: 100%;
  356. min-width: 100%;
  357. }
  358. .text-box {
  359. word-break: break-word;
  360. }
  361. }
  362. }
  363. p {
  364. color: #999;
  365. text-align: center;
  366. }
  367. .card-box li {
  368. padding: 10px;
  369. border-bottom: 1px solid #ccc;
  370. .el-icon-notebook-2 {
  371. display: block;
  372. margin-bottom: 4px;
  373. font-size: 12px;
  374. color: grey;
  375. }
  376. }
  377. }
  378. }
  379. .back-top {
  380. position: absolute;
  381. bottom: 0;
  382. left: 0;
  383. display: flex;
  384. place-content: center center;
  385. align-items: center;
  386. width: 60px;
  387. height: 60px;
  388. cursor: pointer;
  389. }
  390. }
  391. }
  392. }
  393. :deep .scroll-container .audio-wrapper {
  394. width: 100% !important;
  395. .audio-middle {
  396. width: 100% !important;
  397. padding: 6px 8px !important;
  398. border: none;
  399. border-radius: 8px;
  400. .audio-name {
  401. text-align: left;
  402. }
  403. .slider-area {
  404. column-gap: 8px !important;
  405. }
  406. :deep .remark-dialog {
  407. .el-dialog__body {
  408. padding: 5px 20px;
  409. }
  410. }
  411. :deep .audit-dialog {
  412. .el-dialog__body {
  413. height: calc(100vh - 260px);
  414. padding: 5px 20px;
  415. }
  416. .mind-map-container .mind-map {
  417. height: calc(100vh - 310px);
  418. }
  419. }
  420. }
  421. }
  422. .mt10 {
  423. margin: 10px 0 0 !important;
  424. background-color: #eee;
  425. }
  426. .courseware-tree {
  427. display: flex;
  428. flex: 1;
  429. flex-direction: column;
  430. row-gap: 8px;
  431. max-height: calc(100vh - 200px);
  432. overflow: auto;
  433. .menu-item {
  434. display: flex;
  435. align-items: center;
  436. &:not(.courseware) {
  437. font-weight: bold;
  438. }
  439. &.courseware {
  440. &:hover {
  441. .name {
  442. background-color: #f3f3f3;
  443. }
  444. }
  445. }
  446. .svg-icon {
  447. margin-left: 4px;
  448. &.my-edit-task {
  449. color: $right-color;
  450. }
  451. }
  452. .name {
  453. flex: 1;
  454. padding: 4px 8px 4px 4px;
  455. border-radius: 4px;
  456. }
  457. &.active {
  458. .name {
  459. font-weight: bold;
  460. color: #4095e5;
  461. }
  462. }
  463. }
  464. }
  465. </style>
  466. <style lang="scss">
  467. .tox-tinymce-aux {
  468. z-index: 9999 !important;
  469. }
  470. </style>