-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcockm2.html
More file actions
603 lines (603 loc) · 30.5 KB
/
cockm2.html
File metadata and controls
603 lines (603 loc) · 30.5 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
<!doctype html>
<html lang="en">
<!--[if IE 9 ]>
<html lang="en" class="ie9">
<![endif]-->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta name="format-detection" content="telephone=no">
<meta charset="UTF-8">
<title>业务管理</title>
<!-- CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/animate.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/icons.css">
<link rel="stylesheet" href="css/generics.css">
<!-- <link rel="stylesheet" href="css/bstable/bootstrap-table.css">-->
<link rel="stylesheet" href="css/bstable/b-t2.css">
<link rel="stylesheet" href="css/bstable/bsts2.css">
<!-- <link rel="stylesheet" href="css/bstable/bootstrap-table-self.css">-->
</head>
<body>
<header id="header" class="media">
<a href="" id="menu-toggle"></a>
<a class="logo pull-left" href="index.html">
<img src="images/logo.png" alt="logo">
</a>
<div class="media-body">
<div class="media" id="top-menu">
<div class="pull-left tm-icon">
<a data-drawer="messages" class="drawer-toggle" href="">
<i class="sa-top-message"></i>
<span>时间回溯</span>
</a>
</div>
<div class="pull-left tm-icon">
<a data-drawer="notifications" class="drawer-toggle" href="">
<i class="sa-top-updates"></i>
<span>帮助</span>
</a>
</div>
<div id="time" class="pull-right">
<span id="hours"></span>
:
<span id="min"></span>
:
<span id="sec"></span>
</div>
<div class="media-body">
<input type="text" class="main-search">
</div>
</div>
</div>
</header>
<div class="clearfix"></div>
<section id="main" class="p-relative" role="main">
<!-- Sidebar -->
<aside id="sidebar">
<!-- Side Menu -->
<ul class="list-unstyled side-menu">
<li>
<a class="sa-side-home" href="index.html">
<span class="menu-item">首页</span>
</a>
</li>
<li class="active">
<a class="sa-side-view" href="#">
<span class="menu-item">驾驶舱管理</span>
</a>
</li>
</ul>
</aside>
<!-- Content -->
<section id="content" class="container">
<!-- Messages Drawer -->
<div id="messages" class="tile drawer animated">
<div class="listview narrow">
<div class="media">
<a href="">时间回溯</a>
<span class="drawer-close">×</span>
</div>
<div class="overflow" style="height: 254px">
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/1.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Nadin Jackson - 2 Hours ago</small><br>
<a class="t-overflow" href="">Mauris consectetur urna nec tempor adipiscing. Proin sit amet nisi ligula. Sed eu adipiscing lectus</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/2.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">David Villa - 5 Hours ago</small><br>
<a class="t-overflow" href="">Suspendisse in purus ut nibh placerat Cras pulvinar euismod nunc quis gravida. Suspendisse pharetra</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/3.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Harris worgon - On 15/12/2013</small><br>
<a class="t-overflow" href="">Maecenas venenatis enim condimentum ultrices fringilla. Nulla eget libero rhoncus, bibendum diam eleifend, vulputate mi. Fusce non nibh pulvinar, ornare turpis id</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/4.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Mitch Bradberry - On 14/12/2013</small><br>
<a class="t-overflow" href="">Phasellus interdum felis enim, eu bibendum ipsum tristique vitae. Phasellus feugiat massa orci, sed viverra felis aliquet quis. Curabitur vel blandit odio. Vestibulum sagittis quis sem sit amet tristique.</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/1.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Nadin Jackson - On 15/12/2013</small><br>
<a class="t-overflow" href="">Ipsum wintoo consectetur urna nec tempor adipiscing. Proin sit amet nisi ligula. Sed eu adipiscing lectus</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/2.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">David Villa - On 16/12/2013</small><br>
<a class="t-overflow" href="">Suspendisse in purus ut nibh placerat Cras pulvinar euismod nunc quis gravida. Suspendisse pharetra</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/3.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Harris worgon - On 17/12/2013</small><br>
<a class="t-overflow" href="">Maecenas venenatis enim condimentum ultrices fringilla. Nulla eget libero rhoncus, bibendum diam eleifend, vulputate mi. Fusce non nibh pulvinar, ornare turpis id</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/4.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Mitch Bradberry - On 18/12/2013</small><br>
<a class="t-overflow" href="">Phasellus interdum felis enim, eu bibendum ipsum tristique vitae. Phasellus feugiat massa orci, sed viverra felis aliquet quis. Curabitur vel blandit odio. Vestibulum sagittis quis sem sit amet tristique.</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/5.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Wendy Mitchell - On 19/12/2013</small><br>
<a class="t-overflow" href="">Integer a eros dapibus, vehicula quam accumsan, tincidunt purus</a>
</div>
</div>
</div>
<div class="media text-center whiter l-100">
<a href=""><small>VIEW ALL</small></a>
</div>
</div>
</div>
<!-- Notification Drawer -->
<div id="notifications" class="tile drawer animated">
<div class="listview narrow">
<div class="media">
<a href="">帮助</a>
<span class="drawer-close">×</span>
</div>
<div class="overflow" style="height: 254px">
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/1.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Nadin Jackson - 2 Hours ago</small><br>
<a class="t-overflow" href="">Mauris consectetur urna nec tempor adipiscing. Proin sit amet nisi ligula. Sed eu adipiscing lectus</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/2.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">David Villa - 5 Hours ago</small><br>
<a class="t-overflow" href="">Suspendisse in purus ut nibh placerat Cras pulvinar euismod nunc quis gravida. Suspendisse pharetra</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/3.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Harris worgon - On 15/12/2013</small><br>
<a class="t-overflow" href="">Maecenas venenatis enim condimentum ultrices fringilla. Nulla eget libero rhoncus, bibendum diam eleifend, vulputate mi. Fusce non nibh pulvinar, ornare turpis id</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/4.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Mitch Bradberry - On 14/12/2013</small><br>
<a class="t-overflow" href="">Phasellus interdum felis enim, eu bibendum ipsum tristique vitae. Phasellus feugiat massa orci, sed viverra felis aliquet quis. Curabitur vel blandit odio. Vestibulum sagittis quis sem sit amet tristique.</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/1.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">Nadin Jackson - On 15/12/2013</small><br>
<a class="t-overflow" href="">Ipsum wintoo consectetur urna nec tempor adipiscing. Proin sit amet nisi ligula. Sed eu adipiscing lectus</a>
</div>
</div>
<div class="media">
<div class="pull-left">
<img width="40" src="img/profile-pics/2.jpg" alt="">
</div>
<div class="media-body">
<small class="text-muted">David Villa - On 16/12/2013</small><br>
<a class="t-overflow" href="">Suspendisse in purus ut nibh placerat Cras pulvinar euismod nunc quis gravida. Suspendisse pharetra</a>
</div>
</div>
</div>
<div class="media text-center whiter l-100">
<a href=""><small>VIEW ALL</small></a>
</div>
</div>
</div>
<!-- Breadcrumb -->
<h4 class="page-title">业务管理页面</h4>
<div class="block-area" style="padding: 0px 15px 0;">
<!-- <h3 class="block-title">业务管理与设置</h3>-->
<div class="table-responsive overflow">
<div id="btnAddRemove">
<button class="btn btn-default" id="addtable4Row" style="margin-left: 10px;margin-right: 10px;">
<!-- <span>新增</span>-->
<span class="glyphicon glyphicon-plus"></span>
</button>
<button class="btn btn-default" id="deltable4Row" style="margin-right: 20px;">
<!-- <span>删除</span>-->
<span class="glyphicon glyphicon-remove"></span>
</button>
<!-- <button class="btn btn-default" id="changetable4Row">
<span>修改</span>
<span class="glyphicon glyphicon-pencil"></span>
</button>-->
<div class="modal fade in" id="addtableRow-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content" style="background: #000;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
增加行
</h4>
</div>
<div class="modal-body">
<div class="form-horizontal">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary footer-btn" id="btn-addtableRow">
提交
</button>
</div>
</div>
</div>
</div>
<div class="modal fade in" id="changetableRow-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content" style="background: #000;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
更改行内容
</h4>
</div>
<div class="modal-body">
<div class="form-horizontal">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary footer-btn" id="btn-changetableRow">
提交
</button>
</div>
</div>
</div>
</div>
<div class="modal fade in" id="Confirm-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content" style="background: #000;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
操作
</h4>
</div>
<div class="modal-body">
确定删除此行吗?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary footer-btn" data-dismiss="modal" id="btn-ConfirmdelRow">
提交
</button>
</div>
</div>
</div>
</div>
</div>
<table id="table6"></table>
</div>
</div>
</section>
<!-- Older IE Message -->
<!--[if lt IE 9]>
<div class="ie-block">
<h1 class="Ops">抱歉!</h1>
<p>您正在使用一个过时的Internet Explorer版本,升级到以下任何Web浏览器,以便访问该网站的最大功能。 </p>
<ul class="browsers">
<li>
<a href="http://www.google.cn/intl/zh-CN/chrome/browser/desktop/index.html">
<img src="img/browsers/chrome.png" alt="">
<div>Google Chrome</div>
</a>
</li>
<li>
<a href="http://www.firefox.com.cn/">
<img src="img/browsers/firefox.png" alt="">
<div>Mozilla Firefox</div>
</a>
</li>
<li>
<a href="http://www.oupeng.com/download">
<img src="img/browsers/opera.png" alt="">
<div>Opera</div>
</a>
</li>
<li>
<a href="https://www.apple.com/cn/safari/">
<img src="img/browsers/safari.png" alt="">
<div>Safari</div>
</a>
</li>
<li>
<a href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads">
<img src="img/browsers/ie.png" alt="">
<div>Internet Explorer(New)</div>
</a>
</li>
</ul>
<p>升级你的浏览器更安全和更快的网络体验。 <br/>感谢你的支持...</p>
</div>
<![endif]-->
</section>
</body>
</html>
<!-- jQuery -->
<script src="js/jquery.min.js"></script> <!-- jQuery Library -->
<!-- Bootstrap -->
<script src="js/bootstrap.min.js"></script>
<!-- Bootstrap-table -->
<!--<script src="js/bstable/bootstrap-table.js"></script>-->
<script src="js/bstable/bst.js"></script>
<script src="js/bstable/bootstrap-table-zh-CN.js"></script>
<script src="js/functions.js"></script>
<script src="js/changebgsave.js"></script>
<script>
$(function(){
var field = ["name","descrption"],
titleText = ["驾驶舱名称","驾驶舱描述"];
$("#table6").bootstrapTable({
toggle:"table",
url:"/monitor/getMonitorViewList.do",
toolbar:"#btnAddRemove",
pagination:true,
showColumns:true,
columns:[
{
field:"name",
title:"驾驶舱名称",
sortable:true
},{
field:"descrption",
title:"为驾驶舱描述",
sortable:true
},{
field:"userName",
title:"创建用户",
sortable:true
},{
field:"updateTime",
title:"更新时间",
formatter:function(value,row,index){
return getLocalTime(value);
},
sortable:true
},{
field:"lockStatus",
title:"状态",
formatter:function(value,row,index){
if(value){
return "锁定";
}else {
return "未锁定";
}
},
sortable:true
}
],
onClickRow:function(e,row){
$(".tabRowClickbg").removeClass("tabRowClickbg");
$(row).addClass("tabRowClickbg");
},
onDblClickRow:function(dataRow,row){
var rowKeyArry = Object.keys(dataRow);
rowKeyArry.forEach(function(item,index){
if(dataRow[item]==$(row.context).text()){
if(item=="descrption"||item=="name"){
if(!$(row.context).children().hasClass("rowCellInput")){
var input = $('<input type="text" class="rowCellInput" value="'+$(row.context).text()+'"/>')
.width($(row.context).width())
.height($(row.context).outerHeight(true)).css("background","none");
$(row.context).html(input);
$(row.context).children(input).focus().blur(function(){
var cText = $.trim($(this).val());
if(item=="descrption"||verification(cText)){
$(row.context).text(cText);
$.ajax({
url:"/monitor/updateMonitorViewById.do",
type:"post",
data:{
id:dataRow.id,
name:item=="name"?cText:dataRow.name,
descrption:item=="descrption"?cText:dataRow.descrption,
lockStatus:0
},
dataType:"json",
success:function(data){
console.log(data.success);
switch (data.success-0){
case 1:
$("#table6").bootstrapTable('updateRow', {
index:$(".tabRowClickbg").attr("data-index"),
row:{
id:dataRow.id,
name:item=="name"?cText:dataRow.name,
descrption:item=="descrption"?cText:dataRow.descrption,
}
});
break;
case 0:
alert("保存失败,请稍后再试");
break;
case 2:
alert("驾驶舱名称已存在,请更改驾驶仓名稍后再次保存");
break
}
}
})
}else {
alert("驾驶仓名称不能超过32个字符且不能为空");
}
});
}
}
}
});
}
});
/**************增加行******************************/
$("#addtable4Row").click(function(){
$("#addtableRow-modal>.modal-dialog>.modal-content>.modal-body>.form-horizontal").html("");
var length = titleText.length;
for(var i=0;i<length;i++){
var formGroup = $('<div class="form-group group-Style">'+
'<div class="col-md-8">'+
'<input type="text" class="form-control input-sm m-t-15 addtableRowInput">'+
'</div>'+
'</div>');
var label = $('<lable class="col-md-3 control-label">'+
titleText[i]+
'</lable>');
$(formGroup).prepend(label);
$("#addtableRow-modal>.modal-dialog>.modal-content>.modal-body>.form-horizontal").append(formGroup);
}
$("#addtableRow-modal").modal("show");
});
$("#btn-addtableRow").click(function(){
var serverIpVal = $.trim($("#addtableRow-modal .addtableRowInput:eq(0)").val());
if(verification(serverIpVal)){
$("#addtableRow-modal").modal("hide");
$.ajax({
url:"/monitor/addMonitorView.do",
type:"post",
data:{
name:serverIpVal,
descrption:$.trim($("#addtableRow-modal .addtableRowInput:eq(1)").val()),
lockStatus:0
},
dataType:"json",
success:function(data){
switch (data.success-0){
case 1:
$.ajax({
url:"/monitor/getMonitorViewList.do",
type:"post",
data:"",
dataType:"json",
success:function(addData){
$('#table6').bootstrapTable('load',addData);
}
});
break;
case 0:
alert("保存失败,请稍后再试");
break;
case 2:
alert("驾驶舱名称已存在,请更改驾驶仓名稍后再次保存");
break
}
}
})
}else {
alert("驾驶仓名称不能超过32个字符且不能为空");
}
});
function verification(str){
/*验证用户名 将一个汉字转换成两个字符*/
var totalCount = 0;
for (var i=0; i<str.length; i++){
var c = str.charCodeAt(i);
if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)){
totalCount++;
}else{
totalCount+=2;
}
}
// return totalCount;
if(totalCount){
if(totalCount<32){
return true;
}else {
return false;
}
}else {
return false;
}
}
function getLocalTime(nS) {
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');
}
$("#deltable4Row").click(function(){
var selectRowId = $(".tabRowClickbg").attr("data-id");
if(selectRowId!=undefined){
$("#Confirm-modal").modal("show");
$("#btn-ConfirmdelRow").one("click",function(){
$.ajax({
url:"/monitor/delMonitorView.do",
type:"post",
data:{
id:selectRowId
},
dataType:"json",
success:function(data){
console.log(data);
if(data.success-0){
$("#table6").bootstrapTable('remove', {
field: 'id',
values: [selectRowId-0]
});
}else {
alert("删除失败,请稍后再试");
}
}
});
});
}
});
})
</script>