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

提交作业

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