|
@@ -128,7 +128,29 @@
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div style="margin-top: 30px">
|
|
|
|
|
|
+ <div class="choose">
|
|
|
|
+ <div
|
|
|
|
+ class="all_choose"
|
|
|
|
+ v-for="(item, index) in CourseType[0]"
|
|
|
|
+ :key="index"
|
|
|
|
+ >
|
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="courseTypeId[item.id]"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ @change="getTypeName"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item1 in CourseTypeJson[item.id]"
|
|
|
|
+ :key="item1.id"
|
|
|
|
+ :label="item1.name"
|
|
|
|
+ :value="item1.id"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
<div class="bInfo_title">
|
|
<div class="bInfo_title">
|
|
<span style="color: red">*</span>简要描述
|
|
<span style="color: red">*</span>简要描述
|
|
</div>
|
|
</div>
|
|
@@ -144,12 +166,12 @@
|
|
<el-switch
|
|
<el-switch
|
|
v-model="isTeacherSee"
|
|
v-model="isTeacherSee"
|
|
active-text="允许给其他老师查看"
|
|
active-text="允许给其他老师查看"
|
|
- style="margin: 40px 0 0 25px"
|
|
|
|
|
|
+ style="margin: 40px 0 0 25px; padding-bottom: 30px"
|
|
>
|
|
>
|
|
</el-switch>
|
|
</el-switch>
|
|
</div>
|
|
</div>
|
|
<div class="right_first">
|
|
<div class="right_first">
|
|
- <div>
|
|
|
|
|
|
+ <div style="margin-top: 25px">
|
|
<div style="flex: 0.5 1 0%; margin: 0 20px 0 0">
|
|
<div style="flex: 0.5 1 0%; margin: 0 20px 0 0">
|
|
<div class="bInfo_title">
|
|
<div class="bInfo_title">
|
|
<span style="color: red">*</span>课程封面
|
|
<span style="color: red">*</span>课程封面
|
|
@@ -1069,6 +1091,10 @@ export default {
|
|
tdetail: "",
|
|
tdetail: "",
|
|
templateC: {},
|
|
templateC: {},
|
|
cTemplate: "",
|
|
cTemplate: "",
|
|
|
|
+ CourseType: [],
|
|
|
|
+ CourseTypeJson: {},
|
|
|
|
+ courseTypeId: {},
|
|
|
|
+ courseTypeSon: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -1150,6 +1176,16 @@ export default {
|
|
this.cover.length != 0 &&
|
|
this.cover.length != 0 &&
|
|
this.checkboxList.length != 0
|
|
this.checkboxList.length != 0
|
|
) {
|
|
) {
|
|
|
|
+ for (var i = 0; i < this.CourseType[0].length; i++) {
|
|
|
|
+ if (this.courseTypeId[this.CourseType[0][i].id] != "") {
|
|
|
|
+ this.courseTypeSon.push(
|
|
|
|
+ this.courseTypeId[this.CourseType[0][i].id]
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("请选择分类");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.steps = 2;
|
|
this.steps = 2;
|
|
} else {
|
|
} else {
|
|
this.$message.error("请将信息填写完整");
|
|
this.$message.error("请将信息填写完整");
|
|
@@ -1174,6 +1210,16 @@ export default {
|
|
this.cover.length != 0 &&
|
|
this.cover.length != 0 &&
|
|
this.checkboxList.length != 0
|
|
this.checkboxList.length != 0
|
|
) {
|
|
) {
|
|
|
|
+ for (var i = 0; i < this.CourseType[0].length; i++) {
|
|
|
|
+ if (this.courseTypeId[this.CourseType[0][i].id] != "") {
|
|
|
|
+ this.courseTypeSon.push(
|
|
|
|
+ this.courseTypeId[this.CourseType[0][i].id]
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("请选择分类");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.steps++;
|
|
this.steps++;
|
|
} else {
|
|
} else {
|
|
this.$message.error("请将信息填写完整");
|
|
this.$message.error("请将信息填写完整");
|
|
@@ -1550,16 +1596,18 @@ export default {
|
|
see: this.isTeacherSee == true ? 0 : 1,
|
|
see: this.isTeacherSee == true ? 0 : 1,
|
|
chapters: JSON.stringify(this.unitJson),
|
|
chapters: JSON.stringify(this.unitJson),
|
|
template: this.cTemplate,
|
|
template: this.cTemplate,
|
|
|
|
+ courseType: JSON.stringify(this.courseTypeSon),
|
|
},
|
|
},
|
|
];
|
|
];
|
|
this.ajax
|
|
this.ajax
|
|
- .post(this.$store.state.api + "addWork", params)
|
|
|
|
|
|
+ // .post(this.$store.state.api + "addWork", params)
|
|
|
|
+ .post(this.$store.state.api + "addWorkNew", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.$message({
|
|
this.$message({
|
|
message: "新增成功",
|
|
message: "新增成功",
|
|
type: "success",
|
|
type: "success",
|
|
});
|
|
});
|
|
- this.number = res.data[0][0].ordernumber;
|
|
|
|
|
|
+ this.number = res.data.ordernumber;
|
|
this.islogin = true;
|
|
this.islogin = true;
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
@@ -1581,10 +1629,12 @@ export default {
|
|
see: this.isTeacherSee == true ? 0 : 1,
|
|
see: this.isTeacherSee == true ? 0 : 1,
|
|
chapters: JSON.stringify(this.unitJson),
|
|
chapters: JSON.stringify(this.unitJson),
|
|
template: this.myWord,
|
|
template: this.myWord,
|
|
|
|
+ uid: this.userid,
|
|
|
|
+ courseType: JSON.stringify(this.courseTypeSon),
|
|
},
|
|
},
|
|
];
|
|
];
|
|
this.ajax
|
|
this.ajax
|
|
- .post(this.$store.state.api + "updateWork", params)
|
|
|
|
|
|
+ .post(this.$store.state.api + "updateWorkNew", params)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.$message({
|
|
this.$message({
|
|
message: "修改成功",
|
|
message: "修改成功",
|
|
@@ -1848,7 +1898,7 @@ export default {
|
|
: [];
|
|
: [];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.unitJson[0].dyText = "";
|
|
|
|
|
|
+ // this.unitJson[0].dyText = "";
|
|
this.courseName = res.data[0][0].title;
|
|
this.courseName = res.data[0][0].title;
|
|
this.courseText = res.data[0][0].brief;
|
|
this.courseText = res.data[0][0].brief;
|
|
this.checkboxList = JSON.parse(res.data[0][0].course_student);
|
|
this.checkboxList = JSON.parse(res.data[0][0].course_student);
|
|
@@ -1859,17 +1909,52 @@ export default {
|
|
this.myWord = res.data[0][0].template;
|
|
this.myWord = res.data[0][0].template;
|
|
this.templateC.id = "123";
|
|
this.templateC.id = "123";
|
|
this.nbOrder = res.data[0][0].ordernumber;
|
|
this.nbOrder = res.data[0][0].ordernumber;
|
|
|
|
+ this.CourseType[0] = res.data[1];
|
|
|
|
+ // this.selectType();
|
|
|
|
+ for(var i =0;i<this.CourseType[0].length;i++){
|
|
|
|
+ this.courseTypeId[this.CourseType[0][i].typePid] = this.CourseType[0][i].typeid;
|
|
|
|
+ }
|
|
|
|
+ console.log(this.courseTypeId);
|
|
|
|
+ this.$forceUpdate();
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
console.error(err);
|
|
console.error(err);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ getTypeName() {
|
|
|
|
+ console.log(this.courseTypeId);
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
|
|
+ selectType() {
|
|
|
|
+ this.ajax
|
|
|
|
+ .get(this.$store.state.api + "selectType")
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.CourseType = res.data;
|
|
|
|
+ for (var i = 0; i < res.data[0].length; i++) {
|
|
|
|
+ if(!this.cid){
|
|
|
|
+ this.courseTypeId[res.data[0][i].id] = "";
|
|
|
|
+ }
|
|
|
|
+ for (var j = 0; j < res.data[1].length; j++) {
|
|
|
|
+ if (res.data[0][i].id == res.data[1][j].pid) {
|
|
|
|
+ if (!this.CourseTypeJson[res.data[0][i].id]) {
|
|
|
|
+ this.CourseTypeJson[res.data[0][i].id] = [];
|
|
|
|
+ }
|
|
|
|
+ this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.error(err);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.selectCourseDetail();
|
|
this.selectCourseDetail();
|
|
this.getStudent();
|
|
this.getStudent();
|
|
this.getTemplate();
|
|
this.getTemplate();
|
|
|
|
+ this.selectType();
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -1891,7 +1976,8 @@ export default {
|
|
.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
|
|
.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
|
|
color: #fff;
|
|
color: #fff;
|
|
}
|
|
}
|
|
-.dialog_diy >>> .el-dialog__body,.dialog_diy >>> .el-dialog__footer {
|
|
|
|
|
|
+.dialog_diy >>> .el-dialog__body,
|
|
|
|
+.dialog_diy >>> .el-dialog__footer {
|
|
background: #fafafa;
|
|
background: #fafafa;
|
|
}
|
|
}
|
|
.left {
|
|
.left {
|
|
@@ -1958,7 +2044,6 @@ export default {
|
|
.right {
|
|
.right {
|
|
height: 100%;
|
|
height: 100%;
|
|
width: 100%;
|
|
width: 100%;
|
|
- overflow: auto;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
.basic_box {
|
|
.basic_box {
|
|
@@ -2960,4 +3045,27 @@ ol {
|
|
justify-content: center;
|
|
justify-content: center;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
|
|
+.all_choose {
|
|
|
|
+ margin: 15px 0;
|
|
|
|
+ height: 20%;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+.all_choose > span {
|
|
|
|
+ width: 50px;
|
|
|
|
+ display: block;
|
|
|
|
+}
|
|
|
|
+.all_choose >>> .el-select {
|
|
|
|
+ margin: 0 0 0 20px;
|
|
|
|
+}
|
|
|
|
+.choose {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
+ align-content: space-between;
|
|
|
|
+ height: 100%;
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|