|
@@ -15,11 +15,11 @@
|
|
|
<div class="ml">目录</div>
|
|
|
<div
|
|
|
class="blue_box_one"
|
|
|
- v-for="(item, index) in chapInfoList"
|
|
|
- :key="index"
|
|
|
- @click="get(index)"
|
|
|
+ v-for="(item, stageIndex) in chapInfoList"
|
|
|
+ :key="stageIndex"
|
|
|
+ @click="get(stageIndex)"
|
|
|
>
|
|
|
- <div>第{{ index + 1 }}阶段</div>
|
|
|
+ <div>第{{ stageIndex + 1 }}阶段</div>
|
|
|
<div>{{ item.dyName }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -76,7 +76,11 @@
|
|
|
style="width: 70.5% !important; height: 90px"
|
|
|
v-model="chapInfo.taskDetail"
|
|
|
></textarea> -->
|
|
|
- {{ chapInfo.taskDetail }}
|
|
|
+ {{
|
|
|
+ chapInfo.taskDetail != undefined
|
|
|
+ ? chapInfo.taskDetail
|
|
|
+ : "暂无描述"
|
|
|
+ }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -259,7 +263,13 @@
|
|
|
<div class="filebox" v-else>
|
|
|
<div style="display: flex; padding: 20px 0 20px 30px">
|
|
|
<div style="margin-right: 10px">工具描述:</div>
|
|
|
- <div>{{ chapInfo.toolText }}</div>
|
|
|
+ <div>
|
|
|
+ {{
|
|
|
+ chapInfo.toolText != undefined
|
|
|
+ ? chapInfo.toolText
|
|
|
+ : "暂无描述"
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="chooseWho">
|
|
|
<div
|
|
@@ -472,7 +482,7 @@
|
|
|
class="addEditor"
|
|
|
style="margin-top: 23px"
|
|
|
@click="openAddWork"
|
|
|
- v-if="studyJuri.length == 0"
|
|
|
+ v-if="!isNoHomeWork"
|
|
|
>
|
|
|
选择文件
|
|
|
</div>
|
|
@@ -711,6 +721,7 @@ export default {
|
|
|
toolType: 0,
|
|
|
toolTypeList: [],
|
|
|
dialogVisible4: false,
|
|
|
+ isNoHomeWork: false,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -887,6 +898,26 @@ export default {
|
|
|
},
|
|
|
get(i) {
|
|
|
this.courseType = i;
|
|
|
+ this.isNoHomeWork = false;
|
|
|
+ this.goTo(
|
|
|
+ "/study?type=" +
|
|
|
+ i +
|
|
|
+ "&courseId=" +
|
|
|
+ this.id +
|
|
|
+ "&userid=" +
|
|
|
+ this.userid +
|
|
|
+ "&oid=" +
|
|
|
+ this.oid
|
|
|
+ );
|
|
|
+ (this.studyJuri = [
|
|
|
+ {
|
|
|
+ content: "",
|
|
|
+ cover: [],
|
|
|
+ upVedio: [],
|
|
|
+ upFile: [],
|
|
|
+ },
|
|
|
+ ]),
|
|
|
+ this.getHomeWork();
|
|
|
this.getCourseDetail();
|
|
|
},
|
|
|
addQuestion() {
|
|
@@ -1026,7 +1057,12 @@ export default {
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "selectWork", params)
|
|
|
.then((res) => {
|
|
|
- this.studyJuri = JSON.parse(res.data[0][0].content);
|
|
|
+ if (res.data[0].length > 0) {
|
|
|
+ this.studyJuri = JSON.parse(res.data[0][0].content);
|
|
|
+ this.isNoHomeWork = true;
|
|
|
+ } else {
|
|
|
+ console.log("没有作业");
|
|
|
+ }
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
console.error(err);
|
|
@@ -1066,7 +1102,7 @@ export default {
|
|
|
},
|
|
|
openAddWork() {
|
|
|
this.dialogVisible = true;
|
|
|
- this.getHomeWork();
|
|
|
+ // this.getHomeWork();
|
|
|
// this.studyJuri = [
|
|
|
// {
|
|
|
// content: "",
|
|
@@ -1077,47 +1113,91 @@ export default {
|
|
|
// ];
|
|
|
},
|
|
|
addWork() {
|
|
|
- this.$confirm(
|
|
|
- "您已经提交了该作业了,如果您再提交将覆盖上次提交的作业!",
|
|
|
- "提示",
|
|
|
- {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }
|
|
|
- )
|
|
|
- .then(() => {
|
|
|
- let params = [
|
|
|
- {
|
|
|
- uid: this.userid,
|
|
|
- cid: this.id,
|
|
|
- stage: this.courseType,
|
|
|
- content: JSON.stringify(this.studyJuri),
|
|
|
- },
|
|
|
- ];
|
|
|
- this.ajax
|
|
|
- .post(this.$store.state.api + "addWorks", params)
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "提交成功",
|
|
|
- type: "success",
|
|
|
+ if (this.studyJuri[0].content == "") {
|
|
|
+ this.$message.error("请将信息填写完整");
|
|
|
+ return;
|
|
|
+ } else if (this.studyJuri[0].cover.length == 0) {
|
|
|
+ this.$message.error("请将信息填写完整");
|
|
|
+ return;
|
|
|
+ } else if (this.studyJuri[0].upVedio.length == 0) {
|
|
|
+ this.$message.error("请将信息填写完整");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.isNoHomeWork) {
|
|
|
+ this.$confirm(
|
|
|
+ "您已经提交了该作业了,如果您再提交将覆盖上次提交的作业!",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ uid: this.userid,
|
|
|
+ cid: this.id,
|
|
|
+ stage: this.courseType,
|
|
|
+ content: JSON.stringify(this.studyJuri),
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "addWorks", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "提交成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.isNoHomeWork = true;
|
|
|
+ this.dialogVisible = false;
|
|
|
+ // this.studyJuri.push([
|
|
|
+ // {
|
|
|
+ // content: "",
|
|
|
+ // cover: [],
|
|
|
+ // upVedio: [],
|
|
|
+ // upFile: [],
|
|
|
+ // },
|
|
|
+ // ]);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error("提交失败");
|
|
|
+ console.error(err);
|
|
|
});
|
|
|
- this.dialogVisible = false;
|
|
|
- // this.studyJuri.push([
|
|
|
- // {
|
|
|
- // content: "",
|
|
|
- // cover: [],
|
|
|
- // upVedio: [],
|
|
|
- // upFile: [],
|
|
|
- // },
|
|
|
- // ]);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("提交失败");
|
|
|
- console.error(err);
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ } else {
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ uid: this.userid,
|
|
|
+ cid: this.id,
|
|
|
+ stage: this.courseType,
|
|
|
+ content: JSON.stringify(this.studyJuri),
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "addWorks", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ message: "提交成功",
|
|
|
+ type: "success",
|
|
|
});
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ this.isNoHomeWork = true;
|
|
|
+ this.dialogVisible = false;
|
|
|
+ // this.studyJuri.push([
|
|
|
+ // {
|
|
|
+ // content: "",
|
|
|
+ // cover: [],
|
|
|
+ // upVedio: [],
|
|
|
+ // upFile: [],
|
|
|
+ // },
|
|
|
+ // ]);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error("提交失败");
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
selectCount() {
|
|
|
let params = {
|