-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneral.html
More file actions
199 lines (198 loc) · 8.96 KB
/
general.html
File metadata and controls
199 lines (198 loc) · 8.96 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>跟随相位</title>
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/reasyui.css">
<script src="js/libs/jquery-1.11.2.js"></script>
<style>
input{
width:100%;
height:30px;
padding:3px 2px;
font-size:14px;
line-height:1.42857;
color:#555;
border:1px solid #ccc;
border-radius:4px;
-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);
box-shadow:inset 0 1px 1px rgba(0,0,0,.075);
}
</style>
<script>
$.ajax({
type: "POST",
url: "/general1",
contentType: 'application/json',
dataType: "json",
success:function(data){
console.log(data);
// var test1 = data.returnJson[0].list_1[0]; //循环遍历品牌表数据并赋给input
$.each(data,function(key,item){
$("#"+key).val(item); //返回结果为null时,转换成空字符串
})
},
error:function(){
alert("加载资源失败");
}
});
function mysubmit()
{
if(window.confirm("确定要提交吗?"))
{
$.ajax({
type: "POST",
url: "/general1",
contentType: 'application/json',
dataType: "json",
data: $('#form1').serialize(),
success:function(data){
console.log(data);
$.each(data,function(key,item){
$("#"+key).val(item); //返回结果为null时,转换成空字符串
})
},
error: function(data, type, err){
console.log("ajax错误类型:"+type);
console.log(err);
}
});
}
else
{
return false;
}
}
function myrst(){
if(window.confirm("确定要重置吗?"))
{
$.ajax({
type: "POST",
url: "/general1",
contentType: 'application/json',
dataType: "json",
success:function(data){
console.log(data);
$.each(data,function(key,item){
$("#"+key).val(item); //返回结果为null时,转换成空字符串
})
},
error:function(){
alert("加载资源失败");
}
})
}
else
{
return false;
}
};
</script>
</head>
<body>
<section class="container-fluid">
<form class="form-horizontal" id="form1" action="#">
<h2 class="legend">出厂信息</h2>
<fieldset>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">制造厂商</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="t01001" name="t01001">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">设备版本</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="t01002" name="t01002">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">设备编号</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="t01003" name="t01003">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">生产日期</label>
<div class="col-sm-4">
<input type="text" style="width: 40px" id="p07001" name="p07001"><span>年</span>
<input type="text" style="width: 40px" id="p07002" name="p07002"><span>月</span>
<input type="text" style="width: 40px" id="p07003" name="p07003"><span>日</span>
<input type="text" style="width: 40px" id="p07004" name="p07004"><span>时</span>
<input type="text" style="width: 40px" id="p07005" name="p07005"><span>分</span>
<input type="text" style="width: 40px" id="p07006" name="p07006"><span>秒</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">制造日期</label>
<div class="col-sm-4">
<input type="text" style="width: 40px" id="p08001" name="p08001"><span>年</span>
<input type="text" style="width: 40px" id="p08002" name="p08002"><span>月</span>
<input type="text" style="width: 40px" id="p08003" name="p08003"><span>日</span>
<input type="text" style="width: 40px" id="p08004" name="p08004"><span>时</span>
<input type="text" style="width: 40px" id="p08005" name="p08005"><span>分</span>
<input type="text" style="width: 40px" id="p08006" name="p08006"><span>秒</span>
</div>
</div>
</fieldset>
<h2 class="legend">IP</h2>
<fieldset>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">本机地址</label>
<div>
<input type="text" style="width: 40px" id="p02001" name="p02001"><span>.</span>
<input type="text" style="width: 40px" id="p02002" name="p02002"><span>.</span>
<input type="text" style="width: 40px" id="p02003" name="p02003"><span>.</span>
<input type="text" style="width: 40px" id="p02004" name="p02004">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">掩码</label>
<div>
<input type="text" style="width: 40px" id="p03001" name="p03001"><span>.</span>
<input type="text" style="width: 40px" id="p03002" name="p03002"><span>.</span>
<input type="text" style="width: 40px" id="p03003" name="p03003"><span>.</span>
<input type="text" style="width: 40px" id="p03004" name="p03004">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">网关</label>
<div>
<input type="text" style="width: 40px" id="p04001" name="p04001"><span>.</span>
<input type="text" style="width: 40px" id="p04002" name="p04002"><span>.</span>
<input type="text" style="width: 40px" id="p04003" name="p04003"><span>.</span>
<input type="text" style="width: 40px" id="p04004" name="p04004">
</div>
</div>
</fieldset>
<h2 class="legend">中心</h2>
<fieldset>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">中心地址</label>
<div>
<input type="text" style="width: 40px" id="p05001" name="p05001"><span>.</span>
<input type="text" style="width: 40px" id="p05002" name="p05002"><span>.</span>
<input type="text" style="width: 40px" id="p05003" name="p05003"><span>.</span>
<input type="text" style="width: 40px" id="p05004" name="p05004">
<span> 端口 </span><input type="text" style="width: 40px" id="p05005" name="p05005">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 col-md-3 control-label">中心控制</label>
<div>
<span>路口1 </span><input type="text" style="width: 40px" id="p06001" name="p06001">
<span>路口2 </span><input type="text" style="width: 40px" id="p06002" name="p06002">
<span>路口3 </span><input type="text" style="width: 40px" id="p06003" name="p06003">
<span>路口4 </span><input type="text" style="width: 40px" id="p06004" name="p06004">
</div>
</div>
</fieldset>
<div class="main-submit" style="margin: 20px">
<button class="btn btn-frist btn-primary" type="button" onclick="mysubmit()">提交</button>
<button class="btn btn-frist btn-primary" type="button" onclick="myrst()">重置</button>
</div>
</form>
</section>
</body>
</html>