|
@@ -138,6 +138,8 @@ import DicListSelect from "@/components/DicListSelect";
|
|
|
import DetailLink from "@/components/DetailLink";
|
|
|
import WebTable from "@/components/WebTable";
|
|
|
import DicCatalogTree from "../../../components/DicTreeSelect";
|
|
|
+import { post } from '@/utils/request'
|
|
|
+import { checkProcess } from "@/api/paper/exam";
|
|
|
|
|
|
export default {
|
|
|
name: "UserCourseList",
|
|
@@ -163,15 +165,58 @@ export default {
|
|
|
// 列表请求URL
|
|
|
listUrl: "/api/course/course/user-paging",
|
|
|
},
|
|
|
+ unlearn: sessionStorage.unlearn || 'false'
|
|
|
};
|
|
|
},
|
|
|
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ this.funGetCourse()
|
|
|
+ },
|
|
|
methods: {
|
|
|
tabClick(tab) {
|
|
|
this.listQuery.params.learnState = tab.name;
|
|
|
this.$refs.pagingTable.getList();
|
|
|
},
|
|
|
+ funGetCourse() {
|
|
|
+ if (this.unlearn === 'true') {
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ sessionStorage.setItem('unlearn', 'true')
|
|
|
+ }
|
|
|
+ post(this.options.listUrl, {
|
|
|
+ current: 1,
|
|
|
+ size: 10,
|
|
|
+ params: {
|
|
|
+ onlyLearn: this.onlyLearn,
|
|
|
+ learnState: '1'
|
|
|
+ },
|
|
|
+ t: Date.now()
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.code === 0) {
|
|
|
+ if (res.data && res.data.records && res.data.records.length) {
|
|
|
+ this.$message.warning('您有未学习的课程, 请注意!')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ post('/api/exam/exam/online-paging', {
|
|
|
+ current: 1,
|
|
|
+ size: 999,
|
|
|
+ params: {
|
|
|
+ examType: ''
|
|
|
+ },
|
|
|
+ t: Date.now()
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ if (res.data && res.data.records && res.data.records.length) {
|
|
|
+ const checkTryCount = res.data.records.every(o => o.tryCount>0)
|
|
|
+ if (!checkTryCount) {
|
|
|
+ this.$message.warning('您有未参加的考试, 请注意!')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
// 课程详情
|
|
|
handelView(courseId) {
|