Commit 6e18c1c450796dfcb1559f625e36fc3ab5f9da04

Authored by 潘钊
2 parents ce7e5e3c 4ce1c757
Showing 24 changed files with 965 additions and 101 deletions
src/main/java/com/bsth/controller/schedule/TTInfoController.java
... ... @@ -2,11 +2,13 @@ package com.bsth.controller.schedule;
2 2  
3 3 import com.bsth.controller.BaseController;
4 4 import com.bsth.entity.schedule.TTInfo;
  5 +import com.bsth.repository.schedule.TTInfoRepository;
5 6 import com.bsth.service.schedule.utils.DataToolsProperties;
6 7 import org.springframework.beans.factory.annotation.Autowired;
7 8 import org.springframework.boot.context.properties.EnableConfigurationProperties;
8   -import org.springframework.web.bind.annotation.RequestMapping;
9   -import org.springframework.web.bind.annotation.RestController;
  9 +import org.springframework.web.bind.annotation.*;
  10 +
  11 +import java.util.Map;
10 12  
11 13 /**
12 14 * Created by xu on 16/5/12.
... ... @@ -17,9 +19,41 @@ import org.springframework.web.bind.annotation.RestController;
17 19 public class TTInfoController extends BaseController<TTInfo, Long> {
18 20 @Autowired
19 21 private DataToolsProperties dataToolsProperties;
  22 + @Autowired
  23 + private TTInfoRepository ttInfoRepository;
20 24  
21 25 @Override
22 26 protected String getDataImportKtrClasspath() {
23 27 return dataToolsProperties.getTtinfoDatainputktr();
24 28 }
  29 +
  30 + /**
  31 + * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody
  32 + * @Title: save
  33 + * @Description: TODO(持久化对象)
  34 + * @param @param t
  35 + * @param @return 设定文件
  36 + * @return Map<String,Object> {status: 1(成功),-1(失败)}
  37 + * @throws
  38 + */
  39 + @RequestMapping(method = RequestMethod.POST)
  40 + public Map<String, Object> save(@RequestBody TTInfo t){
  41 + return baseService.save(t);
  42 + }
  43 +
  44 + @Override
  45 + public TTInfo findById(@PathVariable("id") Long aLong) {
  46 + return ttInfoRepository.findOneExtend(aLong);
  47 + }
  48 +
  49 + /**
  50 + * 验证。
  51 + * @param map
  52 + * @return
  53 + */
  54 + @RequestMapping(value = "/validate/equale", method = RequestMethod.GET)
  55 + public Map<String, Object> validateData(@RequestParam Map<String, Object> map) {
  56 + // 一般比较自编号是否重复
  57 + return baseService.validateEquale(map);
  58 + }
