Commit 9953864c1fa162aadae5079ee6b4f3e113a495a4

Authored by 徐烜
1 parent ecf5f1e8

update

src/main/java/com/bsth/controller/BaseController.java
@@ -32,7 +32,7 @@ import java.util.Map; @@ -32,7 +32,7 @@ import java.util.Map;
32 public class BaseController<T, ID extends Serializable> { 32 public class BaseController<T, ID extends Serializable> {
33 33
34 @Autowired 34 @Autowired
35 - BaseService<T, ID> baseService; 35 + protected BaseService<T, ID> baseService;
36 @Autowired 36 @Autowired
37 DataImportExportService dataImportExportService; 37 DataImportExportService dataImportExportService;
38 38
src/main/java/com/bsth/controller/schedule/CarConfigInfoController.java
@@ -2,11 +2,15 @@ package com.bsth.controller.schedule; @@ -2,11 +2,15 @@ package com.bsth.controller.schedule;
2 2
3 import com.bsth.controller.BaseController; 3 import com.bsth.controller.BaseController;
4 import com.bsth.entity.schedule.CarConfigInfo; 4 import com.bsth.entity.schedule.CarConfigInfo;
  5 +import com.bsth.repository.CarsRepository;
  6 +import com.bsth.repository.LineRepository;
  7 +import com.bsth.repository.schedule.CarConfigInfoRepository;
5 import com.bsth.service.schedule.utils.DataToolsProperties; 8 import com.bsth.service.schedule.utils.DataToolsProperties;
6 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.boot.context.properties.EnableConfigurationProperties; 10 import org.springframework.boot.context.properties.EnableConfigurationProperties;
8 -import org.springframework.web.bind.annotation.RequestMapping;  
9 -import org.springframework.web.bind.annotation.RestController; 11 +import org.springframework.web.bind.annotation.*;
  12 +
  13 +import java.util.Map;
10 14
11 /** 15 /**
12 * Created by xu on 16/5/9. 16 * Created by xu on 16/5/9.
@@ -17,9 +21,35 @@ import org.springframework.web.bind.annotation.RestController; @@ -17,9 +21,35 @@ import org.springframework.web.bind.annotation.RestController;
17 public class CarConfigInfoController extends BaseController<CarConfigInfo, Long> { 21 public class CarConfigInfoController extends BaseController<CarConfigInfo, Long> {
18 @Autowired 22 @Autowired
19 private DataToolsProperties dataToolsProperties; 23 private DataToolsProperties dataToolsProperties;
  24 + @Autowired
  25 + private CarConfigInfoRepository carConfigInfoRepository;
  26 +
  27 + @Autowired
  28 + private LineRepository lineRepository;
  29 + @Autowired
  30 + private CarsRepository carsRepository;
20 31
21 @Override 32 @Override
22 protected String getDataImportKtrClasspath() { 33 protected String getDataImportKtrClasspath() {
23 return dataToolsProperties.getCarsconfigDatainputktr(); 34 return dataToolsProperties.getCarsconfigDatainputktr();
24 } 35 }
  36 +
  37 + @Override
  38 + public CarConfigInfo findById(@PathVariable("id") Long aLong) {
  39 + return carConfigInfoRepository.findOneExtend(aLong);
  40 + }
  41 +
  42 + /**
  43 + * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody
  44 + * @Title: save
  45 + * @Description: TODO(持久化对象)
  46 + * @param @param t
  47 + * @param @return 设定文件
  48 + * @return Map<String,Object> {status: 1(成功),-1(失败)}
  49 + * @throws
  50 + */
  51 + @RequestMapping(method = RequestMethod.POST)
  52 + public Map<String, Object> save(@RequestBody CarConfigInfo t){
  53 + return baseService.save(t);
  54 + }
25 } 55 }
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
@@ -26,11 +26,11 @@ public class CarConfigInfo implements Serializable { @@ -26,11 +26,11 @@ public class CarConfigInfo implements Serializable {
26 @GeneratedValue 26 @GeneratedValue
27 private Long id; 27 private Long id;
28 28
29 - /** 线路关联 */  
30 - @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) 29 + /** 线路关联(jpa2 detach)*/
  30 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
31 private Line xl; 31 private Line xl;
32 - /** 车辆关联 */  
33 - @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) 32 + /** 车辆关联 (jpa2 detach) */
  33 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
