课程笔记含有图片支持图片放大。

This commit is contained in:
weinan2087
2022-10-22 10:58:35 +08:00
parent e73fe4bfe2
commit 5c2671470a

View File

@@ -6,7 +6,7 @@
<el-dropdown style="margin-left:15px" @command="exportCommand"> <el-dropdown style="margin-left:15px" @command="exportCommand">
<el-button>导出<i class="el-icon-arrow-down el-icon--right"></i></el-button> <el-button>导出<i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<!-- <!--
<el-dropdown-item command="1">PDF</el-dropdown-item> <el-dropdown-item command="1">PDF</el-dropdown-item>
--> -->
<el-dropdown-item command="2">Excel</el-dropdown-item> <el-dropdown-item command="2">Excel</el-dropdown-item>
@@ -72,7 +72,7 @@
<span v-if="item.contentType != 3">{{ item.content }}</span> <span v-if="item.contentType != 3">{{ item.content }}</span>
<div v-else> <div v-else>
<template v-for="img in item.content"> <template v-for="img in item.content">
<img :src="fileBaseUrl + img" alt=""/> <img @click="showBigImg(fileBaseUrl + img)" :src="fileBaseUrl + img" alt=""/>
</template> </template>
</div> </div>
</div> </div>
@@ -167,6 +167,14 @@
</span> </span>
</el-dialog> </el-dialog>
<!-- 图片放大框 -->
<el-dialog
:visible.sync="dialogVisibleBigImage"
:close-on-click-modal="true"
width="30%">
<img :src="currentImagePath" style="width: 100%;" />
</el-dialog>
</div> </div>
</template> </template>
@@ -186,6 +194,8 @@ export default {
}, },
data(){ data(){
return{ return{
dialogVisibleBigImage:false, // 显示图片放大框 true-显示弹框false-隐藏弹框
currentImagePath:'',
userData:{}, userData:{},
formatDate, formatDate,
formatDateShort, formatDateShort,
@@ -254,6 +264,12 @@ export default {
}); });
}, },
methods: { methods: {
// 笔记图片放大
showBigImg(path){
this.currentImagePath = path;
this.dialogVisibleBigImage = true;
},
routerTo(item) { routerTo(item) {
if(item.courseId) { if(item.courseId) {
this.$router.push('/course/studyindex?id='+item.courseId); this.$router.push('/course/studyindex?id='+item.courseId);