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

我的作业-查看作业

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