Commit a1d896bf authored by 杨梦雪's avatar 杨梦雪

11

parent b82f45c8
...@@ -3,15 +3,14 @@ ...@@ -3,15 +3,14 @@
<div class="title"> <div class="title">
<div class="homework_titile">营地作业</div> <div class="homework_titile">营地作业</div>
</div> </div>
<div class="empty_content" v-if="!this.homeworkList"> <div class="content_empty" v-if="total <= 0">
<div> <div>
<img src="@/assets/img/homework/homework.png" alt="" /> <img src="@/assets/img/homework/homework.png" alt="" />
</div> </div>
<p>同学你好,老师暂未发布作业</p> <p v-if="isShowinfo">同学你好,老师暂未发布作业</p>
<p>请于2021年XX年XX月XX日 前往网站查看作业</p>
</div> </div>
<div class="home_content"> <div class="home_content" v-if="total > 0">
<div class="each_content" v-for="item in homeworkList" :key="item.id"> <div class="each_content" v-for="item in homeworkList" :key="item.id">
<div class="top flex"> <div class="top flex">
<div class="homework_name flex"> <div class="homework_name flex">
...@@ -33,7 +32,7 @@ ...@@ -33,7 +32,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="pagination"> <div class="pagination" v-if="total > 0">
<el-pagination <el-pagination
layout="prev, pager, next" layout="prev, pager, next"
:page-size="pageSize" :page-size="pageSize"
...@@ -68,10 +67,11 @@ export default { ...@@ -68,10 +67,11 @@ export default {
}, },
data() { data() {
return { return {
isShowinfo: false,
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0, total: 0,
homeworkList: {}, homeworkList: [],
dialogVisibleFu: false, dialogVisibleFu: false,
work_context: "", work_context: "",
enclosure_url: "", enclosure_url: "",
...@@ -118,10 +118,17 @@ export default { ...@@ -118,10 +118,17 @@ export default {
getTeacherWork() { getTeacherWork() {
getTeacherWork({ page: this.currentPage }).then((res) => { getTeacherWork({ page: this.currentPage }).then((res) => {
// console.log(res, "getTeacherWork"); // console.log(res, "getTeacherWork");
if (res.data.code == 400001) {
this.isShowinfo = false;
return this.$message.error(res.data.message);
}
if (res.data.code != 200) { if (res.data.code != 200) {
this.isShowinfo = true;
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
this.homeworkList = res.data.data.list; this.homeworkList = res.data.data.list;
console.log(this.homeworkList, " this.homeworkList");
this.isShowinfo = true;
this.total = res.data.data.count; this.total = res.data.data.count;
// this.$message.success(res.data.message); // this.$message.success(res.data.message);
}); });
...@@ -267,3 +274,4 @@ export default { ...@@ -267,3 +274,4 @@ export default {
} }
</style> </style>
...@@ -459,7 +459,7 @@ export default { ...@@ -459,7 +459,7 @@ export default {
this.stu_fileListoss = []; this.stu_fileListoss = [];
this.teaFileList = []; this.teaFileList = [];
this.formData.stu_answer = ""; this.formData.stu_answer = "";
this.$refs["formRef"].resetFields(); this.$refs["formRef_stu"].resetFields();
this.dialogVisible = false; this.dialogVisible = false;
this.$emit("closeDialog", this.dialogVisible, true); this.$emit("closeDialog", this.dialogVisible, true);
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment