Commit 81e157d825d79102651396b888d30cbb006ed307

Authored by 徐烜
1 parent d8bbd0bf

时刻表预览功能更新(拷贝bsth_control项目中的更新内容)

src/main/resources/application-dev.properties
... ... @@ -2,13 +2,13 @@ server.port=9088
2 2 management.port= 9001
3 3 management.address= 127.0.0.1
4 4  
5   -spring.jpa.hibernate.ddl-auto= update
  5 +spring.jpa.hibernate.ddl-auto= none
6 6 spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
7 7 #DATABASE
8 8 spring.jpa.database= MYSQL
9 9 spring.jpa.show-sql= true
10 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11   -spring.datasource.url= jdbc:mysql://127.0.0.1/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  11 +spring.datasource.url= jdbc:mysql://127.0.0.1/test_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 12 spring.datasource.username= root
13 13 spring.datasource.password=
14 14 #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
... ...
src/main/resources/application.properties
1 1 spring.profiles: dev,prod
2   -spring.profiles.active: prod
  2 +spring.profiles.active: dev
3 3  
4 4 spring.view.suffix=.html
5 5 server.session-timeout=-1
... ...
src/main/resources/static/pages/scheduleApp/Gruntfile.js
... ... @@ -87,8 +87,10 @@ module.exports = function (grunt) {
87 87 'module/common/dts2/guideboardGroup/saGuideboardgroup.js', // 路牌选择整合指令
88 88 'module/common/dts2/employeeGroup/saEmployeegroup.js', // 人员选饿整合指令
89 89 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令
90   - 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令
91   - 'module/common/dts2/ttinfotable/saTimeTableScrolly1.js', // 时刻表滚动1显示指令
  90 + 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令(编辑模式)
  91 + 'module/common/dts2/ttinfotable/saTimeTablePreView.js', // 时刻表显示指令(预览模式)
  92 + 'module/common/dts2/ttinfotable/saTimeTableScrolly1.js', // 时刻表滚动1显示指令(编辑模式)
  93 + 'module/common/dts2/ttinfotable/saTimeTableScrolly2.js', // 时刻表滚动2显示指令(预览模式)
92 94 'module/common/dts2/queryOption/saOrderOption.js', // saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的)
93 95 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排班计划form中使用)
94 96 'module/common/dts2/scheduleplan/saSrule.js', // saSrule指令(非通用指令,只在排班计划form中使用)
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreView.js 0 → 100644
  1 +/**
  2 + * saTimetablePreview指令,时刻表预览模式视图。
  3 + */
  4 +angular.module("ScheduleApp").directive(
  5 + "saTimetable2",
  6 + [
  7 + '$timeout',
  8 + function($timeout) {
  9 + return {
  10 + restrict : 'E',
  11 + templateUrl : '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreViewTemplate.html',
  12 + scope : { // 独立作用域
  13 + // 使用外部数据源,内部重新组合显示
  14 + ds : "=ngModel"
  15 + },
  16 + controllerAs : "$saTimeTablePreviewCtrl",
  17 + bindToController: true,
  18 + controller : function() {
  19 + var self = this;
  20 +
  21 + // 内部班次时刻模型
  22 + self.internalBcModel = {
  23 + up_qdz_name : "", // 上行起点站名字
  24 + down_qdz_name : "", // 下行起点站名字
  25 + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序)
  26 + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序)
  27 + };
  28 +
  29 + // 内部各个路牌block车次链模型
  30 + self.internalLpBlockModel = {
  31 + // key:路牌名字
  32 + // value: 数组(按照发车时间排序)
  33 + // value 数据内对象 {fcsj:发车时间,isUp:是否上行,fcno:发车顺序号,index:对应的班次列表索引}
  34 + };
  35 +
  36 + // TODO:
  37 + },
  38 +
  39 + /**,
  40 + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
  41 + * @param tElem
  42 + * @param tAttrs
  43 + * @returns {{pre: Function, post: Function}}
  44 + */
  45 + compile : function(tElem, tAttrs) {
  46 + // 获取属性
  47 + var $attr_name = tAttrs["name"]; // 控件的名字
  48 + if (!$attr_name) {
  49 + throw new Error("saTimeTablePreview指令 name属性required");
  50 + }
  51 +
  52 + // 内部controlAs名字
  53 + var ctrlAs = "$saTimeTablePreviewCtrl";
  54 +
  55 + // TODO:
  56 +
  57 + //------------------ 内部方法 --------------------//
  58 + var date_wrap_prefix = "2000-01-01 "; // 包装日期的前缀
  59 + var date_wrap_format = "YYYY-MM-DD HH:mm"; // 日期格式
  60 + /**
  61 + * 将时间包装成日期,方便计算。
  62 + * @param timeStr 时间格式,如 06:30
  63 + * @returns moment对象
  64 + */
  65 + var _fun_WrapTime = function(timeStr) {
  66 + return moment(
  67 + date_wrap_prefix + timeStr,
  68 + date_wrap_format
  69 + );
  70 + };
  71 +
  72 + /**
  73 + * 点击班次html元素(dl),触发班次移动,如下:
  74 + * 1、点击上行班次,下一个下行班次在下行班次列表中移到中间位置
  75 + * 2、点击下行班次,下一个上行班次在上行班次列表中移到中间位置
  76 + * @param ctrl 内部控制器
  77 + * @param index 班次索引
  78 + * @param isUp 是否上行
  79 + * @private
  80 + */
  81 + var _fun_bcDDViewMove = function(ctrl, index, isUp) {
  82 + // 获取当前点击班次对象
  83 + var oBc;
  84 + if (isUp) {
  85 + oBc = ctrl.internalBcModel.up_bc_list_asc[index];
  86 + } else {
  87 + oBc = ctrl.internalBcModel.down_bc_list_asc[index];
  88 + }
  89 +
  90 + // 找出车次链中的下一个班次索引,没有就undefined
  91 + var nextIndex = undefined;
  92 + var nextBlockBc = undefined;
  93 + var currentBlockBcIndex = undefined;
  94 + angular.forEach(ctrl.internalLpBlockModel[oBc.lpName], function(data, i) {
  95 + if (data.fcsj == oBc.fcsj) {
  96 + currentBlockBcIndex = i;
  97 + }
  98 + });
  99 + if (currentBlockBcIndex != undefined &&
  100 + currentBlockBcIndex < (ctrl.internalLpBlockModel[oBc.lpName].length - 1)) {
  101 + nextBlockBc = ctrl.internalLpBlockModel[oBc.lpName][currentBlockBcIndex + 1];
  102 + nextIndex = nextBlockBc.index;
  103 + }
  104 + // 先删除click标记,再添加
  105 + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data) {
  106 + delete data["isClick"];
  107 + });
  108 + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data) {
  109 + delete data["isClick"];
  110 + });
  111 + oBc.isClick = true;
  112 + if (nextIndex) {
  113 + if (nextBlockBc.isUp) {
  114 + ctrl.internalBcModel.up_bc_list_asc[nextIndex].isClick = true;
  115 + } else {
  116 + ctrl.internalBcModel.down_bc_list_asc[nextIndex].isClick = true;
  117 + }
  118 + }
  119 +
  120 + // 移动,同方向不移动
  121 + var clientHeight = angular.element("#temp").height() - 34;
  122 + if (nextBlockBc && isUp != nextBlockBc.isUp) {
  123 + if (isUp) { // 移动下行
  124 + angular.element(".ttpv_table_scrollbar:eq(1)").animate(
  125 + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400);
  126 + } else { // 移动上行
  127 + angular.element(".ttpv_table_scrollbar:eq(0)").animate(
  128 + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400);
  129 + }
  130 + }
  131 +
  132 + };
  133 +
  134 + /**
  135 + * 刷新内部数据。
  136 + * @param ctrl 内部控制器对象($saTimeTablePreviewCtrl)
  137 + * @private
  138 + */
  139 + var _fun_refreshInternalModel = function(ctrl) {
  140 + // 初始化内部数据
  141 + ctrl.internalBcModel = {
  142 + up_qdz_name : "", // 上行起点站名字
  143 + up_zdz_name : "", // 上行终点站名字
  144 + down_qdz_name : "", // 下行起点站名字
  145 + down_zdz_name : "", // 下行终点站名字
  146 + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序)
  147 + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序)
  148 + };
  149 + ctrl.internalLpBlockModel = {
  150 +
  151 + };
  152 +
  153 + // ngModel传入的数据
  154 + var dataSource = ctrl.ds.bcList;
  155 +
  156 + // 构造上下行班次列表,并确定上下行的首发站点
  157 + angular.forEach(dataSource, function(bcObj) {
  158 + var _internalBcObj = {};
  159 + // 构造内部班次对象
  160 + _internalBcObj.lpName = bcObj.lp.lpName; // 路牌
  161 + _internalBcObj.fcsj = bcObj.fcsj; // 发车时间
  162 + _internalBcObj.ddsj = _fun_WrapTime(bcObj.fcsj).add(bcObj.bcsj, "m").format("HH:mm");
  163 + _internalBcObj.qdzName = bcObj.qdzName; // 起点站名字
  164 + _internalBcObj.zdzName = bcObj.zdzName; // 终点站名字
  165 + _internalBcObj.bcType = bcObj.bcType; // 班次类型
  166 + _internalBcObj.isTs = bcObj.isTS; // 是否停驶
  167 + _internalBcObj.isFb = bcObj.isFB; // 是否分班
  168 + _internalBcObj.remark = bcObj.remark; // 备注
  169 + _internalBcObj._fcno = bcObj.fcno; // 发车顺序号
  170 +
  171 + if (bcObj.xlDir == "0") { // 上行
  172 + ctrl.internalBcModel.up_bc_list_asc.push(_internalBcObj);
  173 + // 确定起点站
  174 + if (ctrl.internalBcModel.up_qdz_name == "") {
  175 + if (bcObj.bcType == "normal") {
  176 + ctrl.internalBcModel.up_qdz_name = bcObj.qdzName;
  177 + }
  178 + }
  179 + // 确定终点站
  180 + if (ctrl.internalBcModel.up_zdz_name == "") {
  181 + if (bcObj.bcType == "normal") {
  182 + ctrl.internalBcModel.up_zdz_name = bcObj.zdzName;
  183 + }
  184 + }
  185 + }
  186 + if (bcObj.xlDir == "1") { // 下行
  187 + ctrl.internalBcModel.down_bc_list_asc.push(_internalBcObj);
  188 + // 确定起点站
  189 + if (ctrl.internalBcModel.down_qdz_name == "") {
  190 + if (bcObj.bcType == "normal") {
  191 + ctrl.internalBcModel.down_qdz_name = bcObj.qdzName;
  192 + }
  193 + }
  194 + // 确定终点站
  195 + if (ctrl.internalBcModel.down_zdz_name == "") {
  196 + if (bcObj.bcType == "normal") {
  197 + ctrl.internalBcModel.down_zdz_name = bcObj.zdzName;
  198 + }
  199 + }
  200 + }
  201 +
  202 + });
  203 +
  204 + // 发车时间升序排序上行班次
  205 + ctrl.internalBcModel.up_bc_list_asc.sort(function(a, b) {
  206 + var a_wrapTime = _fun_WrapTime(a.fcsj);
  207 + var b_wrapTime = _fun_WrapTime(b.fcsj);
  208 +
  209 + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定
  210 + // TODO:以后要配合首班车的发车时间判定
  211 + if (a.fcsj.indexOf("00:") == 0 ||
  212 + a.fcsj.indexOf("01:") == 0 ||
  213 + a.fcsj.indexOf("02:") == 0) {
  214 + a_wrapTime.add(1, "day");
  215 + }
  216 + if (b.fcsj.indexOf("00:") == 0 ||
  217 + b.fcsj.indexOf("01:") == 0 ||
  218 + b.fcsj.indexOf("02:") == 0) {
  219 + b_wrapTime.add(1, "day");
  220 + }
  221 +
  222 + if (a_wrapTime.isBefore(b_wrapTime)) {
  223 + return -1;
  224 + } else if (a_wrapTime.isAfter(b_wrapTime)) {
  225 + return 1;
  226 + } else {
  227 + return 0;
  228 + }
  229 +
  230 + });
  231 + // 发车时间升序排序下行班次
  232 + ctrl.internalBcModel.down_bc_list_asc.sort(function(a, b) {
  233 + var a_wrapTime = _fun_WrapTime(a.fcsj);
  234 + var b_wrapTime = _fun_WrapTime(b.fcsj);
  235 +
  236 + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定
  237 + // TODO:以后要配合首班车的发车时间判定
  238 + if (a.fcsj.indexOf("00:") == 0 ||
  239 + a.fcsj.indexOf("01:") == 0 ||
  240 + a.fcsj.indexOf("02:") == 0) {
  241 + a_wrapTime.add(1, "day");
  242 + }
  243 + if (b.fcsj.indexOf("00:") == 0 ||
  244 + b.fcsj.indexOf("01:") == 0 ||
  245 + b.fcsj.indexOf("02:") == 0) {
  246 + b_wrapTime.add(1, "day");
  247 + }
  248 +
  249 + if (a_wrapTime.isBefore(b_wrapTime)) {
  250 + return -1;
  251 + } else if (a_wrapTime.isAfter(b_wrapTime)) {
  252 + return 1;
  253 + } else {
  254 + return 0;
  255 + }
  256 + });
  257 +
  258 + // 构造路牌block车次链,按照发车顺序排序
  259 + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data, index) {
  260 + if (!ctrl.internalLpBlockModel[data.lpName]) {
  261 + ctrl.internalLpBlockModel[data.lpName] = [];
  262 + }
  263 + ctrl.internalLpBlockModel[data.lpName].push({
  264 + fcsj : data.fcsj,
  265 + isUp : true,
  266 + fcno : data._fcno,
  267 + index : index
  268 + });
  269 + });
  270 + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data, index) {
  271 + if (!ctrl.internalLpBlockModel[data.lpName]) {
  272 + ctrl.internalLpBlockModel[data.lpName] = [];
  273 + }
  274 + ctrl.internalLpBlockModel[data.lpName].push({
  275 + fcsj : data.fcsj,
  276 + isUp : false,
  277 + fcno : data._fcno,
  278 + index : index
  279 + });
  280 + });
  281 + angular.forEach(ctrl.internalLpBlockModel, function(value, key) {
  282 + value.sort(function (a, b) {
  283 + if (a.fcno < b.fcno) {
  284 + return -1;
  285 + } else if (a.fcno > b.fcno) {
  286 + return 1;
  287 + } else {
  288 + return 0;
  289 + }
  290 + });
  291 + });
  292 +
  293 +
  294 + };
  295 +
  296 + return {
  297 + pre : function(scope, element, attr) {
  298 + // TODO:
  299 + },
  300 + post : function(scope, element, attr) {
  301 + // 班次html点击事件
  302 + scope[ctrlAs].$$bcDD_Click = function(index, xlDir) {
  303 + _fun_bcDDViewMove(scope[ctrlAs], index, xlDir);
  304 + };
  305 +
  306 + // 监控ngModel绑定的外部数据源的刷新状态变化
  307 + scope.$watch(
  308 + function() {
  309 + return scope[ctrlAs].ds.refreshInfos;
  310 + },
  311 + function(newValue, oldValue) {
  312 + if (newValue === undefined && oldValue === undefined) {
  313 + return;
  314 + }
  315 + console.log("saTimetable2 refresh");
  316 + _fun_refreshInternalModel(scope[ctrlAs]);
  317 + },
  318 + true
  319 + );
  320 + }
  321 + };
  322 + }
  323 + };
  324 + }
  325 + ]
  326 +);
