Commit 705aab85b1428d1c56c97464db46353fdc2fd4b5

Authored by 徐烜
1 parent f347a72b

PSM-12

Showing 25 changed files with 2652 additions and 6 deletions
src/main/java/com/bsth/controller/schedule/GuideboardInfoController.java
@@ -8,8 +8,12 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -8,8 +8,12 @@ import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.boot.context.properties.EnableConfigurationProperties; 8 import org.springframework.boot.context.properties.EnableConfigurationProperties;
9 import org.springframework.web.bind.annotation.PathVariable; 9 import org.springframework.web.bind.annotation.PathVariable;
10 import org.springframework.web.bind.annotation.RequestMapping; 10 import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
11 import org.springframework.web.bind.annotation.RestController; 12 import org.springframework.web.bind.annotation.RestController;
12 13
  14 +import java.util.List;
  15 +import java.util.Map;
  16 +
13 /** 17 /**
14 * Created by xu on 16/5/11. 18 * Created by xu on 16/5/11.
15 */ 19 */
@@ -31,4 +35,10 @@ public class GuideboardInfoController extends BaseController<GuideboardInfo, Lon @@ -31,4 +35,10 @@ public class GuideboardInfoController extends BaseController<GuideboardInfo, Lon
31 public GuideboardInfo findById(@PathVariable("id") Long aLong) { 35 public GuideboardInfo findById(@PathVariable("id") Long aLong) {
32 return guideboardInfoRepository.findOneExtend(aLong); 36 return guideboardInfoRepository.findOneExtend(aLong);
33 } 37 }
  38 +
  39 +
  40 + @RequestMapping(value = "/ttlpnames", method = RequestMethod.GET)
  41 + public List<Map<String, Object>> findLpName(Long ttid) {
  42 + return guideboardInfoRepository.findLpName(ttid);
  43 + }
34 } 44 }
src/main/java/com/bsth/controller/schedule/RerunController.java 0 → 100644
  1 +package com.bsth.controller.schedule;
  2 +
  3 +import com.bsth.controller.BaseController;
  4 +import com.bsth.entity.schedule.rule.RerunRule;
  5 +import com.bsth.repository.schedule.RerunRuleRepository;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.*;
  8 +
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * Created by xu on 16/10/20.
  13 + */
  14 +@RestController
  15 +@RequestMapping("rms")
  16 +public class RerunController extends BaseController<RerunRule, Long> {
  17 +
  18 + @Autowired
  19 + private RerunRuleRepository rerunRuleRepository;
  20 +
  21 + @Override
  22 + public RerunRule findById(@PathVariable("id") Long aLong) {
  23 + return super.findById(aLong);
  24 + }
  25 +
  26 + /**
  27 + * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody
  28 + * @Title: save
  29 + * @Description: TODO(持久化对象)
  30 + * @param @param t
  31 + * @param @return 设定文件
  32 + * @return Map<String,Object> {status: 1(成功),-1(失败)}
  33 + * @throws
  34 + */
  35 + @RequestMapping(method = RequestMethod.POST)
  36 + public Map<String, Object> save(@RequestBody RerunRule t){
  37 + return baseService.save(t);
  38 + }
  39 +
  40 +}
src/main/java/com/bsth/controller/schedule/TTInfoDetailController.java
@@ -16,6 +16,7 @@ import org.springframework.web.multipart.MultipartFile; @@ -16,6 +16,7 @@ import org.springframework.web.multipart.MultipartFile;
16 16
17 import java.util.HashMap; 17 import java.util.HashMap;
18 import java.util.Iterator; 18 import java.util.Iterator;
  19 +import java.util.List;
19 import java.util.Map; 20 import java.util.Map;
20 21
21 /** 22 /**
@@ -111,4 +112,9 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; { @@ -111,4 +112,9 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; {
111 public TTInfoDetail findById(@PathVariable("id") Long aLong) { 112 public TTInfoDetail findById(@PathVariable("id") Long aLong) {
112 return ttInfoDetailRepository.findOneExtend(aLong); 113 return ttInfoDetailRepository.findOneExtend(aLong);
113 } 114 }
  115 +
  116 + @RequestMapping(value = "/bcdetail", method = RequestMethod.GET)
  117 + public List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId) {
  118 + return ttInfoDetailRepository.findBcdetails(xlId, ttinfoId, lpId);
  119 + }
114 } 120 }
src/main/java/com/bsth/entity/schedule/rule/RerunRule.java 0 → 100644
  1 +package com.bsth.entity.schedule.rule;
  2 +
  3 +import com.bsth.entity.Line;
  4 +import com.bsth.entity.schedule.CarConfigInfo;
  5 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  6 +import com.bsth.entity.schedule.GuideboardInfo;
  7 +import com.bsth.entity.schedule.TTInfo;
  8 +import com.bsth.entity.sys.SysUser;
  9 +
  10 +import javax.persistence.*;
  11 +import java.util.Date;
  12 +
  13 +/**
  14 + * 套跑规则。
  15 + */
  16 +@Entity
  17 +@Table(name = "bsth_c_s_rerun_rule")
  18 +@NamedEntityGraphs({
  19 + @NamedEntityGraph(name = "dylp", attributeNodes = {
  20 + @NamedAttributeNode("rerunXl"),
  21 + @NamedAttributeNode("rerunTtinfo"),
  22 + @NamedAttributeNode("rerunLp"),
  23 + @NamedAttributeNode("useXl"),
  24 + @NamedAttributeNode("useLp"),
  25 + @NamedAttributeNode("useCarConfig"),
  26 + @NamedAttributeNode("useEmployeeConfig")
  27 + })
  28 +})
  29 +public class RerunRule {
  30 + /** 主键Id */
  31 + @Id
  32 + @GeneratedValue
  33 + private Long id;
  34 +
  35 + /** 套跑线路 */
  36 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  37 + private Line rerunXl;
  38 + /** 套跑时刻表 */
  39 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  40 + private TTInfo rerunTtinfo;
  41 + /** 套跑路牌 */
  42 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  43 + private GuideboardInfo rerunLp;
  44 + /** 套跑班次(时刻表明细ids,使用逗号连接) */
  45 + private String rerunTtinfodetailIds;
  46 +
  47 +
  48 + /** 套跑类型(dylp;对应路牌,dybc:对应班车) */
  49 + @Column(nullable = false)
  50 + private String rerunType;
  51 +
  52 + //--------- 对应路牌 ----------/
  53 + /** 使用线路 */
  54 + @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  55 + private Line useXl;
  56 + /** 使用路牌 */
  57 + @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  58 + private GuideboardInfo useLp;
  59 +
  60 + //--------- 对应班车 ----------/
  61 + /** 车辆配置 */
  62 + @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  63 + private CarConfigInfo useCarConfig;
  64 + /** 人员配置 */
  65 + @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  66 + private EmployeeConfigInfo useEmployeeConfig;
  67 +
  68 + /** 创建人 */
  69 + @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
  70 + private SysUser createBy;
  71 + /** 修改人 */
  72 + @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
  73 + private SysUser updateBy;
  74 + /** 创建日期 */
  75 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  76 + private Date createDate;
  77 + /** 修改日期 */
  78 + @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  79 + private Date updateDate;
  80 +
  81 + public Long getId() {
  82 + return id;
  83 + }
  84 +
  85 + public void setId(Long id) {
  86 + this.id = id;
  87 + }
  88 +
  89 + public Line getRerunXl() {
  90 + return rerunXl;
  91 + }
  92 +
  93 + public void setRerunXl(Line rerunXl) {
  94 + this.rerunXl = rerunXl;
  95 + }
  96 +
  97 + public TTInfo getRerunTtinfo() {
  98 + return rerunTtinfo;
  99 + }
  100 +
  101 + public void setRerunTtinfo(TTInfo rerunTtinfo) {
  102 + this.rerunTtinfo = rerunTtinfo;
  103 + }
  104 +
  105 + public GuideboardInfo getRerunLp() {
  106 + return rerunLp;
  107 + }
  108 +
  109 + public void setRerunLp(GuideboardInfo rerunLp) {
  110 + this.rerunLp = rerunLp;
  111 + }
  112 +
  113 + public String getRerunTtinfodetailIds() {
  114 + return rerunTtinfodetailIds;
  115 + }
  116 +
  117 + public void setRerunTtinfodetailIds(String rerunTtinfodetailIds) {
  118 + this.rerunTtinfodetailIds = rerunTtinfodetailIds;
  119 + }
  120 +
  121 + public String getRerunType() {
  122 + return rerunType;
  123 + }
  124 +
  125 + public void setRerunType(String rerunType) {
  126 + this.rerunType = rerunType;
  127 + }
  128 +
  129 + public Line getUseXl() {
  130 + return useXl;
  131 + }
  132 +
  133 + public void setUseXl(Line useXl) {
  134 + this.useXl = useXl;
  135 + }
  136 +
  137 + public GuideboardInfo getUseLp() {
  138 + return useLp;
  139 + }
  140 +
  141 + public void setUseLp(GuideboardInfo useLp) {
  142 + this.useLp = useLp;
  143 + }
  144 +
  145 + public CarConfigInfo getUseCarConfig() {
  146 + return useCarConfig;
  147 + }
  148 +
  149 + public void setUseCarConfig(CarConfigInfo useCarConfig) {
  150 + this.useCarConfig = useCarConfig;
  151 + }
  152 +
  153 + public EmployeeConfigInfo getUseEmployeeConfig() {
  154 + return useEmployeeConfig;
  155 + }
  156 +
  157 + public void setUseEmployeeConfig(EmployeeConfigInfo useEmployeeConfig) {
  158 + this.useEmployeeConfig = useEmployeeConfig;
  159 + }
  160 +
  161 + public SysUser getCreateBy() {
  162 + return createBy;
  163 + }
  164 +
  165 + public void setCreateBy(SysUser createBy) {
  166 + this.createBy = createBy;
  167 + }
  168 +
  169 + public SysUser getUpdateBy() {
  170 + return updateBy;
  171 + }
  172 +
  173 + public void setUpdateBy(SysUser updateBy) {
  174 + this.updateBy = updateBy;
  175 + }
  176 +
  177 + public Date getCreateDate() {
  178 + return createDate;
  179 + }
  180 +
  181 + public void setCreateDate(Date createDate) {
  182 + this.createDate = createDate;
  183 + }
  184 +
  185 + public Date getUpdateDate() {
  186 + return updateDate;
  187 + }
  188 +
  189 + public void setUpdateDate(Date updateDate) {
  190 + this.updateDate = updateDate;
  191 + }
  192 +}
src/main/java/com/bsth/repository/schedule/GuideboardInfoRepository.java
1 package com.bsth.repository.schedule; 1 package com.bsth.repository.schedule;
2 2
3 import java.util.List; 3 import java.util.List;
  4 +import java.util.Map;
4 5
5 import com.bsth.entity.schedule.EmployeeConfigInfo; 6 import com.bsth.entity.schedule.EmployeeConfigInfo;
6 import com.bsth.entity.schedule.GuideboardInfo; 7 import com.bsth.entity.schedule.GuideboardInfo;
@@ -29,4 +30,11 @@ public interface GuideboardInfoRepository extends BaseRepository&lt;GuideboardInfo, @@ -29,4 +30,11 @@ public interface GuideboardInfoRepository extends BaseRepository&lt;GuideboardInfo,
29 30
30 @Query(value = " SELECT g FROM GuideboardInfo g where g.lpName like ?1") 31 @Query(value = " SELECT g FROM GuideboardInfo g where g.lpName like ?1")
31 List<GuideboardInfo> findLpName(String lpName); 32 List<GuideboardInfo> findLpName(String lpName);
  33 +
  34 + @Query(value = "" +
  35 + "select new map(td.lp.id as lpId, td.lp.lpName as lpName) " +
  36 + "from TTInfoDetail td " +
  37 + "where td.ttinfo.id=?1 " +
  38 + "group by td.ttinfo.id, td.lp.id, td.lp.lpName")
  39 + List<Map<String, Object>> findLpName(Long ttid);
32 } 40 }
src/main/java/com/bsth/repository/schedule/RerunRuleRepository.java 0 → 100644
  1 +package com.bsth.repository.schedule;
  2 +
  3 +import com.bsth.entity.schedule.rule.RerunRule;
  4 +import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  5 +import com.bsth.repository.BaseRepository;
  6 +import org.springframework.data.domain.Page;
  7 +import org.springframework.data.domain.Pageable;
  8 +import org.springframework.data.jpa.domain.Specification;
  9 +import org.springframework.data.jpa.repository.EntityGraph;
  10 +import org.springframework.data.jpa.repository.Query;
  11 +import org.springframework.stereotype.Repository;
  12 +
  13 +/**
  14 + * Created by xu on 16/10/18.
  15 + */
  16 +@Repository
  17 +public interface RerunRuleRepository extends BaseRepository<RerunRule, Long> {
  18 + @EntityGraph(value = "dylp", type = EntityGraph.EntityGraphType.FETCH)
  19 + @Override
  20 + Page<RerunRule> findAll(Specification<RerunRule> spec, Pageable pageable);
  21 +
  22 + @EntityGraph(value = "dylp", type = EntityGraph.EntityGraphType.FETCH)
  23 + @Query("select cc from RerunRule cc where cc.id=?1")
  24 + RerunRule findOneExtend(Long aLong);
  25 +}
