1 实现过程
在上个练习记录帖的“测试管理”菜单中加入图片信息,使用了若依自带的com.ruoyi.project.common类中的uploadFile方法。实现过程:
- 在数据库sys_test表中添加条目test_pic记录图片的路径
- 在xml文件中加入映射
- 在实体类test.java中加入声明:
/**测试图片*/
@Excel(name = "测试图片")
private String testPic;
public String getTestPic() {
return testPic; }
public void setTestPic(String testPic) {
this.testPic = testPic; }
//最后在toString()中添加testPic
- 在test.html中加入field(这里代码有错,后文改):
{
field: 'testPic',
title: '测试图片',
formatter: function(value, row, index) {
return '<img src=">' + value + '<" width="90" height="90" >';
}
},
- 在add和edit中加入页面设置:
<div class