diff --git a/src/main/java/com/bonus/imgTool/backstage/controller/SynthesisQueryController.java b/src/main/java/com/bonus/imgTool/backstage/controller/SynthesisQueryController.java index 46fe3ca..2237e8f 100644 --- a/src/main/java/com/bonus/imgTool/backstage/controller/SynthesisQueryController.java +++ b/src/main/java/com/bonus/imgTool/backstage/controller/SynthesisQueryController.java @@ -112,4 +112,11 @@ public class SynthesisQueryController { return synthesisQueryService.getListData(data.getData()); } + @ApiOperation("影像上传-查看图片") + @PostMapping(value = "getPhotoImgList") + @DecryptAndVerify(decryptedClass = QueryParamDto.class) + public ServerResponse getPhotoImgList(EncryptedReq data) { + return synthesisQueryService.getPhotoImgList(data.getData()); + } + } diff --git a/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java b/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java index 75f9030..0eac842 100644 --- a/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java +++ b/src/main/java/com/bonus/imgTool/backstage/dao/SynthesisQueryDao.java @@ -160,4 +160,11 @@ public interface SynthesisQueryDao { * @date 2025/4/8 16:40 */ void updateTaskDownload(@Param("params") DownloadTaskVo taskVo,@Param("nowTime") String nowTime); + + /** + * 影像上传-查看图片 + * @param dto + * @return + */ + List getPhotoImgList(QueryParamDto dto); } diff --git a/src/main/java/com/bonus/imgTool/backstage/entity/QueryParamDto.java b/src/main/java/com/bonus/imgTool/backstage/entity/QueryParamDto.java index 6ce9f84..44a70b0 100644 --- a/src/main/java/com/bonus/imgTool/backstage/entity/QueryParamDto.java +++ b/src/main/java/com/bonus/imgTool/backstage/entity/QueryParamDto.java @@ -46,6 +46,11 @@ public class QueryParamDto { */ private String uploadType; + /** + * 上传类型 + */ + private String sourceType; + /**关键字*/ private String keyWord; /**工程ID*/ diff --git a/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java b/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java index 7b198c3..04c691b 100644 --- a/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java +++ b/src/main/java/com/bonus/imgTool/backstage/service/SynthesisQueryService.java @@ -100,4 +100,11 @@ public interface SynthesisQueryService { * @date 2025/4/3 16:27 */ ServerResponse getListData(QueryParamDto data); + + /** + * 影像上传-查看图片 + * @param data + * @return + */ + ServerResponse getPhotoImgList(QueryParamDto data); } diff --git a/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java b/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java index 0349120..f27dc83 100644 --- a/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java +++ b/src/main/java/com/bonus/imgTool/backstage/service/impl/SynthesisQueryServiceImpl.java @@ -236,6 +236,24 @@ public class SynthesisQueryServiceImpl implements SynthesisQueryService { } + /** + * 影像上传-查看图片 + * @param data + * @return + */ + @Override + public ServerResponse getPhotoImgList(QueryParamDto data) { + PageHelper.startPage(data.getPageNum(), data.getPageSize()); + try { + List list = Optional.ofNullable(synthesisQueryDao.getPhotoImgList(data)).orElseGet(ArrayList::new); + PageInfo pageInfo = new PageInfo<>(list); + return ServerResponse.createSuccess(pageInfo); + } catch (Exception e) { + log.error(e.toString(), e); + return ServerResponse.createErroe("查询失败"); + } + } + /** * 查询图片上传类型:1.安全违章、2.质量检查、3.安全措施落实、4.协调照片、5.重要事项及宣传 * @param detailVo diff --git a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml index e9d06a7..548430a 100644 --- a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml +++ b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml @@ -487,6 +487,33 @@ ) A ON A.dict_value = sfr.source_type WHERE tcq.pro_id = #{proId} AND tcq.is_active = '1' AND sfr.watermark_file_path IS NULL + + @@ -525,13 +552,12 @@ build_under_desc = #{buildUnderDesc}, build_after_desc = #{buildAfterDesc}, title = #{title}, - upload_type = #{uploadType}, build_after_desc = #{buildAfterDesc}, update_user_id = #{updateUserId}, update_user_name = #{updateUserName}, update_time = NOW() - where id = #{id} + where id = #{id} and upload_type = #{uploadType} diff --git a/src/main/resources/static/js/imageUpload/coordinatePhoto/coordinatePhotoList.js b/src/main/resources/static/js/imageUpload/coordinatePhoto/coordinatePhotoList.js index 21da0e1..207cc73 100644 --- a/src/main/resources/static/js/imageUpload/coordinatePhoto/coordinatePhotoList.js +++ b/src/main/resources/static/js/imageUpload/coordinatePhoto/coordinatePhotoList.js @@ -90,9 +90,9 @@ function initTable(dataList, limit, page) { let afterCount = countPhotosBySourceType(d, "8"); let html = ''; - html += "" + beforeCount + "

"; - html += "" + inProgressCount + "

"; - html += "" + afterCount + ""; + html += "" + beforeCount + "

"; + html += "" + inProgressCount + "

"; + html += "" + afterCount + ""; return html; } }, @@ -298,17 +298,11 @@ function setSelectValue(list, selectName, placeholder) { * 违规照片 * @param id */ -function violationPhoto(id){ - alert(id) +function violationPhoto(obj,type){ + obj.sourceType = type; + openIframeByParamObj("viewImg", "图片详情", "../photoView.html", "92%", "85%", obj); } -/** - * 修正照片 - * @param id - */ -function correctionPhoto(id){ - alert(id) -} function exportExcel() { let obj = { diff --git a/src/main/resources/static/js/imageUpload/importantMatter/importantMatterList.js b/src/main/resources/static/js/imageUpload/importantMatter/importantMatterList.js index bde0f95..18dba75 100644 --- a/src/main/resources/static/js/imageUpload/importantMatter/importantMatterList.js +++ b/src/main/resources/static/js/imageUpload/importantMatter/importantMatterList.js @@ -76,7 +76,7 @@ function initTable(dataList, limit, page) { {field: "content", title: "内容",width: 310, unresize: true, align: "center"}, {field: "", title: "照片",width: 150, unresize: true, align: "center", templet: function (d) { - let html=""+d.sysFileResourceList.length+""; + let html=""+d.sysFileResourceList.length+""; return html; } }, @@ -277,8 +277,9 @@ function setSelectValue(list, selectName, placeholder) { * 违规照片 * @param id */ -function violationPhoto(id){ - alert(id) +function violationPhoto(obj){ + obj.sourceType = "9"; + openIframeByParamObj("viewImg", "图片详情", "../photoView.html", "92%", "85%", obj); } function exportExcel() { diff --git a/src/main/resources/static/js/imageUpload/photoView.js b/src/main/resources/static/js/imageUpload/photoView.js new file mode 100644 index 0000000..ac33a77 --- /dev/null +++ b/src/main/resources/static/js/imageUpload/photoView.js @@ -0,0 +1,136 @@ +let form, laydate, flow,layer; +let pageNum = 1, pageSize = 20; // 定义分页 +let objParams = {}; +function setParams(obj){ + objParams = JSON.parse(obj); + layui.config({ + base: "../../js/layui-v2.9.14/layui/", //此处路径请自行处理, 可以使用绝对路径 + }).extend({ + rightPopup: "rightPopup", + }).use(["form", 'laydate', 'flow','layer'], function () { + form = layui.form; + laydate = layui.laydate; + flow = layui.flow; + layer = layui.layer; + dataFlow(); + }); +} + +/**数据流加载*/ +function dataFlow() { + flow.load({ + elem: '#ID-flow-demo', // 流加载容器 + scrollElem: '#ID-flow-demo', // 滚动条所在元素,一般不用填,此处只是演示需要。 + end: '数据加载完毕', + direction: 'bottom', + done: function (page, next) { // 执行下一页的回调 + console.error(page); + pageNum = page; + let lis = []; + let returnData = loadData(); + if (returnData != null) { + lis = initImgData(returnData.data.list) + next(lis.join(''), page < returnData.data.total / 15); + $('.img-info2').on('mouseenter', function () { + this.querySelector('.hidden-actions3').style.display = 'block'; + }); + $('.img-info2').on('mouseleave', function () { + this.querySelector('.hidden-actions3').style.display = 'none'; + }); + } + } + }); +} + +/**加载图片数据*/ +function loadData() { + let returnData = null; + let url = dataUrl + "/backstage/synthesisQuery/getPhotoImgList" + let obj = { + pageNum: pageNum, + pageSize: pageSize, + id:objParams.id, + sourceType: objParams.sourceType + } + let params = { + encryptedData: encryptCBC(JSON.stringify(obj)) + } + ajaxRequest(url, "POST", params, false, function () { + }, function (result) { + if (result.status === 200) { + console.log(result) + returnData = result; + } else { + layer.msg(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); + return returnData; +} + +/**渲染图片*/ +function initImgData(list) { + let htmlArr = []; + if (list && list.length > 0) { + $.each(list, function (index, item) { + let filePath = imgUrl + item.compressFilePath + "?token=" + tokens + htmlArr.push("
" + + "
\n" + + " " + + "
" + + "
" + + "
" + + "
" + + "
" + + // setCollectImg(item) + + "
" + + "
"); + }) + } + return htmlArr; + + + // 设置收藏按钮 + function setCollectImg(item) { + if (item.collectStatus === '0') { + return "
" + + ""; + } else { + return "" + + "
"; + } + } + +} + +/**收藏*/ +function collectImg(that, item, type) { + if (type === 0) { // 收藏 + let flag = collectData({ + collectType: 1, + id: item.id + }); + if (flag) { + $(that).next().removeAttr("style"); + $(that).css({'display': 'none'}) + layer.msg("收藏成功",{icon:1}) + }else{ + layer.msg("收藏失败",{icon:2}) + } + + } else if (type === 1) { // 取消收藏 + let flag = collectData({ + collectType: 2, + id: item.id + }); + if (flag) { + $(that).prev().removeAttr("style"); + $(that).css({'display': 'none'}); + layer.msg("取消收藏成功",{icon:1}) + }else{ + layer.msg("取消收藏失败",{icon:2}) + } + } +} + diff --git a/src/main/resources/static/js/imageUpload/qualityInspection/qualityInspectionList.js b/src/main/resources/static/js/imageUpload/qualityInspection/qualityInspectionList.js index ca9d8ce..658147b 100644 --- a/src/main/resources/static/js/imageUpload/qualityInspection/qualityInspectionList.js +++ b/src/main/resources/static/js/imageUpload/qualityInspection/qualityInspectionList.js @@ -77,7 +77,7 @@ function initTable(dataList, limit, page) { {field: "vioDesc", title: "检查描述",width: 110, unresize: true, align: "center"}, {field: "", title: "缺陷问题照片",width: 150, unresize: true, align: "center", templet: function (d) { - let html=""+d.vioPhotoNum+""; + let html=""+d.vioPhotoNum+""; return html; } }, @@ -101,7 +101,7 @@ function initTable(dataList, limit, page) { }, {field: "", title: "整改照片",width: 110, unresize: true, align: "center", templet: function (d) { - let html=""+d.rectPhotoNum+""; + let html=""+d.rectPhotoNum+""; return html; } }, @@ -324,16 +324,18 @@ function setSelectValue(list, selectName, placeholder) { * 违规照片 * @param id */ -function violationPhoto(id){ - alert(id) +function violationPhoto(obj){ + obj.sourceType = "3"; + openIframeByParamObj("viewImg", "图片详情", "../photoView.html", "92%", "85%", obj); } /** * 修正照片 * @param id */ -function correctionPhoto(id){ - alert(id) +function correctionPhoto(obj){ + obj.sourceType = "4"; + openIframeByParamObj("viewImg", "图片详情", "../photoView.html", "92%", "85%", obj); } function exportExcel() { diff --git a/src/main/resources/static/js/imageUpload/safetyMeasure/safetyMeasureList.js b/src/main/resources/static/js/imageUpload/safetyMeasure/safetyMeasureList.js index 12c2485..ca92ecb 100644 --- a/src/main/resources/static/js/imageUpload/safetyMeasure/safetyMeasureList.js +++ b/src/main/resources/static/js/imageUpload/safetyMeasure/safetyMeasureList.js @@ -76,7 +76,7 @@ function initTable(dataList, limit, page) { {field: "checkDesc", title: "问题描述",width: 310, unresize: true, align: "center"}, {field: "", title: "现场照片",width: 150, unresize: true, align: "center", templet: function (d) { - let html=""+d.sysFileResourceList.length+""; + let html=""+d.sysFileResourceList.length+""; return html; } }, @@ -278,8 +278,9 @@ function setSelectValue(list, selectName, placeholder) { * 违规照片 * @param id */ -function violationPhoto(id){ - alert(id) +function violationPhoto(obj){ + obj.sourceType = "5"; + openIframeByParamObj("viewImg", "图片详情", "../photoView.html", "92%", "85%", obj); } function exportExcel() { diff --git a/src/main/resources/static/js/imageUpload/safetyViolations/safetyViolationsList.js b/src/main/resources/static/js/imageUpload/safetyViolations/safetyViolationsList.js index eba0b75..91dfc63 100644 --- a/src/main/resources/static/js/imageUpload/safetyViolations/safetyViolationsList.js +++ b/src/main/resources/static/js/imageUpload/safetyViolations/safetyViolationsList.js @@ -76,7 +76,7 @@ function initTable(dataList, limit, page) { {field: "vioDesc", title: "违章描述",width: 110, unresize: true, align: "center"}, {field: "", title: "违章照片",width: 110, unresize: true, align: "center", templet: function (d) { - let html=""+d.vioPhotoNum+""; + let html=""+d.vioPhotoNum+""; return html; } }, @@ -100,7 +100,7 @@ function initTable(dataList, limit, page) { }, {field: "", title: "整改照片",width: 110, unresize: true, align: "center", templet: function (d) { - let html=""+d.rectPhotoNum+""; + let html=""+d.rectPhotoNum+""; return html; } }, @@ -322,18 +322,20 @@ function setSelectValue(list, selectName, placeholder) { /** * 违规照片 - * @param id + * @param d */ -function violationPhoto(id){ - alert(id) +function violationPhoto(obj){ + obj.sourceType = "1"; + openIframeByParamObj("viewImg", "图片详情", "../photoView.html", "92%", "85%", obj); } /** * 修正照片 * @param id */ -function correctionPhoto(id){ - alert(id) +function correctionPhoto(obj){ + obj.sourceType = "2"; + openIframeByParamObj("viewImg", "图片详情", "../photoView.html", "92%", "85%", obj); } function exportExcel() { diff --git a/src/main/resources/static/pages/imageUpload/photoView.html b/src/main/resources/static/pages/imageUpload/photoView.html new file mode 100644 index 0000000..e3f3b4a --- /dev/null +++ b/src/main/resources/static/pages/imageUpload/photoView.html @@ -0,0 +1,27 @@ + + + + + 图片预览 + + + + + + + + + + + + +
+
+ +
+
+ + + + + \ No newline at end of file