Commit 4d4459b5 authored by 杨梦雪's avatar 杨梦雪

提交作业

parent ee95fb75
......@@ -80,9 +80,7 @@ export function getDate(fmt, dt = new Date()) {
export function timeSpan(d1, d2) {
let dateBegin = new Date(d1.replace(/-/g, "/")); //将-转化为/,使用new Date
let dateEnd = new Date(d2.replace(/-/g, "/")); //将-转化为/,使用new Date
let dateDiff = dateEnd.getTime() - dateBegin.getTime(); //时间差的毫秒数
return Math.round(dateDiff / 1000);
}
......
......@@ -121,7 +121,6 @@ function checkCam(code, cb) {
}
getCam(code).then((res) => {
let root = document.querySelector(":root");
root.style.setProperty("--color", res.data.system_color);
root.style.setProperty("--bk_pic", res.data.background_picture); //当前营地的背景图
......
......@@ -75,6 +75,7 @@
:workName="workName"
:order_nums="order_num"
:student_status="student_status"
:end_time="end_time"
@closeDialog="closeDialog"
></refer>
</div>
......@@ -105,6 +106,7 @@ export default {
workName: "",
order_num: 0,
student_status: 0,
end_time: null,
disabled: false,
};
},
......@@ -144,6 +146,11 @@ export default {
this.workName = item.work_name; //作业名字
this.order_num = item.work_num;
this.student_status = item.student_status;
//作业截止时间
let endTime = new Date((item.end_time).replace(/-/g, "/")).getTime()
let nowDate = new Date().getTime()
this.end_time = nowDate < endTime ? true : false
} else if (item.time_out == 2) {
return this.$message.error("填写作业时间未开始");
}
......@@ -171,6 +178,7 @@ export default {
});
this.isShowinfo = true;
this.total = res.data.data.count;
// this.$message.success(res.data.message);
});
},
......
......@@ -68,7 +68,7 @@
size="small"
:maxlength="300"
show-word-limit
:disabled="student_status == 1 || student_status == 2"
:disabled="is_end===false"
/>
</el-form-item>
<!-- 上传相关附件 -->
......@@ -90,6 +90,7 @@
<div class="flex">
<div
class="item_remove"
v-show="is_end===true"
@click="handleRemove(item)"
>
删除
......@@ -105,8 +106,6 @@
</div>
</div>
<!-- <div v-if="stu_fileList.length <= 0" class="img_list">-->
<!-- <div>-->
......@@ -116,7 +115,7 @@
<!-- </div>-->
<el-upload
v-if="stu_fileList.length < 10 "
ref="stu_enclosure_url"
ref="formData.stu_enclosure_url"
name="multipartFile"
action="#"
:file-list="stu_fileList"
......@@ -222,7 +221,7 @@
</div>
</div>
<el-form-item class="btn">
<el-form-item class="btn" v-show="is_end===true" 凄凄切切群群群群群群群群群群>
<el-button type="primary" v-preventReClick="1000" @click="confirm"
>提交
</el-button
......@@ -252,6 +251,7 @@
<script>
import {delPic, downloadTeacherWork, getStudentWork, PostWorkStudentOss, subStudentWork,} from "r/index/homework";
import fileImg from "@/assets/img/homework/file_img.png";
import {parseTime} from "@/common/utils";
export default {
name: "ReadForm",
......@@ -262,8 +262,9 @@
enclosure_urls: [Object, String], //老师作业地址
work_nums: [Number],
workName: [String], //作业名字
student_status: [Number], //作业状态
student_status: [Number], //作业审核状态
order_nums: [Number], //作业状态
end_time: [Boolean], //作业截止时间
},
data() {
var validateNum = (rule, value, callback) => {
......@@ -303,6 +304,7 @@
isUploading: false, // 图片上传蒙层
work_context: "", //简介
work_name: "", //作业名称
is_end: '',//是否营地截止
time_out: 1,
fileImg: fileImg,
loading: false,
......@@ -319,7 +321,7 @@
score: "", //老师评分
teacher_commment: "", //老师评语
tea_scoreFileList: [], //老师评语的附件
srcList_url_open:'',//打开的图片url_open
srcList_url_open: '',//打开的图片url_open
srcList: [], //在线预览图片-放大
fileList: [],//传给后端的url
};
......@@ -337,11 +339,7 @@
},
methods: {
open() {
console.log(this.timeOut)
console.log(this.time_out)
// console.log(this.student_status);
this.titleName = this.order_nums;
// console.log(this.student_status);
this.getTeachList();
if (this.student_status == 0) {
this.formData = {};
......@@ -428,7 +426,8 @@
this.formData.stu_answer = res.data.data.stu_answer;
// console.log(this.formData);
//学生的已经提交的相关附件
this.stu_enclosure_url = res.data.data.stu_enclosure_url;
this.formData.stu_enclosure_url = res.data.data.stu_enclosure_url;
console.log(this.formData.stu_enclosure_url)
let gotfileList = res.data.data.work;
if (gotfileList) {
this.stu_fileList = gotfileList.map((item) => {
......@@ -479,6 +478,7 @@
}
this.$forceUpdate(); //强制刷新
}
});
},
......@@ -687,7 +687,7 @@
this.dialogVisibleImage = true;
console.log(url.split(" "), '111')
// this.srcList = url.split(" ");
this.srcList_url_open =url
this.srcList_url_open = url
this.srcList = this.stu_fileList.map((item) => {
return item.url_open
})
......@@ -724,8 +724,8 @@
// 未完成
notReadHandle() {
this.formData.teacher_id = this.work_nums;
// console.log(this.fileList)
this.formData.stu_enclosure_url = this.fileList.map((item) => {
console.log(this.stu_fileList)
this.formData.stu_enclosure_url = this.stu_fileList.map((item) => {
return item.url_open;
})
.join(",");
......@@ -755,7 +755,7 @@
return this.$message.success('请上传相关附件再提交')
}
this.$confirm(
"提交后不可以填写其他作业,但在截止日期前仍可以修改本次作业,江毅最后一次提交的为准。您确认要提交本次作业吗?",
"提交后不可以填写其他作业,但在截止日期前仍可以修改本次作业,将以最后一次提交的为准。您确认要提交本次作业吗?",
"提示",
{
confirmButtonText: "确定",
......@@ -796,6 +796,10 @@
this.time_out = this.timeOut;
console.log(this.time_out, "timeout");
},
end_time() {
this.is_end = this.end_time;
console.log(this.is_end, "is_end");
},
},
};
</script>
......
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