studentIndex.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. <template>
  2. <div class="ch_box" ref="ch_box">
  3. <div class="ch_content_box" v-show="type == 1">
  4. <workFlowIframe
  5. v-show="itemType == 7 && iframeSrc2.length"
  6. :iframeSrc="iframeSrc2"
  7. ></workFlowIframe>
  8. </div>
  9. <div class="ch_nav_box">
  10. <div class="ch_nav_box_top">
  11. <div @click="$emit('backPage')" class="ch_nav_box_top_item">
  12. <el-tooltip class="item" effect="dark" :content="lang.ssReturn" placement="top">
  13. <img :src="require('../../assets/icon/course/return.png')" alt="" />
  14. </el-tooltip>
  15. </div>
  16. <div @click="$emit('refresh')" class="ch_nav_box_top_item">
  17. <el-tooltip class="item" effect="dark" :content="lang.ssRefresh" placement="top">
  18. <img
  19. :src="require('../../assets/icon/course/refresh.png')"
  20. alt=""
  21. />
  22. </el-tooltip>
  23. </div>
  24. </div>
  25. <div class="ch_nav_box_middle">
  26. <div
  27. v-if="iframeSrc2.length"
  28. :class="[
  29. 'ch_nav_box_middle_item',
  30. itemType == 7 ? 'ch_nav_box_middle_item_active' : ''
  31. ]"
  32. @click.stop="changeItemType(7)"
  33. >
  34. <img
  35. v-if="itemType == 7"
  36. :src="
  37. require('../../assets/icon/course/teachingAssistant_active.svg')
  38. "
  39. />
  40. <img
  41. v-if="itemType != 7"
  42. :src="
  43. require('../../assets/icon/course/teachingAssistant_default.svg')
  44. "
  45. />
  46. <div>{{ lang.ssAssistant }}</div>
  47. </div>
  48. </div>
  49. <div class="ch_nav_box_bottom">
  50. <div
  51. @click.stop="goStep(0)"
  52. :class="{
  53. disableBtn: IsFollow || IsLookOpen || splitScreenData.isOpen
  54. }"
  55. >
  56. <el-tooltip
  57. class="item"
  58. effect="dark"
  59. :content="lang.ssPrevious"
  60. placement="top"
  61. >
  62. <img :src="require('../../assets/icon/course/last.png')" />
  63. </el-tooltip>
  64. </div>
  65. <div
  66. @click.stop="goStep(1)"
  67. :class="{
  68. disableBtn: IsFollow || IsLookOpen || splitScreenData.isOpen
  69. }"
  70. >
  71. <el-tooltip
  72. class="item"
  73. effect="dark"
  74. :content="lang.ssNext"
  75. placement="top"
  76. >
  77. <img :src="require('../../assets/icon/course/next.png')" />
  78. </el-tooltip>
  79. </div>
  80. <div @click="openSetting">
  81. <el-tooltip
  82. class="item"
  83. effect="dark"
  84. :content="type == 0 ? lang.ssExpand : lang.ssFold"
  85. placement="top"
  86. >
  87. <img :src="require('../../assets/icon/course/menu.png')" />
  88. </el-tooltip>
  89. </div>
  90. </div>
  91. </div>
  92. <!-- <div
  93. v-if="fold"
  94. class="itemFold"
  95. ref="itemFoldRef"
  96. v-click-outside="handleBlur"
  97. >
  98. <div @click="$emit('backPage')">
  99. <img :src="require('../../assets/icon/course/return.png')" alt="" />
  100. <span>返回</span>
  101. </div>
  102. <div @click="$emit('refresh')">
  103. <img :src="require('../../assets/icon/course/refresh.png')" alt="" />
  104. <span>刷新</span>
  105. </div>
  106. </div> -->
  107. </div>
  108. </template>
  109. <script>
  110. import workFlowIframe from "./component/workFlowIframe.vue";
  111. import { myMixin } from "@/mixins/mixin.js";
  112. export default {
  113. mixins: [myMixin],
  114. emits: [
  115. "refresh",
  116. "goStep",
  117. "backPage",
  118. "authority",
  119. "review",
  120. "stopRecording",
  121. "startRecording"
  122. ],
  123. components: {
  124. workFlowIframe
  125. },
  126. props: {
  127. courseDetail: {
  128. type: Object,
  129. default: () => {}
  130. },
  131. tType: {
  132. type: String,
  133. default: 0
  134. },
  135. navList: {
  136. type: Array,
  137. default: () => []
  138. },
  139. tcid: {
  140. type: String,
  141. default: ""
  142. },
  143. courseType: {
  144. type: Number,
  145. default: 0
  146. },
  147. taskCount: {
  148. type: Number,
  149. default: 0
  150. },
  151. worksStudent: {
  152. type: Array,
  153. default: () => []
  154. },
  155. fileList: {
  156. type: Array,
  157. default: () => []
  158. },
  159. videoStart: {
  160. type: Boolean,
  161. default: false
  162. },
  163. IsFollow: {
  164. type: Boolean,
  165. default: false
  166. },
  167. sIsOpen: {
  168. type: Boolean,
  169. default: false
  170. },
  171. IsLookOpen: {
  172. type: Boolean,
  173. default: false
  174. },
  175. splitScreenData: {
  176. type: Object,
  177. default: () => {
  178. return {
  179. isOpen: false,
  180. userId: "",
  181. uid: "",
  182. myUid: ""
  183. };
  184. }
  185. }
  186. },
  187. data() {
  188. return {
  189. isBtn: false,
  190. userid: this.$route.query.userid,
  191. oid: this.$route.query.oid,
  192. courseId: this.$route.query.courseId,
  193. tcid2: this.$route.query.tcid,
  194. type: 0,
  195. itemType: 0, //0--无 1-搜索 2-任务 3-对话
  196. fileId: [],
  197. showTipsLoading: false,
  198. tipsList: [],
  199. firstEnterTime: null,
  200. canGetTips: true,
  201. getTipsTimer: null,
  202. getWangLoading: false,
  203. canUseWangData: false,
  204. wangData: "",
  205. languageSetting: 0,
  206. uploadFileStatus: {
  207. file: null,
  208. status: "",
  209. percent: 0,
  210. key: "",
  211. uploadid: "",
  212. loading: false
  213. },
  214. iframeSrc2: [],
  215. canUseCourseId: [
  216. "bfbe1913-2f87-11ef-bf55-005056b86db5",
  217. "3a64b199-d2eb-11ef-a2d1-005056b86db5",
  218. "bb0b1995-0207-11ef-b534-005056b86db5",
  219. "f77921c8-d2f1-11ef-a2d1-005056b86db5"
  220. ]
  221. };
  222. },
  223. computed: {
  224. showPopover: {
  225. get() {
  226. // return this.Annot
  227. return (
  228. this.splitScreenData.isOpen &&
  229. this.splitScreenData.uid === this.splitScreenData.myUid
  230. );
  231. },
  232. set(newValue) {
  233. console.log(newValue);
  234. // this.AnnotationCanvasShow = newValue
  235. }
  236. }
  237. },
  238. watch: {
  239. courseType(newValue, oldValue) {
  240. this.getAiApp();
  241. },
  242. taskCount(newValue) {
  243. this.getAiApp();
  244. }
  245. },
  246. mounted() {
  247. let setting = this.courseDetail.setting;
  248. if (setting) {
  249. setting = JSON.parse(setting);
  250. if (setting.languageSetting) {
  251. this.languageSetting = setting.languageSetting;
  252. }
  253. }
  254. this.setWidth();
  255. this.firstEnterTime = new Date().getTime();
  256. this.getAiApp();
  257. },
  258. methods: {
  259. setWidth() {
  260. let w = this.$refs.ch_box;
  261. let w2 = w.offsetWidth + 20 + "px";
  262. this.$emit("setWidth", w2);
  263. },
  264. openSetting() {
  265. this.type = this.type == 1 ? 0 : 1;
  266. this.$nextTick(() => {
  267. if (this.type == 1) {
  268. this.$parent.mlDialog = false;
  269. }
  270. this.setWidth();
  271. });
  272. },
  273. changeItemType(type) {
  274. this.type = 0;
  275. if (this.itemType == type) {
  276. this.itemType = 0;
  277. this.type = 1;
  278. this.openSetting();
  279. return;
  280. }
  281. this.openSetting();
  282. // this.$message.info("切换到"+type)
  283. this.$nextTick(() => {
  284. // if (this.itemType == 1 && type != 1) {
  285. // this.$refs.searchAreaRef.scrollBottom();
  286. // this.$refs.searchAreaRef.getWantSearch();
  287. // } else if (this.itemType == 2) {
  288. // this.$refs.taskAreaRef.scrollBottom();
  289. // } else if (this.itemType == 3) {
  290. // this.$refs.dialogAreaRef.scrollBottom();
  291. // }
  292. this.itemType = type;
  293. });
  294. },
  295. getLang() {
  296. let lang = "";
  297. if (this.languageSetting == 0) {
  298. lang = "Chinese.";
  299. } else if (this.languageSetting == 1) {
  300. lang = "Traditional Chinese.";
  301. } else if (this.languageSetting == 2) {
  302. lang = "English.";
  303. }
  304. return lang;
  305. },
  306. getAiApp() {
  307. try {
  308. let _chapters = JSON.parse(this.courseDetail.chapters);
  309. let _list =
  310. _chapters[this.courseType].chapterInfo[0].taskJson[this.taskCount]
  311. .chapterData;
  312. let _app = _list.find(i => i.type == 15);
  313. if (_app) {
  314. _app.src = _app.url;
  315. this.iframeSrc2 = [_app];
  316. } else {
  317. this.iframeSrc2 = [];
  318. }
  319. } catch (error) {
  320. console.log("👉==", error);
  321. this.iframeSrc2 = [];
  322. }
  323. },
  324. goStep(type) {
  325. if (this.IsFollow || this.IsLookOpen || this.splitScreenData.isOpen)
  326. return;
  327. this.$emit("goStep", type);
  328. }
  329. }
  330. };
  331. </script>
  332. <style scoped>
  333. .ch_box {
  334. width: auto;
  335. background: rgb(255, 255, 255);
  336. position: fixed;
  337. height: calc(100% - 40px);
  338. border-radius: 10px;
  339. box-sizing: border-box;
  340. right: 20px;
  341. display: flex;
  342. top: 20px;
  343. z-index: 1000;
  344. }
  345. .ch_nav_box {
  346. height: 100%;
  347. width: 65px;
  348. display: flex;
  349. flex-direction: column;
  350. align-items: center;
  351. overflow-y: auto !important; /* 上下溢出显示滚动条 */
  352. overflow-x: hidden !important; /* 左右溢出正常溢出 */
  353. position: relative;
  354. box-sizing: border-box;
  355. }
  356. .ch_content_box {
  357. width: 495px;
  358. height: 100%;
  359. border-right: 2px solid #e7e7e7;
  360. }
  361. .ch_nav_box_bottom {
  362. width: 100%;
  363. box-sizing: border-box;
  364. border-top: solid 1px #eaeaea;
  365. display: flex;
  366. flex-direction: column;
  367. }
  368. .disableBtn {
  369. opacity: 0.5;
  370. cursor: not-allowed !important;
  371. }
  372. .ch_nav_box_middle {
  373. width: 100%;
  374. box-sizing: border-box;
  375. border-top: solid 1px #eaeaea;
  376. flex-direction: column;
  377. justify-content: space-between;
  378. }
  379. .ch_nav_box_middle_item {
  380. width: 100%;
  381. height: 80px;
  382. display: flex;
  383. flex-direction: column;
  384. justify-content: center;
  385. align-items: center;
  386. cursor: pointer;
  387. transition: 0.3s;
  388. font-size: 14px;
  389. }
  390. .ch_nav_box_middle_item_active {
  391. background-color: #3681fc;
  392. color: white;
  393. }
  394. .ch_nav_box_middle_item > img {
  395. width: 24px;
  396. height: 24px;
  397. margin-bottom: 5px;
  398. }
  399. .ch_nav_box_bottom > div {
  400. width: 100%;
  401. height: 65px;
  402. display: flex;
  403. flex-direction: column;
  404. justify-content: center;
  405. align-items: center;
  406. cursor: pointer;
  407. }
  408. .ch_nav_box_bottom > div > img {
  409. width: 24px;
  410. height: 24px;
  411. }
  412. .ch_nav_box_top {
  413. width: 100%;
  414. height: auto;
  415. margin-bottom: auto;
  416. }
  417. .ch_nav_box_top > div {
  418. width: 100%;
  419. height: 65px;
  420. display: flex;
  421. flex-direction: column;
  422. justify-content: center;
  423. align-items: center;
  424. cursor: pointer;
  425. position: relative;
  426. }
  427. .boxItem {
  428. width: 100%;
  429. height: 65px;
  430. display: flex;
  431. justify-content: center;
  432. align-items: center;
  433. cursor: pointer;
  434. position: relative;
  435. }
  436. .boxItem > img {
  437. width: 24px;
  438. height: 24px;
  439. transition: 0.3s;
  440. }
  441. .ch_nav_box_top > div > img {
  442. width: 24px;
  443. height: 24px;
  444. transition: 0.3s;
  445. }
  446. .itemFold {
  447. position: absolute;
  448. width: 130px;
  449. right: 65px;
  450. top: 0;
  451. background: rgb(255, 255, 255);
  452. box-sizing: border-box;
  453. border: solid 1px #eaeaea;
  454. /* border-top: solid 1px #eaeaea; */
  455. z-index: 1000; /* 确保二级菜单在主菜单上层 */
  456. border-radius: 10px;
  457. box-sizing: border-box;
  458. padding: 10px;
  459. display: flex;
  460. flex-direction: column;
  461. justify-content: center;
  462. align-items: center;
  463. }
  464. .itemFold > div {
  465. width: 100%;
  466. height: 45px;
  467. display: flex;
  468. justify-content: center;
  469. align-items: center;
  470. cursor: pointer;
  471. margin: 5px 0;
  472. border-radius: 10px;
  473. }
  474. .itemFold > div:hover {
  475. background: #f3f7fd;
  476. }
  477. .itemFold > div > img {
  478. width: 24px;
  479. height: 24px;
  480. }
  481. .itemFold > div > span {
  482. margin-left: 10px;
  483. }
  484. @media screen and (max-height: 820px) {
  485. .ch_nav_box_bottom > div {
  486. height: auto;
  487. padding: 8px 0;
  488. }
  489. .ch_nav_box_middle_item {
  490. height: auto;
  491. padding: 8px 0;
  492. }
  493. .ch_nav_box_top > div {
  494. height: auto;
  495. padding: 8px 0;
  496. }
  497. }
  498. .foldActive {
  499. background-color: #f0f2f5;
  500. padding: 10px;
  501. border-radius: 10px;
  502. }
  503. .ch_nav_box_topFixed {
  504. width: 100%;
  505. height: 65px;
  506. position: absolute;
  507. top: 0;
  508. left: 0;
  509. }
  510. .ch_nav_box_topFixed_item {
  511. display: flex;
  512. flex-direction: column;
  513. justify-content: center;
  514. align-items: center;
  515. width: 100%;
  516. height: 65px;
  517. padding-top: 5px;
  518. cursor: pointer;
  519. border-radius: 10px 10px 0 0;
  520. }
  521. .ch_nav_box_topFixed_item > svg {
  522. width: 25px;
  523. height: 25px;
  524. fill: #000;
  525. }
  526. .ch_nav_box_topFixed_item > span {
  527. margin-top: 5px;
  528. font-size: 14px;
  529. }
  530. .ch_nav_box_topFixed_item_active {
  531. background-color: #3681fc;
  532. color: #fff;
  533. }
  534. .ch_nav_box_topFixed_item_active > svg {
  535. fill: #fff;
  536. }
  537. .ch_nav_box_topFixed_popover {
  538. width: 100%;
  539. height: 65px;
  540. display: flex;
  541. }
  542. .ch_nav_box_topFixed_popover_item {
  543. width: 100px;
  544. height: 65px;
  545. display: flex;
  546. flex-direction: column;
  547. justify-content: center;
  548. align-items: center;
  549. cursor: pointer;
  550. }
  551. .ch_nav_box_topFixed_popover_item > svg {
  552. width: 30px;
  553. height: 30px;
  554. fill: #000;
  555. }
  556. .ch_nav_box_topFixed_popover_item > span {
  557. margin-top: 5px;
  558. }
  559. .drawerBox {
  560. width: 100%;
  561. height: 100%;
  562. display: flex;
  563. justify-content: center;
  564. align-items: center;
  565. font-weight: bold;
  566. }
  567. .drawerBox > span {
  568. /* 字体竖着排列; */
  569. writing-mode: vertical-rl;
  570. margin-right: 10px;
  571. }
  572. </style>