34 private Cars cl; 34 private Cars cl;
35 35
36 36
src/main/java/com/bsth/repository/schedule/CarConfigInfoRepository.java
@@ -21,8 +21,13 @@ public interface CarConfigInfoRepository extends BaseRepository&lt;CarConfigInfo, L @@ -21,8 +21,13 @@ public interface CarConfigInfoRepository extends BaseRepository&lt;CarConfigInfo, L
21 @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH) 21 @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH)
22 @Override 22 @Override
23 Page<CarConfigInfo> findAll(Specification<CarConfigInfo> spec, Pageable pageable); 23 Page<CarConfigInfo> findAll(Specification<CarConfigInfo> spec, Pageable pageable);
24 -  
25 - @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH) 24 +
  25 + @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH)
  26 + @Query("select cc from CarConfigInfo cc where cc.id=?1")
  27 + CarConfigInfo findOneExtend(Long aLong);
  28 +
  29 +
  30 + @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH)
26 @Query("select cc from CarConfigInfo cc where cc.xl.lineCode=?1") 31 @Query("select cc from CarConfigInfo cc where cc.xl.lineCode=?1")
27 List<CarConfigInfo> findBylineCode(String lineCode); 32 List<CarConfigInfo> findBylineCode(String lineCode);
28 } 33 }
29 \ No newline at end of file 34 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/busConfig/busConfig.js
@@ -38,7 +38,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService&#39;, [&#39;BusConfigService_g&#39;, @@ -38,7 +38,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService&#39;, [&#39;BusConfigService_g&#39;,
38 getPage: function() { 38 getPage: function() {
39 var params = currentSearchCondition; // 查询条件 39 var params = currentSearchCondition; // 查询条件
40 params.page = currentPageNo - 1; // 服务端页码从0开始 40 params.page = currentPageNo - 1; // 服务端页码从0开始
41 - return service.list(params).$promise; 41 + return service.rest.list(params).$promise;
42 }, 42 },
43 /** 43 /**
44 * 获取明细信息。 44 * 获取明细信息。
@@ -47,7 +47,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService&#39;, [&#39;BusConfigService_g&#39;, @@ -47,7 +47,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService&#39;, [&#39;BusConfigService_g&#39;,
47 */ 47 */
48 getDetail: function(id) { 48 getDetail: function(id) {
49 var params = {id: id}; 49 var params = {id: id};
50 - return service.get(params).$promise; 50 + return service.rest.get(params).$promise;
51 }, 51 },
52 /** 52 /**
53 * 保存信息。 53 * 保存信息。
@@ -55,7 +55,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService&#39;, [&#39;BusConfigService_g&#39;, @@ -55,7 +55,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService&#39;, [&#39;BusConfigService_g&#39;,
55 * @return 返回一个 promise 55 * @return 返回一个 promise
56 */ 56 */
57 saveDetail: function(obj) { 57 saveDetail: function(obj) {
58 - return service.save(obj).$promise; 58 + return service.rest.save(obj).$promise;
59 } 59 }
60 }; 60 };
61 61
@@ -186,12 +186,100 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;BusConfigListCtrl&#39;, [&#39;BusConfigService @@ -186,12 +186,100 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;BusConfigListCtrl&#39;, [&#39;BusConfigService
186 186
187 }]); 187 }]);
188 188
189 -angular.module('ScheduleApp').controller('BusConfigFormCtrl', ['BusConfigService', '$stateParams', '$state', function(busConfigService, $stateParams, $state) {  
190 - // TODO: 189 +angular.module('ScheduleApp').controller('BusConfigFormCtrl', ['BusConfigService', '$stateParams', '$state', '$scope', function(busConfigService, $stateParams, $state, $scope) {
  190 + var self = this;
  191 +
  192 + // 启用日期 日期控件开关
  193 + self.qyrqOpen = false;
  194 + self.qyrq_open = function() {
  195 + self.qyrqOpen = true;
  196 + };
  197 +
  198 + // 终止日期 日期控件开关
  199 + self.zzrqOpen = false;
  200 + self.zzrq_open = function() {
  201 + self.zzrqOpen = true;
  202 + };
  203 +
  204 + // 欲保存的busInfo信息,绑定
  205 + self.busConfigForSave = {};
  206 +
  207 + // 获取传过来的id,有的话就是修改,获取一遍数据
  208 + var id = $stateParams.id;
  209 + if (id) {
  210 + self.busConfigForSave.id = id;
  211 + busConfigService.getDetail(id).then(
  212 + function(result) {
  213 + var key;
  214 + for (key in result) {
  215 + self.busConfigForSave[key] = result[key];
  216 + }
  217 +
  218 + // 添加xl_id,cl_id
  219 + self.busConfigForSave["xl_id"] = self.busConfigForSave.xl.id;
  220 + self.busConfigForSave["cl_id"] = self.busConfigForSave.cl.id;
  221 + },
  222 + function(result) {
  223 + alert("出错啦!");
  224 + }
  225 + );
  226 + }
  227 +
  228 + // 提交方法
  229 + self.submit = function() {
  230 + console.log(self.busConfigForSave);
  231 +
  232 + var mf = $scope.myForm;
  233 +
  234 + // xl_id,cl_id要组织成对象,然后删除
  235 + self.busConfigForSave["xl"] = {};
  236 + self.busConfigForSave.xl["id"] = self.busConfigForSave["xl_id"];
  237 + delete self.busConfigForSave["xl_id"];
  238 + self.busConfigForSave["cl"] = {};
  239 + self.busConfigForSave.cl["id"] = self.busConfigForSave["cl_id"];
  240 + delete self.busConfigForSave["cl_id"];
  241 +
  242 +
  243 +
  244 + //busConfigService.saveDetail(self.busConfigForSave).then(
  245 + // function(result) {
  246 + // // TODO:弹出框方式以后改
  247 + // if (result.status == 'SUCCESS') {
  248 + // alert("保存成功!");
  249 + // $state.go("busConfig");
  250 + // } else {
  251 + // alert("保存异常!");
  252 + // }
  253 + // },
  254 + // function(result) {
  255 + // // TODO:弹出框方式以后改
  256 + // alert("出错啦!");
  257 + // }
  258 + //);
  259 + };
191 }]); 260 }]);
192 261
193 angular.module('ScheduleApp').controller('BusConfigDetailCtrl', ['BusConfigService', '$stateParams', function(busConfigService, $stateParams) { 262 angular.module('ScheduleApp').controller('BusConfigDetailCtrl', ['BusConfigService', '$stateParams', function(busConfigService, $stateParams) {
194 - // TODO: 263 + var self = this;
  264 + self.title = "";
  265 + self.busConfigForDetail = {};
  266 + self.busConfigForDetail.id = $stateParams.id;
  267 +
  268 + // 当转向到此页面时,就获取明细信息并绑定
  269 + busConfigService.getDetail($stateParams.id).then(
  270 + function(result) {
  271 + var key;
  272 + for (key in result) {
  273 + self.busConfigForDetail[key] = result[key];
  274 + }
  275 +
  276 + self.title = "车辆 " + self.busConfigForDetail.cl.insideCode + " 配置详细信息";
  277 + },
  278 + function(result) {
  279 + // TODO:弹出框方式以后改
  280 + alert("出错啦!");
  281 + }
  282 + );
195 }]); 283 }]);
196 284
197 285
src/main/resources/static/pages/scheduleApp/module/core/busConfig/detail.html
1 -<h1>TODO</h1>  
2 \ No newline at end of file 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="busConfig">车俩配置管理</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="BusConfigDetailCtrl 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-3">
  48 + <input type="text" class="form-control"
  49 + name="xl" ng-model="ctrl.busConfigForDetail.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-3">
  56 + <input type="text" class="form-control" name="cl"
  57 + ng-model="ctrl.busConfigForDetail.cl.insideCode" readonly/>
  58 + </div>
  59 + </div>
  60 +
  61 + <div class="form-group">
  62 + <label class="col-md-2 control-label">启用日期*:</label>
  63 + <div class="col-md-4">
  64 + <input type="text" class="form-control"
  65 + name="qyrq" uib-datepicker-popup="yyyy年MM月dd日"
  66 + ng-model="ctrl.busConfigForDetail.qyrq" readonly/>
  67 + </div>
  68 + </div>
  69 + <div class="form-group">
  70 + <label class="col-md-2 control-label">终止日期:</label>
  71 + <div class="col-md-4">
  72 + <input type="text" class="form-control"
  73 + name="zzrq" uib-datepicker-popup="yyyy年MM月dd日"
  74 + ng-model="ctrl.busConfigForDetail.zzrq" readonly/>
  75 + </div>
  76 + </div>
  77 +
  78 + <div class="form-group">
  79 + <label class="col-md-2 control-label">停车点*:</label>
  80 + <div class="col-md-4">
  81 + <input type="text" class="form-control"
  82 + ng-model="ctrl.busConfigForDetail.tcd" readonly/>
  83 + </div>
  84 + </div>
  85 +
  86 +
  87 + <!-- 其他form-group -->
  88 +
  89 + </div>
  90 +
  91 + </form>
  92 +
  93 + </div>
  94 +</div>