src/main/java/com/bsth/repository/schedule/TTInfoDetailRepository.java
@@ -35,4 +35,7 @@ public interface TTInfoDetailRepository extends BaseRepository&lt;TTInfoDetail, Lon @@ -35,4 +35,7 @@ public interface TTInfoDetailRepository extends BaseRepository&lt;TTInfoDetail, Lon
35 @Query(value = "select max(tt.fcno) as mx from bsth_c_s_ttinfo_detail tt where tt.xl =?1 and tt.ttinfo =?2", nativeQuery = true) 35 @Query(value = "select max(tt.fcno) as mx from bsth_c_s_ttinfo_detail tt where tt.xl =?1 and tt.ttinfo =?2", nativeQuery = true)
36 Long findMaxFcno(Integer xlid, Long ttinfoid); 36 Long findMaxFcno(Integer xlid, Long ttinfoid);
37 37
  38 + @Query(value = "select tt from TTInfoDetail tt where tt.xl.id = ?1 and tt.ttinfo.id = ?2 and tt.lp.id = ?3 order by tt.fcno asc")
  39 + List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId);
  40 +
38 } 41 }
src/main/java/com/bsth/service/schedule/RerunService.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +import com.bsth.entity.schedule.rule.RerunRule;
  4 +import com.bsth.service.BaseService;
  5 +
  6 +/**
  7 + * Created by xu on 16/10/20.
  8 + */
  9 +public interface RerunService extends BaseService<RerunRule, Long> {
  10 +}
src/main/java/com/bsth/service/schedule/RerunServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +import com.bsth.entity.schedule.rule.RerunRule;
  4 +import com.bsth.service.impl.BaseServiceImpl;
  5 +import org.springframework.stereotype.Service;
  6 +
  7 +/**
  8 + * Created by xu on 16/10/20.
  9 + */
  10 +@Service
  11 +public class RerunServiceImpl extends BaseServiceImpl<RerunRule, Long> implements RerunService {
  12 +}
src/main/resources/datatools/config-dev.properties
@@ -10,15 +10,15 @@ datatools.kvars_dbuname=root @@ -10,15 +10,15 @@ datatools.kvars_dbuname=root
10 #数据库密码 10 #数据库密码
11 datatools.kvars_dbpwd= 11 datatools.kvars_dbpwd=
12 #数据库库名 12 #数据库库名
13 -datatools.kvars_dbdname=mh_control 13 +datatools.kvars_dbdname=qp_control
14 14
15 # 3、上传数据配置信息 15 # 3、上传数据配置信息
16 # 上传文件目录配置(根据不同的环境需要修正) 16 # 上传文件目录配置(根据不同的环境需要修正)
17 -datatools.fileupload_dir=/Users/xu/resource/project/bsth_control_u_d_files 17 +datatools.fileupload_dir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files
18 # ktr转换文件,中配置的错误输出目录(根据不同的环境需要修正) 18 # ktr转换文件,中配置的错误输出目录(根据不同的环境需要修正)
19 -datatools.trans_errordir=/Users/xu/resource/project/bsth_control_u_d_files/erroroutput 19 +datatools.trans_errordir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/erroroutput
20 # 临时输出文件目录 20 # 临时输出文件目录
21 -datatools.trans_tempdir=/Users/xu/resource/project/bsth_control_u_d_files/temp 21 +datatools.trans_tempdir=/Users/xu/resource/project_code/runtime_temp/bsth_control_u_d_files/temp
22 22
23 ##---------------------------- 导入数据ktr ----------------------------## 23 ##---------------------------- 导入数据ktr ----------------------------##
24 # 测试temp的ktr转换文件 24 # 测试temp的ktr转换文件
src/main/resources/static/pages/scheduleApp/module/common/dts1/select/MyUISelectWrapTemplate2.html 0 → 100644
  1 +<div class="input-group" name="指令compile阶段设定"
  2 + ng-model="$saSelectCtrl.$$internalmodel">
  3 + <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)"
  4 + theme="bootstrap" >
  5 + <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定</ui-select-match>
  6 + <ui-select-choices repeat="指令compile阶段设定"
  7 + refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)"
  8 + refresh-delay="10">
  9 + <span ng-bind="指令compile阶段设定"></span>
  10 + </ui-select-choices>
  11 + </ui-select>
  12 + <span class="input-group-btn">
  13 + <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default">
  14 + <span class="glyphicon glyphicon-trash"></span>
  15 + </button>
  16 + </span>
  17 +</div>
0 \ No newline at end of file 18 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts1/select/saSelect4.js 0 → 100644
  1 +/**
  2 + * saSelect4指令,封装angular-ui-select控件,并添加相应的业务。
  3 + * name(必须):控件的名字
  4 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  5 + * placeholder(可选):输入框占位符字符串
  6 + *
  7 + * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}
  8 + * dcname(必须):绑定的model字段名,如:dcname=xl.id
  9 + * icname(必须):内部与之对应的字段名,如:icname=code
  10 + *
  11 + * cmaps(可选):model其他字段和内部数据字段名映射,如:{{ {'xl.id' : 'id', 'xl.name' : 'name'} | json}}
  12 + * dsparams(必须):内部数据源查询参数,如:{{ {'ttid': ctrl.rerunManageForSave.rerunTtinfo.id} | json }}
  13 + * dscol(必须):内部显示的信息(暂时用内部字段),如:dscol=name
  14 + * required(可选):是否要用required验证
  15 + */
  16 +angular.module('ScheduleApp').directive('saSelect4', [
  17 + '$timeout',
  18 + '$$SearchInfoService_g',
  19 + function($timeout, $$searchInfoService_g) {
  20 + return {
  21 + restrict: 'E',
  22 + templateUrl: '/pages/scheduleApp/module/common/dts1/select/MyUISelectWrapTemplate2.html',
  23 + scope: {
  24 + model: "=" // 独立作用域,关联外部的模型object
  25 + },
  26 + controllerAs: "$saSelectCtrl",
  27 + bindToController: true,
  28 + controller: function($scope) {
  29 + var self = this;
  30 + self.$$data = []; // ui-select显示用的数据
  31 + self.$$data_real = []; // 内部真实的数据
  32 +
  33 + // saSelect4组件的ng-model,用于外部绑定验证等操作
  34 + self.$$internalmodel = undefined;
  35 +
  36 + self.$$internal_select_value = undefined; // 选中的值
  37 + },
  38 +
  39 + /**
  40 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  41 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  42 + * @param tElem
  43 + * @param tAttrs
  44 + * @returns {{pre: Function, post: Function}}
  45 + */
  46 + compile: function(tElem, tAttrs) {
  47 + // 获取属性
  48 + var $name_attr = tAttrs["name"]; // 控件的名字
  49 + var $placeholder_attr = tAttrs["placeholder"]; // 占位符的名字
  50 +
  51 + var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名
  52 + var $icname_attr = tAttrs["icname"]; // 内部与之对应的字段名
  53 +
  54 + var $cmaps_attr = tAttrs["cmaps"]; // model其他字段和内部数据字段名映射
  55 + var $dscol_attr = tAttrs["dscol"]; // 内部显示的信息
  56 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  57 +
  58 + // controlAs名字
  59 + var ctrlAs = "$saSelectCtrl";
  60 +
  61 + // 验证属性
  62 + if (!$name_attr) {
  63 + throw new error("name属性必须填写");
  64 + }
  65 + if (!$dcname_attr) {
  66 + throw new error("dcname属性必须填写");
  67 + }
  68 + if (!$icname_attr) {
  69 + throw new error("icname属性必须填写");
  70 + }
  71 + if (!$dscol_attr) {
  72 + throw new error("dscol属性必须填写");
  73 + }
  74 +
  75 + // 动态设置dom
  76 + // dom required 属性
  77 + if ($required_attr != undefined) {
  78 + tElem.find("ui-select").attr("required", "");
  79 + }
  80 + // dom placeholder 属性
  81 + tElem.find("ui-select-match").attr("placeholder", $placeholder_attr);
  82 + // dom dscol 属性
  83 + tElem.find("ui-select-match").html("{{$select.selected" + "." + $dscol_attr + "}}");
  84 + tElem.find("ui-select-choices span").attr("ng-bind", "item" + "." + $dscol_attr);
  85 + // dom icname 属性
  86 + tElem.find("ui-select-choices").attr("repeat", "item" + "." + $icname_attr + " as item in $saSelectCtrl.$$data");
  87 + // dom name 属性
  88 + tElem.find("ui-select").attr("name", $name_attr);
  89 +
  90 + return {
  91 + pre: function(scope, element, attr) {
  92 + // TODO:
  93 + },
  94 +
  95 + /**
  96 + * 相当于link函数。
  97 + * @param scope
  98 + * @param element
  99 + * @param attr
  100 + */
  101 + post: function(scope, element, attr) {
  102 +
  103 + // 添加选中事件处理函数
  104 + scope[ctrlAs].$$internal_select_fn = function($item) {
  105 + if ($dcname_attr && $icname_attr) {
  106 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";");
  107 + }
  108 +
  109 + if ($cmaps_attr) {
  110 + for (var mc in $cmaps_attr) { // model的字段名:内部数据源对应字段名
  111 + var ic = $cmaps_attr[mc]; // 内部数据源对应字段
  112 + eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";");
  113 + }
  114 + }
  115 + };
  116 +
  117 + // 删除选中事件处理函数
  118 + scope[ctrlAs].$$internal_remove_fn = function() {
  119 + scope[ctrlAs].$$internal_select_value = undefined;
  120 + if ($dcname_attr) {
  121 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;");
  122 + }
  123 +
  124 + if ($cmaps_attr) {
  125 + var mc; // model的字段名
  126 + for (mc in $cmaps_attr) {
  127 + eval("scope[ctrlAs].model" + "." + mc + " = undefined;");
  128 + }
  129 + }
  130 + scope[ctrlAs].$$internal_validate_model();
  131 + };
  132 +
  133 + // 刷新数据
  134 + scope[ctrlAs].$$internal_refresh_fn = function(search) {
  135 + if (search && search != "") { // 有search值
  136 + // 处理search
  137 + console.log("search:" + search);
  138 +
  139 + scope[ctrlAs].$$data = [];
  140 + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {
  141 + var upTerm = search.toUpperCase();
  142 + if (scope[ctrlAs].$$data.length < 10) {
  143 + if (scope[ctrlAs].$$data_real[k].fullChars.indexOf(upTerm) != -1
  144 + || scope[ctrlAs].$$data_real[k].camelChars.indexOf(upTerm) != -1) {
  145 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  146 + }
  147 + } else {
  148 + break;
  149 + }
  150 + }
  151 + }
  152 + };
  153 +
  154 + /**
  155 + * 验证内部数据,更新外部model
  156 + */
  157 + scope[ctrlAs].$$internal_validate_model = function() {
  158 + if (scope[ctrlAs].$$internal_select_value) {
  159 + var select_value_temp = scope[ctrlAs].$$internal_select_value;
  160 + if (scope[ctrlAs].$$data_real && scope[ctrlAs].$$data_real.length > 0) {
  161 + var obj;
  162 + for (var j = 0; j < scope[ctrlAs].$$data_real.length; j++) {
  163 + if (eval("scope[ctrlAs].$$data_real[j]" + "." + $icname_attr + " == select_value_temp")) {
  164 + obj = angular.copy(scope[ctrlAs].$$data_real[j]);
  165 + break;
  166 + }
  167 + }
  168 + if (obj) { // 在data中判定有没有
  169 + for (var k = 0; k < scope[ctrlAs].$$data.length; j++) {
  170 + if (eval("scope[ctrlAs].$$data[j]" + "." + $icname_attr + " == obj." + $icname_attr)) {
  171 + obj = undefined;
  172 + break;
  173 + }
  174 + }
  175 + if (obj) {
  176 + scope[ctrlAs].$$data.push(obj);
  177 + }
  178 + // 更新内部model,用于外部验证
  179 + // 内部model的值暂时随意,以后再改
  180 + scope[ctrlAs].$$internalmodel = {desc: "ok"};
  181 + } else {
  182 + scope[ctrlAs].$$internalmodel = undefined;
  183 + }
  184 +
  185 + } else {
  186 + scope[ctrlAs].$$internalmodel = undefined;
  187 + }
  188 +
  189 + } else {
  190 + scope[ctrlAs].$$internalmodel = undefined;
  191 + }
  192 + };
  193 +
  194 + /**
  195 + * 内部方法,读取字典数据作为数据源。
  196 + * @param atype ajax查询类型
  197 + * @param ajaxparamobj 查询参数对象
  198 + */
  199 + scope[ctrlAs].$$internal_ajax_data = function(atype, ajaxparamobj) {
  200 + ajaxparamobj.type = 'all';
  201 + $$searchInfoService_g[atype].list(
  202 + ajaxparamobj,
  203 + function(result) {
  204 + console.log("$$internal_ajax_data result");
  205 +
  206 + // 清空内部数据
  207 + scope[ctrlAs].$$data_real = [];
  208 + scope[ctrlAs].$$data = [];
  209 +
  210 + // result中添加拼音数据,注意:这里要求result返回对象数组
  211 + for (var i = 0; i < result.length; i ++) {
  212 + if ($icname_s_attr) {
  213 + if (eval("result[i]" + "." + $dscol_attr)) {
  214 + // 全拼
  215 + result[i]["fullChars"] = pinyin.getFullChars(eval("result[i]" + "." + $dscol_attr)).toUpperCase();
  216 + // 简拼
  217 + result[i]["camelChars"] = pinyin.getCamelChars(eval("result[i]" + "." + $dscol_attr));
  218 + }
  219 + }
  220 +
  221 + if (result[i]["fullChars"]) { // 有拼音的加入数据源
  222 + scope[ctrlAs].$$data_real.push(result[i]);
  223 + }
  224 +
  225 + }
  226 +
  227 + // 数据量太大,取10条记录显示
  228 + if (angular.isArray(scope[ctrlAs].$$data_real)) {
  229 + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {
  230 + if (scope[ctrlAs].$$data.length < 10) {
  231 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  232 + } else {
  233 + break;
  234 + }
  235 + }
  236 + }
  237 +
  238 + scope[ctrlAs].$$internal_validate_model();
  239 + },
  240 + function(result) {
  241 +
  242 + }
  243 + );
  244 + };
  245 +
  246 + /**
  247 + * 内部方法,读取字典数据作为数据源。
  248 + * @param dictype 字典类型,如:gsType
  249 + */
  250 + scope[ctrlAs].$$internal_dic_data = function(dictype) {
  251 + if (!dictionaryUtils.getByGroup(dictype)) {
  252 + throw new error("字典数据不窜在=" + dictype);
  253 + }
  254 +
  255 + // 清空内部数据
  256 + scope[ctrlAs].$$data_real = [];
  257 + scope[ctrlAs].$$data = [];
  258 +
  259 + var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup);
  260 + var dic_key; // 字典key
  261 +
  262 + for (dic_key in origin_dicgroup) {
  263 + var data = {}; // 重新组合的字典元素对象
  264 + if (dic_key == "true")
  265 + data[$icname_attr] = true;
  266 + else
  267 + data[$icname_attr] = dic_key;
  268 + data[$dscol_attr] = origin_dicgroup[dic_key];
  269 + scope[ctrlAs].$$data_real.push(data);
  270 + }
  271 + // 这里直接将$$data_real数据深拷贝到$$data
  272 + angular.copy(scope[ctrlAs].$$data_real, scope[ctrlAs].$$data);
  273 + scope[ctrlAs].$$internal_validate_model();
  274 + };
  275 +
  276 + attr.$observe("dsparams", function(value) {
  277 + if (value && value != "") {
  278 + var obj = JSON.parse(value);
  279 + console.log("observe 监控 dsparams=" + obj);
  280 +
  281 + // dsparams格式如下:
  282 + // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'}
  283 +
  284 + if (obj.type == 'dic') {
  285 + scope[ctrlAs].$$internal_dic_data(obj.param);
  286 +
  287 + } else if (obj.type == 'ajax') {
  288 + scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param);
  289 + } else {
  290 + throw new Error("dsparams参数格式异常=" + obj);
  291 + }
  292 +
  293 + }
  294 +
  295 + });
  296 +
  297 + // 监控model绑定的dcvalue值变化
  298 + attr.$observe("dcvalue", function(value) {
  299 + if (value && value != "") {
  300 + console.log("observe 监控 dcvalue=" + value);
  301 + scope[ctrlAs].$$internal_select_value = value;
  302 + scope[ctrlAs].$$internal_validate_model();
  303 + }
  304 + });
  305 + }
  306 + };
  307 +
  308 + }
  309 +
  310 + };
  311 + }
  312 +]);