0 327 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreViewTemplate.html 0 → 100644
  1 +<style>
  2 + .ttpv_detail {
  3 + height: 100%;
  4 + }
  5 + .ttpv_detail .container-fluid {
  6 + height: 100%;
  7 + margin-left: 0;
  8 + }
  9 + .ttpv_detail .container-fluid>* {
  10 + padding: 0;
  11 + }
  12 + .ttpv_detail .container-fluid.top-container {
  13 + margin-top: 5px;
  14 + padding: 0;
  15 + }
  16 +
  17 + .ttpv_detail .detail-panel {
  18 + padding: 0;
  19 + height: 100%;
  20 + border: 1px solid #ddd;
  21 + background: #fafafa;
  22 + border-radius: 10px !important;
  23 + moz-user-select: -moz-none;
  24 + -moz-user-select: none;
  25 + -o-user-select: none;
  26 + -khtml-user-select: none;
  27 + -webkit-user-select: none;
  28 + -ms-user-select: none;
  29 + user-select: none;
  30 + }
  31 +
  32 + .ttpv_detail .detail-panel .detail-wrap {
  33 + height: calc(100% - 1px);
  34 + padding: 0;
  35 +
  36 + font-size: 14px;
  37 + color: #cccaca;
  38 + }
  39 +
  40 + .ttpv_detail .detail-panel .detail-wrap .detail-title {
  41 + margin: 7px 0 5px;
  42 + text-indent: 5px;
  43 + margin: 0;
  44 + height: 31px;
  45 + line-height: 31px;
  46 + color: #2765A7;
  47 + }
  48 +
  49 + .ttpv_detail .detail-panel .detail-wrap .detail-body {
  50 + height: calc(100% - 37px);
  51 + background: #fff;
  52 + }
  53 +
  54 + .ttpv_detail .detail-panel .detail-wrap .detail-body .ttpv_table_wrap {
  55 + width: 100%;
  56 + height: 100%;
  57 + border-left: 0;
  58 + border-bottom: 0;
  59 + overflow: auto;
  60 + }
  61 +
  62 +</style>
  63 +
  64 +<style>
  65 + /** 表格样式 */
  66 + .ttpv_table {
  67 + position: relative;
  68 + padding-top: 34px;
  69 + font-size: 13px;
  70 + }
  71 +
  72 + .ttpv_table dl {
  73 + display: block;
  74 + /*width: 100%;*/
  75 + margin: 0;
  76 + /*border-bottom: 1px solid;*/
  77 + cursor: default;
  78 + }
  79 + .ttpv_table dl {
  80 + font-size: 0;
  81 + white-space: nowrap;
  82 + }
  83 + .ttpv_table dl {
  84 + transition: all .1s ease;
  85 + }
  86 +
  87 + .ttpv_table dl dd, .ttpv_table dl dt {
  88 + display: inline-block;
  89 + white-space: nowrap;
  90 + overflow: hidden;
  91 + text-overflow: ellipsis;
  92 + height: 100%;
  93 + line-height: 34px;
  94 + border-right: 1px solid;
  95 + text-indent: 5px;
  96 + }
  97 + .ttpv_table dl dd, .ttpv_table dl dt {
  98 + border-right-color: #dedede;
  99 + font-size: 13px;
  100 + /*border-bottom: 1px solid #dedede;*/
  101 + border-top: 1px solid #dedede;
  102 + text-align: center;
  103 + }
  104 +
  105 + .ttpv_table > .ttpv_table_head {
  106 + position: absolute;
  107 + top: 0;
  108 + height: 34px;
  109 + background: #f5f5f5;
  110 + /*width: 100%;*/
  111 + line-height: 34px;
  112 + z-index: 1;
  113 + }
  114 + .ttpv_table_head dl {
  115 + border-bottom: 2px solid #96b9d7;
  116 + color: #333333;
  117 + height: 34px;
  118 + background-color: #f5f5f5;
  119 + }
  120 + .ttpv_table_head dl dt {
  121 + font-weight: normal;
  122 + font-size: 12px;
  123 + }
  124 +
  125 + .ttpv_table_head dl dt:nth-of-type(1) {
  126 + width: 50px;
  127 + height: 34px;
  128 + }
  129 + .ttpv_table_head dl dt:nth-of-type(2) {
  130 + width: 55px;
  131 + height: 34px;
  132 + }
  133 + .ttpv_table_head dl dt:nth-of-type(3) {
  134 + width: 120px;
  135 + height: 34px;
  136 + }
  137 + .ttpv_table_head dl dt:nth-of-type(4) {
  138 + width: 100px;
  139 + height: 34px;
  140 + }
  141 + .ttpv_table_head dl dt:nth-of-type(5) {
  142 + width: 200px;
  143 + height: 34px;
  144 + }
  145 +
  146 + .ttpv_table > .ttpv_table_body {
  147 + /*width: 100%;*/
  148 + position: absolute;
  149 + border-bottom: 1px solid #dedede;
  150 + }
  151 +
  152 + .ttpv_table_body dd.ists {
  153 + background: #105383 !important;
  154 + color: white !important;
  155 + }
  156 + .ttpv_table_body dd.region {
  157 + background: #686d7b !important;
  158 + color: white !important;
  159 + }
  160 + .ttpv_table_body dd.isfb {
  161 + background: #adff00 !important;
  162 + color: #501a1a !important;
  163 + }
  164 +
  165 + .ttpv_table_body dd.istsClick {
  166 + background: linear-gradient(to right,#8baabf,#105383,#808086)!important;
  167 + }
  168 + .ttpv_table_body dd.regionClick {
  169 + background: linear-gradient(to right,#8baabf,#686d7b,#a09997)!important;
  170 + }
  171 + .ttpv_table_body dd.isfbClick {
  172 + background: linear-gradient(to right,#8baabf,#adff00,#a09997)!important;
  173 + }
  174 +
  175 + .ttpv_table_body dl dd:nth-of-type(1) {
  176 + width: 50px;
  177 + height: 30px;
  178 + }
  179 + .ttpv_table_body dl dd:nth-of-type(2) {
  180 + width: 55px;
  181 + height: 30px;
  182 + }
  183 + .ttpv_table_body dl dd:nth-of-type(3) {
  184 + width: 120px;
  185 + height: 30px;
  186 + text-align: left;
  187 + }
  188 + .ttpv_table_body dl dd:nth-of-type(4) {
  189 + width: 100px;
  190 + height: 30px;
  191 + }
  192 + .ttpv_table_body dl dd:nth-of-type(5) {
  193 + width: 200px;
  194 + height: 30px;
  195 + }
  196 +
  197 + .ttpv_table_body dd:nth-of-type(1) {
  198 + color: #2765A7;
  199 + background: #eae8e8;
  200 + /*border-bottom: 1px solid #b3b3b3;*/
  201 + border-right: 1px solid #b3b3b3;
  202 + text-indent: -3px;
  203 + }
  204 + .ttpv_table_body dd:nth-of-type(n + 2) {
  205 + color: #2765A7;
  206 + }
  207 + .ttpv_table_body dl:hover {
  208 + box-shadow: 0 0 4px #656c71;
  209 + background: #f5fbff;
  210 + }
  211 + .ttpv_table_body dl:hover dd:nth-of-type(1) {
  212 + background: #fafafa;
  213 + background: linear-gradient(to right, #fafafa, #f5fbff);
  214 + }
  215 +
  216 + .isClick {
  217 + background: #8baabf!important;
  218 + color: #fff!important;
  219 + }
  220 +
  221 +</style>
  222 +
  223 +<style>
  224 + /** 滚动条css样式 */
  225 +
  226 + .ttpv_table_scrollbar::-webkit-scrollbar {
  227 + width: 18px;
  228 + height: 18px;
  229 + }
  230 +
  231 + .ttpv_table_scrollbar::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb {
  232 + border-radius: 999px;
  233 + border: 5px solid transparent;
  234 + }
  235 +
  236 + .ttpv_table_scrollbar::-webkit-scrollbar-track {
  237 + box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset;
  238 + }
  239 +
  240 + .ttpv_table_scrollbar::-webkit-scrollbar-thumb {
  241 + min-height: 20px;
  242 + background-clip: content-box;
  243 + box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset;
  244 + }
  245 +
  246 + .ttpv_table_scrollbar::-webkit-scrollbar-corner {
  247 + background: transparent;
  248 + }
  249 +</style>
  250 +
  251 +<div class="ttpv_detail">
  252 + <div class="container-fluid top-container">
  253 + <div class="col-md-12 container-fluid">
  254 + <div class="col-md-6" style="height: 100%; padding-right: 3px;">
  255 + <div class="detail-panel">
  256 + <div class="detail-wrap" >
  257 + <h3 class="detail-title">
  258 + 上行:
  259 + {{$saTimeTablePreviewCtrl.internalBcModel.up_qdz_name}}
  260 + <i class="fa fa-angle-double-right" aria-hidden="true"></i>
  261 + {{$saTimeTablePreviewCtrl.internalBcModel.up_zdz_name}}
  262 + </h3>
  263 + <div id="temp" class="detail-body">
  264 + <div class="ttpv_table_wrap ttpv_table_scrollbar" sa-tscrolly2 scrclass = ".upFixHead">
  265 + <div class="ttpv_table">
  266 + <div class="ttpv_table_head upFixHead">
  267 + <dl>
  268 + <dt>序号</dt>
  269 + <dt>路牌</dt>
  270 + <dt>发车时间</dt>
  271 + <dt>到达时间</dt>
  272 + <dt>备注</dt>
  273 + </dl>
  274 + </div>
  275 + <div class="ttpv_table_body">
  276 + <dl ng-repeat="bc in $saTimeTablePreviewCtrl.internalBcModel.up_bc_list_asc track by $index"
  277 + ng-click="$saTimeTablePreviewCtrl.$$bcDD_Click($index, true)">
  278 + <dd>{{$index + 1}}</dd>
  279 + <dd ng-class="{isClick : bc.isClick}">
  280 + {{bc.lpName}}
  281 + </dd>
  282 + <dd ng-class="{
  283 + ists: (bc.isTs && !bc.isClick),
  284 + istsClick: (bc.isTs && bc.isClick),
  285 + region: (bc.bcType == 'region' && !bc.isClick),
  286 + regionClick : (bc.bcType == 'region' && bc.isClick),
  287 + isfb: (bc.isFb && !bc.isClick),
  288 + isfbClick : (bc.isFb && bc.isClick),
  289 + isClick: bc.isClick}">
  290 + {{bc.fcsj}}
  291 + <span class="badge"
  292 + style="border-radius: 2px !important; background-color: #f9a124;"
  293 + ng-show="bc.bcType == 'out'">出场</span>
  294 + <span class="badge"
  295 + style="border-radius: 2px !important; background-color: #f9a124;"
  296 + ng-show="bc.bcType == 'in'">进场</span>
  297 + </dd>
  298 + <dd ng-class="{isClick : bc.isClick}">
  299 + {{bc.ddsj}}
  300 + </dd>
  301 + <dd ng-class="{isClick : bc.isClick}">{{bc.remark}}</dd>
  302 + </dl>
  303 + </div>
  304 + </div>
  305 + </div>
  306 + </div>
  307 + </div>
  308 + </div>
  309 + </div>
  310 +
  311 + <div class="col-md-6" style="height: 100%; padding-left: 3px;">
  312 + <div class="detail-panel">
  313 + <div class="detail-wrap" >
  314 + <h3 class="detail-title">
  315 + 下行:
  316 + {{$saTimeTablePreviewCtrl.internalBcModel.down_qdz_name}}
  317 + <i class="fa fa-angle-double-right" aria-hidden="true"></i>
  318 + {{$saTimeTablePreviewCtrl.internalBcModel.down_zdz_name}}
  319 + </h3>
  320 + <div class="detail-body">
  321 + <div class="ttpv_table_wrap ttpv_table_scrollbar" sa-tscrolly2 scrclass = ".downFixHead">
  322 + <div class="ttpv_table">
  323 + <div class="ttpv_table_head downFixHead">
  324 + <dl>
  325 + <dt>序号</dt>
  326 + <dt>路牌</dt>
  327 + <dt>发车时间</dt>
  328 + <dt>到达时间</dt>
  329 + <dt>备注</dt>
  330 + </dl>
  331 + </div>
  332 + <div class="ttpv_table_body">
  333 + <dl ng-repeat="bc in $saTimeTablePreviewCtrl.internalBcModel.down_bc_list_asc track by $index"
  334 + ng-click="$saTimeTablePreviewCtrl.$$bcDD_Click($index, false)">
  335 + <dd>{{$index + 1}}</dd>
  336 + <dd ng-class="{isClick : bc.isClick}">
  337 + {{bc.lpName}}
  338 + </dd>
  339 + <dd ng-class="{
  340 + ists: (bc.isTs && !bc.isClick),
  341 + istsClick: (bc.isTs && bc.isClick),
  342 + region: (bc.bcType == 'region' && !bc.isClick),
  343 + regionClick : (bc.bcType == 'region' && bc.isClick),
  344 + isfb: (bc.isFb && !bc.isClick),
  345 + isfbClick : (bc.isFb && bc.isClick),
  346 + isClick: bc.isClick}">
  347 + {{bc.fcsj}}
  348 + <span class="badge"
  349 + style="border-radius: 2px !important; background-color: #f9a124;"
  350 + ng-show="bc.bcType == 'out'">出场</span>
  351 + <span class="badge"
  352 + style="border-radius: 2px !important; background-color: #f9a124;"
  353 + ng-show="bc.bcType == 'in'">进场</span>
  354 + </dd>
  355 + <dd ng-class="{isClick : bc.isClick}">
  356 + {{bc.ddsj}}
  357 + </dd>
  358 + <dd ng-class="{isClick : bc.isClick}">{{bc.remark}}</dd>
  359 + </dl>
  360 + </div>
  361 + </div>
  362 + </div>
  363 + </div>
  364 + </div>
  365 + </div>
  366 + </div>
  367 +
  368 + </div>
  369 + </div>
  370 +</div>
  371 +
  372 +
  373 +
  374 +
  375 +
  376 +
  377 +
  378 +
  379 +
  380 +
  381 +
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableScrolly2.js 0 → 100644
  1 +/**
  2 + * 滚动事件控制指令。
  3 + */
  4 +angular.module('ScheduleApp').directive(
  5 + 'saTscrolly2',
  6 + [
  7 + function() {
  8 + return {
  9 + restrict: 'A',
  10 +
  11 + compile: function(tElem, tAttrs) {
  12 +
  13 + return {
  14 + pre: function(scope, element, attr) {
  15 + // TODO:
  16 + //alert(element.find("#tooltipTest").html());
  17 + //$compile(element.find("#tooltipTest"))(scope);
  18 +
  19 + },
  20 +
  21 + post: function(scope, element, attr) {
  22 + //var head = element[0];
  23 +
  24 + //console.log("llllllllload");
  25 + //console.log(element.name);
  26 +
  27 + element.bind('scroll', function() {
  28 + //console.log("top=", angular.element(".tt_table_head").css("top"));
  29 + //console.log("left=", angular.element(".tt_table_head").css("left"));
  30 + //console.log("s top=" + element.scrollTop());
  31 +
  32 + angular.element(attr.scrclass).css("top", element.scrollTop());
  33 + // angular.element(".tt_table_head:eq(0)").css("left", element.scrollLeft());
  34 + // angular.element(".tt_table_body:eq(0)").css("left", element.scrollLeft());
  35 +
  36 + });
  37 + }
  38 +
  39 + };
  40 + }
  41 + }
  42 + }
  43 + ]
  44 +);
0 45 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -4407,6 +4407,332 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4407 4407 ]
4408 4408 );
4409 4409  
  4410 +/**
  4411 + * saTimetablePreview指令,时刻表预览模式视图。
  4412 + */
  4413 +angular.module("ScheduleApp").directive(
  4414 + "saTimetable2",
  4415 + [
  4416 + '$timeout',
  4417 + function($timeout) {
  4418 + return {
  4419 + restrict : 'E',
  4420 + templateUrl : '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreViewTemplate.html',
  4421 + scope : { // 独立作用域
  4422 + // 使用外部数据源,内部重新组合显示
  4423 + ds : "=ngModel"
  4424 + },
  4425 + controllerAs : "$saTimeTablePreviewCtrl",
  4426 + bindToController: true,
  4427 + controller : function() {
  4428 + var self = this;
  4429 +
  4430 + // 内部班次时刻模型
  4431 + self.internalBcModel = {
  4432 + up_qdz_name : "", // 上行起点站名字
  4433 + down_qdz_name : "", // 下行起点站名字
  4434 + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序)
  4435 + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序)
  4436 + };
  4437 +
  4438 + // 内部各个路牌block车次链模型
  4439 + self.internalLpBlockModel = {
  4440 + // key:路牌名字
  4441 + // value: 数组(按照发车时间排序)
  4442 + // value 数据内对象 {fcsj:发车时间,isUp:是否上行,fcno:发车顺序号,index:对应的班次列表索引}
  4443 + };
  4444 +
  4445 + // TODO:
  4446 + },
  4447 +
  4448 + /**,
  4449 + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
  4450 + * @param tElem
  4451 + * @param tAttrs
  4452 + * @returns {{pre: Function, post: Function}}
  4453 + */
  4454 + compile : function(tElem, tAttrs) {
  4455 + // 获取属性
  4456 + var $attr_name = tAttrs["name"]; // 控件的名字
  4457 + if (!$attr_name) {
  4458 + throw new Error("saTimeTablePreview指令 name属性required");
  4459 + }
  4460 +
  4461 + // 内部controlAs名字
  4462 + var ctrlAs = "$saTimeTablePreviewCtrl";
  4463 +
  4464 + // TODO:
  4465 +
  4466 + //------------------ 内部方法 --------------------//
  4467 + var date_wrap_prefix = "2000-01-01 "; // 包装日期的前缀
  4468 + var date_wrap_format = "YYYY-MM-DD HH:mm"; // 日期格式
  4469 + /**
  4470 + * 将时间包装成日期,方便计算。
  4471 + * @param timeStr 时间格式,如 06:30
  4472 + * @returns moment对象
  4473 + */
  4474 + var _fun_WrapTime = function(timeStr) {
  4475 + return moment(
  4476 + date_wrap_prefix + timeStr,
  4477 + date_wrap_format
  4478 + );
  4479 + };
  4480 +
  4481 + /**
  4482 + * 点击班次html元素(dl),触发班次移动,如下:
  4483 + * 1、点击上行班次,下一个下行班次在下行班次列表中移到中间位置
  4484 + * 2、点击下行班次,下一个上行班次在上行班次列表中移到中间位置
  4485 + * @param ctrl 内部控制器
  4486 + * @param index 班次索引
  4487 + * @param isUp 是否上行
  4488 + * @private
  4489 + */
  4490 + var _fun_bcDDViewMove = function(ctrl, index, isUp) {
  4491 + // 获取当前点击班次对象
  4492 + var oBc;
  4493 + if (isUp) {
  4494 + oBc = ctrl.internalBcModel.up_bc_list_asc[index];
  4495 + } else {
  4496 + oBc = ctrl.internalBcModel.down_bc_list_asc[index];
  4497 + }
  4498 +
  4499 + // 找出车次链中的下一个班次索引,没有就undefined
  4500 + var nextIndex = undefined;
  4501 + var nextBlockBc = undefined;
  4502 + var currentBlockBcIndex = undefined;
  4503 + angular.forEach(ctrl.internalLpBlockModel[oBc.lpName], function(data, i) {
  4504 + if (data.fcsj == oBc.fcsj) {
  4505 + currentBlockBcIndex = i;
  4506 + }
  4507 + });
  4508 + if (currentBlockBcIndex != undefined &&
  4509 + currentBlockBcIndex < (ctrl.internalLpBlockModel[oBc.lpName].length - 1)) {
  4510 + nextBlockBc = ctrl.internalLpBlockModel[oBc.lpName][currentBlockBcIndex + 1];
  4511 + nextIndex = nextBlockBc.index;
  4512 + }
  4513 + // 先删除click标记,再添加
  4514 + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data) {
  4515 + delete data["isClick"];
  4516 + });
  4517 + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data) {
  4518 + delete data["isClick"];
  4519 + });
  4520 + oBc.isClick = true;
  4521 + if (nextIndex) {
  4522 + if (nextBlockBc.isUp) {
  4523 + ctrl.internalBcModel.up_bc_list_asc[nextIndex].isClick = true;
  4524 + } else {
  4525 + ctrl.internalBcModel.down_bc_list_asc[nextIndex].isClick = true;
  4526 + }
  4527 + }
  4528 +
  4529 + // 移动,同方向不移动
  4530 + var clientHeight = angular.element("#temp").height() - 34;
  4531 + if (nextBlockBc && isUp != nextBlockBc.isUp) {
  4532 + if (isUp) { // 移动下行
  4533 + angular.element(".ttpv_table_scrollbar:eq(1)").animate(
  4534 + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400);
  4535 + } else { // 移动上行
  4536 + angular.element(".ttpv_table_scrollbar:eq(0)").animate(
  4537 + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400);
  4538 + }
  4539 + }
  4540 +
  4541 + };
  4542 +
  4543 + /**
  4544 + * 刷新内部数据。
  4545 + * @param ctrl 内部控制器对象($saTimeTablePreviewCtrl)
  4546 + * @private
  4547 + */
  4548 + var _fun_refreshInternalModel = function(ctrl) {
  4549 + // 初始化内部数据
  4550 + ctrl.internalBcModel = {
  4551 + up_qdz_name : "", // 上行起点站名字
  4552 + up_zdz_name : "", // 上行终点站名字
  4553 + down_qdz_name : "", // 下行起点站名字
  4554 + down_zdz_name : "", // 下行终点站名字
  4555 + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序)
  4556 + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序)
  4557 + };
  4558 + ctrl.internalLpBlockModel = {
  4559 +
  4560 + };
  4561 +
  4562 + // ngModel传入的数据
  4563 + var dataSource = ctrl.ds.bcList;
  4564 +
  4565 + // 构造上下行班次列表,并确定上下行的首发站点
  4566 + angular.forEach(dataSource, function(bcObj) {
  4567 + var _internalBcObj = {};
  4568 + // 构造内部班次对象
  4569 + _internalBcObj.lpName = bcObj.lp.lpName; // 路牌
  4570 + _internalBcObj.fcsj = bcObj.fcsj; // 发车时间
  4571 + _internalBcObj.ddsj = _fun_WrapTime(bcObj.fcsj).add(bcObj.bcsj, "m").format("HH:mm");
  4572 + _internalBcObj.qdzName = bcObj.qdzName; // 起点站名字
  4573 + _internalBcObj.zdzName = bcObj.zdzName; // 终点站名字
  4574 + _internalBcObj.bcType = bcObj.bcType; // 班次类型
  4575 + _internalBcObj.isTs = bcObj.isTS; // 是否停驶
  4576 + _internalBcObj.isFb = bcObj.isFB; // 是否分班
  4577 + _internalBcObj.remark = bcObj.remark; // 备注
  4578 + _internalBcObj._fcno = bcObj.fcno; // 发车顺序号
  4579 +
  4580 + if (bcObj.xlDir == "0") { // 上行
  4581 + ctrl.internalBcModel.up_bc_list_asc.push(_internalBcObj);
  4582 + // 确定起点站
  4583 + if (ctrl.internalBcModel.up_qdz_name == "") {
  4584 + if (bcObj.bcType == "normal") {
  4585 + ctrl.internalBcModel.up_qdz_name = bcObj.qdzName;
  4586 + }
  4587 + }
  4588 + // 确定终点站
  4589 + if (ctrl.internalBcModel.up_zdz_name == "") {
  4590 + if (bcObj.bcType == "normal") {
  4591 + ctrl.internalBcModel.up_zdz_name = bcObj.zdzName;
  4592 + }
  4593 + }
  4594 + }
  4595 + if (bcObj.xlDir == "1") { // 下行
  4596 + ctrl.internalBcModel.down_bc_list_asc.push(_internalBcObj);
  4597 + // 确定起点站
  4598 + if (ctrl.internalBcModel.down_qdz_name == "") {
  4599 + if (bcObj.bcType == "normal") {
  4600 + ctrl.internalBcModel.down_qdz_name = bcObj.qdzName;
  4601 + }
  4602 + }
  4603 + // 确定终点站
  4604 + if (ctrl.internalBcModel.down_zdz_name == "") {
  4605 + if (bcObj.bcType == "normal") {
  4606 + ctrl.internalBcModel.down_zdz_name = bcObj.zdzName;
  4607 + }
  4608 + }
  4609 + }
  4610 +
  4611 + });
  4612 +
  4613 + // 发车时间升序排序上行班次
  4614 + ctrl.internalBcModel.up_bc_list_asc.sort(function(a, b) {
  4615 + var a_wrapTime = _fun_WrapTime(a.fcsj);
  4616 + var b_wrapTime = _fun_WrapTime(b.fcsj);
  4617 +
  4618 + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定
  4619 + // TODO:以后要配合首班车的发车时间判定
  4620 + if (a.fcsj.indexOf("00:") == 0 ||
  4621 + a.fcsj.indexOf("01:") == 0 ||
  4622 + a.fcsj.indexOf("02:") == 0) {
  4623 + a_wrapTime.add(1, "day");
  4624 + }
  4625 + if (b.fcsj.indexOf("00:") == 0 ||
  4626 + b.fcsj.indexOf("01:") == 0 ||
  4627 + b.fcsj.indexOf("02:") == 0) {
  4628 + b_wrapTime.add(1, "day");
  4629 + }
  4630 +
  4631 + if (a_wrapTime.isBefore(b_wrapTime)) {
  4632 + return -1;
  4633 + } else if (a_wrapTime.isAfter(b_wrapTime)) {
  4634 + return 1;
  4635 + } else {
  4636 + return 0;
  4637 + }
  4638 +
  4639 + });
  4640 + // 发车时间升序排序下行班次
  4641 + ctrl.internalBcModel.down_bc_list_asc.sort(function(a, b) {
  4642 + var a_wrapTime = _fun_WrapTime(a.fcsj);
  4643 + var b_wrapTime = _fun_WrapTime(b.fcsj);
  4644 +
  4645 + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定
  4646 + // TODO:以后要配合首班车的发车时间判定
  4647 + if (a.fcsj.indexOf("00:") == 0 ||
  4648 + a.fcsj.indexOf("01:") == 0 ||
  4649 + a.fcsj.indexOf("02:") == 0) {
  4650 + a_wrapTime.add(1, "day");
  4651 + }
  4652 + if (b.fcsj.indexOf("00:") == 0 ||
  4653 + b.fcsj.indexOf("01:") == 0 ||
  4654 + b.fcsj.indexOf("02:") == 0) {
  4655 + b_wrapTime.add(1, "day");
  4656 + }
  4657 +
  4658 + if (a_wrapTime.isBefore(b_wrapTime)) {
  4659 + return -1;
  4660 + } else if (a_wrapTime.isAfter(b_wrapTime)) {
  4661 + return 1;
  4662 + } else {
  4663 + return 0;
  4664 + }
  4665 + });
  4666 +
  4667 + // 构造路牌block车次链,按照发车顺序排序
  4668 + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data, index) {
  4669 + if (!ctrl.internalLpBlockModel[data.lpName]) {
  4670 + ctrl.internalLpBlockModel[data.lpName] = [];
  4671 + }
  4672 + ctrl.internalLpBlockModel[data.lpName].push({
  4673 + fcsj : data.fcsj,
  4674 + isUp : true,
  4675 + fcno : data._fcno,
  4676 + index : index
  4677 + });
  4678 + });
  4679 + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data, index) {
  4680 + if (!ctrl.internalLpBlockModel[data.lpName]) {
  4681 + ctrl.internalLpBlockModel[data.lpName] = [];
  4682 + }
  4683 + ctrl.internalLpBlockModel[data.lpName].push({
  4684 + fcsj : data.fcsj,
  4685 + isUp : false,
  4686 + fcno : data._fcno,
  4687 + index : index
  4688 + });
  4689 + });
  4690 + angular.forEach(ctrl.internalLpBlockModel, function(value, key) {
  4691 + value.sort(function (a, b) {
  4692 + if (a.fcno < b.fcno) {
  4693 + return -1;
  4694 + } else if (a.fcno > b.fcno) {
  4695 + return 1;
  4696 + } else {
  4697 + return 0;
  4698 + }
  4699 + });
  4700 + });
  4701 +
  4702 +
  4703 + };
  4704 +
  4705 + return {
  4706 + pre : function(scope, element, attr) {
  4707 + // TODO:
  4708 + },
  4709 + post : function(scope, element, attr) {
  4710 + // 班次html点击事件
  4711 + scope[ctrlAs].$$bcDD_Click = function(index, xlDir) {
  4712 + _fun_bcDDViewMove(scope[ctrlAs], index, xlDir);
  4713 + };
  4714 +
  4715 + // 监控ngModel绑定的外部数据源的刷新状态变化
  4716 + scope.$watch(
  4717 + function() {
  4718 + return scope[ctrlAs].ds.refreshInfos;
  4719 + },
  4720 + function(newValue, oldValue) {
  4721 + if (newValue === undefined && oldValue === undefined) {
  4722 + return;
  4723 + }
  4724 + console.log("saTimetable2 refresh");
  4725 + _fun_refreshInternalModel(scope[ctrlAs]);
  4726 + },
  4727 + true
  4728 + );
  4729 + }
  4730 + };
  4731 + }
  4732 + };
  4733 + }
  4734 + ]
  4735 +);
