增加 文件夹显示

master
wanghao 2 months ago
parent 83015c3e60
commit 28da293f80

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

@ -23,7 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* Controller
*
* @author wangh
* @date 2024-09-27
* @date 2024-11-11
*/
@Controller
@RequestMapping("/manage/record_inspection_img")
@ -36,6 +36,11 @@ public class RecordInspectionImgController extends BaseController
@RequiresPermissions("manage:record_inspection_img:view")
@GetMapping()
public String record_inspection_lo()
{
return prefix + "/record_inspection_location";
}
@GetMapping("/img")
public String record_inspection_img()
{
return prefix + "/record_inspection_img";
@ -44,7 +49,7 @@ public class RecordInspectionImgController extends BaseController
/**
*
*/
//@RequiresPermissions("manage:record_inspection_img:list")
@RequiresPermissions("manage:record_inspection_img:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(RecordInspectionImg recordInspectionImg)
@ -53,6 +58,15 @@ public class RecordInspectionImgController extends BaseController
List<RecordInspectionImg> list = recordInspectionImgService.selectRecordInspectionImgList(recordInspectionImg);
return getDataTable(list);
}
@RequiresPermissions("manage:record_inspection_img:list")
@PostMapping("/locationList")
@ResponseBody
public TableDataInfo locationList(RecordInspectionImg recordInspectionImg)
{
startPage();
List<RecordInspectionImg> list = recordInspectionImgService.selectRecordInspectionlocationList(recordInspectionImg);
return getDataTable(list);
}
/**
*

@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* record_inspection_img
*
* @author wangh
* @date 2024-09-27
* @date 2024-11-11
*/
public class RecordInspectionImg extends BaseEntity
{
@ -23,6 +23,10 @@ public class RecordInspectionImg extends BaseEntity
@Excel(name = "任务表id")
private Long taskId;
/** 机位码 */
@Excel(name = "机位码")
private String locationCode;
/** 路径 */
@Excel(name = "路径")
private String imgPath;
@ -45,6 +49,15 @@ public class RecordInspectionImg extends BaseEntity
{
return taskId;
}
public void setLocationCode(String locationCode)
{
this.locationCode = locationCode;
}
public String getLocationCode()
{
return locationCode;
}
public void setImgPath(String imgPath)
{
this.imgPath = imgPath;
@ -60,6 +73,7 @@ public class RecordInspectionImg extends BaseEntity
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("inspectionId", getInspectionId())
.append("taskId", getTaskId())
.append("locationCode", getLocationCode())
.append("imgPath", getImgPath())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())

@ -7,7 +7,7 @@ import org.springframework.stereotype.Repository;
* Mapper
*
* @author wangh
* @date 2024-09-27
* @date 2024-11-11
*/
@Repository
public interface RecordInspectionImgMapper
@ -59,4 +59,6 @@ public interface RecordInspectionImgMapper
* @return
*/
public int deleteRecordInspectionImgByInspectionIds(String[] inspectionIds);
List<RecordInspectionImg> selectRecordInspectionlocationList(RecordInspectionImg recordInspectionImg);
}

@ -7,7 +7,7 @@ import com.ruoyi.manage.domain.RecordInspectionImg;
* Service
*
* @author wangh
* @date 2024-09-27
* @date 2024-11-11
*/
public interface IRecordInspectionImgService
{
@ -58,4 +58,6 @@ public interface IRecordInspectionImgService
* @return
*/
public int deleteRecordInspectionImgByInspectionId(Long inspectionId);
List<RecordInspectionImg> selectRecordInspectionlocationList(RecordInspectionImg recordInspectionImg);
}

@ -16,7 +16,7 @@ import com.ruoyi.common.core.text.Convert;
* Service
*
* @author wangh
* @date 2024-09-27
* @date 2024-11-11
*/
@Service
public class RecordInspectionImgServiceImpl implements IRecordInspectionImgService {
@ -57,6 +57,7 @@ public class RecordInspectionImgServiceImpl implements IRecordInspectionImgServi
recordInspectionImg.setCreateBy(ShiroUtils.getLoginName());
recordInspectionImg.setCreateTime(DateUtils.getNowDate());
return recordInspectionImgMapper.insertRecordInspectionImg(recordInspectionImg);
@ -94,4 +95,9 @@ public class RecordInspectionImgServiceImpl implements IRecordInspectionImgServi
public int deleteRecordInspectionImgByInspectionId(Long inspectionId) {
return recordInspectionImgMapper.deleteRecordInspectionImgByInspectionId(inspectionId);
}
@Override
public List<RecordInspectionImg> selectRecordInspectionlocationList(RecordInspectionImg recordInspectionImg) {
return recordInspectionImgMapper.selectRecordInspectionlocationList( recordInspectionImg);
}
}

@ -7,13 +7,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="RecordInspectionImg" id="RecordInspectionImgResult">
<result property="inspectionId" column="inspection_id" />
<result property="taskId" column="task_id" />
<result property="locationCode" column="location_code" />
<result property="imgPath" column="img_path" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectRecordInspectionImgVo">
select inspection_id, task_id, img_path, create_by, create_time from record_inspection_img
select inspection_id, task_id, location_code, img_path, create_by, create_time from record_inspection_img
</sql>
<select id="selectRecordInspectionImgList" parameterType="RecordInspectionImg" resultMap="RecordInspectionImgResult">
@ -21,7 +22,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="inspectionId != null "> and inspection_id = #{inspectionId}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="imgPath != null and imgPath != ''"> and img_path = #{imgPath}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
</select>
@ -35,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="inspectionId != null">inspection_id,</if>
<if test="taskId != null">task_id,</if>
<if test="locationCode != null">location_code,</if>
<if test="imgPath != null">img_path,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -42,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="inspectionId != null">#{inspectionId},</if>
<if test="taskId != null">#{taskId},</if>
<if test="locationCode != null">#{locationCode},</if>
<if test="imgPath != null">#{imgPath},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -52,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update record_inspection_img
<trim prefix="SET" suffixOverrides=",">
<if test="taskId != null">task_id = #{taskId},</if>
<if test="locationCode != null">location_code = #{locationCode},</if>
<if test="imgPath != null">img_path = #{imgPath},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@ -70,4 +77,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="selectRecordInspectionlocationList" parameterType="RecordInspectionImg" resultMap="RecordInspectionImgResult">
select location_code
from record_inspection_img
<where>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
</where>
group by location_code order by location_code
</select>
</mapper>

@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增巡检历史图片')" />
<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -18,15 +19,25 @@
<input name="taskId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机位码:</label>
<div class="col-sm-8">
<input name="locationCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">路径:</label>
<div class="col-sm-8">
<input name="imgPath" class="form-control" type="text">
<input type="hidden" name="imgPath">
<div class="file-loading">
<input class="form-control file-upload" id="imgPath" name="file" type="file">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
var prefix = ctx + "manage/record_inspection_img"
$("#form-record_inspection_img-add").validate({
@ -38,6 +49,16 @@
$.operate.save(prefix + "/add", $('#form-record_inspection_img-add').serialize());
}
}
$(".file-upload").fileinput({
uploadUrl: ctx + 'common/upload',
maxFileCount: 1,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
</script>
</body>
</html>

@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改巡检历史图片')" />
<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -19,15 +20,25 @@
<input name="taskId" th:field="*{taskId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">机位码:</label>
<div class="col-sm-8">
<input name="locationCode" th:field="*{locationCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">路径:</label>
<div class="col-sm-8">
<input name="imgPath" th:field="*{imgPath}" class="form-control" type="text">
<input type="hidden" name="imgPath" th:field="*{imgPath}">
<div class="file-loading">
<input class="form-control file-upload" id="imgPath" name="file" type="file">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
var prefix = ctx + "manage/record_inspection_img";
$("#form-record_inspection_img-edit").validate({
@ -39,6 +50,22 @@
$.operate.save(prefix + "/edit", $('#form-record_inspection_img-edit').serialize());
}
}
$(".file-upload").each(function (i) {
var val = $("input[name='" + this.id + "']").val()
$(this).fileinput({
'uploadUrl': ctx + 'common/upload',
initialPreviewAsData: true,
initialPreview: [val],
maxFileCount: 1,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(this).fileinput('_initFileActions');
});
</script>
</body>
</html>

@ -19,8 +19,18 @@
<input type="text" name="taskId"/>
</li>
<li>
<label>路径:</label>
<input type="text" name="imgPath"/>
<label>机位码:</label>
<input type="text" name="locationCode"/>
</li>
<li>
<label>上传人:</label>
<input type="text" name="createBy"/>
</li>
<li class="select-time">
<label>上传时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -75,6 +85,10 @@
field: 'taskId',
title: '任务表id'
},
{
field: 'locationCode',
title: '机位码'
},
{
field: 'imgPath',
title: '路径'

@ -0,0 +1,143 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('巡检历史图片列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>机位码:</label>
<input type="text" name="locationCode"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manage:record_inspection_img:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manage:record_inspection_img:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manage:record_inspection_img:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manage:record_inspection_img:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<!-- <table id="bootstrap-table"></table>-->
<table id="bootstrap-table" data-page-size="10"
data-show-custom-view="true" data-custom-view="customViewFormatter"
data-show-custom-view-button="true"></table>
</div>
</div>
</div>
<template id="profileTemplate">
<div class="col-sm-2">
<div class="contact-box">
<a onclick="$.modal.openTab('图片详情','device/fileinfo/%locationCode%')">
<div class="col-sm-12" >
<div class="text-center">
<img alt="image" class=" m-t-xs img-responsive col-sm-12" src="/img/folder.png"
style="padding: 20%"/>
<div class="m-t-xs font-bold">%locationCode%</div>
</div>
</div>
<!-- <div class="col-sm-8">
<h3><strong>%userCode%</strong></h3>
<p><i class="fa fa-jpy"></i> %userBalance%</p>
<address>
<strong>RuoYi, Inc.</strong><br>
E-mail: %userEmail%<br>
<abbr title="Phone">Tel:</abbr> %userPhone%
</address>
</div>-->
<div class="clearfix"></div>
</a>
</div>
</div>
</template>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-table-custom-view-js"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manage:record_inspection_img:edit')}]];
var removeFlag = [[${@permission.hasPermi('manage:record_inspection_img:remove')}]];
var prefix = ctx + "manage/record_inspection_img";
$(function() {
var options = {
url: prefix + "/locationList",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "巡检历史图片",
columns: [{
checkbox: true
},
// {
// field: 'inspectionId',
// title: '巡检id'
// },
// {
// field: 'taskId',
// title: '任务表id'
// },
{
field: 'locationCode',
title: '机位码'
},
/* {
field: 'imgPath',
title: '路径'
},
{
field: 'createBy',
title: '上传人'
},
{
field: 'createTime',
title: '上传时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.inspectionId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.inspectionId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}*/]
};
$.table.init(options);
});
function customViewFormatter(data) {
var template = $('#profileTemplate').html()
var view = ''
$.each(data, function (i, row) {
view += template.replace('%locationCode%', row.locationCode)
.replace("%locationCode%", row.locationCode);
})
return `<div class="row mx-0">${view}</div>`
}
</script>
</body>
</html>
Loading…
Cancel
Save