Commit 22f5a969b359e4a75f8949b36bf720e5d488c62a

Authored by 潘钊
2 parents 85bee802 92cba787

Merge branch 'qingpu' of http://222.66.0.204:8800/panzhaov5/bsth_control

into qingpu

# Conflicts:
#	src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
#	src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
#	src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
#	src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list_report.html
#	src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js
src/main/resources/application.properties
1 spring.profiles: dev,prod 1 spring.profiles: dev,prod
2 -spring.profiles.active: dev 2 +spring.profiles.active: prod
3 3
4 spring.view.suffix=.html 4 spring.view.suffix=.html
5 server.session-timeout=-1 5 server.session-timeout=-1
src/main/resources/datatools/config-prod.properties
@@ -4,13 +4,13 @@ @@ -4,13 +4,13 @@
4 datatools.kettle_properties=/datatools/kettle.properties 4 datatools.kettle_properties=/datatools/kettle.properties
5 # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) 5 # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正)
6 #数据库ip地址 6 #数据库ip地址
7 -datatools.kvars_dbip=192.168.168.171 7 +datatools.kvars_dbip=192.168.40.82
8 #数据库用户名 8 #数据库用户名
9 datatools.kvars_dbuname=root 9 datatools.kvars_dbuname=root
10 #数据库密码 10 #数据库密码
11 -datatools.kvars_dbpwd=root2jsp 11 +datatools.kvars_dbpwd=123456
12 #数据库库名 12 #数据库库名
13 -datatools.kvars_dbdname=control 13 +datatools.kvars_dbdname=qp_control
14 14
15 # 3、上传数据配置信息 15 # 3、上传数据配置信息
16 # 上传文件目录配置(根据不同的环境需要修正) 16 # 上传文件目录配置(根据不同的环境需要修正)
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
1 -// 自定义指令,指令模版在dt目录下  
2 -  
3 -  
4 -angular.module('ScheduleApp').directive('loadingWidget', ['requestNotificationChannel', function(requestNotificationChannel) {  
5 - return {  
6 - restrict: 'A',  
7 - link: function(scope, element) {  
8 - // 初始隐藏loading界面  
9 - element.hide();  
10 -  
11 - // 开始请求通知处理  
12 - requestNotificationChannel.onRequestStarted(scope, function() {  
13 - element.show();  
14 - });  
15 - // 请求结束通知处理  
16 - requestNotificationChannel.onRequestEnded(scope, function() {  
17 - element.hide();  
18 - });  
19 - }  
20 - };  
21 -}]);  
22 -  
23 -angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) {  
24 - return {  
25 - restrict: 'E',  
26 - templateUrl: '/pages/scheduleApp/module/other/MyDictionarySelectTemplate.html',  
27 - scope: {  
28 - model: "="  
29 - },  
30 - controllerAs: "$saSelectCtrl",  
31 - bindToController: true,  
32 - controller: function() {  
33 - var self = this;  
34 - self.datas = []; // 关联的字典数据,内部格式 {code:{值},name:{名字}}  
35 - },  
36 - /**  
37 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
38 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
39 - * @param tElem  
40 - * @param tAttrs  
41 - * @returns {{pre: Function, post: Function}}  
42 - */  
43 - compile: function(tElem, tAttrs) {  
44 - // 确定是否使用angularjs required验证  
45 - // 属性 required  
46 - // 如果没有填写,内部不添加验证,如果填写了,并且等于true添加验证,否则不添加  
47 - var required_attr = tAttrs["required"];  
48 - if (required_attr) {  
49 - if (required_attr == "true") {  
50 - // 添加required属性指令  
51 - tElem.find("ui-select").attr("required", "");  
52 - } else {  
53 - // 不等于true,不添加required属性指令  
54 - }  
55 - } else {  
56 - // 不添加required属性指令  
57 - }  
58 -  
59 - //console.log("saSelect" + ":compile = >" + tElem.html());  
60 -  
61 - return {  
62 - pre: function(scope, element, attr) {  
63 - // TODO:  
64 - },  
65 - /**  
66 - * 相当于link函数。  
67 - *  
68 - * 重要属性如下:  
69 - * model 是绑定外部值。  
70 - * dicgroup 字典组的类型  
71 - * name input name属性值  
72 - */  
73 - post: function(scope, element, attr) {  
74 - // 1、获取属性  
75 - var dicgroup_attr = attr['dicgroup']; // 字典组的类型  
76 - var name_attr = attr['name']; // input name属性值  
77 - var dicname_attr = attr['dicname']; // model关联的字典名字段  
78 - var codename_attr = attr['codename']; // model关联的字典值字段  
79 - var placeholder_attr = attr['placeholder']; // select placeholder提示  
80 -  
81 - // 系统的字典对象,使用dictionaryUtils类获取  
82 - var origin_dicgroup;  
83 - var dic_key; // 字典key  
84 -  
85 - if (dicgroup_attr) { // 赋值指定的字典数据  
86 - origin_dicgroup = dictionaryUtils.getByGroup(dicgroup_attr);  
87 - for (dic_key in origin_dicgroup) {  
88 - var data = {}; // 重新组合的字典元素对象  
89 - if (dic_key == "true")  
90 - data.code = true;  
91 - else  
92 - data.code = dic_key;  
93 - data.name = origin_dicgroup[dic_key];  
94 - scope["$saSelectCtrl"].datas.push(data);  
95 - }  
96 - }  
97 -  
98 - if (name_attr) {  
99 - scope["$saSelectCtrl"].nv = name_attr;  
100 - }  
101 - if (placeholder_attr) {  
102 - scope["$saSelectCtrl"].ph = placeholder_attr;  
103 - }  
104 -  
105 - scope["$saSelectCtrl"].select = function($item) {  
106 - if (codename_attr) {  
107 - scope["$saSelectCtrl"].model[codename_attr] = $item.code;  
108 - }  
109 - if (dicname_attr) {  
110 - scope["$saSelectCtrl"].model[dicname_attr] = $item.name;  
111 - }  
112 - };  
113 -  
114 - scope["$saSelectCtrl"].remove = function() {  
115 - if (codename_attr) {  
116 - scope["$saSelectCtrl"].model[codename_attr] = null;  
117 - }  
118 - if (dicname_attr) {  
119 - scope["$saSelectCtrl"].model[dicname_attr] = null;  
120 - }  
121 - scope["$saSelectCtrl"].cmodel = null;  
122 - };  
123 -  
124 - $timeout(function() {  
125 - // 创建内部使用的绑定对象  
126 - var model_code = scope["$saSelectCtrl"].model[codename_attr];  
127 - scope["$saSelectCtrl"].cmodel = model_code;  
128 - }, 0);  
129 - }  
130 - }  
131 - }  
132 - };  
133 -}]);  
134 -  
135 -/**  
136 - * saRadiogroup指令  
137 - * 属性如下:  
138 - * model(必须):独立作用域,外部绑定的一个值,如:ctrl.timeTableManageForForm.isEnableDisTemplate  
139 - * dicgroup(必须):关联的字典数据type(TODO:以后增加其他数据源)  
140 - * name(必须):控件的名字  
141 - * required(可选):是否要用required验证  
142 - * disabled(可选):标示单选框是否可选  
143 - *  
144 - */  
145 -angular.module('ScheduleApp').directive("saRadiogroup", [function() {  
146 - /**  
147 - * 使用字典数据的单选按钮组的指令。  
148 - * 指令名称:truefalse-Dic  
149 - */  
150 - return {  
151 - restrict: 'E',  
152 - templateUrl: '/pages/scheduleApp/module/common/dt/MyRadioGroupWrapTemplate.html',  
153 - scope: {  
154 - model: "="  
155 - },  
156 - controllerAs: "$saRadiogroupCtrl",  
157 - bindToController: true,  
158 - controller: function($scope) {  
159 - //$scope["model"] = {selectedOption: null};  
160 - //console.log("controller");  
161 - //console.log("controller:" + $scope["model"]);  
162 -  
163 - var self = this;  
164 - self.$$data = null; // 内部数据  
165 - },  
166 -  
167 - /**  
168 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
169 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
170 - * @param tElem  
171 - * @param tAttrs  
172 - * @returns {{pre: Function, post: Function}}  
173 - */  
174 - compile: function(tElem, tAttrs) {  
175 - // 获取属性  
176 - var $dicgroup_attr = tAttrs["dicgroup"]; // 关联的字典数据type  
177 - var $name_attr = tAttrs["name"]; // 控件的名字  
178 - var $required_attr = tAttrs["required"]; // 是否要用required验证  
179 - var $disabled_attr = tAttrs["disabled"]; // 标示单选框是否可选  
180 -  
181 - // controlAs名字  
182 - var ctrlAs = "$saRadiogroupCtrl";  
183 -  
184 - // 如果有required属性,添加angularjs required验证  
185 - if ($required_attr != undefined) {  
186 - tElem.find("input").attr("required", "");  
187 - }  
188 -  
189 - return {  
190 - pre: function(scope, element, attr) {  
191 -  
192 - },  
193 -  
194 - /**  
195 - * 相当于link函数。  
196 - * @param scope  
197 - * @param element  
198 - * @param attr  
199 - */  
200 - post: function(scope, element, attr) {  
201 - //console.log("link");  
202 - //console.log("link:" + scope.model);  
203 - //scope["model"] = {selectedOption: null};  
204 -  
205 - if ($name_attr) {  
206 - scope[ctrlAs].nv = $name_attr;  
207 - }  
208 -  
209 - if ($disabled_attr) {  
210 - scope[ctrlAs].disabled = true;  
211 - }  
212 - if ($dicgroup_attr) {  
213 - var obj = dictionaryUtils.getByGroup($dicgroup_attr);  
214 - scope[ctrlAs].$$data = obj;  
215 - // 处理 scope["dic"] key值  
216 - scope[ctrlAs].dicvalueCalcu = function(value) {  
217 - if (value == "true") {  
218 - //console.log(value);  
219 - return true;  
220 - } else if (value == "false") {  
221 - //console.log(value);  
222 - return false;  
223 - } else {  
224 - return value;  
225 - }  
226 - };  
227 - }  
228 - }  
229 - };  
230 - }  
231 - };  
232 -}]);  
233 -  
234 -angular.module('ScheduleApp').directive("remoteValidaton", [  
235 - 'BusInfoManageService_g',  
236 - 'EmployeeInfoManageService_g',  
237 - 'TimeTableManageService_g',  
238 - function(  
239 - busInfoManageService_g,  
240 - employeeInfoManageService_g,  
241 - timeTableManageService_g  
242 - ) {  
243 - /**  
244 - * 远端验证指令,依赖于ngModel  
245 - * 指令名称 remote-Validation  
246 - * 需要属性 rvtype 表示验证类型  
247 - */  
248 - return {  
249 - restrict: "A",  
250 - require: "^ngModel",  
251 - link: function(scope, element, attr, ngModelCtrl) {  
252 - element.bind("keyup", function() {  
253 - var modelValue = ngModelCtrl.$modelValue;  
254 - var rv1_attr = attr["rv1"];  
255 - if (attr["rvtype"]) {  
256 -  
257 - // 根据rvtype的值,确定使用那个远端验证的url,  
258 - // rv1, rv2, rv3是关联比较值,暂时使用rv1  
259 - // 这个貌似没法通用,根据业务变换  
260 - // TODO:暂时有点乱以后改  
261 - if (attr["rvtype"] == "insideCode") {  
262 - busInfoManageService_g.validate.insideCode(  
263 - {"insideCode_eq": modelValue, type: "equale"},  
264 - function(result) {  
265 - //console.log(result);  
266 - if (result.status == "SUCCESS") {  
267 - ngModelCtrl.$setValidity('remote', true);  
268 - } else {  
269 - ngModelCtrl.$setValidity('remote', false);  
270 - }  
271 - },  
272 - function(result) {  
273 - //console.log(result);  
274 - ngModelCtrl.$setValidity('remote', true);  
275 - }  
276 - );  
277 - } else if (attr["rvtype"] == "jobCode") {  
278 - if (!rv1_attr) {  
279 - ngModelCtrl.$setValidity('remote', false);  
280 - return;  
281 - }  
282 -  
283 - employeeInfoManageService_g.validate.jobCode(  
284 - {"jobCode_eq": modelValue, "companyCode_eq": rv1_attr, type: "equale"},  
285 - function(result) {  
286 - //console.log(result);  
287 - if (result.status == "SUCCESS") {  
288 - ngModelCtrl.$setValidity('remote', true);  
289 - } else {  
290 - ngModelCtrl.$setValidity('remote', false);  
291 - }  
292 - },  
293 - function(result) {  
294 - //console.log(result);  
295 - ngModelCtrl.$setValidity('remote', true);  
296 - }  
297 - );  
298 - } else if (attr["rvtype"] == "ttinfoname") {  
299 - if (!rv1_attr) {  
300 - ngModelCtrl.$setValidity('remote', false);  
301 - return;  
302 - }  
303 -  
304 - timeTableManageService_g.validate.ttinfoname(  
305 - {"name_eq": modelValue, "xl.id_eq": rv1_attr, type: "equale"},  
306 - function(result) {  
307 - //console.log(result);  
308 - if (result.status == "SUCCESS") {  
309 - ngModelCtrl.$setValidity('remote', true);  
310 - } else {  
311 - ngModelCtrl.$setValidity('remote', false);  
312 - }  
313 - },  
314 - function(result) {  
315 - //console.log(result);  
316 - ngModelCtrl.$setValidity('remote', true);  
317 - }  
318 - );  
319 -  
320 - }  
321 - } else {  
322 - // 没有rvtype,就不用远端验证了  
323 - ngModelCtrl.$setValidity('remote', true);  
324 - }  
325 -  
326 - attr.$observe("rv1", function(value) {  
327 - if (attr["rvtype"] == "jobCode") {  
328 - if (!value) {  
329 - ngModelCtrl.$setValidity('remote', false);  
330 - return;  
331 - }  
332 -  
333 - employeeInfoManageService_g.validate.jobCode(  
334 - {"jobCode_eq": modelValue, "companyCode_eq": rv1_attr, type: "equale"},  
335 - function(result) {  
336 - //console.log(result);  
337 - if (result.status == "SUCCESS") {  
338 - ngModelCtrl.$setValidity('remote', true);  
339 - } else {  
340 - ngModelCtrl.$setValidity('remote', false);  
341 - }  
342 - },  
343 - function(result) {  
344 - //console.log(result);  
345 - ngModelCtrl.$setValidity('remote', true);  
346 - }  
347 - );  
348 - } else if (attr["rvtype"] == "ttinfoname") {  
349 - if (!value) {  
350 - ngModelCtrl.$setValidity('remote', false);  
351 - return;  
352 - }  
353 -  
354 - console.log("rv1:" + value);  
355 -  
356 - timeTableManageService_g.validate.ttinfoname(  
357 - {"name_eq": modelValue, "xl.id_eq": value, type: "equale"},  
358 - function(result) {  
359 - //console.log(result);  
360 - if (result.status == "SUCCESS") {  
361 - ngModelCtrl.$setValidity('remote', true);  
362 - } else {  
363 - ngModelCtrl.$setValidity('remote', false);  
364 - }  
365 - },  
366 - function(result) {  
367 - //console.log(result);  
368 - ngModelCtrl.$setValidity('remote', true);  
369 - }  
370 - );  
371 - }  
372 -  
373 - });  
374 - });  
375 - }  
376 - };  
377 - }]);  
378 -  
379 -  
380 -/**  
381 - * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。  
382 - * 1、compile阶段使用的属性如下:  
383 - * required:用于和表单验证连接,指定成required="true"才有效。  
384 - * 2、link阶段使用的属性如下  
385 - * model:关联的模型对象  
386 - * name:表单验证时需要的名字  
387 - * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加  
388 - * modelcolname1:关联的模型字段名字1(一般应该是编码字段)  
389 - * modelcolname2:关联的模型字段名字2(一般应该是名字字段)  
390 - * datacolname1;内部数据对应的字段名字1(与模型字段1对应)  
391 - * datacolname2:内部数据对应的字段名字2(与模型字段2对应)  
392 - * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用  
393 - * placeholder:select placeholder字符串描述  
394 - *  
395 - * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。  
396 - * $$SearchInfoService_g,内部使用的数据服务  
397 - */  
398 -// saSelect2指令使用的内部信service  
399 -angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {  
400 - return {  
401 - xl: $resource(  
402 - '/line/:type',  
403 - {order: 'name', direction: 'ASC'},  
404 - {  
405 - list: {  
406 - method: 'GET',  
407 - isArray: true  
408 - }  
409 - }  
410 - ),  
411 - zd: $resource(  
412 - '/stationroute/stations',  
413 - {order: 'stationCode', direction: 'ASC'},  
414 - {  
415 - list: {  
416 - method: 'GET',  
417 - isArray: true  
418 - }  
419 - }  
420 - ),  
421 - tcc: $resource(  
422 - '/carpark/:type',  
423 - {order: 'parkCode', direction: 'ASC'},  
424 - {  
425 - list: {  
426 - method: 'GET',  
427 - isArray: true  
428 - }  
429 - }  
430 - ),  
431 - ry: $resource(  
432 - '/personnel/:type',  
433 - {order: 'personnelName', direction: 'ASC'},  
434 - {  
435 - list: {  
436 - method: 'GET',  
437 - isArray: true  
438 - }  
439 - }  
440 - ),  
441 - cl: $resource(  
442 - '/cars/:type',  
443 - {order: "insideCode", direction: 'ASC'},  
444 - {  
445 - list: {  
446 - method: 'GET',  
447 - isArray: true  
448 - }  
449 - }  
450 - ),  
451 - ttInfo: $resource(  
452 - '/tic/:type',  
453 - {order: "name", direction: 'ASC'},  
454 - {  
455 - list: {  
456 - method: 'GET',  
457 - isArray: true  
458 - }  
459 - }  
460 - ),  
461 - cci: $resource(  
462 - '/cci/cars',  
463 - {},  
464 - {  
465 - list: {  
466 - method: 'GET',  
467 - isArray: true  
468 - }  
469 - }  
470 -  
471 - ),  
472 - cci2: $resource(  
473 - '/cci/:type',  
474 - {},  
475 - {  
476 - list: {  
477 - method: 'GET',  
478 - isArray: true  
479 - }  
480 - }  
481 - ),  
482 - cci3: $resource(  
483 - '/cci/cars2',  
484 - {},  
485 - {  
486 - list: {  
487 - method: 'GET',  
488 - isArray: true  
489 - }  
490 - }  
491 -  
492 - ),  
493 - eci: $resource(  
494 - '/eci/jsy',  
495 - {},  
496 - {  
497 - list: {  
498 - method: 'GET',  
499 - isArray: true  
500 - }  
501 - }  
502 - ),  
503 - eci2: $resource(  
504 - '/eci/spy',  
505 - {},  
506 - {  
507 - list: {  
508 - method: 'GET',  
509 - isArray: true  
510 - }  
511 - }  
512 - )  
513 - }  
514 -}]);  
515 -angular.module('ScheduleApp').filter("$$pyFilter", function() {  
516 - return function(items, props) {  
517 - var out = [];  
518 - var limit = props["limit"] || 20; // 默认20条记录  
519 -  
520 - if (angular.isArray(items)) {  
521 - items.forEach(function(item) {  
522 - if (out.length < limit) {  
523 - if (props.search) {  
524 - var upTerm = props.search.toUpperCase();  
525 - if(item.fullChars.indexOf(upTerm) != -1  
526 - || item.camelChars.indexOf(upTerm) != -1) {  
527 - out.push(item);  
528 - }  
529 - }  
530 - }  
531 - });  
532 - }  
533 -  
534 - return out;  
535 - };  
536 -});  
537 -angular.module('ScheduleApp').directive("saSelect2", [  
538 - '$timeout', '$$SearchInfoService_g',  
539 - function($timeout, $$searchInfoService_g) {  
540 - return {  
541 - restrict: 'E',  
542 - templateUrl: '/pages/scheduleApp/module/other/MySearchSelectTemplate.html',  
543 - scope: {  
544 - model: "=" // 独立作用域,关联外部的模型对象  
545 - },  
546 - controllerAs: "$saSelectCtrl",  
547 - bindToController: true,  
548 - controller: function($scope) {  
549 - var self = this;  
550 - self.$$data = []; // 内部关联的数据  
551 - },  
552 - /**  
553 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
554 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
555 - * @param tElem  
556 - * @param tAttrs  
557 - * @returns {{pre: Function, post: Function}}  
558 - */  
559 - compile: function(tElem, tAttrs) {  
560 - // 1、获取此阶段使用的属性  
561 - var $required_attr = tAttrs["required"]; // 用于和表单验证连接,指定成required="true"才有效。  
562 -  
563 - // 2、处理属性  
564 -  
565 - // 确定是否使用angularjs required验证  
566 - // 属性 required  
567 - // 如果没有填写,内部不添加验证,如果填写了,并且等于true添加验证,否则不添加  
568 - if ($required_attr) {  
569 - if ($required_attr == "true") {  
570 - // 添加required属性指令  
571 - tElem.find("ui-select").attr("required", "");  
572 - } else {  
573 - // 不等于true,不添加required属性指令  
574 - }  
575 - } else {  
576 - // 不添加required属性指令  
577 - }  
578 -  
579 - //console.log("saSelect" + ":compile = >" + tElem.html());  
580 -  
581 - return {  
582 - pre: function(scope, element, attr) {  
583 - // TODO:  
584 - },  
585 - /**  
586 - * 相当于link函数。  
587 - *  
588 - * 重要属性如下:  
589 - * model 是绑定外部值。  
590 - * dicgroup 字典组的类型  
591 - * name input name属性值  
592 - */  
593 - post: function(scope, element, attr) {  
594 - // 1、获取此阶段使用的属性  
595 - var $name_attr = attr["name"]; // 表单验证时需要的名字  
596 - var $type_attr = attr["type"]; // 关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加  
597 - var $modelcolname1_attr = attr["modelcolname1"]; // 关联的模型字段名字1(一般应该是编码字段)  
598 - var $modelcolname2_attr = attr["modelcolname2"]; // 关联的模型字段名字2(一般应该是名字字段)  
599 - var $datacolname1_attr = attr["datacolname1"]; // 内部数据对应的字段名字1(与模型字段1对应)  
600 - var $datacolname2_attr = attr["datacolname2"]; // 内部数据对应的字段名字2(与模型字段2对应)  
601 - var $showcolname_attr = attr["showcolname"]; // 下拉框显示的内部数据字段名  
602 - var $placeholder_attr = attr["placeholder"]; // select placeholder字符串描述  
603 -  
604 - // 2、处理属性、转换成$saSelectCtrl内部使用的属性  
605 - if ($name_attr) {  
606 - scope["$saSelectCtrl"].$name_attr = $name_attr;  
607 - }  
608 - if ($placeholder_attr) {  
609 - scope["$saSelectCtrl"].$placeholder_attr = $placeholder_attr;  
610 - }  
611 - if ($showcolname_attr) {  
612 - scope["$saSelectCtrl"].$showcolname_attr = $showcolname_attr;  
613 - }  
614 -  
615 - // 2-1、添加内部方法,根据type值,改变$$data的值  
616 - scope["$saSelectCtrl"].$$internal_data_change_fn = function() {  
617 - // 根据type属性动态载入数据  
618 - if ($type_attr) {  
619 - $$searchInfoService_g[$type_attr].list(  
620 - {type: "all"},  
621 - function(result) {  
622 - scope["$saSelectCtrl"].$$data = [];  
623 - for (var i = 0; i < result.length; i ++) {  
624 - var data = {}; // data是result的一部分属性集合,根据配置来确定  
625 - if ($datacolname1_attr) {  
626 - data[$datacolname1_attr] = result[i][$datacolname1_attr];  
627 - }  
628 - if ($datacolname2_attr) {  
629 - data[$datacolname2_attr] = result[i][$datacolname2_attr];  
630 - }  
631 - if ($showcolname_attr) {  
632 - // 动态添加基于名字的拼音  
633 - data[$showcolname_attr] = result[i][$showcolname_attr];  
634 - if (data[$showcolname_attr]) {  
635 - data["fullChars"] = pinyin.getFullChars(result[i][$showcolname_attr]).toUpperCase(); // 全拼  
636 - data["camelChars"] = pinyin.getCamelChars(result[i][$showcolname_attr]); // 简拼  
637 - }  
638 - }  
639 - if (data["fullChars"])  
640 - scope["$saSelectCtrl"].$$data.push(data);  
641 - }  
642 - },  
643 - function(result) {  
644 -  
645 - }  
646 - );  
647 - }  
648 - };  
649 -  
650 - // 3、选择、删除事件映射模型和内部数据对应的字段  
651 - scope["$saSelectCtrl"].$select_fn_attr = function($item) {  
652 - if ($modelcolname1_attr && $datacolname1_attr) {  
653 - scope["$saSelectCtrl"].model[$modelcolname1_attr] = $item[$datacolname1_attr];  
654 - }  
655 - if ($modelcolname2_attr && $datacolname2_attr) {  
656 - scope["$saSelectCtrl"].model[$modelcolname2_attr] = $item[$datacolname2_attr];  
657 - }  
658 - };  
659 - scope["$saSelectCtrl"].$remove_fn_attr = function() {  
660 - if ($modelcolname1_attr) {  
661 - scope["$saSelectCtrl"].model[$modelcolname1_attr] = null;  
662 - }  
663 - if ($modelcolname2_attr) {  
664 - scope["$saSelectCtrl"].model[$modelcolname2_attr] = null;  
665 - }  
666 - scope["$saSelectCtrl"].$$cmodel = null; // 内部模型清空  
667 -  
668 - scope["$saSelectCtrl"].$$internal_data_change_fn();  
669 - };  
670 -  
671 - // 4、搜索事件  
672 - scope["$saSelectCtrl"].$refreshdata_fn_attr = function($search) {  
673 - //var fullChars = pinyin.getFullChars($search).toUpperCase();  
674 - //var camelChars = pinyin.getCamelChars($search);  
675 - //  
676 - //console.log(fullChars + " " + camelChars);  
677 - // TODO:事件暂时没用,放着以后再说  
678 - };  
679 -  
680 - // 5、全部载入后,输入的  
681 - $timeout(function() {  
682 - // 创建内部使用的绑定对象,用于确认选中那个值  
683 - scope["$saSelectCtrl"].$$cmodel = scope["$saSelectCtrl"].model[$modelcolname1_attr];  
684 -  
685 - scope["$saSelectCtrl"].$$internal_data_change_fn();  
686 - }, 0);  
687 - }  
688 - }  
689 - }  
690 - };  
691 - }  
692 -]);  
693 -  
694 -/**  
695 - * saSelect3指令  
696 - * 属性如下:  
697 - * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave  
698 - * name(必须):控件的名字  
699 - * placeholder(可选):占位符字符串  
700 - * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}  
701 - * dcname(必须):绑定的model字段名,如:dcname=xl.id  
702 - * icname(必须):内部与之对应的字段名,如:icname=code  
703 - * dcname2(可选):其他需要赋值的model字段名2,如:dcname2=xl.name  
704 - * icname2(可选):内部与之对应的字段名2,如:icname2=name  
705 - * dcname3(可选):其他需要赋值的model字段名3,如:dcname2=xl.name  
706 - * icname3(可选):内部与之对应的字段名3,如:icname2=name  
707 - * icnames(必须):用于用于显示,以及简评处理的内部数据字段,如:icnames=name  
708 - * required(可选):是否要用required验证  
709 - * datatype(必须):业务数据类型,有字典类型,动态数据类型,暂时写的死点  
710 - * mlp(可选):是否多级属性(这里假设外部model如果多级,内部model也是多级)  
711 - *  
712 - * 高级属性:  
713 - * dataassociate(可选):数据源是否关联属性(内部数据随外部指定的参数变化而变化)  
714 - * dataparam(可选):数据源关联的外部参数对象  
715 - *  
716 - */  
717 -angular.module('ScheduleApp').directive("saSelect3", [  
718 - '$timeout',  
719 - '$$SearchInfoService_g',  
720 - function($timeout, $$searchInfoService_g) {  
721 - return {  
722 - restrict: 'E',  
723 - templateUrl: '/pages/scheduleApp/module/common/dt/MyUiSelectWrapTemplate1.html',  
724 - scope: {  
725 - model: "=" // 独立作用域,关联外部的模型object  
726 - },  
727 - controllerAs: "$saSelectCtrl",  
728 - bindToController: true,  
729 - controller: function($scope) {  
730 - var self = this;  
731 - self.$$data = []; // ui-select显示用的数据源  
732 - self.$$data_real= []; // 内部真实的数据源  
733 - },  
734 -  
735 - /**  
736 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
737 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
738 - * @param tElem  
739 - * @param tAttrs  
740 - * @returns {{pre: Function, post: Function}}  
741 - */  
742 - compile: function(tElem, tAttrs) {  
743 - // 获取所有的属性  
744 - var $name_attr = tAttrs["name"]; // 控件的名字  
745 - var $placeholder_attr = tAttrs["placeholder"]; // 占位符的名字  
746 - var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名  
747 - var $icname_attr = tAttrs["icname"]; // 内部与之对应的字段名  
748 - var $dcname2_attr = tAttrs["dcname2"]; // 其他需要赋值的model字段名2  
749 - var $icname2_attr = tAttrs["icname2"]; // 内部与之对应的字段名2  
750 - var $dcname3_attr = tAttrs["dcname3"]; // 其他需要赋值的model字段名3  
751 - var $icname3_attr = tAttrs["icname3"]; // 内部与之对应的字段名3  
752 -  
753 - var $icname_s_attr = tAttrs["icnames"]; // 用于用于显示,以及简评处理的内部数据字段  
754 - var $datatype_attr = tAttrs["datatype"]; // 内部业务数据类型  
755 - var $required_attr = tAttrs["required"]; // 是否需要required验证  
756 - var $mlp_attr = tAttrs["mlp"]; // 是否多级属性  
757 - var $dataassociate_attr = tAttrs["dataassociate"]; // 数据源是否关联属性  
758 -  
759 - // controlAs名字  
760 - var ctrlAs = "$saSelectCtrl";  
761 -  
762 - // 数据源初始化标志  
763 - var $$data_init = false;  
764 - // 如果有required属性,添加angularjs required验证  
765 - if ($required_attr != undefined) {  
766 - tElem.find("ui-select").attr("required", "");  
767 - }  
768 -  
769 - // 由于有的属性是多级的如xl.name,所以要在compile阶段重写属性绑定属性定义  
770 - // 原来的设置:{{$select.selected[$saSelectCtrl.$icname_s]}}  
771 - tElem.find("ui-select-match").html("{{$select.selected" + "." + $icname_s_attr + "}}");  
772 - // 原来的设置:item[$saSelectCtrl.$icname] as item in $saSelectCtrl.$$data  
773 - tElem.find("ui-select-choices").attr("repeat", "item" + "." + $icname_attr + " as item in $saSelectCtrl.$$data");  
774 - // 原来的设置:item[$saSelectCtrl.$icname_s]  
775 - tElem.find("ui-select-choices span").attr("ng-bind", "item" + "." + $icname_s_attr);  
776 - // 原来的设置:{{$saSelectCtrl.$name}}  
777 - tElem.find("ui-select").attr("name", $name_attr);  
778 - // 原来的设置:{{$saSelectCtrl.$placeholder}}  
779 - tElem.find("ui-select-match").attr("placeholder", $placeholder_attr);  
780 -  
781 - return {  
782 - pre: function(scope, element, attr) {  
783 - // TODO:  
784 - },  
785 - /**  
786 - * 相当于link函数。  
787 - * @param scope  
788 - * @param element  
789 - * @param attr  
790 - */  
791 - post: function(scope, element, attr) {  
792 - // 添加选中事件处理函数  
793 - scope[ctrlAs].$$internal_select_fn = function($item) {  
794 - if ($dcname_attr && $icname_attr) {  
795 - if ($mlp_attr) {  
796 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";");  
797 - } else {  
798 - scope[ctrlAs].model[$dcname_attr] = $item[$icname_attr];  
799 - }  
800 - }  
801 - if ($dcname2_attr && $icname2_attr) {  
802 - if ($mlp_attr) {  
803 - eval("scope[ctrlAs].model" + "." + $dcname2_attr + " = $item" + "." + $icname2_attr + ";");  
804 - } else {  
805 - scope[ctrlAs].model[$dcname2_attr] = $item[$icname2_attr];  
806 - }  
807 - }  
808 - if ($dcname3_attr && $icname3_attr) {  
809 - if ($mlp_attr) {  
810 - eval("scope[ctrlAs].model" + "." + $dcname3_attr + " = $item" + "." + $icname3_attr + ";");  
811 - } else {  
812 - scope[ctrlAs].model[$dcname3_attr] = $item[$icname3_attr];  
813 - }  
814 - }  
815 - };  
816 -  
817 - // 删除选中事件处理函数  
818 - scope[ctrlAs].$$internal_remove_fn = function() {  
819 - scope[ctrlAs].$$internalmodel = undefined;  
820 - if ($mlp_attr) {  
821 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;");  
822 - } else {  
823 - scope[ctrlAs].model[$dcname_attr] = undefined;  
824 - }  
825 -  
826 - if ($dcname2_attr) {  
827 - if ($mlp_attr) {  
828 - eval("scope[ctrlAs].model" + "." + $dcname2_attr + " = undefined;");  
829 - } else {  
830 - scope[ctrlAs].model[$dcname2_attr] = undefined;  
831 - }  
832 - }  
833 - if ($dcname3_attr) {  
834 - if ($mlp_attr) {  
835 - eval("scope[ctrlAs].model" + "." + $dcname3_attr + " = undefined;");  
836 - } else {  
837 - scope[ctrlAs].model[$dcname3_attr] = undefined;  
838 - }  
839 - }  
840 - };  
841 -  
842 - /**  
843 - * 内部方法,读取字典数据作为数据源。  
844 - * @param dicgroup 字典类型,如:gsType  
845 - * @param ccol 代码字段名  
846 - * @param ncol 名字字段名  
847 - */  
848 - scope[ctrlAs].$$internal_dic_data = function(dicgroup, ccol, ncol) {  
849 - var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup);  
850 - var dic_key; // 字典key  
851 - // 清空内部数据  
852 - scope[ctrlAs].$$data_real = [];  
853 - for (dic_key in origin_dicgroup) {  
854 - var data = {}; // 重新组合的字典元素对象  
855 - if (dic_key == "true")  
856 - data[ccol] = true;  
857 - else  
858 - data[ccol] = dic_key;  
859 - data[ncol] = origin_dicgroup[dic_key];  
860 - scope[ctrlAs].$$data_real.push(data);  
861 - }  
862 - // 这里直接将$$data_real数据深拷贝到$$data  
863 - angular.copy(scope[ctrlAs].$$data_real, scope[ctrlAs].$$data);  
864 -  
865 - console.log(scope[ctrlAs].$$data);  
866 - };  
867 -  
868 - /**  
869 - * TODO:这个方法有性能问题,result一多就会卡一卡,之后再解决把  
870 - * 内部方法,读取字典数据作为数据源。  
871 - * @param result 原始数据  
872 - * @param dcvalue 传入的关联数据  
873 - */  
874 - scope[ctrlAs].$$internal_other_data = function(result, dcvalue) {  
875 - //console.log("start");  
876 - // 清空内部数据  
877 - scope[ctrlAs].$$data_real = [];  
878 - scope[ctrlAs].$$data = [];  
879 - for (var i = 0; i < result.length; i ++) {  
880 - if ($icname_s_attr) {  
881 - if ($mlp_attr) {  
882 - if (eval("result[i]" + "." + $icname_s_attr)) {  
883 - // 全拼  
884 - result[i]["fullChars"] = pinyin.getFullChars(eval("result[i]" + "." + $icname_s_attr)).toUpperCase();  
885 - // 简拼  
886 - result[i]["camelChars"] = pinyin.getCamelChars(eval("result[i]" + "." + $icname_s_attr));  
887 - }  
888 - } else {  
889 - if (result[i][$icname_s_attr]) {  
890 - // 全拼  
891 - result[i]["fullChars"] = pinyin.getFullChars(result[i][$icname_s_attr]).toUpperCase();  
892 - // 简拼  
893 - result[i]["camelChars"] = pinyin.getCamelChars(result[i][$icname_s_attr]);  
894 - }  
895 - }  
896 - }  
897 -  
898 - if (result[i]["fullChars"]) { // 有拼音的加入数据源  
899 - scope[ctrlAs].$$data_real.push(result[i]);  
900 - }  
901 -  
902 - }  
903 - //console.log("start2");  
904 -  
905 - // 数量太大取前10条记录作为显示  
906 - if (angular.isArray(scope[ctrlAs].$$data_real)) {  
907 - // 先迭代循环查找已经传过来的值  
908 - if (scope[ctrlAs].$$data_real.length > 0) {  
909 - if (dcvalue) {  
910 - for (var j = 0; j < scope[ctrlAs].$$data_real.length; j++) {  
911 - if (scope[ctrlAs].$$data_real[j][$icname_attr] == dcvalue) {  
912 - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[j]));  
913 - break;  
914 - }  
915 - }  
916 - }  
917 - }  
918 - // 在插入剩余的数据  
919 - for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {  
920 - if (scope[ctrlAs].$$data.length < 10) {  
921 - if ($mlp_attr) {  
922 - if (eval("scope[ctrlAs].$$data_real[k]" + "." + $icname_attr + " != dcvalue")) {  
923 - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));  
924 - }  
925 - } else {  
926 - if (scope[ctrlAs].$$data_real[k][$icname_attr] != dcvalue) {  
927 - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));  
928 - }  
929 - }  
930 - } else {  
931 - break;  
932 - }  
933 - }  
934 - }  
935 -  
936 - //console.log("end");  
937 - };  
938 -  
939 - /**  
940 - * 判定一个对象是否为空对象。  
941 - * @param Obj  
942 - */  
943 - scope[ctrlAs].$$internal_isEmpty_obj = function(obj) {  
944 - console.log(typeof obj);  
945 -  
946 - if (typeof obj === "object" && !(obj instanceof Array)) {  
947 - for (var prop in obj) {  
948 - if (obj.hasOwnProperty(prop)) {  
949 - return false;  
950 - }  
951 - }  
952 - return true;  
953 - } else {  
954 - throw "必须是对象";  
955 - }  
956 - };  
957 -  
958 - // 刷新数据  
959 - scope[ctrlAs].$$internal_refresh_fn = function(search) {  
960 - // 绑定的model字段值,此属性是绑定属性,只能在link阶段获取  
961 - var $dcvalue_attr = attr["dcvalue"];  
962 -  
963 - console.log("刷新数据:" + $dcvalue_attr);  
964 -  
965 - if (!$$data_init) { // 只初始化$$data_real一次,重新载入页面才能重新初始化  
966 - if (dictionaryUtils.getByGroup($datatype_attr)) { // 判定是否字典类型数据源  
967 - scope[ctrlAs].$$internal_dic_data(  
968 - $datatype_attr, $icname_attr, $icname_s_attr);  
969 - if ($dcvalue_attr) {  
970 - scope[ctrlAs].$$internalmodel = $dcvalue_attr;  
971 - }  
972 - } else { // 非字典类型数据源  
973 - if (!$dataassociate_attr) {  
974 - $$searchInfoService_g[$datatype_attr].list(  
975 - {type: "all"},  
976 - function(result) {  
977 - //console.log("ok:" + $datatype_attr);  
978 - scope[ctrlAs].$$internal_other_data(result, $dcvalue_attr);  
979 - //console.log("ok2:" + $datatype_attr);  
980 - if ($dcvalue_attr) {  
981 - scope[ctrlAs].$$internalmodel = $dcvalue_attr;  
982 - }  
983 -  
984 - $$data_init = true;  
985 - },  
986 - function(result) {  
987 -  
988 - }  
989 - );  
990 - }  
991 - }  
992 - }  
993 -  
994 - if ($$data_init) {  
995 - if (search && search != "") { // 有search值  
996 - if (!dictionaryUtils.getByGroup($datatype_attr)) { // 其他数据源  
997 - // 处理search  
998 - console.log("search:" + search);  
999 -  
1000 - scope[ctrlAs].$$data = [];  
1001 - for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {  
1002 - var upTerm = search.toUpperCase();  
1003 - if (scope[ctrlAs].$$data.length < 10) {  
1004 - if (scope[ctrlAs].$$data_real[k].fullChars.indexOf(upTerm) != -1  
1005 - || scope[ctrlAs].$$data_real[k].camelChars.indexOf(upTerm) != -1) {  
1006 - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));  
1007 - }  
1008 - } else {  
1009 - break;  
1010 - }  
1011 - }  
1012 - }  
1013 - }  
1014 -  
1015 - }  
1016 -  
1017 - };  
1018 -  
1019 -  
1020 -  
1021 -  
1022 -  
1023 -  
1024 -  
1025 -  
1026 -  
1027 -  
1028 - // TODO:  
1029 -  
1030 - // dom全部载入后调用  
1031 - $timeout(function() {  
1032 - console.log("dom全部载入后调用");  
1033 - }, 0);  
1034 - // 监控dcvalue model值变换  
1035 - attr.$observe("dcvalue", function(value) {  
1036 - console.log("监控dc1 model值变换:" + value);  
1037 - scope[ctrlAs].$$internalmodel = value;  
1038 - }  
1039 - );  
1040 - // 监控获取数据参数变换  
1041 - attr.$observe("dataparam", function(value) {  
1042 - // 判定是否空对象  
1043 - console.log(value);  
1044 - var obj = JSON.parse(value);  
1045 - var $dcvalue_attr = attr["dcvalue"];  
1046 - if (!scope[ctrlAs].$$internal_isEmpty_obj(obj)) {  
1047 - console.log("dataparam:" + obj);  
1048 -  
1049 - //  
1050 -  
1051 - obj["type"] = "all";  
1052 -  
1053 - $$data_init = false;  
1054 - $$searchInfoService_g[$datatype_attr].list(  
1055 - obj,  
1056 - function(result) {  
1057 - //console.log("ok:" + $datatype_attr);  
1058 - scope[ctrlAs].$$internal_other_data(result, $dcvalue_attr);  
1059 - //console.log("ok2:" + $datatype_attr);  
1060 - if ($dcvalue_attr) {  
1061 - scope[ctrlAs].$$internalmodel = $dcvalue_attr;  
1062 - }  
1063 -  
1064 - $$data_init = true;  
1065 - },  
1066 - function(result) {  
1067 -  
1068 - }  
1069 - );  
1070 - }  
1071 - }  
1072 - );  
1073 - }  
1074 - };  
1075 - }  
1076 - };  
1077 -  
1078 - }  
1079 -]);  
1080 -  
1081 -/**  
1082 - * saCheckboxgroup指令  
1083 - * 属性如下:  
1084 - * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave  
1085 - * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}  
1086 - * dcname(必须):绑定的model字段名,如:dcname=xl.id  
1087 - * name(必须):控件的名字  
1088 - * required(可选):是否要用required验证  
1089 - * disabled(可选):标示框是否可选  
1090 - *  
1091 - */  
1092 -angular.module('ScheduleApp').directive('saCheckboxgroup', [  
1093 - function() {  
1094 - return {  
1095 - restrict: 'E',  
1096 - templateUrl: '/pages/scheduleApp/module/common/dt/MyCheckboxGroupWrapTemplate.html',  
1097 - scope: {  
1098 - model: "=" // 独立作用域,关联外部的模型object  
1099 - },  
1100 - controllerAs: "$saCheckboxgroupCtrl",  
1101 - bindToController: true,  
1102 - controller: function($scope) {  
1103 - var self = this;  
1104 - self.$$data = []; // 内部的数据  
1105 -  
1106 - // TODO:数据写死,周一至周日选择数据,以后有别的数据再议  
1107 - self.$$data = [  
1108 - {name: "星期一", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1109 - {name: "星期二", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1110 - {name: "星期三", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1111 - {name: "星期四", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1112 - {name: "星期五", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1113 - {name: "星期六", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1114 - {name: "星期日", checkedvalue: "1", uncheckedvalue: "0", ischecked: false}  
1115 - ];  
1116 - },  
1117 -  
1118 - /**  
1119 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
1120 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
1121 - * @param tElem  
1122 - * @param tAttrs  
1123 - * @returns {{pre: Function, post: Function}}  
1124 - */  
1125 - compile: function(tElem, tAttrs) {  
1126 - // 获取所有的属性  
1127 - var $name_attr = tAttrs["name"]; // 控件的名字  
1128 - var $required_attr = tAttrs["required"]; // 是否需要required验证  
1129 - var $disabled_attr = tAttrs["disabled"]; // 是否禁用  
1130 - var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名  
1131 -  
1132 - // controlAs名字  
1133 - var ctrlAs = '$saCheckboxgroupCtrl';  
1134 -  
1135 - // 如果有required属性,添加angularjs required验证  
1136 - if ($required_attr != undefined) {  
1137 - //console.log(tElem.html());  
1138 - tElem.find("div").attr("required", "");  
1139 - }  
1140 - // 如果有disabled属性,添加禁用标志  
1141 - if ($disabled_attr != undefined) {  
1142 - tElem.find("input").attr("ng-disabled", "true");  
1143 - }  
1144 -  
1145 - return {  
1146 - pre: function(scope, element, attr) {  
1147 - // TODO:  
1148 - },  
1149 - /**  
1150 - * 相当于link函数。  
1151 - * @param scope  
1152 - * @param element  
1153 - * @param attr  
1154 - */  
1155 - post: function(scope, element, attr) {  
1156 - // name属性  
1157 - if ($name_attr) {  
1158 - scope[ctrlAs]["$name_attr"] = $name_attr;  
1159 - }  
1160 -  
1161 - /**  
1162 - * checkbox选择事件处理函数。  
1163 - * @param $d 数据对象,$$data中的元素对象  
1164 - */  
1165 - scope[ctrlAs].$$internal_updateCheck_fn = function($d) {  
1166 - $d.ischecked = !$d.ischecked;  
1167 - console.log($d);  
1168 - };  
1169 -  
1170 - // 测试使用watch监控$$data的变化  
1171 - scope.$watch(  
1172 - function() {  
1173 - return scope[ctrlAs]["$$data"];  
1174 - },  
1175 - function(newValue, oldValue) {  
1176 - // 根据$$data生成对应的数据  
1177 - var rule_days_arr = [];  
1178 - var i;  
1179 - for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {  
1180 - if (scope[ctrlAs]["$$data"][i].ischecked)  
1181 - rule_days_arr.push(scope[ctrlAs]["$$data"][i].checkedvalue);  
1182 - else  
1183 - rule_days_arr.push(scope[ctrlAs]["$$data"][i].uncheckedvalue);  
1184 - }  
1185 - scope[ctrlAs].$$internalmodel = rule_days_arr.join(",");  
1186 - //scope[ctrlAs].$$internalmodel = undefined;  
1187 - console.log("bbbbbbbb--->" + scope[ctrlAs].$$internalmodel);  
1188 -  
1189 - // 更新model  
1190 - if ($dcname_attr) {  
1191 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = rule_days_arr.join(',');");  
1192 - }  
1193 -  
1194 -  
1195 - },  
1196 - true  
1197 - );  
1198 -  
1199 - // TODO:  
1200 -  
1201 - // 监控dcvalue model值变换  
1202 - attr.$observe("dcvalue", function(value) {  
1203 - console.log("saCheckboxgroup 监控dc1 model值变换:" + value);  
1204 - if (value) {  
1205 - // 根据value值,修改$$data里的值  
1206 - var data_array = value.split(",");  
1207 - var i;  
1208 - if (data_array.length > scope[ctrlAs]["$$data"].length) {  
1209 - for (i = 0; i < scope[ctrlAs]["$$data"].length; i ++) {  
1210 - if (data_array[i] == scope[ctrlAs]["$$data"][i].checkedvalue) {  
1211 - scope[ctrlAs]["$$data"][i].ischecked = true;  
1212 - } else {  
1213 - scope[ctrlAs]["$$data"][i].ischecked = false;  
1214 - }  
1215 - }  
1216 - } else {  
1217 - for (i = 0; i < data_array.length; i ++) {  
1218 - if (data_array[i] == scope[ctrlAs]["$$data"][i].checkedvalue) {  
1219 - scope[ctrlAs]["$$data"][i].ischecked = true;  
1220 - } else {  
1221 - scope[ctrlAs]["$$data"][i].ischecked = false;  
1222 - }  
1223 - }  
1224 - }  
1225 -  
1226 - }  
1227 - });  
1228 - }  
1229 -  
1230 - };  
1231 -  
1232 -  
1233 - }  
1234 -  
1235 - };  
1236 - }  
1237 -]);  
1238 -  
1239 -/**  
1240 - * saDategroup指令  
1241 - * 属性如下:  
1242 - * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave  
1243 - * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}  
1244 - * dcname(必须):绑定的model字段名,如:dcname=xl.id  
1245 - * name(必须):控件的名字  
1246 - * required(可选):是否要用required验证  
1247 - * disabled(可选):标示框是否可选  
1248 - *  
1249 - */  
1250 -angular.module('ScheduleApp').directive('saDategroup', [  
1251 - '$filter',  
1252 - function($filter) {  
1253 - return {  
1254 - restrict: 'E',  
1255 - templateUrl: '/pages/scheduleApp/module/common/dt/MyDateGroupWrapTemplate.html',  
1256 - scope: {  
1257 - model: "=" // 独立作用域,关联外部的模型object  
1258 - },  
1259 - controllerAs: "$saDategroupCtrl",  
1260 - bindToController: true,  
1261 - controller: function($scope) {  
1262 - var self = this;  
1263 - self.$$data = []; // 内部的数据  
1264 - self.$$date_select; // 内部选中的日期  
1265 -  
1266 - //// 测试数据  
1267 - //self.$$data = [  
1268 - // {datestr: '2011-01-01', ischecked: true},  
1269 - // {datestr: '2011-01-01', ischecked: true},  
1270 - // {datestr: '2011-01-01', ischecked: true}  
1271 - //];  
1272 - },  
1273 -  
1274 - /**  
1275 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
1276 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
1277 - * @param tElem  
1278 - * @param tAttrs  
1279 - * @returns {{pre: Function, post: Function}}  
1280 - */  
1281 - compile: function(tElem, tAttrs) {  
1282 - // 获取所有的属性  
1283 - var $name_attr = tAttrs["name"]; // 控件的名字  
1284 - var $required_attr = tAttrs["required"]; // 是否需要required验证  
1285 - var $disabled_attr = tAttrs["disabled"]; // 是否禁用  
1286 - var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名  
1287 -  
1288 - // controlAs名字  
1289 - var ctrlAs = '$saDategroupCtrl';  
1290 -  
1291 - // 如果有required属性,添加angularjs required验证  
1292 - if ($required_attr != undefined) {  
1293 - //console.log(tElem.html());  
1294 - tElem.find("div").attr("required", "");  
1295 - }  
1296 - // 如果有disabled属性,添加禁用标志  
1297 - if ($disabled_attr != undefined) {  
1298 - tElem.find("input").attr("ng-disabled", "true");  
1299 - tElem.find("div").attr("ng-disabled", "true");  
1300 - }  
1301 -  
1302 - return {  
1303 - pre: function (scope, element, attr) {  
1304 - // TODO:  
1305 - },  
1306 - /**  
1307 - * 相当于link函数。  
1308 - * @param scope  
1309 - * @param element  
1310 - * @param attr  
1311 - */  
1312 - post: function (scope, element, attr) {  
1313 - // name属性  
1314 - if ($name_attr) {  
1315 - scope[ctrlAs]["$name_attr"] = $name_attr;  
1316 - }  
1317 -  
1318 -  
1319 - // 日期open属性,及方法  
1320 - scope[ctrlAs].$$specialDateOpen = false;  
1321 - scope[ctrlAs].$$specialDate_open = function() {  
1322 - scope[ctrlAs].$$specialDateOpen = true;  
1323 - };  
1324 -  
1325 - // 监控选择的日期  
1326 - scope.$watch(  
1327 - function() {  
1328 - return scope[ctrlAs]['$$date_select'];  
1329 - },  
1330 - function(newValue, oldValue) {  
1331 - if (newValue) {  
1332 - //console.log("saDategroup--->selectdate:" + newValue);  
1333 - // 调用内置filter,转换日期到yyyy-MM-dd格式  
1334 - var text = $filter('date')(newValue, 'yyyy-MM-dd');  
1335 - var i;  
1336 - var isexist = false; // 日期是否已经选择标识  
1337 - for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {  
1338 - if (scope[ctrlAs]["$$data"][i].datestr == text) {  
1339 - isexist = true;  
1340 - break;  
1341 - }  
1342 - }  
1343 - if (!isexist) {  
1344 - scope[ctrlAs]["$$data"].push(  
1345 - {  
1346 - datestr: text,  
1347 - ischecked: true  
1348 - }  
1349 - );  
1350 - }  
1351 -  
1352 - }  
1353 -  
1354 - }  
1355 - );  
1356 -  
1357 - /**  
1358 - * 日期点击事件处理函数。  
1359 - * @param $index 索引  
1360 - */  
1361 - scope[ctrlAs].$$internal_datestr_click = function($index) {  
1362 - scope[ctrlAs].$$data.splice($index, 1);  
1363 - };  
1364 -  
1365 - // 测试使用watch监控$$data的变化  
1366 - scope.$watch(  
1367 - function() {  
1368 - return scope[ctrlAs]['$$data'];  
1369 - },  
1370 - function(newValue, oldValue) {  
1371 - // 根据$$data生成对应的数据  
1372 - var special_days_arr = [];  
1373 - var i;  
1374 - for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {  
1375 - special_days_arr.push(scope[ctrlAs]["$$data"][i].datestr);  
1376 - }  
1377 -  
1378 - scope[ctrlAs].$$internalmodel = special_days_arr.join(",");  
1379 - console.log("bbbbbbbb--->" + scope[ctrlAs].$$internalmodel);  
1380 -  
1381 - // 更新model  
1382 - if ($dcname_attr) {  
1383 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = special_days_arr.join(',');");  
1384 - }  
1385 - },  
1386 - true  
1387 - );  
1388 -  
1389 - // 监控dcvalue model值变换  
1390 - attr.$observe("dcvalue", function(value) {  
1391 - console.log("saDategroup 监控dc1 model值变换:" + value);  
1392 - if (value) {  
1393 - // 根据value值,修改$$data里的值  
1394 - var date_array = value.split(",");  
1395 - var i;  
1396 - scope[ctrlAs]["$$data"] = [];  
1397 - for (i = 0; i < date_array.length; i++) {  
1398 - scope[ctrlAs]["$$data"].push(  
1399 - {  
1400 - datestr: date_array[i],  
1401 - ischecked: true  
1402 - }  
1403 - );  
1404 - }  
1405 -  
1406 -  
1407 -  
1408 -  
1409 -  
1410 -  
1411 -  
1412 -  
1413 -  
1414 - }  
1415 - });  
1416 -  
1417 - }  
1418 -  
1419 - };  
1420 - }  
1421 - }  
1422 - }  
1423 -]);  
1424 -  
1425 -/**  
1426 - * saGuideboardgroup指令  
1427 - * 属性如下:  
1428 - * name(必须):控件的名字  
1429 - * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave  
1430 - * xlidvalue(必须):绑定的model线路id值,如:xlidvalue={{ctrl.employeeInfoForSave.xl.id}}  
1431 - * lprangevalue(必须):绑定的model路牌名字范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}  
1432 - * lprangename(必须):绑定的model路牌名字范围字段名,如:lprangename=lprange  
1433 - * lpidrangevalue(必须):绑定的model路牌id范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}  
1434 - * lpidrangename(必须):绑定的model路牌id范围字段名,如:lprangename=lprange  
1435 - * lpstartvalue(必须):绑定的model起始路牌值,如:lpstartvalue={{ctrl.employeeInfoForSave.lpstart}}  
1436 - * lpstartname(必须):绑定的model起始路牌字段名,如:lpstartname=lpstart  
1437 - *  
1438 - * required(可选):是否要用required验证  
1439 - *  
1440 - */  
1441 -angular.module('ScheduleApp').directive('saGuideboardgroup', [  
1442 - 'GuideboardManageService_g',  
1443 - function(guideboardManageService_g) {  
1444 - return {  
1445 - restrict: 'E',  
1446 - templateUrl: '/pages/scheduleApp/module/common/dt/MyGuideboardGroupWrapTemplate.html',  
1447 - scope: {  
1448 - model: "=" // 独立作用域,关联外部的模型object  
1449 - },  
1450 - controllerAs: '$saGuideboardgroupCtrl',  
1451 - bindToController: true,  
1452 - controller: function($scope) {  
1453 - var self = this;  
1454 - self.$$data = []; // 选择线路后,该线路的路牌数据  
1455 -  
1456 - // 测试数据  
1457 - //self.$$data = [  
1458 - // {lpid: 1, lpname: '路1', isstart: false},  
1459 - // {lpid: 2, lpname: '路2', isstart: true},  
1460 - // {lpid: 3, lpname: '路3', isstart: false}  
1461 - //];  
1462 -  
1463 -  
1464 - self.$$dataSelected = []; // 选中的路牌列表  
1465 - self.$$dataSelectedStart = undefined; // 起始路牌  
1466 -  
1467 - //self.$$dataSelected = [  
1468 - // {lpid: 11, lpname: '路11', isstart: false},  
1469 - // {lpid: 12, lpname: '路12', isstart: true},  
1470 - // {lpid: 13, lpname: '路13', isstart: false}  
1471 - //];  
1472 -  
1473 - // saGuideboardgroup组件的ng-model,用于外部绑定等操作  
1474 - self.$$internalmodel = undefined;  
1475 -  
1476 - self.$$data_init = false; // *数据源初始化标志  
1477 - self.$$data_xl_first_init = false; // 线路是否初始化  
1478 - self.$$data_lp_first_init = false; // 路牌名字是否初始化  
1479 - self.$$data_lpid_first_init = false; // 路牌id是否初始化  
1480 - self.$$data_lpstart_first_init = false; // 起始路牌是否初始化  
1481 -  
1482 - self.$$dataDesc = ""; // 路牌列表描述  
1483 - self.$$dataSelectDesc = ""; // 选中路牌描述  
1484 -  
1485 - },  
1486 -  
1487 - /**  
1488 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
1489 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
1490 - * @param tElem  
1491 - * @param tAttrs  
1492 - * @returns {{pre: Function, post: Function}}  
1493 - */  
1494 - compile: function(tElem, tAttrs) {  
1495 - // TODO:获取所有的属性  
1496 - var $name_attr = tAttrs["name"]; // 控件的名字  
1497 - var $required_attr = tAttrs["required"]; // 是否需要required验证  
1498 - var $lprangename_attr = tAttrs["lprangename"]; // 绑定的model路牌名字范围字段名  
1499 - var $lpidrangename_attr = tAttrs["lpidrangename"]; // 绑定的model路牌id范围字段名  
1500 - var $lpstartname_attr = tAttrs["lpstartname"]; // 绑定的model起始路牌字段名  
1501 -  
1502 - // controlAs名字  
1503 - var ctrlAs = '$saGuideboardgroupCtrl';  
1504 -  
1505 - // 如果有required属性,添加angularjs required验证  
1506 - if ($required_attr != undefined) {  
1507 - //console.log(tElem.html());  
1508 - tElem.find("div").attr("required", "");  
1509 - }  
1510 -  
1511 - return {  
1512 - pre: function(scope, element, attr) {  
1513 - // TODO:  
1514 - },  
1515 -  
1516 - /**  
1517 - * 相当于link函数。  
1518 - * @param scope  
1519 - * @param element  
1520 - * @param attr  
1521 - */  
1522 - post: function(scope, element, attr) {  
1523 - // name属性  
1524 - if ($name_attr) {  
1525 - scope[ctrlAs]["$name_attr"] = $name_attr;  
1526 - }  
1527 -  
1528 - // TODO:  
1529 -  
1530 -  
1531 - /**  
1532 - * 路牌列表点击(路牌列表中选中路牌)  
1533 - * @param $index  
1534 - */  
1535 - scope[ctrlAs].$$internal_lplist_click = function($index) {  
1536 - var data_temp = scope[ctrlAs].$$data;  
1537 - if (data_temp && data_temp.length > $index) {  
1538 - scope[ctrlAs].$$dataSelected.push({  
1539 - lpid: data_temp[$index].lpid,  
1540 - lpname: data_temp[$index].lpname,  
1541 - isstart: data_temp[$index].isstart  
1542 - });  
1543 -  
1544 - // 如果没有指定过初始路牌,默认选择此路牌作为起始路牌  
1545 - if (scope[ctrlAs].$$dataSelectedStart == undefined) {  
1546 - scope[ctrlAs].$$internal_sellplist_click(  
1547 - scope[ctrlAs].$$dataSelected.length - 1);  
1548 - }  
1549 - }  
1550 - };  
1551 - /**  
1552 - * 选中的路牌单击(初始路牌选择)  
1553 - * @param $index  
1554 - */  
1555 - scope[ctrlAs].$$internal_sellplist_click = function($index) {  
1556 - var data_temp = scope[ctrlAs].$$dataSelected;  
1557 - if (data_temp && data_temp.length > $index) {  
1558 - for (var i = 0; i < data_temp.length; i++) {  
1559 - data_temp[i].isstart = false;  
1560 - }  
1561 - data_temp[$index].isstart = true;  
1562 - scope[ctrlAs].$$dataSelectedStart = $index;  
1563 - }  
1564 - };  
1565 - /**  
1566 - * 选中的路牌双击(删除选中的路牌)  
1567 - * @param $index  
1568 - */  
1569 - scope[ctrlAs].$$internal_sellplist_dbclick = function($index) {  
1570 - var data_temp = scope[ctrlAs].$$dataSelected;  
1571 - if (data_temp && data_temp.length > $index) {  
1572 - if (scope[ctrlAs].$$dataSelectedStart == $index) {  
1573 - scope[ctrlAs].$$dataSelectedStart = undefined;  
1574 - }  
1575 - data_temp.splice($index, 1);  
1576 - }  
1577 - };  
1578 -  
1579 -  
1580 - /**  
1581 - * 验证内部数据,更新外部model  
1582 - */  
1583 - scope[ctrlAs].$$internal_validate_model = function() {  
1584 - var data_temp = scope[ctrlAs].$$dataSelected;  
1585 - var data_temp2 = scope[ctrlAs].$$dataSelectedStart;  
1586 - var lpNames = [];  
1587 - var lpIds = [];  
1588 - var lpStart = 0;  
1589 - var i = 0;  
1590 -  
1591 - if (data_temp &&  
1592 - data_temp.length > 0 &&  
1593 - data_temp2 != undefined) {  
1594 -  
1595 - for (i = 0; i < data_temp.length; i++) {  
1596 - lpNames.push(data_temp[i].lpname);  
1597 - lpIds.push(data_temp[i].lpid)  
1598 - }  
1599 - data_temp[data_temp2].isstart = true;  
1600 - lpStart = data_temp2 + 1;  
1601 -  
1602 - // 更新内部model,用于外部验证  
1603 - // 内部model的值暂时随意,以后再改  
1604 - scope[ctrlAs].$$internalmodel = {desc: "ok"};  
1605 -  
1606 - // 更新外部model字段  
1607 - if ($lprangename_attr) {  
1608 - console.log("lprangename=" + lpNames.join(','));  
1609 - eval("scope[ctrlAs].model" + "." + $lprangename_attr + " = lpNames.join(',');");  
1610 - }  
1611 - if ($lpidrangename_attr) {  
1612 - console.log("lpidrangename=" + lpIds.join(','));  
1613 - eval("scope[ctrlAs].model" + "." + $lpidrangename_attr + " = lpIds.join(',');");  
1614 - }  
1615 - if ($lpstartname_attr) {  
1616 - console.log("lpstartname=" + lpStart);  
1617 - eval("scope[ctrlAs].model" + "." + $lpstartname_attr + " = lpStart;");  
1618 - }  
1619 -  
1620 - scope[ctrlAs].$$dataSelectDesc =  
1621 - ",共" + data_temp.length + "个," + "初始路牌,第" + lpStart + "个";  
1622 -  
1623 - } else {  
1624 - scope[ctrlAs].$$internalmodel = undefined;  
1625 - }  
1626 -  
1627 -  
1628 - };  
1629 -  
1630 - // 监控内部数据,$$data_selected 变化  
1631 - scope.$watch(  
1632 - function() {  
1633 - return scope[ctrlAs].$$dataSelected;  
1634 - },  
1635 - function(newValue, oldValue) {  
1636 - scope[ctrlAs].$$internal_validate_model();  
1637 - },  
1638 - true  
1639 - );  
1640 -  
1641 - // 监控内部数据,$$data_selected_start 变化  
1642 - scope.$watch(  
1643 - function() {  
1644 - return scope[ctrlAs].$$dataSelectedStart;  
1645 - },  
1646 - function(newValue, oldValue) {  
1647 - scope[ctrlAs].$$internal_validate_model();  
1648 - },  
1649 - true  
1650 - );  
1651 -  
1652 - /**  
1653 - * 验证数据是否初始化完成,  
1654 - * 所谓的初始化就是内部所有的数据被有效设定过一次。  
1655 - */  
1656 - scope[ctrlAs].$$internal_validate_init = function() {  
1657 - var self = scope[ctrlAs];  
1658 -  
1659 - if (self.$$data_xl_first_init &&  
1660 - self.$$data_lp_first_init &&  
1661 - self.$$data_lpid_first_init &&  
1662 - self.$$data_lpstart_first_init) {  
1663 - console.log("数据初始化完毕!");  
1664 - self.$$data_init = true;  
1665 - }  
1666 -  
1667 - };  
1668 -  
1669 - // 监控初始化标志,线路,路牌,路牌id,起始路牌  
1670 - scope.$watch(  
1671 - function() {  
1672 - return scope[ctrlAs].$$data_xl_first_init;  
1673 - },  
1674 - function(newValue, oldValue) {  
1675 - scope[ctrlAs].$$internal_validate_init();  
1676 - }  
1677 - );  
1678 - scope.$watch(  
1679 - function() {  
1680 - return scope[ctrlAs].$$data_lp_first_init;  
1681 - },  
1682 - function(newValue, oldValue) {  
1683 - scope[ctrlAs].$$internal_validate_init();  
1684 - }  
1685 - );  
1686 - scope.$watch(  
1687 - function() {  
1688 - return scope[ctrlAs].$$data_lpid_first_init;  
1689 - },  
1690 - function(newValue, oldValue) {  
1691 - scope[ctrlAs].$$internal_validate_init();  
1692 - }  
1693 - );  
1694 - scope.$watch(  
1695 - function() {  
1696 - return scope[ctrlAs].$$data_lpstart_first_init;  
1697 - },  
1698 - function(newValue, oldValue) {  
1699 - scope[ctrlAs].$$internal_validate_init();  
1700 - }  
1701 - );  
1702 -  
1703 -  
1704 - // 监控线路id的变化  
1705 - attr.$observe("xlidvalue", function(value) {  
1706 - if (value && value != "") {  
1707 - console.log("xlidvalue=" + value);  
1708 -  
1709 - guideboardManageService_g.rest.list(  
1710 - {"xl.id_eq": value, size: 100},  
1711 - function(result) {  
1712 - // 获取值了  
1713 - console.log("路牌获取了");  
1714 -  
1715 - scope[ctrlAs].$$data = [];  
1716 - for (var i = 0; i < result.content.length; i++) {  
1717 - scope[ctrlAs].$$data.push({  
1718 - lpid: result.content[i].id,  
1719 - lpname: result.content[i].lpName,  
1720 - isstart: false  
1721 - });  
1722 - }  
1723 - if (scope[ctrlAs].$$data_init) {  
1724 - scope[ctrlAs].$$dataSelected = [];  
1725 - scope[ctrlAs].$$dataSelectedStart = undefined;  
1726 - scope[ctrlAs].$$internalmodel = undefined;  
1727 - scope[ctrlAs].$$dataDesc = "";  
1728 - scope[ctrlAs].$$dataSelectDesc = "";  
1729 - }  
1730 - scope[ctrlAs].$$data_xl_first_init = true;  
1731 -  
1732 - scope[ctrlAs].$$dataDesc = ",共" + result.content.length + "个";  
1733 - },  
1734 - function(result) {  
1735 -  
1736 - }  
1737 - );  
1738 -  
1739 - }  
1740 - });  
1741 -  
1742 - // 监控路牌名称范围值的变化  
1743 - attr.$observe("lprangevalue", function(value) {  
1744 - if (value && value != "") {  
1745 - var data_temp = scope[ctrlAs].$$dataSelected;  
1746 - var lpnames = value.split(",");  
1747 - var i = 0;  
1748 - if (data_temp && data_temp.length == 0) { // 初始创建  
1749 - console.log("lprangevalue变换了");  
1750 - for (i = 0; i < lpnames.length; i++) {  
1751 - scope[ctrlAs].$$dataSelected.push({  
1752 - lpname: lpnames[i],  
1753 - isstart: false  
1754 - });  
1755 - }  
1756 - } else {  
1757 - for (i = 0; i < lpnames.length; i++) {  
1758 - data_temp[i].lpname = lpnames[i];  
1759 - }  
1760 - }  
1761 - scope[ctrlAs].$$data_lp_first_init = true;  
1762 - }  
1763 - });  
1764 -  
1765 - // 监控路牌id范围值的变化  
1766 - attr.$observe("lpidrangevalue", function(value) {  
1767 - if (value && value != "") {  
1768 - console.log("lpidrangevalue=" + value);  
1769 - var data_temp = scope[ctrlAs].$$dataSelected;  
1770 - var lpids = value.split(",");  
1771 - var i = 0;  
1772 - if (data_temp && data_temp.length == 0) { // 初始创建  
1773 - console.log("lpidrangevalue");  
1774 - for (i = 0; i < lpids.length; i++) {  
1775 - scope[ctrlAs].$$dataSelected.push({  
1776 - lpid: lpids[i],  
1777 - isstart: false  
1778 - });  
1779 - }  
1780 - } else {  
1781 - for (i = 0; i < lpids.length; i++) {  
1782 - data_temp[i].lpid = lpids[i];  
1783 - }  
1784 - }  
1785 - scope[ctrlAs].$$data_lpid_first_init = true;  
1786 - }  
1787 - });  
1788 -  
1789 - // 监控起始路牌的变化  
1790 - attr.$observe("lpstartvalue", function(value) {  
1791 - if (value && value != "") {  
1792 - scope[ctrlAs].$$dataSelectedStart = value - 1;  
1793 - scope[ctrlAs].$$data_lpstart_first_init = true;  
1794 - }  
1795 - });  
1796 -  
1797 -  
1798 -  
1799 - }  
1800 - }  
1801 -  
1802 - }  
1803 - }  
1804 - }  
1805 -]);  
1806 -  
1807 -/**  
1808 - * saEmployeegroup指令  
1809 - * 属性如下:  
1810 - * name(必须):控件的名字  
1811 - * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave  
1812 - * xlidvalue(必须):绑定的model线路id值,如:xlidvalue={{ctrl.employeeInfoForSave.xl.id}}  
1813 - * dbbmrangevalue(必须):绑定的model搭班编码范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}  
1814 - * dbbmrangename(必须):绑定的model搭班编码范围字段名,如:lprangename=lprange  
1815 - * rycidrangevalue(必须):绑定的model人员配置idid范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}  
1816 - * rycidrangename(必须):绑定的model人员配置id范围字段名,如:lprangename=lprange  
1817 - * rystartvalue(必须):绑定的model起始人员,如:lpstartvalue={{ctrl.employeeInfoForSave.lpstart}}  
1818 - * rystartname(必须):绑定的model起始人员字段名,如:lpstartname=lpstart  
1819 - *  
1820 - * required(可选):是否要用required验证  
1821 - *  
1822 - */  
1823 -angular.module('ScheduleApp').directive('saEmployeegroup', [  
1824 - 'EmployeeConfigService_g',  
1825 - function(employeeConfigService_g) {  
1826 - return {  
1827 - restrict: 'E',  
1828 - templateUrl: '/pages/scheduleApp/module/common/dt/MyEmployeeGroupWrapTemplate.html',  
1829 - scope: {  
1830 - model: "=" // 独立作用域,关联外部的模型object  
1831 - },  
1832 - controllerAs: '$saEmployeegroupCtrl',  
1833 - bindToController: true,  
1834 - controller: function($scope) {  
1835 - var self = this;  
1836 - self.$$data = []; // 选择线路后,该线路的人员配置数据  
1837 -  
1838 - // 测试数据  
1839 - //self.$$data = [  
1840 - // {id: 1, dbbm: "1", jsy: '忍1', spy: '守1', isstart: false},  
1841 - // {id: 2, dbbm: "2", jsy: '忍2', spy: '守2', isstart: true},  
1842 - // {id: 3, dbbm: "3", jsy: '忍3', spy: '守3', isstart: false}  
1843 - //];  
1844 -  
1845 -  
1846 - self.$$dataSelected = []; // 选中的人员配置列表  
1847 - self.$$dataSelectedStart = undefined; // 起始人员配置  
1848 -  
1849 - // saGuideboardgroup组件的ng-model,用于外部绑定等操作  
1850 - self.$$internalmodel = undefined;  
1851 -  
1852 - self.$$data_init = false; // *数据源初始化标志  
1853 - self.$$data_xl_first_init = false; // 线路是否初始化  
1854 - self.$$data_ry_first_init = false; // 人员配置是否初始化  
1855 - self.$$data_rycid_first_init = false; // 人员配置id是否初始化  
1856 - self.$$data_rystart_first_init = false; // 起始人员是否初始化  
1857 -  
1858 - self.$$dataDesc = ""; // 路牌列表描述  
1859 - self.$$dataSelectDesc = ""; // 选中路牌描述  
1860 -  
1861 - },  
1862 -  
1863 - /**  
1864 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
1865 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
1866 - * @param tElem  
1867 - * @param tAttrs  
1868 - * @returns {{pre: Function, post: Function}}  
1869 - */  
1870 - compile: function(tElem, tAttrs) {  
1871 - // TODO:获取所有的属性  
1872 - var $name_attr = tAttrs["name"]; // 控件的名字  
1873 - var $required_attr = tAttrs["required"]; // 是否需要required验证  
1874 - var $dbbmrangename_attr = tAttrs["dbbmrangename"]; // 绑定的model搭班编码范围字段名  
1875 - var rycidrangename_attr = tAttrs["rycidrangename"]; // 绑定的model人员配置id范围字段名  
1876 - var $rystartname_attr = tAttrs["rystartname"]; // 绑定的model起始人员字段名  
1877 -  
1878 - // controlAs名字  
1879 - var ctrlAs = '$saEmployeegroupCtrl';  
1880 -  
1881 - // 如果有required属性,添加angularjs required验证  
1882 - if ($required_attr != undefined) {  
1883 - //console.log(tElem.html());  
1884 - tElem.find("div").attr("required", "");  
1885 - }  
1886 -  
1887 - return {  
1888 - pre: function(scope, element, attr) {  
1889 - // TODO:  
1890 - },  
1891 -  
1892 - /**  
1893 - * 相当于link函数。  
1894 - * @param scope  
1895 - * @param element  
1896 - * @param attr  
1897 - */  
1898 - post: function(scope, element, attr) {  
1899 - // name属性  
1900 - if ($name_attr) {  
1901 - scope[ctrlAs]["$name_attr"] = $name_attr;  
1902 - }  
1903 -  
1904 - // TODO:  
1905 -  
1906 -  
1907 - /**  
1908 - * 人员配置列表点击(人员配置列表中选中路牌)  
1909 - * @param $index  
1910 - */  
1911 - scope[ctrlAs].$$internal_rylist_click = function($index) {  
1912 - var data_temp = scope[ctrlAs].$$data;  
1913 - if (data_temp && data_temp.length > $index) {  
1914 - scope[ctrlAs].$$dataSelected.push({  
1915 - id : data_temp[$index].id,  
1916 - dbbm: data_temp[$index].dbbm,  
1917 - jsy: data_temp[$index].jsy,  
1918 - spy: data_temp[$index].spy,  
1919 - isstart: data_temp[$index].isstart  
1920 - });  
1921 -  
1922 - // 如果没有指定过初始人员,默认选择此人员作为起始人员  
1923 - if (scope[ctrlAs].$$dataSelectedStart == undefined) {  
1924 - scope[ctrlAs].$$internal_selrylist_click(  
1925 - scope[ctrlAs].$$dataSelected.length - 1);  
1926 - }  
1927 - }  
1928 - };  
1929 - /**  
1930 - * 选中的人员单击(初始人员选择)  
1931 - * @param $index  
1932 - */  
1933 - scope[ctrlAs].$$internal_selrylist_click = function($index) {  
1934 - var data_temp = scope[ctrlAs].$$dataSelected;  
1935 - if (data_temp && data_temp.length > $index) {  
1936 - for (var i = 0; i < data_temp.length; i++) {  
1937 - data_temp[i].isstart = false;  
1938 - }  
1939 - data_temp[$index].isstart = true;  
1940 - scope[ctrlAs].$$dataSelectedStart = $index;  
1941 - }  
1942 - };  
1943 - /**  
1944 - * 选中的人员双击(删除选中的人员)  
1945 - * @param $index  
1946 - */  
1947 - scope[ctrlAs].$$internal_selrylist_dbclick = function($index) {  
1948 - var data_temp = scope[ctrlAs].$$dataSelected;  
1949 - if (data_temp && data_temp.length > $index) {  
1950 - if (scope[ctrlAs].$$dataSelectedStart == $index) {  
1951 - scope[ctrlAs].$$dataSelectedStart = undefined;  
1952 - }  
1953 - data_temp.splice($index, 1);  
1954 - }  
1955 - };  
1956 -  
1957 -  
1958 - /**  
1959 - * 验证内部数据,更新外部model  
1960 - */  
1961 - scope[ctrlAs].$$internal_validate_model = function() {  
1962 - var data_temp = scope[ctrlAs].$$dataSelected;  
1963 - var data_temp2 = scope[ctrlAs].$$dataSelectedStart;  
1964 - var ryDbbms = [];  
1965 - var ryCids = [];  
1966 - var ryStart = 0;  
1967 - var i = 0;  
1968 -  
1969 - if (data_temp &&  
1970 - data_temp.length > 0 &&  
1971 - data_temp2 != undefined) {  
1972 -  
1973 - for (i = 0; i < data_temp.length; i++) {  
1974 - ryDbbms.push(data_temp[i].dbbm);  
1975 - ryCids.push(data_temp[i].id);  
1976 - }  
1977 - data_temp[data_temp2].isstart = true;  
1978 - ryStart = data_temp2 + 1;  
1979 -  
1980 - // 更新内部model,用于外部验证  
1981 - // 内部model的值暂时随意,以后再改  
1982 - scope[ctrlAs].$$internalmodel = {desc: "ok"};  
1983 -  
1984 - // 更新外部model字段  
1985 - if ($dbbmrangename_attr) {  
1986 - console.log("dbbmrangename=" + ryDbbms.join(','));  
1987 - eval("scope[ctrlAs].model" + "." + $dbbmrangename_attr + " = ryDbbms.join(',');");  
1988 - }  
1989 - if (rycidrangename_attr) {  
1990 - console.log("rycidrangename=" + ryCids.join(','));  
1991 - eval("scope[ctrlAs].model" + "." + rycidrangename_attr + " = ryCids.join(',');");  
1992 - }  
1993 - if ($rystartname_attr) {  
1994 - console.log("rystartname=" + ryStart);  
1995 - eval("scope[ctrlAs].model" + "." + $rystartname_attr + " = ryStart;");  
1996 - }  
1997 -  
1998 - scope[ctrlAs].$$dataSelectDesc =  
1999 - ",共" + data_temp.length + "组," + "初始人员,第" + ryStart + "组";  
2000 -  
2001 - } else {  
2002 - scope[ctrlAs].$$internalmodel = undefined;  
2003 - }  
2004 -  
2005 -  
2006 - };  
2007 -  
2008 - // 监控内部数据,$$data_selected 变化  
2009 - scope.$watch(  
2010 - function() {  
2011 - return scope[ctrlAs].$$dataSelected;  
2012 - },  
2013 - function(newValue, oldValue) {  
2014 - scope[ctrlAs].$$internal_validate_model();  
2015 - },  
2016 - true  
2017 - );  
2018 -  
2019 - // 监控内部数据,$$data_selected_start 变化  
2020 - scope.$watch(  
2021 - function() {  
2022 - return scope[ctrlAs].$$dataSelectedStart;  
2023 - },  
2024 - function(newValue, oldValue) {  
2025 - scope[ctrlAs].$$internal_validate_model();  
2026 - },  
2027 - true  
2028 - );  
2029 -  
2030 - /**  
2031 - * 验证数据是否初始化完成,  
2032 - * 所谓的初始化就是内部所有的数据被有效设定过一次。  
2033 - */  
2034 - scope[ctrlAs].$$internal_validate_init = function() {  
2035 - var self = scope[ctrlAs];  
2036 - var data_temp = self.$$data;  
2037 - var dataSelect_temp = self.$$dataSelected;  
2038 - var i = 0;  
2039 - var j = 0;  
2040 -  
2041 - if (self.$$data_xl_first_init &&  
2042 - self.$$data_ry_first_init &&  
2043 - self.$$data_rycid_first_init &&  
2044 - self.$$data_rystart_first_init) {  
2045 - console.log("数据初始化完毕!");  
2046 - self.$$data_init = true;  
2047 -  
2048 - // 修正选择dataSelect  
2049 - for (i = 0; i < dataSelect_temp.length; i++) {  
2050 - for (j = 0; j < data_temp.length; j++) {  
2051 - if (dataSelect_temp[i].dbbm == data_temp[j].dbbm) {  
2052 - dataSelect_temp[i].jsy = data_temp[j].jsy;  
2053 - dataSelect_temp[i].spy = data_temp[j].spy;  
2054 - break;  
2055 - }  
2056 - }  
2057 - }  
2058 - }  
2059 -  
2060 - };  
2061 -  
2062 - // 监控初始化标志,线路,人员,起始人员  
2063 - scope.$watch(  
2064 - function() {  
2065 - return scope[ctrlAs].$$data_xl_first_init;  
2066 - },  
2067 - function(newValue, oldValue) {  
2068 - scope[ctrlAs].$$internal_validate_init();  
2069 - }  
2070 - );  
2071 - scope.$watch(  
2072 - function() {  
2073 - return scope[ctrlAs].$$data_ry_first_init;  
2074 - },  
2075 - function(newValue, oldValue) {  
2076 - scope[ctrlAs].$$internal_validate_init();  
2077 - }  
2078 - );  
2079 - scope.$watch(  
2080 - function() {  
2081 - return scope[ctrlAs].$$data_rycid_first_init;  
2082 - },  
2083 - function(newValue, oldValue) {  
2084 - scope[ctrlAs].$$internal_validate_init();  
2085 - }  
2086 - );  
2087 - scope.$watch(  
2088 - function() {  
2089 - return scope[ctrlAs].$$data_rystart_first_init;  
2090 - },  
2091 - function(newValue, oldValue) {  
2092 - scope[ctrlAs].$$internal_validate_init();  
2093 - }  
2094 - );  
2095 -  
2096 -  
2097 - // 监控线路id的变化  
2098 - attr.$observe("xlidvalue", function(value) {  
2099 - if (value && value != "") {  
2100 - console.log("xlidvalue=" + value);  
2101 -  
2102 - employeeConfigService_g.rest.list(  
2103 - {"xl.id_eq": value, size: 100},  
2104 - function(result) {  
2105 - // 获取值了  
2106 - console.log("人员配置获取了");  
2107 -  
2108 - scope[ctrlAs].$$data = [];  
2109 - for (var i = 0; i < result.content.length; i++) {  
2110 - scope[ctrlAs].$$data.push({  
2111 - id: result.content[i].id,  
2112 - dbbm: result.content[i].dbbm,  
2113 - jsy: result.content[i].jsy.personnelName,  
2114 - spy: result.content[i].spy == null ? "" : result.content[i].spy.personnelName,  
2115 - isstart: false  
2116 - });  
2117 - }  
2118 - if (scope[ctrlAs].$$data_init) {  
2119 - scope[ctrlAs].$$dataSelected = [];  
2120 - scope[ctrlAs].$$dataSelectedStart = undefined;  
2121 - scope[ctrlAs].$$internalmodel = undefined;  
2122 - scope[ctrlAs].$$dataDesc = "";  
2123 - scope[ctrlAs].$$dataSelectDesc = "";  
2124 - }  
2125 - scope[ctrlAs].$$data_xl_first_init = true;  
2126 -  
2127 - scope[ctrlAs].$$dataDesc = ",共" + result.content.length + "组";  
2128 - },  
2129 - function(result) {  
2130 -  
2131 - }  
2132 - );  
2133 -  
2134 - }  
2135 - });  
2136 -  
2137 - // 监控搭班编码范围值的变化  
2138 - attr.$observe("dbbmrangevalue", function(value) {  
2139 - if (value && value != "") {  
2140 - var data_temp = scope[ctrlAs].$$dataSelected;  
2141 - var dbbmnames = value.split(",");  
2142 - var i = 0;  
2143 - if (data_temp && data_temp.length == 0) { // 初始创建  
2144 - console.log("dbbmrangevalue变换了");  
2145 - for (i = 0; i < dbbmnames.length; i++) {  
2146 - scope[ctrlAs].$$dataSelected.push({  
2147 - dbbm: dbbmnames[i],  
2148 - isstart: false  
2149 - });  
2150 - }  
2151 - } else {  
2152 - for (i = 0; i < dbbmnames.length; i++) {  
2153 - data_temp[i].dbbm = dbbmnames[i];  
2154 - }  
2155 - }  
2156 - scope[ctrlAs].$$data_ry_first_init = true;  
2157 - }  
2158 - });  
2159 -  
2160 - // 监控人员配置id范围值的变化  
2161 - attr.$observe("rycidrangevalue", function(value) {  
2162 - if (value && value != "") {  
2163 - var data_temp = scope[ctrlAs].$$dataSelected;  
2164 - var rycids = value.split(",");  
2165 - var i = 0;  
2166 - if (data_temp && data_temp.length == 0) { // 初始创建  
2167 - console.log("rycidrangevalue变换了");  
2168 - for (i = 0; i < rycids.length; i++) {  
2169 - scope[ctrlAs].$$dataSelected.push({  
2170 - id: rycids[i],  
2171 - isstart: false  
2172 - });  
2173 - }  
2174 - } else {  
2175 - for (i = 0; i < rycids.length; i++) {  
2176 - data_temp[i].id = rycids[i];  
2177 - }  
2178 - }  
2179 - scope[ctrlAs].$$data_rycid_first_init = true;  
2180 - }  
2181 - });  
2182 -  
2183 - // 监控起始人员的变化  
2184 - attr.$observe("rystartvalue", function(value) {  
2185 - if (value && value != "") {  
2186 - scope[ctrlAs].$$dataSelectedStart = value - 1;  
2187 - scope[ctrlAs].$$data_rystart_first_init = true;  
2188 - }  
2189 - });  
2190 -  
2191 -  
2192 -  
2193 - }  
2194 - }  
2195 -  
2196 - }  
2197 - }  
2198 - }  
2199 -]);  
2200 \ No newline at end of file 1 \ No newline at end of file
  2 +// 自定义指令,指令模版在dt目录下
  3 +
  4 +
  5 +angular.module('ScheduleApp').directive('loadingWidget', ['requestNotificationChannel', function(requestNotificationChannel) {
  6 + return {
  7 + restrict: 'A',
  8 + link: function(scope, element) {
  9 + // 初始隐藏loading界面
  10 + element.hide();
  11 +
  12 + // 开始请求通知处理
  13 + requestNotificationChannel.onRequestStarted(scope, function() {
  14 + element.show();
  15 + });
  16 + // 请求结束通知处理
  17 + requestNotificationChannel.onRequestEnded(scope, function() {
  18 + element.hide();
  19 + });
  20 + }
  21 + };
  22 +}]);
  23 +
  24 +angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) {
  25 + return {
  26 + restrict: 'E',
  27 + templateUrl: '/pages/scheduleApp/module/other/MyDictionarySelectTemplate.html',
  28 + scope: {
  29 + model: "="
  30 + },
  31 + controllerAs: "$saSelectCtrl",
  32 + bindToController: true,
  33 + controller: function() {
  34 + var self = this;
  35 + self.datas = []; // 关联的字典数据,内部格式 {code:{值},name:{名字}}
  36 + },
  37 + /**
  38 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  39 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  40 + * @param tElem
  41 + * @param tAttrs
  42 + * @returns {{pre: Function, post: Function}}
  43 + */
  44 + compile: function(tElem, tAttrs) {
  45 + // 确定是否使用angularjs required验证
  46 + // 属性 required
  47 + // 如果没有填写,内部不添加验证,如果填写了,并且等于true添加验证,否则不添加
  48 + var required_attr = tAttrs["required"];
  49 + if (required_attr) {
  50 + if (required_attr == "true") {
  51 + // 添加required属性指令
  52 + tElem.find("ui-select").attr("required", "");
  53 + } else {
  54 + // 不等于true,不添加required属性指令
  55 + }
  56 + } else {
  57 + // 不添加required属性指令
  58 + }
  59 +
  60 + //console.log("saSelect" + ":compile = >" + tElem.html());
  61 +
  62 + return {
  63 + pre: function(scope, element, attr) {
  64 + // TODO:
  65 + },
  66 + /**
  67 + * 相当于link函数。
  68 + *
  69 + * 重要属性如下:
  70 + * model 是绑定外部值。
  71 + * dicgroup 字典组的类型
  72 + * name input name属性值
  73 + */
  74 + post: function(scope, element, attr) {
  75 + // 1、获取属性
  76 + var dicgroup_attr = attr['dicgroup']; // 字典组的类型
  77 + var name_attr = attr['name']; // input name属性值
  78 + var dicname_attr = attr['dicname']; // model关联的字典名字段
  79 + var codename_attr = attr['codename']; // model关联的字典值字段
  80 + var placeholder_attr = attr['placeholder']; // select placeholder提示
  81 +
  82 + // 系统的字典对象,使用dictionaryUtils类获取
  83 + var origin_dicgroup;
  84 + var dic_key; // 字典key
  85 +
  86 + if (dicgroup_attr) { // 赋值指定的字典数据
  87 + origin_dicgroup = dictionaryUtils.getByGroup(dicgroup_attr);
  88 + for (dic_key in origin_dicgroup) {
  89 + var data = {}; // 重新组合的字典元素对象
  90 + if (dic_key == "true")
  91 + data.code = true;
  92 + else
  93 + data.code = dic_key;
  94 + data.name = origin_dicgroup[dic_key];
  95 + scope["$saSelectCtrl"].datas.push(data);
  96 + }
  97 + }
  98 +
  99 + if (name_attr) {
  100 + scope["$saSelectCtrl"].nv = name_attr;
  101 + }
  102 + if (placeholder_attr) {
  103 + scope["$saSelectCtrl"].ph = placeholder_attr;
  104 + }
  105 +
  106 + scope["$saSelectCtrl"].select = function($item) {
  107 + if (codename_attr) {
  108 + scope["$saSelectCtrl"].model[codename_attr] = $item.code;
  109 + }
  110 + if (dicname_attr) {
  111 + scope["$saSelectCtrl"].model[dicname_attr] = $item.name;
  112 + }
  113 + };
  114 +
  115 + scope["$saSelectCtrl"].remove = function() {
  116 + if (codename_attr) {
  117 + scope["$saSelectCtrl"].model[codename_attr] = null;
  118 + }
  119 + if (dicname_attr) {
  120 + scope["$saSelectCtrl"].model[dicname_attr] = null;
  121 + }
  122 + scope["$saSelectCtrl"].cmodel = null;
  123 + };
  124 +
  125 + $timeout(function() {
  126 + // 创建内部使用的绑定对象
  127 + var model_code = scope["$saSelectCtrl"].model[codename_attr];
  128 + scope["$saSelectCtrl"].cmodel = model_code;
  129 + }, 0);
  130 + }
  131 + }
  132 + }
  133 + };
  134 +}]);
  135 +
  136 +/**
  137 + * saRadiogroup指令
  138 + * 属性如下:
  139 + * model(必须):独立作用域,外部绑定的一个值,如:ctrl.timeTableManageForForm.isEnableDisTemplate
  140 + * dicgroup(必须):关联的字典数据type(TODO:以后增加其他数据源)
  141 + * name(必须):控件的名字
  142 + * required(可选):是否要用required验证
  143 + * disabled(可选):标示单选框是否可选
  144 + *
  145 + */
  146 +angular.module('ScheduleApp').directive("saRadiogroup", [function() {
  147 + /**
  148 + * 使用字典数据的单选按钮组的指令。
  149 + * 指令名称:truefalse-Dic
  150 + */
  151 + return {
  152 + restrict: 'E',
  153 + templateUrl: '/pages/scheduleApp/module/common/dt/MyRadioGroupWrapTemplate.html',
  154 + scope: {
  155 + model: "="
  156 + },
  157 + controllerAs: "$saRadiogroupCtrl",
  158 + bindToController: true,
  159 + controller: function($scope) {
  160 + //$scope["model"] = {selectedOption: null};
  161 + //console.log("controller");
  162 + //console.log("controller:" + $scope["model"]);
  163 +
  164 + var self = this;
  165 + self.$$data = null; // 内部数据
  166 + },
  167 +
  168 + /**
  169 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  170 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  171 + * @param tElem
  172 + * @param tAttrs
  173 + * @returns {{pre: Function, post: Function}}
  174 + */
  175 + compile: function(tElem, tAttrs) {
  176 + // 获取属性
  177 + var $dicgroup_attr = tAttrs["dicgroup"]; // 关联的字典数据type
  178 + var $name_attr = tAttrs["name"]; // 控件的名字
  179 + var $required_attr = tAttrs["required"]; // 是否要用required验证
  180 + var $disabled_attr = tAttrs["disabled"]; // 标示单选框是否可选
  181 +
  182 + // controlAs名字
  183 + var ctrlAs = "$saRadiogroupCtrl";
  184 +
  185 + // 如果有required属性,添加angularjs required验证
  186 + if ($required_attr != undefined) {
  187 + tElem.find("input").attr("required", "");
  188 + }
  189 +
  190 + return {
  191 + pre: function(scope, element, attr) {
  192 +
  193 + },
  194 +
  195 + /**
  196 + * 相当于link函数。
  197 + * @param scope
  198 + * @param element
  199 + * @param attr
  200 + */
  201 + post: function(scope, element, attr) {
  202 + //console.log("link");
  203 + //console.log("link:" + scope.model);
  204 + //scope["model"] = {selectedOption: null};
  205 +
  206 + if ($name_attr) {
  207 + scope[ctrlAs].nv = $name_attr;
  208 + }
  209 +
  210 + if ($disabled_attr) {
  211 + scope[ctrlAs].disabled = true;
  212 + }
  213 + if ($dicgroup_attr) {
  214 + var obj = dictionaryUtils.getByGroup($dicgroup_attr);
  215 + scope[ctrlAs].$$data = obj;
  216 + // 处理 scope["dic"] key值
  217 + scope[ctrlAs].dicvalueCalcu = function(value) {
  218 + if (value == "true") {
  219 + //console.log(value);
  220 + return true;
  221 + } else if (value == "false") {
  222 + //console.log(value);
  223 + return false;
  224 + } else {
  225 + return value;
  226 + }
  227 + };
  228 + }
  229 + }
  230 + };
  231 + }
  232 + };
  233 +}]);
  234 +
  235 +angular.module('ScheduleApp').directive("remoteValidaton", [
  236 + 'BusInfoManageService_g',
  237 + 'EmployeeInfoManageService_g',
  238 + 'TimeTableManageService_g',
  239 + function(
  240 + busInfoManageService_g,
  241 + employeeInfoManageService_g,
  242 + timeTableManageService_g
  243 + ) {
  244 + /**
  245 + * 远端验证指令,依赖于ngModel
  246 + * 指令名称 remote-Validation
  247 + * 需要属性 rvtype 表示验证类型
  248 + */
  249 + return {
  250 + restrict: "A",
  251 + require: "^ngModel",
  252 + link: function(scope, element, attr, ngModelCtrl) {
  253 + element.bind("keyup", function() {
  254 + var modelValue = ngModelCtrl.$modelValue;
  255 + var rv1_attr = attr["rv1"];
  256 + if (attr["rvtype"]) {
  257 +
  258 + // 根据rvtype的值,确定使用那个远端验证的url,
  259 + // rv1, rv2, rv3是关联比较值,暂时使用rv1
  260 + // 这个貌似没法通用,根据业务变换
  261 + // TODO:暂时有点乱以后改
  262 + if (attr["rvtype"] == "insideCode") {
  263 + busInfoManageService_g.validate.insideCode(
  264 + {"insideCode_eq": modelValue, type: "equale"},
  265 + function(result) {
  266 + //console.log(result);
  267 + if (result.status == "SUCCESS") {
  268 + ngModelCtrl.$setValidity('remote', true);
  269 + } else {
  270 + ngModelCtrl.$setValidity('remote', false);
  271 + }
  272 + },
  273 + function(result) {
  274 + //console.log(result);
  275 + ngModelCtrl.$setValidity('remote', true);
  276 + }
  277 + );
  278 + } else if (attr["rvtype"] == "jobCode") {
  279 + if (!rv1_attr) {
  280 + ngModelCtrl.$setValidity('remote', false);
  281 + return;
  282 + }
  283 +
  284 + employeeInfoManageService_g.validate.jobCode(
  285 + {"jobCode_eq": modelValue, "companyCode_eq": rv1_attr, type: "equale"},
  286 + function(result) {
  287 + //console.log(result);
  288 + if (result.status == "SUCCESS") {
  289 + ngModelCtrl.$setValidity('remote', true);
  290 + } else {
  291 + ngModelCtrl.$setValidity('remote', false);
  292 + }
  293 + },
  294 + function(result) {
  295 + //console.log(result);
  296 + ngModelCtrl.$setValidity('remote', true);
  297 + }
  298 + );
  299 + } else if (attr["rvtype"] == "ttinfoname") {
  300 + if (!rv1_attr) {
  301 + ngModelCtrl.$setValidity('remote', false);
  302 + return;
  303 + }
  304 +
  305 + timeTableManageService_g.validate.ttinfoname(
  306 + {"name_eq": modelValue, "xl.id_eq": rv1_attr, type: "equale"},
  307 + function(result) {
  308 + //console.log(result);
  309 + if (result.status == "SUCCESS") {
  310 + ngModelCtrl.$setValidity('remote', true);
  311 + } else {
  312 + ngModelCtrl.$setValidity('remote', false);
  313 + }
  314 + },
  315 + function(result) {
  316 + //console.log(result);
  317 + ngModelCtrl.$setValidity('remote', true);
  318 + }
  319 + );
  320 +
  321 + }
  322 + } else {
  323 + // 没有rvtype,就不用远端验证了
  324 + ngModelCtrl.$setValidity('remote', true);
  325 + }
  326 +
  327 + attr.$observe("rv1", function(value) {
  328 + if (attr["rvtype"] == "jobCode") {
  329 + if (!value) {
  330 + ngModelCtrl.$setValidity('remote', false);
  331 + return;
  332 + }
  333 +
  334 + employeeInfoManageService_g.validate.jobCode(
  335 + {"jobCode_eq": modelValue, "companyCode_eq": rv1_attr, type: "equale"},
  336 + function(result) {
  337 + //console.log(result);
  338 + if (result.status == "SUCCESS") {
  339 + ngModelCtrl.$setValidity('remote', true);
  340 + } else {
  341 + ngModelCtrl.$setValidity('remote', false);
  342 + }
  343 + },
  344 + function(result) {
  345 + //console.log(result);
  346 + ngModelCtrl.$setValidity('remote', true);
  347 + }
  348 + );
  349 + } else if (attr["rvtype"] == "ttinfoname") {
  350 + if (!value) {
  351 + ngModelCtrl.$setValidity('remote', false);
  352 + return;
  353 + }
  354 +
  355 + console.log("rv1:" + value);
  356 +
  357 + timeTableManageService_g.validate.ttinfoname(
  358 + {"name_eq": modelValue, "xl.id_eq": value, type: "equale"},
  359 + function(result) {
  360 + //console.log(result);
  361 + if (result.status == "SUCCESS") {
  362 + ngModelCtrl.$setValidity('remote', true);
  363 + } else {
  364 + ngModelCtrl.$setValidity('remote', false);
  365 + }
  366 + },
  367 + function(result) {
  368 + //console.log(result);
  369 + ngModelCtrl.$setValidity('remote', true);
  370 + }
  371 + );
  372 + }
  373 +
  374 + });
  375 + });
  376 + }
  377 + };
  378 + }]);
  379 +
  380 +
  381 +/**
  382 + * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。
  383 + * 1、compile阶段使用的属性如下:
  384 + * required:用于和表单验证连接,指定成required="true"才有效。
  385 + * 2、link阶段使用的属性如下
  386 + * model:关联的模型对象
  387 + * name:表单验证时需要的名字
  388 + * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加
  389 + * modelcolname1:关联的模型字段名字1(一般应该是编码字段)
  390 + * modelcolname2:关联的模型字段名字2(一般应该是名字字段)
  391 + * datacolname1;内部数据对应的字段名字1(与模型字段1对应)
  392 + * datacolname2:内部数据对应的字段名字2(与模型字段2对应)
  393 + * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用
  394 + * placeholder:select placeholder字符串描述
  395 + *
  396 + * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。
  397 + * $$SearchInfoService_g,内部使用的数据服务
  398 + */
  399 +// saSelect2指令使用的内部信service
  400 +angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {
  401 + return {
  402 + xl: $resource(
  403 + '/line/:type',
  404 + {order: 'name', direction: 'ASC'},
  405 + {
  406 + list: {
  407 + method: 'GET',
  408 + isArray: true
  409 + }
  410 + }
  411 + ),
  412 + zd: $resource(
  413 + '/stationroute/stations',
  414 + {order: 'stationCode', direction: 'ASC'},
  415 + {
  416 + list: {
  417 + method: 'GET',
  418 + isArray: true
  419 + }
  420 + }
  421 + ),
  422 + tcc: $resource(
  423 + '/carpark/:type',
  424 + {order: 'parkCode', direction: 'ASC'},
  425 + {
  426 + list: {
  427 + method: 'GET',
  428 + isArray: true
  429 + }
  430 + }
  431 + ),
  432 + ry: $resource(
  433 + '/personnel/:type',
  434 + {order: 'personnelName', direction: 'ASC'},
  435 + {
  436 + list: {
  437 + method: 'GET',
  438 + isArray: true
  439 + }
  440 + }
  441 + ),
  442 + cl: $resource(
  443 + '/cars/:type',
  444 + {order: "insideCode", direction: 'ASC'},
  445 + {
  446 + list: {
  447 + method: 'GET',
  448 + isArray: true
  449 + }
  450 + }
  451 + ),
  452 + ttInfo: $resource(
  453 + '/tic/:type',
  454 + {order: "name", direction: 'ASC'},
  455 + {
  456 + list: {
  457 + method: 'GET',
  458 + isArray: true
  459 + }
  460 + }
  461 + ),
  462 + cci: $resource(
  463 + '/cci/cars',
  464 + {},
  465 + {
  466 + list: {
  467 + method: 'GET',
  468 + isArray: true
  469 + }
  470 + }
  471 +
  472 + ),
  473 + cci2: $resource(
  474 + '/cci/:type',
  475 + {},
  476 + {
  477 + list: {
  478 + method: 'GET',
  479 + isArray: true
  480 + }
  481 + }
  482 + ),
  483 + cci3: $resource(
  484 + '/cci/cars2',
  485 + {},
  486 + {
  487 + list: {
  488 + method: 'GET',
  489 + isArray: true
  490 + }
  491 + }
  492 +
  493 + ),
  494 + eci: $resource(
  495 + '/eci/jsy',
  496 + {},
  497 + {
  498 + list: {
  499 + method: 'GET',
  500 + isArray: true
  501 + }
  502 + }
  503 + ),
  504 + eci2: $resource(
  505 + '/eci/spy',
  506 + {},
  507 + {
  508 + list: {
  509 + method: 'GET',
  510 + isArray: true
  511 + }
  512 + }
  513 + )
  514 + }
  515 +}]);
  516 +angular.module('ScheduleApp').filter("$$pyFilter", function() {
  517 + return function(items, props) {
  518 + var out = [];
  519 + var limit = props["limit"] || 20; // 默认20条记录
  520 +
  521 + if (angular.isArray(items)) {
  522 + items.forEach(function(item) {
  523 + if (out.length < limit) {
  524 + if (props.search) {
  525 + var upTerm = props.search.toUpperCase();
  526 + if(item.fullChars.indexOf(upTerm) != -1
  527 + || item.camelChars.indexOf(upTerm) != -1) {
  528 + out.push(item);
  529 + }
  530 + }
  531 + }
  532 + });
  533 + }
  534 +
  535 + return out;
  536 + };
  537 +});
  538 +angular.module('ScheduleApp').directive("saSelect2", [
  539 + '$timeout', '$$SearchInfoService_g',
  540 + function($timeout, $$searchInfoService_g) {
  541 + return {
  542 + restrict: 'E',
  543 + templateUrl: '/pages/scheduleApp/module/other/MySearchSelectTemplate.html',
  544 + scope: {
  545 + model: "=" // 独立作用域,关联外部的模型对象
  546 + },
  547 + controllerAs: "$saSelectCtrl",
  548 + bindToController: true,
  549 + controller: function($scope) {
  550 + var self = this;
  551 + self.$$data = []; // 内部关联的数据
  552 + },
  553 + /**
  554 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  555 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  556 + * @param tElem
  557 + * @param tAttrs
  558 + * @returns {{pre: Function, post: Function}}
  559 + */
  560 + compile: function(tElem, tAttrs) {
  561 + // 1、获取此阶段使用的属性
  562 + var $required_attr = tAttrs["required"]; // 用于和表单验证连接,指定成required="true"才有效。
  563 +
  564 + // 2、处理属性
  565 +
  566 + // 确定是否使用angularjs required验证
  567 + // 属性 required
  568 + // 如果没有填写,内部不添加验证,如果填写了,并且等于true添加验证,否则不添加
  569 + if ($required_attr) {
  570 + if ($required_attr == "true") {
  571 + // 添加required属性指令
  572 + tElem.find("ui-select").attr("required", "");
  573 + } else {
  574 + // 不等于true,不添加required属性指令
  575 + }
  576 + } else {
  577 + // 不添加required属性指令
  578 + }
  579 +
  580 + //console.log("saSelect" + ":compile = >" + tElem.html());
  581 +
  582 + return {
  583 + pre: function(scope, element, attr) {
  584 + // TODO:
  585 + },
  586 + /**
  587 + * 相当于link函数。
  588 + *
  589 + * 重要属性如下:
  590 + * model 是绑定外部值。
  591 + * dicgroup 字典组的类型
  592 + * name input name属性值
  593 + */
  594 + post: function(scope, element, attr) {
  595 + // 1、获取此阶段使用的属性
  596 + var $name_attr = attr["name"]; // 表单验证时需要的名字
  597 + var $type_attr = attr["type"]; // 关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加
  598 + var $modelcolname1_attr = attr["modelcolname1"]; // 关联的模型字段名字1(一般应该是编码字段)
  599 + var $modelcolname2_attr = attr["modelcolname2"]; // 关联的模型字段名字2(一般应该是名字字段)
  600 + var $datacolname1_attr = attr["datacolname1"]; // 内部数据对应的字段名字1(与模型字段1对应)
  601 + var $datacolname2_attr = attr["datacolname2"]; // 内部数据对应的字段名字2(与模型字段2对应)
  602 + var $showcolname_attr = attr["showcolname"]; // 下拉框显示的内部数据字段名
  603 + var $placeholder_attr = attr["placeholder"]; // select placeholder字符串描述
  604 +
  605 + // 2、处理属性、转换成$saSelectCtrl内部使用的属性
  606 + if ($name_attr) {
  607 + scope["$saSelectCtrl"].$name_attr = $name_attr;
  608 + }
  609 + if ($placeholder_attr) {
  610 + scope["$saSelectCtrl"].$placeholder_attr = $placeholder_attr;
  611 + }
  612 + if ($showcolname_attr) {
  613 + scope["$saSelectCtrl"].$showcolname_attr = $showcolname_attr;
  614 + }
  615 +
  616 + // 2-1、添加内部方法,根据type值,改变$$data的值
  617 + scope["$saSelectCtrl"].$$internal_data_change_fn = function() {
  618 + // 根据type属性动态载入数据
  619 + if ($type_attr) {
  620 + $$searchInfoService_g[$type_attr].list(
  621 + {type: "all"},
  622 + function(result) {
  623 + scope["$saSelectCtrl"].$$data = [];
  624 + for (var i = 0; i < result.length; i ++) {
  625 + var data = {}; // data是result的一部分属性集合,根据配置来确定
  626 + if ($datacolname1_attr) {
  627 + data[$datacolname1_attr] = result[i][$datacolname1_attr];
  628 + }
  629 + if ($datacolname2_attr) {
  630 + data[$datacolname2_attr] = result[i][$datacolname2_attr];
  631 + }
  632 + if ($showcolname_attr) {
  633 + // 动态添加基于名字的拼音
  634 + data[$showcolname_attr] = result[i][$showcolname_attr];
  635 + if (data[$showcolname_attr]) {
  636 + data["fullChars"] = pinyin.getFullChars(result[i][$showcolname_attr]).toUpperCase(); // 全拼
  637 + data["camelChars"] = pinyin.getCamelChars(result[i][$showcolname_attr]); // 简拼
  638 + }
  639 + }
  640 + if (data["fullChars"])
  641 + scope["$saSelectCtrl"].$$data.push(data);
  642 + }
  643 + },
  644 + function(result) {
  645 +
  646 + }
  647 + );
  648 + }
  649 + };
  650 +
  651 + // 3、选择、删除事件映射模型和内部数据对应的字段
  652 + scope["$saSelectCtrl"].$select_fn_attr = function($item) {
  653 + if ($modelcolname1_attr && $datacolname1_attr) {
  654 + scope["$saSelectCtrl"].model[$modelcolname1_attr] = $item[$datacolname1_attr];
  655 + }
  656 + if ($modelcolname2_attr && $datacolname2_attr) {
  657 + scope["$saSelectCtrl"].model[$modelcolname2_attr] = $item[$datacolname2_attr];
  658 + }
  659 + };
  660 + scope["$saSelectCtrl"].$remove_fn_attr = function() {
  661 + if ($modelcolname1_attr) {
  662 + scope["$saSelectCtrl"].model[$modelcolname1_attr] = null;
  663 + }
  664 + if ($modelcolname2_attr) {
  665 + scope["$saSelectCtrl"].model[$modelcolname2_attr] = null;
  666 + }
  667 + scope["$saSelectCtrl"].$$cmodel = null; // 内部模型清空
  668 +
  669 + scope["$saSelectCtrl"].$$internal_data_change_fn();
  670 + };
  671 +
  672 + // 4、搜索事件
  673 + scope["$saSelectCtrl"].$refreshdata_fn_attr = function($search) {
  674 + //var fullChars = pinyin.getFullChars($search).toUpperCase();
  675 + //var camelChars = pinyin.getCamelChars($search);
  676 + //
  677 + //console.log(fullChars + " " + camelChars);
  678 + // TODO:事件暂时没用,放着以后再说
  679 + };
  680 +
  681 + // 5、全部载入后,输入的
  682 + $timeout(function() {
  683 + // 创建内部使用的绑定对象,用于确认选中那个值
  684 + scope["$saSelectCtrl"].$$cmodel = scope["$saSelectCtrl"].model[$modelcolname1_attr];
  685 +
  686 + scope["$saSelectCtrl"].$$internal_data_change_fn();
  687 + }, 0);
  688 + }
  689 + }
  690 + }
  691 + };
  692 + }
  693 +]);
  694 +
  695 +/**
  696 + * saSelect3指令
  697 + * 属性如下:
  698 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  699 + * name(必须):控件的名字
  700 + * placeholder(可选):占位符字符串
  701 + * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}
  702 + * dcname(必须):绑定的model字段名,如:dcname=xl.id
  703 + * icname(必须):内部与之对应的字段名,如:icname=code
  704 + * dcname2(可选):其他需要赋值的model字段名2,如:dcname2=xl.name
  705 + * icname2(可选):内部与之对应的字段名2,如:icname2=name
  706 + * dcname3(可选):其他需要赋值的model字段名3,如:dcname2=xl.name
  707 + * icname3(可选):内部与之对应的字段名3,如:icname2=name
  708 + * icnames(必须):用于用于显示,以及简评处理的内部数据字段,如:icnames=name
  709 + * required(可选):是否要用required验证
  710 + * datatype(必须):业务数据类型,有字典类型,动态数据类型,暂时写的死点
  711 + * mlp(可选):是否多级属性(这里假设外部model如果多级,内部model也是多级)
  712 + *
  713 + * 高级属性:
  714 + * dataassociate(可选):数据源是否关联属性(内部数据随外部指定的参数变化而变化)
  715 + * dataparam(可选):数据源关联的外部参数对象
  716 + *
  717 + */
  718 +angular.module('ScheduleApp').directive("saSelect3", [
  719 + '$timeout',
  720 + '$$SearchInfoService_g',
  721 + function($timeout, $$searchInfoService_g) {
  722 + return {
  723 + restrict: 'E',
  724 + templateUrl: '/pages/scheduleApp/module/common/dt/MyUiSelectWrapTemplate1.html',
  725 + scope: {
  726 + model: "=" // 独立作用域,关联外部的模型object
  727 + },
  728 + controllerAs: "$saSelectCtrl",
  729 + bindToController: true,
  730 + controller: function($scope) {
  731 + var self = this;
  732 + self.$$data = []; // ui-select显示用的数据源
  733 + self.$$data_real= []; // 内部真实的数据源
  734 + },
  735 +
  736 + /**
  737 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  738 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  739 + * @param tElem
  740 + * @param tAttrs
  741 + * @returns {{pre: Function, post: Function}}
  742 + */
  743 + compile: function(tElem, tAttrs) {
  744 + // 获取所有的属性
  745 + var $name_attr = tAttrs["name"]; // 控件的名字
  746 + var $placeholder_attr = tAttrs["placeholder"]; // 占位符的名字
  747 + var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名
  748 + var $icname_attr = tAttrs["icname"]; // 内部与之对应的字段名
  749 + var $dcname2_attr = tAttrs["dcname2"]; // 其他需要赋值的model字段名2
  750 + var $icname2_attr = tAttrs["icname2"]; // 内部与之对应的字段名2
  751 + var $dcname3_attr = tAttrs["dcname3"]; // 其他需要赋值的model字段名3
  752 + var $icname3_attr = tAttrs["icname3"]; // 内部与之对应的字段名3
  753 +
  754 + var $icname_s_attr = tAttrs["icnames"]; // 用于用于显示,以及简评处理的内部数据字段
  755 + var $datatype_attr = tAttrs["datatype"]; // 内部业务数据类型
  756 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  757 + var $mlp_attr = tAttrs["mlp"]; // 是否多级属性
  758 + var $dataassociate_attr = tAttrs["dataassociate"]; // 数据源是否关联属性
  759 +
  760 + // controlAs名字
  761 + var ctrlAs = "$saSelectCtrl";
  762 +
  763 + // 数据源初始化标志
  764 + var $$data_init = false;
  765 + // 如果有required属性,添加angularjs required验证
  766 + if ($required_attr != undefined) {
  767 + tElem.find("ui-select").attr("required", "");
  768 + }
  769 +
  770 + // 由于有的属性是多级的如xl.name,所以要在compile阶段重写属性绑定属性定义
  771 + // 原来的设置:{{$select.selected[$saSelectCtrl.$icname_s]}}
  772 + tElem.find("ui-select-match").html("{{$select.selected" + "." + $icname_s_attr + "}}");
  773 + // 原来的设置:item[$saSelectCtrl.$icname] as item in $saSelectCtrl.$$data
  774 + tElem.find("ui-select-choices").attr("repeat", "item" + "." + $icname_attr + " as item in $saSelectCtrl.$$data");
  775 + // 原来的设置:item[$saSelectCtrl.$icname_s]
  776 + tElem.find("ui-select-choices span").attr("ng-bind", "item" + "." + $icname_s_attr);
  777 + // 原来的设置:{{$saSelectCtrl.$name}}
  778 + tElem.find("ui-select").attr("name", $name_attr);
  779 + // 原来的设置:{{$saSelectCtrl.$placeholder}}
  780 + tElem.find("ui-select-match").attr("placeholder", $placeholder_attr);
  781 +
  782 + return {
  783 + pre: function(scope, element, attr) {
  784 + // TODO:
  785 + },
  786 + /**
  787 + * 相当于link函数。
  788 + * @param scope
  789 + * @param element
  790 + * @param attr
  791 + */
  792 + post: function(scope, element, attr) {
  793 + // 添加选中事件处理函数
  794 + scope[ctrlAs].$$internal_select_fn = function($item) {
  795 + if ($dcname_attr && $icname_attr) {
  796 + if ($mlp_attr) {
  797 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";");
  798 + } else {
  799 + scope[ctrlAs].model[$dcname_attr] = $item[$icname_attr];
  800 + }
  801 + }
  802 + if ($dcname2_attr && $icname2_attr) {
  803 + if ($mlp_attr) {
  804 + eval("scope[ctrlAs].model" + "." + $dcname2_attr + " = $item" + "." + $icname2_attr + ";");
  805 + } else {
  806 + scope[ctrlAs].model[$dcname2_attr] = $item[$icname2_attr];
  807 + }
  808 + }
  809 + if ($dcname3_attr && $icname3_attr) {
  810 + if ($mlp_attr) {
  811 + eval("scope[ctrlAs].model" + "." + $dcname3_attr + " = $item" + "." + $icname3_attr + ";");
  812 + } else {
  813 + scope[ctrlAs].model[$dcname3_attr] = $item[$icname3_attr];
  814 + }
  815 + }
  816 + };
  817 +
  818 + // 删除选中事件处理函数
  819 + scope[ctrlAs].$$internal_remove_fn = function() {
  820 + scope[ctrlAs].$$internalmodel = undefined;
  821 + if ($mlp_attr) {
  822 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;");
  823 + } else {
  824 + scope[ctrlAs].model[$dcname_attr] = undefined;
  825 + }
  826 +
  827 + if ($dcname2_attr) {
  828 + if ($mlp_attr) {
  829 + eval("scope[ctrlAs].model" + "." + $dcname2_attr + " = undefined;");
  830 + } else {
  831 + scope[ctrlAs].model[$dcname2_attr] = undefined;
  832 + }
  833 + }
  834 + if ($dcname3_attr) {
  835 + if ($mlp_attr) {
  836 + eval("scope[ctrlAs].model" + "." + $dcname3_attr + " = undefined;");
  837 + } else {
  838 + scope[ctrlAs].model[$dcname3_attr] = undefined;
  839 + }
  840 + }
  841 + };
  842 +
  843 + /**
  844 + * 内部方法,读取字典数据作为数据源。
  845 + * @param dicgroup 字典类型,如:gsType
  846 + * @param ccol 代码字段名
  847 + * @param ncol 名字字段名
  848 + */
  849 + scope[ctrlAs].$$internal_dic_data = function(dicgroup, ccol, ncol) {
  850 + var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup);
  851 + var dic_key; // 字典key
  852 + // 清空内部数据
  853 + scope[ctrlAs].$$data_real = [];
  854 + for (dic_key in origin_dicgroup) {
  855 + var data = {}; // 重新组合的字典元素对象
  856 + if (dic_key == "true")
  857 + data[ccol] = true;
  858 + else
  859 + data[ccol] = dic_key;
  860 + data[ncol] = origin_dicgroup[dic_key];
  861 + scope[ctrlAs].$$data_real.push(data);
  862 + }
  863 + // 这里直接将$$data_real数据深拷贝到$$data
  864 + angular.copy(scope[ctrlAs].$$data_real, scope[ctrlAs].$$data);
  865 +
  866 + console.log(scope[ctrlAs].$$data);
  867 + };
  868 +
  869 + /**
  870 + * TODO:这个方法有性能问题,result一多就会卡一卡,之后再解决把
  871 + * 内部方法,读取字典数据作为数据源。
  872 + * @param result 原始数据
  873 + * @param dcvalue 传入的关联数据
  874 + */
  875 + scope[ctrlAs].$$internal_other_data = function(result, dcvalue) {
  876 + //console.log("start");
  877 + // 清空内部数据
  878 + scope[ctrlAs].$$data_real = [];
  879 + scope[ctrlAs].$$data = [];
  880 + for (var i = 0; i < result.length; i ++) {
  881 + if ($icname_s_attr) {
  882 + if ($mlp_attr) {
  883 + if (eval("result[i]" + "." + $icname_s_attr)) {
  884 + // 全拼
  885 + result[i]["fullChars"] = pinyin.getFullChars(eval("result[i]" + "." + $icname_s_attr)).toUpperCase();
  886 + // 简拼
  887 + result[i]["camelChars"] = pinyin.getCamelChars(eval("result[i]" + "." + $icname_s_attr));
  888 + }
  889 + } else {
  890 + if (result[i][$icname_s_attr]) {
  891 + // 全拼
  892 + result[i]["fullChars"] = pinyin.getFullChars(result[i][$icname_s_attr]).toUpperCase();
  893 + // 简拼
  894 + result[i]["camelChars"] = pinyin.getCamelChars(result[i][$icname_s_attr]);
  895 + }
  896 + }
  897 + }
  898 +
  899 + if (result[i]["fullChars"]) { // 有拼音的加入数据源
  900 + scope[ctrlAs].$$data_real.push(result[i]);
  901 + }
  902 +
  903 + }
  904 + //console.log("start2");
  905 +
  906 + // 数量太大取前10条记录作为显示
  907 + if (angular.isArray(scope[ctrlAs].$$data_real)) {
  908 + // 先迭代循环查找已经传过来的值
  909 + if (scope[ctrlAs].$$data_real.length > 0) {
  910 + if (dcvalue) {
  911 + for (var j = 0; j < scope[ctrlAs].$$data_real.length; j++) {
  912 + if (scope[ctrlAs].$$data_real[j][$icname_attr] == dcvalue) {
  913 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[j]));
  914 + break;
  915 + }
  916 + }
  917 + }
  918 + }
  919 + // 在插入剩余的数据
  920 + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {
  921 + if (scope[ctrlAs].$$data.length < 10) {
  922 + if ($mlp_attr) {
  923 + if (eval("scope[ctrlAs].$$data_real[k]" + "." + $icname_attr + " != dcvalue")) {
  924 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  925 + }
  926 + } else {
  927 + if (scope[ctrlAs].$$data_real[k][$icname_attr] != dcvalue) {
  928 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  929 + }
  930 + }
  931 + } else {
  932 + break;
  933 + }
  934 + }
  935 + }
  936 +
  937 + //console.log("end");
  938 + };
  939 +
  940 + /**
  941 + * 判定一个对象是否为空对象。
  942 + * @param Obj
  943 + */
  944 + scope[ctrlAs].$$internal_isEmpty_obj = function(obj) {
  945 + console.log(typeof obj);
  946 +
  947 + if (typeof obj === "object" && !(obj instanceof Array)) {
  948 + for (var prop in obj) {
  949 + if (obj.hasOwnProperty(prop)) {
  950 + return false;
  951 + }
  952 + }
  953 + return true;
  954 + } else {
  955 + throw "必须是对象";
  956 + }
  957 + };
  958 +
  959 + // 刷新数据
  960 + scope[ctrlAs].$$internal_refresh_fn = function(search) {
  961 + // 绑定的model字段值,此属性是绑定属性,只能在link阶段获取
  962 + var $dcvalue_attr = attr["dcvalue"];
  963 +
  964 + console.log("刷新数据:" + $dcvalue_attr);
  965 +
  966 + if (!$$data_init) { // 只初始化$$data_real一次,重新载入页面才能重新初始化
  967 + if (dictionaryUtils.getByGroup($datatype_attr)) { // 判定是否字典类型数据源
  968 + scope[ctrlAs].$$internal_dic_data(
  969 + $datatype_attr, $icname_attr, $icname_s_attr);
  970 + if ($dcvalue_attr) {
  971 + scope[ctrlAs].$$internalmodel = $dcvalue_attr;
  972 + }
  973 + } else { // 非字典类型数据源
  974 + if (!$dataassociate_attr) {
  975 + $$searchInfoService_g[$datatype_attr].list(
  976 + {type: "all"},
  977 + function(result) {
  978 + //console.log("ok:" + $datatype_attr);
  979 + scope[ctrlAs].$$internal_other_data(result, $dcvalue_attr);
  980 + //console.log("ok2:" + $datatype_attr);
  981 + if ($dcvalue_attr) {
  982 + scope[ctrlAs].$$internalmodel = $dcvalue_attr;
  983 + }
  984 +
  985 + $$data_init = true;
  986 + },
  987 + function(result) {
  988 +
  989 + }
  990 + );
  991 + }
  992 + }
  993 + }
  994 +
  995 + if ($$data_init) {
  996 + if (search && search != "") { // 有search值
  997 + if (!dictionaryUtils.getByGroup($datatype_attr)) { // 其他数据源
  998 + // 处理search
  999 + console.log("search:" + search);
  1000 +
  1001 + scope[ctrlAs].$$data = [];
  1002 + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {
  1003 + var upTerm = search.toUpperCase();
  1004 + if (scope[ctrlAs].$$data.length < 10) {
  1005 + if (scope[ctrlAs].$$data_real[k].fullChars.indexOf(upTerm) != -1
  1006 + || scope[ctrlAs].$$data_real[k].camelChars.indexOf(upTerm) != -1) {
  1007 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  1008 + }
  1009 + } else {
  1010 + break;
  1011 + }
  1012 + }
  1013 + }
  1014 + }
  1015 +
  1016 + }
  1017 +
  1018 + };
  1019 +
  1020 +
  1021 +
  1022 +
  1023 +
  1024 +
  1025 +
  1026 +
  1027 +
  1028 +
  1029 + // TODO:
  1030 +
  1031 + // dom全部载入后调用
  1032 + $timeout(function() {
  1033 + console.log("dom全部载入后调用");
  1034 + }, 0);
  1035 + // 监控dcvalue model值变换
  1036 + attr.$observe("dcvalue", function(value) {
  1037 + console.log("监控dc1 model值变换:" + value);
  1038 + scope[ctrlAs].$$internalmodel = value;
  1039 + }
  1040 + );
  1041 + // 监控获取数据参数变换
  1042 + attr.$observe("dataparam", function(value) {
  1043 + // 判定是否空对象
  1044 + console.log(value);
  1045 + var obj = JSON.parse(value);
  1046 + var $dcvalue_attr = attr["dcvalue"];
  1047 + if (!scope[ctrlAs].$$internal_isEmpty_obj(obj)) {
  1048 + console.log("dataparam:" + obj);
  1049 +
  1050 + //
  1051 +
  1052 + obj["type"] = "all";
  1053 +
  1054 + $$data_init = false;
  1055 + $$searchInfoService_g[$datatype_attr].list(
  1056 + obj,
  1057 + function(result) {
  1058 + //console.log("ok:" + $datatype_attr);
  1059 + scope[ctrlAs].$$internal_other_data(result, $dcvalue_attr);
  1060 + //console.log("ok2:" + $datatype_attr);
  1061 + if ($dcvalue_attr) {
  1062 + scope[ctrlAs].$$internalmodel = $dcvalue_attr;
  1063 + }
  1064 +
  1065 + $$data_init = true;
  1066 + },
  1067 + function(result) {
  1068 +
  1069 + }
  1070 + );
  1071 + }
  1072 + }
  1073 + );
  1074 + }
  1075 + };
  1076 + }
  1077 + };
  1078 +
  1079 + }
  1080 +]);
  1081 +
  1082 +/**
  1083 + * saCheckboxgroup指令
  1084 + * 属性如下:
  1085 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  1086 + * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}
  1087 + * dcname(必须):绑定的model字段名,如:dcname=xl.id
  1088 + * name(必须):控件的名字
  1089 + * required(可选):是否要用required验证
  1090 + * disabled(可选):标示框是否可选
  1091 + *
  1092 + */
  1093 +angular.module('ScheduleApp').directive('saCheckboxgroup', [
  1094 + function() {
  1095 + return {
  1096 + restrict: 'E',
  1097 + templateUrl: '/pages/scheduleApp/module/common/dt/MyCheckboxGroupWrapTemplate.html',
  1098 + scope: {
  1099 + model: "=" // 独立作用域,关联外部的模型object
  1100 + },
  1101 + controllerAs: "$saCheckboxgroupCtrl",
  1102 + bindToController: true,
  1103 + controller: function($scope) {
  1104 + var self = this;
  1105 + self.$$data = []; // 内部的数据
  1106 +
  1107 + // TODO:数据写死,周一至周日选择数据,以后有别的数据再议
  1108 + self.$$data = [
  1109 + {name: "星期一", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1110 + {name: "星期二", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1111 + {name: "星期三", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1112 + {name: "星期四", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1113 + {name: "星期五", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1114 + {name: "星期六", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1115 + {name: "星期日", checkedvalue: "1", uncheckedvalue: "0", ischecked: false}
  1116 + ];
  1117 + },
  1118 +
  1119 + /**
  1120 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  1121 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  1122 + * @param tElem
  1123 + * @param tAttrs
  1124 + * @returns {{pre: Function, post: Function}}
  1125 + */
  1126 + compile: function(tElem, tAttrs) {
  1127 + // 获取所有的属性
  1128 + var $name_attr = tAttrs["name"]; // 控件的名字
  1129 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  1130 + var $disabled_attr = tAttrs["disabled"]; // 是否禁用
  1131 + var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名
  1132 +
  1133 + // controlAs名字
  1134 + var ctrlAs = '$saCheckboxgroupCtrl';
  1135 +
  1136 + // 如果有required属性,添加angularjs required验证
  1137 + if ($required_attr != undefined) {
  1138 + //console.log(tElem.html());
  1139 + tElem.find("div").attr("required", "");
  1140 + }
  1141 + // 如果有disabled属性,添加禁用标志
  1142 + if ($disabled_attr != undefined) {
  1143 + tElem.find("input").attr("ng-disabled", "true");
  1144 + }
  1145 +
  1146 + return {
  1147 + pre: function(scope, element, attr) {
  1148 + // TODO:
  1149 + },
  1150 + /**
  1151 + * 相当于link函数。
  1152 + * @param scope
  1153 + * @param element
  1154 + * @param attr
  1155 + */
  1156 + post: function(scope, element, attr) {
  1157 + // name属性
  1158 + if ($name_attr) {
  1159 + scope[ctrlAs]["$name_attr"] = $name_attr;
  1160 + }
  1161 +
  1162 + /**
  1163 + * checkbox选择事件处理函数。
  1164 + * @param $d 数据对象,$$data中的元素对象
  1165 + */
  1166 + scope[ctrlAs].$$internal_updateCheck_fn = function($d) {
  1167 + $d.ischecked = !$d.ischecked;
  1168 + console.log($d);
  1169 + };
  1170 +
  1171 + // 测试使用watch监控$$data的变化
  1172 + scope.$watch(
  1173 + function() {
  1174 + return scope[ctrlAs]["$$data"];
  1175 + },
  1176 + function(newValue, oldValue) {
  1177 + // 根据$$data生成对应的数据
  1178 + var rule_days_arr = [];
  1179 + var i;
  1180 + for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {
  1181 + if (scope[ctrlAs]["$$data"][i].ischecked)
  1182 + rule_days_arr.push(scope[ctrlAs]["$$data"][i].checkedvalue);
  1183 + else
  1184 + rule_days_arr.push(scope[ctrlAs]["$$data"][i].uncheckedvalue);
  1185 + }
  1186 + scope[ctrlAs].$$internalmodel = rule_days_arr.join(",");
  1187 + //scope[ctrlAs].$$internalmodel = undefined;
  1188 + console.log("bbbbbbbb--->" + scope[ctrlAs].$$internalmodel);
  1189 +
  1190 + // 更新model
  1191 + if ($dcname_attr) {
  1192 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = rule_days_arr.join(',');");
  1193 + }
  1194 +
  1195 +
  1196 + },
  1197 + true
  1198 + );
  1199 +
  1200 + // TODO:
  1201 +
  1202 + // 监控dcvalue model值变换
  1203 + attr.$observe("dcvalue", function(value) {
  1204 + console.log("saCheckboxgroup 监控dc1 model值变换:" + value);
  1205 + if (value) {
  1206 + // 根据value值,修改$$data里的值
  1207 + var data_array = value.split(",");
  1208 + var i;
  1209 + if (data_array.length > scope[ctrlAs]["$$data"].length) {
  1210 + for (i = 0; i < scope[ctrlAs]["$$data"].length; i ++) {
  1211 + if (data_array[i] == scope[ctrlAs]["$$data"][i].checkedvalue) {
  1212 + scope[ctrlAs]["$$data"][i].ischecked = true;
  1213 + } else {
  1214 + scope[ctrlAs]["$$data"][i].ischecked = false;
  1215 + }
  1216 + }
  1217 + } else {
  1218 + for (i = 0; i < data_array.length; i ++) {
  1219 + if (data_array[i] == scope[ctrlAs]["$$data"][i].checkedvalue) {
  1220 + scope[ctrlAs]["$$data"][i].ischecked = true;
  1221 + } else {
  1222 + scope[ctrlAs]["$$data"][i].ischecked = false;
  1223 + }
  1224 + }
  1225 + }
  1226 +
  1227 + }
  1228 + });
  1229 + }
  1230 +
  1231 + };
  1232 +
  1233 +
  1234 + }
  1235 +
  1236 + };
  1237 + }
  1238 +]);
  1239 +
  1240 +/**
  1241 + * saDategroup指令
  1242 + * 属性如下:
  1243 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  1244 + * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}
  1245 + * dcname(必须):绑定的model字段名,如:dcname=xl.id
  1246 + * name(必须):控件的名字
  1247 + * required(可选):是否要用required验证
  1248 + * disabled(可选):标示框是否可选
  1249 + *
  1250 + */
  1251 +angular.module('ScheduleApp').directive('saDategroup', [
  1252 + '$filter',
  1253 + function($filter) {
  1254 + return {
  1255 + restrict: 'E',
  1256 + templateUrl: '/pages/scheduleApp/module/common/dt/MyDateGroupWrapTemplate.html',
  1257 + scope: {
  1258 + model: "=" // 独立作用域,关联外部的模型object
  1259 + },
  1260 + controllerAs: "$saDategroupCtrl",
  1261 + bindToController: true,
  1262 + controller: function($scope) {
  1263 + var self = this;
  1264 + self.$$data = []; // 内部的数据
  1265 + self.$$date_select; // 内部选中的日期
  1266 +
  1267 + //// 测试数据
  1268 + //self.$$data = [
  1269 + // {datestr: '2011-01-01', ischecked: true},
  1270 + // {datestr: '2011-01-01', ischecked: true},
  1271 + // {datestr: '2011-01-01', ischecked: true}
  1272 + //];
  1273 + },
  1274 +
  1275 + /**
  1276 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  1277 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  1278 + * @param tElem
  1279 + * @param tAttrs
  1280 + * @returns {{pre: Function, post: Function}}
  1281 + */
  1282 + compile: function(tElem, tAttrs) {
  1283 + // 获取所有的属性
  1284 + var $name_attr = tAttrs["name"]; // 控件的名字
  1285 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  1286 + var $disabled_attr = tAttrs["disabled"]; // 是否禁用
  1287 + var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名
  1288 +
  1289 + // controlAs名字
  1290 + var ctrlAs = '$saDategroupCtrl';
  1291 +
  1292 + // 如果有required属性,添加angularjs required验证
  1293 + if ($required_attr != undefined) {
  1294 + //console.log(tElem.html());
  1295 + tElem.find("div").attr("required", "");
  1296 + }
  1297 + // 如果有disabled属性,添加禁用标志
  1298 + if ($disabled_attr != undefined) {
  1299 + tElem.find("input").attr("ng-disabled", "true");
  1300 + tElem.find("div").attr("ng-disabled", "true");
  1301 + }
  1302 +
  1303 + return {
  1304 + pre: function (scope, element, attr) {
  1305 + // TODO:
  1306 + },
  1307 + /**
  1308 + * 相当于link函数。
  1309 + * @param scope
  1310 + * @param element
  1311 + * @param attr
  1312 + */
  1313 + post: function (scope, element, attr) {
  1314 + // name属性
  1315 + if ($name_attr) {
  1316 + scope[ctrlAs]["$name_attr"] = $name_attr;
  1317 + }
  1318 +
  1319 +
  1320 + // 日期open属性,及方法
  1321 + scope[ctrlAs].$$specialDateOpen = false;
  1322 + scope[ctrlAs].$$specialDate_open = function() {
  1323 + scope[ctrlAs].$$specialDateOpen = true;
  1324 + };
  1325 +
  1326 + // 监控选择的日期
  1327 + scope.$watch(
  1328 + function() {
  1329 + return scope[ctrlAs]['$$date_select'];
  1330 + },
  1331 + function(newValue, oldValue) {
  1332 + if (newValue) {
  1333 + //console.log("saDategroup--->selectdate:" + newValue);
  1334 + // 调用内置filter,转换日期到yyyy-MM-dd格式
  1335 + var text = $filter('date')(newValue, 'yyyy-MM-dd');
  1336 + var i;
  1337 + var isexist = false; // 日期是否已经选择标识
  1338 + for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {
  1339 + if (scope[ctrlAs]["$$data"][i].datestr == text) {
  1340 + isexist = true;
  1341 + break;
  1342 + }
  1343 + }
  1344 + if (!isexist) {
  1345 + scope[ctrlAs]["$$data"].push(
  1346 + {
  1347 + datestr: text,
  1348 + ischecked: true
  1349 + }
  1350 + );
  1351 + }
  1352 +
  1353 + }
  1354 +
  1355 + }
  1356 + );
  1357 +
  1358 + /**
  1359 + * 日期点击事件处理函数。
  1360 + * @param $index 索引
  1361 + */
  1362 + scope[ctrlAs].$$internal_datestr_click = function($index) {
  1363 + scope[ctrlAs].$$data.splice($index, 1);
  1364 + };
  1365 +
  1366 + // 测试使用watch监控$$data的变化
  1367 + scope.$watch(
  1368 + function() {
  1369 + return scope[ctrlAs]['$$data'];
  1370 + },
  1371 + function(newValue, oldValue) {
  1372 + // 根据$$data生成对应的数据
  1373 + var special_days_arr = [];
  1374 + var i;
  1375 + for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {
  1376 + special_days_arr.push(scope[ctrlAs]["$$data"][i].datestr);
  1377 + }
  1378 +
  1379 + scope[ctrlAs].$$internalmodel = special_days_arr.join(",");
  1380 + console.log("bbbbbbbb--->" + scope[ctrlAs].$$internalmodel);
  1381 +
  1382 + // 更新model
  1383 + if ($dcname_attr) {
  1384 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = special_days_arr.join(',');");
  1385 + }
  1386 + },
  1387 + true
  1388 + );
  1389 +
  1390 + // 监控dcvalue model值变换
  1391 + attr.$observe("dcvalue", function(value) {
  1392 + console.log("saDategroup 监控dc1 model值变换:" + value);
  1393 + if (value) {
  1394 + // 根据value值,修改$$data里的值
  1395 + var date_array = value.split(",");
  1396 + var i;
  1397 + scope[ctrlAs]["$$data"] = [];
  1398 + for (i = 0; i < date_array.length; i++) {
  1399 + scope[ctrlAs]["$$data"].push(
  1400 + {
  1401 + datestr: date_array[i],
  1402 + ischecked: true
  1403 + }
  1404 + );
  1405 + }
  1406 +
  1407 +
  1408 +
  1409 +
  1410 +
  1411 +
  1412 +
  1413 +
  1414 +
  1415 + }
  1416 + });
  1417 +
  1418 + }
  1419 +
  1420 + };
  1421 + }
  1422 + }
  1423 + }
  1424 +]);
  1425 +
  1426 +/**
  1427 + * saGuideboardgroup指令
  1428 + * 属性如下:
  1429 + * name(必须):控件的名字
  1430 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  1431 + * xlidvalue(必须):绑定的model线路id值,如:xlidvalue={{ctrl.employeeInfoForSave.xl.id}}
  1432 + * lprangevalue(必须):绑定的model路牌名字范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}
  1433 + * lprangename(必须):绑定的model路牌名字范围字段名,如:lprangename=lprange
  1434 + * lpidrangevalue(必须):绑定的model路牌id范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}
  1435 + * lpidrangename(必须):绑定的model路牌id范围字段名,如:lprangename=lprange
  1436 + * lpstartvalue(必须):绑定的model起始路牌值,如:lpstartvalue={{ctrl.employeeInfoForSave.lpstart}}
  1437 + * lpstartname(必须):绑定的model起始路牌字段名,如:lpstartname=lpstart
  1438 + *
  1439 + * required(可选):是否要用required验证
  1440 + *
  1441 + */
  1442 +angular.module('ScheduleApp').directive('saGuideboardgroup', [
  1443 + 'GuideboardManageService_g',
  1444 + function(guideboardManageService_g) {
  1445 + return {
  1446 + restrict: 'E',
  1447 + templateUrl: '/pages/scheduleApp/module/common/dt/MyGuideboardGroupWrapTemplate.html',
  1448 + scope: {
  1449 + model: "=" // 独立作用域,关联外部的模型object
  1450 + },
  1451 + controllerAs: '$saGuideboardgroupCtrl',
  1452 + bindToController: true,
  1453 + controller: function($scope) {
  1454 + var self = this;
  1455 + self.$$data = []; // 选择线路后,该线路的路牌数据
  1456 +
  1457 + // 测试数据
  1458 + //self.$$data = [
  1459 + // {lpid: 1, lpname: '路1', isstart: false},
  1460 + // {lpid: 2, lpname: '路2', isstart: true},
  1461 + // {lpid: 3, lpname: '路3', isstart: false}
  1462 + //];
  1463 +
  1464 +
  1465 + self.$$dataSelected = []; // 选中的路牌列表
  1466 + self.$$dataSelectedStart = undefined; // 起始路牌
  1467 +
  1468 + //self.$$dataSelected = [
  1469 + // {lpid: 11, lpname: '路11', isstart: false},
  1470 + // {lpid: 12, lpname: '路12', isstart: true},
  1471 + // {lpid: 13, lpname: '路13', isstart: false}
  1472 + //];
  1473 +
  1474 + // saGuideboardgroup组件的ng-model,用于外部绑定等操作
  1475 + self.$$internalmodel = undefined;
  1476 +
  1477 + self.$$data_init = false; // *数据源初始化标志
  1478 + self.$$data_xl_first_init = false; // 线路是否初始化
  1479 + self.$$data_lp_first_init = false; // 路牌名字是否初始化
  1480 + self.$$data_lpid_first_init = false; // 路牌id是否初始化
  1481 + self.$$data_lpstart_first_init = false; // 起始路牌是否初始化
  1482 +
  1483 + self.$$dataDesc = ""; // 路牌列表描述
  1484 + self.$$dataSelectDesc = ""; // 选中路牌描述
  1485 +
  1486 + },
  1487 +
  1488 + /**
  1489 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  1490 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  1491 + * @param tElem
  1492 + * @param tAttrs
  1493 + * @returns {{pre: Function, post: Function}}
  1494 + */
  1495 + compile: function(tElem, tAttrs) {
  1496 + // TODO:获取所有的属性
  1497 + var $name_attr = tAttrs["name"]; // 控件的名字
  1498 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  1499 + var $lprangename_attr = tAttrs["lprangename"]; // 绑定的model路牌名字范围字段名
  1500 + var $lpidrangename_attr = tAttrs["lpidrangename"]; // 绑定的model路牌id范围字段名
  1501 + var $lpstartname_attr = tAttrs["lpstartname"]; // 绑定的model起始路牌字段名
  1502 +
  1503 + // controlAs名字
  1504 + var ctrlAs = '$saGuideboardgroupCtrl';
  1505 +
  1506 + // 如果有required属性,添加angularjs required验证
  1507 + if ($required_attr != undefined) {
  1508 + //console.log(tElem.html());
  1509 + tElem.find("div").attr("required", "");
  1510 + }
  1511 +
  1512 + return {
  1513 + pre: function(scope, element, attr) {
  1514 + // TODO:
  1515 + },
  1516 +
  1517 + /**
  1518 + * 相当于link函数。
  1519 + * @param scope
  1520 + * @param element
  1521 + * @param attr
  1522 + */
  1523 + post: function(scope, element, attr) {
  1524 + // name属性
  1525 + if ($name_attr) {
  1526 + scope[ctrlAs]["$name_attr"] = $name_attr;
  1527 + }
  1528 +
  1529 + // TODO:
  1530 +
  1531 +
  1532 + /**
  1533 + * 路牌列表点击(路牌列表中选中路牌)
  1534 + * @param $index
  1535 + */
  1536 + scope[ctrlAs].$$internal_lplist_click = function($index) {
  1537 + var data_temp = scope[ctrlAs].$$data;
  1538 + if (data_temp && data_temp.length > $index) {
  1539 + scope[ctrlAs].$$dataSelected.push({
  1540 + lpid: data_temp[$index].lpid,
  1541 + lpname: data_temp[$index].lpname,
  1542 + isstart: data_temp[$index].isstart
  1543 + });
  1544 +
  1545 + // 如果没有指定过初始路牌,默认选择此路牌作为起始路牌
  1546 + if (scope[ctrlAs].$$dataSelectedStart == undefined) {
  1547 + scope[ctrlAs].$$internal_sellplist_click(
  1548 + scope[ctrlAs].$$dataSelected.length - 1);
  1549 + }
  1550 + }
  1551 + };
  1552 + /**
  1553 + * 选中的路牌单击(初始路牌选择)
  1554 + * @param $index
  1555 + */
  1556 + scope[ctrlAs].$$internal_sellplist_click = function($index) {
  1557 + var data_temp = scope[ctrlAs].$$dataSelected;
  1558 + if (data_temp && data_temp.length > $index) {
  1559 + for (var i = 0; i < data_temp.length; i++) {
  1560 + data_temp[i].isstart = false;
  1561 + }
  1562 + data_temp[$index].isstart = true;
  1563 + scope[ctrlAs].$$dataSelectedStart = $index;
  1564 + }
  1565 + };
  1566 + /**
  1567 + * 选中的路牌双击(删除选中的路牌)
  1568 + * @param $index
  1569 + */
  1570 + scope[ctrlAs].$$internal_sellplist_dbclick = function($index) {
  1571 + var data_temp = scope[ctrlAs].$$dataSelected;
  1572 + if (data_temp && data_temp.length > $index) {
  1573 + if (scope[ctrlAs].$$dataSelectedStart == $index) {
  1574 + scope[ctrlAs].$$dataSelectedStart = undefined;
  1575 + }
  1576 + data_temp.splice($index, 1);
  1577 + }
  1578 + };
  1579 +
  1580 +
  1581 + /**
  1582 + * 验证内部数据,更新外部model
  1583 + */
  1584 + scope[ctrlAs].$$internal_validate_model = function() {
  1585 + var data_temp = scope[ctrlAs].$$dataSelected;
  1586 + var data_temp2 = scope[ctrlAs].$$dataSelectedStart;
  1587 + var lpNames = [];
  1588 + var lpIds = [];
  1589 + var lpStart = 0;
  1590 + var i = 0;
  1591 +
  1592 + if (data_temp &&
  1593 + data_temp.length > 0 &&
  1594 + data_temp2 != undefined) {
  1595 +
  1596 + for (i = 0; i < data_temp.length; i++) {
  1597 + lpNames.push(data_temp[i].lpname);
  1598 + lpIds.push(data_temp[i].lpid)
  1599 + }
  1600 + data_temp[data_temp2].isstart = true;
  1601 + lpStart = data_temp2 + 1;
  1602 +
  1603 + // 更新内部model,用于外部验证
  1604 + // 内部model的值暂时随意,以后再改
  1605 + scope[ctrlAs].$$internalmodel = {desc: "ok"};
  1606 +
  1607 + // 更新外部model字段
  1608 + if ($lprangename_attr) {
  1609 + console.log("lprangename=" + lpNames.join(','));
  1610 + eval("scope[ctrlAs].model" + "." + $lprangename_attr + " = lpNames.join(',');");
  1611 + }
  1612 + if ($lpidrangename_attr) {
  1613 + console.log("lpidrangename=" + lpIds.join(','));
  1614 + eval("scope[ctrlAs].model" + "." + $lpidrangename_attr + " = lpIds.join(',');");
  1615 + }
  1616 + if ($lpstartname_attr) {
  1617 + console.log("lpstartname=" + lpStart);
  1618 + eval("scope[ctrlAs].model" + "." + $lpstartname_attr + " = lpStart;");
  1619 + }
  1620 +
  1621 + scope[ctrlAs].$$dataSelectDesc =
  1622 + ",共" + data_temp.length + "个," + "初始路牌,第" + lpStart + "个";
  1623 +
  1624 + } else {
  1625 + scope[ctrlAs].$$internalmodel = undefined;
  1626 + }
  1627 +
  1628 +
  1629 + };
  1630 +
  1631 + // 监控内部数据,$$data_selected 变化
  1632 + scope.$watch(
  1633 + function() {
  1634 + return scope[ctrlAs].$$dataSelected;
  1635 + },
  1636 + function(newValue, oldValue) {
  1637 + scope[ctrlAs].$$internal_validate_model();
  1638 + },
  1639 + true
  1640 + );
  1641 +
  1642 + // 监控内部数据,$$data_selected_start 变化
  1643 + scope.$watch(
  1644 + function() {
  1645 + return scope[ctrlAs].$$dataSelectedStart;
  1646 + },
  1647 + function(newValue, oldValue) {
  1648 + scope[ctrlAs].$$internal_validate_model();
  1649 + },
  1650 + true
  1651 + );
  1652 +
  1653 + /**
  1654 + * 验证数据是否初始化完成,
  1655 + * 所谓的初始化就是内部所有的数据被有效设定过一次。
  1656 + */
  1657 + scope[ctrlAs].$$internal_validate_init = function() {
  1658 + var self = scope[ctrlAs];
  1659 +
  1660 + if (self.$$data_xl_first_init &&
  1661 + self.$$data_lp_first_init &&
  1662 + self.$$data_lpid_first_init &&
  1663 + self.$$data_lpstart_first_init) {
  1664 + console.log("数据初始化完毕!");
  1665 + self.$$data_init = true;
  1666 + }
  1667 +
  1668 + };
  1669 +
  1670 + // 监控初始化标志,线路,路牌,路牌id,起始路牌
  1671 + scope.$watch(
  1672 + function() {
  1673 + return scope[ctrlAs].$$data_xl_first_init;
  1674 + },
  1675 + function(newValue, oldValue) {
  1676 + scope[ctrlAs].$$internal_validate_init();
  1677 + }
  1678 + );
  1679 + scope.$watch(
  1680 + function() {
  1681 + return scope[ctrlAs].$$data_lp_first_init;
  1682 + },
  1683 + function(newValue, oldValue) {
  1684 + scope[ctrlAs].$$internal_validate_init();
  1685 + }
  1686 + );
  1687 + scope.$watch(
  1688 + function() {
  1689 + return scope[ctrlAs].$$data_lpid_first_init;
  1690 + },
  1691 + function(newValue, oldValue) {
  1692 + scope[ctrlAs].$$internal_validate_init();
  1693 + }
  1694 + );
  1695 + scope.$watch(
  1696 + function() {
  1697 + return scope[ctrlAs].$$data_lpstart_first_init;
  1698 + },
  1699 + function(newValue, oldValue) {
  1700 + scope[ctrlAs].$$internal_validate_init();
  1701 + }
  1702 + );
  1703 +
  1704 +
  1705 + // 监控线路id的变化
  1706 + attr.$observe("xlidvalue", function(value) {
  1707 + if (value && value != "") {
  1708 + console.log("xlidvalue=" + value);
  1709 +
  1710 + guideboardManageService_g.rest.list(
  1711 + {"xl.id_eq": value, size: 100},
  1712 + function(result) {
  1713 + // 获取值了
  1714 + console.log("路牌获取了");
  1715 +
  1716 + scope[ctrlAs].$$data = [];
  1717 + for (var i = 0; i < result.content.length; i++) {
  1718 + scope[ctrlAs].$$data.push({
  1719 + lpid: result.content[i].id,
  1720 + lpname: result.content[i].lpName,
  1721 + isstart: false
  1722 + });
  1723 + }
  1724 + if (scope[ctrlAs].$$data_init) {
  1725 + scope[ctrlAs].$$dataSelected = [];
  1726 + scope[ctrlAs].$$dataSelectedStart = undefined;
  1727 + scope[ctrlAs].$$internalmodel = undefined;
  1728 + scope[ctrlAs].$$dataDesc = "";
  1729 + scope[ctrlAs].$$dataSelectDesc = "";
  1730 + }
  1731 + scope[ctrlAs].$$data_xl_first_init = true;
  1732 +
  1733 + scope[ctrlAs].$$dataDesc = ",共" + result.content.length + "个";
  1734 + },
  1735 + function(result) {
  1736 +
  1737 + }
  1738 + );
  1739 +
  1740 + }
  1741 + });
  1742 +
  1743 + // 监控路牌名称范围值的变化
  1744 + attr.$observe("lprangevalue", function(value) {
  1745 + if (value && value != "") {
  1746 + var data_temp = scope[ctrlAs].$$dataSelected;
  1747 + var lpnames = value.split(",");
  1748 + var i = 0;
  1749 + if (data_temp && data_temp.length == 0) { // 初始创建
  1750 + console.log("lprangevalue变换了");
  1751 + for (i = 0; i < lpnames.length; i++) {
  1752 + scope[ctrlAs].$$dataSelected.push({
  1753 + lpname: lpnames[i],
  1754 + isstart: false
  1755 + });
  1756 + }
  1757 + } else {
  1758 + for (i = 0; i < lpnames.length; i++) {
  1759 + data_temp[i].lpname = lpnames[i];
  1760 + }
  1761 + }
  1762 + scope[ctrlAs].$$data_lp_first_init = true;
  1763 + }
  1764 + });
  1765 +
  1766 + // 监控路牌id范围值的变化
  1767 + attr.$observe("lpidrangevalue", function(value) {
  1768 + if (value && value != "") {
  1769 + console.log("lpidrangevalue=" + value);
  1770 + var data_temp = scope[ctrlAs].$$dataSelected;
  1771 + var lpids = value.split(",");
  1772 + var i = 0;
  1773 + if (data_temp && data_temp.length == 0) { // 初始创建
  1774 + console.log("lpidrangevalue");
  1775 + for (i = 0; i < lpids.length; i++) {
  1776 + scope[ctrlAs].$$dataSelected.push({
  1777 + lpid: lpids[i],
  1778 + isstart: false
  1779 + });
  1780 + }
  1781 + } else {
  1782 + for (i = 0; i < lpids.length; i++) {
  1783 + data_temp[i].lpid = lpids[i];
  1784 + }
  1785 + }
  1786 + scope[ctrlAs].$$data_lpid_first_init = true;
  1787 + }
  1788 + });
  1789 +
  1790 + // 监控起始路牌的变化
  1791 + attr.$observe("lpstartvalue", function(value) {
  1792 + if (value && value != "") {
  1793 + scope[ctrlAs].$$dataSelectedStart = value - 1;
  1794 + scope[ctrlAs].$$data_lpstart_first_init = true;
  1795 + }
  1796 + });
  1797 +
  1798 +
  1799 +
  1800 + }
  1801 + }
  1802 +
  1803 + }
  1804 + }
  1805 + }
  1806 +]);
  1807 +
  1808 +/**
  1809 + * saEmployeegroup指令
  1810 + * 属性如下:
  1811 + * name(必须):控件的名字
  1812 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  1813 + * xlidvalue(必须):绑定的model线路id值,如:xlidvalue={{ctrl.employeeInfoForSave.xl.id}}
  1814 + * dbbmrangevalue(必须):绑定的model搭班编码范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}
  1815 + * dbbmrangename(必须):绑定的model搭班编码范围字段名,如:lprangename=lprange
  1816 + * rycidrangevalue(必须):绑定的model人员配置idid范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}
  1817 + * rycidrangename(必须):绑定的model人员配置id范围字段名,如:lprangename=lprange
  1818 + * rystartvalue(必须):绑定的model起始人员,如:lpstartvalue={{ctrl.employeeInfoForSave.lpstart}}
  1819 + * rystartname(必须):绑定的model起始人员字段名,如:lpstartname=lpstart
  1820 + *
  1821 + * required(可选):是否要用required验证
  1822 + *
  1823 + */
  1824 +angular.module('ScheduleApp').directive('saEmployeegroup', [
  1825 + 'EmployeeConfigService_g',
  1826 + function(employeeConfigService_g) {
  1827 + return {
  1828 + restrict: 'E',
  1829 + templateUrl: '/pages/scheduleApp/module/common/dt/MyEmployeeGroupWrapTemplate.html',
  1830 + scope: {
  1831 + model: "=" // 独立作用域,关联外部的模型object
  1832 + },
  1833 + controllerAs: '$saEmployeegroupCtrl',
  1834 + bindToController: true,
  1835 + controller: function($scope) {
  1836 + var self = this;
  1837 + self.$$data = []; // 选择线路后,该线路的人员配置数据
  1838 +
  1839 + // 测试数据
  1840 + //self.$$data = [
  1841 + // {id: 1, dbbm: "1", jsy: '忍1', spy: '守1', isstart: false},
  1842 + // {id: 2, dbbm: "2", jsy: '忍2', spy: '守2', isstart: true},
  1843 + // {id: 3, dbbm: "3", jsy: '忍3', spy: '守3', isstart: false}
  1844 + //];
  1845 +
  1846 +
  1847 + self.$$dataSelected = []; // 选中的人员配置列表
  1848 + self.$$dataSelectedStart = undefined; // 起始人员配置
  1849 +
  1850 + // saGuideboardgroup组件的ng-model,用于外部绑定等操作
  1851 + self.$$internalmodel = undefined;
  1852 +
  1853 + self.$$data_init = false; // *数据源初始化标志
  1854 + self.$$data_xl_first_init = false; // 线路是否初始化
  1855 + self.$$data_ry_first_init = false; // 人员配置是否初始化
  1856 + self.$$data_rycid_first_init = false; // 人员配置id是否初始化
  1857 + self.$$data_rystart_first_init = false; // 起始人员是否初始化
  1858 +
  1859 + self.$$dataDesc = ""; // 路牌列表描述
  1860 + self.$$dataSelectDesc = ""; // 选中路牌描述
  1861 +
  1862 + },
  1863 +
  1864 + /**
  1865 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  1866 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  1867 + * @param tElem
  1868 + * @param tAttrs
  1869 + * @returns {{pre: Function, post: Function}}
  1870 + */
  1871 + compile: function(tElem, tAttrs) {
  1872 + // TODO:获取所有的属性
  1873 + var $name_attr = tAttrs["name"]; // 控件的名字
  1874 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  1875 + var $dbbmrangename_attr = tAttrs["dbbmrangename"]; // 绑定的model搭班编码范围字段名
  1876 + var rycidrangename_attr = tAttrs["rycidrangename"]; // 绑定的model人员配置id范围字段名
  1877 + var $rystartname_attr = tAttrs["rystartname"]; // 绑定的model起始人员字段名
  1878 +
  1879 + // controlAs名字
  1880 + var ctrlAs = '$saEmployeegroupCtrl';
  1881 +
  1882 + // 如果有required属性,添加angularjs required验证
  1883 + if ($required_attr != undefined) {
  1884 + //console.log(tElem.html());
  1885 + tElem.find("div").attr("required", "");
  1886 + }
  1887 +
  1888 + return {
  1889 + pre: function(scope, element, attr) {
  1890 + // TODO:
  1891 + },
  1892 +
  1893 + /**
  1894 + * 相当于link函数。
  1895 + * @param scope
  1896 + * @param element
  1897 + * @param attr
  1898 + */
  1899 + post: function(scope, element, attr) {
  1900 + // name属性
  1901 + if ($name_attr) {
  1902 + scope[ctrlAs]["$name_attr"] = $name_attr;
  1903 + }
  1904 +
  1905 + // TODO:
  1906 +
  1907 +
  1908 + /**
  1909 + * 人员配置列表点击(人员配置列表中选中路牌)
  1910 + * @param $index
  1911 + */
  1912 + scope[ctrlAs].$$internal_rylist_click = function($index) {
  1913 + var data_temp = scope[ctrlAs].$$data;
  1914 + if (data_temp && data_temp.length > $index) {
  1915 + scope[ctrlAs].$$dataSelected.push({
  1916 + id : data_temp[$index].id,
  1917 + dbbm: data_temp[$index].dbbm,
  1918 + jsy: data_temp[$index].jsy,
  1919 + spy: data_temp[$index].spy,
  1920 + isstart: data_temp[$index].isstart
  1921 + });
  1922 +
  1923 + // 如果没有指定过初始人员,默认选择此人员作为起始人员
  1924 + if (scope[ctrlAs].$$dataSelectedStart == undefined) {
  1925 + scope[ctrlAs].$$internal_selrylist_click(
  1926 + scope[ctrlAs].$$dataSelected.length - 1);
  1927 + }
  1928 + }
  1929 + };
  1930 + /**
  1931 + * 选中的人员单击(初始人员选择)
  1932 + * @param $index
  1933 + */
  1934 + scope[ctrlAs].$$internal_selrylist_click = function($index) {
  1935 + var data_temp = scope[ctrlAs].$$dataSelected;
  1936 + if (data_temp && data_temp.length > $index) {
  1937 + for (var i = 0; i < data_temp.length; i++) {
  1938 + data_temp[i].isstart = false;
  1939 + }
  1940 + data_temp[$index].isstart = true;
  1941 + scope[ctrlAs].$$dataSelectedStart = $index;
  1942 + }
  1943 + };
  1944 + /**
  1945 + * 选中的人员双击(删除选中的人员)
  1946 + * @param $index
  1947 + */
  1948 + scope[ctrlAs].$$internal_selrylist_dbclick = function($index) {
  1949 + var data_temp = scope[ctrlAs].$$dataSelected;
  1950 + if (data_temp && data_temp.length > $index) {
  1951 + if (scope[ctrlAs].$$dataSelectedStart == $index) {
  1952 + scope[ctrlAs].$$dataSelectedStart = undefined;
  1953 + }
  1954 + data_temp.splice($index, 1);
  1955 + }
  1956 + };
  1957 +
  1958 +
  1959 + /**
  1960 + * 验证内部数据,更新外部model
  1961 + */
  1962 + scope[ctrlAs].$$internal_validate_model = function() {
  1963 + var data_temp = scope[ctrlAs].$$dataSelected;
  1964 + var data_temp2 = scope[ctrlAs].$$dataSelectedStart;
  1965 + var ryDbbms = [];
  1966 + var ryCids = [];
  1967 + var ryStart = 0;
  1968 + var i = 0;
  1969 +
  1970 + if (data_temp &&
  1971 + data_temp.length > 0 &&
  1972 + data_temp2 != undefined) {
  1973 +
  1974 + for (i = 0; i < data_temp.length; i++) {
  1975 + ryDbbms.push(data_temp[i].dbbm);
  1976 + ryCids.push(data_temp[i].id);
  1977 + }
  1978 + data_temp[data_temp2].isstart = true;
  1979 + ryStart = data_temp2 + 1;
  1980 +
  1981 + // 更新内部model,用于外部验证
  1982 + // 内部model的值暂时随意,以后再改
  1983 + scope[ctrlAs].$$internalmodel = {desc: "ok"};
  1984 +
  1985 + // 更新外部model字段
  1986 + if ($dbbmrangename_attr) {
  1987 + console.log("dbbmrangename=" + ryDbbms.join(','));
  1988 + eval("scope[ctrlAs].model" + "." + $dbbmrangename_attr + " = ryDbbms.join(',');");
  1989 + }
  1990 + if (rycidrangename_attr) {
  1991 + console.log("rycidrangename=" + ryCids.join(','));
  1992 + eval("scope[ctrlAs].model" + "." + rycidrangename_attr + " = ryCids.join(',');");
  1993 + }
  1994 + if ($rystartname_attr) {
  1995 + console.log("rystartname=" + ryStart);
  1996 + eval("scope[ctrlAs].model" + "." + $rystartname_attr + " = ryStart;");
  1997 + }
  1998 +
  1999 + scope[ctrlAs].$$dataSelectDesc =
  2000 + ",共" + data_temp.length + "组," + "初始人员,第" + ryStart + "组";
  2001 +
  2002 + } else {
  2003 + scope[ctrlAs].$$internalmodel = undefined;
  2004 + }
  2005 +
  2006 +
  2007 + };
  2008 +
  2009 + // 监控内部数据,$$data_selected 变化
  2010 + scope.$watch(
  2011 + function() {
  2012 + return scope[ctrlAs].$$dataSelected;
  2013 + },
  2014 + function(newValue, oldValue) {
  2015 + scope[ctrlAs].$$internal_validate_model();
  2016 + },
  2017 + true
  2018 + );
  2019 +
  2020 + // 监控内部数据,$$data_selected_start 变化
  2021 + scope.$watch(
  2022 + function() {
  2023 + return scope[ctrlAs].$$dataSelectedStart;
  2024 + },
  2025 + function(newValue, oldValue) {
  2026 + scope[ctrlAs].$$internal_validate_model();
  2027 + },
  2028 + true
  2029 + );
  2030 +
  2031 + /**
  2032 + * 验证数据是否初始化完成,
  2033 + * 所谓的初始化就是内部所有的数据被有效设定过一次。
  2034 + */
  2035 + scope[ctrlAs].$$internal_validate_init = function() {
  2036 + var self = scope[ctrlAs];
  2037 + var data_temp = self.$$data;
  2038 + var dataSelect_temp = self.$$dataSelected;
  2039 + var i = 0;
  2040 + var j = 0;
  2041 +
  2042 + if (self.$$data_xl_first_init &&
  2043 + self.$$data_ry_first_init &&
  2044 + self.$$data_rycid_first_init &&
  2045 + self.$$data_rystart_first_init) {
  2046 + console.log("数据初始化完毕!");
  2047 + self.$$data_init = true;
  2048 +
  2049 + // 修正选择dataSelect
  2050 + for (i = 0; i < dataSelect_temp.length; i++) {
  2051 + for (j = 0; j < data_temp.length; j++) {
  2052 + if (dataSelect_temp[i].dbbm == data_temp[j].dbbm) {
  2053 + dataSelect_temp[i].jsy = data_temp[j].jsy;
  2054 + dataSelect_temp[i].spy = data_temp[j].spy;
  2055 + break;
  2056 + }
  2057 + }
  2058 + }
  2059 + }
  2060 +
  2061 + };
  2062 +
  2063 + // 监控初始化标志,线路,人员,起始人员
  2064 + scope.$watch(
  2065 + function() {
  2066 + return scope[ctrlAs].$$data_xl_first_init;
  2067 + },
  2068 + function(newValue, oldValue) {
  2069 + scope[ctrlAs].$$internal_validate_init();
  2070 + }
  2071 + );
  2072 + scope.$watch(
  2073 + function() {
  2074 + return scope[ctrlAs].$$data_ry_first_init;
  2075 + },
  2076 + function(newValue, oldValue) {
  2077 + scope[ctrlAs].$$internal_validate_init();
  2078 + }
  2079 + );
  2080 + scope.$watch(
  2081 + function() {
  2082 + return scope[ctrlAs].$$data_rycid_first_init;
  2083 + },
  2084 + function(newValue, oldValue) {
  2085 + scope[ctrlAs].$$internal_validate_init();
  2086 + }
  2087 + );
  2088 + scope.$watch(
  2089 + function() {
  2090 + return scope[ctrlAs].$$data_rystart_first_init;
  2091 + },
  2092 + function(newValue, oldValue) {
  2093 + scope[ctrlAs].$$internal_validate_init();
  2094 + }
  2095 + );
  2096 +
  2097 +
  2098 + // 监控线路id的变化
  2099 + attr.$observe("xlidvalue", function(value) {
  2100 + if (value && value != "") {
  2101 + console.log("xlidvalue=" + value);
  2102 +
  2103 + employeeConfigService_g.rest.list(
  2104 + {"xl.id_eq": value, size: 100},
  2105 + function(result) {
  2106 + // 获取值了
  2107 + console.log("人员配置获取了");
  2108 +
  2109 + scope[ctrlAs].$$data = [];
  2110 + for (var i = 0; i < result.content.length; i++) {
  2111 + scope[ctrlAs].$$data.push({
  2112 + id: result.content[i].id,
  2113 + dbbm: result.content[i].dbbm,
  2114 + jsy: result.content[i].jsy.personnelName,
  2115 + spy: result.content[i].spy == null ? "" : result.content[i].spy.personnelName,
  2116 + isstart: false
  2117 + });
  2118 + }
  2119 + if (scope[ctrlAs].$$data_init) {
  2120 + scope[ctrlAs].$$dataSelected = [];
  2121 + scope[ctrlAs].$$dataSelectedStart = undefined;
  2122 + scope[ctrlAs].$$internalmodel = undefined;
  2123 + scope[ctrlAs].$$dataDesc = "";
  2124 + scope[ctrlAs].$$dataSelectDesc = "";
  2125 + }
  2126 + scope[ctrlAs].$$data_xl_first_init = true;
  2127 +
  2128 + scope[ctrlAs].$$dataDesc = ",共" + result.content.length + "组";
  2129 + },
  2130 + function(result) {
  2131 +
  2132 + }
  2133 + );
  2134 +
  2135 + }
  2136 + });
  2137 +
  2138 + // 监控搭班编码范围值的变化
  2139 + attr.$observe("dbbmrangevalue", function(value) {
  2140 + if (value && value != "") {
  2141 + var data_temp = scope[ctrlAs].$$dataSelected;
  2142 + var dbbmnames = value.split(",");
  2143 + var i = 0;
  2144 + if (data_temp && data_temp.length == 0) { // 初始创建
  2145 + console.log("dbbmrangevalue变换了");
  2146 + for (i = 0; i < dbbmnames.length; i++) {
  2147 + scope[ctrlAs].$$dataSelected.push({
  2148 + dbbm: dbbmnames[i],
  2149 + isstart: false
  2150 + });
  2151 + }
  2152 + } else {
  2153 + for (i = 0; i < dbbmnames.length; i++) {
  2154 + data_temp[i].dbbm = dbbmnames[i];
  2155 + }
  2156 + }
  2157 + scope[ctrlAs].$$data_ry_first_init = true;
  2158 + }
  2159 + });
  2160 +
  2161 + // 监控人员配置id范围值的变化
  2162 + attr.$observe("rycidrangevalue", function(value) {
  2163 + if (value && value != "") {
  2164 + var data_temp = scope[ctrlAs].$$dataSelected;
  2165 + var rycids = value.split(",");
  2166 + var i = 0;
  2167 + if (data_temp && data_temp.length == 0) { // 初始创建
  2168 + console.log("rycidrangevalue变换了");
  2169 + for (i = 0; i < rycids.length; i++) {
  2170 + scope[ctrlAs].$$dataSelected.push({
  2171 + id: rycids[i],
  2172 + isstart: false
  2173 + });
  2174 + }
  2175 + } else {
  2176 + for (i = 0; i < rycids.length; i++) {
  2177 + data_temp[i].id = rycids[i];
  2178 + }
  2179 + }
  2180 + scope[ctrlAs].$$data_rycid_first_init = true;
  2181 + }
  2182 + });
  2183 +
  2184 + // 监控起始人员的变化
  2185 + attr.$observe("rystartvalue", function(value) {
  2186 + if (value && value != "") {
  2187 + scope[ctrlAs].$$dataSelectedStart = value - 1;
  2188 + scope[ctrlAs].$$data_rystart_first_init = true;
  2189 + }
  2190 + });
  2191 +
  2192 +
  2193 +
  2194 + }
  2195 + }
  2196 +
  2197 + }
  2198 + }
  2199 + }
  2200 +]);
  2201 +
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
1 -// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用  
2 -  
3 -// 文件下载服务  
4 -angular.module('ScheduleApp').factory('FileDownload_g', function() {  
5 - return {  
6 - downloadFile: function (data, mimeType, fileName) {  
7 - var success = false;  
8 - var blob = new Blob([data], { type: mimeType });  
9 - try {  
10 - if (navigator.msSaveBlob)  
11 - navigator.msSaveBlob(blob, fileName);  
12 - else {  
13 - // Try using other saveBlob implementations, if available  
14 - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;  
15 - if (saveBlob === undefined) throw "Not supported";  
16 - saveBlob(blob, fileName);  
17 - }  
18 - success = true;  
19 - } catch (ex) {  
20 - console.log("saveBlob method failed with the following exception:");  
21 - console.log(ex);  
22 - }  
23 -  
24 - if (!success) {  
25 - // Get the blob url creator  
26 - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;  
27 - if (urlCreator) {  
28 - // Try to use a download link  
29 - var link = document.createElement('a');  
30 - if ('download' in link) {  
31 - // Try to simulate a click  
32 - try {  
33 - // Prepare a blob URL  
34 - var url = urlCreator.createObjectURL(blob);  
35 - link.setAttribute('href', url);  
36 -  
37 - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)  
38 - link.setAttribute("download", fileName);  
39 -  
40 - // Simulate clicking the download link  
41 - var event = document.createEvent('MouseEvents');  
42 - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);  
43 - link.dispatchEvent(event);  
44 - success = true;  
45 -  
46 - } catch (ex) {  
47 - console.log("Download link method with simulated click failed with the following exception:");  
48 - console.log(ex);  
49 - }  
50 - }  
51 -  
52 - if (!success) {  
53 - // Fallback to window.location method  
54 - try {  
55 - // Prepare a blob URL  
56 - // Use application/octet-stream when using window.location to force download  
57 - var url = urlCreator.createObjectURL(blob);  
58 - window.location = url;  
59 - console.log("Download link method with window.location succeeded");  
60 - success = true;  
61 - } catch (ex) {  
62 - console.log("Download link method with window.location failed with the following exception:");  
63 - console.log(ex);  
64 - }  
65 - }  
66 - }  
67 - }  
68 -  
69 - if (!success) {  
70 - // Fallback to window.open method  
71 - console.log("No methods worked for saving the arraybuffer, using last resort window.open");  
72 - window.open("", '_blank', '');  
73 - }  
74 - }  
75 - };  
76 -});  
77 -  
78 -// 车辆信息service  
79 -angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) {  
80 - return {  
81 - rest: $resource(  
82 - '/cars/:id',  
83 - {order: 'carCode', direction: 'ASC', id: '@id_route'},  
84 - {  
85 - list: {  
86 - method: 'GET',  
87 - params: {  
88 - page: 0  
89 - }  
90 - },  
91 - get: {  
92 - method: 'GET'  
93 - },  
94 - save: {  
95 - method: 'POST'  
96 - }  
97 - }  
98 - ),  
99 - validate: $resource(  
100 - '/cars/validate/:type',  
101 - {},  
102 - {  
103 - insideCode: {  
104 - method: 'GET'  
105 - }  
106 - }  
107 - ),  
108 - dataTools: $resource(  
109 - '/cars/:type',  
110 - {},  
111 - {  
112 - dataExport: {  
113 - method: 'GET',  
114 - responseType: "arraybuffer",  
115 - params: {  
116 - type: "dataExport"  
117 - },  
118 - transformResponse: function(data, headers){  
119 - return {data : data};  
120 - }  
121 - }  
122 - }  
123 - )  
124 - };  
125 -}]);  
126 -// 人员信息service  
127 -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {  
128 - return {  
129 - rest : $resource(  
130 - '/personnel/:id',  
131 - {order: 'jobCode', direction: 'ASC', id: '@id_route'},  
132 - {  
133 - list: {  
134 - method: 'GET',  
135 - params: {  
136 - page: 0  
137 - }  
138 - },  
139 - get: {  
140 - method: 'GET'  
141 - },  
142 - save: {  
143 - method: 'POST'  
144 - }  
145 - }  
146 - ),  
147 - validate: $resource(  
148 - '/personnel/validate/:type',  
149 - {},  
150 - {  
151 - jobCode: {  
152 - method: 'GET'  
153 - }  
154 - }  
155 - ),  
156 - dataTools: $resource(  
157 - '/personnel/:type',  
158 - {},  
159 - {  
160 - dataExport: {  
161 - method: 'GET',  
162 - responseType: "arraybuffer",  
163 - params: {  
164 - type: "dataExport"  
165 - },  
166 - transformResponse: function(data, headers){  
167 - return {data : data};  
168 - }  
169 - }  
170 - }  
171 - )  
172 - };  
173 -}]);  
174 -// 车辆设备信息service  
175 -angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {  
176 - return $resource(  
177 - '/carDevice/:id',  
178 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
179 - {  
180 - list: {  
181 - method: 'GET',  
182 - params: {  
183 - page: 0  
184 - }  
185 - },  
186 - get: {  
187 - method: 'GET'  
188 - },  
189 - save: {  
190 - method: 'POST'  
191 - }  
192 - }  
193 - );  
194 -}]);  
195 -  
196 -// 车辆配置service  
197 -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {  
198 - return {  
199 - rest : $resource(  
200 - '/cci/:id',  
201 - {order: 'createDate', direction: 'ASC', id: '@id_route'},  
202 - {  
203 - list: {  
204 - method: 'GET',  
205 - params: {  
206 - page: 0  
207 - }  
208 - },  
209 - get: {  
210 - method: 'GET'  
211 - },  
212 - save: {  
213 - method: 'POST'  
214 - }  
215 - }  
216 - )  
217 - };  
218 -}]);  
219 -  
220 -// 人员配置service  
221 -angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {  
222 - return {  
223 - rest : $resource(  
224 - '/eci/:id',  
225 - {order: 'createDate', direction: 'ASC', id: '@id_route'},  
226 - {  
227 - list: {  
228 - method: 'GET',  
229 - params: {  
230 - page: 0  
231 - }  
232 - },  
233 - get: {  
234 - method: 'GET'  
235 - },  
236 - save: {  
237 - method: 'POST'  
238 - }  
239 - }  
240 - ),  
241 - validate: $resource( // TODO:  
242 - '/personnel/validate/:type',  
243 - {},  
244 - {  
245 - jobCode: {  
246 - method: 'GET'  
247 - }  
248 - }  
249 - )  
250 - };  
251 -}]);  
252 -  
253 -// 路牌管理service  
254 -angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) {  
255 - return {  
256 - rest: $resource(  
257 - '/gic/:id',  
258 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
259 - {  
260 - list: {  
261 - method: 'GET',  
262 - params: {  
263 - page: 0  
264 - }  
265 - },  
266 - get: {  
267 - method: 'GET'  
268 - },  
269 - save: {  
270 - method: 'POST'  
271 - }  
272 - }  
273 - )  
274 - };  
275 -}]);  
276 -  
277 -// 排班管理service  
278 -angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) {  
279 - return {  
280 - rest: $resource(  
281 - '/sr1fc/:id',  
282 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
283 - {  
284 - list: {  
285 - method: 'GET',  
286 - params: {  
287 - page: 0  
288 - }  
289 - },  
290 - get: {  
291 - method: 'GET'  
292 - },  
293 - save: {  
294 - method: 'POST'  
295 - },  
296 - delete: {  
297 - method: 'DELETE'  
298 - }  
299 - }  
300 - )  
301 - };  
302 -}]);  
303 -  
304 -// 时刻表管理service  
305 -angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) {  
306 - return {  
307 - rest: $resource(  
308 - '/tic/:id',  
309 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
310 - {  
311 - list: {  
312 - method: 'GET',  
313 - params: {  
314 - page: 0,  
315 - isCancel_eq: 'false'  
316 - }  
317 - },  
318 - get: {  
319 - method: 'GET'  
320 - },  
321 - save: {  
322 - method: 'POST'  
323 - },  
324 - delete: {  
325 - method: 'DELETE'  
326 - }  
327 - }  
328 - ),  
329 - validate: $resource(  
330 - '/tic/validate/:type',  
331 - {},  
332 - {  
333 - ttinfoname: {  
334 - method: 'GET'  
335 - }  
336 - }  
337 - )  
338 - };  
339 -}]);  
340 -// 时刻表明细管理service  
341 -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {  
342 - return {  
343 - rest: $resource(  
344 - '/tidc/:id',  
345 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
346 - {  
347 - get: {  
348 - method: 'GET'  
349 - },  
350 - save: {  
351 - method: 'POST'  
352 - }  
353 - }  
354 - ),  
355 - edit: $resource(  
356 - '/tidc/edit/:xlid/:ttid',  
357 - {},  
358 - {  
359 - list: {  
360 - method: 'GET'  
361 - }  
362 - }  
363 - )  
364 - };  
365 -}]);  
366 -  
367 -  
368 -  
369 -// 排班计划管理service  
370 -angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) {  
371 - return {  
372 - rest : $resource(  
373 - '/spc/:id',  
374 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
375 - {  
376 - list: {  
377 - method: 'GET',  
378 - params: {  
379 - page: 0  
380 - }  
381 - },  
382 - get: {  
383 - method: 'GET'  
384 - },  
385 - save: {  
386 - method: 'POST'  
387 - },  
388 - delete: {  
389 - method: 'DELETE'  
390 - }  
391 - }  
392 - ),  
393 - tommorw: $resource(  
394 - '/spc/tommorw',  
395 - {},  
396 - {  
397 - list: {  
398 - method: 'GET'  
399 - }  
400 - }  
401 - )  
402 - };  
403 -}]);  
404 -  
405 -// 排班计划明细管理service  
406 -angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) {  
407 - return {  
408 - rest : $resource(  
409 - '/spic/:id',  
410 - {order: 'scheduleDate,lp,fcno', direction: 'ASC', id: '@id_route'},  
411 - {  
412 - list: {  
413 - method: 'GET',  
414 - params: {  
415 - page: 0  
416 - }  
417 - },  
418 - get: {  
419 - method: 'GET'  
420 - },  
421 - save: {  
422 - method: 'POST'  
423 - }  
424 - }  
425 - ),  
426 - groupinfo : $resource(  
427 - '/spic/groupinfos/:xlid/:sdate',  
428 - {},  
429 - {  
430 - list: {  
431 - method: 'GET',  
432 - isArray: true  
433 - }  
434 - }  
435 - ),  
436 - updateGroupInfo : $resource(  
437 - '/spic/groupinfos/update',  
438 - {},  
439 - {  
440 - update: {  
441 - method: 'POST'  
442 - }  
443 - }  
444 - )  
445 - };  
446 -}]);  
447 -  
448 -// 线路运营统计service  
449 -angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {  
450 - return $resource(  
451 - '/bic/:id',  
452 - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询  
453 - {  
454 - list: {  
455 - method: 'GET',  
456 - params: {  
457 - page: 0  
458 - }  
459 - }  
460 - }  
461 - );  
462 -}]);  
463 \ No newline at end of file 1 \ No newline at end of file
  2 +// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用
  3 +
  4 +// 文件下载服务
  5 +angular.module('ScheduleApp').factory('FileDownload_g', function() {
  6 + return {
  7 + downloadFile: function (data, mimeType, fileName) {
  8 + var success = false;
  9 + var blob = new Blob([data], { type: mimeType });
  10 + try {
  11 + if (navigator.msSaveBlob)
  12 + navigator.msSaveBlob(blob, fileName);
  13 + else {
  14 + // Try using other saveBlob implementations, if available
  15 + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
  16 + if (saveBlob === undefined) throw "Not supported";
  17 + saveBlob(blob, fileName);
  18 + }
  19 + success = true;
  20 + } catch (ex) {
  21 + console.log("saveBlob method failed with the following exception:");
  22 + console.log(ex);
  23 + }
  24 +
  25 + if (!success) {
  26 + // Get the blob url creator
  27 + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
  28 + if (urlCreator) {
  29 + // Try to use a download link
  30 + var link = document.createElement('a');
  31 + if ('download' in link) {
  32 + // Try to simulate a click
  33 + try {
  34 + // Prepare a blob URL
  35 + var url = urlCreator.createObjectURL(blob);
  36 + link.setAttribute('href', url);
  37 +
  38 + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
  39 + link.setAttribute("download", fileName);
  40 +
  41 + // Simulate clicking the download link
  42 + var event = document.createEvent('MouseEvents');
  43 + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
  44 + link.dispatchEvent(event);
  45 + success = true;
  46 +
  47 + } catch (ex) {
  48 + console.log("Download link method with simulated click failed with the following exception:");
  49 + console.log(ex);
  50 + }
  51 + }
  52 +
  53 + if (!success) {
  54 + // Fallback to window.location method
  55 + try {
  56 + // Prepare a blob URL
  57 + // Use application/octet-stream when using window.location to force download
  58 + var url = urlCreator.createObjectURL(blob);
  59 + window.location = url;
  60 + console.log("Download link method with window.location succeeded");
  61 + success = true;
  62 + } catch (ex) {
  63 + console.log("Download link method with window.location failed with the following exception:");
  64 + console.log(ex);
  65 + }
  66 + }
  67 + }
  68 + }
  69 +
  70 + if (!success) {
  71 + // Fallback to window.open method
  72 + console.log("No methods worked for saving the arraybuffer, using last resort window.open");
  73 + window.open("", '_blank', '');
  74 + }
  75 + }
  76 + };
  77 +});
  78 +
  79 +// 车辆信息service
  80 +angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) {
  81 + return {
  82 + rest: $resource(
  83 + '/cars/:id',
  84 + {order: 'carCode', direction: 'ASC', id: '@id_route'},
  85 + {
  86 + list: {
  87 + method: 'GET',
  88 + params: {
  89 + page: 0
  90 + }
  91 + },
  92 + get: {
  93 + method: 'GET'
  94 + },
  95 + save: {
  96 + method: 'POST'
  97 + }
  98 + }
  99 + ),
  100 + validate: $resource(
  101 + '/cars/validate/:type',
  102 + {},
  103 + {
  104 + insideCode: {
  105 + method: 'GET'
  106 + }
  107 + }
  108 + ),
  109 + dataTools: $resource(
  110 + '/cars/:type',
  111 + {},
  112 + {
  113 + dataExport: {
  114 + method: 'GET',
  115 + responseType: "arraybuffer",
  116 + params: {
  117 + type: "dataExport"
  118 + },
  119 + transformResponse: function(data, headers){
  120 + return {data : data};
  121 + }
  122 + }
  123 + }
  124 + )
  125 + };
  126 +}]);
  127 +// 人员信息service
  128 +angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {
  129 + return {
  130 + rest : $resource(
  131 + '/personnel/:id',
  132 + {order: 'jobCode', direction: 'ASC', id: '@id_route'},
  133 + {
  134 + list: {
  135 + method: 'GET',
  136 + params: {
  137 + page: 0
  138 + }
  139 + },
  140 + get: {
  141 + method: 'GET'
  142 + },
  143 + save: {
  144 + method: 'POST'
  145 + }
  146 + }
  147 + ),
  148 + validate: $resource(
  149 + '/personnel/validate/:type',
  150 + {},
  151 + {
  152 + jobCode: {
  153 + method: 'GET'
  154 + }
  155 + }
  156 + ),
  157 + dataTools: $resource(
  158 + '/personnel/:type',
  159 + {},
  160 + {
  161 + dataExport: {
  162 + method: 'GET',
  163 + responseType: "arraybuffer",
  164 + params: {
  165 + type: "dataExport"
  166 + },
  167 + transformResponse: function(data, headers){
  168 + return {data : data};
  169 + }
  170 + }
  171 + }
  172 + )
  173 + };
  174 +}]);
  175 +// 车辆设备信息service
  176 +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
  177 + return $resource(
  178 + '/carDevice/:id',
  179 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  180 + {
  181 + list: {
  182 + method: 'GET',
  183 + params: {
  184 + page: 0
  185 + }
  186 + },
  187 + get: {
  188 + method: 'GET'
  189 + },
  190 + save: {
  191 + method: 'POST'
  192 + }
  193 + }
  194 + );
  195 +}]);
  196 +
  197 +// 车辆配置service
  198 +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
  199 + return {
  200 + rest : $resource(
  201 + '/cci/:id',
  202 + {order: 'createDate', direction: 'ASC', id: '@id_route'},
  203 + {
  204 + list: {
  205 + method: 'GET',
  206 + params: {
  207 + page: 0
  208 + }
  209 + },
  210 + get: {
  211 + method: 'GET'
  212 + },
  213 + save: {
  214 + method: 'POST'
  215 + }
  216 + }
  217 + )
  218 + };
  219 +}]);
  220 +
  221 +// 人员配置service
  222 +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {
  223 + return {
  224 + rest : $resource(
  225 + '/eci/:id',
  226 + {order: 'createDate', direction: 'ASC', id: '@id_route'},
  227 + {
  228 + list: {
  229 + method: 'GET',
  230 + params: {
  231 + page: 0
  232 + }
  233 + },
  234 + get: {
  235 + method: 'GET'
  236 + },
  237 + save: {
  238 + method: 'POST'
  239 + }
  240 + }
  241 + ),
  242 + validate: $resource( // TODO:
  243 + '/personnel/validate/:type',
  244 + {},
  245 + {
  246 + jobCode: {
  247 + method: 'GET'
  248 + }
  249 + }
  250 + )
  251 + };
  252 +}]);
  253 +
  254 +// 路牌管理service
  255 +angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) {
  256 + return {
  257 + rest: $resource(
  258 + '/gic/:id',
  259 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  260 + {
  261 + list: {
  262 + method: 'GET',
  263 + params: {
  264 + page: 0
  265 + }
  266 + },
  267 + get: {
  268 + method: 'GET'
  269 + },
  270 + save: {
  271 + method: 'POST'
  272 + }
  273 + }
  274 + )
  275 + };
  276 +}]);
  277 +
  278 +// 排班管理service
  279 +angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) {
  280 + return {
  281 + rest: $resource(
  282 + '/sr1fc/:id',
  283 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  284 + {
  285 + list: {
  286 + method: 'GET',
  287 + params: {
  288 + page: 0
  289 + }
  290 + },
  291 + get: {
  292 + method: 'GET'
  293 + },
  294 + save: {
  295 + method: 'POST'
  296 + },
  297 + delete: {
  298 + method: 'DELETE'
  299 + }
  300 + }
  301 + )
  302 + };
  303 +}]);
  304 +
  305 +// 时刻表管理service
  306 +angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) {
  307 + return {
  308 + rest: $resource(
  309 + '/tic/:id',
  310 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  311 + {
  312 + list: {
  313 + method: 'GET',
  314 + params: {
  315 + page: 0,
  316 + isCancel_eq: 'false'
  317 + }
  318 + },
  319 + get: {
  320 + method: 'GET'
  321 + },
  322 + save: {
  323 + method: 'POST'
  324 + },
  325 + delete: {
  326 + method: 'DELETE'
  327 + }
  328 + }
  329 + ),
  330 + validate: $resource(
  331 + '/tic/validate/:type',
  332 + {},
  333 + {
  334 + ttinfoname: {
  335 + method: 'GET'
  336 + }
  337 + }
  338 + )
  339 + };
  340 +}]);
  341 +// 时刻表明细管理service
  342 +angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {
  343 + return {
  344 + rest: $resource(
  345 + '/tidc/:id',
  346 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  347 + {
  348 + get: {
  349 + method: 'GET'
  350 + },
  351 + save: {
  352 + method: 'POST'
  353 + }
  354 + }
  355 + ),
  356 + edit: $resource(
  357 + '/tidc/edit/:xlid/:ttid',
  358 + {},
  359 + {
  360 + list: {
  361 + method: 'GET'
  362 + }
  363 + }
  364 + )
  365 + };
  366 +}]);
  367 +
  368 +
  369 +
  370 +// 排班计划管理service
  371 +angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) {
  372 + return {
  373 + rest : $resource(
  374 + '/spc/:id',
  375 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  376 + {
  377 + list: {
  378 + method: 'GET',
  379 + params: {
  380 + page: 0
  381 + }
  382 + },
  383 + get: {
  384 + method: 'GET'
  385 + },
  386 + save: {
  387 + method: 'POST'
  388 + },
  389 + delete: {
  390 + method: 'DELETE'
  391 + }
  392 + }
  393 + ),
  394 + tommorw: $resource(
  395 + '/spc/tommorw',
  396 + {},
  397 + {
  398 + list: {
  399 + method: 'GET'
  400 + }
  401 + }
  402 + )
  403 + };
  404 +}]);
  405 +
  406 +// 排班计划明细管理service
  407 +angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) {
  408 + return {
  409 + rest : $resource(
  410 + '/spic/:id',
  411 + {order: 'scheduleDate,lp,fcno', direction: 'ASC', id: '@id_route'},
  412 + {
  413 + list: {
  414 + method: 'GET',
  415 + params: {
  416 + page: 0
  417 + }
  418 + },
  419 + get: {
  420 + method: 'GET'
  421 + },
  422 + save: {
  423 + method: 'POST'
  424 + }
  425 + }
  426 + ),
  427 + groupinfo : $resource(
  428 + '/spic/groupinfos/:xlid/:sdate',
  429 + {},
  430 + {
  431 + list: {
  432 + method: 'GET',
  433 + isArray: true
  434 + }
  435 + }
  436 + ),
  437 + updateGroupInfo : $resource(
  438 + '/spic/groupinfos/update',
  439 + {},
  440 + {
  441 + update: {
  442 + method: 'POST'
  443 + }
  444 + }
  445 + )
  446 + };
  447 +}]);
  448 +
  449 +// 线路运营统计service
  450 +angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {
  451 + return $resource(
  452 + '/bic/:id',
  453 + {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询
  454 + {
  455 + list: {
  456 + method: 'GET',
  457 + params: {
  458 + page: 0
  459 + }
  460 + }
  461 + }
  462 + );
  463 +}]);
  464 +
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
1 -// ui route 配置  
2 -  
3 -/** 配置所有模块页面route */  
4 -ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {  
5 - // 默认路由  
6 - //$urlRouterProvider.otherwise('/busConfig.html');  
7 -  
8 - $stateProvider  
9 - // 车辆基础信息模块配置  
10 - .state("busInfoManage", {  
11 - url: '/busInfoManage',  
12 - views: {  
13 - "": {  
14 - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html'  
15 - },  
16 - "busInfoManage_list@busInfoManage": {  
17 - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html'  
18 - }  
19 - },  
20 -  
21 - resolve: {  
22 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
23 - return $ocLazyLoad.load({  
24 - name: 'busInfoManage_module',  
25 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
26 - files: [  
27 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
28 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
29 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
30 - "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"  
31 - ]  
32 - });  
33 - }]  
34 - }  
35 - })  
36 - .state("busInfoManage_form", {  
37 - url: '/busInfoManage_form',  
38 - views: {  
39 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'}  
40 - },  
41 - resolve: {  
42 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
43 - return $ocLazyLoad.load({  
44 - name: 'busInfoManage_form_module',  
45 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
46 - files: [  
47 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
48 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
49 - "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"  
50 - ]  
51 - });  
52 - }]  
53 - }  
54 - })  
55 - .state("busInfoManage_edit", {  
56 - url: '/busInfoManage_edit/:id',  
57 - views: {  
58 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'}  
59 - },  
60 - resolve: {  
61 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
62 - return $ocLazyLoad.load({  
63 - name: 'busInfoManage_edit_module',  
64 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
65 - files: [  
66 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
67 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
68 - "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"  
69 - ]  
70 - });  
71 - }]  
72 - }  
73 - })  
74 - .state("busInfoManage_detail", {  
75 - url: '/busInfoManage_detail/:id',  
76 - views: {  
77 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'}  
78 - },  
79 - resolve: {  
80 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
81 - return $ocLazyLoad.load({  
82 - name: 'busInfoManage_detail_module',  
83 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
84 - files: [  
85 - "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"  
86 - ]  
87 - });  
88 - }]  
89 - }  
90 - })  
91 -  
92 - // 人员基础信息模块配置  
93 - .state("employeeInfoManage", {  
94 - url: '/employeeInfoManage',  
95 - views: {  
96 - "": {  
97 - templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html'  
98 - },  
99 - "employeeInfoManage_list@employeeInfoManage": {  
100 - templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html'  
101 - }  
102 - },  
103 -  
104 - resolve: {  
105 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
106 - return $ocLazyLoad.load({  
107 - name: 'employeeInfoManage_module',  
108 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
109 - files: [  
110 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
111 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
112 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
113 - "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"  
114 - ]  
115 - });  
116 - }]  
117 - }  
118 - })  
119 - .state("employeeInfoManage_form", {  
120 - url: '/employeeInfoManage_form',  
121 - views: {  
122 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html'}  
123 - },  
124 - resolve: {  
125 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
126 - return $ocLazyLoad.load({  
127 - name: 'employeeInfoManage_form_module',  
128 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
129 - files: [  
130 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
131 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
132 - "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"  
133 - ]  
134 - });  
135 - }]  
136 - }  
137 - })  
138 - .state("employeeInfoManage_edit", {  
139 - url: '/employeeInfoManage_edit/:id',  
140 - views: {  
141 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html'}  
142 - },  
143 - resolve: {  
144 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
145 - return $ocLazyLoad.load({  
146 - name: 'employeeInfoManage_edit_module',  
147 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
148 - files: [  
149 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
150 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
151 - "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"  
152 - ]  
153 - });  
154 - }]  
155 - }  
156 - })  
157 - .state("employeeInfoManage_detail", {  
158 - url: '/employeeInfoManage_detail/:id',  
159 - views: {  
160 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html'}  
161 - },  
162 - resolve: {  
163 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
164 - return $ocLazyLoad.load({  
165 - name: 'employeeInfoManage_detail_module',  
166 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
167 - files: [  
168 - "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"  
169 - ]  
170 - });  
171 - }]  
172 - }  
173 - })  
174 -  
175 - // 车辆设备信息模块配置  
176 - .state("deviceInfoManage", {  
177 - url: '/deviceInfoManage',  
178 - views: {  
179 - "": {  
180 - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html'  
181 - },  
182 - "deviceInfoManage_list@deviceInfoManage": {  
183 - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html'  
184 - }  
185 - },  
186 -  
187 - resolve: {  
188 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
189 - return $ocLazyLoad.load({  
190 - name: 'deviceInfoManage_module',  
191 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
192 - files: [  
193 - "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"  
194 - ]  
195 - });  
196 - }]  
197 - }  
198 - })  
199 - .state("deviceInfoManage_form", {  
200 - url: '/deviceInfoManage_form',  
201 - views: {  
202 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'}  
203 - },  
204 - resolve: {  
205 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
206 - return $ocLazyLoad.load({  
207 - name: 'deviceInfoManage_form_module',  
208 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
209 - files: [  
210 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
211 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
212 - "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"  
213 - ]  
214 - });  
215 - }]  
216 - }  
217 - })  
218 - .state("deviceInfoManage_edit", {  
219 - url: '/deviceInfoManage_edit/:id',  
220 - views: {  
221 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'}  
222 - },  
223 - resolve: {  
224 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
225 - return $ocLazyLoad.load({  
226 - name: 'deviceInfoManage_edit_module',  
227 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
228 - files: [  
229 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
230 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
231 - "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"  
232 - ]  
233 - });  
234 - }]  
235 - }  
236 - })  
237 - .state("deviceInfoManage_detail", {  
238 - url: '/deviceInfoManage_detail/:id',  
239 - views: {  
240 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'}  
241 - },  
242 - resolve: {  
243 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
244 - return $ocLazyLoad.load({  
245 - name: 'deviceInfoManage_detail_module',  
246 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
247 - files: [  
248 - "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"  
249 - ]  
250 - });  
251 - }]  
252 - }  
253 - })  
254 -  
255 - // 车辆配置模块  
256 - .state("busConfig", {  
257 - url: '/busConfig',  
258 - views: {  
259 - "": {  
260 - templateUrl: 'pages/scheduleApp/module/core/busConfig/index.html'  
261 - },  
262 - "busConfig_list@busConfig": {  
263 - templateUrl: 'pages/scheduleApp/module/core/busConfig/list.html'  
264 - }  
265 - },  
266 -  
267 - resolve: {  
268 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
269 - return $ocLazyLoad.load({  
270 - name: 'busConfig_module',  
271 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
272 - files: [  
273 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
274 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
275 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
276 - "pages/scheduleApp/module/core/busConfig/busConfig.js"  
277 - ]  
278 - });  
279 - }]  
280 - }  
281 - })  
282 - .state("busConfig_form", {  
283 - url: '/busConfig_form',  
284 - views: {  
285 - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/form.html'}  
286 - },  
287 - resolve: {  
288 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
289 - return $ocLazyLoad.load({  
290 - name: 'busConfig_form_module',  
291 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
292 - files: [  
293 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
294 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
295 - "pages/scheduleApp/module/core/busConfig/busConfig.js"  
296 - ]  
297 - });  
298 - }]  
299 - }  
300 - })  
301 - .state("busConfig_edit", {  
302 - url: '/busConfig_edit/:id',  
303 - views: {  
304 - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/edit.html'}  
305 - },  
306 - resolve: {  
307 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
308 - return $ocLazyLoad.load({  
309 - name: 'busConfig_edit_module',  
310 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
311 - files: [  
312 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
313 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
314 - "pages/scheduleApp/module/core/busConfig/busConfig.js"  
315 - ]  
316 - });  
317 - }]  
318 - }  
319 - })  
320 - .state("busConfig_detail", {  
321 - url: '/busConfig_detail/:id',  
322 - views: {  
323 - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/detail.html'}  
324 - },  
325 - resolve: {  
326 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
327 - return $ocLazyLoad.load({  
328 - name: 'busConfig_detail_module',  
329 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
330 - files: [  
331 - "pages/scheduleApp/module/core/busConfig/busConfig.js"  
332 - ]  
333 - });  
334 - }]  
335 - }  
336 - })  
337 -  
338 - // 人员配置模块  
339 - .state("employeeConfig", {  
340 - url: '/employeeConfig',  
341 - views: {  
342 - "": {  
343 - templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html'  
344 - },  
345 - "employeeConfig_list@employeeConfig": {  
346 - templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html'  
347 - }  
348 - },  
349 -  
350 - resolve: {  
351 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
352 - return $ocLazyLoad.load({  
353 - name: 'employeeConfig_module',  
354 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
355 - files: [  
356 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
357 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
358 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
359 - "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"  
360 - ]  
361 - });  
362 - }]  
363 - }  
364 - })  
365 - .state("employeeConfig_form", {  
366 - url: '/employeeConfig_form',  
367 - views: {  
368 - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/form.html'}  
369 - },  
370 - resolve: {  
371 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
372 - return $ocLazyLoad.load({  
373 - name: 'employeeConfig_form_module',  
374 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
375 - files: [  
376 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
377 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
378 - "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"  
379 - ]  
380 - });  
381 - }]  
382 - }  
383 - })  
384 - .state("employeeConfig_edit", {  
385 - url: '/employeeConfig_edit/:id',  
386 - views: {  
387 - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/edit.html'}  
388 - },  
389 - resolve: {  
390 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
391 - return $ocLazyLoad.load({  
392 - name: 'employeeConfig_edit_module',  
393 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
394 - files: [  
395 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
396 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
397 - "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"  
398 - ]  
399 - });  
400 - }]  
401 - }  
402 - })  
403 - .state("employeeConfig_detail", {  
404 - url: '/employeeConfig_detail/:id',  
405 - views: {  
406 - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/detail.html'}  
407 - },  
408 - resolve: {  
409 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
410 - return $ocLazyLoad.load({  
411 - name: 'employeeConfig_detail_module',  
412 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
413 - files: [  
414 - "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"  
415 - ]  
416 - });  
417 - }]  
418 - }  
419 - })  
420 -  
421 - // 路牌管理  
422 - .state("guideboardManage", {  
423 - url: '/guideboardManage',  
424 - views: {  
425 - "": {  
426 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'  
427 - },  
428 - "guideboardManage_list@guideboardManage": {  
429 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'  
430 - }  
431 - },  
432 -  
433 - resolve: {  
434 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
435 - return $ocLazyLoad.load({  
436 - name: 'guideboardManage_module',  
437 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
438 - files: [  
439 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
440 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
441 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
442 - "pages/scheduleApp/module/core/guideboardManage/guideboardManage.js"  
443 - ]  
444 - });  
445 - }]  
446 - }  
447 - })  
448 - .state("guideboardManage_detail", {  
449 - url: '/guideboardManage_detail/:id',  
450 - views: {  
451 - "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}  
452 - },  
453 - resolve: {  
454 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
455 - return $ocLazyLoad.load({  
456 - name: 'guideboardManage_detail_module',  
457 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
458 - files: [  
459 - "pages/scheduleApp/module/core/guideboardManage/guideboardManage.js"  
460 - ]  
461 - });  
462 - }]  
463 - }  
464 - })  
465 -  
466 -  
467 - // 时刻表管理  
468 - .state("timeTableManage", {  
469 - url: '/timeTableManage',  
470 - views: {  
471 - "": {  
472 - templateUrl: 'pages/scheduleApp/module/core/timeTableManage/index.html'  
473 - },  
474 - "timeTableManage_list@timeTableManage": {  
475 - templateUrl: 'pages/scheduleApp/module/core/timeTableManage/list.html'  
476 - }  
477 - },  
478 -  
479 - resolve: {  
480 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
481 - return $ocLazyLoad.load({  
482 - name: 'timeTableManage_module',  
483 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
484 - files: [  
485 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
486 - "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"  
487 - ]  
488 - });  
489 - }]  
490 - }  
491 - })  
492 - .state("timeTableManage_form", {  
493 - url: '/timeTableManage_form',  
494 - views: {  
495 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/form.html'}  
496 - },  
497 - resolve: {  
498 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
499 - return $ocLazyLoad.load({  
500 - name: 'timeTableManage_form_module',  
501 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
502 - files: [  
503 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
504 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
505 - "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"  
506 - ]  
507 - });  
508 - }]  
509 - }  
510 - })  
511 - .state("timeTableManage_edit", {  
512 - url: '/timeTableManage_edit/:id',  
513 - views: {  
514 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/edit.html'}  
515 - },  
516 - resolve: {  
517 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
518 - return $ocLazyLoad.load({  
519 - name: 'timeTableManage_edit_module',  
520 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
521 - files: [  
522 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
523 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
524 - "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"  
525 - ]  
526 - });  
527 - }]  
528 - }  
529 - })  
530 - .state("timeTableManage_detail", {  
531 - url: '/timeTableManage_detail/:id',  
532 - views: {  
533 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail.html'}  
534 - },  
535 - resolve: {  
536 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
537 - return $ocLazyLoad.load({  
538 - name: 'timeTableManage_detail_module',  
539 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
540 - files: [  
541 - "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"  
542 - ]  
543 - });  
544 - }]  
545 - }  
546 - })  
547 - .state("timeTableDetailInfoManage", {  
548 - url: '/timeTableDetailInfoManage/:xlid/:ttid/:xlname/:ttname',  
549 - views: {  
550 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info.html'}  
551 - },  
552 - resolve: {  
553 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
554 - return $ocLazyLoad.load({  
555 - name: 'timeTableDetailInfoManage_module',  
556 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
557 - files: [  
558 - "pages/scheduleApp/module/core/timeTableManage/timeTableDetailManage.js"  
559 - ]  
560 - });  
561 - }]  
562 - }  
563 - })  
564 - .state("timeTableDetailInfoManage_detail_edit", {  
565 - url: '/timeTableDetailInfoManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname',  
566 - views: {  
567 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info_edit.html'}  
568 - },  
569 - resolve: {  
570 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
571 - return $ocLazyLoad.load({  
572 - name: 'timeTableDetailInfoManage_module',  
573 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
574 - files: [  
575 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
576 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
577 - "pages/scheduleApp/module/core/timeTableManage/timeTableDetailManage.js"  
578 - ]  
579 - });  
580 - }]  
581 - }  
582 - })  
583 -  
584 - // 排班规则管理模块  
585 - .state("scheduleRuleManage", {  
586 - url: '/scheduleRuleManage',  
587 - views: {  
588 - "": {  
589 - templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/index.html'  
590 - },  
591 - "scheduleRuleManage_list@scheduleRuleManage": {  
592 - templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/list.html'  
593 - }  
594 - },  
595 -  
596 - resolve: {  
597 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
598 - return $ocLazyLoad.load({  
599 - name: 'scheduleRuleManage_module',  
600 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
601 - files: [  
602 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
603 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
604 - "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"  
605 - ]  
606 - });  
607 - }]  
608 - }  
609 - })  
610 - .state("scheduleRuleManage_form", {  
611 - url: '/scheduleRuleManage_form',  
612 - views: {  
613 - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/form.html'}  
614 - },  
615 - resolve: {  
616 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
617 - return $ocLazyLoad.load({  
618 - name: 'scheduleRuleManage_form_module',  
619 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
620 - files: [  
621 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
622 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
623 - "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"  
624 - ]  
625 - });  
626 - }]  
627 - }  
628 - })  
629 - .state("scheduleRuleManage_edit", {  
630 - url: '/scheduleRuleManage_edit/:id',  
631 - views: {  
632 - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/edit.html'}  
633 - },  
634 - resolve: {  
635 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
636 - return $ocLazyLoad.load({  
637 - name: 'scheduleRuleManage_edit_module',  
638 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
639 - files: [  
640 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
641 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
642 - "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"  
643 - ]  
644 - });  
645 - }]  
646 - }  
647 - })  
648 - .state("scheduleRuleManage_detail", {  
649 - url: '/scheduleRuleManage_detail/:id',  
650 - views: {  
651 - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/detail.html'}  
652 - },  
653 - resolve: {  
654 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
655 - return $ocLazyLoad.load({  
656 - name: 'scheduleRuleManage_detail_module',  
657 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
658 - files: [  
659 - "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"  
660 - ]  
661 - });  
662 - }]  
663 - }  
664 - })  
665 -  
666 - // 排班计划管理模块  
667 - .state("schedulePlanManage", {  
668 - url: '/schedulePlanManage',  
669 - views: {  
670 - "": {  
671 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index.html'  
672 - },  
673 - "schedulePlanManage_list@schedulePlanManage": {  
674 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list.html'  
675 - }  
676 - },  
677 -  
678 - resolve: {  
679 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
680 - return $ocLazyLoad.load({  
681 - name: 'schedulePlanManage_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/schedulePlanManage/schedulePlanManage.js"  
687 - ]  
688 - });  
689 - }]  
690 - }  
691 - })  
692 - .state("schedulePlanManage_form", {  
693 - url: '/schedulePlanManage_form',  
694 - views: {  
695 - "": {  
696 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/form.html'  
697 - }  
698 - },  
699 -  
700 - resolve: {  
701 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
702 - return $ocLazyLoad.load({  
703 - name: 'schedulePlanManage_form_module',  
704 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
705 - files: [  
706 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
707 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
708 - "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js"  
709 - ]  
710 - });  
711 - }]  
712 - }  
713 - })  
714 -  
715 - // 排班计划明细管理模块  
716 - .state("schedulePlanInfoManage", {  
717 - url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime',  
718 - views: {  
719 - "": {  
720 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index_info.html'  
721 - },  
722 - "schedulePlanInfoManage_list@schedulePlanInfoManage": {  
723 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list_info.html'  
724 - }  
725 - },  
726 -  
727 - resolve: {  
728 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
729 - return $ocLazyLoad.load({  
730 - name: 'schedulePlanInfoManage_module',  
731 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
732 - files: [  
733 - "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanInfoManage.js"  
734 - ]  
735 - });  
736 - }]  
737 - }  
738 - })  
739 -  
740 - // 排班调度值勤日报模块  
741 - .state("schedulePlanReportManage", {  
742 - url: '/schedulePlanReportManage',  
743 - views: {  
744 - "": {  
745 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index_report.html'  
746 - },  
747 - "schedulePlanReportManage_list@schedulePlanReportManage": {  
748 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list_report.html'  
749 - }  
750 - },  
751 -  
752 - resolve: {  
753 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
754 - return $ocLazyLoad.load({  
755 - name: 'schedulePlanManage_module',  
756 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
757 - files: [  
758 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
759 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
760 - "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js"  
761 - ]  
762 - });  
763 - }]  
764 - }  
765 - })  
766 -  
767 - .state("schedulePlanReportManage_edit", {  
768 - url: '/schedulePlanReportManage_edit',  
769 - params: {type: 0, groupInfo: null},  
770 - views: {  
771 - "": {  
772 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/edit_report.html'  
773 - }  
774 - },  
775 -  
776 - resolve: {  
777 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
778 - return $ocLazyLoad.load({  
779 - name: 'schedulePlanReportManage_edit_module',  
780 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
781 - files: [  
782 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
783 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
784 - "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js"  
785 - ]  
786 - });  
787 - }]  
788 - }  
789 - })  
790 -  
791 - // 线路运营概览模块  
792 - .state("busLineInfoStat", {  
793 - url: '/busLineInfoStat',  
794 - views: {  
795 - "": {  
796 - templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/index.html'  
797 - },  
798 - "busLineInfoStat_list@busLineInfoStat": {  
799 - templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/list.html'  
800 - }  
801 - },  
802 -  
803 - resolve: {  
804 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
805 - return $ocLazyLoad.load({  
806 - name: 'busLineInfoStat_module',  
807 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
808 - files: [  
809 - "pages/scheduleApp/module/core/busLineInfoStat/busLineInfoStat.js"  
810 - ]  
811 - });  
812 - }]  
813 - }  
814 - })  
815 -  
816 -  
817 -  
818 -  
819 -  
820 - // TODO:  
821 -  
822 - ; 1 +// ui route 配置
  2 +
  3 +/** 配置所有模块页面route */
  4 +ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
  5 + // 默认路由
  6 + //$urlRouterProvider.otherwise('/busConfig.html');
  7 +
  8 + $stateProvider
  9 + // 车辆基础信息模块配置
  10 + .state("busInfoManage", {
  11 + url: '/busInfoManage',
  12 + views: {
  13 + "": {
  14 + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html'
  15 + },
  16 + "busInfoManage_list@busInfoManage": {
  17 + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html'
  18 + }
  19 + },
  20 +
  21 + resolve: {
  22 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  23 + return $ocLazyLoad.load({
  24 + name: 'busInfoManage_module',
  25 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  26 + files: [
  27 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  28 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  29 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  30 + "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"
  31 + ]
  32 + });
  33 + }]
  34 + }
  35 + })
  36 + .state("busInfoManage_form", {
  37 + url: '/busInfoManage_form',
  38 + views: {
  39 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'}
  40 + },
  41 + resolve: {
  42 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  43 + return $ocLazyLoad.load({
  44 + name: 'busInfoManage_form_module',
  45 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  46 + files: [
  47 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  48 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  49 + "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"
  50 + ]
  51 + });
  52 + }]
  53 + }
  54 + })
  55 + .state("busInfoManage_edit", {
  56 + url: '/busInfoManage_edit/:id',
  57 + views: {
  58 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'}
  59 + },
  60 + resolve: {
  61 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  62 + return $ocLazyLoad.load({
  63 + name: 'busInfoManage_edit_module',
  64 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  65 + files: [
  66 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  67 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  68 + "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"
  69 + ]
  70 + });
  71 + }]
  72 + }
  73 + })
  74 + .state("busInfoManage_detail", {
  75 + url: '/busInfoManage_detail/:id',
  76 + views: {
  77 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'}
  78 + },
  79 + resolve: {
  80 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  81 + return $ocLazyLoad.load({
  82 + name: 'busInfoManage_detail_module',
  83 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  84 + files: [
  85 + "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"
  86 + ]
  87 + });
  88 + }]
  89 + }
  90 + })
  91 +
  92 + // 人员基础信息模块配置
  93 + .state("employeeInfoManage", {
  94 + url: '/employeeInfoManage',
  95 + views: {
  96 + "": {
  97 + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html'
  98 + },
  99 + "employeeInfoManage_list@employeeInfoManage": {
  100 + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html'
  101 + }
  102 + },
  103 +
  104 + resolve: {
  105 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  106 + return $ocLazyLoad.load({
  107 + name: 'employeeInfoManage_module',
  108 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  109 + files: [
  110 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  111 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  112 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  113 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"
  114 + ]
  115 + });
  116 + }]
  117 + }
  118 + })
  119 + .state("employeeInfoManage_form", {
  120 + url: '/employeeInfoManage_form',
  121 + views: {
  122 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html'}
  123 + },
  124 + resolve: {
  125 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  126 + return $ocLazyLoad.load({
  127 + name: 'employeeInfoManage_form_module',
  128 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  129 + files: [
  130 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  131 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  132 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"
  133 + ]
  134 + });
  135 + }]
  136 + }
  137 + })
  138 + .state("employeeInfoManage_edit", {
  139 + url: '/employeeInfoManage_edit/:id',
  140 + views: {
  141 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html'}
  142 + },
  143 + resolve: {
  144 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  145 + return $ocLazyLoad.load({
  146 + name: 'employeeInfoManage_edit_module',
  147 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  148 + files: [
  149 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  150 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  151 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"
  152 + ]
  153 + });
  154 + }]
  155 + }
  156 + })
  157 + .state("employeeInfoManage_detail", {
  158 + url: '/employeeInfoManage_detail/:id',
  159 + views: {
  160 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html'}
  161 + },
  162 + resolve: {
  163 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  164 + return $ocLazyLoad.load({
  165 + name: 'employeeInfoManage_detail_module',
  166 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  167 + files: [
  168 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"
  169 + ]
  170 + });
  171 + }]
  172 + }
  173 + })
  174 +
  175 + // 车辆设备信息模块配置
  176 + .state("deviceInfoManage", {
  177 + url: '/deviceInfoManage',
  178 + views: {
  179 + "": {
  180 + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html'
  181 + },
  182 + "deviceInfoManage_list@deviceInfoManage": {
  183 + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html'
  184 + }
  185 + },
  186 +
  187 + resolve: {
  188 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  189 + return $ocLazyLoad.load({
  190 + name: 'deviceInfoManage_module',
  191 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  192 + files: [
  193 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  194 + ]
  195 + });
  196 + }]
  197 + }
  198 + })
  199 + .state("deviceInfoManage_form", {
  200 + url: '/deviceInfoManage_form',
  201 + views: {
  202 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'}
  203 + },
  204 + resolve: {
  205 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  206 + return $ocLazyLoad.load({
  207 + name: 'deviceInfoManage_form_module',
  208 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  209 + files: [
  210 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  211 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  212 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  213 + ]
  214 + });
  215 + }]
  216 + }
  217 + })
  218 + .state("deviceInfoManage_edit", {
  219 + url: '/deviceInfoManage_edit/:id',
  220 + views: {
  221 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'}
  222 + },
  223 + resolve: {
  224 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  225 + return $ocLazyLoad.load({
  226 + name: 'deviceInfoManage_edit_module',
  227 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  228 + files: [
  229 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  230 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  231 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  232 + ]
  233 + });
  234 + }]
  235 + }
  236 + })
  237 + .state("deviceInfoManage_detail", {
  238 + url: '/deviceInfoManage_detail/:id',
  239 + views: {
  240 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'}
  241 + },
  242 + resolve: {
  243 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  244 + return $ocLazyLoad.load({
  245 + name: 'deviceInfoManage_detail_module',
  246 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  247 + files: [
  248 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  249 + ]
  250 + });
  251 + }]
  252 + }
  253 + })
  254 +
  255 + // 车辆配置模块
  256 + .state("busConfig", {
  257 + url: '/busConfig',
  258 + views: {
  259 + "": {
  260 + templateUrl: 'pages/scheduleApp/module/core/busConfig/index.html'
  261 + },
  262 + "busConfig_list@busConfig": {
  263 + templateUrl: 'pages/scheduleApp/module/core/busConfig/list.html'
  264 + }
  265 + },
  266 +
  267 + resolve: {
  268 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  269 + return $ocLazyLoad.load({
  270 + name: 'busConfig_module',
  271 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  272 + files: [
  273 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  274 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  275 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  276 + "pages/scheduleApp/module/core/busConfig/busConfig.js"
  277 + ]
  278 + });
  279 + }]
  280 + }
  281 + })
  282 + .state("busConfig_form", {
  283 + url: '/busConfig_form',
  284 + views: {
  285 + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/form.html'}
  286 + },
  287 + resolve: {
  288 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  289 + return $ocLazyLoad.load({
  290 + name: 'busConfig_form_module',
  291 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  292 + files: [
  293 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  294 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  295 + "pages/scheduleApp/module/core/busConfig/busConfig.js"
  296 + ]
  297 + });
  298 + }]
  299 + }
  300 + })
  301 + .state("busConfig_edit", {
  302 + url: '/busConfig_edit/:id',
  303 + views: {
  304 + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/edit.html'}
  305 + },
  306 + resolve: {
  307 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  308 + return $ocLazyLoad.load({
  309 + name: 'busConfig_edit_module',
  310 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  311 + files: [
  312 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  313 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  314 + "pages/scheduleApp/module/core/busConfig/busConfig.js"
  315 + ]
  316 + });
  317 + }]
  318 + }
  319 + })
  320 + .state("busConfig_detail", {
  321 + url: '/busConfig_detail/:id',
  322 + views: {
  323 + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/detail.html'}
  324 + },
  325 + resolve: {
  326 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  327 + return $ocLazyLoad.load({
  328 + name: 'busConfig_detail_module',
  329 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  330 + files: [
  331 + "pages/scheduleApp/module/core/busConfig/busConfig.js"
  332 + ]
  333 + });
  334 + }]
  335 + }
  336 + })
  337 +
  338 + // 人员配置模块
  339 + .state("employeeConfig", {
  340 + url: '/employeeConfig',
  341 + views: {
  342 + "": {
  343 + templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html'
  344 + },
  345 + "employeeConfig_list@employeeConfig": {
  346 + templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html'
  347 + }
  348 + },
  349 +
  350 + resolve: {
  351 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  352 + return $ocLazyLoad.load({
  353 + name: 'employeeConfig_module',
  354 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  355 + files: [
  356 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  357 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  358 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  359 + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"
  360 + ]
  361 + });
  362 + }]
  363 + }
  364 + })
  365 + .state("employeeConfig_form", {
  366 + url: '/employeeConfig_form',
  367 + views: {
  368 + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/form.html'}
  369 + },
  370 + resolve: {
  371 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  372 + return $ocLazyLoad.load({
  373 + name: 'employeeConfig_form_module',
  374 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  375 + files: [
  376 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  377 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  378 + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"
  379 + ]
  380 + });
  381 + }]
  382 + }
  383 + })
  384 + .state("employeeConfig_edit", {
  385 + url: '/employeeConfig_edit/:id',
  386 + views: {
  387 + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/edit.html'}
  388 + },
  389 + resolve: {
  390 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  391 + return $ocLazyLoad.load({
  392 + name: 'employeeConfig_edit_module',
  393 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  394 + files: [
  395 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  396 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  397 + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"
  398 + ]
  399 + });
  400 + }]
  401 + }
  402 + })
  403 + .state("employeeConfig_detail", {
  404 + url: '/employeeConfig_detail/:id',
  405 + views: {
  406 + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/detail.html'}
  407 + },
  408 + resolve: {
  409 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  410 + return $ocLazyLoad.load({
  411 + name: 'employeeConfig_detail_module',
  412 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  413 + files: [
  414 + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"
  415 + ]
  416 + });
  417 + }]
  418 + }
  419 + })
  420 +
  421 + // 路牌管理
  422 + .state("guideboardManage", {
  423 + url: '/guideboardManage',
  424 + views: {
  425 + "": {
  426 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'
  427 + },
  428 + "guideboardManage_list@guideboardManage": {
  429 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'
  430 + }
  431 + },
  432 +
  433 + resolve: {
  434 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  435 + return $ocLazyLoad.load({
  436 + name: 'guideboardManage_module',
  437 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  438 + files: [
  439 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  440 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  441 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  442 + "pages/scheduleApp/module/core/guideboardManage/guideboardManage.js"
  443 + ]
  444 + });
  445 + }]
  446 + }
  447 + })
  448 + .state("guideboardManage_detail", {
  449 + url: '/guideboardManage_detail/:id',
  450 + views: {
  451 + "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}
  452 + },
  453 + resolve: {
  454 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  455 + return $ocLazyLoad.load({
  456 + name: 'guideboardManage_detail_module',
  457 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  458 + files: [
  459 + "pages/scheduleApp/module/core/guideboardManage/guideboardManage.js"
  460 + ]
  461 + });
  462 + }]
  463 + }
  464 + })
  465 +
  466 +
  467 + // 时刻表管理
  468 + .state("timeTableManage", {
  469 + url: '/timeTableManage',
  470 + views: {
  471 + "": {
  472 + templateUrl: 'pages/scheduleApp/module/core/timeTableManage/index.html'
  473 + },
  474 + "timeTableManage_list@timeTableManage": {
  475 + templateUrl: 'pages/scheduleApp/module/core/timeTableManage/list.html'
  476 + }
  477 + },
  478 +
  479 + resolve: {
  480 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  481 + return $ocLazyLoad.load({
  482 + name: 'timeTableManage_module',
  483 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  484 + files: [
  485 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  486 + "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"
  487 + ]
  488 + });
  489 + }]
  490 + }
  491 + })
  492 + .state("timeTableManage_form", {
  493 + url: '/timeTableManage_form',
  494 + views: {
  495 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/form.html'}
  496 + },
  497 + resolve: {
  498 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  499 + return $ocLazyLoad.load({
  500 + name: 'timeTableManage_form_module',
  501 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  502 + files: [
  503 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  504 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  505 + "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"
  506 + ]
  507 + });
  508 + }]
  509 + }
  510 + })
  511 + .state("timeTableManage_edit", {
  512 + url: '/timeTableManage_edit/:id',
  513 + views: {
  514 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/edit.html'}
  515 + },
  516 + resolve: {
  517 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  518 + return $ocLazyLoad.load({
  519 + name: 'timeTableManage_edit_module',
  520 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  521 + files: [
  522 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  523 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  524 + "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"
  525 + ]
  526 + });
  527 + }]
  528 + }
  529 + })
  530 + .state("timeTableManage_detail", {
  531 + url: '/timeTableManage_detail/:id',
  532 + views: {
  533 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail.html'}
  534 + },
  535 + resolve: {
  536 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  537 + return $ocLazyLoad.load({
  538 + name: 'timeTableManage_detail_module',
  539 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  540 + files: [
  541 + "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"
  542 + ]
  543 + });
  544 + }]
  545 + }
  546 + })
  547 + .state("timeTableDetailInfoManage", {
  548 + url: '/timeTableDetailInfoManage/:xlid/:ttid/:xlname/:ttname',
  549 + views: {
  550 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info.html'}
  551 + },
  552 + resolve: {
  553 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  554 + return $ocLazyLoad.load({
  555 + name: 'timeTableDetailInfoManage_module',
  556 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  557 + files: [
  558 + "pages/scheduleApp/module/core/timeTableManage/timeTableDetailManage.js"
  559 + ]
  560 + });
  561 + }]
  562 + }
  563 + })
  564 + .state("timeTableDetailInfoManage_detail_edit", {
  565 + url: '/timeTableDetailInfoManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname',
  566 + views: {
  567 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info_edit.html'}
  568 + },
  569 + resolve: {
  570 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  571 + return $ocLazyLoad.load({
  572 + name: 'timeTableDetailInfoManage_module',
  573 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  574 + files: [
  575 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  576 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  577 + "pages/scheduleApp/module/core/timeTableManage/timeTableDetailManage.js"
  578 + ]
  579 + });
  580 + }]
  581 + }
  582 + })
  583 +
  584 + // 排班规则管理模块
  585 + .state("scheduleRuleManage", {
  586 + url: '/scheduleRuleManage',
  587 + views: {
  588 + "": {
  589 + templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/index.html'
  590 + },
  591 + "scheduleRuleManage_list@scheduleRuleManage": {
  592 + templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/list.html'
  593 + }
  594 + },
  595 +
  596 + resolve: {
  597 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  598 + return $ocLazyLoad.load({
  599 + name: 'scheduleRuleManage_module',
  600 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  601 + files: [
  602 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  603 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  604 + "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"
  605 + ]
  606 + });
  607 + }]
  608 + }
  609 + })
  610 + .state("scheduleRuleManage_form", {
  611 + url: '/scheduleRuleManage_form',
  612 + views: {
  613 + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/form.html'}
  614 + },
  615 + resolve: {
  616 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  617 + return $ocLazyLoad.load({
  618 + name: 'scheduleRuleManage_form_module',
  619 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  620 + files: [
  621 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  622 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  623 + "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"
  624 + ]
  625 + });
  626 + }]
  627 + }
  628 + })
  629 + .state("scheduleRuleManage_edit", {
  630 + url: '/scheduleRuleManage_edit/:id',
  631 + views: {
  632 + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/edit.html'}
  633 + },
  634 + resolve: {
  635 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  636 + return $ocLazyLoad.load({
  637 + name: 'scheduleRuleManage_edit_module',
  638 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  639 + files: [
  640 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  641 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  642 + "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"
  643 + ]
  644 + });
  645 + }]
  646 + }
  647 + })
  648 + .state("scheduleRuleManage_detail", {
  649 + url: '/scheduleRuleManage_detail/:id',
  650 + views: {
  651 + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/detail.html'}
  652 + },
  653 + resolve: {
  654 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  655 + return $ocLazyLoad.load({
  656 + name: 'scheduleRuleManage_detail_module',
  657 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  658 + files: [
  659 + "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"
  660 + ]
  661 + });
  662 + }]
  663 + }
  664 + })
  665 +
  666 + // 排班计划管理模块
  667 + .state("schedulePlanManage", {
  668 + url: '/schedulePlanManage',
  669 + views: {
  670 + "": {
  671 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index.html'
  672 + },
  673 + "schedulePlanManage_list@schedulePlanManage": {
  674 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list.html'
  675 + }
  676 + },
  677 +
  678 + resolve: {
  679 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  680 + return $ocLazyLoad.load({
  681 + name: 'schedulePlanManage_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/schedulePlanManage/schedulePlanManage.js"
  687 + ]
  688 + });
  689 + }]
  690 + }
  691 + })
  692 + .state("schedulePlanManage_form", {
  693 + url: '/schedulePlanManage_form',
  694 + views: {
  695 + "": {
  696 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/form.html'
  697 + }
  698 + },
  699 +
  700 + resolve: {
  701 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  702 + return $ocLazyLoad.load({
  703 + name: 'schedulePlanManage_form_module',
  704 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  705 + files: [
  706 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  707 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  708 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js"
  709 + ]
  710 + });
  711 + }]
  712 + }
  713 + })
  714 +
  715 + // 排班计划明细管理模块
  716 + .state("schedulePlanInfoManage", {
  717 + url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime',
  718 + views: {
  719 + "": {
  720 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index_info.html'
  721 + },
  722 + "schedulePlanInfoManage_list@schedulePlanInfoManage": {
  723 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list_info.html'
  724 + }
  725 + },
  726 +
  727 + resolve: {
  728 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  729 + return $ocLazyLoad.load({
  730 + name: 'schedulePlanInfoManage_module',
  731 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  732 + files: [
  733 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanInfoManage.js"
  734 + ]
  735 + });
  736 + }]
  737 + }
  738 + })
  739 +
  740 + // 排班调度值勤日报模块
  741 + .state("schedulePlanReportManage", {
  742 + url: '/schedulePlanReportManage',
  743 + views: {
  744 + "": {
  745 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index_report.html'
  746 + },
  747 + "schedulePlanReportManage_list@schedulePlanReportManage": {
  748 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list_report.html'
  749 + }
  750 + },
  751 +
  752 + resolve: {
  753 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  754 + return $ocLazyLoad.load({
  755 + name: 'schedulePlanManage_module',
  756 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  757 + files: [
  758 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  759 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  760 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js"
  761 + ]
  762 + });
  763 + }]
  764 + }
  765 + })
  766 +
  767 + .state("schedulePlanReportManage_edit", {
  768 + url: '/schedulePlanReportManage_edit',
  769 + params: {type: 0, groupInfo: null},
  770 + views: {
  771 + "": {
  772 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/edit_report.html'
  773 + }
  774 + },
  775 +
  776 + resolve: {
  777 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  778 + return $ocLazyLoad.load({
  779 + name: 'schedulePlanReportManage_edit_module',
  780 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  781 + files: [
  782 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  783 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  784 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js"
  785 + ]
  786 + });
  787 + }]
  788 + }
  789 + })
  790 +
  791 + // 线路运营概览模块
  792 + .state("busLineInfoStat", {
  793 + url: '/busLineInfoStat',
  794 + views: {
  795 + "": {
  796 + templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/index.html'
  797 + },
  798 + "busLineInfoStat_list@busLineInfoStat": {
  799 + templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/list.html'
  800 + }
  801 + },
  802 +
  803 + resolve: {
  804 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  805 + return $ocLazyLoad.load({
  806 + name: 'busLineInfoStat_module',
  807 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  808 + files: [
  809 + "pages/scheduleApp/module/core/busLineInfoStat/busLineInfoStat.js"
  810 + ]
  811 + });
  812 + }]
  813 + }
  814 + })
  815 +
  816 +
  817 +
  818 +
  819 +
  820 + // TODO:
  821 +
  822 + ;
  823 +