0 \ No newline at end of file 313 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts1/ttt.txt 0 → 100644
src/main/resources/static/pages/scheduleApp/module/common/dts2/bcGroup/MyBcGroupWrapTemplate.html 0 → 100644
  1 +<div name="{{$saBcgroupCtrl.$name_attr}}"
  2 + ng-model="$saBcgroupCtrl.$$internalmodel">
  3 +
  4 + <style>
  5 + .bc-select {
  6 + min-height: 180px;
  7 + border: 1px solid #ddd;
  8 + }
  9 + .bc-select .bc-input {
  10 + margin: 5px 5px 0px 5px;
  11 + padding-left: 0;
  12 + }
  13 + .bc-select .bc-select-cont {
  14 + text-align: left;
  15 + min-height: 60px;
  16 + padding-right: 0px;
  17 + }
  18 + .bc-select .bc-select-body {
  19 + margin-top: 5px;
  20 + overflow: auto;
  21 + width: auto;
  22 + min-height: 5px;
  23 + }
  24 + .bc-select .bc {
  25 + display: inline-block;
  26 + padding: 8px;
  27 + min-width: 50px;
  28 + text-align: center;
  29 + border: 1px solid #C1C1C1;
  30 + color: #666;
  31 + border-radius: 5px !important;
  32 + margin: 5px;
  33 + }
  34 + .bc-select .bc.active {
  35 + color: white;
  36 + background: #4095E8;
  37 + border: 1px solid #4095E8;
  38 + }
  39 +
  40 +
  41 + </style>
  42 +
  43 + <div class="col-md-12 bc-select">
  44 + <div class="col-md-12 bc-input">
  45 + <div class="col-md-9">
  46 + 班次列表,共{{$saBcgroupCtrl.$$data.length}}个
  47 + </div>
  48 + </div>
  49 + <div class="col-md-12 bc-select-cont">
  50 + <div class="bc-select-body">
  51 + <div class="bc active"
  52 + ng-repeat="$d in $saBcgroupCtrl.$$data track by $index"
  53 + ng-click="$saBcgroupCtrl.$$internal_bclist_click($index)">
  54 + <i class="fa fa-list" aria-hidden="true"></i>
  55 + <span ng-if="$d.bctype == 'out'">
  56 + 出场
  57 + </span>
  58 + <span ng-if="$d.bctype == 'in'">
  59 + 进场
  60 + </span>
  61 + {{"(" + $d.bcfcsj + ")"}}
  62 + </div>
  63 + </div>
  64 + </div>
  65 + <div class="col-md-12 bc-input">
  66 + <div class="col-md-12">
  67 + 已经选中的班次列表,共{{$saBcgroupCtrl.$$dataSelected.length}}个
  68 + </div>
  69 + </div>
  70 + <div class="col-md-12 bc-select-cont">
  71 + <div class="bc-select-body">
  72 + <div ng-class="{bc: true, active: true}"
  73 + ng-repeat="$d in $saBcgroupCtrl.$$dataSelected track by $index"
  74 + ng-click="$saBcgroupCtrl.$$internal_selbclist_click($index)"
  75 + ng-dblclick="$saBcgroupCtrl.$$internal_selbclist_dbclick($index)">
  76 + <i class="fa fa-list" aria-hidden="true"></i>
  77 + <span ng-if="$d.bctype == 'out'">
  78 + 出场
  79 + </span>
  80 + <span ng-if="$d.bctype == 'in'">
  81 + 进场
  82 + </span>
  83 + {{"(" + $d.bcfcsj + ")"}}
  84 + </div>
  85 + </div>
  86 + </div>
  87 + </div>
  88 +
  89 +
  90 +</div>
0 \ No newline at end of file 91 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts2/bcGroup/saBcgroup.js 0 → 100644
  1 +/**
  2 + * saBcgroup指令,用于套跑界面中,从指定线路,指定时刻表,指定路牌的班次列表中选择套跑班次。
  3 + * 属性如下:
  4 + * name(必须):控件的名字
  5 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  6 + * bcttinfoidsvalue(必须):绑定的model班次ids字段值,如:bcttinfoidsvalue={{ctrl.employeeInfoForSave.lprange}}
  7 + * bcttinfoidsname(必须):bind的model班次ids字段名,如:bcttinfoidsname=lprange
  8 + * dataparams (必须):内部数据关联的查询参数,如:{{ {'ttid': ctrl.rerunManageForSave.rerunTtinfo.id} | json }}
  9 + * required(可选):是否要用required验证
  10 + *
  11 + */
  12 +angular.module('ScheduleApp').directive('saBcgroup', [
  13 + 'TimeTableDetailManageService_g',
  14 + function(timeTableDetailManageService_g) {
  15 + return {
  16 + restrict: 'E',
  17 + templateUrl: '/pages/scheduleApp/module/common/dts2/bcGroup/MyBcGroupWrapTemplate.html',
  18 + scope: {
  19 + model: "=" // 独立作用域,关联外部的模型object
  20 + },
  21 + controllerAs: '$saBcgroupCtrl',
  22 + bindToController: true,
  23 + controller: function($scope) {
  24 + var self = this;
  25 + self.$$data = []; // 选择线路,时刻表,路牌后的班次列表
  26 +
  27 + // 测试数据
  28 + //self.$$data = [
  29 + // {bcttinfoid: 1, bcfcsj: '7:30', bctype: 'out'},
  30 + // {bcttinfoid: 2, bcfcsj: '8:30', bctype: 'normal'},
  31 + // {bcttinfoid: 3, bcfcsj: '9:30', bctype: 'in'}
  32 + //];
  33 +
  34 +
  35 + self.$$dataSelected = []; // 套跑选中的班次列表
  36 +
  37 + //self.$$dataSelected = [
  38 + // {bcttinfoid: 1, bcfcsj: '7:30', bctype: 'out'},
  39 + // {bcttinfoid: 2, bcfcsj: '8:30', bctype: 'normal'},
  40 + // {bcttinfoid: 3, bcfcsj: '9:30', bctype: 'in'}
  41 + //];
  42 +
  43 + // saBcgroup组件的ng-model,用于外部绑定等操作
  44 + self.$$internalmodel = undefined;
  45 +
  46 + self.$$data_bcdata_first_init = false; // 班次数据首次初始化标志
  47 + self.$$data_bcttinfoids_first_init = false; // 班次ids数据首次初始化标志
  48 + self.$$data_bcttinfoids_first_data = undefined; // 班次ids数据首次初始化数据
  49 +
  50 + },
  51 +
  52 + /**
  53 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  54 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  55 + * @param tElem
  56 + * @param tAttrs
  57 + * @returns {{pre: Function, post: Function}}
  58 + */
  59 + compile: function(tElem, tAttrs) {
  60 + // TODO:获取所有的属性
  61 + var $name_attr = tAttrs["name"]; // 控件的名字
  62 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  63 + var $bcttinfoidsname_attr = tAttrs["bcttinfoidsname"]; // bind的model班次ids字段名
  64 +
  65 + // controlAs名字
  66 + var ctrlAs = '$saBcgroupCtrl';
  67 +
  68 + // 如果有required属性,添加angularjs required验证
  69 + if ($required_attr != undefined) {
  70 + //console.log(tElem.html());
  71 + tElem.find("div").attr("required", "");
  72 + }
  73 +
  74 + return {
  75 + pre: function(scope, element, attr) {
  76 + // TODO:
  77 + },
  78 +
  79 + /**
  80 + * 相当于link函数。
  81 + * @param scope
  82 + * @param element
  83 + * @param attr
  84 + */
  85 + post: function(scope, element, attr) {
  86 + // name属性
  87 + if ($name_attr) {
  88 + scope[ctrlAs]["$name_attr"] = $name_attr;
  89 + }
  90 +
  91 + // TODO:
  92 +
  93 +
  94 + /**
  95 + * 班次列表点击(班次列表中选中班次)
  96 + * @param $index
  97 + */
  98 + scope[ctrlAs].$$internal_bclist_click = function($index) {
  99 + var data_temp = scope[ctrlAs].$$data;
  100 + var data_temp2 = scope[ctrlAs].$$dataSelected;
  101 + var i = 0;
  102 + var isunique = true; // 是否已经选择过
  103 + if (data_temp && data_temp.length > $index) {
  104 + for (i = 0; i < data_temp2.length; i++) {
  105 + if (data_temp2[i].bcttinfoid == data_temp[$index].bcttinfoid) {
  106 + isunique = false;
  107 + break;
  108 + }
  109 + }
  110 + if (isunique) {
  111 + data_temp2.push({
  112 + bcttinfoid: data_temp[$index].bcttinfoid,
  113 + bcfcsj: data_temp[$index].bcfcsj,
  114 + bctype: data_temp[$index].bctype
  115 + });
  116 + }
  117 +
  118 + }
  119 + };
  120 + /**
  121 + * 选中的班次双击(删除选中的班次)
  122 + * @param $index
  123 + */
  124 + scope[ctrlAs].$$internal_selbclist_dbclick = function($index) {
  125 + var data_temp = scope[ctrlAs].$$dataSelected;
  126 + if (data_temp && data_temp.length > $index) {
  127 + data_temp.splice($index, 1);
  128 + }
  129 + };
  130 +
  131 +
  132 + /**
  133 + * 验证内部数据,更新外部model
  134 + */
  135 + scope[ctrlAs].$$internal_validate_model = function() {
  136 + var data_temp = scope[ctrlAs].$$dataSelected;
  137 + var bcttinfoIds = [];
  138 + var i = 0;
  139 +
  140 + if (data_temp &&
  141 + data_temp.length > 0) {
  142 +
  143 + for (i = 0; i < data_temp.length; i++) {
  144 + bcttinfoIds.push(data_temp[i].bcttinfoid);
  145 + }
  146 +
  147 + // 更新外部model字段
  148 + if ($bcttinfoidsname_attr) {
  149 + console.log("bcttinfoidsname=" + bcttinfoIds.join(','));
  150 + eval("scope[ctrlAs].model" + "." + $bcttinfoidsname_attr + " = bcttinfoIds.join(',');");
  151 + }
  152 +
  153 + // 更新内部model,用于外部验证
  154 + // 内部model的值暂时随意,以后再改
  155 + scope[ctrlAs].$$internalmodel = {desc: "ok"};
  156 +
  157 + scope[ctrlAs].$$data_bcdata_first_init = true;
  158 + scope[ctrlAs].$$data_bcttinfoids_first_init = true;
  159 +
  160 + } else {
  161 + scope[ctrlAs].$$internalmodel = undefined;
  162 + }
  163 +
  164 + };
  165 +
  166 + // 监控内部数据,$$data_selected 变化
  167 + scope.$watch(
  168 + function() {
  169 + return scope[ctrlAs].$$dataSelected;
  170 + },
  171 + function(newValue, oldValue) {
  172 + scope[ctrlAs].$$internal_validate_model();
  173 + },
  174 + true
  175 + );
  176 +
  177 + /**
  178 + * 验证数据是否初始化完成,
  179 + * 所谓的初始化就是内部所有的数据被有效设定过一次。
  180 + */
  181 + scope[ctrlAs].$$internal_validate_init = function() {
  182 + var self = scope[ctrlAs];
  183 +
  184 + var data_temp = self.$$data;
  185 + var dataSelect_temp = self.$$dataSelected;
  186 + var bcttinfoids = null;
  187 +
  188 + var i = 0;
  189 + var j = 0;
  190 +
  191 + if (self.$$data_bcdata_first_init &&
  192 + self.$$data_bcttinfoids_first_init) {
  193 + console.log("开始初始化数据");
  194 +
  195 + bcttinfoids = self.$$data_bcttinfoids_first_data ? self.$$data_bcttinfoids_first_data.split(",") : [];
  196 +
  197 + for (i = 0; i < bcttinfoids.length; i++) {
  198 + dataSelect_temp.push({
  199 + bcttinfoid: bcttinfoids[i]
  200 + });
  201 + for (j = 0; j < data_temp.length; j++) {
  202 + if (dataSelect_temp[i].bcttinfoid == data_temp[j].bcttinfoid) {
  203 + dataSelect_temp[i].bcfcsj = data_temp[j].bcfcsj;
  204 + dataSelect_temp[i].bctype = data_temp[j].bctype;
  205 + break;
  206 + }
  207 + }
  208 + }
  209 +
  210 + console.log("数据初始化完毕!");
  211 + }
  212 +
  213 + };
  214 +
  215 + // 监控初始化标志
  216 + scope.$watch(
  217 + function() {
  218 + return scope[ctrlAs].$$data_bcdata_first_init;
  219 + },
  220 + function(newValue, oldValue) {
  221 + scope[ctrlAs].$$internal_validate_init();
  222 + }
  223 + );
  224 + scope.$watch(
  225 + function() {
  226 + return scope[ctrlAs].$$data_bcttinfoids_first_init;
  227 + },
  228 + function(newValue, oldValue) {
  229 + scope[ctrlAs].$$internal_validate_init();
  230 + }
  231 + );
  232 +
  233 + // 监控内部数据的变化
  234 + attr.$observe("dataparams", function(value) {
  235 + if (value && value != "") {
  236 + console.log("observe 监控 dataparams=" + value);
  237 +
  238 + var obj = JSON.parse(value);
  239 + timeTableDetailManageService_g.bcdetails.list(
  240 + obj,
  241 + function(result) {
  242 + // 获取值了
  243 + console.log("内部班次数据获取了");
  244 +
  245 + scope[ctrlAs].$$data = [];
  246 + for (var i = 0; i < result.length; i++) {
  247 + scope[ctrlAs].$$data.push({
  248 + bcttinfoid: result[i].id,
  249 + bcfcsj: result[i].fcsj,
  250 + bctype: result[i].bcType
  251 + });
  252 + }
  253 + if (scope[ctrlAs].$$data_bcdata_first_init &&
  254 + scope[ctrlAs].$$data_bcttinfoids_first_init) {
  255 +
  256 + scope[ctrlAs].$$dataSelected = [];
  257 + scope[ctrlAs].$$internalmodel = undefined;
  258 + }
  259 + scope[ctrlAs].$$data_bcdata_first_init = true;
  260 + },
  261 + function(result) {
  262 +
  263 + }
  264 + );
  265 + }
  266 + });
  267 + // 监控班次ids数据的变化
  268 + attr.$observe("bcttinfoidsvalue", function(value) {
  269 + if (value && value != "") {
  270 + console.log("observe 监控 bcttinfoidsvalue=" + value);
  271 + scope[ctrlAs].$$data_bcttinfoids_first_init = true;
  272 + scope[ctrlAs].$$data_bcttinfoids_first_data = value;
  273 + }
  274 + });
  275 +
  276 + }
  277 + }
  278 +
  279 + }
  280 + }
  281 + }
  282 +]);
