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

我的作业-查看作业

parent e383d507
...@@ -100,22 +100,13 @@ ...@@ -100,22 +100,13 @@
> >
查看作业 查看作业
</div> </div>
<!--查看作业图片 -->
<el-dialog
title="作业"
:visible.sync="dialogVisibleImage"
width="30%"
:before-close="handleImageClose"
append-to-body
>
<el-image
:lazy='true'
:src="item.url_open"
:preview-src-list="srcList"
></el-image>
</el-dialog>
</div> </div>
</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>-->
...@@ -240,7 +231,22 @@ ...@@ -240,7 +231,22 @@
</el-form> </el-form>
</div> </div>
</el-dialog> </el-dialog>
<!--查看作业图片 -->
<el-dialog
title="作业"
:visible.sync="dialogVisibleImage"
width="30%"
:before-close="handleImageClose"
append-to-body
>
<el-image
:lazy='true'
:src="srcList_url_open"
:preview-src-list="srcList"
></el-image>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -283,6 +289,7 @@ ...@@ -283,6 +289,7 @@
} }
}; };
return { return {
dialogVisible: this.dialogVisibleFu,
dialogVisibleImage: false, dialogVisibleImage: false,
referRules: { referRules: {
stu_answer: [ stu_answer: [
...@@ -299,8 +306,6 @@ ...@@ -299,8 +306,6 @@
time_out: 1, time_out: 1,
fileImg: fileImg, fileImg: fileImg,
loading: false, loading: false,
dialogVisible: this.dialogVisibleFu,
dialogVisibleimage: false,
formData: { formData: {
teacher_id: "", teacher_id: "",
stu_answer: "", stu_answer: "",
...@@ -314,6 +319,7 @@ ...@@ -314,6 +319,7 @@
score: "", //老师评分 score: "", //老师评分
teacher_commment: "", //老师评语 teacher_commment: "", //老师评语
tea_scoreFileList: [], //老师评语的附件 tea_scoreFileList: [], //老师评语的附件
srcList_url_open:'',//打开的图片url_open
srcList: [], //在线预览图片-放大 srcList: [], //在线预览图片-放大
fileList: [],//传给后端的url fileList: [],//传给后端的url
}; };
...@@ -674,12 +680,17 @@ ...@@ -674,12 +680,17 @@
// 查看已上传的学生作业 // 查看已上传的学生作业
handleCheck(url) { handleCheck(url) {
console.log(url, "url"); console.log(url, "url");
console.log(this.srcList, "fileList");
// console.log(url.match(/\.(jpeg|jpg|gif|png)$/) != null) // console.log(url.match(/\.(jpeg|jpg|gif|png)$/) != null)
// 是否为图片 // 是否为图片
if (url.match(/\.(jpeg|jpg|gif|png)$/) != null) { if (url.match(/\.(jpeg|jpg|gif|png)$/) != null) {
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 = this.stu_fileList.map((item) => {
return item.url_open
})
} else { } else {
let onlineViewType = [ let onlineViewType = [
"doc", "doc",
...@@ -699,7 +710,8 @@ ...@@ -699,7 +710,8 @@
} }
window.open(url, "_blank"); window.open(url, "_blank");
} }
}, }
,
handleImageClose(done) { handleImageClose(done) {
this.$confirm("确认关闭?") this.$confirm("确认关闭?")
.then((_) => { .then((_) => {
...@@ -707,7 +719,8 @@ ...@@ -707,7 +719,8 @@
}) })
.catch((_) => { .catch((_) => {
}); });
}, }
,
// 未完成 // 未完成
notReadHandle() { notReadHandle() {
this.formData.teacher_id = this.work_nums; this.formData.teacher_id = this.work_nums;
...@@ -734,7 +747,8 @@ ...@@ -734,7 +747,8 @@
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
}); });
}, }
,
// 提交按钮 // 提交按钮
confirm() { confirm() {
if (this.stu_fileList.length == 0) { if (this.stu_fileList.length == 0) {
...@@ -764,7 +778,8 @@ ...@@ -764,7 +778,8 @@
message: "已取消", message: "已取消",
}); });
}); });
}, }
,
}, },
watch: { watch: {
......
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