cameraSetup.esp
4.09 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>相机架设</title>
<link href="../../css/frame.css" rel="stylesheet" />
<link href="../../scripts/easyui/themes/default/easyui.css" rel="stylesheet" />
<link href="../../scripts/easyui/themes/icon.css" rel="stylesheet" />
<style type="text/css">
.mainContainer {
width: 90%;
height: 400px;
padding: 8px;
}
.tdTitle {
width: 110px;
}
.picExample {
height: 276px;
width: 322px;
background: url(../../images/cameraSetup.png) no-repeat 0 0;
}
</style>
</head>
<body>
<div class="mainContainer">
<form id="cameraSetupForm">
<table class="settingsContainer">
<tr>
<td class="tdTitle">杆高(1-10米)</td>
<td class="tdContent">
<input type="text" name="210" id="210" class="settingParameter" />
</td>
</tr>
<tr>
<td class="tdTitle">焦距(5-50毫米)</td>
<td class="tdContent">
<input type="text" name="211" id="211" class="settingParameter">
</td>
</tr>
<tr>
<td colspan="2">
<div class="picExample">
</div>
</td>
</tr>
<tr>
<td colspan="2">
<% inputSecurityToken(); %>
<a href="#" id="btnSave" class="settingBtn">保存</a>
</td>
</tr>
</table>
</form>
</div>
<script src="../../scripts/easyui/jquery.min.js"></script>
<script src="../../scripts/easyui/jquery.easyui.min.js"></script>
<script src="../../scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
<script src="../../scripts/utilities.js"></script>
<script src="../../scripts/jquery.validate.min.js"></script>
<script src="../../scripts/jquery.validate.extend.js"></script>
<script type="text/javascript">
var parameterAdaptor = new ParameterAdaptor();
var rebootManager = new RebootManager();
$().ready(function() {
loadCameraSetupInfo();
setTimeout(loadAttributeInfo, 200);
$("#btnSave").click(saveParametersToServer);
//表单验证
$("#cameraSetupForm").validate({
rules: {
210: {
required:true,
range:[1,10]
},
211: {
required:true,
range:[5,50]
}
}
});
});
//加载相机设置参数
function loadCameraSetupInfo() {
var RefererInfo = "cameraSetup";
parameterAdaptor.getParameters(RefererInfo, function(data) {
$("#cameraSetupForm").form("load", data.feedback);
});
}
function loadAttributeInfo() {
var RefererInfo = "cameraSetup";
parameterAdaptor.getAttribute(RefererInfo, function(data){
for(var pId in data){
if(document.getElementById(pId) != null)
document.getElementById(pId).setAttribute( "title", data[pId]);
}
});
}
//保存参数到服务器
function saveParametersToServer() {
var formObj = $("#cameraSetupForm");
if (!formObj.valid()) {
$.messager.alert("提示", "参数验证有误,请修改后再提交!", "error");
return;
}
parameterAdaptor.saveParameters(formObj, function(response) {
if (response.error) {
$.messager.show({
title:'结果',
msg:'修改成功!',
timeout:3000,
showType:'slide'
});
}
});
}
</script>
</body>
</html>