3 \ No newline at end of file 95 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/busConfig/edit.html
1 -<h1>TODO</h1>  
2 \ No newline at end of file 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="busConfig">车俩配置管理</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="BusConfigFormCtrl 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-Select2 model="ctrl.busConfigForSave"
  48 + name="xl"
  49 + required="true"
  50 + type="xl"
  51 + modelcolname1="xl_id"
  52 + datacolname1="id"
  53 + showcolname="name"
  54 + placeholder="请输拼音...">
  55 + </sa-Select2>
  56 + </div>
  57 + <!-- 隐藏块,显示验证信息 -->
  58 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  59 + 线路必须选择
  60 + </div>
  61 + </div>
  62 + <div class="form-group has-success has-feedback">
  63 + <label class="col-md-2 control-label">车辆*:</label>
  64 + <div class="col-md-3">
  65 + <sa-Select2 model="ctrl.busConfigForSave"
  66 + name="cl"
  67 + required="true"
  68 + type="cl"
  69 + modelcolname1="cl_id"
  70 + datacolname1="id"
  71 + showcolname="insideCode"
  72 + placeholder="请输拼音...">
  73 + </sa-Select2>
  74 + </div>
  75 + <!-- 隐藏块,显示验证信息 -->
  76 + <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
  77 + 车辆必须选择
  78 + </div>
  79 + </div>
  80 +
  81 + <div class="form-group">
  82 + <label class="col-md-2 control-label">启用日期:</label>
  83 + <div class="col-md-3">
  84 + <div class="input-group">
  85 + <input type="text" class="form-control"
  86 + name="qyrq" placeholder="请选择启用日期..."
  87 + uib-datepicker-popup="yyyy年MM月dd日"
  88 + is-open="ctrl.qyrqOpen" required
  89 + ng-model="ctrl.busConfigForSave.qyrq"/>
  90 + <span class="input-group-btn">
  91 + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">
  92 + <i class="glyphicon glyphicon-calendar"></i>
  93 + </button>
  94 + </span>
  95 + </div>
  96 + </div>
  97 + <!-- 隐藏块,显示验证信息 -->
  98 + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
  99 + 启用日期必须选择
  100 + </div>
  101 + </div>
  102 +
  103 + <div class="form-group">
  104 + <label class="col-md-2 control-label">终止日期:</label>
  105 + <div class="col-md-3">
  106 + <div class="input-group">
  107 + <input type="text" class="form-control"
  108 + name="zzrq" placeholder="请选择启用日期..."
  109 + uib-datepicker-popup="yyyy年MM月dd日"
  110 + is-open="ctrl.zzrqOpen"
  111 + ng-model="ctrl.busConfigForSave.zzrq"/>
  112 + <span class="input-group-btn">
  113 + <button type="button" class="btn btn-default" ng-click="ctrl.zzrq_open()">
  114 + <i class="glyphicon glyphicon-calendar"></i>
  115 + </button>
  116 + </span>
  117 + </div>
  118 + </div>
  119 + </div>
  120 +
  121 +
  122 + <div class="form-group">
  123 + <label class="col-md-2 control-label">停车场*:</label>
  124 + <div class="col-md-3">
  125 + <input type="text" class="form-control" name="tcd" ng-model="ctrl.busConfigForSave.tcd" required
  126 + placeholder="请输入停车场"/>
  127 + </div>
  128 + <!-- 隐藏块,显示验证信息 -->
  129 + <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required">
  130 + 停车场必须填写
  131 + </div>
  132 + </div>
  133 +
  134 +
  135 + <!-- 其他form-group -->
  136 +
  137 + </div>
  138 +
  139 + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 -->
  140 + <div class="form-actions">
  141 + <div class="row">
  142 + <div class="col-md-offset-3 col-md-4">
  143 + <button type="submit" class="btn green"
  144 + ng-disabled="myForm.xl.$error.required ||
  145 + myForm.cl.$error.required ||
  146 + myForm.qyrq.$error.required ||
  147 + myForm.tcd.$error.required"
  148 + ><i class="fa fa-check"></i> 提交</button>
  149 + <a type="button" class="btn default" ui-sref="busInfoManage" ><i class="fa fa-times"></i> 取消</a>
  150 + </div>
  151 + </div>
  152 + </div>
  153 +
  154 + </form>
  155 +
  156 + </div>
  157 +
  158 +
  159 +</div>