25 59 }
... ...
src/main/java/com/bsth/entity/schedule/TTInfo.java
... ... @@ -13,7 +13,9 @@ import java.util.Date;
13 13 @Table(name="bsth_c_s_ttinfo")
14 14 @NamedEntityGraphs({
15 15 @NamedEntityGraph(name = "ttInfo_xl", attributeNodes = {
16   - @NamedAttributeNode("xl")
  16 + @NamedAttributeNode("xl"),
  17 + @NamedAttributeNode("createBy"),
  18 + @NamedAttributeNode("updateBy")
17 19 })
18 20 })
19 21 public class TTInfo {
... ... @@ -28,7 +30,7 @@ public class TTInfo {
28 30 private Line xl;
29 31  
30 32 /** 时刻表名称 */
31   - @Column(nullable = false, unique = true)
  33 + @Column(nullable = false)
32 34 private String name;
33 35 /** 线路方向(TODO:上下行,上行,下行,这个以后用枚举还是字典再议,现在先用文字) */
34 36 @Column(nullable = false)
... ... @@ -36,11 +38,13 @@ public class TTInfo {
36 38 /** 启用日期 */
37 39 @Column(nullable = false)
38 40 private Date qyrq;
39   - /** 模版类型(TODO:时刻表,间隔式,这个以后用枚举还是字典再议,现在先用文字) */
40   - private String templateType;
41 41 /** 是否启用调度模版 */
  42 + @Column(nullable = false)
42 43 private Boolean isEnableDisTemplate;
43 44  
  45 + /** 模版类型(TODO:时刻表,间隔式,这个以后用枚举还是字典再议,现在先用文字) */
  46 + private String templateType;
  47 +
44 48 // TODO:还有很多判定条件,这里先不放
45 49  
46 50 /** 路牌数 */
... ... @@ -55,12 +59,6 @@ public class TTInfo {
55 59 /** 特殊有效日期(格式:2001-01-01,多个用逗号隔开) */
56 60 private String special_days;
57 61  
58   -
59   -
60   - /** 是否启用(这个是算出来的,不持久化) */
61   - @Transient
62   - private boolean isEnable;
63   -
64 62 /** 操作人员关联 */
65 63 @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
66 64 private SysUser createBy;
... ... @@ -163,14 +161,6 @@ public class TTInfo {
163 161 this.special_days = special_days;
164 162 }
165 163  
166   - public boolean isEnable() {
167   - return isEnable;
168   - }
169   -
170   - public void setIsEnable(boolean isEnable) {
171   - this.isEnable = isEnable;
172   - }
173   -
174 164 public SysUser getCreateBy() {
175 165 return createBy;
176 166 }
... ...
src/main/java/com/bsth/repository/SectionRouteRepository.java
... ... @@ -52,7 +52,7 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int
52 52 " b.section_type AS sectionType," +
53 53 " b.csection_vector AS sectionCsectionVector," +
54 54 " AsText(b.bsection_vector) AS sectionBsectionVector," +
55   - " AsText(b.gsection_vector) sectionGsectionVector," +
  55 + " AsText(b.gsection_vector) AS sectionGsectionVector," +
56 56 " b.road_coding AS sectionRoadCoding," +
57 57 " b.section_distance AS sectionDistance," +
58 58 " b.section_time AS sectionTime," +
... ...
src/main/java/com/bsth/repository/schedule/TTInfoRepository.java
1 1 package com.bsth.repository.schedule;
2 2  
  3 +import com.bsth.entity.schedule.EmployeeConfigInfo;
3 4 import com.bsth.entity.schedule.TTInfo;
4 5 import com.bsth.repository.BaseRepository;
5 6 import org.springframework.data.domain.Page;
6 7 import org.springframework.data.domain.Pageable;
7 8 import org.springframework.data.jpa.domain.Specification;
8 9 import org.springframework.data.jpa.repository.EntityGraph;
  10 +import org.springframework.data.jpa.repository.Query;
9 11 import org.springframework.stereotype.Repository;
10 12  
11 13 /**
... ... @@ -17,4 +19,8 @@ public interface TTInfoRepository extends BaseRepository&lt;TTInfo, Long&gt; {
17 19 @EntityGraph(value = "ttInfo_xl", type = EntityGraph.EntityGraphType.FETCH)
18 20 @Override
19 21 Page<TTInfo> findAll(Specification<TTInfo> spec, Pageable pageable);
  22 +
  23 + @EntityGraph(value = "ttInfo_xl", type = EntityGraph.EntityGraphType.FETCH)
  24 + @Query("select cc from TTInfo cc where cc.id=?1")
  25 + TTInfo findOneExtend(Long aLong);
20 26 }
... ...
src/main/java/com/bsth/service/impl/StationServiceImpl.java
... ... @@ -335,12 +335,30 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
335 335 arg0.setDbType(dbType);
336 336  
337 337  
  338 + String gLonxStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").toString();
  339 +
  340 + String gLatyStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").toString();
  341 +
  342 + float gLonx = 0.0f;
  343 +
  344 + float gLaty = 0.0f;
  345 +
338 346 /** to WGS坐标 */
339 347 Location resultPoint = FromBDPointToWGSPoint(bLonx,bLatx);
340 348  
341   - arg0.setgLonx((float)resultPoint.getLng());
  349 + if(gLonxStr==null)
  350 + gLonx = (float)resultPoint.getLng();
  351 + else
  352 + gLonx = Float.valueOf(gLonxStr);
  353 +
  354 + if(gLatyStr==null)
  355 + gLaty = (float)resultPoint.getLat();
  356 + else
  357 + gLaty = Float.valueOf(gLatyStr);
  358 +
  359 + arg0.setgLonx(gLonx);
342 360  
343   - arg0.setgLaty((float)resultPoint.getLat());
  361 + arg0.setgLaty(gLaty);
344 362  
345 363 // 站点地理位置WGS坐标经度
346 364 // String gLonx = JSONObject.parseObject(stationsArray.getJSONObject(i).get("WGSpotion").toString()).get("Lng").toString();
... ...
src/main/resources/datatools/config-dev.properties
... ... @@ -12,11 +12,11 @@ datatools.kettle_properties=/datatools/kettle.properties
12 12  
13 13 ##------------------ ktr通用变量 ------------------
14 14 #数据库ip地址
15   -datatools.kvars_dbip=192.168.168.171
  15 +datatools.kvars_dbip=127.0.0.1
16 16 #数据库用户名
17 17 datatools.kvars_dbuname=root
18 18 #数据库密码
19   -datatools.kvars_dbpwd=root2jsp
  19 +datatools.kvars_dbpwd=
20 20  
21 21 # 以下是封装数据导入导出逻辑的ktr转换文件,类路径,以后考虑放到数据库中
22 22 # 测试temp的ktr转换文件
... ...
src/main/resources/static/pages/base/line/add.html
... ... @@ -220,8 +220,8 @@
220 220 <input type="text" class="form-control" name="endPhone" id="startPhoneInput" placeholder="终点站调度电话">
221 221 </div>
222 222 </div>
223   - <!--
224   - 起始站名称
  223 +
  224 + <!-- 起始站名称 -->
225 225 <div class="form-group">
226 226 <label class="control-label col-md-3"> 起始站名称: </label>
227 227 <div class="col-md-4">
... ... @@ -229,6 +229,14 @@
229 229 </div>
230 230 </div>
231 231  
  232 + <!-- 终点站名称 -->
  233 + <div class="form-group">
  234 + <label class="control-label col-md-3"> 终点站名称: </label>
  235 + <div class="col-md-4">
  236 + <input type="text" class="form-control" name="endStationName" id="endStationNameInput" placeholder="终点站名称">
  237 + </div>
  238 + </div>
  239 + <!--
232 240 起始站首班车时间
233 241 <div class="form-group">
234 242 <label class="control-label col-md-3"> 起始站首班车时间: </label>
... ... @@ -246,14 +254,6 @@
246 254 </div>
247 255  
248 256  
249   - 终点站名称
250   - <div class="form-group">
251   - <label class="control-label col-md-3"> 终点站名称: </label>
252   - <div class="col-md-4">
253   - <input type="text" class="form-control" name="endStationName" id="endStationNameInput" placeholder="终点站名称">
254   - </div>
255   - </div>
256   -
257 257 终点站首班时间
258 258 <div class="form-group">
259 259 <label class="control-label col-md-3"> 终点站首班车时间: </label>
... ...
src/main/resources/static/pages/base/line/edit.html
... ... @@ -219,7 +219,23 @@
219 219 </div>
220 220 </div>
221 221  
222   - <!-- 车辆总数 -->
  222 + <!-- 起始站名称 -->
  223 + <div class="form-group">
  224 + <label class="control-label col-md-3"> 起始站名称: </label>
  225 + <div class="col-md-4">
  226 + <input type="text" class="form-control" name="startStationName" id="startStationNameInput" placeholder="起始站名称">
  227 + </div>
  228 + </div>
  229 +
  230 + <!-- 终点站名称 -->
  231 + <div class="form-group">
  232 + <label class="control-label col-md-3"> 终点站名称: </label>
  233 + <div class="col-md-4">
  234 + <input type="text" class="form-control" name="endStationName" id="endStationNameInput" placeholder="终点站名称">
  235 + </div>
  236 + </div>
  237 +
  238 + <!-- 车辆总数 -->
223 239 <div class="form-group">
224 240 <label class="control-label col-md-3"> 车辆总数: </label>
225 241 <div class="col-md-4">
... ...
src/main/resources/static/pages/base/line/list.html
... ... @@ -50,14 +50,14 @@
50 50 <tr role="row" class="heading">
51 51 <th width="2%">#</th>
52 52 <th width="4%">序号</th>
53   - <th width="7%">线路编码</th>
  53 + <th width="5%">线路编码</th>
54 54 <th width="8%">线路名称</th>
55 55 <th width="7%">所属公司</th>
56 56 <!-- 闵行没有下属公司,这里暂时注释掉 -->
57 57 <!-- <th width="8%">所属分公司</th> -->
58 58 <th width="6%">线路性质</th>
59 59 <th width="6%">线路等级</th>
60   - <th width="7%">上海市线路编码</th>
  60 + <th width="8%">上海市线路编码</th>
61 61 <th width="7%">是否撤销</th>
62 62 <th width="6%">线路标准</th>
63 63 <th width="6%">站点详情</th>
... ...
src/main/resources/static/pages/base/section/js/add-form-wizard.js
... ... @@ -304,9 +304,9 @@ var FormWizard = function() {
304 304  
305 305 var paramsStationsArray = [];
306 306  
307   - paramsStationsArray[0] = stationStartValue;
  307 + paramsStationsArray[0] = stationStartValue+'公交车站';
308 308  
309   - paramsStationsArray[1]= stationEndValue;
  309 + paramsStationsArray[1]= stationEndValue+'公交车站';
310 310  
311 311 $('#sectionNameInput').val(stationStartValue + '至' + stationEndValue );
312 312  
... ... @@ -329,9 +329,9 @@ var FormWizard = function() {
329 329  
330 330 }else if(baseResValue ==1) {
331 331  
332   - SectionVmapWorlds.localSearchFromAdreesToPoint(stationStartValue);
  332 + SectionVmapWorlds.localSearchFromAdreesToPoint(stationStartValue+'公交车站');
333 333  
334   - SectionVmapWorlds.localSearchFromAdreesToPoint(stationEndValue);
  334 + SectionVmapWorlds.localSearchFromAdreesToPoint(stationEndValue+'公交车站');
335 335  
336 336 SectionVmapWorlds.drawingManagerOpen();
337 337  
... ...
src/main/resources/static/pages/base/station/js/add-form-wizard.js
... ... @@ -322,7 +322,7 @@ var FormWizard = function() {
322 322  
323 323 if(baseResValue == 0) {
324 324  
325   - StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {
  325 + StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV+'公交车站',function(p) {
326 326  
327 327 if(p) {
328 328  
... ... @@ -337,7 +337,7 @@ var FormWizard = function() {
337 337  
338 338 }else if(baseResValue ==1) {
339 339  
340   - StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {});
  340 + StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV+'公交车站',function(p) {});
341 341  
342 342 $('.leftUtils').show();
343 343  
... ...
src/main/resources/static/pages/base/stationroute/addstationstemplate.html
... ... @@ -25,8 +25,8 @@
25 25 <label class="control-label col-md-3">
26 26 <span class="required"> * </span> 站点名称:
27 27 </label>
28   - <div class="col-md-6">
29   - <textarea class="form-control" rows="10" name="stations" id="stationsInput" placeholder="站点名称"></textarea>
  28 + <div class="col-md-9">
  29 + <textarea class="form-control" rows="12" name="stations" id="stationsInput" placeholder="站点名称"></textarea>
30 30 </div>
31 31 </div>
32 32  
... ... @@ -35,7 +35,16 @@
35 35 <div class="form-group">
36 36 <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50">
37 37 <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 手动添加站点规划说明: </span></h5>
38   - <p><span class="help-block" style="color:#1bbc9b;">&nbsp;请在文本域中按站点顺序依次输入站点名称,每输入完一个站名时请按回车键(Enter)换行.</span> </p>
  38 + <p>
  39 + <span class="help-block" style="color:#1bbc9b;">
  40 + &nbsp;请在文本域中按站点顺序依次输入站点名称(如果已有站点GPS坐标,请将坐标跟在站点名称后面用【Tab】键隔开),每输入完一个站名时请按回车键【Enter】换行.
  41 + 例如:<br><br>
  42 + <!-- <HR style="FILTER: alpha(opacity=0,finishopacity=100,style=1)" width="80%" color=#987cb9 SIZE=3> -->
  43 + 浦东大道金桥路 121.496612 31.238960<br>
  44 + 浦东大道居家桥路 121.496618 31.238957<br>
  45 + 浦东大道德平路 121.496622 31.238948<br>
  46 + </span>
  47 + </p>
39 48 </div>
40 49 </div>
41 50 </form>
... ... @@ -143,9 +152,45 @@ $(&#39;#add_station_template_mobal&#39;).on(&#39;AddStationTempMobal.show&#39;, function(e,map,a
143 152 // 站点名称字符串切割
144 153 var paramsStationsArray = params.stations.split('\r\n');
145 154  
146   - // 根据站点名称获取百度坐标
147   - map.stationsNameToPoints(paramsStationsArray,function(resultJson) {
  155 + var stationList = [];
  156 +
  157 + var len = paramsStationsArray.length;
  158 +
  159 + if(len>0) {
  160 +
  161 + for(var k =0;k<len;k++) {
  162 +
  163 + debugger;
  164 +
  165 + if(paramsStationsArray[k]=="")
  166 + continue;
  167 +
  168 + var tempStr = paramsStationsArray[k].split('\t');
  169 +
  170 + if(tempStr.length<2){
  171 +
  172 + stationList.push({name:paramsStationsArray[k]+"公交车站",wgs:{x:'',y:''}});
  173 +
  174 + }else {
  175 +
  176 + stationList.push({name:tempStr[0]+"公交车站",wgs:{x:tempStr[1], y:tempStr[2]}});
  177 +
  178 + }
  179 +
  180 + }
  181 +
  182 + }else {
148 183  
  184 + layer.msg('请按说明规则输入站点!');
  185 +
  186 + return;
  187 +
  188 + }
  189 + console.log(stationList);
  190 + // 根据站点名称获取百度坐标
  191 + map.stationsNameToPoints(stationList,function(resultJson) {
  192 + console.log(resultJson);
  193 + debugger;
149 194 // 根据坐标点获取两点之间的时间与距离
150 195 map.getDistanceAndDuration(resultJson,function(stationdataList) {
151 196  
... ... @@ -216,7 +261,7 @@ $(&#39;#add_station_template_mobal&#39;).on(&#39;AddStationTempMobal.show&#39;, function(e,map,a
216 261 layer.closeAll();
217 262  
218 263 // 清除地图覆盖物
219   - map.clearOverlays();
  264 + map.clearMarkAndOverlays();
220 265  
221 266 // 刷新树
222 267 fun.resjtreeDate(addLine.id,directionData);
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
... ... @@ -184,7 +184,7 @@ var GetAjaxData = function(){
184 184 // 保存
185 185 $post('/station/manualSave',params,function(rd) {
186 186  
187   - return callback && callback(rd);
  187 + callback && callback(rd);
188 188  
189 189 });
190 190  
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
... ... @@ -717,11 +717,11 @@ var WorldsBMap = function () {
717 717  
718 718 var f = arguments.callee;
719 719  
720   - if(arra[index]!=''){
  720 + if(arra[index].name!=''){
721 721  
722 722 var localSearch = new BMap.LocalSearch(mapBValue);
723 723  
724   - localSearch.search(arra[index]);
  724 + localSearch.search(arra[index].name);
725 725  
726 726 localSearch.setSearchCompleteCallback(function (searchResult) {
727 727  
... ... @@ -729,7 +729,8 @@ var WorldsBMap = function () {
729 729  
730 730 if(poi) {
731 731  
732   - stationList.push({name:arra[index],potion:{lng:poi.point.lng,lat:poi.point.lat}});
  732 + /* stationList.push({name:arra[index],potion:{lng:poi.point.lng,lat:poi.point.lat}});*/
  733 + stationList.push({name:arra[index].name.replace('公交站',''),wgs:arra[index].wgs,potion:{lng:poi.point.lng,lat:poi.point.lat}});
733 734  
734 735 f();
735 736  
... ...
src/main/resources/static/pages/scheduleApp/module/common/dt/MyRadioGroupWrapTemplate.html 0 → 100644
  1 +<div>
  2 + <!--<label class="radio-inline">-->
  3 + <!--<input type="radio" name="{{nv}}"-->
  4 + <!--ng-value="true" ng-model="model" {{disabled}}/>{{trueDesc}}-->
  5 + <!--</label>-->
  6 + <!--<label class="radio-inline">-->
  7 + <!--<input type="radio" name="{{nv}}"-->
  8 + <!--ng-value="false" ng-model="model" {{disabled}}/>{{falseDesc}}-->
  9 + <!--</label>-->
  10 +
  11 + <!-- 单选按钮组模版 -->
  12 + <!--
  13 + 使用 ng-repeat 循环生成input radio时候,双向绑定会有问题,因为ng-repeat有自己的controller,
  14 + 会影响外部的controller绑定,网上有很多解决方法,这里使用controllerAs方式,让指令定义自己的控制器别名,
  15 + 模版里指定别名就不会和ng-repeat控制器混了。
  16 + -->
  17 +
  18 + <label class="radio-inline" ng-repeat="(dicvalue, dicdesc) in $saRadiogroupCtrl.$$data">
  19 + <input type="radio" name="{{$saRadiogroupCtrl.nv}}"
  20 + ng-value="$saRadiogroupCtrl.dicvalueCalcu(dicvalue)" ng-model="$saRadiogroupCtrl.model" ng-disabled="$saRadiogroupCtrl.disabled" />{{dicdesc}}
  21 + </label>
  22 +</div>
0 23 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -112,6 +112,16 @@ angular.module(&#39;ScheduleApp&#39;).directive(&quot;saSelect&quot;, [&#39;$timeout&#39;, function($timeo
112 112 };
113 113 }]);
114 114  
  115 +/**
  116 + * saRadiogroup指令
  117 + * 属性如下:
  118 + * model(必须):独立作用域,外部绑定的一个值,如:ctrl.timeTableManageForForm.isEnableDisTemplate
  119 + * dicgroup(必须):关联的字典数据type(TODO:以后增加其他数据源)
  120 + * name(必须):控件的名字
  121 + * required(可选):是否要用required验证
  122 + * disabled(可选):标示单选框是否可选
  123 + *
  124 + */
115 125 angular.module('ScheduleApp').directive("saRadiogroup", [function() {
116 126 /**
117 127 * 使用字典数据的单选按钮组的指令。
... ... @@ -119,52 +129,84 @@ angular.module(&#39;ScheduleApp&#39;).directive(&quot;saRadiogroup&quot;, [function() {
119 129 */
120 130 return {
121 131 restrict: 'E',
122   - templateUrl: '/pages/scheduleApp/module/other/MyDictionaryRadioGroupTemplate.html',
  132 + templateUrl: '/pages/scheduleApp/module/common/dt/MyRadioGroupWrapTemplate.html',
123 133 scope: {
124 134 model: "="
125 135 },
126   - controllerAs: "ctrl",
  136 + controllerAs: "$saRadiogroupCtrl",
127 137 bindToController: true,
128 138 controller: function($scope) {
129 139 //$scope["model"] = {selectedOption: null};
130 140 //console.log("controller");
131 141 //console.log("controller:" + $scope["model"]);
  142 +
  143 + var self = this;
  144 + self.$$data = null; // 内部数据
132 145 },
  146 +
133 147 /**
134   - * 重要属性如下:
135   - * model 是绑定外部值。
136   - * disabled 说明是否不能修改
137   - * dicgroup 字典组的类型
138   - * name input name属性值
  148 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  149 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  150 + * @param tElem
  151 + * @param tAttrs
  152 + * @returns {{pre: Function, post: Function}}
139 153 */
140   - link: function(scope, element, attr) {
141   - //console.log("link");
142   - //console.log("link:" + scope.model);
143   - //scope["model"] = {selectedOption: null};
144   -
145   - if (attr["name"]) {
146   - scope["ctrl"].nv = attr["name"];
  154 + compile: function(tElem, tAttrs) {
  155 + // 获取属性
  156 + var $dicgroup_attr = tAttrs["dicgroup"]; // 关联的字典数据type
  157 + var $name_attr = tAttrs["name"]; // 控件的名字
  158 + var $required_attr = tAttrs["required"]; // 是否要用required验证
  159 + var $disabled_attr = tAttrs["disabled"]; // 标示单选框是否可选
  160 +
  161 + // controlAs名字
  162 + var ctrlAs = "$saRadiogroupCtrl";
  163 +
  164 + // 如果有required属性,添加angularjs required验证
  165 + if ($required_attr != undefined) {
  166 + tElem.find("input").attr("required", "");
147 167 }
148 168  
149   - if (attr["disabled"]) {
150   - scope["ctrl"].disabled = true;
151   - }
152   - if (attr["dicgroup"]) {
153   - var obj = dictionaryUtils.getByGroup(attr['dicgroup']);
154   - scope["ctrl"].dic = obj;
155   - // 处理 scope["dic"] key值
156   - scope["ctrl"].dicvalueCalcu = function(value) {
157   - if (value == "true") {
158   - //console.log(value);
159   - return true;
160   - } else if (value == "false") {
161   - //console.log(value);
162   - return false;
163   - } else {
164   - return value;
  169 + return {
  170 + pre: function(scope, element, attr) {
  171 +
  172 + },
  173 +
  174 + /**
  175 + * 相当于link函数。
  176 + * @param scope
  177 + * @param element
  178 + * @param attr
  179 + */
  180 + post: function(scope, element, attr) {
  181 + //console.log("link");
  182 + //console.log("link:" + scope.model);
  183 + //scope["model"] = {selectedOption: null};
  184 +
  185 + if ($name_attr) {
  186 + scope[ctrlAs].nv = $name_attr;
165 187 }
166   - };
167   - }
  188 +
  189 + if ($disabled_attr) {
  190 + scope[ctrlAs].disabled = true;
  191 + }
  192 + if ($dicgroup_attr) {
  193 + var obj = dictionaryUtils.getByGroup($dicgroup_attr);
  194 + scope[ctrlAs].$$data = obj;
  195 + // 处理 scope["dic"] key值
  196 + scope[ctrlAs].dicvalueCalcu = function(value) {
  197 + if (value == "true") {
  198 + //console.log(value);
  199 + return true;
  200 + } else if (value == "false") {
  201 + //console.log(value);
  202 + return false;
  203 + } else {
  204 + return value;
  205 + }
  206 + };
  207 + }
  208 + }
  209 + };
168 210 }
169 211 };
170 212 }]);
... ... @@ -172,9 +214,11 @@ angular.module(&#39;ScheduleApp&#39;).directive(&quot;saRadiogroup&quot;, [function() {
172 214 angular.module('ScheduleApp').directive("remoteValidaton", [
173 215 'BusInfoManageService_g',
174 216 'EmployeeInfoManageService_g',
  217 + 'TimeTableManageService_g',
175 218 function(
176 219 busInfoManageService_g,
177   - employeeInfoManageService_g
  220 + employeeInfoManageService_g,
  221 + timeTableManageService_g
178 222 ) {
179 223 /**
180 224 * 远端验证指令,依赖于ngModel
... ... @@ -231,6 +275,28 @@ angular.module(&#39;ScheduleApp&#39;).directive(&quot;remoteValidaton&quot;, [
231 275 ngModelCtrl.$setValidity('remote', true);
232 276 }
233 277 );
  278 + } else if (attr["rvtype"] == "ttinfoname") {
  279 + if (!rv1_attr) {
  280 + ngModelCtrl.$setValidity('remote', false);
  281 + return;
  282 + }
  283 +
  284 + timeTableManageService_g.validate.ttinfoname(
  285 + {"name_eq": modelValue, "xl.id_eq": rv1_attr, type: "equale"},
  286 + function(result) {
  287 + //console.log(result);
  288 + if (result.status == "SUCCESS") {
  289 + ngModelCtrl.$setValidity('remote', true);
  290 + } else {
  291 + ngModelCtrl.$setValidity('remote', false);
  292 + }
  293 + },
  294 + function(result) {
  295 + //console.log(result);
  296 + ngModelCtrl.$setValidity('remote', true);
  297 + }
  298 + );
  299 +
234 300 }
235 301 } else {
236 302 // 没有rvtype,就不用远端验证了
... ... @@ -259,6 +325,29 @@ angular.module(&#39;ScheduleApp&#39;).directive(&quot;remoteValidaton&quot;, [
259 325 ngModelCtrl.$setValidity('remote', true);
260 326 }
261 327 );
  328 + } else if (attr["rvtype"] == "ttinfoname") {
  329 + if (!value) {
  330 + ngModelCtrl.$setValidity('remote', false);
  331 + return;
  332 + }
  333 +
  334 + console.log("rv1:" + value);
  335 +
  336 + timeTableManageService_g.validate.ttinfoname(
  337 + {"name_eq": modelValue, "xl.id_eq": value, type: "equale"},
  338 + function(result) {
  339 + //console.log(result);
  340 + if (result.status == "SUCCESS") {
  341 + ngModelCtrl.$setValidity('remote', true);
  342 + } else {
  343 + ngModelCtrl.$setValidity('remote', false);
  344 + }
  345 + },
  346 + function(result) {
  347 + //console.log(result);
  348 + ngModelCtrl.$setValidity('remote', true);
  349 + }
  350 + );
262 351 }
263 352  
264 353 });
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -211,6 +211,15 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;TimeTableManageService_g&#39;, [&#39;$resource&#39;,
211 211 method: 'POST'
212 212 }
213 213 }
  214 + ),
  215 + validate: $resource(
  216 + '/tic/validate/:type',
  217 + {},
  218 + {
  219 + ttinfoname: {
  220 + method: 'GET'
  221 + }
  222 + }
214 223 )
215 224 };
216 225 }]);
... ... @@ -261,6 +270,9 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService_g&#39;, [&#39;$resource
261 270 },
262 271 save: {
263 272 method: 'POST'
  273 + },
  274 + delete: {
  275 + method: 'DELETE'
264 276 }
265 277 }
266 278 )
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list.html
... ... @@ -9,7 +9,6 @@
9 9 <th style="width: 20%;">时刻表</th>
10 10 <th>排班开始时间</th>
11 11 <th>排班结束时间</th>
12   - <th>修改人</th>
13 12 <th>修改时间</th>
14 13 <th style="width: 21%">操作</th>
15 14 </tr>
... ... @@ -30,7 +29,6 @@
30 29 <td></td>
31 30 <td></td>
32 31 <td></td>
33   - <td></td>
34 32 <td>
35 33 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
36 34 ng-click="ctrl.pageChanaged()">
... ... @@ -61,9 +59,6 @@
61 59 <span ng-bind="info.scheduleToTime | date: 'yyyy-MM-dd '"></span>
62 60 </td>
63 61 <td>
64   - <span ng-bind=""></span>
65   - </td>
66   - <td>
67 62 <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
68 63 </td>
69 64 <td>
... ... @@ -71,6 +66,8 @@
71 66 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
72 67 <a ui-sref="schedulePlanInfoManage({spid : info.id, xlname : info.xl.name, ttname : info.ttInfo.name, stime : info.scheduleFromTime, etime : info.scheduleToTime})"
73 68 class="btn default blue-stripe btn-sm"> 排班明细 </a>
  69 + <a ng-click="ctrl.deletePlan(info.id)"
  70 + class="btn default blue-stripe btn-sm"> 删除 </a>
74 71 </td>
75 72 </tr>
76 73 </tbody>
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js
... ... @@ -47,6 +47,14 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanManageService&#39;, [&#39;SchedulePla
47 47 */
48 48 saveDetail: function(obj) {
49 49 return service.rest.save(obj).$promise;
  50 + },
  51 + /**
  52 + * 删除信息。
  53 + * @param id 主键id
  54 + * @returns {*|Function|promise|n}
  55 + */
  56 + deleteDetail: function(id) {
  57 + return service.rest.delete({id: id}).$promise;
50 58 }
51 59  
52 60 };
... ... @@ -113,6 +121,30 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;SchedulePlanManageListCtrl&#39;, [&#39;Schedul
113 121 self.pageChanaged();
114 122 };
115 123  
  124 + // 删除排班(整个删除)
  125 + self.deletePlan = function(id) {
  126 + schedulePlanManageService.deleteDetail(id).then(
  127 + function(result) {
  128 + alert("删除成功!");
  129 +
  130 + schedulePlanManageService.getPage().then(
  131 + function(result) {
  132 + self.pageInfo.totalItems = result.totalElements;
  133 + self.pageInfo.currentPage = result.number + 1;
  134 + self.pageInfo.infos = result.content;
  135 + schedulePlanManageService.setCurrentPageNo(result.number + 1);
  136 + },
  137 + function(result) {
  138 + alert("出错啦!");
  139 + }
  140 + );
  141 + },
  142 + function(result) {
  143 + alert("出错啦!");
  144 + }
  145 + );
  146 + }
  147 +
116 148 }]);
117 149  
118 150  
... ...
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/detail.html
1   -<h1>TODO</h1>
2 1 \ No newline at end of file
  2 +<div class="page-head">
  3 + <div class="page-title">
  4 + <h1>时刻表基础信息</h1>
  5 + </div>
  6 +</div>
  7 +
  8 +<ul class="page-breadcrumb breadcrumb">
  9 + <li>
  10 + <a href="/pages/home.html" data-pjax>首页</a>
  11 + <i class="fa fa-circle"></i>
  12 + </li>
  13 + <li>
  14 + <span class="active">运营计划管理</span>
  15 + <i class="fa fa-circle"></i>
  16 + </li>
  17 + <li>
  18 + <a ui-sref="timeTableManage">时刻表管理</a>
  19 + <i class="fa fa-circle"></i>
  20 + </li>
  21 + <li>
  22 + <span class="active">时刻表基础信息</span>
  23 + </li>
  24 +</ul>
  25 +
  26 +<div class="portlet light bordered" ng-controller="TimeTableManageDetailCtrl as ctrl">
  27 + <div class="portlet-title">
  28 + <div class="caption">
  29 + <i class="icon-equalizer font-red-sunglo"></i> <span
  30 + class="caption-subject font-red-sunglo bold uppercase"
  31 + ng-bind="ctrl.title"></span>
  32 + </div>
  33 + </div>
  34 +
  35 + <div class="portlet-body form">
  36 + <form class="form-horizontal" novalidate name="myForm">
  37 + <!--<div class="alert alert-danger display-hide">-->
  38 + <!--<button class="close" data-close="alert"></button>-->
  39 + <!--您的输入有误,请检查下面的输入项-->
  40 + <!--</div>-->
  41 +
  42 +
  43 + <!-- 其他信息放置在这里 -->
  44 + <div class="form-body">
  45 + <div class="form-group has-success has-feedback">
  46 + <label class="col-md-2 control-label">线路*:</label>
  47 + <div class="col-md-4">
  48 + <input type="text" class="form-control"
  49 + name="xl" ng-model="ctrl.timeTableManageForDetail.xl.name" readonly/>
  50 + </div>
  51 + </div>
  52 +
  53 + <div class="form-group has-success has-feedback">
  54 + <label class="col-md-2 control-label">线路走向*:</label>
  55 + <div class="col-md-4">
  56 + <sa-Radiogroup model="ctrl.timeTableManageForDetail.xlDir" dicgroup="LineTrend2" name="xlDir" disabled="true"></sa-Radiogroup>
  57 + </div>
  58 + </div>
  59 +
  60 + <div class="form-group has-success has-feedback">
  61 + <label class="col-md-2 control-label">时刻表名字*:</label>
  62 + <div class="col-md-4">
  63 + <input type="text" class="form-control"
  64 + name="name" ng-model="ctrl.timeTableManageForDetail.name" readonly/>
  65 + </div>
  66 + </div>
  67 +
  68 + <div class="form-group has-success has-feedback">
  69 + <label class="col-md-2 control-label">启用日期*:</label>
  70 + <div class="col-md-4">
  71 + <input type="text" class="form-control"
  72 + name="qyrq" uib-datepicker-popup="yyyy年MM月dd日"
  73 + ng-model="ctrl.timeTableManageForDetail.qyrq" readonly/>
  74 + </div>
  75 + </div>
  76 +
  77 + <div class="form-group has-success has-feedback">
  78 + <label class="col-md-2 control-label">是否启用*:</label>
  79 + <div class="col-md-4">
  80 + <sa-Radiogroup model="ctrl.timeTableManageForDetail.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" disabled="true"></sa-Radiogroup>
  81 + </div>
  82 +
  83 + </div>
  84 +
  85 + <div class="form-group">
  86 + <label class="col-md-2 control-label">路牌数量:</label>
  87 + <div class="col-md-4">
  88 + <input type="number" class="form-control" ng-value="ctrl.timeTableManageForDetail.lpCount"
  89 + name="lpCount" placeholder="请输入路牌数" min="1" readonly/>
  90 + </div>
  91 + </div>
  92 +
  93 + <div class="form-group">
  94 + <label class="col-md-2 control-label">营运圈数:</label>
  95 + <div class="col-md-4">
  96 + <input type="number" class="form-control" ng-value="ctrl.timeTableManageForDetail.loopCount"
  97 + name="loopCount" placeholder="请输入圈数" min="1" readonly/>
  98 + </div>
  99 + </div>
  100 +
  101 + <div class="form-group">
  102 + <label class="col-md-2 control-label">停车场:</label>
  103 + <div class="col-md-4">
  104 + <input type="text" class="form-control" ng-value="ctrl.timeTableManageForDetail.xl.carParkCode | dict:'CarPark':'未知' "
  105 + name="carParkCode" readonly/>
  106 + </div>
  107 + </div>
  108 +
  109 + <!--<div class="form-group">-->
  110 + <!--<label class="col-md-2 control-label">常规有效日:</label>-->
  111 + <!--</div>-->
  112 +
  113 + <!--<div class="form-group">-->
  114 + <!--<label class="col-md-2 control-label">特殊有效日:</label>-->
  115 + <!--</div>-->
  116 +
  117 + <!--<div class="form-group">-->
  118 + <!--<label class="col-md-2 control-label">备注:</label>-->
  119 + <!--</div>-->
  120 +
  121 + <div class="form-group">
  122 + <label class="col-md-2 control-label">创建人:</label>
  123 + <div class="col-md-4">
  124 + <input type="text" class="form-control" ng-value="ctrl.timeTableManageForDetail.createBy.name"
  125 + name="createBy" readonly/>
  126 + </div>
  127 + </div>
  128 +
  129 + <div class="form-group">
  130 + <label class="col-md-2 control-label">创建时间:</label>
  131 + <div class="col-md-4">
  132 + <input type="text" class="form-control" ng-model="ctrl.timeTableManageForDetail.createDate"
  133 + name="createDate" uib-datepicker-popup="yyyy年MM月dd日 hh:mm:ss"
  134 + readonly/>
  135 + </div>
  136 + </div>
  137 +
  138 + <div class="form-group">
  139 + <label class="col-md-2 control-label">更新人:</label>
  140 + <div class="col-md-4">
  141 + <input type="text" class="form-control" ng-value="ctrl.timeTableManageForDetail.updateBy.name"
  142 + name="updateBy" readonly/>
  143 + </div>
  144 + </div>
  145 +
  146 + <div class="form-group">
  147 + <label class="col-md-2 control-label">更新时间:</label>
  148 + <div class="col-md-4">
  149 + <input type="text" class="form-control" ng-model="ctrl.timeTableManageForDetail.updateDate"
  150 + name="updateDate" uib-datepicker-popup="yyyy年MM月dd日 hh:mm:ss"
  151 + readonly/>
  152 + </div>
  153 + </div>
  154 +
  155 + <!-- 其他form-group -->
  156 +
  157 + </div>
  158 +
  159 + </form>
  160 +
  161 + </div>
  162 +
  163 +
  164 +</div>
3 165 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/edit.html
1   -<h1>TODO</h1>
2 1 \ No newline at end of file
  2 +<div class="page-head">
  3 + <div class="page-title">
  4 + <h1>修改时刻表基础信息</h1>
  5 + </div>
  6 +</div>
  7 +
  8 +<ul class="page-breadcrumb breadcrumb">
  9 + <li>
  10 + <a href="/pages/home.html" data-pjax>首页</a>
  11 + <i class="fa fa-circle"></i>
  12 + </li>
  13 + <li>
  14 + <span class="active">运营计划管理</span>
  15 + <i class="fa fa-circle"></i>
  16 + </li>
  17 + <li>
  18 + <a ui-sref="timeTableManage">时刻表管理</a>
  19 + <i class="fa fa-circle"></i>
  20 + </li>
  21 + <li>
  22 + <span class="active">修改时刻表基础信息</span>
  23 + </li>
  24 +</ul>
  25 +
  26 +<div class="portlet light bordered" ng-controller="TimeTableManageFormCtrl as ctrl">
  27 + <div class="portlet-title">
  28 + <div class="caption">
  29 + <i class="icon-equalizer font-red-sunglo"></i> <span
  30 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  31 + </div>
  32 + </div>
  33 +
  34 + <div class="portlet-body form">
  35 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  36 + <!--<div class="alert alert-danger display-hide">-->
  37 + <!--<button class="close" data-close="alert"></button>-->
  38 + <!--您的输入有误,请检查下面的输入项-->
  39 + <!--</div>-->
  40 +
  41 +
  42 + <!-- 其他信息放置在这里 -->
  43 + <div class="form-body">
  44 + <div class="form-group has-success has-feedback">
  45 + <label class="col-md-2 control-label">线路*:</label>
  46 + <div class="col-md-3">
  47 + <sa-Select3 model="ctrl.timeTableManageForForm"
  48 + name="xl"
  49 + placeholder="请输拼音..."
  50 + dcvalue="{{ctrl.timeTableManageForForm.xl.id}}"
  51 + dcname="xl.id"
  52 + icname="id"
  53 + icnames="name"
  54 + datatype="xl"
  55 + mlp="true"
  56 + required >
  57 + </sa-Select3>
  58 + </div>
  59 + <!-- 隐藏块,显示验证信息 -->
  60 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  61 + 线路必须选择
  62 + </div>
  63 + </div>
  64 +
  65 + <div class="form-group has-success has-feedback">
  66 + <label class="col-md-2 control-label">线路走向*:</label>
  67 + <div class="col-md-3">
  68 + <sa-Radiogroup model="ctrl.timeTableManageForForm.xlDir" dicgroup="LineTrend2" name="xlDir" required></sa-Radiogroup>
  69 + </div>
  70 + <!-- 隐藏块,显示验证信息 -->
  71 + <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required">
  72 + 线路走向必须填写
  73 + </div>
  74 + </div>
  75 +
  76 + <div class="form-group has-success has-feedback">
  77 + <label class="col-md-2 control-label">时刻表名字*:</label>
  78 + <div class="col-md-3">
  79 + <input type="text" class="form-control" ng-model="ctrl.timeTableManageForForm.name"
  80 + name="name" placeholder="请输入时刻表名字" required
  81 + remote-Validaton rvtype="ttinfoname" rv1="{{ctrl.timeTableManageForForm.xl.id}}"
  82 + />
  83 + </div>
  84 +
  85 + <!-- 隐藏块,显示验证信息 -->
  86 + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.required">
  87 + 时刻表名字必须填写
  88 + </div>
  89 + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.remote">
  90 + 选择线路并且相同相同线路时刻表名字不能重复
  91 + </div>
  92 + </div>
  93 +
  94 + <div class="form-group has-success has-feedback">
  95 + <label class="col-md-2 control-label">启用日期*:</label>
  96 + <div class="col-md-3">
  97 + <div class="input-group">
  98 + <input type="text" class="form-control"
  99 + name="qyrq" placeholder="请选择启用日期..."
  100 + uib-datepicker-popup="yyyy年MM月dd日"
  101 + is-open="ctrl.qyrqOpen"
  102 + ng-model="ctrl.timeTableManageForForm.qyrq" readonly required/>
  103 + <span class="input-group-btn">
  104 + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">
  105 + <i class="glyphicon glyphicon-calendar"></i>
  106 + </button>
  107 + </span>
  108 + </div>
  109 + </div>
  110 +
  111 + <!-- 隐藏块,显示验证信息 -->
  112 + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
  113 + 启用日期必须填写
  114 + </div>
  115 + </div>
  116 +
  117 + <div class="form-group has-success has-feedback">
  118 + <label class="col-md-2 control-label">是否启用*:</label>
  119 + <div class="col-md-3">
  120 + <sa-Radiogroup model="ctrl.timeTableManageForForm.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" required></sa-Radiogroup>
  121 + </div>
  122 +
  123 + <!-- 隐藏块,显示验证信息 -->
  124 + <div class="alert alert-danger well-sm" ng-show="myForm.isEnableDisTemplate.$error.required">
  125 + 是否启用必须选择
  126 + </div>
  127 +
  128 + </div>
  129 +
  130 + <div class="form-group">
  131 + <label class="col-md-2 control-label">路牌数量:</label>
  132 + <div class="col-md-3">
  133 + <input type="number" class="form-control" ng-model="ctrl.timeTableManageForForm.lpCount"
  134 + name="lpCount" placeholder="请输入路牌数" min="1"/>
  135 + </div>
  136 + <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.number">
  137 + 必须输入数字
  138 + </div>
  139 + <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.min">
  140 + 路爬数量必须大于1
  141 + </div>
  142 + </div>
  143 +
  144 + <div class="form-group">
  145 + <label class="col-md-2 control-label">营运圈数:</label>
  146 + <div class="col-md-3">
  147 + <input type="number" class="form-control" ng-model="ctrl.timeTableManageForForm.loopCount"
  148 + name="loopCount" placeholder="请输入圈数" min="1"/>
  149 + </div>
  150 + <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.number">
  151 + 必须输入数字
  152 + </div>
  153 + <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.min">
  154 + 营运圈数必须大于1
  155 + </div>
  156 + </div>
  157 +
  158 + <!--<div class="form-group">-->
  159 + <!--<label class="col-md-2 control-label">常规有效日:</label>-->
  160 + <!--</div>-->
  161 +
  162 + <!--<div class="form-group">-->
  163 + <!--<label class="col-md-2 control-label">特殊有效日:</label>-->
  164 + <!--</div>-->
  165 +
  166 + <!--<div class="form-group">-->
  167 + <!--<label class="col-md-2 control-label">备注:</label>-->
  168 + <!--</div>-->
  169 +
  170 + <!-- 其他form-group -->
  171 +
  172 + </div>
  173 +
  174 + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 -->
  175 + <div class="form-actions">
  176 + <div class="row">
  177 + <div class="col-md-offset-3 col-md-4">
  178 + <button type="submit" class="btn green"
  179 + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  180 + <a type="button" class="btn default" ui-sref="timeTableManage" ><i class="fa fa-times"></i> 取消</a>
  181 + </div>
  182 + </div>
  183 + </div>
  184 +
  185 + </form>
  186 +
  187 + </div>
  188 +
  189 +
  190 +</div>
3 191 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/form.html
1   -<h1>TODO</h1>
2 1 \ No newline at end of file
  2 +<div class="page-head">
  3 + <div class="page-title">
  4 + <h1>添加时刻表基础信息</h1>
  5 + </div>
  6 +</div>
  7 +
  8 +<ul class="page-breadcrumb breadcrumb">
  9 + <li>
  10 + <a href="/pages/home.html" data-pjax>首页</a>
  11 + <i class="fa fa-circle"></i>
  12 + </li>
  13 + <li>
  14 + <span class="active">运营计划管理</span>
  15 + <i class="fa fa-circle"></i>
  16 + </li>
  17 + <li>
  18 + <a ui-sref="timeTableManage">时刻表管理</a>
  19 + <i class="fa fa-circle"></i>
  20 + </li>
  21 + <li>
  22 + <span class="active">添加时刻表基础信息</span>
  23 + </li>
  24 +</ul>
  25 +
  26 +<div class="portlet light bordered" ng-controller="TimeTableManageFormCtrl as ctrl">
  27 + <div class="portlet-title">
  28 + <div class="caption">
  29 + <i class="icon-equalizer font-red-sunglo"></i> <span
  30 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  31 + </div>
  32 + </div>
  33 +
  34 + <div class="portlet-body form">
  35 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  36 + <!--<div class="alert alert-danger display-hide">-->
  37 + <!--<button class="close" data-close="alert"></button>-->
  38 + <!--您的输入有误,请检查下面的输入项-->
  39 + <!--</div>-->
  40 +
  41 +
  42 + <!-- 其他信息放置在这里 -->
  43 + <div class="form-body">
  44 + <div class="form-group has-success has-feedback">
  45 + <label class="col-md-2 control-label">线路*:</label>
  46 + <div class="col-md-3">
  47 + <sa-Select3 model="ctrl.timeTableManageForForm"
  48 + name="xl"
  49 + placeholder="请输拼音..."
  50 + dcvalue="{{ctrl.timeTableManageForForm.xl.id}}"
  51 + dcname="xl.id"
  52 + icname="id"
  53 + icnames="name"
  54 + datatype="xl"
  55 + mlp="true"
  56 + required >
  57 + </sa-Select3>
  58 + </div>
  59 + <!-- 隐藏块,显示验证信息 -->
  60 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  61 + 线路必须选择
  62 + </div>
  63 + </div>
  64 +
  65 + <div class="form-group has-success has-feedback">
  66 + <label class="col-md-2 control-label">线路走向*:</label>
  67 + <div class="col-md-3">
  68 + <sa-Radiogroup model="ctrl.timeTableManageForForm.xlDir" dicgroup="LineTrend2" name="xlDir" required></sa-Radiogroup>
  69 + </div>
  70 + <!-- 隐藏块,显示验证信息 -->
  71 + <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required">
  72 + 线路走向必须填写
  73 + </div>
  74 + </div>
  75 +
  76 + <div class="form-group has-success has-feedback">
  77 + <label class="col-md-2 control-label">时刻表名字*:</label>
  78 + <div class="col-md-3">
  79 + <input type="text" class="form-control" ng-model="ctrl.timeTableManageForForm.name"
  80 + name="name" placeholder="请输入时刻表名字" required
  81 + remote-Validaton rvtype="ttinfoname" rv1="{{ctrl.timeTableManageForForm.xl.id}}"
  82 + />
  83 + </div>
  84 +
  85 + <!-- 隐藏块,显示验证信息 -->
  86 + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.required">
  87 + 时刻表名字必须填写
  88 + </div>
  89 + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.remote">
  90 + 选择线路并且相同相同线路时刻表名字不能重复
  91 + </div>
  92 + </div>
  93 +
  94 + <div class="form-group has-success has-feedback">
  95 + <label class="col-md-2 control-label">启用日期*:</label>
  96 + <div class="col-md-3">
  97 + <div class="input-group">
  98 + <input type="text" class="form-control"
  99 + name="qyrq" placeholder="请选择启用日期..."
  100 + uib-datepicker-popup="yyyy年MM月dd日"
  101 + is-open="ctrl.qyrqOpen"
  102 + ng-model="ctrl.timeTableManageForForm.qyrq" readonly required/>
  103 + <span class="input-group-btn">
  104 + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">
  105 + <i class="glyphicon glyphicon-calendar"></i>
  106 + </button>
  107 + </span>
  108 + </div>
  109 + </div>
  110 +
  111 + <!-- 隐藏块,显示验证信息 -->
  112 + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
  113 + 启用日期必须填写
  114 + </div>
  115 + </div>
  116 +
  117 + <div class="form-group has-success has-feedback">
  118 + <label class="col-md-2 control-label">是否启用*:</label>
  119 + <div class="col-md-3">
  120 + <sa-Radiogroup model="ctrl.timeTableManageForForm.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" required></sa-Radiogroup>
  121 + </div>
  122 +
  123 + <!-- 隐藏块,显示验证信息 -->
  124 + <div class="alert alert-danger well-sm" ng-show="myForm.isEnableDisTemplate.$error.required">
  125 + 是否启用必须选择
  126 + </div>
  127 +
  128 + </div>
  129 +
  130 + <div class="form-group">
  131 + <label class="col-md-2 control-label">路牌数量:</label>
  132 + <div class="col-md-3">
  133 + <input type="number" class="form-control" ng-model="ctrl.timeTableManageForForm.lpCount"
  134 + name="lpCount" placeholder="请输入路牌数" min="1"/>
  135 + </div>
  136 + <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.number">
  137 + 必须输入数字
  138 + </div>
  139 + <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.min">
  140 + 路爬数量必须大于1
  141 + </div>
  142 + </div>
  143 +
  144 + <div class="form-group">
  145 + <label class="col-md-2 control-label">营运圈数:</label>
  146 + <div class="col-md-3">
  147 + <input type="number" class="form-control" ng-model="ctrl.timeTableManageForForm.loopCount"
  148 + name="loopCount" placeholder="请输入圈数" min="1"/>
  149 + </div>
  150 + <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.number">
  151 + 必须输入数字
  152 + </div>
  153 + <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.min">
  154 + 营运圈数必须大于1
  155 + </div>
  156 + </div>
  157 +
  158 + <!--<div class="form-group">-->
  159 + <!--<label class="col-md-2 control-label">常规有效日:</label>-->
  160 + <!--</div>-->
  161 +
  162 + <!--<div class="form-group">-->
  163 + <!--<label class="col-md-2 control-label">特殊有效日:</label>-->
  164 + <!--</div>-->
  165 +
  166 + <!--<div class="form-group">-->
  167 + <!--<label class="col-md-2 control-label">备注:</label>-->
  168 + <!--</div>-->
  169 +
  170 + <!-- 其他form-group -->
  171 +
  172 + </div>
  173 +
  174 + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 -->
  175 + <div class="form-actions">
  176 + <div class="row">
  177 + <div class="col-md-offset-3 col-md-4">
  178 + <button type="submit" class="btn green"
  179 + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  180 + <a type="button" class="btn default" ui-sref="timeTableManage" ><i class="fa fa-times"></i> 取消</a>
  181 + </div>
  182 + </div>
  183 + </div>
  184 +
  185 + </form>
  186 +
  187 + </div>
  188 +
  189 +
  190 +</div>
3 191 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/list.html
... ... @@ -11,7 +11,7 @@
11 11 <th>圈数</th>
12 12 <th>上下行</th>
13 13 <th>启用</th>
14   - <th style="width: 15%">修改时间</th>
  14 + <th style="width: 10%">启用日期</th>
15 15 <th style="width: 25%">时刻表明细</th>
16 16 <th style="width: 21%">操作</th>
17 17 </tr>
... ... @@ -57,13 +57,13 @@
57 57 <span ng-bind="info.loopCount"></span>
58 58 </td>
59 59 <td>
60   - <span ng-bind="info.xlDir | dict:'LineTrend':'未知'"></span>
  60 + <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span>
61 61 </td>
62 62 <td>
63   - <span ng-bind="info.isEnableDisTemplate"></span>
  63 + <span ng-bind="info.isEnableDisTemplate | dict:'truefalseType':'未知' "></span>
64 64 </td>
65 65 <td>
66   - <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
  66 + <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span>
67 67 </td>
68 68 <td>
69 69 <a ui-sref="timeTableDetailInfoManage({xlid: info.xl.id, ttid : info.id})"
... ...
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/timeTableManage.js
... ... @@ -261,11 +261,75 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;TimeTableDetailManageToolsCtrl&#39;, [&#39;$mo
261 261 }]);
262 262  
263 263 angular.module('ScheduleApp').controller('TimeTableManageFormCtrl', ['TimeTableManageService', '$stateParams', '$state', function(timeTableManageService, $stateParams, $state) {
264   - // TODO:
  264 + var self = this;
  265 +
  266 + // 启用日期 日期控件开关
  267 + self.qyrqOpen = false;
  268 + self.qyrq_open = function() {
  269 + self.qyrqOpen = true;
  270 + };
  271 +
  272 + // 欲保存的表单信息,双向绑定
  273 + self.timeTableManageForForm= {xl : {}};
  274 +
  275 + // 如果是修改,获取传过来的id,从后台获取一份数据,用于绑定页面form值
  276 + var id = $stateParams.id;
  277 + if (id) {
  278 + self.timeTableManageForForm.id = id;
  279 + timeTableManageService.getDetail(id).then(
  280 + function(result) {
  281 + var key;
  282 + for (key in result) {
  283 + self.timeTableManageForForm[key] = result[key];
  284 + }
  285 + },
  286 + function(result) {
  287 + alert("出错啦!");
  288 + }
  289 + );
  290 + }
  291 +
  292 + // form提交方法
  293 + self.submit = function() {
  294 + timeTableManageService.saveDetail(self.timeTableManageForForm).then(
  295 + function(result) {
  296 + if (result.status == 'SUCCESS') {
  297 + alert("保存成功!");
  298 + $state.go("timeTableManage");
  299 + } else {
  300 + alert("保存异常!");
  301 + }
  302 + },
  303 + function(result) {
  304 + alert("出错啦!");
  305 + }
  306 + );
  307 + };
  308 +
  309 +
265 310 }]);
266 311  
267 312 angular.module('ScheduleApp').controller('TimeTableManageDetailCtrl', ['TimeTableManageService', '$stateParams', function(timeTableManageService, $stateParams) {
268   - // TODO:
  313 + var self = this;
  314 + self.title = "";
  315 + self.timeTableManageForDetail = {};
  316 +
  317 + timeTableManageService.getDetail($stateParams.id).then(
  318 + function(result) {
  319 + angular.copy(result, self.timeTableManageForDetail);
  320 +
  321 + self.title = self.timeTableManageForDetail.xl.name +
  322 + "(" +
  323 + self.timeTableManageForDetail.name +
  324 + ")" +
  325 + "时刻表基础信息";
  326 + },
  327 + function(result) {
  328 + alert("出错啦!");
  329 + }
  330 + );
  331 +
  332 +
269 333 }]);
270 334  
271 335  
... ...