0 \ No newline at end of file 283 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
@@ -458,6 +458,26 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -458,6 +458,26 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
458 } 458 }
459 } 459 }
460 ), 460 ),
  461 + lpInfo: $resource(
  462 + '/gic/ttlpnames',
  463 + {order: "lpName", direction: 'ASC'},
  464 + {
  465 + list: {
  466 + method: 'GET',
  467 + isArray: true
  468 + }
  469 + }
  470 + ),
  471 + lpInfo2: $resource(
  472 + '/gic/:type',
  473 + {order: "lpName", direction: 'ASC'},
  474 + {
  475 + list: {
  476 + method: 'GET',
  477 + isArray: true
  478 + }
  479 + }
  480 + ),
461 cci: $resource( 481 cci: $resource(
462 '/cci/cars', 482 '/cci/cars',
463 {}, 483 {},
@@ -872,7 +892,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&quot;saSelect3&quot;, [ @@ -872,7 +892,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&quot;saSelect3&quot;, [
872 * @param dcvalue 传入的关联数据 892 * @param dcvalue 传入的关联数据
873 */ 893 */
874 scope[ctrlAs].$$internal_other_data = function(result, dcvalue) { 894 scope[ctrlAs].$$internal_other_data = function(result, dcvalue) {
875 - //console.log("start"); 895 + console.log("start=" + dcvalue);
876 // 清空内部数据 896 // 清空内部数据
877 scope[ctrlAs].$$data_real = []; 897 scope[ctrlAs].$$data_real = [];
878 scope[ctrlAs].$$data = []; 898 scope[ctrlAs].$$data = [];
@@ -2431,3 +2451,599 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -2431,3 +2451,599 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
2431 } 2451 }
2432 ]); 2452 ]);
2433 2453
  2454 +
  2455 +/**
  2456 + * saBcgroup指令,用于套跑界面中,从指定线路,指定时刻表,指定路牌的班次列表中选择套跑班次。
  2457 + * 属性如下:
  2458 + * name(必须):控件的名字
  2459 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  2460 + * bcttinfoidsvalue(必须):绑定的model班次ids字段值,如:bcttinfoidsvalue={{ctrl.employeeInfoForSave.lprange}}
  2461 + * bcttinfoidsname(必须):bind的model班次ids字段名,如:bcttinfoidsname=lprange
  2462 + * dataparams (必须):内部数据关联的查询参数,如:{{ {'ttid': ctrl.rerunManageForSave.rerunTtinfo.id} | json }}
  2463 + * required(可选):是否要用required验证
  2464 + *
  2465 + */
  2466 +angular.module('ScheduleApp').directive('saBcgroup', [
  2467 + 'TimeTableDetailManageService_g',
  2468 + function(timeTableDetailManageService_g) {
  2469 + return {
  2470 + restrict: 'E',
  2471 + templateUrl: '/pages/scheduleApp/module/common/dts2/bcGroup/MyBcGroupWrapTemplate.html',
  2472 + scope: {
  2473 + model: "=" // 独立作用域,关联外部的模型object
  2474 + },
  2475 + controllerAs: '$saBcgroupCtrl',
  2476 + bindToController: true,
  2477 + controller: function($scope) {
  2478 + var self = this;
  2479 + self.$$data = []; // 选择线路,时刻表,路牌后的班次列表
  2480 +
  2481 + // 测试数据
  2482 + //self.$$data = [
  2483 + // {bcttinfoid: 1, bcfcsj: '7:30', bctype: 'out'},
  2484 + // {bcttinfoid: 2, bcfcsj: '8:30', bctype: 'normal'},
  2485 + // {bcttinfoid: 3, bcfcsj: '9:30', bctype: 'in'}
  2486 + //];
  2487 +
  2488 +
  2489 + self.$$dataSelected = []; // 套跑选中的班次列表
  2490 +
  2491 + //self.$$dataSelected = [
  2492 + // {bcttinfoid: 1, bcfcsj: '7:30', bctype: 'out'},
  2493 + // {bcttinfoid: 2, bcfcsj: '8:30', bctype: 'normal'},
  2494 + // {bcttinfoid: 3, bcfcsj: '9:30', bctype: 'in'}
  2495 + //];
  2496 +
  2497 + // saBcgroup组件的ng-model,用于外部绑定等操作
  2498 + self.$$internalmodel = undefined;
  2499 +
  2500 + self.$$data_bcdata_first_init = false; // 班次数据首次初始化标志
  2501 + self.$$data_bcttinfoids_first_init = false; // 班次ids数据首次初始化标志
  2502 + self.$$data_bcttinfoids_first_data = undefined; // 班次ids数据首次初始化数据
  2503 +
  2504 + },
  2505 +
  2506 + /**
  2507 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  2508 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  2509 + * @param tElem
  2510 + * @param tAttrs
  2511 + * @returns {{pre: Function, post: Function}}
  2512 + */
  2513 + compile: function(tElem, tAttrs) {
  2514 + // TODO:获取所有的属性
  2515 + var $name_attr = tAttrs["name"]; // 控件的名字
  2516 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  2517 + var $bcttinfoidsname_attr = tAttrs["bcttinfoidsname"]; // bind的model班次ids字段名
  2518 +
  2519 + // controlAs名字
  2520 + var ctrlAs = '$saBcgroupCtrl';
  2521 +
  2522 + // 如果有required属性,添加angularjs required验证
  2523 + if ($required_attr != undefined) {
  2524 + //console.log(tElem.html());
  2525 + tElem.find("div").attr("required", "");
  2526 + }
  2527 +
  2528 + return {
  2529 + pre: function(scope, element, attr) {
  2530 + // TODO:
  2531 + },
  2532 +
  2533 + /**
  2534 + * 相当于link函数。
  2535 + * @param scope
  2536 + * @param element
  2537 + * @param attr
  2538 + */
  2539 + post: function(scope, element, attr) {
  2540 + // name属性
  2541 + if ($name_attr) {
  2542 + scope[ctrlAs]["$name_attr"] = $name_attr;
  2543 + }
  2544 +
  2545 + // TODO:
  2546 +
  2547 +
  2548 + /**
  2549 + * 班次列表点击(班次列表中选中班次)
  2550 + * @param $index
  2551 + */
  2552 + scope[ctrlAs].$$internal_bclist_click = function($index) {
  2553 + var data_temp = scope[ctrlAs].$$data;
  2554 + var data_temp2 = scope[ctrlAs].$$dataSelected;
  2555 + var i = 0;
  2556 + var isunique = true; // 是否已经选择过
  2557 + if (data_temp && data_temp.length > $index) {
  2558 + for (i = 0; i < data_temp2.length; i++) {
  2559 + if (data_temp2[i].bcttinfoid == data_temp[$index].bcttinfoid) {
  2560 + isunique = false;
  2561 + break;
  2562 + }
  2563 + }
  2564 + if (isunique) {
  2565 + data_temp2.push({
  2566 + bcttinfoid: data_temp[$index].bcttinfoid,
  2567 + bcfcsj: data_temp[$index].bcfcsj,
  2568 + bctype: data_temp[$index].bctype
  2569 + });
  2570 + }
  2571 +
  2572 + }
  2573 + };
  2574 + /**
  2575 + * 选中的班次双击(删除选中的班次)
  2576 + * @param $index
  2577 + */
  2578 + scope[ctrlAs].$$internal_selbclist_dbclick = function($index) {
  2579 + var data_temp = scope[ctrlAs].$$dataSelected;
  2580 + if (data_temp && data_temp.length > $index) {
  2581 + data_temp.splice($index, 1);
  2582 + }
  2583 + };
  2584 +
  2585 +
  2586 + /**
  2587 + * 验证内部数据,更新外部model
  2588 + */
  2589 + scope[ctrlAs].$$internal_validate_model = function() {
  2590 + var data_temp = scope[ctrlAs].$$dataSelected;
  2591 + var bcttinfoIds = [];
  2592 + var i = 0;
  2593 +
  2594 + if (data_temp &&
  2595 + data_temp.length > 0) {
  2596 +
  2597 + for (i = 0; i < data_temp.length; i++) {
  2598 + bcttinfoIds.push(data_temp[i].bcttinfoid);
  2599 + }
  2600 +
  2601 + // 更新外部model字段
  2602 + if ($bcttinfoidsname_attr) {
  2603 + console.log("bcttinfoidsname=" + bcttinfoIds.join(','));
  2604 + eval("scope[ctrlAs].model" + "." + $bcttinfoidsname_attr + " = bcttinfoIds.join(',');");
  2605 + }
  2606 +
  2607 + // 更新内部model,用于外部验证
  2608 + // 内部model的值暂时随意,以后再改
  2609 + scope[ctrlAs].$$internalmodel = {desc: "ok"};
  2610 +
  2611 + scope[ctrlAs].$$data_bcdata_first_init = true;
  2612 + scope[ctrlAs].$$data_bcttinfoids_first_init = true;
  2613 +
  2614 + } else {
  2615 + scope[ctrlAs].$$internalmodel = undefined;
  2616 + }
  2617 +
  2618 + };
  2619 +
  2620 + // 监控内部数据,$$data_selected 变化
  2621 + scope.$watch(
  2622 + function() {
  2623 + return scope[ctrlAs].$$dataSelected;
  2624 + },
  2625 + function(newValue, oldValue) {
  2626 + scope[ctrlAs].$$internal_validate_model();
  2627 + },
  2628 + true
  2629 + );
  2630 +
  2631 + /**
  2632 + * 验证数据是否初始化完成,
  2633 + * 所谓的初始化就是内部所有的数据被有效设定过一次。
  2634 + */
  2635 + scope[ctrlAs].$$internal_validate_init = function() {
  2636 + var self = scope[ctrlAs];
  2637 +
  2638 + var data_temp = self.$$data;
  2639 + var dataSelect_temp = self.$$dataSelected;
  2640 + var bcttinfoids = null;
  2641 +
  2642 + var i = 0;
  2643 + var j = 0;
  2644 +
  2645 + if (self.$$data_bcdata_first_init &&
  2646 + self.$$data_bcttinfoids_first_init) {
  2647 + console.log("开始初始化数据");
  2648 +
  2649 + bcttinfoids = self.$$data_bcttinfoids_first_data ? self.$$data_bcttinfoids_first_data.split(",") : [];
  2650 +
  2651 + for (i = 0; i < bcttinfoids.length; i++) {
  2652 + dataSelect_temp.push({
  2653 + bcttinfoid: bcttinfoids[i]
  2654 + });
  2655 + for (j = 0; j < data_temp.length; j++) {
  2656 + if (dataSelect_temp[i].bcttinfoid == data_temp[j].bcttinfoid) {
  2657 + dataSelect_temp[i].bcfcsj = data_temp[j].bcfcsj;
  2658 + dataSelect_temp[i].bctype = data_temp[j].bctype;
  2659 + break;
  2660 + }
  2661 + }
  2662 + }
  2663 +
  2664 + console.log("数据初始化完毕!");
  2665 + }
  2666 +
  2667 + };
  2668 +
  2669 + // 监控初始化标志
  2670 + scope.$watch(
  2671 + function() {
  2672 + return scope[ctrlAs].$$data_bcdata_first_init;
  2673 + },
  2674 + function(newValue, oldValue) {
  2675 + scope[ctrlAs].$$internal_validate_init();
  2676 + }
  2677 + );
  2678 + scope.$watch(
  2679 + function() {
  2680 + return scope[ctrlAs].$$data_bcttinfoids_first_init;
  2681 + },
  2682 + function(newValue, oldValue) {
  2683 + scope[ctrlAs].$$internal_validate_init();
  2684 + }
  2685 + );
  2686 +
  2687 + // 监控内部数据的变化
  2688 + attr.$observe("dataparams", function(value) {
  2689 + if (value && value != "") {
  2690 + console.log("observe 监控 dataparams=" + value);
  2691 +
  2692 + var obj = JSON.parse(value);
  2693 + timeTableDetailManageService_g.bcdetails.list(
  2694 + obj,
  2695 + function(result) {
  2696 + // 获取值了
  2697 + console.log("内部班次数据获取了");
  2698 +
  2699 + scope[ctrlAs].$$data = [];
  2700 + for (var i = 0; i < result.length; i++) {
  2701 + scope[ctrlAs].$$data.push({
  2702 + bcttinfoid: result[i].id,
  2703 + bcfcsj: result[i].fcsj,
  2704 + bctype: result[i].bcType
  2705 + });
  2706 + }
  2707 + if (scope[ctrlAs].$$data_bcdata_first_init &&
  2708 + scope[ctrlAs].$$data_bcttinfoids_first_init) {
  2709 +
  2710 + scope[ctrlAs].$$dataSelected = [];
  2711 + scope[ctrlAs].$$internalmodel = undefined;
  2712 + }
  2713 + scope[ctrlAs].$$data_bcdata_first_init = true;
  2714 + },
  2715 + function(result) {
  2716 +
  2717 + }
  2718 + );
  2719 + }
  2720 + });
  2721 + // 监控班次ids数据的变化
  2722 + attr.$observe("bcttinfoidsvalue", function(value) {
  2723 + if (value && value != "") {
  2724 + console.log("observe 监控 bcttinfoidsvalue=" + value);
  2725 + scope[ctrlAs].$$data_bcttinfoids_first_init = true;
  2726 + scope[ctrlAs].$$data_bcttinfoids_first_data = value;
  2727 + }
  2728 + });
  2729 +
  2730 + }
  2731 + }
  2732 +
  2733 + }
  2734 + }
  2735 + }
  2736 +]);
  2737 +
  2738 +/**
  2739 + * saSelect4指令,封装angular-ui-select控件,并添加相应的业务。
  2740 + * name(必须):控件的名字
  2741 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  2742 + * placeholder(可选):输入框占位符字符串
  2743 + *
  2744 + * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}
  2745 + * dcname(必须):绑定的model字段名,如:dcname=xl.id
  2746 + * icname(必须):内部与之对应的字段名,如:icname=code
  2747 + *
  2748 + * cmaps(可选):model其他字段和内部数据字段名映射,如:{{ {'xl.id' : 'id', 'xl.name' : 'name'} | json}}
  2749 + * dsparams(必须):内部数据源查询参数,如:{{ {'ttid': ctrl.rerunManageForSave.rerunTtinfo.id} | json }}
  2750 + * dscol(必须):内部显示的信息(暂时用内部字段),如:dscol=name
  2751 + * required(可选):是否要用required验证
  2752 + */
  2753 +angular.module('ScheduleApp').directive('saSelect4', [
  2754 + '$timeout',
  2755 + '$$SearchInfoService_g',
  2756 + function($timeout, $$searchInfoService_g) {
  2757 + return {
  2758 + restrict: 'E',
  2759 + templateUrl: '/pages/scheduleApp/module/common/dts1/select/MyUISelectWrapTemplate2.html',
  2760 + scope: {
  2761 + model: "=" // 独立作用域,关联外部的模型object
  2762 + },
  2763 + controllerAs: "$saSelectCtrl",
  2764 + bindToController: true,
  2765 + controller: function($scope) {
  2766 + var self = this;
  2767 + self.$$data = []; // ui-select显示用的数据
  2768 + self.$$data_real = []; // 内部真实的数据
  2769 +
  2770 + // saSelect4组件的ng-model,用于外部绑定验证等操作
  2771 + self.$$internalmodel = undefined;
  2772 +
  2773 + self.$$internal_select_value = undefined; // 选中的值
  2774 + },
  2775 +
  2776 + /**
  2777 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  2778 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  2779 + * @param tElem
  2780 + * @param tAttrs
  2781 + * @returns {{pre: Function, post: Function}}
  2782 + */
  2783 + compile: function(tElem, tAttrs) {
  2784 + // 获取属性
  2785 + var $name_attr = tAttrs["name"]; // 控件的名字
  2786 + var $placeholder_attr = tAttrs["placeholder"]; // 占位符的名字
  2787 +
  2788 + var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名
  2789 + var $icname_attr = tAttrs["icname"]; // 内部与之对应的字段名
  2790 +
  2791 + var $cmaps_attr = tAttrs["cmaps"]; // model其他字段和内部数据字段名映射
  2792 + var $dscol_attr = tAttrs["dscol"]; // 内部显示的信息
  2793 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  2794 +
  2795 + // controlAs名字
  2796 + var ctrlAs = "$saSelectCtrl";
  2797 +
  2798 + // 验证属性
  2799 + if (!$name_attr) {
  2800 + throw new error("name属性必须填写");
  2801 + }
  2802 + if (!$dcname_attr) {
  2803 + throw new error("dcname属性必须填写");
  2804 + }
  2805 + if (!$icname_attr) {
  2806 + throw new error("icname属性必须填写");
  2807 + }
  2808 + if (!$dscol_attr) {
  2809 + throw new error("dscol属性必须填写");
  2810 + }
  2811 +
  2812 + // 动态设置dom
  2813 + // dom required 属性
  2814 + if ($required_attr != undefined) {
  2815 + tElem.find("div").attr("required", "");
  2816 + }
  2817 + // dom placeholder 属性
  2818 + tElem.find("ui-select-match").attr("placeholder", $placeholder_attr);
  2819 + // dom dscol 属性
  2820 + tElem.find("ui-select-match").html("{{$select.selected" + "." + $dscol_attr + "}}");
  2821 + tElem.find("ui-select-choices span").attr("ng-bind", "item" + "." + $dscol_attr);
  2822 + // dom icname 属性
  2823 + tElem.find("ui-select-choices").attr("repeat", "item" + "." + $icname_attr + " as item in $saSelectCtrl.$$data");
  2824 + // dom name 属性
  2825 + tElem.find("div").attr("name", $name_attr);
  2826 +
  2827 + return {
  2828 + pre: function(scope, element, attr) {
  2829 + // TODO:
  2830 + },
  2831 +
  2832 + /**
  2833 + * 相当于link函数。
  2834 + * @param scope
  2835 + * @param element
  2836 + * @param attr
  2837 + */
  2838 + post: function(scope, element, attr) {
  2839 +
  2840 + // 添加选中事件处理函数
  2841 + scope[ctrlAs].$$internal_select_fn = function($item) {
  2842 + if ($dcname_attr && $icname_attr) {
  2843 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";");
  2844 + }
  2845 +
  2846 + if ($cmaps_attr) {
  2847 + for (var mc in $cmaps_attr) { // model的字段名:内部数据源对应字段名
  2848 + var ic = $cmaps_attr[mc]; // 内部数据源对应字段
  2849 + eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";");
  2850 + }
  2851 + }
  2852 + };
  2853 +
  2854 + // 删除选中事件处理函数
  2855 + scope[ctrlAs].$$internal_remove_fn = function() {
  2856 + scope[ctrlAs].$$internal_select_value = undefined;
  2857 + if ($dcname_attr) {
  2858 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;");
  2859 + }
  2860 +
  2861 + if ($cmaps_attr) {
  2862 + var mc; // model的字段名
  2863 + for (mc in $cmaps_attr) {
  2864 + eval("scope[ctrlAs].model" + "." + mc + " = undefined;");
  2865 + }
  2866 + }
  2867 + scope[ctrlAs].$$internal_validate_model();
  2868 + };
  2869 +
  2870 + // 刷新数据
  2871 + scope[ctrlAs].$$internal_refresh_fn = function(search) {
  2872 + if (search && search != "") { // 有search值
  2873 + // 处理search
  2874 + console.log("search:" + search);
  2875 +
  2876 + scope[ctrlAs].$$data = [];
  2877 + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {
  2878 + var upTerm = search.toUpperCase();
  2879 + if (scope[ctrlAs].$$data.length < 10) {
  2880 + if (scope[ctrlAs].$$data_real[k].fullChars.indexOf(upTerm) != -1
  2881 + || scope[ctrlAs].$$data_real[k].camelChars.indexOf(upTerm) != -1) {
  2882 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  2883 + }
  2884 + } else {
  2885 + break;
  2886 + }
  2887 + }
  2888 + }
  2889 + };
  2890 +
  2891 + /**
  2892 + * 验证内部数据,更新外部model
  2893 + */
  2894 + scope[ctrlAs].$$internal_validate_model = function() {
  2895 + if (scope[ctrlAs].$$internal_select_value) {
  2896 + var select_value_temp = scope[ctrlAs].$$internal_select_value;
  2897 + if (scope[ctrlAs].$$data_real && scope[ctrlAs].$$data_real.length > 0) {
  2898 + var obj;
  2899 + for (var j = 0; j < scope[ctrlAs].$$data_real.length; j++) {
  2900 + if (eval("scope[ctrlAs].$$data_real[j]" + "." + $icname_attr + " == select_value_temp")) {
  2901 + obj = angular.copy(scope[ctrlAs].$$data_real[j]);
  2902 + break;
  2903 + }
  2904 + }
  2905 + if (obj) { // 在data中判定有没有
  2906 + for (var k = 0; k < scope[ctrlAs].$$data.length; k++) {
  2907 + if (eval("scope[ctrlAs].$$data[k]" + "." + $icname_attr + " == obj." + $icname_attr)) {
  2908 + obj = undefined;
  2909 + break;
  2910 + }
  2911 + }
  2912 + if (obj) {
  2913 + scope[ctrlAs].$$data.push(obj);
  2914 + }
  2915 + // 更新内部model,用于外部验证
  2916 + // 内部model的值暂时随意,以后再改
  2917 + scope[ctrlAs].$$internalmodel = {desc: "ok"};
  2918 + } else {
  2919 + scope[ctrlAs].$$internalmodel = undefined;
  2920 + }
  2921 +
  2922 + } else {
  2923 + scope[ctrlAs].$$internalmodel = undefined;
  2924 + }
  2925 +
  2926 + } else {
  2927 + scope[ctrlAs].$$internalmodel = undefined;
  2928 + }
  2929 + };
  2930 +
  2931 + /**
  2932 + * 内部方法,读取字典数据作为数据源。
  2933 + * @param atype ajax查询类型
  2934 + * @param ajaxparamobj 查询参数对象
  2935 + */
  2936 + scope[ctrlAs].$$internal_ajax_data = function(atype, ajaxparamobj) {
  2937 + ajaxparamobj.type = 'all';
  2938 + $$searchInfoService_g[atype].list(
  2939 + ajaxparamobj,
  2940 + function(result) {
  2941 + console.log("$$internal_ajax_data result");
  2942 +
  2943 + // 清空内部数据
  2944 + scope[ctrlAs].$$data_real = [];
  2945 + scope[ctrlAs].$$data = [];
  2946 +
  2947 + // result中添加拼音数据,注意:这里要求result返回对象数组
  2948 + for (var i = 0; i < result.length; i ++) {
  2949 + if ($dscol_attr) {
  2950 + if (eval("result[i]" + "." + $dscol_attr)) {
  2951 + // 全拼
  2952 + result[i]["fullChars"] = pinyin.getFullChars(eval("result[i]" + "." + $dscol_attr)).toUpperCase();
  2953 + // 简拼
  2954 + result[i]["camelChars"] = pinyin.getCamelChars(eval("result[i]" + "." + $dscol_attr));
  2955 + }
  2956 + }
  2957 +
  2958 + if (result[i]["fullChars"]) { // 有拼音的加入数据源
  2959 + scope[ctrlAs].$$data_real.push(result[i]);
  2960 + }
  2961 +
  2962 + }
  2963 +
  2964 + // 数据量太大,取10条记录显示
  2965 + if (angular.isArray(scope[ctrlAs].$$data_real)) {
  2966 + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {
  2967 + if (scope[ctrlAs].$$data.length < 10) {
  2968 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  2969 + } else {
  2970 + break;
  2971 + }
  2972 + }
  2973 + }
  2974 +
  2975 + scope[ctrlAs].$$internal_validate_model();
  2976 + },
  2977 + function(result) {
  2978 +
  2979 + }
  2980 + );
  2981 + };
  2982 +
  2983 + /**
  2984 + * 内部方法,读取字典数据作为数据源。
  2985 + * @param dictype 字典类型,如:gsType
  2986 + */
  2987 + scope[ctrlAs].$$internal_dic_data = function(dictype) {
  2988 + if (!dictionaryUtils.getByGroup(dictype)) {
  2989 + throw new error("字典数据不窜在=" + dictype);
  2990 + }
  2991 +
  2992 + // 清空内部数据
  2993 + scope[ctrlAs].$$data_real = [];
  2994 + scope[ctrlAs].$$data = [];
  2995 +
  2996 + var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup);
  2997 + var dic_key; // 字典key
  2998 +
  2999 + for (dic_key in origin_dicgroup) {
  3000 + var data = {}; // 重新组合的字典元素对象
  3001 + if (dic_key == "true")
  3002 + data[$icname_attr] = true;
  3003 + else
  3004 + data[$icname_attr] = dic_key;
  3005 + data[$dscol_attr] = origin_dicgroup[dic_key];
  3006 + scope[ctrlAs].$$data_real.push(data);
  3007 + }
  3008 + // 这里直接将$$data_real数据深拷贝到$$data
  3009 + angular.copy(scope[ctrlAs].$$data_real, scope[ctrlAs].$$data);
  3010 + scope[ctrlAs].$$internal_validate_model();
  3011 + };
  3012 +
  3013 + attr.$observe("dsparams", function(value) {
  3014 + if (value && value != "") {
  3015 + var obj = JSON.parse(value);
  3016 + console.log("observe 监控 dsparams=" + obj);
  3017 +
  3018 + // dsparams格式如下:
  3019 + // {type: 'dic/ajax', param: 'dic名字'/'ajax查询参数对象', atype: 'ajax查询类型'}
  3020 +
  3021 + if (obj.type == 'dic') {
  3022 + scope[ctrlAs].$$internal_dic_data(obj.param);
  3023 +
  3024 + } else if (obj.type == 'ajax') {
  3025 + scope[ctrlAs].$$internal_ajax_data(obj.atype, obj.param);
  3026 + } else {
  3027 + throw new Error("dsparams参数格式异常=" + obj);
  3028 + }
  3029 +
  3030 + }
  3031 +
  3032 + });
  3033 +
  3034 + // 监控model绑定的dcvalue值变化
  3035 + attr.$observe("dcvalue", function(value) {
  3036 + if (value && value != "") {
  3037 + console.log("observe 监控 dcvalue=" + value);
  3038 + scope[ctrlAs].$$internal_select_value = value;
  3039 + scope[ctrlAs].$$internal_validate_model();
  3040 + }
  3041 + });
  3042 + }
  3043 + };
  3044 +
  3045 + }
  3046 +
  3047 + };
  3048 + }
  3049 +]);
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
@@ -301,6 +301,33 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource @@ -301,6 +301,33 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource
301 }; 301 };
302 }]); 302 }]);
303 303
  304 +// 套跑管理service
  305 +angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) {
  306 + return {
  307 + rest: $resource(
  308 + 'rms/:id',
  309 + {order: 'rerunXl.name,createDate', direction: 'DESC', id: '@id_route'},
  310 + {
  311 + list: {
  312 + method: 'GET',
  313 + params: {
  314 + page: 0
  315 + }
  316 + },
  317 + get: {
  318 + method: 'GET'
  319 + },
  320 + save: {
  321 + method: 'POST'
  322 + },
  323 + delete: {
  324 + method: 'DELETE'
  325 + }
  326 + }
  327 + )
  328 + };
  329 +}]);
  330 +