823 }]); 824 }]);
824 \ No newline at end of file 825 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list_report.html
1 -<!-- ui-route employeeInfoManage.list -->  
2 -<div ng-controller="SchedulePlanReportManageListCtrl as ctrl">  
3 - <div class="fixDiv">  
4 - <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column" style="width: 2000px">  
5 - <thead>  
6 - <tr role="row" class="heading">  
7 - <th style="width: 50px;">序号</th>  
8 - <th style="width: 230px;">线路</th>  
9 - <th style="width: 180px">日期</th>  
10 - <th style="width: 60px">路牌</th>  
11 - <th style="width: 100px;">车辆</th>  
12 - <th style="width: 80px;">出场1</th>  
13 - <th style="width: 100px;">驾工1</th>  
14 - <th style="width: 100px;">驾1</th>  
15 - <th style="width: 100px;">售工1</th>  
16 - <th style="width: 100px;">售1</th>  
17 - <th style="width: 80px;">出场2</th>  
18 - <th style="width: 100px;">驾工2</th>  
19 - <th style="width: 100px;">驾2</th>  
20 - <th style="width: 100px;">售工2</th>  
21 - <th style="width: 100px;">售2</th>  
22 - <th style="width: 150px;">排班时间</th>  
23 - <th>时刻表</th>  
24 - </tr>  
25 - <tr role="row" class="filter">  
26 - <td></td>  
27 - <td>  
28 - <sa-Select3 model="ctrl.searchCondition()"  
29 - name="xl"  
30 - placeholder="请输拼音..."  
31 - dcvalue="{{ctrl.searchCondition()['xlid']}}"  
32 - dcname="xlid"  
33 - icname="id"  
34 - icnames="name"  
35 - datatype="xl">  
36 - </sa-Select3>  
37 - </td>  
38 - <td>  
39 - <div class="input-group">  
40 - <input type="text" class="form-control"  
41 - name="scheduleDate" placeholder="选择日期..."  
42 - uib-datepicker-popup="yyyy-MM-dd"  
43 - is-open="ctrl.scheduleDateOpen"  
44 - ng-model="ctrl.searchCondition().sdate" readonly/>  
45 - <span class="input-group-btn">  
46 - <button type="button" class="btn btn-default" ng-click="ctrl.scheduleDate_open()">  
47 - <i class="glyphicon glyphicon-calendar"></i>  
48 - </button>  
49 - </span>  
50 - </div>  
51 - </td>  
52 - <td></td>  
53 - <td></td>  
54 - <td></td>  
55 - <td></td>  
56 - <td></td>  
57 - <td></td>  
58 - <td></td>  
59 - <td></td>  
60 - <td></td>  
61 - <td></td>  
62 - <td></td>  
63 - <td></td>  
64 - <td></td>  
65 - </tr>  
66 - </thead>  
67 - <tbody>  
68 - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX">  
69 - <td>  
70 - <span ng-bind="$index + 1"></span>  
71 - </td>  
72 - <td>  
73 - <span ng-bind="info.xlName"></span>  
74 - </td>  
75 - <td>  
76 - <span ng-bind="info.scheduleDate | date: 'yyyy-MM-dd'"></span>  
77 - </td>  
78 - <td>  
79 - <span ng-bind="info.lpName"></span>  
80 - </td>  
81 - <td>  
82 - <a class="btn btn-primary" ng-click="ctrl.goEditForm(1, info)">  
83 - <span ng-bind="info.clZbh"></span>  
84 - </a>  
85 - </td>  
86 - <td>  
87 - <a class="btn btn-info" ng-show="info.ccsj1" ng-click="ctrl.goEditForm(2, info)">  
88 - <span ng-bind="info.ccsj1"></span>  
89 - </a>  
90 - </td>  
91 - <td>  
92 - <a class="btn btn-success" ng-show="info.jsy1Gh" ng-click="ctrl.goEditForm(3, info)">  
93 - <span ng-bind="info.jsy1Gh"></span>  
94 - </a>  
95 - </td>  
96 - <td>  
97 - <a class="btn btn-success" ng-show="info.jsy1Name" ng-click="ctrl.goEditForm(3, info)">  
98 - <span ng-bind="info.jsy1Name"></span>  
99 - </a>  
100 - </td>  
101 - <td>  
102 - <a class="btn btn-info" ng-show="info.spy1Gh" ng-click="ctrl.goEditForm(3, info)">  
103 - <span ng-bind="info.spy1Gh"></span>  
104 - </a>  
105 - </td>  
106 - <td>  
107 - <a class="btn btn-info" ng-show="info.spy1Name" ng-click="ctrl.goEditForm(3, info)">  
108 - <span ng-bind="info.spy1Name"></span>  
109 - </a>  
110 - </td>  
111 - <td>  
112 - <a class="btn btn-success" ng-show="info.ccsj2" ng-click="ctrl.goEditForm(4, info)">  
113 - <span ng-bind="info.ccsj2"></span>  
114 - </a>  
115 - </td>  
116 - <td>  
117 - <a class="btn btn-info" ng-show="info.jsy2Gh" ng-click="ctrl.goEditForm(5, info)">  
118 - <span ng-bind="info.jsy2Gh"></span>  
119 - </a>  
120 - </td>  
121 - <td>  
122 - <a class="btn btn-info" ng-show="info.jsy2Name" ng-click="ctrl.goEditForm(5, info)">  
123 - <span ng-bind="info.jsy2Name"></span>  
124 - </a>  
125 - </td>  
126 - <td>  
127 - <a class="btn btn-info" ng-show="info.spy2Gh" ng-click="ctrl.goEditForm(5, info)">  
128 - <span ng-bind="info.spy2Gh"></span>  
129 - </a>  
130 - </td>  
131 - <td>  
132 - <a class="btn btn-info" ng-show="info.spy2Name" ng-click="ctrl.goEditForm(5, info)">  
133 - <span ng-bind="info.spy2Name"></span>  
134 - </a>  
135 - </td>  
136 - <td>  
137 - <span ng-bind="info.createDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>  
138 - </td>  
139 - <td>  
140 - <span ng-bind="info.ttinfoName"></span>  
141 - </td>  
142 - </tr>  
143 - </tbody>  
144 - </table>  
145 - </div>  
146 - 1 +<!-- ui-route employeeInfoManage.list -->
  2 +<div ng-controller="SchedulePlanReportManageListCtrl as ctrl">
  3 + <div class="fixDiv">
  4 + <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column" style="width: 2000px">
  5 + <thead>
  6 + <tr role="row" class="heading">
  7 + <th style="width: 50px;">序号</th>
  8 + <th style="width: 230px;">线路</th>
  9 + <th style="width: 180px">日期</th>
  10 + <th style="width: 60px">路牌</th>
  11 + <th style="width: 100px;">车辆</th>
  12 + <th style="width: 80px;">出场1</th>
  13 + <th style="width: 100px;">驾工1</th>
  14 + <th style="width: 100px;">驾1</th>
  15 + <th style="width: 100px;">售工1</th>
  16 + <th style="width: 100px;">售1</th>
  17 + <th style="width: 80px;">出场2</th>
  18 + <th style="width: 100px;">驾工2</th>
  19 + <th style="width: 100px;">驾2</th>
  20 + <th style="width: 100px;">售工2</th>
  21 + <th style="width: 100px;">售2</th>
  22 + <th style="width: 150px;">排班时间</th>
  23 + <th>时刻表</th>
  24 + </tr>
  25 + <tr role="row" class="filter">
  26 + <td></td>
  27 + <td>
  28 + <sa-Select3 model="ctrl.searchCondition()"
  29 + name="xl"
  30 + placeholder="请输拼音..."
  31 + dcvalue="{{ctrl.searchCondition()['xlid']}}"
  32 + dcname="xlid"
  33 + icname="id"
  34 + icnames="name"
  35 + datatype="xl">
  36 + </sa-Select3>
  37 + </td>
  38 + <td>
  39 + <div class="input-group">
  40 + <input type="text" class="form-control"
  41 + name="scheduleDate" placeholder="选择日期..."
  42 + uib-datepicker-popup="yyyy-MM-dd"
  43 + is-open="ctrl.scheduleDateOpen"
  44 + ng-model="ctrl.searchCondition().sdate" readonly/>
  45 + <span class="input-group-btn">
  46 + <button type="button" class="btn btn-default" ng-click="ctrl.scheduleDate_open()">
  47 + <i class="glyphicon glyphicon-calendar"></i>
  48 + </button>
  49 + </span>
  50 + </div>
  51 + </td>
  52 + <td></td>
  53 + <td></td>
  54 + <td></td>
  55 + <td></td>
  56 + <td></td>
  57 + <td></td>
  58 + <td></td>
  59 + <td></td>
  60 + <td></td>
  61 + <td></td>
  62 + <td></td>
  63 + <td></td>
  64 + <td></td>
  65 + </tr>
  66 + </thead>
  67 + <tbody>
  68 + <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX">
  69 + <td>
  70 + <span ng-bind="$index + 1"></span>
  71 + </td>
  72 + <td>
  73 + <span ng-bind="info.xlName"></span>
  74 + </td>
  75 + <td>
  76 + <span ng-bind="info.scheduleDate | date: 'yyyy-MM-dd'"></span>
  77 + </td>
  78 + <td>
  79 + <span ng-bind="info.lpName"></span>
  80 + </td>
  81 + <td>
  82 + <a class="btn btn-primary" ng-click="ctrl.goEditForm(1, info)">
  83 + <span ng-bind="info.clZbh"></span>
  84 + </a>
  85 + </td>
  86 + <td>
  87 + <a class="btn btn-info" ng-show="info.ccsj1" ng-click="ctrl.goEditForm(2, info)">
  88 + <span ng-bind="info.ccsj1"></span>
  89 + </a>
  90 + </td>
  91 + <td>
  92 + <a class="btn btn-success" ng-show="info.jsy1Gh" ng-click="ctrl.goEditForm(3, info)">
  93 + <span ng-bind="info.jsy1Gh"></span>
  94 + </a>
  95 + </td>
  96 + <td>
  97 + <a class="btn btn-success" ng-show="info.jsy1Name" ng-click="ctrl.goEditForm(3, info)">
  98 + <span ng-bind="info.jsy1Name"></span>
  99 + </a>
  100 + </td>
  101 + <td>
  102 + <a class="btn btn-info" ng-show="info.spy1Gh" ng-click="ctrl.goEditForm(3, info)">
  103 + <span ng-bind="info.spy1Gh"></span>
  104 + </a>
  105 + </td>
  106 + <td>
  107 + <a class="btn btn-info" ng-show="info.spy1Name" ng-click="ctrl.goEditForm(3, info)">
  108 + <span ng-bind="info.spy1Name"></span>
  109 + </a>
  110 + </td>
  111 + <td>
  112 + <a class="btn btn-success" ng-show="info.ccsj2" ng-click="ctrl.goEditForm(4, info)">
  113 + <span ng-bind="info.ccsj2"></span>
  114 + </a>
  115 + </td>
  116 + <td>
  117 + <a class="btn btn-info" ng-show="info.jsy2Gh" ng-click="ctrl.goEditForm(5, info)">
  118 + <span ng-bind="info.jsy2Gh"></span>
  119 + </a>
  120 + </td>
  121 + <td>
  122 + <a class="btn btn-info" ng-show="info.jsy2Name" ng-click="ctrl.goEditForm(5, info)">
  123 + <span ng-bind="info.jsy2Name"></span>
  124 + </a>
  125 + </td>
  126 + <td>
  127 + <a class="btn btn-info" ng-show="info.spy2Gh" ng-click="ctrl.goEditForm(5, info)">
  128 + <span ng-bind="info.spy2Gh"></span>
  129 + </a>
  130 + </td>
  131 + <td>
  132 + <a class="btn btn-info" ng-show="info.spy2Name" ng-click="ctrl.goEditForm(5, info)">
  133 + <span ng-bind="info.spy2Name"></span>
  134 + </a>
  135 + </td>
  136 + <td>
  137 + <span ng-bind="info.createDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
  138 + </td>
  139 + <td>
  140 + <span ng-bind="info.ttinfoName"></span>
  141 + </td>
  142 + </tr>
  143 + </tbody>
  144 + </table>
  145 + </div>
  146 +