4410 4736 /**
4411 4737 * 滚动事件控制指令。
4412 4738 */
... ... @@ -4451,6 +4777,50 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4451 4777 }
4452 4778 ]
4453 4779 );
  4780 +/**
  4781 + * 滚动事件控制指令。
  4782 + */
  4783 +angular.module('ScheduleApp').directive(
  4784 + 'saTscrolly2',
  4785 + [
  4786 + function() {
  4787 + return {
  4788 + restrict: 'A',
  4789 +
  4790 + compile: function(tElem, tAttrs) {
  4791 +
  4792 + return {
  4793 + pre: function(scope, element, attr) {
  4794 + // TODO:
  4795 + //alert(element.find("#tooltipTest").html());
  4796 + //$compile(element.find("#tooltipTest"))(scope);
  4797 +
  4798 + },
  4799 +
  4800 + post: function(scope, element, attr) {
  4801 + //var head = element[0];
  4802 +
  4803 + //console.log("llllllllload");
  4804 + //console.log(element.name);
  4805 +
  4806 + element.bind('scroll', function() {
  4807 + //console.log("top=", angular.element(".tt_table_head").css("top"));
  4808 + //console.log("left=", angular.element(".tt_table_head").css("left"));
  4809 + //console.log("s top=" + element.scrollTop());
  4810 +
  4811 + angular.element(attr.scrclass).css("top", element.scrollTop());
  4812 + // angular.element(".tt_table_head:eq(0)").css("left", element.scrollLeft());
  4813 + // angular.element(".tt_table_body:eq(0)").css("left", element.scrollLeft());
  4814 +
  4815 + });
  4816 + }
  4817 +
  4818 + };
  4819 + }
  4820 + }
  4821 + }
  4822 + ]
  4823 +);