304 // 时刻表管理service 331 // 时刻表管理service
305 angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) { 332 angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) {
306 return { 333 return {
@@ -360,6 +387,16 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;TimeTableDetailManageService_g&#39;, [&#39;$resou @@ -360,6 +387,16 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;TimeTableDetailManageService_g&#39;, [&#39;$resou
360 method: 'GET' 387 method: 'GET'
361 } 388 }
362 } 389 }
  390 + ),
  391 + bcdetails: $resource(
  392 + '/tidc/bcdetail',
  393 + {},
  394 + {
  395 + list: {
  396 + method: 'GET',
  397 + isArray: true
  398 + }
  399 + }
363 ) 400 )
364 }; 401 };
365 }]); 402 }]);
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
@@ -663,6 +663,88 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi @@ -663,6 +663,88 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi
663 } 663 }
664 }) 664 })
665 665
  666 + // 套跑管理模块
  667 + .state("rerunManage", {
  668 + url: '/rerunManage',
  669 + views: {
  670 + "": {
  671 + templateUrl: 'pages/scheduleApp/module/core/rerunManage/index.html'
  672 + },
  673 + "rerunManage_list@rerunManage": {
  674 + templateUrl: 'pages/scheduleApp/module/core/rerunManage/list.html'
  675 + }
  676 + },
  677 +
  678 + resolve: {
  679 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  680 + return $ocLazyLoad.load({
  681 + name: 'rerunManage_module',
  682 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  683 + files: [
  684 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  685 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  686 + "pages/scheduleApp/module/core/rerunManage/main.js"
  687 + ]
  688 + });
  689 + }]
  690 + }
  691 + })
  692 + .state("rerunManage_form", {
  693 + url: '/rerunManage_form',
  694 + views: {
  695 + "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/form.html'}
  696 + },
  697 + resolve: {
  698 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  699 + return $ocLazyLoad.load({
  700 + name: 'rerunManage_form_module',
  701 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  702 + files: [
  703 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  704 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  705 + "pages/scheduleApp/module/core/rerunManage/main.js"
  706 + ]
  707 + });
  708 + }]
  709 + }
  710 + })
  711 + .state("rerunManage_edit", {
  712 + url: '/rerunManage_edit/:id',
  713 + views: {
  714 + "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/edit.html'}
  715 + },
  716 + resolve: {
  717 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  718 + return $ocLazyLoad.load({
  719 + name: 'rerunManage_edit_module',
  720 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  721 + files: [
  722 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  723 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  724 + "pages/scheduleApp/module/core/rerunManage/main.js"
  725 + ]
  726 + });
  727 + }]
  728 + }
  729 + })
  730 + .state("rerunManage_detail", {
  731 + url: '/rerunManage_detail/:id',
  732 + views: {
  733 + "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/detail.html'}
  734 + },
  735 + resolve: {
  736 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  737 + return $ocLazyLoad.load({
  738 + name: 'rerunManage_detail_module',
  739 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  740 + files: [
  741 + "pages/scheduleApp/module/core/rerunManage/main.js"
  742 + ]
  743 + });
  744 + }]
  745 + }
  746 + })
  747 +