3 \ No newline at end of file 160 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/busConfig/form.html
1 -<h1>TODO</h1>  
2 \ No newline at end of file 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="busConfig">车俩配置管理</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="BusConfigFormCtrl 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-Select2 model="ctrl.busConfigForSave"
  48 + name="xl"
  49 + required="true"
  50 + type="xl"
  51 + modelcolname1="xl_id"
  52 + datacolname1="id"
  53 + showcolname="name"
  54 + placeholder="请输拼音...">
  55 + </sa-Select2>
  56 + </div>
  57 + <!-- 隐藏块,显示验证信息 -->
  58 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  59 + 线路必须选择
  60 + </div>
  61 + </div>
  62 + <div class="form-group has-success has-feedback">
  63 + <label class="col-md-2 control-label">车辆*:</label>
  64 + <div class="col-md-3">
  65 + <sa-Select2 model="ctrl.busConfigForSave"
  66 + name="cl"
  67 + required="true"
  68 + type="cl"
  69 + modelcolname1="cl_id"
  70 + datacolname1="id"
  71 + showcolname="insideCode"
  72 + placeholder="请输拼音...">
  73 + </sa-Select2>
  74 + </div>
  75 + <!-- 隐藏块,显示验证信息 -->
  76 + <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
  77 + 车辆必须选择
  78 + </div>
  79 + </div>
  80 +
  81 + <div class="form-group">
  82 + <label class="col-md-2 control-label">启用日期:</label>
  83 + <div class="col-md-3">
  84 + <div class="input-group">
  85 + <input type="text" class="form-control"
  86 + name="qyrq" placeholder="请选择启用日期..."
  87 + uib-datepicker-popup="yyyy年MM月dd日"
  88 + is-open="ctrl.qyrqOpen" required
  89 + ng-model="ctrl.busConfigForSave.qyrq"/>
  90 + <span class="input-group-btn">
  91 + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">
  92 + <i class="glyphicon glyphicon-calendar"></i>
  93 + </button>
  94 + </span>
  95 + </div>
  96 + </div>
  97 + <!-- 隐藏块,显示验证信息 -->
  98 + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
  99 + 启用日期必须选择
  100 + </div>
  101 + </div>
  102 +
  103 + <div class="form-group">
  104 + <label class="col-md-2 control-label">终止日期:</label>
  105 + <div class="col-md-3">
  106 + <div class="input-group">
  107 + <input type="text" class="form-control"
  108 + name="zzrq" placeholder="请选择启用日期..."
  109 + uib-datepicker-popup="yyyy年MM月dd日"
  110 + is-open="ctrl.zzrqOpen"
  111 + ng-model="ctrl.busConfigForSave.zzrq"/>
  112 + <span class="input-group-btn">
  113 + <button type="button" class="btn btn-default" ng-click="ctrl.zzrq_open()">
  114 + <i class="glyphicon glyphicon-calendar"></i>
  115 + </button>
  116 + </span>
  117 + </div>
  118 + </div>
  119 + </div>
  120 +
  121 +
  122 + <div class="form-group">
  123 + <label class="col-md-2 control-label">停车场*:</label>
  124 + <div class="col-md-3">
  125 + <input type="text" class="form-control" name="tcd" ng-model="ctrl.busConfigForSave.tcd" required
  126 + placeholder="请输入停车场"/>
  127 + </div>
  128 + <!-- 隐藏块,显示验证信息 -->
  129 + <div class="alert alert-danger well-sm" ng-show="myForm.tcd.$error.required">
  130 + 停车场必须填写
  131 + </div>
  132 + </div>
  133 +
  134 +
  135 + <!-- 其他form-group -->
  136 +
  137 + </div>
  138 +
  139 + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 -->
  140 + <div class="form-actions">
  141 + <div class="row">
  142 + <div class="col-md-offset-3 col-md-4">
  143 + <button type="submit" class="btn green"
  144 + ng-disabled="myForm.xl.$error.required ||
  145 + myForm.cl.$error.required ||
  146 + myForm.qyrq.$error.required ||
  147 + myForm.tcd.$error.required"
  148 + ><i class="fa fa-check"></i> 提交</button>
  149 + <a type="button" class="btn default" ui-sref="busInfoManage" ><i class="fa fa-times"></i> 取消</a>
  150 + </div>
  151 + </div>
  152 + </div>
  153 +
  154 + </form>
  155 +
  156 + </div>
  157 +
  158 +
  159 +</div>
