Commit 5febee8d433b7f20378dece9c4623cd191ad9838

Authored by 王通
1 parent 2e60002e

1.

src/main/resources/ms-jdbc.properties
... ... @@ -4,6 +4,6 @@
4 4 #ms.mysql.password= 123456
5 5  
6 6 ms.mysql.driver= com.mysql.jdbc.Driver
7   -ms.mysql.url= jdbc:mysql://192.168.168.152/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false
  7 +ms.mysql.url= jdbc:mysql://127.0.0.1/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false
8 8 ms.mysql.username= root
9   -ms.mysql.password= root2jsp
10 9 \ No newline at end of file
  10 +ms.mysql.password= Bsth@1+2
11 11 \ No newline at end of file
... ...
src/main/resources/static/login.html
... ... @@ -221,7 +221,7 @@
221 221 <div class="alert alert-danger"></div>
222 222 </div>
223 223  
224   - <div class="login-footer">© 2024 上海巴士拓华科技发展有限公司 Some Rights
  224 + <div class="login-footer">© 2024 湖南航盛电子科技有限公司 Some Rights
225 225 Reserved</div>
226 226 </div>
227 227  
... ...
src/main/resources/static/real_control_v2/js/home/line_panel.js
1   -/* home line panel */
2   -
3   -var gb_home_line_panel = (function() {
4   -
5   - var temps;
6   -
7   - var init = function(cb) {
8   - $.get('/real_control_v2/fragments/home/line_panel.html', function(dom) {
9   - temps = gb_common.compileTempByDom(dom);
10   -
11   - var tempRender = temps['home-gps-table-temp'];
12   - $('.home-line-card').each(function() {
13   - var line = gb_data_basic.codeToLine[$(this).data('line-code')];
14   -
15   - $('.data-wrap.up', this).html(tempRender({
16   - title: line.endStationName
17   - }));
18   - $('.data-wrap.down', this).html(tempRender({
19   - title: line.startStationName
20   - }));
21   -
22   - //draw svg
23   - gb_svg_chart.draw_line(line.lineCode, $('.svg-chart-wrap', this), true);
24   - });
25   -
26   - //fixed table head
27   - gb_ct_table.fixedHead($('.ct_table_wrap', '.home-panel'));
28   -
29   - //register gps refresh event
30   - gb_data_gps.registerCallback(gps_refresh_event);
31   -
32   - //表格滚动条
33   - $('.ct_table_wrap', '.home-panel').perfectScrollbar();
34   - cb && cb();
35   - });
36   - };
37   -
38   - var reload_gps_table = function () {
39   - var data = gb_common.groupBy(gb_common.get_vals(gb_data_gps.allGps), 'lineId');
40   - $('#home-main-content .home-line-card').each(function() {
41   - if($(this).is(':visible'))
42   - return true;
43   - var array = data[$(this).data('line-code')];
44   -
45   - });
46   - };
47   -
48   - var gps_refresh_event = function(addArr, upArr, upDownChange) {
49   - /*if(!$('.main-container #home-main-content').is(':visible'))
50   - return;*/
51   -
52   - //marker
53   - $.each(upArr, function() {
54   - this.update = true;
55   - });
56   - $.each(upDownChange, function() {
57   - this.changeUpDown = true;
58   - });
59   -
60   - var all = addArr.concat(upArr).concat(upDownChange);
61   - //refresh table
62   - var data = groupByLineAndUpDown(all);
63   - for (var key in data) {
64   - rederGpsTable(key, data[key]);
65   - }
66   -
67   - //refresh svg
68   - data = gb_common.groupBy(all, 'lineId');
69   - var svgs;
70   - for (var lineCode in data)
71   - gb_svg_chart.setGps(lineCode);
72   - };
73   -
74   - var rederGpsTable = function(key, list) {
75   - var $tbody = $('.home-gps-table>.ct_table_body', '#home_' + key),
76   - tempRender = temps['home-gps-tbody-temp'];
77   -
78   - for (var i = 0, gps; gps = list[i++];) {
79   - if (gps.update)
80   - updateRow($('#home_gps_' + gps.deviceId), gps);
81   - else if (gps.changeUpDown) {
82   - $('#home_gps_' + gps.deviceId).remove();
83   - gps.changeUpDown = false;
84   - i--;
85   - } else
86   - $tbody.append(tempRender(gps));
87   - }
88   -
89   - //更新滚动条
90   - $('.ct_table_wrap:visible', '.home-panel').perfectScrollbar('update');
91   -
92   - //sort table
93   - sortRows($tbody);
94   - //update car number badge
95   - var len = $tbody.find('dl').length;
96   - $('.data-title .no-badge', '#home_' + key).text(len);
97   - };
98   -
99   - var updateRow = function(e, t) {
100   - //var rows = e.clone();
101   - //e.hide();
102   - if(e.hasClass('offline'))
103   - e.removeClass('offline');
104   -
105   - var cells = e.find('dd');
106   - $(cells[2]).text(t.speed);
107   - $(cells[3]).html(t.expectStopTime == null ? '' : t.expectStopTime);
108   -
109   - //状态
110   - $(cells[4]).html(temps['home-gps-abnormal-temp'](t));
111   -
112   - if(!t.stationName)
113   - t.stationName='';
114   - $(cells[5]).text(t.stationName).attr('title', t.stationName);
115   -
116   - //班次信息
117   - if(t.sch){
118   - //console.log('t.sch', t.sch);
119   - $(cells[1]).text(t.sch.lpName);
120   - $(cells[6]).text(t.sch.zdzName);
121   - $(cells[7]).text(t.sch.zdsj);
122   - $(cells[8]).text(t.sch.jGh + '/' + t.sch.jName);
123   - }
124   - //e.show();
125   - };
126   -
127   - var sortRows = function($tbody) {
128   - var rows = $tbody.find('dl');
129   -
130   - rows.sort(function(a, b) {
131   - var rs;
132   - var acs = $(a).find('dd'),
133   - bcs = $(b).find('dd');
134   -
135   - var at = $t(acs[2]) == '' ? 9999 : parseFloat($t(acs[2])),
136   - bt = $t(bcs[2]) == '' ? 9999 : parseFloat($t(bcs[2]));
137   -
138   - rs = at - bt;
139   -
140   - if (rs == 0)
141   - rs = $t(acs[0]).localeCompare($t(bcs[0]));
142   -
143   - return rs;
144   - });
145   -
146   - $tbody.html(rows);
147   - };
148   -
149   - var $t = function(e) {
150   - return $(e).text();
151   - };
152   -
153   - function groupByLineAndUpDown(list) {
154   - var rs = {},
155   - key;
156   - $.each(list, function() {
157   - key = this.lineId + '_' + this.upDown;
158   - if (!rs[key])
159   - rs[key] = [];
160   -
161   - rs[key].push(this);
162   - });
163   -
164   - return rs;
165   - }
166   -
167   - /**
168   - * 设备掉线事件
169   - */
170   - gb_data_gps.registerOfflineCb(deviceOffline);
171   -
172   - function deviceOffline(gps) {
173   - //模拟图掉线
174   - gb_svg_chart.deviceOffline(gps);
175   - //主页表格掉线
176   - $('#home-main-content .data-body .home-gps-table dl#home_gps_'+gps.deviceId).addClass('offline');
177   - }
178   -
179   - //文件载入完毕
180   - res_load_ep.emitLater('load_home_line_panel');
181   -
182   -
183   - return {
184   - init: init
185   - };
186   -})();
  1 +/* home line panel */
  2 +
  3 +var gb_home_line_panel = (function() {
  4 +
  5 + var temps;
  6 +
  7 + var init = function(cb) {
  8 + $.get('/real_control_v2/fragments/home/line_panel.html', function(dom) {
  9 + temps = gb_common.compileTempByDom(dom);
  10 +
  11 + var tempRender = temps['home-gps-table-temp'];
  12 + $('.home-line-card').each(function() {
  13 + var line = gb_data_basic.codeToLine[$(this).data('line-code')];
  14 +
  15 + $('.data-wrap.up', this).html(tempRender({
  16 + title: line.endStationName
  17 + }));
  18 + $('.data-wrap.down', this).html(tempRender({
  19 + title: line.startStationName
  20 + }));
  21 +
  22 + //draw svg
  23 + gb_svg_chart.draw_line(line.lineCode, $('.svg-chart-wrap', this), true);
  24 + });
  25 +
  26 + //fixed table head
  27 + gb_ct_table.fixedHead($('.ct_table_wrap', '.home-panel'));
  28 +
  29 + //register gps refresh event
  30 + gb_data_gps.registerCallback(gps_refresh_event);
  31 +
  32 + //表格滚动条
  33 + $('.ct_table_wrap', '.home-panel').perfectScrollbar();
  34 + cb && cb();
  35 + });
  36 + };
  37 +
  38 + var reload_gps_table = function () {
  39 + var data = gb_common.groupBy(gb_common.get_vals(gb_data_gps.allGps), 'lineId');
  40 + $('#home-main-content .home-line-card').each(function() {
  41 + if($(this).is(':visible'))
  42 + return true;
  43 + var array = data[$(this).data('line-code')];
  44 +
  45 + });
  46 + };
  47 +
  48 + var gps_refresh_event = function(addArr, upArr, upDownChange) {
  49 + /*if(!$('.main-container #home-main-content').is(':visible'))
  50 + return;*/
  51 +
  52 + //marker
  53 + $.each(upArr, function() {
  54 + this.update = true;
  55 + });
  56 + $.each(upDownChange, function() {
  57 + this.changeUpDown = true;
  58 + });
  59 +
  60 + var all = addArr.concat(upArr).concat(upDownChange);
  61 + //refresh table
  62 + var data = groupByLineAndUpDown(all);
  63 + for (var key in data) {
  64 + rederGpsTable(key, data[key]);
  65 + }
  66 +
  67 + //refresh svg
  68 + data = gb_common.groupBy(all, 'lineId');
  69 + var svgs;
  70 + for (var lineCode in data)
  71 + gb_svg_chart.setGps(lineCode);
  72 + };
  73 +
  74 + var rederGpsTable = function(key, list) {
  75 + var $tbody = $('.home-gps-table>.ct_table_body', '#home_' + key),
  76 + tempRender = temps['home-gps-tbody-temp'];
  77 +
  78 + for (var i = 0, gps; gps = list[i++];) {
  79 + if (gps.update)
  80 + updateRow($('#home_gps_' + gps.deviceId), gps);
  81 + else if (gps.changeUpDown) {
  82 + $('#home_gps_' + gps.deviceId).remove();
  83 + gps.changeUpDown = false;
  84 + i--;
  85 + } else
  86 + $tbody.append(tempRender(gps));
  87 + }
  88 +
  89 + //更新滚动条
  90 + $('.ct_table_wrap:visible', '.home-panel').perfectScrollbar('update');
  91 +
  92 + //sort table
  93 + sortRows($tbody);
  94 + //update car number badge
  95 + var len = $tbody.find('dl').length;
  96 + $('.data-title .no-badge', '#home_' + key).text(len);
  97 + };
  98 +
  99 + var updateRow = function(e, t) {
  100 + //var rows = e.clone();
  101 + //e.hide();
  102 + if(e.hasClass('offline'))
  103 + e.removeClass('offline');
  104 +
  105 + var cells = e.find('dd');
  106 + $(cells[2]).text(t.speed);
  107 + $(cells[3]).html(t.expectStopTime == null ? '' : t.expectStopTime);
  108 +
  109 + //状态
  110 + $(cells[4]).html(temps['home-gps-abnormal-temp'](t));
  111 +
  112 + if(!t.stationName)
  113 + t.stationName='';
  114 + $(cells[5]).text(t.stationName).attr('title', t.stationName);
  115 +
  116 + //班次信息
  117 + if(t.sch){
  118 + //console.log('t.sch', t.sch);
  119 + $(cells[1]).text(t.sch.lpName);
  120 + $(cells[6]).text(t.sch.zdzName);
  121 + $(cells[7]).text(t.sch.zdsj);
  122 + //$(cells[8]).text(t.sch.jGh + '/' + t.sch.jName);
  123 + $(cells[8]).text(t.sch.jName);
  124 + }
  125 + //e.show();
  126 + };
  127 +
  128 + var sortRows = function($tbody) {
  129 + var rows = $tbody.find('dl');
  130 +
  131 + rows.sort(function(a, b) {
  132 + var rs;
  133 + var acs = $(a).find('dd'),
  134 + bcs = $(b).find('dd');
  135 +
  136 + var at = $t(acs[2]) == '' ? 9999 : parseFloat($t(acs[2])),
  137 + bt = $t(bcs[2]) == '' ? 9999 : parseFloat($t(bcs[2]));
  138 +
  139 + rs = at - bt;
  140 +
  141 + if (rs == 0)
  142 + rs = $t(acs[0]).localeCompare($t(bcs[0]));
  143 +
  144 + return rs;
  145 + });
  146 +
  147 + $tbody.html(rows);
  148 + };
  149 +
  150 + var $t = function(e) {
  151 + return $(e).text();
  152 + };
  153 +
  154 + function groupByLineAndUpDown(list) {
  155 + var rs = {},
  156 + key;
  157 + $.each(list, function() {
  158 + key = this.lineId + '_' + this.upDown;
  159 + if (!rs[key])
  160 + rs[key] = [];
  161 +
  162 + rs[key].push(this);
  163 + });
  164 +
  165 + return rs;
  166 + }
  167 +
  168 + /**
  169 + * 设备掉线事件
  170 + */
  171 + gb_data_gps.registerOfflineCb(deviceOffline);
  172 +
  173 + function deviceOffline(gps) {
  174 + //模拟图掉线
  175 + gb_svg_chart.deviceOffline(gps);
  176 + //主页表格掉线
  177 + $('#home-main-content .data-body .home-gps-table dl#home_gps_'+gps.deviceId).addClass('offline');
  178 + }
  179 +
  180 + //文件载入完毕
  181 + res_load_ep.emitLater('load_home_line_panel');
  182 +
  183 +
  184 + return {
  185 + init: init
  186 + };
  187 +})();
... ...