666 // 排班计划管理模块 748 // 排班计划管理模块
667 .state("schedulePlanManage", { 749 .state("schedulePlanManage", {
668 url: '/schedulePlanManage', 750 url: '/schedulePlanManage',
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/detail.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>排班规则管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="scheduleRuleManage">排班规则管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">排班规则详细信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="ScheduleRuleManageDetailCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase"
  30 + ng-bind="ctrl.title"></span>
  31 + </div>
  32 + </div>
  33 +
  34 + <div class="portlet-body form">
  35 + <form 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 + <input type="text" class="form-control"
  48 + name="xl" ng-model="ctrl.scheduleRuleManageForDetail.xl.name" readonly/>
  49 + </div>
  50 + </div>
  51 +
  52 + <div class="form-group has-success has-feedback">
  53 + <label class="col-md-2 control-label">车辆*:</label>
  54 + <div class="col-md-3">
  55 + <input type="text" class="form-control" name="cl"
  56 + ng-model="ctrl.scheduleRuleManageForDetail.carConfigInfo.cl.insideCode" readonly/>
  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="qyrq" uib-datepicker-popup="yyyy年MM月dd日"
  65 + ng-model="ctrl.scheduleRuleManageForDetail.qyrq" readonly/>
  66 + </div>
  67 + </div>
  68 +
  69 + <div class="form-group has-success has-feedback">
  70 + <label class="col-md-2 control-label">路牌范围*:</label>
  71 + <div class="col-md-4">
  72 + <input type="text" class="form-control"
  73 + ng-model="ctrl.scheduleRuleManageForDetail.lpNames" 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 + <input type="text" class="form-control"
  81 + ng-model="ctrl.scheduleRuleManageForDetail.lpStart" readonly/>
  82 + </div>
  83 + </div>
  84 +
  85 + <div class="form-group has-success has-feedback">
  86 + <label class="col-md-2 control-label">人员范围*:</label>
  87 + <div class="col-md-4">
  88 + <input type="text" class="form-control"
  89 + ng-model="ctrl.scheduleRuleManageForDetail.ryDbbms" readonly/>
  90 + </div>
  91 + </div>
  92 +
  93 + <div class="form-group has-success has-feedback">
  94 + <label class="col-md-2 control-label">起始人员*:</label>
  95 + <div class="col-md-4">
  96 + <input type="text" class="form-control"
  97 + ng-model="ctrl.scheduleRuleManageForDetail.ryStart" 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"
  105 + ng-model="ctrl.scheduleRuleManageForDetail.fbgs" readonly/>
  106 + </div>
  107 + </div>
  108 +
  109 + <!-- 其他form-group -->
  110 +
  111 + </div>
  112 +
  113 + </form>
  114 +
  115 + </div>
  116 +</div>
0 \ No newline at end of file 117 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/edit.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>排班规则管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="scheduleRuleManage">排班规则管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">修改排班规则信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="ScheduleRuleManageFormCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="portlet-body form">
  34 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  35 + <!--<div class="alert alert-danger display-hide">-->
  36 + <!--<button class="close" data-close="alert"></button>-->
  37 + <!--您的输入有误,请检查下面的输入项-->
  38 + <!--</div>-->
  39 +
  40 +
  41 + <!-- 其他信息放置在这里 -->
  42 + <div class="form-body">
  43 + <div class="form-group has-success has-feedback">
  44 + <label class="col-md-2 control-label">线路*:</label>
  45 + <div class="col-md-3">
  46 + <sa-Select3 model="ctrl.scheduleRuleManageForSave"
  47 + name="xl"
  48 + placeholder="请输拼音..."
  49 + dcvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}"
  50 + dcname="xl.id"
  51 + icname="id"
  52 + icnames="name"
  53 + datatype="xl"
  54 + mlp="true"
  55 + required >
  56 + </sa-Select3>
  57 + </div>
  58 + <!-- 隐藏块,显示验证信息 -->
  59 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  60 + 线路必须选择
  61 + </div>
  62 + </div>
  63 + <div class="form-group has-success has-feedback">
  64 + <label class="col-md-2 control-label">车辆配置*:</label>
  65 + <div class="col-md-3">
  66 + <sa-Select3 model="ctrl.scheduleRuleManageForSave"
  67 + name="cl"
  68 + placeholder="请输拼音..."
  69 + dcvalue="{{ctrl.scheduleRuleManageForSave.carConfigInfo.id}}"
  70 + dcname="carConfigInfo.id"
  71 + icname="id"
  72 + icnames="cl.insideCode"
  73 + datatype="cci2"
  74 + dataassociate="true"
  75 + dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id} | json }}"
  76 + mlp="true"
  77 + required >
  78 + </sa-Select3>
  79 + </div>
  80 + <!-- 隐藏块,显示验证信息 -->
  81 + <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
  82 + 车辆必须选择
  83 + </div>
  84 + </div>
  85 +
  86 + <div class="form-group has-success has-feedback">
  87 + <label class="col-md-2 control-label">启用日期*:</label>
  88 + <div class="col-md-3">
  89 + <div class="input-group">
  90 + <input type="text" class="form-control"
  91 + name="qyrq" placeholder="请选择启用日期..."
  92 + uib-datepicker-popup="yyyy年MM月dd日"
  93 + is-open="ctrl.qyrqOpen" required
  94 + ng-model="ctrl.scheduleRuleManageForSave.qyrq" readonly/>
  95 + <span class="input-group-btn">
  96 + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()">
  97 + <i class="glyphicon glyphicon-calendar"></i>
  98 + </button>
  99 + </span>
  100 + </div>
  101 + </div>
  102 + <!-- 隐藏块,显示验证信息 -->
  103 + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required">
  104 + 启用日期必须选择
  105 + </div>
  106 + </div>
  107 +
  108 + <div class="form-group has-success has-feedback">
  109 + <label class="col-md-2 control-label">路牌范围*:</label>
  110 + <div class="col-md-6">
  111 + <sa-Guideboardgroup model="ctrl.scheduleRuleManageForSave"
  112 + name="lprange"
  113 + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}"
  114 + lprangevalue="{{ctrl.scheduleRuleManageForSave.lpNames}}"
  115 + lprangename="lpNames"
  116 + lpidrangevalue="{{ctrl.scheduleRuleManageForSave.lpIds}}"
  117 + lpidrangename="lpIds"
  118 + lpstartvalue="{{ctrl.scheduleRuleManageForSave.lpStart}}"
  119 + lpstartname="lpStart"
  120 + required
  121 + >
  122 + </sa-Guideboardgroup>
  123 + </div>
  124 + <div class="alert alert-danger well-sm" ng-show="myForm.lprange.$error.required">
  125 + 路牌范围,起始路牌必须选择
  126 + </div>
  127 + </div>
  128 +
  129 + <div class="form-group has-success has-feedback">
  130 + <label class="col-md-2 control-label">人员范围*:</label>
  131 + <div class="col-md-6">
  132 + <sa-Employeegroup model="ctrl.scheduleRuleManageForSave"
  133 + name="ryrange"
  134 + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}"
  135 + dbbmrangevalue="{{ctrl.scheduleRuleManageForSave.ryDbbms}}"
  136 + dbbmrangename="ryDbbms"
  137 + rycidrangevalue="{{ctrl.scheduleRuleManageForSave.ryConfigIds}}"
  138 + rycidrangename="ryConfigIds"
  139 + rystartvalue="{{ctrl.scheduleRuleManageForSave.ryStart}}"
  140 + rystartname="ryStart"
  141 + required
  142 + >
  143 + </sa-Employeegroup>
  144 + </div>
  145 + <div class="alert alert-danger well-sm" ng-show="myForm.ryrange.$error.required">
  146 + 人员范围,起始人员必须选择
  147 + </div>
  148 + </div>
  149 +
  150 + <!--<div class="form-group">-->
  151 + <!--<label class="col-md-2 control-label">翻班格式:</label>-->
  152 + <!--<div class="col-md-4">-->
  153 + <!--<input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs"-->
  154 + <!--placeholder="车辆翻班格式"/>-->
  155 + <!--</div>-->
  156 + <!--</div>-->
  157 +
  158 +
  159 + <!-- 其他form-group -->
  160 +
  161 + </div>
  162 +
  163 + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 -->
  164 + <div class="form-actions">
  165 + <div class="row">
  166 + <div class="col-md-offset-3 col-md-4">
  167 + <button type="submit" class="btn green"
  168 + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  169 + <a type="button" class="btn default" ui-sref="scheduleRuleManage" ><i class="fa fa-times"></i> 取消</a>
  170 + </div>
  171 + </div>
  172 + </div>
  173 +
  174 + </form>
  175 +
  176 + </div>
  177 +
  178 +
  179 +</div>
