Commit 0cec34562fc61896542e41f61482dc630e2954e0
1 parent
6e21e4a2
update
Showing
7 changed files
with
57 additions
and
12 deletions
pom.xml
| ... | ... | @@ -18,6 +18,13 @@ |
| 18 | 18 | <groupId>org.springframework.boot</groupId> |
| 19 | 19 | <artifactId>spring-boot-starter-web</artifactId> |
| 20 | 20 | </dependency> |
| 21 | + | |
| 22 | + <!-- <dependency> | |
| 23 | + <groupId>org.springframework.boot</groupId> | |
| 24 | + <artifactId>spring-boot-starter-tomcat</artifactId> | |
| 25 | + <scope>provided</scope> | |
| 26 | + </dependency> --> | |
| 27 | + | |
| 21 | 28 | <dependency> |
| 22 | 29 | <groupId>org.springframework.boot</groupId> |
| 23 | 30 | <artifactId>spring-boot-starter-security</artifactId> | ... | ... |
src/main/java/com/bsth/entity/sys/Module.java
| ... | ... | @@ -18,11 +18,6 @@ import javax.persistence.Table; |
| 18 | 18 | |
| 19 | 19 | @Entity |
| 20 | 20 | @Table(name = "bsth_c_sys_module") |
| 21 | -@NamedEntityGraphs({ | |
| 22 | - @NamedEntityGraph(name = "module_roles", attributeNodes = { | |
| 23 | - @NamedAttributeNode("roles") | |
| 24 | - }) | |
| 25 | -}) | |
| 26 | 21 | public class Module { |
| 27 | 22 | |
| 28 | 23 | @Id |
| ... | ... | @@ -53,7 +48,7 @@ public class Module { |
| 53 | 48 | */ |
| 54 | 49 | private String groupType; |
| 55 | 50 | |
| 56 | - @ManyToMany(mappedBy = "modules", fetch = FetchType.LAZY) | |
| 51 | + @ManyToMany(mappedBy = "modules") | |
| 57 | 52 | private Set<Role> roles = new LinkedHashSet<>(); |
| 58 | 53 | |
| 59 | 54 | @Column(updatable = false,name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ... | ... |
src/main/java/com/bsth/repository/ModuleRepository.java
| ... | ... | @@ -21,7 +21,6 @@ public interface ModuleRepository extends BaseRepository<Module, Integer>{ |
| 21 | 21 | @Query("select m from Module m where m.id in ?1") |
| 22 | 22 | Set<Module> findByIds(List<Integer> ids); |
| 23 | 23 | |
| 24 | - @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH) | |
| 25 | 24 | @Override |
| 26 | 25 | List<Module> findAll(Specification<Module> spec); |
| 27 | 26 | } | ... | ... |
src/main/resources/static/pages/control/line/child_pages/child_task.html
| ... | ... | @@ -240,6 +240,7 @@ $(function(){ |
| 240 | 240 | var scheduleIdMap; |
| 241 | 241 | |
| 242 | 242 | var _data; //data.js引用 |
| 243 | + var _alone; //alone.js 引用 | |
| 243 | 244 | |
| 244 | 245 | //滚动时固定表头 |
| 245 | 246 | $('.custom-table-panel').on('scroll', function(){ |
| ... | ... | @@ -317,6 +318,7 @@ $(function(){ |
| 317 | 318 | //线路下拉框 |
| 318 | 319 | $('#childTaskDiv').on('init', function(e, ops ){ |
| 319 | 320 | _data = ops._data; |
| 321 | + _alone = ops._alone; | |
| 320 | 322 | //要选中的班次 |
| 321 | 323 | var schedul = ops.selected; |
| 322 | 324 | var lineData = [], lineName; |
| ... | ... | @@ -494,8 +496,14 @@ $(function(){ |
| 494 | 496 | param.zdzName = searchStationName(route, param.zdzCode); |
| 495 | 497 | |
| 496 | 498 | $post('/realSchedule', param, function(rs){ |
| 499 | + var sch = rs.t; | |
| 497 | 500 | //前端缓存更新 |
| 498 | - scheduleLineMap[param.xlBm][param.lpName].push(rs.t); | |
| 501 | + scheduleLineMap[param.xlBm][param.lpName].push(sch); | |
| 502 | + _data.pushSchedule(sch); | |
| 503 | + //刷新表格 | |
| 504 | + _alone.addScheduleToTable(sch); | |
| 505 | + //关闭弹出层 | |
| 506 | + layer.closeAll(); | |
| 499 | 507 | }); |
| 500 | 508 | }); |
| 501 | 509 | ... | ... |
src/main/resources/static/pages/control/line/js/alone.js
| ... | ... | @@ -62,6 +62,27 @@ var _alone = (function(){ |
| 62 | 62 | $tr.replaceWith(newTr); |
| 63 | 63 | initRemarksPop(); |
| 64 | 64 | }, |
| 65 | + //添加一个班次到表格 | |
| 66 | + addScheduleToTable: function(schedule){ | |
| 67 | + var upDown = schedule.xlDir==0?'up':'down'; | |
| 68 | + //重新渲染表格 | |
| 69 | + var table = $('#tab_line_' + schedule.xlBm).find('.pb-table[data-type='+upDown+']'); | |
| 70 | + //获取班次信息 | |
| 71 | + var schArray = _data.findSchByLine(schedule.xlBm, schedule.xlDir); | |
| 72 | + calculateLineNo( | |
| 73 | + table.find('tbody').html(template('alone_plan_table_temp', {list: schArray}))[0] | |
| 74 | + ); | |
| 75 | + | |
| 76 | + var currTr = table.find('tr[data-id='+schedule.id+']'); | |
| 77 | + console.log(currTr); | |
| 78 | + //重新设置滚动条, | |
| 79 | + table.find('._body').slimscroll({ | |
| 80 | + height: 'calc(100% - 80px)', | |
| 81 | + alwaysVisible: true, | |
| 82 | + start: currTr | |
| 83 | + }); | |
| 84 | + | |
| 85 | + }, | |
| 65 | 86 | //重新计算行号 |
| 66 | 87 | calculateLineNo: calculateLineNo |
| 67 | 88 | } | ... | ... |
src/main/resources/static/pages/control/line/js/data.js
| ... | ... | @@ -28,6 +28,23 @@ var _data = (function(){ |
| 28 | 28 | var carDeviceIdMapp = {}; |
| 29 | 29 | |
| 30 | 30 | var dataObject = { |
| 31 | + //根据线路和上下行获取计划排班 | |
| 32 | + findSchByLine: function(xlbm, upDown){ | |
| 33 | + var array = []; | |
| 34 | + $.each(scheduleList, function(){ | |
| 35 | + if(this.xlBm == xlbm | |
| 36 | + && this.xlDir == upDown) | |
| 37 | + array.push(this); | |
| 38 | + }); | |
| 39 | + | |
| 40 | + return array; | |
| 41 | + }, | |
| 42 | + //添加一个班次 | |
| 43 | + pushSchedule: function(sch){ | |
| 44 | + scheduleList.push(sch); | |
| 45 | + schedules[sch.id] = sch; | |
| 46 | + lineLpMap[sch.xlBm][sch.lpName].push(sch); | |
| 47 | + }, | |
| 31 | 48 | getLines: function(){ |
| 32 | 49 | return JSON.parse(storage.getItem('lineControlItems')); |
| 33 | 50 | }, | ... | ... |
src/main/resources/static/pages/control/line/js/rightMenu.js
| ... | ... | @@ -177,11 +177,9 @@ var _menu = (function() { |
| 177 | 177 | success: function(){ |
| 178 | 178 | dictionaryUtils.transformDom($('#childTaskDiv .nt-dictionary')); |
| 179 | 179 | $('#childTaskDiv').trigger('init', { |
| 180 | - //data: _data.getLineLpMap(), | |
| 181 | 180 | selected: schedul, |
| 182 | - _data: _data | |
| 183 | - //stationRoute: _data.getStationRouteByLine(schedul.xlBm), | |
| 184 | - // lineInformation: _data.getLineInformation(schedul.xlBm) | |
| 181 | + _data: _data, | |
| 182 | + _alone: _alone | |
| 185 | 183 | }); |
| 186 | 184 | } |
| 187 | 185 | }); | ... | ... |