3 \ No newline at end of file 160 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/list.html
@@ -44,20 +44,20 @@ @@ -44,20 +44,20 @@
44 <td></td> 44 <td></td>
45 <td> 45 <td>
46 <div style="width: 180px"> 46 <div style="width: 180px">
47 - <sa-Select2 model="ctrl.searchCondition()"  
48 - type="ry"  
49 - modelcolname1="jsy.id_eq"  
50 - datacolname1="id"  
51 - showcolname="name"  
52 - placeholder="请输拼音...">  
53 - </sa-Select2>  
54 <!--<sa-Select2 model="ctrl.searchCondition()"--> 47 <!--<sa-Select2 model="ctrl.searchCondition()"-->
55 - <!--type="ry2"--> 48 + <!--type="ry"-->
56 <!--modelcolname1="jsy.id_eq"--> 49 <!--modelcolname1="jsy.id_eq"-->
57 <!--datacolname1="id"--> 50 <!--datacolname1="id"-->
58 - <!--showcolname="personnelName"--> 51 + <!--showcolname="name"-->
59 <!--placeholder="请输拼音...">--> 52 <!--placeholder="请输拼音...">-->
60 <!--</sa-Select2>--> 53 <!--</sa-Select2>-->
  54 + <sa-Select2 model="ctrl.searchCondition()"
  55 + type="ry2"
  56 + modelcolname1="jsy.id_eq"
  57 + datacolname1="id"
  58 + showcolname="personnelName"
  59 + placeholder="请输拼音...">
  60 + </sa-Select2>