4454 4824 /**
4455 4825 * saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的)
4456 4826 * 属性如下:
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -344,7 +344,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;GuideboardManageService_g&#39;, [&#39;$resource&#39;,
344 344 return {
345 345 rest: $resource(
346 346 '/gic/:id',
347   - {order: 'xl,isCancel,lpNo', direction: 'DESC,ASC,ASC', id: '@id'},
  347 + {order: 'xl.name,isCancel,lpNo', direction: 'DESC,ASC,ASC', id: '@id'},
348 348 {
349 349 list: {
350 350 method: 'GET',
... ... @@ -417,7 +417,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;rerunManageService_g&#39;, [&#39;$resource&#39;, func
417 417 return {
418 418 rest: $resource(
419 419 '/rms/:id',
420   - {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id'},
  420 + {order: 'rerunXl.name,isCancel', direction: 'ASC', id: '@id'},
421 421 {
422 422 list: {
423 423 method: 'GET',
... ... @@ -791,6 +791,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(
791 791 '/tidc/:id',
792 792 {order: 'createDate', direction: 'DESC', id: '@id'},
793 793 {
  794 + list: {
  795 + method: 'GET',
  796 + params: {
  797 + page: 0
  798 + },
  799 + transformResponse: function(rs) {
  800 + var dst = angular.fromJson(rs);
  801 + if (dst.status == 'SUCCESS') {
  802 + return dst.data;
  803 + } else {
  804 + return dst; // 业务错误留给控制器处理
  805 + }
  806 + }
  807 + },
794 808 get: {
795 809 method: 'GET',
796 810 transformResponse: function(rs) {
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
... ... @@ -37,10 +37,13 @@
37 37 <!--<i class="fa fa-arrow-down" aria-hidden="true"></i>-->
38 38 <!--<span style="padding-right: 10px;">下行班次</span>-->
39 39 <!--<i class="fa fa-circle-o-notch" aria-hidden="true"></i>-->
40   - <span style="padding-right: 10px;background: #105383;color: white;text-align: center;">停驶班次</span>
41   - <span style="padding-right: 10px;background: #686d7b;color: white;text-align: center;">区间班次</span>
42   - <!--<i class="fa fa-adjust" aria-hidden="true"></i>-->
43   - <span style="padding-right: 10px;background: #adff00;color: #501a1a;text-align: center;">分班班次</span>
  40 +
  41 + <a href="javascript:" class="btn blue" style="padding-right: 5px;" ng-click="ctrl.switchView()">
  42 + <i class="fa fa-exchange"></i>
  43 + {{ctrl.currentView.switchBtnMsg}}
  44 + </a>
  45 +
  46 +
44 47  
45 48 <!--<div class="btn-group">-->
46 49 <!--<a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">-->
... ... @@ -87,40 +90,67 @@
87 90 </div>
88 91  
89 92 <div class="portlet-body">
90   - <div style="padding-bottom: 5px;">
91   - <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.multiselect()">
92   - <i class="fa fa-file-excel-o"></i>
93   - 批量选择
94   - </a>
95   - <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.editInfos()">
96   - <i class="fa fa-pencil-square-o"></i>
97   - 批量修改
98   - </a>
  93 + <div style="padding-bottom: 10px; height: 20px;">
  94 + <div style="float: left">
  95 + <a href="javascript:" style="padding-right: 5px;"
  96 + ng-click="ctrl.multiselect()"
  97 + ng-show="ctrl.currentView.btn1">
  98 + <i class="fa fa-file-excel-o"></i>
  99 + 批量选择
  100 + </a>
  101 + <a href="javascript:" style="padding-right: 5px;"
  102 + ng-click="ctrl.editInfos()"
  103 + ng-show="ctrl.currentView.btn2">
  104 + <i class="fa fa-pencil-square-o"></i>
  105 + 批量修改
  106 + </a>
  107 +
  108 + <a sweetalert
  109 + sweet-options="{title: '是否删除选定的班次?',text: '线路:' + ctrl.xlname + '</br>时刻表:' + ctrl.ttname + '</br>谨慎删除!', html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
  110 + sweet-on-confirm="ctrl.deleteInfos()"
  111 + style="padding-right: 5px;"
  112 + ng-show="ctrl.currentView.btn3">
  113 + <i class="fa fa-trash"></i>
  114 + 批量删除
  115 + </a>
  116 + <a href="javascript:" style="padding-right: 5px;"
  117 + ng-click="ctrl.clearsel()"
  118 + ng-show="ctrl.currentView.btn4">
  119 + <i class="fa fa-eraser"></i>
  120 + 取消选择
  121 + </a>
  122 + <a href="javascript:" style="padding-right: 5px;"
  123 + ng-click="ctrl.refresh()"
  124 + ng-show="ctrl.currentView.btn5">
  125 + <i class="fa fa-refresh"></i>
  126 + 刷新数据
  127 + </a>
  128 + </div>
  129 +
  130 +
  131 + <div style="float: right;">
  132 + <span style="padding-right: 10px;background: #105383;color: white;text-align: center;">停驶班次</span>
  133 + <span style="padding-right: 10px;background: #686d7b;color: white;text-align: center;">区间班次</span>
  134 + <!--<i class="fa fa-adjust" aria-hidden="true"></i>-->
  135 + <span style="padding-right: 10px;background: #adff00;color: #501a1a;text-align: center;">分班班次</span>
  136 + </div>
99 137  
100   - <a sweetalert
101   - sweet-options="{title: '是否删除选定的班次?',text: '线路:' + ctrl.xlname + '</br>时刻表:' + ctrl.ttname + '</br>谨慎删除!', html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
102   - sweet-on-confirm="ctrl.deleteInfos()"
103   - style="padding-right: 5px;" >
104   - <i class="fa fa-trash"></i>
105   - 批量删除
106   - </a>
107   - <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.clearsel()">
108   - <i class="fa fa-eraser"></i>
109   - 取消选择
110   - </a>
111   - <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.refresh()">
112   - <i class="fa fa-refresh"></i>
113   - 刷行数据
114   - </a>
115 138 </div>
116 139  
117 140 <!--<div ng-view></div>-->
118   - <div style="height: {{ctrl.ttHeight}}px;">
  141 + <div style="height: {{ctrl.ttHeight}}px;"
  142 + ng-show="ctrl.currentView.viewId == 1">
119 143 <sa-Timetable name="tt" ng-model="ctrl.editInfo" ng-model-options="{ getterSetter: true }" celldbclick="ctrl.singleEditBcDetail">
120 144  
121 145 </sa-Timetable>
122 146 </div>
123 147  
  148 + <div style="height: {{ctrl.ttHeight}}px;"
  149 + ng-show="ctrl.currentView.viewId == 2">
  150 + <sa-Timetable2 name="tt2" ng-model="ctrl.pvInfo" ng-model-options="{ getterSetter: true }" >
  151 +
  152 + </sa-Timetable2>
  153 + </div>
124 154  
125 155 </div>
126 156 </div>
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
... ... @@ -12,7 +12,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
12 12 // 查询对象类
13 13 var queryClass = service.rest;
14 14  
15   - // 时刻表信息
  15 + // 时刻表信息(编辑视图使用)
16 16 var editInfo = {
17 17 detailHeads: [], // 时刻表头信息
18 18 detailInfos: [], // 时刻表明细信息
... ... @@ -20,6 +20,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
20 20 yydesc: "" // 营运汇总描述
21 21 };
22 22  
  23 + // 时刻表信息(预览视图使用)
  24 + var pvInfo = {
  25 + bcList : [], // 班次列表
  26 + refreshInfos : undefined // 刷新信息
  27 + };
  28 +
23 29 return {
24 30 getQueryClass: function() {
25 31 return queryClass;
... ... @@ -27,6 +33,31 @@ angular.module(&#39;ScheduleApp&#39;).factory(
27 33 getEditInfo: function() {
28 34 return editInfo;
29 35 },
  36 + getPvInfo : function() {
  37 + return pvInfo;
  38 + },
  39 +
  40 + /**
  41 + * 获取预览用的时刻表明细数据。
  42 + * @param ttid 时刻表id
  43 + */
  44 + refreshPvInfo : function(ttid) {
  45 + service.rest.list(
  46 + {page : 0, size : 1000, "ttinfo.id_eq" : ttid},
  47 + function(result) {
  48 + if (result.content.length > 0) {
  49 + pvInfo.bcList = result.content;
  50 + if (pvInfo.refreshInfos == undefined) {
  51 + pvInfo.refreshInfos = {
  52 + count : 1 // 刷新次数
  53 + };
  54 + } else {
  55 + pvInfo.refreshInfos.count ++;
  56 + }
  57 + }
  58 + }
  59 + );
  60 + },
