|
@@ -870,7 +870,54 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
- getCourseDetail() {
|
|
|
+ getCourseDetail1() {
|
|
|
+ const loading = this.$loading.service({
|
|
|
+ background: "rgba(255, 255, 255, 0.7)",
|
|
|
+ target: document.querySelector(".student_table"),
|
|
|
+ });
|
|
|
+ let params = {
|
|
|
+ courseId: this.id,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "selectCourseDetail2", params)
|
|
|
+ .then((res) => {
|
|
|
+ loading.close();
|
|
|
+ // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
|
+ this.courseDetail = res.data[0][0];
|
|
|
+ var a = res.data[0];
|
|
|
+ var b = res.data[1];
|
|
|
+ var c = res.data[2];
|
|
|
+ for (var i = 0; i < b.length; i++) {
|
|
|
+ // if (!this.id) {
|
|
|
+ // this.courseType[b[i].id] = [];
|
|
|
+ // }
|
|
|
+ for (var j = 0; j < a.length; j++) {
|
|
|
+ if (b[i].id == a[j].pid) {
|
|
|
+ if (!this.courseTypeJson[b[i].name]) {
|
|
|
+ this.courseType.push(b[i].name);
|
|
|
+ this.courseTypeJson[b[i].name] = [];
|
|
|
+ }
|
|
|
+ this.courseTypeJson[b[i].name].push(a[j].name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (var k = 0; k < c.length; k++) {
|
|
|
+ this.Tname.push(c[k].name);
|
|
|
+ }
|
|
|
+ console.log(this.courseTypeJson.length);
|
|
|
+ this.aStudentName = res.data[2];
|
|
|
+ this.chapInfo = JSON.parse(this.courseDetail.chapters);
|
|
|
+ for (var z = 0; z < this.chapInfo.length; z++) {
|
|
|
+ this.rw += this.chapInfo[z].chapterInfo[0].taskJson.length;
|
|
|
+ }
|
|
|
+ // debugger
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ loading.close();
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getCourseDetail2() {
|
|
|
const loading = this.$loading.service({
|
|
|
background: "rgba(255, 255, 255, 0.7)",
|
|
|
target: document.querySelector(".student_table"),
|
|
@@ -1057,7 +1104,11 @@ export default {
|
|
|
// },
|
|
|
},
|
|
|
created() {
|
|
|
- this.getCourseDetail();
|
|
|
+ if(this.tType == 1 || this.tType == 4){
|
|
|
+ this.getCourseDetail2();
|
|
|
+ }else{
|
|
|
+ this.getCourseDetail1();
|
|
|
+ }
|
|
|
this.getUser();
|
|
|
document.scrollingElement.scrollTop = 0;
|
|
|
// this.getSName();
|