147 </div> 147 </div>
148 \ No newline at end of file 148 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js
1 -// 调度值勤日报管理 service controller 等写在一起  
2 -// TODO:使用的global服务需要修正  
3 -angular.module('ScheduleApp').factory('SchedulePlanReportManageService', [  
4 - 'SchedulePlanInfoManageService_g', 'SchedulePlanManageService_g',  
5 - function(service, service2) {  
6 - /** 当前的查询条件信息 */  
7 - var currentSearchCondition = {};  
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 - * 组装查询参数,返回一个promise查询结果。  
28 - * @param params 查询参数  
29 - * @return 返回一个 promise  
30 - */  
31 - getPage: function() {  
32 - var params = currentSearchCondition; // 查询条件  
33 -  
34 - // TODO:如果没有选中线路、日期,默认选中一个  
35 - if (!params.xlid) {  
36 - currentSearchCondition.xlid = 2;  
37 - }  
38 - if (!params.sdate) {  
39 - currentSearchCondition.sdate = new Date();  
40 - currentSearchCondition.sdate.setTime(1472140800000);  
41 - }  
42 -  
43 - return service.groupinfo.list(params).$promise;  
44 - },  
45 - /**  
46 - * 获取明细信息。  
47 - * @param id 车辆id  
48 - * @return 返回一个 promise  
49 - */  
50 - getDetail: function(id) {  
51 - var params = {id: id};  
52 - return service.get(params).$promise;  
53 - },  
54 - /**  
55 - * 保存信息。  
56 - * @param obj 车辆详细信息  
57 - * @return 返回一个 promise  
58 - */  
59 - saveDetail: function(obj) {  
60 - return service.save(obj).$promise;  
61 - },  
62 - /**  
63 - * 更新分组信息。  
64 - * @param obj  
65 - * @returns {*|Function|promise|n}  
66 - */  
67 - updateDetail: function(obj) {  
68 - return service.updateGroupInfo.update(obj).$promise;  
69 - },  
70 - tommorwPlan: function() {  
71 - return service2.tommorw.list().$promise;  
72 - }  
73 - };  
74 -  
75 -}]);  
76 -  
77 -angular.module('ScheduleApp').controller('SchedulePlanReportManageCtrl', [  
78 - 'SchedulePlanReportManageService', '$state',  
79 - function(schedulePlanReportManageService, $state) {  
80 - var self = this;  
81 -  
82 - // 切换到form状态  
83 - self.goForm = function() {  
84 - alert("切换");  
85 - }  
86 - }  
87 -]);  
88 -  
89 -angular.module('ScheduleApp').controller('SchedulePlanReportManageListCtrl', [  
90 - 'SchedulePlanReportManageService', '$scope', '$state',  
91 - function(schedulePlanReportManageService, $scope, $state) {  
92 -  
93 - var self = this;  
94 - self.pageInfo = {  
95 - infos: []  
96 - };  
97 -  
98 - // 日期 日期控件开关  
99 - self.scheduleDateOpen = false;  
100 - self.scheduleDate_open = function() {  
101 - self.scheduleDateOpen = true;  
102 - };  
103 -  
104 - // 翻页的时候调用  
105 - self.pageChanaged = function() {  
106 - schedulePlanReportManageService.getPage().then(  
107 - function(result) {  
108 - self.pageInfo.infos = result;  
109 - },  
110 - function(result) {  
111 - alert("出错啦!");  
112 - }  
113 - );  
114 - };  
115 - // 获取查询条件数据  
116 - self.searchCondition = function() {  
117 - return schedulePlanReportManageService.getSearchCondition();  
118 - };  
119 - // 重置查询条件  
120 - self.resetSearchCondition = function() {  
121 - return schedulePlanReportManageService.resetSearchCondition();  
122 - };  
123 -  
124 - // 监控条件变化,触发查询  
125 - $scope.$watch(  
126 - function() {  
127 - return schedulePlanReportManageService.getSearchCondition();  
128 - },  
129 - function(newValue, oldValue) {  
130 - if (newValue) {  
131 - if (newValue.xlid && newValue.sdate) {  
132 - self.pageChanaged();  
133 - }  
134 - }  
135 - },  
136 - true  
137 - );  
138 -  
139 - /**  
140 - * ui-route中param不定义在template-url后,定义在params参数对象中  
141 - * 参数说明,type=更新方式,groupInfo=分组排班信息  
142 - * @param type 1=替换车辆,2=修改出场班次1,3=替换分组人员(驾驶员1和售票员1)  
143 - // 有分班的话,4=修改出场班次2,5=修改分组人员(驾驶员2和售票员2)  
144 - * @param groupInfo 列表单条数据,表示每条线路,每天,每个路牌谁跑的  
145 - */  
146 - self.goEditForm = function(type, groupInfo) {  
147 - $state.go("schedulePlanReportManage_edit", {  
148 - type: type,  
149 - groupInfo: groupInfo  
150 - });  
151 - };  
152 -  
153 -  
154 - // 初始创建的时候,获取一次列表数据  
155 - schedulePlanReportManageService.tommorwPlan().then(  
156 - function(result) {  
157 - self.searchCondition().xlid = result.xl.id;  
158 - var dd = new Date();  
159 - dd.setHours(0);  
160 - dd.setMinutes(0);  
161 - dd.setSeconds(0);  
162 - dd.setMilliseconds(0);  
163 - dd.setTime(dd.getTime() + 24 * 3600 * 1000);  
164 - self.searchCondition().sdate = dd;  
165 - self.pageChanaged();  
166 - },  
167 - function(result) {  
168 - self.pageChanaged();  
169 - }  
170 - );  
171 -  
172 - }  
173 -]);  
174 -  
175 -angular.module('ScheduleApp').controller('SchedulePlanReportManageFormCtrl', [  
176 - 'SchedulePlanReportManageService',  
177 - '$stateParams',  
178 - '$state',  
179 - function(schedulePlanReportManageService, $stateParams, $state) {  
180 - var self = this;  
181 -  
182 - // 传过来的值  
183 - var type_src = $stateParams.type;  
184 - var groupInfo_src = $stateParams.groupInfo;  
185 -  
186 - // 时间正则表达式(格式hh:mm,如:06:39)  
187 - self.time_regex = /^(([0-1]\d)|(2[0-4])):[0-5]\d$/;  
188 -  
189 - // 欲修改的groupInfo值  
190 - self.groupInfo_src = groupInfo_src;  
191 - self.groupInfo = {};  
192 - self.type = type_src;  
193 - angular.copy(groupInfo_src, self.groupInfo);  
194 -  
195 - // 提交方法  
196 - self.submit = function() {  
197 - var param = {  
198 - type: self.type,  
199 - src: self.groupInfo_src,  
200 - update: self.groupInfo  
201 - };  
202 - schedulePlanReportManageService.updateDetail(param).then(  
203 - function(result) {  
204 - if (result.status == 'SUCCESS') {  
205 - alert("保存成功!");  
206 - $state.go("schedulePlanReportManage");  
207 - } else {  
208 - alert("保存异常!");  
209 - }  
210 - },  
211 - function(result) {  
212 - alert("出错啦!");  
213 - }  
214 - );  
215 - }  
216 -  
217 - }  
218 -]);  
219 -  
220 -angular.module('ScheduleApp').controller('SchedulePlanReportManageDetailCtrl', ['SchedulePlanReportManageService', '$stateParams', function(schedulePlanReportManageService, $stateParams) {  
221 - // TODO:  
222 -}]);  
223 \ No newline at end of file 1 \ No newline at end of file
  2 +// 调度值勤日报管理 service controller 等写在一起
  3 +// TODO:使用的global服务需要修正
  4 +angular.module('ScheduleApp').factory('SchedulePlanReportManageService', [
  5 + 'SchedulePlanInfoManageService_g', 'SchedulePlanManageService_g',
  6 + function(service, service2) {
  7 + /** 当前的查询条件信息 */
  8 + var currentSearchCondition = {};
  9 +
  10 + return {
  11 + /**
  12 + * 获取查询条件信息,
  13 + * 用于给controller用来和页面数据绑定。
  14 + */
  15 + getSearchCondition: function() {
  16 + return currentSearchCondition;
  17 + },
  18 + /**
  19 + * 重置查询条件信息。
  20 + */
  21 + resetSearchCondition: function() {
  22 + var key;
  23 + for (key in currentSearchCondition) {
  24 + currentSearchCondition[key] = undefined;
  25 + }
  26 + },
  27 + /**
  28 + * 组装查询参数,返回一个promise查询结果。
  29 + * @param params 查询参数
  30 + * @return 返回一个 promise
  31 + */
  32 + getPage: function() {
  33 + var params = currentSearchCondition; // 查询条件
  34 +
  35 + // TODO:如果没有选中线路、日期,默认选中一个
  36 + if (!params.xlid) {
  37 + currentSearchCondition.xlid = 2;
  38 + }
  39 + if (!params.sdate) {
  40 + currentSearchCondition.sdate = new Date();
  41 + currentSearchCondition.sdate.setTime(1472140800000);
  42 + }
  43 +
  44 + return service.groupinfo.list(params).$promise;
  45 + },
  46 + /**
  47 + * 获取明细信息。
  48 + * @param id 车辆id
  49 + * @return 返回一个 promise
  50 + */
  51 + getDetail: function(id) {
  52 + var params = {id: id};
  53 + return service.get(params).$promise;
  54 + },
  55 + /**
  56 + * 保存信息。
  57 + * @param obj 车辆详细信息
  58 + * @return 返回一个 promise
  59 + */
  60 + saveDetail: function(obj) {
  61 + return service.save(obj).$promise;
  62 + },
  63 + /**
  64 + * 更新分组信息。
  65 + * @param obj
  66 + * @returns {*|Function|promise|n}
  67 + */
  68 + updateDetail: function(obj) {
  69 + return service.updateGroupInfo.update(obj).$promise;
  70 + },
  71 + tommorwPlan: function() {
  72 + return service2.tommorw.list().$promise;
  73 + }
  74 + };
  75 +
  76 +}]);
  77 +
  78 +angular.module('ScheduleApp').controller('SchedulePlanReportManageCtrl', [
  79 + 'SchedulePlanReportManageService', '$state',
  80 + function(schedulePlanReportManageService, $state) {
  81 + var self = this;
  82 +
  83 + // 切换到form状态
  84 + self.goForm = function() {
  85 + alert("切换");
  86 + }
  87 + }
  88 +]);
  89 +
  90 +angular.module('ScheduleApp').controller('SchedulePlanReportManageListCtrl', [
  91 + 'SchedulePlanReportManageService', '$scope', '$state',
  92 + function(schedulePlanReportManageService, $scope, $state) {
  93 +
  94 + var self = this;
  95 + self.pageInfo = {
  96 + infos: []
  97 + };
  98 +
  99 + // 日期 日期控件开关
  100 + self.scheduleDateOpen = false;
  101 + self.scheduleDate_open = function() {
  102 + self.scheduleDateOpen = true;
  103 + };
  104 +
  105 + // 翻页的时候调用
  106 + self.pageChanaged = function() {
  107 + schedulePlanReportManageService.getPage().then(
  108 + function(result) {
  109 + self.pageInfo.infos = result;
  110 + },
  111 + function(result) {
  112 + alert("出错啦!");
  113 + }
  114 + );
  115 + };
  116 + // 获取查询条件数据
  117 + self.searchCondition = function() {
  118 + return schedulePlanReportManageService.getSearchCondition();
  119 + };
  120 + // 重置查询条件
  121 + self.resetSearchCondition = function() {
  122 + return schedulePlanReportManageService.resetSearchCondition();
  123 + };
  124 +
  125 + // 监控条件变化,触发查询
  126 + $scope.$watch(
  127 + function() {
  128 + return schedulePlanReportManageService.getSearchCondition();
  129 + },
  130 + function(newValue, oldValue) {
  131 + if (newValue) {
  132 + if (newValue.xlid && newValue.sdate) {
  133 + self.pageChanaged();
  134 + }
  135 + }
  136 + },
  137 + true
  138 + );
  139 +
  140 + /**
  141 + * ui-route中param不定义在template-url后,定义在params参数对象中
  142 + * 参数说明,type=更新方式,groupInfo=分组排班信息
  143 + * @param type 1=替换车辆,2=修改出场班次1,3=替换分组人员(驾驶员1和售票员1)
  144 + // 有分班的话,4=修改出场班次2,5=修改分组人员(驾驶员2和售票员2)
  145 + * @param groupInfo 列表单条数据,表示每条线路,每天,每个路牌谁跑的
  146 + */
  147 + self.goEditForm = function(type, groupInfo) {
  148 + $state.go("schedulePlanReportManage_edit", {
  149 + type: type,
  150 + groupInfo: groupInfo
  151 + });
  152 + };
  153 +
  154 +
  155 + // 初始创建的时候,获取一次列表数据
  156 + schedulePlanReportManageService.tommorwPlan().then(
  157 + function(result) {
  158 + self.searchCondition().xlid = result.xl.id;
  159 + var dd = new Date();
  160 + dd.setHours(0);
  161 + dd.setMinutes(0);
  162 + dd.setSeconds(0);
  163 + dd.setMilliseconds(0);
  164 + dd.setTime(dd.getTime() + 24 * 3600 * 1000);
  165 + self.searchCondition().sdate = dd;
  166 + self.pageChanaged();
  167 + },
  168 + function(result) {
  169 + self.pageChanaged();
  170 + }
  171 + );
  172 +
  173 + }
  174 +]);
  175 +
  176 +angular.module('ScheduleApp').controller('SchedulePlanReportManageFormCtrl', [
  177 + 'SchedulePlanReportManageService',
  178 + '$stateParams',
  179 + '$state',
  180 + function(schedulePlanReportManageService, $stateParams, $state) {
  181 + var self = this;
  182 +
  183 + // 传过来的值
  184 + var type_src = $stateParams.type;
  185 + var groupInfo_src = $stateParams.groupInfo;
  186 +
  187 + // 时间正则表达式(格式hh:mm,如:06:39)
  188 + self.time_regex = /^(([0-1]\d)|(2[0-4])):[0-5]\d$/;
  189 +
  190 + // 欲修改的groupInfo值
  191 + self.groupInfo_src = groupInfo_src;
  192 + self.groupInfo = {};
  193 + self.type = type_src;
  194 + angular.copy(groupInfo_src, self.groupInfo);
  195 +
  196 + // 提交方法
  197 + self.submit = function() {
  198 + var param = {
  199 + type: self.type,
  200 + src: self.groupInfo_src,
  201 + update: self.groupInfo
  202 + };
  203 + schedulePlanReportManageService.updateDetail(param).then(
  204 + function(result) {
  205 + if (result.status == 'SUCCESS') {
  206 + alert("保存成功!");
  207 + $state.go("schedulePlanReportManage");
  208 + } else {
  209 + alert("保存异常!");
  210 + }
  211 + },
  212 + function(result) {
  213 + alert("出错啦!");
  214 + }
  215 + );
  216 + }
  217 +
  218 + }
  219 +]);
  220 +
  221 +angular.module('ScheduleApp').controller('SchedulePlanReportManageDetailCtrl', ['SchedulePlanReportManageService', '$stateParams', function(schedulePlanReportManageService, $stateParams) {
  222 + // TODO:
  223 +}]);
  224 +
  225 +