发展规划-学习路径模块 图片显示

This commit is contained in:
xusd 2024-04-30 17:59:11 +08:00
parent 1b7ea03dbf
commit b9ccd13511
3 changed files with 12 additions and 1 deletions

View File

@ -62,4 +62,6 @@ public class LearningPathInfo extends BaseEntity {
*/
private List<LearningPathCourse> learningPathCourseList;
private String photoBase;
}

View File

@ -1,9 +1,11 @@
package com.inspur.service.impl;
import java.util.Base64;
import java.util.List;
import java.util.Objects;
import cn.hutool.core.util.StrUtil;
import com.inspur.common.sftp.ISFTPServices;
import com.inspur.common.utils.DateUtils;
import com.inspur.common.utils.SecurityUtils;
import com.inspur.common.utils.StringUtils;
@ -33,6 +35,9 @@ public class LearningPathInfoServiceImpl implements ILearningPathInfoService
@Autowired
private ILearningPathCourseService learningPathCourseService;
@Autowired
private ISFTPServices sftpServices;
/**
* 查询学习路径信息
*
@ -45,6 +50,10 @@ public class LearningPathInfoServiceImpl implements ILearningPathInfoService
LearningPathInfo learningPathInfo = learningPathInfoMapper.selectLearningPathInfoById(id);
if (Objects.nonNull(learningPathInfo)){
learningPathInfo.setLearningPathCourseList(learningPathCourseService.selectLearningPathCourseByPathId(id));
if (StringUtils.isNotEmpty(learningPathInfo.getFileName())){
byte[] bytes = sftpServices.downLoadFile(learningPathInfo.getFileName());
learningPathInfo.setPhotoBase("data:image/png;base64,"+Base64.getEncoder().encodeToString(bytes));
}
}
return learningPathInfo;
}

View File

@ -361,7 +361,7 @@
</el-card>
<el-card>
<div slot="header" class="clearfix"><span>学习路径</span></div>
<!-- <img src="https://img2.baidu.com/it/u=1998428691,4088712844&fm=253&fmt=auto&app=120&f=BMP?w=753&h=500" alt="learningPathForm.fileName" width="700px" height="400px">-->
<img :src="learningPathForm.photoBase" alt="learningPathForm.fileName" width="700px" height="400px">
<el-table :data="allDiaLogSelectList">
<el-table-column label="课程名称" align="center" prop="courseName" />
<el-table-column label="课程类型" align="center" prop="typeName" />