jiazx0107@163.com
2023-11-06 69cd9f59a0fabf12f8c9147fcba7f69817a870b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="zh-cn" xmlns:th=http://www.thymeleaf.org>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <title>门禁记录抓拍</title>
 
    <link rel="stylesheet" type="text/css" th:href="@{../../static/plugins/layui/css/layui.css?v=2.5.5}">
 
    <style type="text/css">
 
        .layui-card-header {
            font-weight: bold;
        }
 
        .cut-img {
            height: 480px;
            width: 600px;
        }
 
        .layui-layer-title {
            font-weight: bold;
            background-color: #eff4f6;
        }
 
        thead span {
            font-weight: bold
        }
    </style>
 
</head>
 
<body>
<!-- 可追踪信息 -->
<div class="layui-tab-content">
    <div class="layui-fluid" id="recordFilesDiv">
        <!--         <div class="layui-col-md6 layui-col-sm6"> -->
        <!--             <div class="layui-card"> -->
        <!--                 <div class="layui-card-header">图片1</div> -->
        <!--                 <div class="layui-card-body"> -->
        <!--                     <img src="" alt="" /> -->
        <!--                 </div> -->
        <!--             </div> -->
        <!--         </div> -->
    </div>
</div>
 
<script th:inline="javascript">
    var id = [[${id}]];
    var imgPathList = [[${imgPathList}]];
</script>
 
<script th:src="@{../../static/plugins/layui/layui.js}"></script>
<script th:src="@{../../static/js/jquery.min.js}"></script>
 
<script>
    var layer;
    $(function () {
        layui.use(['layer'], function () {
            layer = layui.layer;
            //获取附件信息
            var index = layer.load();
            renderImg(imgPathList);
            layer.close(index);
        });
    });
 
    // 渲染出入库的图片列表
    function renderImg(imgList) {
        var mainDiv = $("#recordFilesDiv");
        mainDiv.empty();
        var html;
        if(imgList == null || imgList.length <= 0){
            layer.msg("图片未找到!");
            return true;
        }
        $.each(imgList, function (index, item) {
            html = "";
            html += "<div class='layui-col-md6 layui-col-sm6'><div class='layui-card'>";
            html += "<div class='layui-card-header'>抓拍记录-" + (index+1) + "</div>";
            html += "<div class='layui-card-body'>";
            //使用文件流进行渲染图片
            html += "<img class ='cut-img' src='../../basic/common/getImg?filePath=" + item + "' />";
 
            html += "</div></div></div>";
            mainDiv.append(html);
        });
    }
 
</script>
</body>
</html>