61 </div> 61 </div>
62 </td> 62 </td>
63 <td></td> 63 <td></td>
src/main/resources/static/pages/scheduleApp/module/main.js
@@ -785,24 +785,35 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;DeviceInfoManageService_g&#39;, [&#39;$resource&#39;, @@ -785,24 +785,35 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;DeviceInfoManageService_g&#39;, [&#39;$resource&#39;,
785 785
786 // 车辆配置service 786 // 车辆配置service
787 angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) { 787 angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
788 - return $resource(  
789 - '/cci/:id',  
790 - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询  
791 - {  
792 - list: {  
793 - method: 'GET',  
794 - params: {  
795 - page: 0 788 + return {
  789 + rest : $resource(
  790 + '/cci/:id',
  791 + {order: 'createDate', direction: 'ASC', id: '@id_route'},
  792 + {
  793 + list: {
  794 + method: 'GET',
  795 + params: {
  796 + page: 0
  797 + }
  798 + },
  799 + get: {
  800 + method: 'GET'
  801 + },
  802 + save: {
  803 + method: 'POST'
796 } 804 }
797 - },  
798 - get: {  
799 - method: 'GET'  
800 - },  
801 - save: {  
802 - method: 'POST'  
803 } 805 }
804 - }  
805 - ); 806 + ),
  807 + validate: $resource( // TODO:
  808 + '/personnel/validate/:type',
  809 + {},
  810 + {
  811 + jobCode: {
  812 + method: 'GET'
  813 + }
  814 + }
  815 + )
  816 + };
806 }]); 817 }]);
807 818
808 // 人员配置service 819 // 人员配置service
@@ -1283,14 +1294,17 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -1283,14 +1294,17 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
1283 angular.module('ScheduleApp').filter("$$pyFilter", function() { 1294 angular.module('ScheduleApp').filter("$$pyFilter", function() {
1284 return function(items, props) { 1295 return function(items, props) {
1285 var out = []; 1296 var out = [];
  1297 + var limit = props["limit"] || 20; // 默认20条记录
1286 1298
1287 if (angular.isArray(items)) { 1299 if (angular.isArray(items)) {
1288 items.forEach(function(item) { 1300 items.forEach(function(item) {
1289 - if (props.search) {  
1290 - var upTerm = props.search.toUpperCase();  
1291 - if(item.fullChars.indexOf(upTerm) != -1  
1292 - || item.camelChars.indexOf(upTerm) != -1) {  
1293 - out.push(item); 1301 + if (out.length < limit) {
  1302 + if (props.search) {
  1303 + var upTerm = props.search.toUpperCase();
  1304 + if(item.fullChars.indexOf(upTerm) != -1
  1305 + || item.camelChars.indexOf(upTerm) != -1) {
  1306 + out.push(item);
  1307 + }
1294 } 1308 }
1295 } 1309 }
1296 }); 1310 });
@@ -1396,8 +1410,10 @@ angular.module(&#39;ScheduleApp&#39;).directive(&quot;saSelect2&quot;, [ @@ -1396,8 +1410,10 @@ angular.module(&#39;ScheduleApp&#39;).directive(&quot;saSelect2&quot;, [
1396 if ($showcolname_attr) { 1410 if ($showcolname_attr) {
1397 // 动态添加基于名字的拼音 1411 // 动态添加基于名字的拼音
1398 data[$showcolname_attr] = result[i][$showcolname_attr]; 1412 data[$showcolname_attr] = result[i][$showcolname_attr];
1399 - data["fullChars"] = pinyin.getFullChars(result[i][$showcolname_attr]).toUpperCase(); // 全拼  
1400 - data["camelChars"] = pinyin.getCamelChars(result[i][$showcolname_attr]); // 简拼 1413 + if (data[$showcolname_attr]) {
  1414 + data["fullChars"] = pinyin.getFullChars(result[i][$showcolname_attr]).toUpperCase(); // 全拼
  1415 + data["camelChars"] = pinyin.getCamelChars(result[i][$showcolname_attr]); // 简拼
  1416 + }
1401 } 1417 }
1402 if (data["fullChars"]) 1418 if (data["fullChars"])
1403 scope["$saSelectCtrl"].$$data.push(data); 1419 scope["$saSelectCtrl"].$$data.push(data);
src/main/resources/static/pages/scheduleApp/module/other/MySearchSelectTemplate.html
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <ui-select-match placeholder="{{$saSelectCtrl.$placeholder_attr}}"> 5 <ui-select-match placeholder="{{$saSelectCtrl.$placeholder_attr}}">
6 <span>{{$select.selected[$saSelectCtrl.$showcolname_attr]}}</span> 6 <span>{{$select.selected[$saSelectCtrl.$showcolname_attr]}}</span>
7 </ui-select-match> 7 </ui-select-match>
8 - <ui-select-choices repeat="item[$saSelectCtrl.$showcolname_attr] as item in $saSelectCtrl.$$data | $$pyFilter: {search : $select.search}" 8 + <ui-select-choices repeat="item[$saSelectCtrl.$showcolname_attr] as item in $saSelectCtrl.$$data | $$pyFilter: {search : $select.search, limit : 10}"
9 refresh="$saSelectCtrl.$refreshdata_fn_attr($select.search)" 9 refresh="$saSelectCtrl.$refreshdata_fn_attr($select.search)"
10 refresh-delay="1000"> 10 refresh-delay="1000">
11 <span ng-bind="item[$saSelectCtrl.$showcolname_attr]"></span> 11 <span ng-bind="item[$saSelectCtrl.$showcolname_attr]"></span>