0 \ No newline at end of file 180 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/form.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>套跑管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="scheduleRuleManage">套跑管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">添加套跑信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="RerunManageFormCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="portlet-body form">
  34 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  35 + <!--<div class="alert alert-danger display-hide">-->
  36 + <!--<button class="close" data-close="alert"></button>-->
  37 + <!--您的输入有误,请检查下面的输入项-->
  38 + <!--</div>-->
  39 +
  40 +
  41 + <!-- 其他信息放置在这里 -->
  42 + <div class="form-body">
  43 + <div class="form-group has-success has-feedback">
  44 + <label class="col-md-2 control-label">线路*:</label>
  45 + <div class="col-md-3">
  46 + <sa-Select3 model="ctrl.rerunManageForSave"
  47 + name="rerunXl"
  48 + placeholder="请输拼音..."
  49 + dcvalue="{{ctrl.rerunManageForSave.rerunXl.id}}"
  50 + dcname="rerunXl.id"
  51 + icname="id"
  52 + icnames="name"
  53 + datatype="xl"
  54 + mlp="true"
  55 + required >
  56 + </sa-Select3>
  57 + </div>
  58 + <!-- 隐藏块,显示验证信息 -->
  59 + <div class="alert alert-danger well-sm" ng-show="myForm.rerunXl.$error.required">
  60 + 线路必须选择
  61 + </div>
  62 + </div>
  63 + <div class="form-group has-success has-feedback">
  64 + <label class="col-md-2 control-label">时刻表*:</label>
  65 + <div class="col-md-3">
  66 + <sa-Select3 model="ctrl.rerunManageForSave"
  67 + name="rerunTtinfo"
  68 + placeholder="请输拼音..."
  69 + dcvalue="{{ctrl.rerunManageForSave.rerunTtinfo.id}}"
  70 + dcname="rerunTtinfo.id"
  71 + icname="id"
  72 + icnames="name"
  73 + datatype="ttInfo"
  74 + dataassociate="true"
  75 + dataparam="{{ {'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id} | json }}"
  76 + mlp="true"
  77 + required >
  78 + </sa-Select3>
  79 + </div>
  80 + <!-- 隐藏块,显示验证信息 -->
  81 + <div class="alert alert-danger well-sm" ng-show="myForm.rerunTtinfo.$error.required">
  82 + 先选择线路,再选择时刻表
  83 + </div>
  84 + </div>
  85 + <div class="form-group has-success has-feedback">
  86 + <label class="col-md-2 control-label">路牌*:</label>
  87 + <div class="col-md-3">
  88 + <sa-Select3 model="ctrl.rerunManageForSave"
  89 + name="rerunLp"
  90 + placeholder="请输拼音..."
  91 + dcvalue="{{ctrl.rerunManageForSave.rerunLp.id}}"
  92 + dcname="rerunLp.id"
  93 + icname="lpId"
  94 + icnames="lpName"
  95 + datatype="lpInfo"
  96 + dataassociate="true"
  97 + dataparam="{{ {'ttid': ctrl.rerunManageForSave.rerunTtinfo.id} | json }}"
  98 + mlp="true"
  99 + required >
  100 + </sa-Select3>
  101 + </div>
  102 + <!-- 隐藏块,显示验证信息 -->
  103 + <div class="alert alert-danger well-sm" ng-show="myForm.rerunLp.$error.required">
  104 + 先选择时刻表,再选择路牌
  105 + </div>
  106 + </div>
  107 +
  108 + <div class="form-group has-success has-feedback">
  109 + <label class="col-md-2 control-label">套跑班次*:</label>
  110 + <div class="col-md-6">
  111 + <sa-Bcgroup model="ctrl.rerunManageForSave"
  112 + name="rerunTtinfodetailIds"
  113 + dataparams="{{ {'xlId': ctrl.rerunManageForSave.rerunXl.id, 'ttinfoId' : ctrl.rerunManageForSave.rerunTtinfo.id, 'lpId' : ctrl.rerunManageForSave.rerunLp.id} | json }}"
  114 + bcttinfoidsvalue="{{ctrl.rerunManageForSave.rerunTtinfodetailIds}}"
  115 + bcttinfoidsname="rerunTtinfodetailIds"
  116 + required >
  117 + </sa-Bcgroup>
  118 + </div>
  119 + <div class="alert alert-danger well-sm" ng-show="myForm.rerunTtinfodetailIds.$error.required">
  120 + 套跑班次必须选择
  121 + </div>
  122 + </div>
  123 +
  124 + <div class="form-group has-success has-feedback">
  125 + <label class="col-md-2 control-label">套跑类型*:</label>
  126 + <div class="col-md-3">
  127 + <sa-Radiogroup model="ctrl.rerunManageForSave.rerunType" dicgroup="rerunType" name="rerunType"></sa-Radiogroup>
  128 + </div>
  129 + </div>
  130 +
  131 + <div class="form-group has-success has-feedback"
  132 + ng-if="ctrl.rerunManageForSave.rerunType == 'dylp'">
  133 + <label class="col-md-2 control-label">线路2*:</label>
  134 + <div class="col-md-3">
  135 + <sa-Select4 model="ctrl.rerunManageForSave"
  136 + name="useXl"
  137 + placeholder="请输拼音..."
  138 + dcvalue="{{ctrl.rerunManageForSave.useXl.id}}"
  139 + dcname="useXl.id"
  140 + icname="id"
  141 + dscol="name"
  142 + dsparams="{{ {type: 'ajax', param:{}, atype:'xl' } | json }}"
  143 + mlp="true"
  144 + required >
  145 + </sa-Select4>
  146 + </div>
  147 + <!-- 隐藏块,显示验证信息 -->
  148 + <div class="alert alert-danger well-sm" ng-show="myForm.useXl.$error.required">
  149 + 线路2必须选择
  150 + </div>
  151 + </div>
  152 + <!--<div class="form-group has-success has-feedback"-->
  153 + <!--ng-if="ctrl.rerunManageForSave.rerunType == 'dylp'">-->
  154 + <!--<label class="col-md-2 control-label">路牌*:</label>-->
  155 + <!--<div class="col-md-3">-->
  156 + <!--<sa-Select3 model="ctrl.rerunManageForSave"-->
  157 + <!--name="useLp"-->
  158 + <!--placeholder="请输拼音..."-->
  159 + <!--dcvalue="{{ctrl.rerunManageForSave.useLp.id}}"-->
  160 + <!--dcname="useLp.id"-->
  161 + <!--icname="id"-->
  162 + <!--icnames="lpName"-->
  163 + <!--datatype="lpInfo2"-->
  164 + <!--dataassociate="true"-->
  165 + <!--dataparam="{{ {'xl.id_eq': ctrl.rerunManageForSave.useXl.id} | json }}"-->
  166 + <!--mlp="true"-->
  167 + <!--required >-->
  168 + <!--</sa-Select3>-->
  169 + <!--</div>-->
  170 + <!--&lt;!&ndash; 隐藏块,显示验证信息 &ndash;&gt;-->
  171 + <!--<div class="alert alert-danger well-sm" ng-show="myForm.useLp.$error.required">-->
  172 + <!--路牌2必须选择-->
  173 + <!--</div>-->
  174 + <!--</div>-->
  175 +
  176 +
  177 +
  178 +
  179 +
  180 + <div class="form-group has-success has-feedback" ng-if="ctrl.rerunManageForSave.rerunType == 'dybc'">
  181 + 对应班车
  182 + </div>
  183 +
  184 + </div>
  185 +
  186 + <div class="form-actions">
  187 + <div class="row">
  188 + <div class="col-md-offset-3 col-md-4">
  189 + <button type="submit" class="btn green"
  190 +
  191 + <!--ng-disabled="!myForm.$valid"-->
  192 +
  193 + ><i class="fa fa-check"></i> 提交</button>
  194 + <a type="button" class="btn default" ui-sref="rerunManage" ><i class="fa fa-times"></i> 取消</a>
  195 + </div>
  196 + </div>
  197 + </div>
  198 +
  199 + </form>
  200 +
  201 + </div>
  202 +
  203 +
  204 +</div>
