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

查看作业-在线预览

parent 2ed5f13e
...@@ -181,12 +181,17 @@ ...@@ -181,12 +181,17 @@
> div { > div {
width: 100%; width: 100%;
.el-image { // .home_icon {
// width: 30px;
// height: 30px;
// display: block;
// margin: 0 auto;
.el-image{
width: 30px; width: 30px;
height: 30px; height: 30px;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
img { img {
width: auto; width: auto;
height: auto; height: auto;
...@@ -204,7 +209,7 @@ ...@@ -204,7 +209,7 @@
} }
.item_remove { .item_remove {
width: 40px; // width: 40px;
font-size: 12px; font-size: 12px;
color: #999999; color: #999999;
font-weight: bold; font-weight: bold;
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
// export const SERVER_WS_URL = "wss://123.56.237.167:20202"; // websocket // export const SERVER_WS_URL = "wss://123.56.237.167:20202"; // websocket
// 正式 // 正式
export const SERVER_URL = 'https://api1.testgate.cn' // 正式环境 // export const SERVER_URL = 'https://api1.testgate.cn' // 正式环境
export const DEVELOPMENT_SERVER_URL = 'https://api1.testgate.cn' // 开发环境 // export const DEVELOPMENT_SERVER_URL = 'https://api1.testgate.cn' // 开发环境
export const SERVER_WS_URL = 'wss://api1.testgate.cn' // websocket // export const SERVER_WS_URL = 'wss://api1.testgate.cn' // websocket
// 线上测试 // 线上测试
// export const SERVER_URL = "http://api.campcenter.cn/"; // 正式环境 export const SERVER_URL = "http://api.campcenter.cn/"; // 正式环境
// export const DEVELOPMENT_SERVER_URL = "http://api.campcenter.cn/"; //开发环境 export const DEVELOPMENT_SERVER_URL = "http://api.campcenter.cn/"; //开发环境
// export const SERVER_WS_URL = "ws://api.campcenter.cn"; // websocket export const SERVER_WS_URL = "ws://api.campcenter.cn"; // websocket
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<div class="homework_name flex"> <div class="homework_name flex">
<div class="work_name">{{ item.work_name }}</div> <div class="work_name">{{ item.work_name }}</div>
<span class="status_0" v-if="item.student_status == 0">未完成</span> <span class="status_0" v-if="item.student_status == 0">未完成</span>
<span class="status_1" v-if="item.student_status == 1">待评</span> <span class="status_1" v-if="item.student_status == 1">待评</span>
<span class="status_2" v-if="item.student_status == 2">已评</span> <span class="status_2" v-if="item.student_status == 2">已评</span>
</div> </div>
<el-button <el-button
class="btn_refer" class="btn_refer"
......
<template> <template>
<div>
<el-dialog <el-dialog
:title="work_name" :title="work_name"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
...@@ -83,8 +84,9 @@ ...@@ -83,8 +84,9 @@
:key="index" :key="index"
> >
<div> <div>
<el-image :src="fileImg"></el-image> <el-image class="home_icon" :src="fileImg"></el-image>
<div class="item_name">{{ item.name }}</div> <div class="item_name">{{ item.name }}</div>
<div class="flex">
<div <div
v-show="student_status == 0" v-show="student_status == 0"
class="item_remove" class="item_remove"
...@@ -92,6 +94,27 @@ ...@@ -92,6 +94,27 @@
> >
删除 删除
</div> </div>
<div
v-show="student_status == 0"
class="item_remove"
@click="handleCheck(item.url)"
>
查看作业
</div>
<!--查看作业图片 -->
<el-dialog
title="作业"
:visible.sync="dialogVisibleImage"
width="30%"
:before-close="handleImageClose"
append-to-body
>
<el-image
:src="item.url"
:preview-src-list="srcList"
></el-image>
</el-dialog>
</div>
</div> </div>
</div> </div>
...@@ -204,7 +227,10 @@ ...@@ -204,7 +227,10 @@
<div> <div>
<el-image :src="fileImg"></el-image> <el-image :src="fileImg"></el-image>
<div class="item_name">{{ item.name }}</div> <div class="item_name">{{ item.name }}</div>
<div class="item_remove" @click="downloadScoreFile(item.url)"> <div
class="item_remove"
@click="downloadScoreFile(item.url)"
>
下载 下载
</div> </div>
</div> </div>
...@@ -225,6 +251,7 @@ ...@@ -225,6 +251,7 @@
</el-form> </el-form>
</div> </div>
</el-dialog> </el-dialog>
</div>
</template> </template>
<script> <script>
...@@ -273,6 +300,7 @@ export default { ...@@ -273,6 +300,7 @@ export default {
}; };
return { return {
dialogVisibleImage: false,
referRules: { referRules: {
stu_answer: [ stu_answer: [
{ required: true, validator: validateNum, trigger: "blur" }, { required: true, validator: validateNum, trigger: "blur" },
...@@ -302,6 +330,7 @@ export default { ...@@ -302,6 +330,7 @@ export default {
// score: "", //老师评分 // score: "", //老师评分
teacher_commment: "", //老师评语 teacher_commment: "", //老师评语
tea_scoreFileList: [], //老师评语的附件 tea_scoreFileList: [], //老师评语的附件
srcList: [], //在线预览图片-放大
}; };
}, },
created() { created() {
...@@ -626,23 +655,20 @@ export default { ...@@ -626,23 +655,20 @@ export default {
if (res.data.code != 200) { if (res.data.code != 200) {
return this.$message.error(res.data.message); return this.$message.error(res.data.message);
} }
console.log(this.fileList); // console.log(this.fileList);
// console.log(this.stu_fileListoss); // console.log(this.stu_fileListoss);
this.fileList.forEach((item, idx) => { this.fileList.forEach((item, idx) => {
console.log(idx, "idx"); // console.log(idx, "idx");
// console.log(item.url == file.url); // console.log(item.url == file.url);
if (item.url == file.url) { if (item.url == file.url) {
this.fileList.splice(idx, 1); this.fileList.splice(idx, 1);
let code = this.$store.state.indexIdentity; let code = this.$store.state.indexIdentity;
window.localStorage.setItem( window.localStorage.setItem(
"student_file_" + "student_file_" +
window.localStorage.getItem("phone" + code) + window.localStorage.getItem("phone" + code) +
code, code,
JSON.stringify(this.stu_fileListoss) JSON.stringify(this.stu_fileListoss)
); );
} }
}); });
...@@ -652,7 +678,7 @@ export default { ...@@ -652,7 +678,7 @@ export default {
return item.url; return item.url;
}) })
.join(","); .join(",");
console.log(this.stu_fileListoss); // console.log(this.stu_fileListoss);
// console.log(this.fileList); // console.log(this.fileList);
this.$message.success(res.data.message); this.$message.success(res.data.message);
}); });
...@@ -665,6 +691,42 @@ export default { ...@@ -665,6 +691,42 @@ export default {
}); });
}); });
}, },
// 查看已上传的学生作业
handleCheck(url) {
console.log(url, "url");
// console.log(url.match(/\.(jpeg|jpg|gif|png)$/) != null)
// 是否为图片
if (url.match(/\.(jpeg|jpg|gif|png)$/) != null) {
this.dialogVisibleImage = true;
// console.log(url.split(" "),'111')
this.srcList = url.split(" ");
} else {
let onlineViewType = [
"doc",
"docx",
"xls",
"xlsx",
"xlsm",
"ppt",
"pptx",
];
let fileTypeName = url
.substring(url.lastIndexOf(".") + 1, url.length)
.split("?")[0];
let isWord = onlineViewType.find((type) => type === fileTypeName);
if (isWord) {
url = "http://view.officeapps.live.com/op/view.aspx?src=" + url;
}
window.open(url, "_blank");
}
},
handleImageClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
done();
})
.catch((_) => {});
},
// 提交按钮 // 提交按钮
confirm() { confirm() {
this.$confirm( this.$confirm(
...@@ -711,6 +773,9 @@ export default { ...@@ -711,6 +773,9 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
@import "a/scss/btn"; @import "a/scss/btn";
@import "a/scss/homework/refer"; @import "a/scss/homework/refer";
.flex {
display: flex;
}
</style> </style>
......
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