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

查看作业-在线预览

parent 2ed5f13e
......@@ -181,12 +181,17 @@
> div {
width: 100%;
.el-image {
// .home_icon {
// width: 30px;
// height: 30px;
// display: block;
// margin: 0 auto;
.el-image{
width: 30px;
height: 30px;
display: block;
margin: 0 auto;
img {
width: auto;
height: auto;
......@@ -204,7 +209,7 @@
}
.item_remove {
width: 40px;
// width: 40px;
font-size: 12px;
color: #999999;
font-weight: bold;
......
......@@ -7,10 +7,10 @@
// export const SERVER_WS_URL = "wss://123.56.237.167:20202"; // websocket
// 正式
export const 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_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_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_URL = "http://api.campcenter.cn/"; // 正式环境
export const DEVELOPMENT_SERVER_URL = "http://api.campcenter.cn/"; //开发环境
export const SERVER_WS_URL = "ws://api.campcenter.cn"; // websocket
......@@ -16,8 +16,8 @@
<div class="homework_name flex">
<div class="work_name">{{ item.work_name }}</div>
<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_2" v-if="item.student_status == 2">已评</span>
<span class="status_1" v-if="item.student_status == 1">待评</span>
<span class="status_2" v-if="item.student_status == 2">已评</span>
</div>
<el-button
class="btn_refer"
......
<template>
<div>
<el-dialog
:title="work_name"
:visible.sync="dialogVisible"
......@@ -83,8 +84,9 @@
:key="index"
>
<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="flex">
<div
v-show="student_status == 0"
class="item_remove"
......@@ -92,6 +94,27 @@
>
删除
</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>
......@@ -204,7 +227,10 @@
<div>
<el-image :src="fileImg"></el-image>
<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>
......@@ -225,6 +251,7 @@
</el-form>
</div>
</el-dialog>
</div>
</template>
<script>
......@@ -273,6 +300,7 @@ export default {
};
return {
dialogVisibleImage: false,
referRules: {
stu_answer: [
{ required: true, validator: validateNum, trigger: "blur" },
......@@ -302,6 +330,7 @@ export default {
// score: "", //老师评分
teacher_commment: "", //老师评语
tea_scoreFileList: [], //老师评语的附件
srcList: [], //在线预览图片-放大
};
},
created() {
......@@ -626,23 +655,20 @@ export default {
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
console.log(this.fileList);
// console.log(this.fileList);
// console.log(this.stu_fileListoss);
this.fileList.forEach((item, idx) => {
console.log(idx, "idx");
// console.log(idx, "idx");
// console.log(item.url == file.url);
if (item.url == file.url) {
this.fileList.splice(idx, 1);
let code = this.$store.state.indexIdentity;
window.localStorage.setItem(
"student_file_" +
window.localStorage.getItem("phone" + code) +
code,
JSON.stringify(this.stu_fileListoss)
);
}
});
......@@ -652,7 +678,7 @@ export default {
return item.url;
})
.join(",");
console.log(this.stu_fileListoss);
// console.log(this.stu_fileListoss);
// console.log(this.fileList);
this.$message.success(res.data.message);
});
......@@ -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() {
this.$confirm(
......@@ -711,6 +773,9 @@ export default {
<style scoped lang="scss">
@import "a/scss/btn";
@import "a/scss/homework/refer";
.flex {
display: flex;
}
</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