CourseCon.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <template>
  2. <div class="teacherDevelop">
  3. <topBar title="课程建设" detail="智能课程管理 · 数字化教学资源 · AI赋能备课教学"></topBar>
  4. <div class="cardBox">
  5. <card v-for="item in cardArray" :key="item.title" :title="item.title" :icon="item.icon" :to="item.to" :type="item.type"></card>
  6. </div>
  7. <div class="courseList" v-loading="isLoading">
  8. <div class="courseListTit">精品课程</div>
  9. <div class="courseListSearch">
  10. <div style="display: flex;gap: 25px;">
  11. <el-select v-for="(i,index) in typeList" clearable :key="index" v-model="i.typeE" @change="search" :placeholder="i.name">
  12. <el-option :value="false" label="全部"></el-option>
  13. <el-option
  14. v-for="item in i.child"
  15. :key="item.id"
  16. :label="item.name"
  17. :value="item.id">
  18. </el-option>
  19. </el-select>
  20. <el-select v-model="groupA" clearable @change="search" v-if="role == '1'" placeholder="所有者">
  21. <el-option value="4" label="全部"></el-option>
  22. <el-option value="2" label="我的课程"></el-option>
  23. <el-option value="3" label="协同课程"></el-option>
  24. <el-option value="1" label="他人课程"></el-option>
  25. </el-select>
  26. <el-select v-model="groupA" clearable @change="search" v-else placeholder="所有者">
  27. <el-option value="0" label="全部"></el-option>
  28. <el-option value="2" label="我的课程"></el-option>
  29. <el-option value="3" label="协同课程"></el-option>
  30. </el-select>
  31. </div>
  32. <div class="serachCon">
  33. <el-input
  34. placeholder="请输入关键字"
  35. suffix-icon="el-icon-search"
  36. @change="search"
  37. v-model="courseName">
  38. </el-input>
  39. </div>
  40. </div>
  41. <div class="courseDataL">
  42. <div class="Conblock" v-for="(i,index) in courseList" :key="index">
  43. <div class="ConblockTit">
  44. {{ i.title }}
  45. </div>
  46. <div style="display: flex;gap: 10px;color: #969BA3;font-size: 14px;">
  47. <span v-if="i.state == 1">阶段模式</span>
  48. <span v-if="i.state == 2">任务模式</span>
  49. <span v-if="i.state == 3">极简模式</span>
  50. <span v-if="i.state == 4 || i.state == 5">ai模式</span>
  51. <span v-if="i.state == 6">上课模式</span>
  52. <span>@{{ i.school }}</span>
  53. </div>
  54. <img class="PimgL" :src="i.cover != null && i.cover != ''
  55. ? JSON.parse(i.cover).length > 0
  56. ? JSON.parse(i.cover)[0].url
  57. : mr
  58. : mr
  59. " alt />
  60. <div class="foot">
  61. <img style="cursor: pointer;" @click="goToCourse(i.courseId,i.userid)" src="../../../assets/icon/liyuan/courseEditC.svg" alt="">
  62. <div class="ent" @click="entCourse(i)">进入</div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="moreL" @click="lookMore">
  67. <div>查看更多</div>
  68. <img style="margin-top: 1px;" src="../../../assets/icon/liyuan/arrow-up.svg" alt="">
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import topBar from './components/topBar'
  75. import card from './components/card.vue';
  76. import { myMixin } from "@/mixins/mixin.js"
  77. export default {
  78. mixins: [ myMixin ],
  79. components: {
  80. topBar,
  81. card
  82. },
  83. data() {
  84. return {
  85. betaL:'beta',
  86. typeList:[],
  87. CourseType:[],
  88. CourseTypeJson:[],
  89. total:0,
  90. isLoading:false,
  91. mr: require("../../../assets/icon/kc1.png"),
  92. groupA:'', //所有者
  93. courseName:'',
  94. courseList:[],
  95. org:this.$route.query["org"],
  96. oid:this.$route.query["oid"],
  97. userid:this.$route.query["userid"],
  98. role:this.$route.query["role"],
  99. page:1,
  100. pageSize:8,
  101. cardArray: [
  102. { title: '课程管理', icon: require('../../../assets/icon/liyuan/niandukaohe.svg'), type: 1, to: "/course" },
  103. { title: '课程中心', icon: require('../../../assets/icon/liyuan/gerendangan.svg'), type: 4, to: `/pbl-student-table/dist/#/index?userid=${this.$route.query.userid}&oid=${this.$route.query.oid}&org=${this.$route.query.org}&tType=${this.$route.query.tType}&cid=&screenType=3&gotype=1` },
  104. { title: 'AI应用', icon: require('../../../assets/icon/liyuan/jiaoshihuaxiang.svg'), type: 3, to: `?userid=${this.$route.query.userid}&oid=${this.$route.query.oid}&org=${this.$route.query.org}&role=${this.$route.query.role}&tab=0&gotype=1` },
  105. { title: '工作空间', icon: require('../../../assets/icon/liyuan/ketangguancha.svg'), type: 3, to:`?userid=${this.$route.query.userid}&oid=${this.$route.query.oid}&org=${this.$route.query.org}&role=${this.$route.query.role}&tab=1&gotype=1` },
  106. { title: '知识库', icon: require('../../../assets/icon/liyuan/zhinengbiaodan.svg'), type:3, to: `?userid=${this.$route.query.userid}&oid=${this.$route.query.oid}&org=${this.$route.query.org}&role=${this.$route.query.role}&tab=2&gotype=1` },
  107. { title: '协同建构', icon: require('../../../assets/icon/liyuan/zhinengbiaodan.svg'), type: 1, to: "/synergyCourse" },
  108. ]
  109. }
  110. },
  111. methods:{
  112. search() {
  113. console.log('6666');
  114. this.isLoading = true;
  115. this.page = 1;
  116. this.getCourse();
  117. },
  118. lookMore(){
  119. sessionStorage.setItem('gotype', this.$route.path);
  120. let to = `/pbl-student-table/dist/#/index?userid=${this.$route.query.userid}&oid=${this.$route.query.oid}&org=${this.$route.query.org}&role=${this.$route.query.role}&tType=${this.$route.query.tType}&cid=&screenType=3&gotype=1`
  121. let con = this.betaL =='beta'? 'https://beta.pbl.cocorobo.cn' : 'https://pbl.cocorobo.cn'
  122. console.log( `${con}${to}`);
  123. window.location.href = `${con}${to}`;
  124. },
  125. selectAllType() {
  126. let params = {
  127. org: this.org && this.org != "" ? this.org : "",
  128. oid: this.oid && this.oid != "" ? this.oid : "",
  129. stand: "cn"
  130. };
  131. this.ajax
  132. .get(this.$store.state.api + "selectAllTypeStand", params)
  133. .then((res) => {
  134. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  135. res.data[0] = [...res.data[0], ...res.data[4]]
  136. }
  137. this.CourseType = res.data;
  138. this.typeList = res.data[0]
  139. for (var cti = 0; cti < res.data[0].length; cti++) {
  140. if (res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86db5" || res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86ac5") {
  141. res.data[0][cti].name = "年级";
  142. } else if (res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86db5" || res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86ac5") {
  143. res.data[0][cti].name = "学科";
  144. } else if (res.data[0][cti].id == "34629bcc-d02f-11ec-8c78-005056b86db5") {
  145. res.data[0][cti].name = "主题";
  146. }
  147. }
  148. for (var i = 0; i < res.data[0].length; i++) {
  149. // if (!this.cid) {
  150. // this.courseTypeId[res.data[0][i].id] = [];
  151. // }
  152. if (!this.CourseTypeJson[res.data[0][i].id]) {
  153. this.CourseTypeJson[res.data[0][i].id] = [];
  154. }
  155. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  156. if (res.data[0][i].name == "栏目") {
  157. this.CourseType[0][i].name = "主题";
  158. }
  159. }
  160. if (res.data[2].length == 0 && res.data[3].length == 0) {
  161. for (var j = 0; j < res.data[1].length; j++) {
  162. if (res.data[0][i].id == res.data[1][j].pid) {
  163. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  164. }
  165. }
  166. } else {
  167. if (res.data[2].length > 0) {
  168. for (var j = 0; j < res.data[2].length; j++) {
  169. if (res.data[0][i].id == res.data[2][j].pid) {
  170. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  171. }
  172. }
  173. }
  174. if (res.data[3].length > 0) {
  175. for (var j = 0; j < res.data[3].length; j++) {
  176. if (res.data[0][i].id == res.data[3][j].pid) {
  177. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  178. }
  179. }
  180. }
  181. }
  182. }
  183. this.typeList.forEach(e=>{
  184. e.child = this.CourseTypeJson[e.id]
  185. e.typeE = ''
  186. })
  187. console.log('typeList',this.typeList);
  188. this.getCourse()
  189. // console.log('CourseTypeJson',this.CourseTypeJson['34629bcc-d02f-11ec-8c78-005056b86db5']);
  190. // console.log('CourseType',this.CourseType);
  191. })
  192. .catch((err) => {
  193. console.error(err);
  194. });
  195. },
  196. getCourse() {
  197. this.isLoading = true;
  198. let params = {
  199. type: this.groupA ? this.groupA : 4,
  200. uid: this.userid,
  201. oid: this.oid,
  202. org: this.org,
  203. typea: this.typeList.filter(e=> e.id == "34628934-d02f-11ec-8c78-005056b86db5")[0].typeE ? this.typeList.filter(e=> e.id == "34628934-d02f-11ec-8c78-005056b86db5")[0].typeE : '',
  204. typeb: this.typeList.filter(e=> e.id == "34629bcc-d02f-11ec-8c78-005056b86db5")[0].typeE ? this.typeList.filter(e=> e.id == "34629bcc-d02f-11ec-8c78-005056b86db5")[0].typeE : '',
  205. typec: "",
  206. typed: this.typeList.filter(e=> e.id == "34629907-d02f-11ec-8c78-005056b86db5")[0].typeE ? this.typeList.filter(e=> e.id == "34629907-d02f-11ec-8c78-005056b86db5")[0].typeE : '',
  207. typeE: '',
  208. cu: "",
  209. cn: this.courseName,
  210. page: this.page,
  211. pageSize: this.pageSize,
  212. };
  213. console.log('params',params);
  214. this.ajax
  215. .get(this.$store.state.api + "selectCourseNew2Liyuan", params)
  216. .then((res) => {
  217. // this.loading.close();
  218. // this.loading = "";
  219. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  220. this.courseList = res.data[0];
  221. this.isLoading = false;
  222. })
  223. .catch((err) => {
  224. this.isLoading = false;
  225. console.error(err);
  226. });
  227. },
  228. entCourse(item) {
  229. let _str = ""
  230. if(item.state == 1){
  231. _str = "course_stageMode_open"
  232. }if(item.state == 2){
  233. _str = "course_taskMode_open"
  234. }if(item.state == 3){
  235. _str = "course_easyMode_open"
  236. }if(item.state == 5){
  237. _str = "course_aiMode_open"
  238. }if(item.state == 6){
  239. _str = "course_aiEasyMode_open"
  240. }
  241. this.addOp3('1', "", { courseid: item.courseId, type: _str }, "success")
  242. window.topU.postMessage({ cid: item.courseId, screenType: "3" }, "*");
  243. },
  244. goToCourse(courseId,uid) {
  245. if (this.userid != uid) return this.$message.info('课程创建者才可编辑哦')
  246. sessionStorage.setItem('gotype', 'backCourseCon');
  247. this.goToCourse4(courseId)
  248. },
  249. goToCourse4(courseId) {
  250. if (courseId) {
  251. this.$router.push(
  252. "/newAddCourse?cid=" +
  253. courseId +
  254. "&userid=" +
  255. this.userid +
  256. "&oid=" +
  257. this.oid +
  258. "&org=" +
  259. this.org +
  260. "&role=" +
  261. this.role
  262. );
  263. this.addOp3('1', "", { courseid: courseId ,type: "course_stageMode_edit" }, "success")
  264. } else {
  265. this.$router.push(
  266. "/newAddCourse?userid=" +
  267. this.userid +
  268. "&oid=" +
  269. this.oid +
  270. "&org=" +
  271. this.org +
  272. "&role=" +
  273. this.role
  274. );
  275. this.addOp3('1', "", { type: "course_stageMode_createClick" }, "success")
  276. }
  277. // this.$router.push(path);
  278. },
  279. },
  280. mounted(){
  281. this.betaL = window.location.href.includes("beta") ? "beta" : "cloud"
  282. this.selectAllType()
  283. }
  284. }
  285. </script>
  286. <style scoped>
  287. .teacherDevelop{
  288. display: flex;
  289. flex-direction: column;
  290. width: 100%;
  291. height: 100%;
  292. padding: 40px 90px;
  293. box-sizing: border-box;
  294. background: #FAFAFA;
  295. }
  296. .cardBox{
  297. display: grid;
  298. grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  299. gap: 20px;
  300. width: 100%;
  301. margin-top: 20px;
  302. }
  303. .courseList{
  304. flex: 1;
  305. margin-top: 30px;
  306. display: flex;
  307. flex-direction: column;
  308. gap: 30px;
  309. }
  310. .courseListTit{
  311. font-family: PingFang SC;
  312. font-weight: 600;
  313. font-style: Semibold;
  314. font-size: 20px;
  315. line-height: 100%;
  316. letter-spacing: 10%;
  317. }
  318. .courseListSearch{
  319. display: flex;
  320. justify-content: space-between;
  321. }
  322. .courseListSearch >>> .el-select .el-input__inner{
  323. border-radius: 20px;
  324. height: 40px;
  325. width: 110px;
  326. /* border: 1px solid #969BA3 !important; */
  327. color: #606266;
  328. }
  329. .courseListSearch>>> .el-input__inner::-webkit-input-placeholder {
  330. color: #606266 !important;
  331. }
  332. /* .courseListSearch >>> .el-input__placeholder{
  333. color: #606266 !important;
  334. } */
  335. .courseListSearch >>> .el-input__icon{
  336. line-height: 40px;
  337. }
  338. .serachCon >>> .el-input__inner{
  339. height: 40px !important;
  340. border-radius: 20px !important;
  341. width: 300px !important;
  342. border: none;
  343. background: #E7E7E7;
  344. }
  345. .courseDataL{
  346. display: grid;
  347. grid-template-columns: repeat(4, 1fr);
  348. gap: 20px;
  349. }
  350. .Conblock{
  351. display: flex;
  352. flex-direction: column;
  353. gap: 15px;
  354. background: #fff;
  355. border-radius: 12px;
  356. padding: 14px 16px;
  357. box-sizing: border-box;
  358. box-shadow: 0px 4px 10px 0px #0000001A;
  359. }
  360. .PimgL{
  361. width: 100%;
  362. height: 126px;
  363. border-radius: 10px;
  364. object-fit: cover;
  365. }
  366. .ConblockTit{
  367. font-size: 18px;
  368. -webkit-line-clamp: 1;
  369. display: -webkit-box;
  370. -webkit-box-orient: vertical;
  371. overflow: hidden;
  372. text-overflow: ellipsis;
  373. }
  374. .foot{
  375. display: flex;
  376. justify-content: flex-end;
  377. align-items: center;
  378. gap: 10px;
  379. }
  380. .foot > .ent{
  381. border: 1px solid #bcbcbc;
  382. color: #606266;
  383. opacity: 1;
  384. gap: 10px;
  385. cursor: pointer;
  386. border-radius: 20px;
  387. padding-top: 4px;
  388. padding-right: 20px;
  389. padding-bottom: 4px;
  390. padding-left: 20px;
  391. border-width: 1px;
  392. }
  393. .ent:hover{
  394. border: 1px solid #4080FF;
  395. background: #4080FF;
  396. color: #fff;
  397. }
  398. .moreL{
  399. font-family: PingFang HK;
  400. font-size: 16px;
  401. display: flex;
  402. align-items: center;
  403. color: #969BA3;
  404. justify-content: flex-end;
  405. }
  406. </style>