studentIndex.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269
  1. <template>
  2. <div class="pb_content">
  3. <div class="pb_content_body">
  4. <div class="student_head">
  5. <!-- <img src="../assets/banner.png" alt="" /> -->
  6. <el-carousel trigger="click" style="width: 100%; height: 100%">
  7. <el-carousel-item v-for="item in bannerList" :key="item.id">
  8. <!-- <h3 class="small">{{ item }}</h3> -->
  9. <img class="imgS" :src="item.poster" alt="" />
  10. </el-carousel-item>
  11. </el-carousel>
  12. </div>
  13. <div class="reBox">
  14. <div class="reTop">
  15. <div>项目</div>
  16. <div>
  17. <div class="search" @click="search">
  18. <img src="../assets/icon/search.png" alt="" />
  19. </div>
  20. <input class="sInput" type="text" placeholder="请输入关键字" v-model="sCourse" @keyup.enter="search" />
  21. </div>
  22. </div>
  23. <div class="choose">
  24. <div class="all_choose" v-for="(item, index) in CourseType[0]" :key="index"
  25. :style="{ margin: !CourseTypeJson[item.id].length && 0 }">
  26. <div v-if="CourseTypeJson[item.id].length"><span>{{ item.name }}</span>:</div>
  27. <div class="typeCss" v-if="CourseTypeJson[item.id].length">
  28. <div class="cName" @click="getCourse(item.name, '', item.id, 1)"
  29. :class="typeE.indexOf(item.id) != -1 ? 'isCType' : ''" style="min-width: fit-content;width: auto;">
  30. 全部
  31. </div>
  32. <div v-for="(item1, index1) in CourseTypeJson[item.id]" :key="index + '-' + index1" :label="item1.id"
  33. @click="getCourse(item.name, item.id, item1.id, 2)">
  34. <div class="cName" :class="
  35. typea == item1.id || typeb == item1.id || typed == item1.id || typef == item1.id
  36. ? 'isCType'
  37. : ''
  38. ">
  39. {{ item1.name }}
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="body_student">
  47. <div class="typeCheck">
  48. <el-switch v-model="typeCheck"></el-switch><span>分类显示</span>
  49. </div>
  50. <div>
  51. <div class="main_box" v-loading="loading">
  52. <div style="display:flex;flex-wrap:wrap" v-if="!typeCheck">
  53. <div class="box_course" v-for="(item, index) in zoneClass" :key="index" @click="
  54. goTo(
  55. '/courseDetailS?courseId=' +
  56. item.courseId +
  57. '&userid=' +
  58. userid +
  59. '&oid=' +
  60. oid +
  61. '&org=' +
  62. org +
  63. '&cid=' +
  64. classId +
  65. '&tType=' +
  66. tType +
  67. '&role=' +
  68. role +
  69. '&screenType=' +
  70. screenType
  71. )
  72. ">
  73. <div class="wheel">
  74. <img :src="
  75. item.cover
  76. ? JSON.parse(item.cover)[0].url
  77. : require('../assets/wheel.png')
  78. " alt="" />
  79. </div>
  80. <div class="middle_white">
  81. <div class="textOverflow">{{ item.title }}</div>
  82. <div class="nameAndLength">
  83. <el-tooltip class="typeN" effect="light" :content="item.typename" placement="top">
  84. <div>{{ item.typename }}</div>
  85. </el-tooltip>
  86. <div>{{ JSON.parse(item.chapters).length }}阶段</div>
  87. </div>
  88. <div class="school_box">
  89. <el-tooltip effect="light" :content="item.school" placement="top">
  90. <div class="school">
  91. {{ item.school }}
  92. </div>
  93. </el-tooltip>
  94. <div style="color: #b4b4b4">{{ item.utime }}</div>
  95. </div>
  96. </div>
  97. <div class="now_study" @click="
  98. goTo(
  99. '/courseDetailS?courseId=' +
  100. item.courseId +
  101. '&userid=' +
  102. userid +
  103. '&oid=' +
  104. oid +
  105. '&org=' +
  106. org +
  107. '&cid=' +
  108. classId +
  109. '&tType=' +
  110. tType +
  111. '&role=' +
  112. role +
  113. '&screenType=' +
  114. screenType
  115. )
  116. ">
  117. 立即学习
  118. <!-- <div @click="goToCongress(item)">
  119. 进展
  120. </div> -->
  121. </div>
  122. </div>
  123. </div>
  124. <div v-else>
  125. <div class="FirstTypeBox" v-for="(type, tindex) in CourseType2" :key="tindex">
  126. <div class="title">{{ type.name }}</div>
  127. <div style="display: flex;flex-flow: wrap;margin-top: 20px;">
  128. <div class="box_course" v-for="(item, index) in type.course" :key="tindex + '-' + index" @click="
  129. goTo(
  130. '/courseDetailS?courseId=' +
  131. item.courseId +
  132. '&userid=' +
  133. userid +
  134. '&oid=' +
  135. oid +
  136. '&org=' +
  137. org +
  138. '&cid=' +
  139. classId +
  140. '&tType=' +
  141. tType +
  142. '&role=' +
  143. role +
  144. '&screenType=' +
  145. screenType
  146. )
  147. ">
  148. <div class="wheel">
  149. <img :src="
  150. item.cover
  151. ? JSON.parse(item.cover)[0].url
  152. : require('../assets/wheel.png')
  153. " alt="" />
  154. </div>
  155. <div class="middle_white">
  156. <div class="textOverflow">{{ item.title }}</div>
  157. <div class="nameAndLength">
  158. <el-tooltip class="typeN" effect="light" :content="item.typename" placement="top">
  159. <div>{{ item.typename }}</div>
  160. </el-tooltip>
  161. <div>{{ JSON.parse(item.chapters).length }}阶段</div>
  162. </div>
  163. <div class="school_box">
  164. <el-tooltip effect="light" :content="item.school" placement="top">
  165. <div class="school">
  166. {{ item.school }}
  167. </div>
  168. </el-tooltip>
  169. <div style="color: #b4b4b4">{{ item.utime }}</div>
  170. </div>
  171. </div>
  172. <div class="now_study" @click="
  173. goTo(
  174. '/courseDetailS?courseId=' +
  175. item.courseId +
  176. '&userid=' +
  177. userid +
  178. '&oid=' +
  179. oid +
  180. '&org=' +
  181. org +
  182. '&cid=' +
  183. classId +
  184. '&tType=' +
  185. tType +
  186. '&role=' +
  187. role +
  188. '&screenType=' +
  189. screenType
  190. )
  191. ">
  192. 立即学习
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="course_empty" v-if="zoneClass.length == 0">
  199. 暂无项目
  200. </div>
  201. </div>
  202. </div>
  203. <div class="student_page" style="margin: 15px 0 0" v-if="zoneClass.length > 0 && !typeCheck">
  204. <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total" v-if="page"
  205. @current-change="handleCurrentChange">
  206. </el-pagination>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. </template>
  212. <script>
  213. export default {
  214. data() {
  215. return {
  216. zoneList: [],
  217. zoneClass: [],
  218. page: 1,
  219. total: 0,
  220. pageSize: 20,
  221. isListAjax: false,
  222. zoneListId: "",
  223. bannerList: [],
  224. userid: this.$route.query.userid,
  225. oid: this.$route.query.oid,
  226. classId: this.$route.query.cid,
  227. tType: this.$route.query.tType,
  228. org: this.$route.query.org,
  229. role: this.$route.query.role,
  230. screenType: this.$route.query.screenType,
  231. CourseType: [],
  232. CourseType2: [],
  233. CourseTypeJson: {},
  234. courseTypeId: {},
  235. sCourse: "",
  236. isCType: "",
  237. typea: "",
  238. typeb: "",
  239. typec: "",
  240. typed: "",
  241. typef: "",
  242. typeE: [],
  243. loading: "",
  244. typeCheck: false,
  245. };
  246. },
  247. watch: {
  248. typeCheck(newValue, oldValue) {
  249. this.loading = true
  250. if (newValue) {
  251. this.selectAll()
  252. } else {
  253. this.page = 1
  254. this.selectAll2()
  255. }
  256. }
  257. },
  258. methods: {
  259. search() {
  260. if (this.typeCheck) {
  261. this.selectAll()
  262. } else {
  263. this.page = 1
  264. this.selectAll2()
  265. }
  266. },
  267. goTo(path) {
  268. this.$router.push(path);
  269. },
  270. goToCongress(item){
  271. window.location.href='https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/courseProgress?cid=' +
  272. item.courseId +
  273. '&userid=' +
  274. this.userid +
  275. '&oid=' +
  276. this.oid +
  277. '&org=' +
  278. this.org
  279. },
  280. // getZone() {
  281. // this.ajax
  282. // .get(this.$store.state.api + "getZone", "")
  283. // .then((res) => {
  284. // this.zoneList = res.data[0];
  285. // // this.zoneListId = this.zoneList[0].id;
  286. // // this.getZoneClass(this.zoneList[0].id);
  287. // this.selectAll();
  288. // })
  289. // .catch((err) => {
  290. // console.error(err);
  291. // });
  292. // },
  293. //获取专区下的课程
  294. getZoneClass(zid) {
  295. this.isListAjax = true;
  296. // const loading = this.openLoading(document.querySelector(".main_box"));
  297. let params = {
  298. bid: zid,
  299. oid: this.oid,
  300. page: this.page,
  301. };
  302. this.ajax
  303. .get(this.$store.state.api + "getZoneClassStudent", params)
  304. .then((res) => {
  305. // loading.close();
  306. this.isListAjax = false;
  307. this.zoneClass = res.data[0];
  308. this.total = res.data[0].length ? res.data[0][0].num : 0;
  309. })
  310. .catch((err) => {
  311. console.error(err);
  312. });
  313. },
  314. getCourse(typeName, ftypeId, typeid, type) {
  315. this.page = 1;
  316. this.zoneClass = [];
  317. if (typeName == "年级") {
  318. if (type == 1) {
  319. if (this.typeE.indexOf(typeid) != -1) {
  320. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  321. } else {
  322. this.typeE.push(typeid);
  323. if (this.typea != "") {
  324. this.typea = "";
  325. }
  326. }
  327. } else {
  328. if (this.typea == typeid) {
  329. this.typea = "";
  330. } else {
  331. this.typea = typeid;
  332. if (this.typeE.indexOf(ftypeId) != -1) {
  333. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  334. }
  335. }
  336. }
  337. } else if (typeName == "专栏") {
  338. if (type == 1) {
  339. if (this.typeE.indexOf(typeid) != -1) {
  340. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  341. } else {
  342. this.typeE.push(typeid);
  343. if (this.typeb != "") {
  344. this.typeb = "";
  345. }
  346. }
  347. } else {
  348. if (this.typeb == typeid) {
  349. this.typeb = "";
  350. } else {
  351. this.typeb = typeid;
  352. if (this.typeE.indexOf(ftypeId) != -1) {
  353. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  354. }
  355. }
  356. }
  357. } else if (typeName == "栏目") {
  358. if (type == 1) {
  359. if (this.typeE.indexOf(typeid) != -1) {
  360. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  361. } else {
  362. this.typeE.push(typeid);
  363. if (this.typeb != "") {
  364. this.typeb = "";
  365. }
  366. }
  367. } else {
  368. if (this.typeb == typeid) {
  369. this.typeb = "";
  370. } else {
  371. this.typeb = typeid;
  372. if (this.typeE.indexOf(ftypeId) != -1) {
  373. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  374. }
  375. }
  376. }
  377. } else if (typeName == "主题") {
  378. if (type == 1) {
  379. if (this.typeE.indexOf(typeid) != -1) {
  380. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  381. } else {
  382. this.typeE.push(typeid);
  383. if (this.typef != "") {
  384. this.typef = "";
  385. }
  386. }
  387. } else {
  388. if (this.typef == typeid) {
  389. this.typef = "";
  390. } else {
  391. this.typef = typeid;
  392. if (this.typeE.indexOf(ftypeId) != -1) {
  393. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  394. }
  395. }
  396. }
  397. } else if (typeName == "赛道") {
  398. if (type == 1) {
  399. if (this.typeE.indexOf(typeid) != -1) {
  400. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  401. } else {
  402. this.typeE.push(typeid);
  403. if (this.typed != "") {
  404. this.typed = "";
  405. }
  406. }
  407. } else {
  408. if (this.typed == typeid) {
  409. this.typed = "";
  410. } else {
  411. this.typed = typeid;
  412. if (this.typeE.indexOf(ftypeId) != -1) {
  413. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  414. }
  415. }
  416. }
  417. } else if (typeName == "学科") {
  418. if (type == 1) {
  419. if (this.typeE.indexOf(typeid) != -1) {
  420. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  421. } else {
  422. this.typeE.push(typeid);
  423. if (this.typed != "") {
  424. this.typed = "";
  425. }
  426. }
  427. } else {
  428. if (this.typed == typeid) {
  429. this.typed = "";
  430. } else {
  431. this.typed = typeid;
  432. if (this.typeE.indexOf(ftypeId) != -1) {
  433. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  434. }
  435. }
  436. }
  437. } else if (typeName == "项目类型") {
  438. if (type == 1) {
  439. if (this.typeE.indexOf(typeid) != -1) {
  440. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  441. } else {
  442. this.typeE.push(typeid);
  443. if (this.typed != "") {
  444. this.typed = "";
  445. }
  446. }
  447. } else {
  448. if (this.typed == typeid) {
  449. this.typed = "";
  450. } else {
  451. this.typed = typeid;
  452. if (this.typeE.indexOf(ftypeId) != -1) {
  453. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  454. }
  455. }
  456. }
  457. } else if (typeName == "学院") {
  458. if (type == 1) {
  459. if (this.typeE.indexOf(typeid) != -1) {
  460. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  461. } else {
  462. this.typeE.push(typeid);
  463. if (this.typeb != "") {
  464. this.typeb = "";
  465. }
  466. }
  467. } else {
  468. if (this.typeb == typeid) {
  469. this.typeb = "";
  470. } else {
  471. this.typeb = typeid;
  472. if (this.typeE.indexOf(ftypeId) != -1) {
  473. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  474. }
  475. }
  476. }
  477. } else if (typeName == "学科") {
  478. if (type == 1) {
  479. if (this.typeE.indexOf(typeid) != -1) {
  480. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  481. } else {
  482. this.typeE.push(typeid);
  483. if (this.typed != "") {
  484. this.typed = "";
  485. }
  486. }
  487. } else {
  488. if (this.typed == typeid) {
  489. this.typed = "";
  490. } else {
  491. this.typed = typeid;
  492. if (this.typeE.indexOf(ftypeId) != -1) {
  493. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  494. }
  495. }
  496. }
  497. }
  498. // this.loading = this.openLoading(document.querySelector(".main_box"));
  499. // if (!this.loading) {
  500. // this.loading = this.openLoading(document.querySelector(".main_box"));
  501. // }
  502. this.loading = true
  503. if (this.typeCheck) {
  504. this.selectAll();
  505. } else {
  506. this.selectAll2();
  507. }
  508. },
  509. selectAll() {
  510. this.zoneListId = 0;
  511. this.isListAjax = true;
  512. let type = '0'
  513. if (!this.org || this.org == "undefined" || this.org == "null") {
  514. if (this.tType == 1) {
  515. type = '2'
  516. }
  517. } else {
  518. if (this.role == 1) {
  519. type = '2'
  520. }else if (this.tType == 1) {
  521. type = '1'
  522. }
  523. }
  524. let params = {
  525. type: type,
  526. uid: this.userid,
  527. oid: this.oid,
  528. org: this.org,
  529. typea: this.typea != undefined ? this.typea : "",
  530. typeb: this.typeb != undefined ? this.typeb : "",
  531. typec: this.typec != undefined ? this.typec : "",
  532. typed: this.typed != undefined ? this.typed : "",
  533. typef: this.typef != undefined ? this.typef : "",
  534. typeE: this.typeE.join(","),
  535. cu: "",
  536. cn: this.sCourse,
  537. page: this.page,
  538. };
  539. this.ajax
  540. .get(this.$store.state.api + "selectStudentCourseNew22Mode", params)
  541. .then((res) => {
  542. this.loading = false
  543. this.isListAjax = false;
  544. this.zoneClass = res.data[0];
  545. // this.total = res.data[0].length ? res.data[0][0].num : 0;
  546. let CourseType2 = JSON.parse(JSON.stringify(this.CourseType[0]))
  547. for (var i = 0; i < CourseType2.length; i++) {
  548. CourseType2[i].course = []
  549. for (var j = 0; j < res.data[0].length; j++) {
  550. if (res.data[0][j].pid && res.data[0][j].pid.indexOf(CourseType2[i].id) != -1) {
  551. CourseType2[i].course.push(res.data[0][j])
  552. }
  553. }
  554. }
  555. let noTypeCourse = []
  556. for (var j = 0; j < res.data[0].length; j++) {
  557. if (!res.data[0][j].pid) {
  558. noTypeCourse.push(res.data[0][j])
  559. }
  560. }
  561. if (noTypeCourse.length > 0) {
  562. CourseType2.push({
  563. course: noTypeCourse,
  564. name: '其他'
  565. })
  566. }
  567. CourseType2 = CourseType2.filter(item => {
  568. return item.course.length > 0;
  569. })
  570. this.CourseType2 = CourseType2
  571. // this.selectType({
  572. // data: [res.data[1], res.data[2], res.data[3], res.data[4]],
  573. // });
  574. // this.selectAllType();
  575. // this.getBanner({
  576. // data: [res.data[6], res.data[5], res.data[7]],
  577. // });
  578. this.getBanner()
  579. })
  580. .catch((err) => {
  581. console.error(err);
  582. });
  583. },
  584. selectAll2() {
  585. this.zoneListId = 0;
  586. this.isListAjax = true;
  587. let type = '0'
  588. if (!this.org || this.org == "undefined" || this.org == "null") {
  589. if (this.tType == 1) {
  590. type = '2'
  591. }
  592. } else {
  593. if (this.role == 1) {
  594. type = '2'
  595. }else if(this.tType == 1){
  596. type = '1'
  597. }
  598. }
  599. let params = {
  600. type: type,
  601. uid: this.userid,
  602. oid: this.oid,
  603. org: this.org,
  604. typea: this.typea != undefined ? this.typea : "",
  605. typeb: this.typeb != undefined ? this.typeb : "",
  606. typec: this.typec != undefined ? this.typec : "",
  607. typed: this.typed != undefined ? this.typed : "",
  608. typef: this.typef != undefined ? this.typef : "",
  609. typeE: this.typeE.join(","),
  610. cu: "",
  611. cn: this.sCourse,
  612. page: this.page,
  613. pageSize: this.pageSize,
  614. };
  615. this.ajax
  616. .get(this.$store.state.api + "selectStudentCourseNew22", params)
  617. .then((res) => {
  618. this.loading = false
  619. this.isListAjax = false;
  620. this.zoneClass = res.data[0];
  621. this.total = res.data[0].length ? res.data[0][0].num : 0;
  622. let CourseType2 = []
  623. // this.selectType({
  624. // data: [res.data[1], res.data[2], res.data[3], res.data[4]],
  625. // });
  626. // this.selectAllType();
  627. // this.getBanner({
  628. // data: [res.data[6], res.data[5], res.data[7]],
  629. // });
  630. this.getBanner()
  631. })
  632. .catch((err) => {
  633. console.error(err);
  634. });
  635. },
  636. checkZone(id) {
  637. this.page = 1;
  638. this.zoneListId = id;
  639. this.getZoneClass(id);
  640. },
  641. // handleCurrentChange(val) {
  642. // this.page = val;
  643. // this.getZoneClass(this.zoneListId);
  644. // },
  645. handleCurrentChange(val) {
  646. // if (!this.loading) {
  647. // this.loading = this.openLoading(document.querySelector(".main_box"));
  648. // }
  649. this.page = val;
  650. this.loading = true
  651. this.selectAll2();
  652. },
  653. //获取banner
  654. getBanner(res) {
  655. let params = {
  656. oid: this.org,
  657. };
  658. this.ajax
  659. .get(this.$store.state.api + "selectBannerByOidS", params)
  660. .then((res) => {
  661. if (res.data[0].length > 0) {
  662. this.bannerList = res.data[0];
  663. } else {
  664. // this.getBannerByOid({
  665. // data: [res.data[1], res.data[2]],
  666. // });
  667. this.getBannerByOid();
  668. }
  669. })
  670. .catch((err) => {
  671. console.error(err);
  672. });
  673. },
  674. getBannerByOid(res) {
  675. let params = {
  676. oid: this.oid,
  677. };
  678. this.ajax
  679. .get(this.$store.state.api + "selectBannerByOidS", params)
  680. .then((res) => {
  681. if (res.data[0].length > 0) {
  682. this.bannerList = res.data[0];
  683. } else {
  684. // this.getOldBanner({
  685. // data: [res.data[1]],
  686. // });
  687. this.getOldBanner();
  688. }
  689. })
  690. .catch((err) => {
  691. console.error(err);
  692. });
  693. },
  694. getOldBanner(res) {
  695. this.ajax
  696. .get(this.$store.state.api + "getBannerS", "")
  697. .then((res) => {
  698. this.bannerList = res.data[0];
  699. })
  700. .catch((err) => {
  701. console.error(err);
  702. });
  703. },
  704. selectAllType() {
  705. let params = {
  706. org: this.org && this.org != "" ? this.org : "",
  707. oid: this.oid && this.oid != "" ? this.oid : "",
  708. };
  709. this.ajax
  710. .get(this.$store.state.api + "selectAllTypeS", params)
  711. .then((res) => {
  712. this.CourseTypeJson = {}
  713. this.CourseType = res.data;
  714. for (var i = 0; i < res.data[0].length; i++) {
  715. if(res.data[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5"){
  716. res.data[0][i].name = "赛道";
  717. }else if(res.data[0][i].id == "2f8beae3-d030-11ec-8c78-005056b86db5"){
  718. res.data[0][i].name = "主题";
  719. }else if(res.data[0][i].id == "34628934-d02f-11ec-8c78-005056b86db5"){
  720. res.data[0][i].name = "年级";
  721. }
  722. if (!this.CourseTypeJson[res.data[0][i].id]) {
  723. this.CourseTypeJson[res.data[0][i].id] = [];
  724. }
  725. if (this.oid == "1c3b9def-8fbe-11ed-b13d-005056b86db5") {
  726. if (res.data[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5") {
  727. this.CourseType[0][i].name = "项目类型";
  728. }
  729. }else if(this.org == '150e3120-9195-11ed-b13d-005056b86db5'){
  730. }else{
  731. if (res.data[0][i].name == "赛道") {
  732. this.CourseType[0][i].name = "学科";
  733. }
  734. }
  735. if (res.data[2].length == 0 && res.data[3].length == 0) {
  736. if(this.org == '150e3120-9195-11ed-b13d-005056b86db5'){
  737. for (var j = 0; j < res.data[1].length; j++) {
  738. if (res.data[0][i].id == res.data[1][j].pid) {
  739. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  740. }
  741. }
  742. }else{
  743. // this.CourseType = []
  744. for (var j = 0; j < res.data[1].length; j++) {
  745. if (res.data[0][i].id == res.data[1][j].pid) {
  746. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  747. }
  748. }
  749. }
  750. } else {
  751. if (res.data[2].length > 0) {
  752. for (var j = 0; j < res.data[2].length; j++) {
  753. if (res.data[0][i].id == res.data[2][j].pid) {
  754. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  755. }
  756. }
  757. }
  758. if (res.data[3].length > 0) {
  759. for (var j = 0; j < res.data[3].length; j++) {
  760. if (res.data[0][i].id == res.data[3][j].pid) {
  761. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  762. }
  763. }
  764. }
  765. }
  766. }
  767. this.$forceUpdate();
  768. if (this.typeCheck) {
  769. this.selectAll();
  770. } else {
  771. this.selectAll2();
  772. }
  773. })
  774. .catch((err) => {
  775. console.error(err);
  776. });
  777. },
  778. selectType(res) {
  779. // this.ajax
  780. // .get(this.$store.state.api + "selectType")
  781. // .then((res) => {
  782. this.CourseTypeJson = {};
  783. this.CourseType = res.data;
  784. for (var i = 0; i < res.data[0].length; i++) {
  785. if (!this.cid) {
  786. this.courseTypeId[res.data[0][i].id] = "";
  787. }
  788. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  789. if (res.data[0][i].name == "栏目") {
  790. this.CourseType[0][i].name = "主题";
  791. }
  792. }
  793. for (var j = 0; j < res.data[1].length; j++) {
  794. if (res.data[0][i].id == res.data[1][j].pid) {
  795. if (!this.CourseTypeJson[res.data[0][i].id]) {
  796. this.CourseTypeJson[res.data[0][i].id] = [];
  797. }
  798. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  799. }
  800. }
  801. }
  802. this.selectTypeByOid({ data: [res.data[0], res.data[2]] });
  803. this.selectTypeByOrg({ data: [res.data[0], res.data[3]] });
  804. // })
  805. // .catch((err) => {
  806. // console.error(err);
  807. // });
  808. },
  809. selectTypeByOid(res) {
  810. // let params = {
  811. // oid: this.oid,
  812. // };
  813. // this.ajax
  814. // .get(this.$store.state.api + "selectTypeByOid", params)
  815. // .then((res) => {
  816. for (var i = 0; i < res.data[0].length; i++) {
  817. for (var j = 0; j < res.data[1].length; j++) {
  818. if (res.data[0][i].id == res.data[1][j].pid) {
  819. if (!this.CourseTypeJson[res.data[0][i].id]) {
  820. this.CourseTypeJson[res.data[0][i].id] = [];
  821. }
  822. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  823. }
  824. }
  825. }
  826. this.$forceUpdate();
  827. // })
  828. // .catch((err) => {
  829. // console.error(err);
  830. // });
  831. },
  832. selectTypeByOrg(res) {
  833. // let params = {
  834. // oid: this.org,
  835. // };
  836. // this.ajax
  837. // .get(this.$store.state.api + "selectTypeByOrg", params)
  838. // .then((res) => {
  839. for (var i = 0; i < res.data[0].length; i++) {
  840. for (var j = 0; j < res.data[1].length; j++) {
  841. if (res.data[0][i].id == res.data[1][j].pid) {
  842. if (!this.CourseTypeJson[res.data[0][i].id]) {
  843. this.CourseTypeJson[res.data[0][i].id] = [];
  844. }
  845. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  846. }
  847. }
  848. }
  849. this.$forceUpdate();
  850. // })
  851. // .catch((err) => {
  852. // console.error(err);
  853. // });
  854. },
  855. },
  856. beforeDestroy() {
  857. clearInterval(this.timer);
  858. this.timer = null;
  859. },
  860. created() {
  861. // this.loading = this.openLoading(document.querySelector(".main_box"));
  862. // this.selectType();
  863. this.loading = true
  864. this.selectAllType();
  865. // this.getBanner();
  866. this.timer = setInterval(() => {
  867. this.selectAllType();
  868. // this.getBanner();
  869. }, 60000);
  870. document.scrollingElement.scrollTop = 0;
  871. },
  872. };
  873. </script>
  874. <style scoped>
  875. @media screen and (max-width: 1024px) {
  876. .box_course {
  877. margin: 0px 5px 20px 5px !important;
  878. }
  879. }
  880. .student_head .imgS {
  881. width: 100%;
  882. height: 100%;
  883. cursor: pointer;
  884. object-fit: cover;
  885. }
  886. .top {
  887. padding: 20px 30px 20px 1%;
  888. box-sizing: border-box;
  889. display: flex;
  890. align-items: center;
  891. }
  892. .top div {
  893. cursor: pointer;
  894. box-sizing: border-box;
  895. height: 35px;
  896. line-height: 35px;
  897. margin: 0 10px 0 0;
  898. padding-bottom: 5px;
  899. width: 80px;
  900. text-align: center;
  901. }
  902. .top .active {
  903. border-bottom: 3px solid #0e71e6;
  904. }
  905. .isactive {
  906. border-bottom: 3px solid #0e71e6;
  907. }
  908. .box_fk {
  909. width: 8px;
  910. height: 21px;
  911. background: #0e71e6;
  912. margin-right: 5px;
  913. }
  914. .wheel {
  915. width: 100%;
  916. height: 140px;
  917. }
  918. .man {
  919. width: 16px;
  920. height: 16px;
  921. }
  922. .wheel>img,
  923. .man>img {
  924. width: 100%;
  925. height: 100%;
  926. object-fit: cover;
  927. }
  928. .box_course {
  929. display: flex;
  930. flex-direction: column;
  931. flex-wrap: nowrap;
  932. /* margin: 0px 1% 20px; */
  933. margin: 0 15px 20px 0;
  934. width: 300px;
  935. /* height: 260px; */
  936. /*border: 1px solid #cecece; */
  937. border-radius: 10px;
  938. overflow: hidden;
  939. box-shadow: 0px 1px 3px 0px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%),
  940. 0px 2px 1px -1px rgb(0 0 0 / 12%);
  941. justify-content: space-between;
  942. cursor: pointer;
  943. }
  944. .middle_white {
  945. font-size: 14px;
  946. margin: 5px 10px 10px;
  947. }
  948. .people {
  949. display: flex;
  950. align-items: center;
  951. }
  952. .people>div:nth-child(2) {
  953. margin-left: 10px;
  954. }
  955. .now_study {
  956. width: 100%;
  957. height: 40px;
  958. color: #fff;
  959. background: #4a9eed;
  960. text-align: center;
  961. line-height: 40px;
  962. font-size: 13px;
  963. cursor: pointer;
  964. display: none;
  965. }
  966. .now_study:hover {
  967. background: #205cc6;
  968. }
  969. /* .now_study {
  970. width: 100%;
  971. height: 40px;
  972. color: #222;
  973. line-height: 40px;
  974. font-size: 14px;
  975. cursor: pointer;
  976. display: flex;
  977. }
  978. .now_study > div{
  979. text-align: center;
  980. height: 100%;
  981. width: 100%;
  982. background: #dddddd;
  983. box-sizing: border-box;
  984. transition: all .3s ease-in-out;
  985. }
  986. .now_study > div+div{
  987. border-left: 1px solid #c7c7c7;
  988. }
  989. .now_study > div:hover {
  990. background: #6574a2;
  991. color: #fff;
  992. } */
  993. .main_box {
  994. width: 100%;
  995. /* display: flex;
  996. flex-direction: row;
  997. flex-wrap: wrap;
  998. justify-content: flex-start; */
  999. margin: 0 auto;
  1000. }
  1001. .right_bottom_flex {
  1002. width: 219px;
  1003. height: 144px;
  1004. margin: auto 0;
  1005. }
  1006. .right_bottom_flex>img {
  1007. width: 100%;
  1008. height: 100%;
  1009. }
  1010. .body_student {
  1011. margin: 0 auto;
  1012. width: 90%;
  1013. height: 100%;
  1014. }
  1015. .student_head {
  1016. width: 100%;
  1017. /* height: 30%; */
  1018. }
  1019. .textOverflow {
  1020. padding: 0 5px 0 0px;
  1021. width: 95%;
  1022. overflow: hidden;
  1023. white-space: nowrap;
  1024. text-overflow: ellipsis;
  1025. font-weight: bold;
  1026. font-size: 16px;
  1027. }
  1028. .student_page {
  1029. margin-top: 10px;
  1030. }
  1031. .course_empty {
  1032. width: 100%;
  1033. height: 200px;
  1034. display: flex;
  1035. align-items: center;
  1036. justify-content: center;
  1037. }
  1038. .choose {
  1039. display: flex;
  1040. flex-direction: column;
  1041. flex-wrap: nowrap;
  1042. height: 100%;
  1043. justify-content: space-evenly;
  1044. align-items: flex-start;
  1045. padding: 10px 0;
  1046. }
  1047. .all_choose {
  1048. display: flex;
  1049. flex-direction: row;
  1050. align-items: baseline;
  1051. margin: 10px 0;
  1052. width: 100%;
  1053. }
  1054. .all_choose>div:nth-child(1) span {
  1055. text-align-last: justify;
  1056. width: 100%;
  1057. display: block;
  1058. }
  1059. .all_choose>div:nth-child(1) {
  1060. min-width: 80px;
  1061. width: 80px;
  1062. font-weight: bold;
  1063. margin-right: 10px;
  1064. display: flex;
  1065. }
  1066. .all_choose>>>.el-checkbox-group {
  1067. display: flex;
  1068. flex-direction: row;
  1069. width: 820px;
  1070. flex-wrap: wrap;
  1071. align-content: center;
  1072. justify-content: flex-start;
  1073. align-items: center;
  1074. margin-top: 3px;
  1075. }
  1076. .all_choose>.el-checkbox-group>>>.el-checkbox {
  1077. margin-bottom: 10px;
  1078. display: flex;
  1079. flex-direction: row;
  1080. align-items: center;
  1081. }
  1082. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label {
  1083. min-width: 80px;
  1084. overflow: hidden;
  1085. width: 80px;
  1086. text-overflow: ellipsis;
  1087. white-space: nowrap;
  1088. }
  1089. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label:hover {
  1090. width: auto;
  1091. }
  1092. .cName {
  1093. cursor: pointer;
  1094. margin: 0 10px 10px 0;
  1095. color: #b9b6b9;
  1096. min-width: 80px;
  1097. width: 80px;
  1098. white-space: nowrap;
  1099. overflow: hidden;
  1100. text-overflow: ellipsis;
  1101. }
  1102. .reBox {
  1103. position: relative;
  1104. top: -25px;
  1105. z-index: 999;
  1106. background: #fff;
  1107. width: 90%;
  1108. border-radius: 5px;
  1109. padding-left: 20px;
  1110. margin: 0 auto;
  1111. box-sizing: border-box;
  1112. }
  1113. .reTop {
  1114. padding: 20px 0 0 0;
  1115. border-bottom: 1px solid #eee;
  1116. width: 98%;
  1117. display: flex;
  1118. flex-direction: row;
  1119. flex-wrap: nowrap;
  1120. align-items: center;
  1121. justify-content: space-between;
  1122. }
  1123. .reTop>div:nth-child(1) {
  1124. font-weight: bold;
  1125. width: 40px;
  1126. border-bottom: 1px solid #205cc6;
  1127. padding-bottom: 20px;
  1128. color: #205cc6;
  1129. font-size: 20px;
  1130. }
  1131. .reTop>div:nth-child(2) {
  1132. display: flex;
  1133. flex-direction: row;
  1134. align-items: center;
  1135. border: 1px solid #ccced3;
  1136. width: 300px;
  1137. border-radius: 8px;
  1138. padding: 5px 0;
  1139. margin-bottom: 10px;
  1140. }
  1141. .search {
  1142. width: 20px;
  1143. padding: 0 5px;
  1144. }
  1145. .search>img {
  1146. width: 100%;
  1147. height: 100%;
  1148. }
  1149. .sInput {
  1150. border: none;
  1151. width: 85%;
  1152. }
  1153. .sInput:focus-visible {
  1154. outline: none;
  1155. }
  1156. .nameAndLength {
  1157. display: flex;
  1158. flex-direction: row;
  1159. flex-wrap: nowrap;
  1160. align-items: center;
  1161. justify-content: space-between;
  1162. margin: 5px 0;
  1163. }
  1164. .typeN {
  1165. width: 200px;
  1166. white-space: nowrap;
  1167. overflow: hidden;
  1168. text-overflow: ellipsis;
  1169. }
  1170. .isCType {
  1171. color: #6282c2;
  1172. }
  1173. .typeCss {
  1174. display: flex;
  1175. flex-direction: row;
  1176. flex-wrap: wrap;
  1177. justify-content: flex-start;
  1178. align-items: center;
  1179. }
  1180. .school {
  1181. white-space: nowrap;
  1182. overflow: hidden;
  1183. text-overflow: ellipsis;
  1184. max-width: 50%;
  1185. box-sizing: border-box;
  1186. }
  1187. .school_box {
  1188. display: flex;
  1189. align-items: center;
  1190. justify-content: space-between;
  1191. }
  1192. .FirstTypeBox {}
  1193. .FirstTypeBox+.FirstTypeBox {
  1194. margin-top: 20px;
  1195. }
  1196. .FirstTypeBox>.title {
  1197. font-size: 24px;
  1198. font-weight: 700;
  1199. }
  1200. .typeCheck {
  1201. display: flex;
  1202. align-items: center;
  1203. justify-content: flex-end;
  1204. margin-bottom: 10px;
  1205. }
  1206. .typeCheck>span {
  1207. margin-left: 10px;
  1208. }
  1209. </style>