accuracy.html
8.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
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
<style>
#accuracy_data_page .table_wrap {
height: calc(100% - 70px);
margin-top: 25px;
}
#accuracy_data_page div.data_list {
overflow: auto;
height: calc(100% - 66px);
display: block;
position: relative;
font-size: 14px;
}
#accuracy_data_page table th:nth-of-type(1), #accuracy_data_page table td:nth-of-type(1) {
width: 10%;
}
#accuracy_data_page table th:nth-of-type(2), #accuracy_data_page table td:nth-of-type(2) {
width: 10%;
}
#accuracy_data_page table th:nth-of-type(3), #accuracy_data_page table td:nth-of-type(3) {
width: 10%;
}
#accuracy_data_page table th:nth-of-type(4), #accuracy_data_page table td:nth-of-type(4) {
width: 10%;
}
#accuracy_data_page table th:nth-of-type(5), #accuracy_data_page table td:nth-of-type(5) {
width: 10%;
}
#accuracy_data_page table th:nth-of-type(6), #accuracy_data_page table td:nth-of-type(6) {
width: 10%;
}
#accuracy_data_page table th:nth-of-type(7), #accuracy_data_page table td:nth-of-type(7) {
width: 10%;
}
#accuracy_data_page table th:nth-of-type(8), #accuracy_data_page table td:nth-of-type(8) {
width: 10%;
}
#accuracy_data_page table th:nth-of-type(9), #accuracy_data_page table td:nth-of-type(9) {
width: 10%;
}
#accuracy_data_page table th:nth-of-type(10), #accuracy_data_page table td:nth-of-type(10) {
width: 10%;
}
table i.material-icons {
font-size: 16px !important;
vertical-align: middle !important;
color: #FFC107;
margin-left: 2px;
cursor: default;
}
</style>
<div class="container-fluid page" id="accuracy_data_page">
<div class="card">
<div class="card-body" style="height: 100%">
<div class="top_form_card" style="width: 100%;">
<form>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label class="bmd-label-floating">日期</label>
<input type="text" name="rq" required class="form-control flatpickr_date">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label class="bmd-label-floating">线路</label>
<div class="ct_auto_wrap line_autocompleter">
<input type="text" name="lineName" required class="form-control" autocomplete="off">
</div>
</div>
</div>
<div class="col-md-2" style="padding-right: 0">
<div class="form-group">
<label class="bmd-label-floating">时间</label>
<input type="time" name="st" required class="form-control flatpickr_time" value="00:00">
</div>
</div>
<div class="col-md-2" style="padding-left: 0">
<div class="form-group">
<label class="bmd-label-floating">至</label>
<input type="time" name="et" required class="form-control flatpickr_time" value="09:30">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label class="bmd-label-floating">车辆</label>
<input type="text" name="nbbm" class="form-control " autocomplete="off">
</div>
</div>
<div class="col-md-1">
<div class="form-group">
<button type="submit" class="btn btn-primary btn-raised" style="margin-top: 22px;">
<i class="material-icons">search</i> 搜索
</button>
</div>
</div>
</div>
</form>
</div>
<div class="table_wrap">
<div class="table-responsive">
<table class="table table-hover" style="margin-bottom: 0;">
<thead class="">
<th>发布时间</th>
<th>站点</th>
<th>自编号</th>
<th>车牌号</th>
<th>站数</th>
<th>距离(米)</th>
<th>预计(秒)</th>
<th>实际(秒)</th>
<th>dd2</th>
<th>状态</th>
</thead>
</table>
<div class="data_list">
<table class="table table-hover">
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script id="accuracy_list-temp" type="text/html">
{{each list as obj i}}
<tr>
<td>{{obj.timeStr}}</td>
<td>{{obj.station}}</td>
<td>{{obj.nbbm}}</td>
<td>{{obj.plate}}</td>
<td>{{obj.stopDis}}</td>
<td>{{obj.distance}}</td>
<td>{{obj.seconds}}</td>
<td>{{obj.realSeconds}}</td>
<td>{{obj.d2}}</td>
<td>
{{if obj.status == 1}}
<span class="badge badge-success">准</span>
{{else if obj.status == -1}}
<span class="badge badge-danger">不准确</span>
{{/if}}
</td>
</tr>
{{/each}}
</script>
<script>
(function () {
var wrap = '#accuracy_data_page';
flatpickr(wrap + ' .flatpickr_date', flatpickrDateConfig);
$('[data-toggle="tooltip"]').tooltip();
//滚动条
$('div.data_list', wrap).perfectScrollbar({suppressScrollX: true});
//线路自动补全
$.get('/basic/lines', function (rs) {
var data = [], item;
for (var i = 0, len = rs.length; i < len; i++) {
item = rs[i];
data.push({
code: item.lineCode,
text: item.name,
others: [item.fullChars, item.camelChars]
});
}
gb_ct_autocompleter.build($('.line_autocompleter', wrap), data);
});
var f = $('form', wrap);
f.on('submit', function () {
try {
query();
} catch (e) {
console.log(e);
}
return false;
});
function query() {
var data = f.serializeJSON();
data.lineCode = $('[name=lineName]', f).data('val');
if (!data.rq) {
gb_utils.showNotification('参数异常', '必须选择日期', 'danger');
return;
}
$.get('/accuracy_data/search', data, function (rs) {
var diff;
for (var i = 0, len = rs.length; i < len; i++) {
rs[i].timeStr = moment(rs[i].t1).format('HH:mm');
diff = Math.abs(rs[i]['realSeconds'] - rs[i]['seconds']);
//是否准点
if (diff > 60 * 3)
rs[i].status = -1;
else {
if (diff / rs[i]['stopDis'] < 40)
rs[i].status = 1;
else
rs[i].status = -1;
}
}
var htmlStr = template('accuracy_list-temp', {list: rs});
$('div.data_list>table tbody', wrap).html(htmlStr);
$('div.data_list', wrap).perfectScrollbar('update');
});
}
})();
</script>