0 \ No newline at end of file 205 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/index.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>套跑管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <span class="active">套跑管理</span>
  18 + </li>
  19 +</ul>
  20 +
  21 +<div class="row">
  22 + <div class="col-md-12" ng-controller="RerunManageCtrl as ctrl">
  23 + <div class="portlet light bordered">
  24 + <div class="portlet-title">
  25 + <div class="caption font-dark">
  26 + <i class="fa fa-database font-dark"></i>
  27 + <span class="caption-subject bold uppercase">排班规则</span>
  28 + </div>
  29 + <div class="actions">
  30 + <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()">
  31 + <i class="fa fa-plus"></i>
  32 + 添加套跑
  33 + </a>
  34 +
  35 + <div class="btn-group">
  36 + <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">
  37 + <i class="fa fa-share"></i>
  38 + <span>数据工具</span>
  39 + <i class="fa fa-angle-down"></i>
  40 + </a>
  41 + <ul class="dropdown-menu pull-right">
  42 + <li>
  43 + <a href="javascript:" class="tool-action">
  44 + <i class="fa fa-file-excel-o"></i>
  45 + 导入excel
  46 + </a>
  47 + </li>
  48 + <li>
  49 + <a href="javascript:" class="tool-action">
  50 + <i class="fa fa-file-excel-o"></i>
  51 + 导出excel
  52 + </a>
  53 + </li>
  54 + <li class="divider"></li>
  55 + <li>
  56 + <a href="javascript:" class="tool-action">
  57 + <i class="fa fa-refresh"></i>
  58 + 刷行数据
  59 + </a>
  60 + </li>
  61 + </ul>
  62 + </div>
  63 + </div>
  64 + </div>
  65 +
  66 + <div class="portlet-body">
  67 + <div ui-view="rerunManage_list"></div>
  68 + </div>
  69 + </div>
  70 + </div>
  71 +</div>
0 \ No newline at end of file 72 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/list.html 0 → 100644
  1 +<div ng-controller="RerunManageListCtrl as ctrl">
  2 + <div class="fixDiv">
  3 + <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column">
  4 + <thead>
  5 + <tr role="row" class="heading">
  6 + <th style="width: 5%;">序号</th>
  7 + <th style="width: 15%;">套跑线路</th>
  8 + <th style="width: 15%;">套跑路牌</th>
  9 + <th style="width: 10%;">时刻表</th>
  10 + <th style="width: 10%;">线路</th>
  11 + <th>路牌</th>
  12 + <th>车辆</th>
  13 + <th>套跑类型</th>
  14 + <th style="width: 21%">操作</th>
  15 + </tr>
  16 + <tr role="row" class="filter">
  17 + <td></td>
  18 + <td>
  19 + <sa-Select3 model="ctrl.searchCondition()"
  20 + name="xl"
  21 + placeholder="请输拼音..."
  22 + dcvalue="{{ctrl.searchCondition()['xl.id_eq']}}"
  23 + dcname="xl.id_eq"
  24 + icname="id"
  25 + icnames="name"
  26 + datatype="xl">
  27 + </sa-Select3>
  28 + </td>
  29 + <td></td>
  30 + <td></td>
  31 + <td></td>
  32 + <td></td>
  33 + <td></td>
  34 + <td></td>
  35 + <td>
  36 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
  37 + ng-click="ctrl.pageChanaged()">
  38 + <i class="fa fa-search"></i> 搜索</button>
  39 +
  40 + <button class="btn btn-sm red btn-outline filter-cancel"
  41 + ng-click="ctrl.resetSearchCondition()">
  42 + <i class="fa fa-times"></i> 重置</button>
  43 + </td>
  44 +
  45 + </tr>
  46 + </thead>
  47 + <tbody>
  48 + <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX">
  49 + <td>
  50 + <span ng-bind="$index + 1"></span>
  51 + </td>
  52 + <td>
  53 + <span ng-bind="info.rerunXl.name"></span>
  54 + </td>
  55 + <td>
  56 + <span ng-bind="info.rerunLp.lpName"></span>
  57 + </td>
  58 + <td>
  59 + <span ng-bind="info.rerunTtinfo.name"></span>
  60 + </td>
  61 + <td>
  62 + <span ng-bind="info.useXl.name"></span>
  63 + </td>
  64 + <td>
  65 + <span ng-bind="info.useLp.lpName"></span>
  66 + </td>
  67 + <td>
  68 + <span ng-bind="info.useCarConfig.cl.insideCode"></span>
  69 + </td>
  70 + <td>
  71 + <span ng-bind="info.useLp.rerunType | dict:'rerunType':'未知' "></span>
  72 + </td>
  73 +
  74 + <td>
  75 + <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
  76 + <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
  77 + <a ui-sref="rerunManage_detail({id : info.id})" class="btn default blue-stripe btn-sm"> 详细 </a>
  78 + <a ui-sref="rerunManage_edit({id : info.id})" class="btn default blue-stripe btn-sm"> 修改 </a>
  79 + <a ng-click="ctrl.deleteRule(info.id)" class="btn default blue-stripe btn-sm"> 删除 </a>
  80 + </td>
  81 + </tr>
  82 + </tbody>
  83 + </table>
  84 + </div>
  85 +
  86 +
  87 + <div style="text-align: right;">
  88 + <uib-pagination total-items="ctrl.pageInfo.totalItems"
  89 + ng-model="ctrl.pageInfo.currentPage"
  90 + ng-change="ctrl.pageChanaged()"
  91 + rotate="false"
  92 + max-size="10"
  93 + boundary-links="true"
  94 + first-text="首页"
  95 + previous-text="上一页"
  96 + next-text="下一页"
  97 + last-text="尾页">
  98 + </uib-pagination>
  99 + </div>
  100 +</div>
0 \ No newline at end of file 101 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/main.js 0 → 100644
  1 +// 规则配置管理 service controller 等写在一起
  2 +angular.module('ScheduleApp').factory('RerunManageService', ['rerunManageService_g', function(service) {
  3 + /** 当前的查询条件信息 */
  4 + var currentSearchCondition = {};
  5 +
  6 + /** 当前第几页 */
  7 + var currentPageNo = 1;
  8 +
  9 + return {
  10 + /**
  11 + * 获取查询条件信息,
  12 + * 用于给controller用来和页面数据绑定。
  13 + */
  14 + getSearchCondition: function() {
  15 + return currentSearchCondition;
  16 + },
  17 + /**
  18 + * 重置查询条件信息。
  19 + */
  20 + resetSearchCondition: function() {
  21 + var key;
  22 + for (key in currentSearchCondition) {
  23 + currentSearchCondition[key] = undefined;
  24 + }
  25 + },
  26 + /**
  27 + * 设置当前页码。
  28 + * @param cpn 从1开始,后台是从0开始的
  29 + */
  30 + setCurrentPageNo: function(cpn) {
  31 + currentPageNo = cpn;
  32 + },
  33 + /**
  34 + * 组装查询参数,返回一个promise查询结果。
  35 + * @param params 查询参数
  36 + * @return 返回一个 promise
  37 + */
  38 + getPage: function() {
  39 + var params = currentSearchCondition; // 查询条件
  40 + params.page = currentPageNo - 1; // 服务端页码从0开始
  41 + return service.rest.list(params).$promise;
  42 + },
  43 + /**
  44 + * 获取明细信息。
  45 + * @param id 车辆id
  46 + * @return 返回一个 promise
  47 + */
  48 + getDetail: function(id) {
  49 + var params = {id: id};
  50 + return service.rest.get(params).$promise;
  51 + },
  52 + /**
  53 + * 保存信息。
  54 + * @param obj 车辆详细信息
  55 + * @return 返回一个 promise
  56 + */
  57 + saveDetail: function(obj) {
  58 + return service.rest.save(obj).$promise;
  59 + },
  60 + /**
  61 + * 删除信息。
  62 + * @param id 主键id
  63 + * @returns {*|Function|promise|n}
  64 + */
  65 + deleteDetail: function(id) {
  66 + return service.rest.delete({id: id}).$promise;
  67 + }
  68 + };
  69 +
  70 +}]);
  71 +
  72 +angular.module('ScheduleApp').controller('RerunManageCtrl', ['RerunManageService', '$state', function(rerunManageService, $state) {
  73 + var self = this;
  74 +
  75 + // 切换到form状态
  76 + self.goForm = function() {
  77 + //alert("切换");
  78 + $state.go("rerunManage_form");
  79 + };
  80 +
  81 +}]);
  82 +
  83 +angular.module('ScheduleApp').controller('RerunManageListCtrl', ['RerunManageService', function(rerunManageService) {
  84 + var self = this;
  85 + self.pageInfo = {
  86 + totalItems : 0,
  87 + currentPage : 1,
  88 + infos: []
  89 + };
  90 +
  91 + // 初始创建的时候,获取一次列表数据
  92 + rerunManageService.getPage().then(
  93 + function(result) {
  94 + self.pageInfo.totalItems = result.totalElements;
  95 + self.pageInfo.currentPage = result.number + 1;
  96 + self.pageInfo.infos = result.content;
  97 + rerunManageService.setCurrentPageNo(result.number + 1);
  98 + },
  99 + function(result) {
  100 + alert("出错啦!");
  101 + }
  102 + );
  103 +
  104 + //$scope.$watch("ctrl.pageInfo.currentPage", function() {
  105 + // alert("dfdfdf");
  106 + //});
  107 +
  108 + // 翻页的时候调用
  109 + self.pageChanaged = function() {
  110 + rerunManageService.setCurrentPageNo(self.pageInfo.currentPage);
  111 + rerunManageService.getPage().then(
  112 + function(result) {
  113 + self.pageInfo.totalItems = result.totalElements;
  114 + self.pageInfo.currentPage = result.number + 1;
  115 + self.pageInfo.infos = result.content;
  116 + rerunManageService.setCurrentPageNo(result.number + 1);
  117 + },
  118 + function(result) {
  119 + alert("出错啦!");
  120 + }
  121 + );
  122 + };
  123 + // 获取查询条件数据
  124 + self.searchCondition = function() {
  125 + return rerunManageService.getSearchCondition();
  126 + };
  127 + // 重置查询条件
  128 + self.resetSearchCondition = function() {
  129 + rerunManageService.resetSearchCondition();
  130 + self.pageInfo.currentPage = 1;
  131 + self.pageChanaged();
  132 + };
  133 +
  134 + // 删除规则
  135 + self.deleteRule = function(id) {
  136 + rerunManageService.deleteDetail(id).then(
  137 + function(result) {
  138 + alert("删除成功!");
  139 +
  140 + rerunManageService.getPage().then(
  141 + function(result) {
  142 + self.pageInfo.totalItems = result.totalElements;
  143 + self.pageInfo.currentPage = result.number + 1;
  144 + self.pageInfo.infos = result.content;
  145 + rerunManageService.setCurrentPageNo(result.number + 1);
  146 + },
  147 + function(result) {
  148 + alert("出错啦!");
  149 + }
  150 + );
  151 + },
  152 + function(result) {
  153 + alert("出错啦!");
  154 + }
  155 + );
  156 + }
  157 +
  158 +}]);
  159 +
  160 +angular.module('ScheduleApp').controller('RerunManageFormCtrl', ['RerunManageService', '$stateParams', '$state', '$scope', function(rerunManageService, $stateParams, $state, $scope) {
  161 + var self = this;
  162 +
  163 + // 启用日期 日期控件开关
  164 + self.qyrqOpen = false;
  165 + self.qyrq_open = function() {
  166 + self.qyrqOpen = true;
  167 + };
  168 +
  169 + // 欲保存的busInfo信息,绑定
  170 + self.rerunManageForSave = {rerunXl: {}, rerunTtinfo: {}, rerunLp: {}, rerunType: "dylp", useXl: {}, useLp: {}};
  171 +
  172 + // 获取传过来的id,有的话就是修改,获取一遍数据
  173 + var id = $stateParams.id;
  174 + if (id) {
  175 + self.rerunManageForSave.id = id;
  176 + scheduleRuleManageService.getDetail(id).then(
  177 + function(result) {
  178 + var key;
  179 + for (key in result) {
  180 + self.rerunManageForSave[key] = result[key];
  181 + }
  182 + },
  183 + function(result) {
  184 + alert("出错啦!");
  185 + }
  186 + );
  187 + }
  188 +
  189 + // 提交方法
  190 + self.submit = function() {
  191 + console.log(self.rerunManageForSave);
  192 +
  193 + //rerunManageService.saveDetail(self.rerunManageForSave).then(
  194 + // function(result) {
  195 + // // TODO:弹出框方式以后改
  196 + // if (result.status == 'SUCCESS') {
  197 + // alert("保存成功!");
  198 + // $state.go("rerunManage");
  199 + // } else {
  200 + // alert("保存异常!");
  201 + // }
  202 + // },
  203 + // function(result) {
  204 + // // TODO:弹出框方式以后改
  205 + // alert("出错啦!");
  206 + // }
  207 + //);
  208 + };
  209 +}]);
  210 +
  211 +angular.module('ScheduleApp').controller('RerunManageDetailCtrl', ['RerunManageService', '$stateParams', function(rerunManageService, $stateParams) {
  212 + var self = this;
  213 + self.title = "";
  214 + self.rerunManageForDetail = {};
  215 + self.rerunManageForDetail.id = $stateParams.id;
  216 +
  217 + // 当转向到此页面时,就获取明细信息并绑定
  218 + rerunManageService.getDetail($stateParams.id).then(
  219 + function(result) {
  220 + var key;
  221 + for (key in result) {
  222 + self.rerunManageForDetail[key] = result[key];
  223 + }
  224 +
  225 + self.title = "规则配置详细信息";
  226 + },
  227 + function(result) {
  228 + // TODO:弹出框方式以后改
  229 + alert("出错啦!");
  230 + }
  231 + );
  232 +}]);
  233 +
  234 +
  235 +
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/rerunManage.html deleted 100644 → 0
1 -套跑管理  
2 \ No newline at end of file 0 \ No newline at end of file