alone.js
1.44 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
/**
* 单线路调度
*/
var _alone = (function(){
//暂时用文字判断上下行
var upCode = '上行'
,downCode = '下行';
var aloneObject = {
init: function(){
_data.queryRealSchedule(lineCodes, function(schList){
for(var lineCode in schList){
//按上下行拆分数据
var rs = splitDir(schList[lineCode])
,htmlStr = template('alone_main_temp', {up: rs.up, down: rs.down});
$('#tab_line_' + lineCode).append(htmlStr).find('._body')
//滚动条
.slimscroll({
height: 'calc(100% - 80px)',
alwaysVisible: true
});
//底部svg
_data.queryStationRoute(lineCode , 'lineSvg' + lineCode , drawSvg.init);
}
//绑定右键菜单事件
_menu.bindClickMenu();
$('.console-log .log-item-list').slimscroll({
height: '100%'
})
//托管Question
$('#tgQuestion').popover({
content: template('tg_question_info_temp', {}),
html: true,
placement: 'left',
trigger: 'hover',
container: '.portlet-fullscreen'
});
});
//$('.tab-pane.aloneline')
/*_data.queryStationRoute('10904' , 'lineSvg10904' , drawSvg.init);
*/
}
}
function splitDir(list){
var rs = {up: [], down: []};
$.each(list, function(){
if(this.xlDir == upCode)
rs.up.push(this);
else
rs.down.push(this);
});
return rs;
}
return aloneObject;
})();