upload.html
6.1 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-integrity-edit" th:object="${creditGovernmentIntegrity}">
<input name="id" id="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">序号:</label>
<div class="col-sm-8">
<input name="serialNumber" th:field="*{serialNumber}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">一级指标:</label>
<div class="col-sm-8">
<input name="firstIndex" th:field="*{firstIndex}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">二级指标:</label>
<div class="col-sm-8">
<input name="secondIndex" th:field="*{secondIndex}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">分值:</label>
<div class="col-sm-8">
<input name="score" id="score" th:field="*{score}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">材料:</label>
<div class="col-sm-8">
<select name="fileType" id="fileType" class="form-control m-b" th:with="type=${@dict.getType('eit_government_file_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{fileType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">主要监测内容:</label>
<div class="col-sm-8">
<textarea name="monitorContent" class="form-control" disabled>[[*{monitorContent}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">评分说明:</label>
<div class="col-sm-8">
<textarea name="scoreStandard" class="form-control" disabled>[[*{scoreStandard}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">证明材料:</label>
<div class="col-sm-8">
<textarea name="fileRequest" class="form-control" disabled>[[*{fileRequest}]]</textarea>
</div>
</div>
<div class="form-group" id="fileUpload">
<label class="col-sm-4 control-label">多附件上传</label>
<div class="col-sm-7">
<input type="hidden" name="fileIdList"/>
<div class="file-loading">
<input id="fileIdList" name="files" type="file" multiple>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<th:block th:include="include :: file-upload-parse" />
<script th:inline="javascript">
var prefix = ctx + "business/integrity";
$("#form-integrity-edit").validate({
focusCleanup: true
});
function submitHandler() {
$.operate.save(ctx+ "business/score/add", {"id":$("#id").val(),"score":$("#score").val()}, function (result){
$.modal.close();
});
}
var fileRespList = [[${creditGovernmentIntegrity.fileRespList}]];
$(function (){
if(fileRespList == null){
fileRespList = [];
}
var deleteFileUrl = ctx + "business/common/cloud/upload/delete";
var parseResult = parseUpload(fileRespList, deleteFileUrl);
var initialPreview = parseResult.initialPreview;
var initialPreviewConfig = parseResult.initialPreviewConfig;
console.log(fileRespList);
// 多图上传
$("#fileIdList").fileinput({
uploadUrl: ctx + 'business/common/cloud/uploads',
deleteUrl: deleteFileUrl,
uploadAsync: false,
allowedFileExtensions:['image', 'doc', 'docx', 'video', 'png', 'jpg', 'pdf'],//允许上传的文件类型,错误会给出提示
maxFileCount: 10,
autoReplace: true,
showClose: false, //隐藏右上角叉
showRemove: false, //隐藏清除按钮
uploadExtraData: {bid:$("#id").val(), bType: "affairs_integrity"},
initialPreview: initialPreview,
initialPreviewConfig: initialPreviewConfig,
initialPreviewAsData: true, // defaults markup
fileSizeGetter:true,
overwriteInitial:false
}).on('filebatchuploadsuccess', function (event, data, previewId, index) {
var rsp = data.response;
$("input[name='" + event.currentTarget.id + "']").val(rsp.data.ids)
}).on('filedeleted', function (event, data, previewId, index) {
for (var i = 0; i < fileRespList.length; i++) {
if (fileRespList[i].id == data) {
delete fileRespList[i];
}
}
})
});
</script>
</body>
</html>