add.html
2.99 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
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增报告目录')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-reportDirectoryData-add">
<div class="form-group">
<label class="col-sm-3 control-label">报告类型:</label>
<div class="col-sm-8">
<select class="form-control" id="reportType" name="reportType" th:with="type=${@dict.getType('autoMakeReportType')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目录名称:</label>
<div class="col-sm-8">
<input id="rdName" name="rdName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">排序编号:</label>
<div class="col-sm-8">
<input id="sortNum" name="sortNum" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数据源:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="dsSelectName" disabled >
<input type="text" class="form-control" id="suggest-demo-1" name="dsId" >
<div class="input-group-btn">
<button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
</ul>
</div>
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<th:block th:include="include :: bootstrap-suggest-js" />
<th:block th:include="include :: bootstrap-typeahead-js" />
<script type="text/javascript">
var prefix = ctx + "business/reportDirectoryData"
function getDataSource(){
var reportType=$("#reportType").val()
if ($.common.isEmpty(reportType)){
alert("请选择报告类型");
return ;
}
$.get(prefix+"/getDataSource?id="+reportType,(data)=>{
})
}
$("#form-reportDirectoryData-add").validate({
rules:{
xxxx:{
required:true,
},
},
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-reportDirectoryData-add').serialize());
}
}
var testBsSuggest = $("#suggest-demo-1").bsSuggest({
url: ctx + "business/reportDataSource/list2",
idField: "id",
keyField: "dsName"
}).on('onDataRequestSuccess', function (e, result) {
console.log('onDataRequestSuccess: ', result);
}).on('onSetSelectValue', function (e, keyword) {
$("#suggest-demo-1").val(keyword.id)
$("#dsSelectName").val(keyword.key)
console.log('onSetSelectValue: ', keyword);
}).on('onUnsetSelectValue', function (e) {
console.log("onUnsetSelectValue");
});
</script>
</body>
</html>