马宇豪
2023-08-25 aa2051a2327c079105110f5424f3a44ffaa0c7bb
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
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('公司四色平面图')"/>
    <th:block th:include="include :: bootstrap-fileinput-css"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <style type="text/css">
        .btn-file {
            display: none;
        }
 
        .kv-file-remove {
            display: none;
        }
 
        .krajee-default .file-footer-caption {
            display: none;
        }
 
        .krajee-default.file-preview-frame .file-thumbnail-footer {
            height: 30px;
        }
 
        .glyphicon-move:before {
            display: none;
        }
    </style>
</head>
 
<!--多图上传样式-->
<link rel="stylesheet" href="/ajax/libs/layui/css/layui.css" media="all">
 
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-company-detail" th:object="${company}">
 
        <div class="form-group">
            <div class="col-sm-11">
                <input name="companyFourColorMapUrl" th:value="*{companyFourColorMapUrl}" type="hidden"
                       id="companyFourColorMapUrl">
                <div class="file-loading">
                    <input name="file" id="companyFourColorMapUrlUpload" type="file">
                    <!--                    </div>-->
                </div>
            </div>
        </div>
 
 
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    $(function () {
        showDetail($("#companyFourColorMapUrlUpload"), $("#companyFourColorMapUrl"));
        showDetail($("#postSafetyRiskBarChartUrlUpload"), $("#postSafetyRiskBarChartUrl"));
        showDetail($("#companyBusinessLicenseUpload"), $("#companyBusinessLicense"));
 
    });
 
 
    $(function () {
        $("#form-company-detail").find("input,textarea,select").attr("disabled", "disabled");
    });
 
 
    var showDetail = function (thatFile, thatUrl, callback) {
        var urlObj = $(thatUrl).val();
        var previewUrl = [];
        var config = [];
        if (urlObj) {
            urlObj = JSON.parse(urlObj);
            for (var key in urlObj) {
                previewUrl.push(urlObj[key]);
                var tem = {};
                tem['key'] = key;
                config.push(tem)
            }
        }
        ;
        var lastThatFile =
            $(thatFile).fileinput({
                'theme': 'explorer-fas',
                showUpload: false,
                overwriteInitial: false,
                initialPreviewAsData: true,
                language: 'zh',
                dropZoneEnabled: false,
                resizeImage: false,
                showCaption: false,
                showPreview: true,
                showRemove: false,
                showClose: false,
                browseClass: "btn btn-primary btn-lg",
                allowedFileExtensions: ['jpg', 'png', 'gif', 'jpeg', 'bmp'],
                previewFileIcon: '',
                initialPreviewConfig: config,
                initialPreview: previewUrl
            });
    }
</script>
</body>
</html>