From 8f860f53c3c62c645f33018291d82266dd43a578 Mon Sep 17 00:00:00 2001 From: 16639036659 <577530412@qq.com> Date: 星期五, 25 八月 2023 09:49:11 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/delayDangerRectify.html | 107 +++++++++++++ src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotDanger.html | 12 src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/detailDangerAccept.html | 63 +++++++ src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/detailDangerRectify.html | 63 +++++++ src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/editDangerRectify.html | 37 ++++ src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailYesDanger.html | 4 src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/editDangerAccept.html | 63 +++++++ src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotJudge.html | 4 src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/dangerRectify.html | 7 src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/editDangerExamine.html | 37 ++++ src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/detailDangerExamine.html | 37 ++++ 11 files changed, 415 insertions(+), 19 deletions(-) diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/detailDangerAccept.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/detailDangerAccept.html index a647f0c..3cca9a5 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/detailDangerAccept.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/detailDangerAccept.html @@ -177,11 +177,18 @@ <div class="form-group"> <label class="col-sm-4 control-label ">隐患视图:</label> <div class="col-sm-8"> - <img style="width: 100px; height: 100px;cursor:pointer;" +<!-- <img style="width: 100px; height: 100px;cursor:pointer;"--> +<!-- title="查看图片"--> +<!-- th:src="*{preRectifyPhoto}"--> +<!-- onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')"--> +<!-- th:data-id="${hdcp.id}">--> + <img style="width: 100px; height: 100px;cursor:pointer;display: none" title="查看图片" + class="allPics1" th:src="*{preRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')" th:data-id="${hdcp.id}"> + <div class="image-container1" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -341,11 +348,18 @@ <div class="col-sm-6"> <label class="col-sm-4 control-label ">隐患整改后视图:</label> <div class="col-sm-8"> - <img style="width: 100px; height: 100px;cursor:pointer;" +<!-- <img style="width: 100px; height: 100px;cursor:pointer;"--> +<!-- title="查看图片"--> +<!-- th:src="*{postRectifyPhoto}"--> +<!-- onclick="showPicture(this.getAttribute('data-id'),'postRectifyPhoto')"--> +<!-- th:data-id="${hdcp.id}">--> + <img style="width: 100px; height: 100px;cursor:pointer;display: none" title="查看图片" + class="allPics2" th:src="*{postRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'postRectifyPhoto')" th:data-id="${hdcp.id}"> + <div class="image-container2" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -418,6 +432,51 @@ <th:block th:include="include :: footer"/> <th:block th:include="include :: jquery-steps-js"/> <script type="text/javascript"> + $(document).ready(function () { + var imgsUrl1 = $('.allPics1'); + var imageUrls1 = imgsUrl1.attr('src') + var ids = imgsUrl1.attr('data-id') + var imageContainer1 = document.querySelector('.image-container1'); + // 将逗号分隔的字符串拆分为URL数组 + var imageUrlArray1 = imageUrls1.split(','); + // 遍历URL数组并创建img元素 + imageUrlArray1.forEach(function(url, index) { + var img = document.createElement('img'); + img.setAttribute('src', url); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); + img.setAttribute('title', '查看图片'); + img.setAttribute('data-id', ids); + img.addEventListener('click', function() { + // showPicture(this.getAttribute('data-id'), 'preRectifyPhoto'); + openPicture(url) + }); + imageContainer1.appendChild(img); + }); + + var imgsUrl2 = $('.allPics2'); + var imageUrls2 = imgsUrl2.attr('src') + var imageContainer2 = document.querySelector('.image-container2'); + // 将逗号分隔的字符串拆分为URL数组 + var imageUrlArray2 = imageUrls2.split(','); + // 遍历URL数组并创建img元素 + imageUrlArray2.forEach(function(url, index) { + var img = document.createElement('img'); + img.setAttribute('src', url); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); + img.setAttribute('title', '查看图片'); + img.setAttribute('data-id', ids); + img.addEventListener('click', function() { + // showPicture(this.getAttribute('data-id'), 'preRectifyPhoto'); + openPicture(url) + }); + imageContainer2.appendChild(img); + }); + }); + + function openPicture(url) { + window.open(url) + } + /* 图片--查看 */ function showPicture(id,type) { var showPictureUrl = "/tr/hiddenDangerCheck/dangerBase/showPicture/{type}/{id}"; diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/editDangerAccept.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/editDangerAccept.html index b22e534..32325db 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/editDangerAccept.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerAccept/editDangerAccept.html @@ -182,11 +182,18 @@ <div class="form-group"> <label class="col-sm-4 control-label ">隐患视图:</label> <div class="col-sm-8"> - <img style="width: 100px; height: 100px;cursor:pointer;" +<!-- <img style="width: 100px; height: 100px;cursor:pointer;"--> +<!-- title="查看图片"--> +<!-- th:src="*{preRectifyPhoto}"--> +<!-- onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')"--> +<!-- th:data-id="${hdcp.id}">--> + <img style="width: 100px; height: 100px;cursor:pointer;display: none" title="查看图片" + class="allPics1" th:src="*{preRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')" th:data-id="${hdcp.id}"> + <div class="image-container1" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -346,11 +353,18 @@ <label class="col-sm-4 control-label ">隐患整改后视图:</label> <div class="col-sm-8"> <div class="col-sm-8"> - <img style="width: 100px; height: 100px;cursor:pointer;" +<!-- <img style="width: 100px; height: 100px;cursor:pointer;"--> +<!-- title="查看图片"--> +<!-- th:src="*{postRectifyPhoto}"--> +<!-- onclick="showPicture(this.getAttribute('data-id'),'postRectifyPhoto')"--> +<!-- th:data-id="${hdcp.id}">--> + <img style="width: 100px; height: 100px;cursor:pointer;display: none" title="查看图片" + class="allPics2" th:src="*{postRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'postRectifyPhoto')" th:data-id="${hdcp.id}"> + <div class="image-container2" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -406,6 +420,51 @@ <th:block th:include="include :: jasny-bootstrap-js"/> <th:block th:include="include :: jquery-steps-js"/> <script type="text/javascript"> + $(document).ready(function () { + var imgsUrl1 = $('.allPics1'); + var imageUrls1 = imgsUrl1.attr('src') + var ids = imgsUrl1.attr('data-id') + var imageContainer1 = document.querySelector('.image-container1'); + // 将逗号分隔的字符串拆分为URL数组 + var imageUrlArray1 = imageUrls1.split(','); + // 遍历URL数组并创建img元素 + imageUrlArray1.forEach(function(url, index) { + var img = document.createElement('img'); + img.setAttribute('src', url); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); + img.setAttribute('title', '查看图片'); + img.setAttribute('data-id', ids); + img.addEventListener('click', function() { + // showPicture(this.getAttribute('data-id'), 'preRectifyPhoto'); + openPicture(url) + }); + imageContainer1.appendChild(img); + }); + + var imgsUrl2 = $('.allPics2'); + var imageUrls2 = imgsUrl2.attr('src') + var imageContainer2 = document.querySelector('.image-container2'); + // 将逗号分隔的字符串拆分为URL数组 + var imageUrlArray2 = imageUrls2.split(','); + // 遍历URL数组并创建img元素 + imageUrlArray2.forEach(function(url, index) { + var img = document.createElement('img'); + img.setAttribute('src', url); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); + img.setAttribute('title', '查看图片'); + img.setAttribute('data-id', ids); + img.addEventListener('click', function() { + // showPicture(this.getAttribute('data-id'), 'preRectifyPhoto'); + openPicture(url) + }); + imageContainer2.appendChild(img); + }); + }); + + function openPicture(url) { + window.open(url) + } + /* 图片--查看 */ function showPicture(id,type) { var showPictureUrl = "/tr/hiddenDangerCheck/dangerBase/showPicture/{type}/{id}"; diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/detailDangerExamine.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/detailDangerExamine.html index f9a646f..73775fe 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/detailDangerExamine.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/detailDangerExamine.html @@ -174,11 +174,18 @@ <div class="form-group"> <label class="col-sm-4 control-label ">隐患视图:</label> <div class="col-sm-8"> - <img style="width: 100px; height: 100px;cursor:pointer;" +<!-- <img style="width: 100px; height: 100px;cursor:pointer;"--> +<!-- title="查看图片"--> +<!-- th:src="*{preRectifyPhoto}"--> +<!-- onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')"--> +<!-- th:data-id="${hdcp.id}">--> + <img style="width: 100px; height: 100px;cursor:pointer;display: none" title="查看图片" + class="allPics" th:src="*{preRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')" th:data-id="${hdcp.id}"> + <div class="image-container" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -290,6 +297,34 @@ <th:block th:include="include :: jquery-steps-js"/> <script type="text/javascript"> + $(document).ready(function () { + var imgsUrl = $('.allPics'); + var imageUrls = imgsUrl.attr('src') + var ids = imgsUrl.attr('data-id') + var imageContainer = document.querySelector('.image-container'); + + // 将逗号分隔的字符串拆分为URL数组 + var imageUrlArray = imageUrls.split(','); + + // 遍历URL数组并创建img元素 + imageUrlArray.forEach(function(url, index) { + var img = document.createElement('img'); + img.setAttribute('src', url); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); + img.setAttribute('title', '查看图片'); + img.setAttribute('data-id', ids); + img.addEventListener('click', function() { + // showPicture(this.getAttribute('data-id'), 'preRectifyPhoto'); + openPicture(url) + }); + imageContainer.appendChild(img); + }); + }); + + function openPicture(url) { + window.open(url) + } + /* 图片--查看 */ function showPicture(id,type) { var showPictureUrl = "/tr/hiddenDangerCheck/dangerBase/showPicture/{type}/{id}"; diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/editDangerExamine.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/editDangerExamine.html index ebc4590..d02b036 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/editDangerExamine.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerExamine/editDangerExamine.html @@ -179,11 +179,18 @@ <div class="form-group"> <label class="col-sm-4 control-label ">隐患视图:</label> <div class="col-sm-8"> - <img style="width: 100px; height: 100px;cursor:pointer;" +<!-- <img style="width: 100px; height: 100px;cursor:pointer;"--> +<!-- title="查看图片"--> +<!-- th:src="*{preRectifyPhoto}"--> +<!-- onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')"--> +<!-- th:data-id="${hdcp.id}">--> + <img style="width: 100px; height: 100px;cursor:pointer;display: none" title="查看图片" + class="allPics" th:src="*{preRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')" th:data-id="${hdcp.id}"> + <div class="image-container" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -337,6 +344,34 @@ <th:block th:include="include :: datetimepicker-js"/> <th:block th:include="include :: jquery-steps-js"/> <script type="text/javascript"> + $(document).ready(function () { + var imgsUrl = $('.allPics'); + var imageUrls = imgsUrl.attr('src') + var ids = imgsUrl.attr('data-id') + var imageContainer = document.querySelector('.image-container'); + + // 将逗号分隔的字符串拆分为URL数组 + var imageUrlArray = imageUrls.split(','); + + // 遍历URL数组并创建img元素 + imageUrlArray.forEach(function(url, index) { + var img = document.createElement('img'); + img.setAttribute('src', url); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); + img.setAttribute('title', '查看图片'); + img.setAttribute('data-id', ids); + img.addEventListener('click', function() { + // showPicture(this.getAttribute('data-id'), 'preRectifyPhoto'); + openPicture(url) + }); + imageContainer.appendChild(img); + }); + }); + + function openPicture(url) { + window.open(url) + } + /* 图片--查看 */ function showPicture(id,type) { var showPictureUrl = "/tr/hiddenDangerCheck/dangerBase/showPicture/{type}/{id}"; diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/dangerRectify.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/dangerRectify.html index 96aeb1b..0da8daf 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/dangerRectify.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/dangerRectify.html @@ -149,6 +149,7 @@ var actions = []; if (row.rectifyStatus == 0) { actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="editDangerRectify(\'' + row.id + '\')"><i class="fa fa-edit"></i>整改</a> '); + actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="delayDangerRectify(\'' + row.id + '\')"><i class="fa fa-edit"></i>延期整改</a> '); return actions.join(''); } else if (row.rectifyStatus == 1) { actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="detailDangerRectify(\'' + row.id + '\')"><i class="fa fa-search"></i>查看</a> '); @@ -166,6 +167,12 @@ $.modal.open("隐患整改", editDangerRectifyUrl.replace("{id}", id)); } + /* 隐患整改--整改 */ + function delayDangerRectify(id) { + var delayDangerRectifyUrl = prefix + "/delayDangerRectify/{id}"; + $.modal.open("延期整改", delayDangerRectifyUrl.replace("{id}", id)); + } + /* 隐患整改--查看 */ function detailDangerRectify(id) { var detailDangerRectifyUrl = prefix + "/detailDangerRectify/{id}"; diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/delayDangerRectify.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/delayDangerRectify.html new file mode 100644 index 0000000..5e8b624 --- /dev/null +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/delayDangerRectify.html @@ -0,0 +1,107 @@ +<!DOCTYPE html> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<head> + <th:block th:include="include :: header('延期整改')"/> + <th:block th:include="include :: datetimepicker-css"/> + <th:block th:include="include :: jquery-steps-css"/> + + <!--多图上传样式--> + <link rel="stylesheet" href="/ajax/libs/layui/css/layui.css" media="all"> + <style type="text/css"> + #tablist li a { + height: 5em; + } + + #tablist li.notExecute a { + line-height: 5em; + text-align: center; + } + + label.error{ + position :absolute !important; + } + #preFileList{ + display: flex; + align-items: flex-start; + margin-top: 10px; + } + #postFileList{ + display: flex; + align-items: flex-start; + margin-top: 10px; + } + .file-list-item1,.file-temp1,.file-list-item2,.file-temp2{ + width: 100px; + margin-right: 10px; + } + [class^="file-list-item"] div:nth-child(1){ + width: 100%; + overflow: hidden; + position: relative; + } + [class^="file-list-item"] div:nth-child(1) img{ + width: 100px; + height: 100px; + } + [class^="file-list-item"] div:nth-child(1) .layui-badge1,.layui-badge2{ + position: absolute; + left: 2px; + top: 2px; + } + [class^="file-list-item"] div:nth-child(2){ + width: 100%; + height: 36px; + text-align: center; + line-height: 36px; + margin-top: 4px; + } + [class^="file-list-item"] div:nth-child(2) [class^="file-cancel"]{ + width: 100%; + height: 36px; + } + [class^="file-list-item"] div:nth-child(2) [class^="file-cancel"]:hover{ + background: #ED5565; + color: #fff; + } + </style> +</head> +<body class="white-bg"> +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-hdcp-edit" th:object="${hdcp}"> + <h4 class="form-header h4">延期整改</h4> + + <input name="id" th:field="*{id}" type="hidden"> +<!-- <input name="checkId" th:field="*{checkId}" type="hidden">--> + <div class="form-group showByDangerLevelChange"> + <label class="col-sm-3 control-label is-required">完成期限:</label> + <div class="col-sm-8"> + <div class="input-group date"> + <span class="input-group-addon"><i class="fa fa-calendar"></i></span> + <input name="rectifyDeadlineTime" class="form-control" type="text" readonly="readonly" required> + </div> + </div> + </div> + </form> +</div> +<th:block th:include="include :: footer"/> +<th:block th:include="include :: datetimepicker-js"/> +<th:block th:include="include :: jquery-steps-js"/> +<script type="text/javascript"> + + function submitHandler() { + if ($.validate.form()) { + var data = $('#form-hdcp-edit').serializeArray(); + console.log(data,'data') + $.operate.save(prefix + "/editDangerRectifySave", data); + } + } + + $("input[name='rectifyDeadlineTime']").datetimepicker({ + format: "yyyy-mm-dd", + minView: "month", + autoclose: true + }); + +</script> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/detailDangerRectify.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/detailDangerRectify.html index 568547c..727a0e1 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/detailDangerRectify.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/detailDangerRectify.html @@ -173,11 +173,18 @@ <div class="form-group"> <label class="col-sm-4 control-label ">隐患视图:</label> <div class="col-sm-8"> - <img style="width: 100px; height: 100px;cursor:pointer;" +<!-- <img style="width: 100px; height: 100px;cursor:pointer;"--> +<!-- title="查看图片"--> +<!-- th:src="*{preRectifyPhoto}"--> +<!-- onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')"--> +<!-- th:data-id="${hdcp.id}">--> + <img style="width: 100px; height: 100px;cursor:pointer;display: none" title="查看图片" + class="allPics1" th:src="*{preRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')" th:data-id="${hdcp.id}"> + <div class="image-container1" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -337,11 +344,18 @@ <div class="col-sm-6"> <label class="col-sm-4 control-label ">隐患整改后视图:</label> <div class="col-sm-8"> - <img style="width: 100px; height: 100px;cursor:pointer;" +<!-- <img style="width: 100px; height: 100px;cursor:pointer;"--> +<!-- title="查看图片"--> +<!-- th:src="*{postRectifyPhoto}"--> +<!-- onclick="showPicture(this.getAttribute('data-id'),'postRectifyPhoto')"--> +<!-- th:data-id="${hdcp.id}">--> + <img style="width: 100px; height: 100px;cursor:pointer;display: none" title="查看图片" + class="allPics2" th:src="*{postRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'postRectifyPhoto')" th:data-id="${hdcp.id}"> + <div class="image-container2" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -360,6 +374,51 @@ <th:block th:include="include :: footer"/> <th:block th:include="include :: jquery-steps-js"/> <script type="text/javascript"> + $(document).ready(function () { + var imgsUrl1 = $('.allPics1'); + var imageUrls1 = imgsUrl1.attr('src') + var ids = imgsUrl1.attr('data-id') + var imageContainer1 = document.querySelector('.image-container1'); + // 将逗号分隔的字符串拆分为URL数组 + var imageUrlArray1 = imageUrls1.split(','); + // 遍历URL数组并创建img元素 + imageUrlArray1.forEach(function(url, index) { + var img = document.createElement('img'); + img.setAttribute('src', url); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); + img.setAttribute('title', '查看图片'); + img.setAttribute('data-id', ids); + img.addEventListener('click', function() { + // showPicture(this.getAttribute('data-id'), 'preRectifyPhoto'); + openPicture(url) + }); + imageContainer1.appendChild(img); + }); + + var imgsUrl2 = $('.allPics2'); + var imageUrls2 = imgsUrl2.attr('src') + var imageContainer2 = document.querySelector('.image-container2'); + // 将逗号分隔的字符串拆分为URL数组 + var imageUrlArray2 = imageUrls2.split(','); + // 遍历URL数组并创建img元素 + imageUrlArray2.forEach(function(url, index) { + var img = document.createElement('img'); + img.setAttribute('src', url); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); + img.setAttribute('title', '查看图片'); + img.setAttribute('data-id', ids); + img.addEventListener('click', function() { + // showPicture(this.getAttribute('data-id'), 'preRectifyPhoto'); + openPicture(url) + }); + imageContainer2.appendChild(img); + }); + }); + + function openPicture(url) { + window.open(url) + } + /* 图片--查看 */ function showPicture(id,type) { var showPictureUrl = "/tr/hiddenDangerCheck/dangerBase/showPicture/{type}/{id}"; diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/editDangerRectify.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/editDangerRectify.html index de8eb71..0e57f53 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/editDangerRectify.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerRectify/editDangerRectify.html @@ -222,11 +222,18 @@ <div class="form-group"> <label class="col-sm-4 control-label ">隐患视图:</label> <div class="col-sm-8"> - <img style="width: 100px; height: 100px;cursor:pointer;" +<!-- <img style="width: 100px; height: 100px;cursor:pointer;"--> +<!-- title="查看图片"--> +<!-- th:src="*{preRectifyPhoto}"--> +<!-- onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')"--> +<!-- th:data-id="${hdcp.id}">--> + <img style="width: 100px; height: 100px;cursor:pointer;display: none" title="查看图片" + class="allPics" th:src="*{preRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')" th:data-id="${hdcp.id}"> + <div class="image-container" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -402,6 +409,34 @@ <th:block th:include="include :: datetimepicker-js"/> <th:block th:include="include :: jquery-steps-js"/> <script type="text/javascript"> + $(document).ready(function () { + var imgsUrl = $('.allPics'); + var imageUrls = imgsUrl.attr('src') + var ids = imgsUrl.attr('data-id') + var imageContainer = document.querySelector('.image-container'); + + // 将逗号分隔的字符串拆分为URL数组 + var imageUrlArray = imageUrls.split(','); + + // 遍历URL数组并创建img元素 + imageUrlArray.forEach(function(url, index) { + var img = document.createElement('img'); + img.setAttribute('src', url); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); + img.setAttribute('title', '查看图片'); + img.setAttribute('data-id', ids); + img.addEventListener('click', function() { + // showPicture(this.getAttribute('data-id'), 'preRectifyPhoto'); + openPicture(url) + }); + imageContainer.appendChild(img); + }); + }); + + function openPicture(url) { + window.open(url) + } + /* 图片--查看 */ function showPicture(id,type) { var showPictureUrl = "/tr/hiddenDangerCheck/dangerBase/showPicture/{type}/{id}"; diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotDanger.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotDanger.html index cc0c2f2..145d2c0 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotDanger.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotDanger.html @@ -109,7 +109,7 @@ th:src="*{preRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')" th:data-id="${hiddenDangerCheckPoint.id}"> - <div class="image-container"></div> + <div class="image-container" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -161,7 +161,7 @@ imageUrlArray.forEach(function(url, index) { var img = document.createElement('img'); img.setAttribute('src', url); - img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin: 10px'); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); img.setAttribute('title', '查看图片'); img.setAttribute('data-id', ids); img.addEventListener('click', function() { @@ -172,15 +172,15 @@ }); }); + function openPicture(url) { + window.open(url) + } + /* 图片--查看 */ function showPicture(id,type) { var showPictureUrl = "/tr/hiddenDangerCheck/dangerBase/showPicture/{type}/{id}"; var urlLast = showPictureUrl.replace("{type}", type).replace("{id}", id); $.operate.openDetailInfo("查看图片", urlLast); - } - - function openPicture(url) { - window.open(url) } </script> diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotJudge.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotJudge.html index 59799b6..393bda5 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotJudge.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailNotJudge.html @@ -108,7 +108,7 @@ th:src="*{preRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')" th:data-id="${hiddenDangerCheckPoint.id}"> - <div class="image-container"></div> + <div class="image-container" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -160,7 +160,7 @@ imageUrlArray.forEach(function(url, index) { var img = document.createElement('img'); img.setAttribute('src', url); - img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin: 10px'); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); img.setAttribute('title', '查看图片'); img.setAttribute('data-id', ids); img.addEventListener('click', function() { diff --git a/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailYesDanger.html b/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailYesDanger.html index 0e53535..4e7b271 100644 --- a/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailYesDanger.html +++ b/src/main/resources/templates/tr/hiddenDangerCheck/dangerReport/detailYesDanger.html @@ -162,7 +162,7 @@ th:src="*{preRectifyPhoto}" onclick="showPicture(this.getAttribute('data-id'),'preRectifyPhoto')" th:data-id="${hiddenDangerCheckPoint.id}"> - <div class="image-container"></div> + <div class="image-container" style="display: flex;align-items: flex-start"></div> </div> </div> </div> @@ -214,7 +214,7 @@ imageUrlArray.forEach(function(url, index) { var img = document.createElement('img'); img.setAttribute('src', url); - img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin: 10px'); + img.setAttribute('style', 'width: 100px; height: 100px; cursor: pointer;margin-right: 10px'); img.setAttribute('title', '查看图片'); img.setAttribute('data-id', ids); img.addEventListener('click', function() { -- Gitblit v1.9.2