30 61  
31 62 /**
32 63 * 获取编辑用的时刻表明细数据。
... ... @@ -269,6 +300,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(
269 300 };
270 301  
271 302 self.editInfo = undefined;
  303 + self.pvInfo = undefined;
272 304  
273 305 $scope.$watch(
274 306 function() {
... ... @@ -280,6 +312,17 @@ angular.module(&#39;ScheduleApp&#39;).controller(
280 312 true
281 313 );
282 314  
  315 + $scope.$watch(
  316 + function() {
  317 + return service.getPvInfo();
  318 + },
  319 + function(n, o) {
  320 + self.pvInfo = n;
  321 + },
  322 + true
  323 + );
  324 +
  325 +
283 326 // 清除选择
284 327 self.clearsel = function() {
285 328 var ds = service.getEditInfo().detailInfos;
... ... @@ -291,7 +334,39 @@ angular.module(&#39;ScheduleApp&#39;).controller(
291 334 };
292 335 // 刷新时刻表数据
293 336 self.refresh = function() {
294   - service.refreshEditInfo(self.xlid, self.ttid);
  337 + // TODO:目前只有2个视图,内部toggle,以后多个视图需传入viewId
  338 + if (self.currentView.viewId == 1) {
  339 + service.refreshEditInfo(self.xlid, self.ttid);
  340 + } else {
  341 + service.refreshPvInfo(self.ttid);
  342 + }
  343 + };
  344 +
  345 + // 切换视图(编辑视图/预览视图)
  346 + self.viewInfos = {
  347 + "editView" : {
  348 + viewId : 1,
  349 + switchBtnMsg : "切换预览视图",
  350 + btn1 : true,
  351 + btn2 : true,
  352 + btn3 : true,
  353 + btn4 : true,
  354 + btn5 : true
  355 + },
  356 + "preView" : {
  357 + viewId : 2,
  358 + switchBtnMsg : "切换编辑视图",
  359 + btn5 : true
  360 + }
  361 + };
  362 + self.currentView = self.viewInfos["editView"]; // 默认编辑视图
  363 + self.switchView = function() {
  364 + // TODO:目前只有2个视图,内部toggle,以后多个视图需传入viewId
  365 + if (self.currentView.viewId == 1) {
  366 + self.currentView = self.viewInfos["preView"];
  367 + } else {
  368 + self.currentView = self.viewInfos["editView"];
  369 + }
295 370 };
296 371  
297 372 self.ttHeight = 500; // 时刻表的高度
... ... @@ -431,8 +506,9 @@ angular.module(&#39;ScheduleApp&#39;).controller(
431 506  
432 507 };
433 508  
434   - if (self.rflag) { // 是否刷新
435   - self.refresh(); // 刷新数据
  509 + if (self.rflag) { // 是否初始刷新数据
  510 + service.refreshEditInfo(self.xlid, self.ttid);
  511 + service.refreshPvInfo(self.ttid);
436 512 }
437 513  
438 514 // TODO:
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js
... ... @@ -108,6 +108,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(
108 108 '/tidc/:id',
109 109 {order: 'createDate', direction: 'DESC', id: '@id'},
110 110 {
  111 + list: {
  112 + method: 'GET',
  113 + params: {
  114 + page: 0
  115 + },
  116 + transformResponse: function(rs) {
  117 + var dst = angular.fromJson(rs);
  118 + if (dst.status == 'SUCCESS') {
  119 + return dst.data;
  120 + } else {
  121 + return dst; // 业务错误留给控制器处理
  122 + }
  123 + }
  124 + },
111 125 get: {
112 126 method: 'GET',
113 127 transformResponse: function(rs) {
... ...