index.vue 38 KB

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