classRoom.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. <template>
  2. <div class="pb_content" style="height: auto;background:#fff;width:98%;margin:0 auto;">
  3. <div class="pb_head top">
  4. <span>课堂备课</span>
  5. <!-- <div class="student_button">
  6. <el-button
  7. type="primary"
  8. class="bgColor"
  9. @click="goTo('/addPPt?userid=' + userid + '&oid=' + oid)"
  10. >添加备课ppt</el-button>
  11. </div> -->
  12. </div>
  13. <div class="pb_content_body" style="height: 100%">
  14. <div class="student_head">
  15. <div class="student_right">
  16. <div class="head_left">
  17. <el-input v-model="courseName" class="student_input" placeholder="请输入课程名称"></el-input>
  18. <el-button class="course_button" @click="searchCourse">查询</el-button>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="student_table">
  23. <div class="course_box">
  24. <div class="out_box" v-for="(item, index) in course" :key="index">
  25. <div class="tup">
  26. <img
  27. :src="
  28. item.poster != null && item.poster != ''
  29. ? item.poster
  30. : mr
  31. "
  32. alt
  33. />
  34. </div>
  35. <div class="bottom_box">
  36. <div>{{ item.name }}</div>
  37. <div class="kc_time">{{ item.time }}</div>
  38. </div>
  39. <div class="three_bottom">
  40. <div
  41. @click="
  42. goTo(
  43. '/liveRoom?cid=' +
  44. item.id +
  45. '&userid=' +
  46. userid +
  47. '&oid=' +
  48. oid
  49. )
  50. "
  51. >开始教学</div>
  52. <!-- <div
  53. @click="
  54. goTo(
  55. '/liveRoomKQ?cid=' +
  56. item.id +
  57. '&userid=' +
  58. userid +
  59. '&oid=' +
  60. oid
  61. )
  62. "
  63. >上课预览</div> -->
  64. <!-- <div v-if="groupA == '0'">修改</div> -->
  65. <div @click="checkData">报告</div>
  66. <!-- <div @click="deleteCourse(item.courseId)">删除</div> -->
  67. </div>
  68. </div>
  69. <div class="course_empty" v-if="course.length == 0">暂无数据</div>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="student_page">
  74. <el-pagination
  75. background
  76. layout="prev, pager, next"
  77. :page-size="10"
  78. :total="total"
  79. v-if="page && course.length"
  80. style="padding-bottom: 20px"
  81. @current-change="handleCurrentChange"
  82. ></el-pagination>
  83. </div>
  84. <el-dialog
  85. title="课堂报告"
  86. :visible.sync="dataVisible"
  87. :append-to-body="true"
  88. width="1200px"
  89. :before-close="handleClose"
  90. class="dialog_diy"
  91. >
  92. <div>
  93. <div class="a_addBox2">
  94. <ActualTimeData></ActualTimeData>
  95. </div>
  96. </div>
  97. <span slot="footer" class="dialog-footer">
  98. <el-button @click="dataVisible = false">关 闭</el-button>
  99. </span>
  100. </el-dialog>
  101. </div>
  102. </template>
  103. <script>
  104. import "../../common/aws-sdk-2.235.1.min";
  105. import EditorBar from "../../components/tools/wangEnduit";
  106. import CourseProblem from "./components/courseProblem";
  107. import ActualTimeData from "./components/actualTimeData";
  108. export default {
  109. components: { EditorBar, CourseProblem,ActualTimeData },
  110. data() {
  111. return {
  112. dataVisible:false,
  113. isLoading: false,
  114. formLabelWidth: "100px",
  115. userid: this.$route.query.userid,
  116. oid: this.$route.query.oid,
  117. page: 1,
  118. total: 0,
  119. tableData: [],
  120. now: "",
  121. groupA: "0",
  122. course: [
  123. // {
  124. // cover: [],
  125. // courseId:"9a4e8dbe-132e-438e-97db-b07eb01fa04c",
  126. // title: "introduce a festival (Final)",
  127. // time: this.getNowTime(),
  128. // },
  129. ],
  130. courseName: "",
  131. mr: require("../../assets/icon/pptImg2.png"),
  132. };
  133. },
  134. methods: {
  135. change(val) {
  136. console.log(val);
  137. },
  138. goTo(path) {
  139. this.$router.push(path);
  140. },
  141. tableRowClassName({ row, rowIndex }) {
  142. if ((rowIndex + 1) % 2 === 0) {
  143. return "even_row";
  144. } else {
  145. return "";
  146. }
  147. },
  148. jump(cid) {
  149. window.parent.postMessage({ cid: cid, type: "1" }, "*");
  150. },
  151. handleCurrentChange(val) {
  152. // console.log(`当前页: ${val}`);
  153. this.page = val;
  154. this.getData();
  155. },
  156. init() {},
  157. handleClose(done) {
  158. done();
  159. },
  160. handleRemove(file, fileList) {
  161. console.log(file, fileList);
  162. },
  163. onExceed() {
  164. this.$message.error("课程海报仅支持上传一张,请删除后再进行上传");
  165. },
  166. //uuid生成
  167. guid() {
  168. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (
  169. c
  170. ) {
  171. var r = (Math.random() * 16) | 0,
  172. v = c == "x" ? r : (r & 0x3) | 0x8;
  173. return v.toString(16);
  174. });
  175. },
  176. getNowTime() {
  177. const yy = new Date().getFullYear()
  178. const MM = (new Date().getMonth() + 1) < 10 ? '0' + (new Date().getMonth() + 1) : (new Date().getMonth() + 1)
  179. const dd = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
  180. const HH = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours()
  181. const mm = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
  182. const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
  183. return yy + '-' + MM + '-' + dd + ' ' + HH + ':' + mm + ':' + ss
  184. },
  185. time() {
  186. if (!this.now) {
  187. this.now = new Date().getTime();
  188. return true;
  189. } else {
  190. let time = new Date().getTime();
  191. if (time - this.now > 3000) {
  192. this.now = time;
  193. return true;
  194. } else {
  195. return false;
  196. }
  197. }
  198. },
  199. searchCourse() {
  200. this.page = 1;
  201. this.getData();
  202. },
  203. // deleteCourse(cid) {
  204. // const loading = this.openLoading(
  205. // document.querySelector(".student_table")
  206. // );
  207. // this.isLoading = true;
  208. // let params = {
  209. // cid: cid,
  210. // };
  211. // this.ajax
  212. // .get(this.$store.state.api + "deleteCourse", params)
  213. // .then((res) => {
  214. // loading.close();
  215. // this.isLoading = false;
  216. // this.$message.success("删除成功");
  217. // })
  218. // .catch((err) => {
  219. // console.error(err);
  220. // });
  221. // },
  222. checkData() {
  223. this.dataVisible = true
  224. },
  225. search() {
  226. this.page = 1;
  227. },
  228. getData(){
  229. if (!this.loading) {
  230. this.loading = this.openLoading(
  231. document.querySelector(".student_table")
  232. );
  233. }
  234. let params = {
  235. cn: this.courseName,
  236. uid:this.userid,
  237. page: this.page,
  238. };
  239. this.ajax
  240. .get(this.$store.state.api + "getRealTimeClass", params)
  241. .then((res) => {
  242. this.loading.close();
  243. this.loading = "";
  244. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  245. this.course = res.data[0];
  246. })
  247. .catch((err) => {
  248. this.loading.close();
  249. this.loading = "";
  250. console.error(err);
  251. });
  252. }
  253. },
  254. created() {
  255. this.page = 1;
  256. this.getData();
  257. },
  258. };
  259. </script>
  260. <style scoped>
  261. .student_head >>> .el-button--primary {
  262. background-color: #2268bc;
  263. }
  264. .xls_button {
  265. font-size: 14px;
  266. cursor: pointer;
  267. text-decoration: underline;
  268. color: rgb(34, 104, 188);
  269. }
  270. .student_head {
  271. display: flex;
  272. justify-content: flex-end;
  273. align-items: baseline;
  274. flex-direction: row;
  275. flex-wrap: nowrap;
  276. margin-top: 25px;
  277. }
  278. .top {
  279. display: flex;
  280. justify-content: space-between;
  281. }
  282. .bgColor {
  283. background: #466b99;
  284. }
  285. .student_search {
  286. display: flex;
  287. align-items: center;
  288. width: calc(100% / 3);
  289. }
  290. .student_search span {
  291. margin: 0 10px 0 0;
  292. width: 65px;
  293. }
  294. .student_button {
  295. display: flex;
  296. overflow: hidden;
  297. height: 40px;
  298. }
  299. .upload-demo {
  300. display: flex;
  301. flex-direction: column;
  302. align-items: end;
  303. /* position: relative; */
  304. width: 100px;
  305. overflow: hidden;
  306. }
  307. .student_table {
  308. margin: 10px 0;
  309. height: 100%;
  310. overflow: auto;
  311. }
  312. .student_empty {
  313. display: flex;
  314. justify-content: center;
  315. align-items: center;
  316. }
  317. .el-table >>> .even_row {
  318. background-color: #f1f1f1;
  319. }
  320. .time {
  321. font-size: 13px;
  322. color: #999;
  323. }
  324. .course_button {
  325. padding: 10px 20px;
  326. }
  327. .course_button_box {
  328. display: flex;
  329. margin-top: 5px;
  330. justify-content: space-between;
  331. }
  332. .course_rate {
  333. margin-top: 5px;
  334. }
  335. .course_view {
  336. display: flex;
  337. align-items: center;
  338. margin: 5px 0 0 0;
  339. }
  340. .course_view i {
  341. background-image: url("../../assets/liulan.png");
  342. width: 25px;
  343. height: 25px;
  344. background-size: 100% 100%;
  345. /* margin-top: 1px; */
  346. line-height: 25px;
  347. vertical-align: text-top;
  348. background-repeat: no-repeat;
  349. }
  350. .image {
  351. width: 100%;
  352. height: 150px;
  353. display: block;
  354. }
  355. .course_box {
  356. display: flex;
  357. flex-wrap: wrap;
  358. }
  359. .student_page {
  360. width: 95%;
  361. margin: 0 auto;
  362. }
  363. .course_create_box {
  364. font-size: 18px;
  365. }
  366. .course_name {
  367. margin-top: 10px;
  368. }
  369. .course_name span {
  370. margin-bottom: 10px;
  371. display: block;
  372. }
  373. .homework_box {
  374. display: flex;
  375. align-items: center;
  376. flex-wrap: wrap;
  377. }
  378. .course_homework {
  379. width: 130px;
  380. display: flex;
  381. justify-content: center;
  382. flex-direction: column;
  383. align-items: center;
  384. margin: 0 10px 10px 0;
  385. }
  386. .course_type {
  387. margin-top: 10px;
  388. display: flex;
  389. }
  390. .course_type1 span {
  391. margin-bottom: 10px;
  392. display: block;
  393. }
  394. .course_type2 {
  395. margin-left: 20px;
  396. }
  397. .course_type2 span {
  398. margin-bottom: 10px;
  399. display: block;
  400. }
  401. .course_empty {
  402. color: rgb(110, 110, 110);
  403. width: 100%;
  404. height: 100%;
  405. display: flex;
  406. align-items: center;
  407. justify-content: center;
  408. }
  409. .el_cards >>> .el-card__body {
  410. height: 100%;
  411. }
  412. .courseBtnBox {
  413. display: flex;
  414. flex-direction: column;
  415. justify-content: space-between;
  416. height: calc(100% - 170px);
  417. padding: 10px;
  418. }
  419. .wordUpload {
  420. display: flex;
  421. }
  422. .wordUpload > .buttonUp {
  423. margin-right: 5px;
  424. }
  425. .out_box {
  426. display: flex;
  427. flex-direction: column;
  428. flex-wrap: nowrap;
  429. width: 250px;
  430. background: #fff;
  431. margin-right: 25px;
  432. border: 1px solid #ccc;
  433. height: fit-content;
  434. box-sizing: border-box;
  435. border-radius: 0px 0px 5px 5px;
  436. overflow: hidden;
  437. margin-bottom: 15px;
  438. }
  439. .bottom_box {
  440. display: flex;
  441. padding: 10px 0 10px 10px;
  442. flex-direction: column;
  443. box-sizing: border-box;
  444. }
  445. .bottom_box > div:nth-child(1) {
  446. width: 230px;
  447. overflow: hidden;
  448. text-overflow: ellipsis;
  449. white-space: nowrap;
  450. }
  451. .tup {
  452. width: 100%;
  453. height: 141.06px;
  454. margin: 0 auto;
  455. }
  456. .tup > img {
  457. width: 100%;
  458. height: 100%;
  459. }
  460. .kc_time {
  461. margin-top: 8px;
  462. font-size: 14px;
  463. color: #999;
  464. }
  465. .kc_t {
  466. margin-top: 5px;
  467. width: 100%;
  468. white-space: nowrap;
  469. overflow: hidden;
  470. text-overflow: ellipsis;
  471. }
  472. .three_bottom {
  473. display: flex;
  474. flex-direction: row;
  475. justify-content: space-around;
  476. height: 40px;
  477. align-items: center;
  478. background: #f5f4f4;
  479. font-size: 14px;
  480. }
  481. .three_bottom > div {
  482. cursor: pointer;
  483. }
  484. .three_bottom > div:hover {
  485. color: #79a2ff;
  486. }
  487. .head_left {
  488. display: flex;
  489. }
  490. .student_input >>> .el-input__inner {
  491. height: 40px;
  492. width: 190px;
  493. font-size: 13px;
  494. padding: 0 10px;
  495. }
  496. .course_button {
  497. color: #fff;
  498. background: #2268bc;
  499. width: 75px;
  500. height: 40px;
  501. padding: 0 !important;
  502. font-size: 12px;
  503. line-height: 40px;
  504. }
  505. .all_choose {
  506. margin: 15px 0 10px;
  507. height: 20%;
  508. display: flex;
  509. flex-direction: row;
  510. align-items: center;
  511. width: calc(100% / 3);
  512. }
  513. .all_choose > span {
  514. width: 50px;
  515. display: block;
  516. }
  517. .choose {
  518. display: flex;
  519. flex-direction: row;
  520. flex-wrap: wrap;
  521. align-content: space-between;
  522. height: 100%;
  523. justify-content: flex-start;
  524. width: 60%;
  525. min-width: 868px;
  526. align-items: center;
  527. }
  528. .choose > div:nth-child(2) {
  529. margin-left: 1%;
  530. width: 32.33333%;
  531. }
  532. .choose > div:nth-child(4) {
  533. margin-right: 1%;
  534. width: 32.33333%;
  535. }
  536. .choose > div:nth-child(5) {
  537. margin-left: 1%;
  538. }
  539. .choose > div:nth-child(4) > span {
  540. width: 74px !important;
  541. min-width: 74px;
  542. }
  543. .choose > div:nth-child(4) >>> .el-select {
  544. width: 217.5px;
  545. min-width: 215.06px;
  546. }
  547. .clear {
  548. width: 70px;
  549. height: 35px;
  550. background: #2268bc;
  551. color: #fff;
  552. text-align: center;
  553. border-radius: 5px;
  554. line-height: 35px;
  555. cursor: pointer;
  556. margin-left: 20px;
  557. }
  558. .dialog_diy >>> .el-dialog__header {
  559. padding: 9px 20px 10px;
  560. background: #32455b !important;
  561. }
  562. .dialog_diy >>> .el-dialog__title {
  563. color: #fff;
  564. font-size: 15px;
  565. }
  566. .dialog_diy >>> .el-dialog__headerbtn {
  567. top: 14px;
  568. }
  569. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
  570. color: #fff;
  571. }
  572. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
  573. color: #fff;
  574. }
  575. .dialog_diy >>> .el-dialog__body,
  576. .dialog_diy >>> .el-dialog__footer {
  577. background: #f3f3f3;
  578. }
  579. </style>