Commit 20d5d7ff58997e4c727a20a17dad77d84bf781e4

Authored by 徐烜
1 parent bb7d840d

Update

src/main/resources/datatools/ktrs/ttinfodetailDataInput.ktr
@@ -137,6 +137,48 @@ @@ -137,6 +137,48 @@
137 <bordercolorblue>100</bordercolorblue> 137 <bordercolorblue>100</bordercolorblue>
138 <drawshadow>Y</drawshadow> 138 <drawshadow>Y</drawshadow>
139 </notepad> 139 </notepad>
  140 + <notepad>
  141 + <note>&#x51fa;&#x573a;&#x73ed;&#x6b21;&#xff0c;&#x65b9;&#x5411;&#x6709;&#x65f6;&#x786e;&#x5b9a;&#x4e0d;&#x51c6;&#xff0c;&#xa;&#x7a7a;&#x7684;&#x60c5;&#x51b5;&#x4e0b;&#x8bbe;&#x5b9a;&#x4e3a;0&#xff08;&#x4e0a;&#x884c;&#xff09;</note>
  142 + <xloc>120</xloc>
  143 + <yloc>1016</yloc>
  144 + <width>178</width>
  145 + <heigth>42</heigth>
  146 + <fontname>YaHei Consolas Hybrid</fontname>
  147 + <fontsize>12</fontsize>
  148 + <fontbold>N</fontbold>
  149 + <fontitalic>N</fontitalic>
  150 + <fontcolorred>0</fontcolorred>
  151 + <fontcolorgreen>0</fontcolorgreen>
  152 + <fontcolorblue>0</fontcolorblue>
  153 + <backgroundcolorred>255</backgroundcolorred>
  154 + <backgroundcolorgreen>205</backgroundcolorgreen>
  155 + <backgroundcolorblue>112</backgroundcolorblue>
  156 + <bordercolorred>100</bordercolorred>
  157 + <bordercolorgreen>100</bordercolorgreen>
  158 + <bordercolorblue>100</bordercolorblue>
  159 + <drawshadow>Y</drawshadow>
  160 + </notepad>
  161 + <notepad>
  162 + <note>&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#xff0c;&#x65b9;&#x5411;&#x6709;&#x65f6;&#x786e;&#x5b9a;&#x4e0d;&#x51c6;&#xff0c;&#xa;&#x7a7a;&#x7684;&#x60c5;&#x51b5;&#x4e0b;&#x8bbe;&#x5b9a;&#x4e3a;0&#xff08;&#x4e0a;&#x884c;&#xff09;</note>
  163 + <xloc>578</xloc>
  164 + <yloc>1084</yloc>
  165 + <width>178</width>
  166 + <heigth>42</heigth>
  167 + <fontname>YaHei Consolas Hybrid</fontname>
  168 + <fontsize>12</fontsize>
  169 + <fontbold>N</fontbold>
  170 + <fontitalic>N</fontitalic>
  171 + <fontcolorred>0</fontcolorred>
  172 + <fontcolorgreen>0</fontcolorgreen>
  173 + <fontcolorblue>0</fontcolorblue>
  174 + <backgroundcolorred>255</backgroundcolorred>
  175 + <backgroundcolorgreen>205</backgroundcolorgreen>
  176 + <backgroundcolorblue>112</backgroundcolorblue>
  177 + <bordercolorred>100</bordercolorred>
  178 + <bordercolorgreen>100</bordercolorgreen>
  179 + <bordercolorblue>100</bordercolorblue>
  180 + <drawshadow>Y</drawshadow>
  181 + </notepad>
140 </notepads> 182 </notepads>
141 <connection> 183 <connection>
142 <name>bus_control_variable</name> 184 <name>bus_control_variable</name>
@@ -342,10 +384,12 @@ @@ -342,10 +384,12 @@
342 <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x5e76;&#x4f5c;&#x4e3a;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;</from><to>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</to><enabled>Y</enabled> </hop> 384 <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x4e0a;&#x4e00;&#x4e2a;&#x73ed;&#x6b21;&#x7684;&#x7ec8;&#x70b9;&#x7ad9;&#xff0c;&#x5e76;&#x4f5c;&#x4e3a;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x7684;&#x8d77;&#x70b9;&#x7ad9;</from><to>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</to><enabled>Y</enabled> </hop>
343 <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 3</to><enabled>Y</enabled> </hop> 385 <hop> <from>&#x67e5;&#x627e;&#x8fdb;&#x573a;&#x8d77;&#x70b9;&#x7ad9;&#x5173;&#x8054;&#x786e;&#x5b9a;&#x4e0a;&#x4e0b;&#x884c;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5b57;&#x5178; 3</to><enabled>Y</enabled> </hop>
344 <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x51fa;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop> 386 <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x51fa;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
345 - <hop> <from>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</to><enabled>Y</enabled> </hop>  
346 - <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 2</to><enabled>Y</enabled> </hop>  
347 <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x8fdb;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop> 387 <hop> <from>&#x67e5;&#x627e;&#x7ebf;&#x8def;&#x8fdb;&#x573a;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</to><enabled>Y</enabled> </hop>
348 - <hop> <from>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</to><enabled>Y</enabled> </hop> 388 + <hop> <from>&#x5339;&#x914d;&#x51fa;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</to><enabled>Y</enabled> </hop>
  389 + <hop> <from>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</to><enabled>Y</enabled> </hop>
  390 + <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 2</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 2</to><enabled>Y</enabled> </hop>
  391 + <hop> <from>&#x5339;&#x914d;&#x8fdb;&#x573a;&#x73ed;&#x6b21;&#x91cc;&#x7a0b;&#x65f6;&#x95f4;</from><to>&#x4e0a;&#x4e0b;&#x884c;&#x5224;&#x5b9a; 2</to><enabled>Y</enabled> </hop>
  392 + <hop> <from>&#x4e0a;&#x4e0b;&#x884c;&#x5224;&#x5b9a; 2</from><to>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</to><enabled>Y</enabled> </hop>
349 <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 3</to><enabled>Y</enabled> </hop> 393 <hop> <from>&#x7c7b;&#x578b;&#x4fee;&#x6b63; 3</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail 3</to><enabled>Y</enabled> </hop>
350 </order> 394 </order>
351 <step> 395 <step>
@@ -1051,8 +1095,8 @@ @@ -1051,8 +1095,8 @@
1051 </lookup> 1095 </lookup>
1052 <cluster_schema/> 1096 <cluster_schema/>
1053 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 1097 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1054 - <xloc>342</xloc>  
1055 - <yloc>1031</yloc> 1098 + <xloc>340</xloc>
  1099 + <yloc>1087</yloc>
1056 <draw>Y</draw> 1100 <draw>Y</draw>
1057 </GUI> 1101 </GUI>
1058 </step> 1102 </step>
@@ -1172,8 +1216,8 @@ @@ -1172,8 +1216,8 @@
1172 </lookup> 1216 </lookup>
1173 <cluster_schema/> 1217 <cluster_schema/>
1174 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 1218 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1175 - <xloc>875</xloc>  
1176 - <yloc>887</yloc> 1219 + <xloc>845</xloc>
  1220 + <yloc>899</yloc>
1177 <draw>Y</draw> 1221 <draw>Y</draw>
1178 </GUI> 1222 </GUI>
1179 </step> 1223 </step>
@@ -2450,10 +2494,25 @@ @@ -2450,10 +2494,25 @@
2450 <grouping_symbol/> 2494 <grouping_symbol/>
2451 <currency_symbol/> 2495 <currency_symbol/>
2452 <storage_type/> 2496 <storage_type/>
  2497 + </meta> <meta> <name>sxx</name>
  2498 + <rename>sxx</rename>
  2499 + <type>Integer</type>
  2500 + <length>-2</length>
  2501 + <precision>-2</precision>
  2502 + <conversion_mask/>
  2503 + <date_format_lenient>false</date_format_lenient>
  2504 + <date_format_locale/>
  2505 + <date_format_timezone/>
  2506 + <lenient_string_to_number>false</lenient_string_to_number>
  2507 + <encoding/>
  2508 + <decimal_symbol/>
  2509 + <grouping_symbol/>
  2510 + <currency_symbol/>
  2511 + <storage_type/>
2453 </meta> </fields> <cluster_schema/> 2512 </meta> </fields> <cluster_schema/>
2454 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 2513 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2455 <xloc>338</xloc> 2514 <xloc>338</xloc>
2456 - <yloc>949</yloc> 2515 + <yloc>1008</yloc>
2457 <draw>Y</draw> 2516 <draw>Y</draw>
2458 </GUI> 2517 </GUI>
2459 </step> 2518 </step>
@@ -2500,10 +2559,25 @@ @@ -2500,10 +2559,25 @@
2500 <grouping_symbol/> 2559 <grouping_symbol/>
2501 <currency_symbol/> 2560 <currency_symbol/>
2502 <storage_type/> 2561 <storage_type/>
  2562 + </meta> <meta> <name>sxx2</name>
  2563 + <rename>sxx2</rename>
  2564 + <type>Integer</type>
  2565 + <length>-2</length>
  2566 + <precision>-2</precision>
  2567 + <conversion_mask/>
  2568 + <date_format_lenient>false</date_format_lenient>
  2569 + <date_format_locale/>
  2570 + <date_format_timezone/>
  2571 + <lenient_string_to_number>false</lenient_string_to_number>
  2572 + <encoding/>
  2573 + <decimal_symbol/>
  2574 + <grouping_symbol/>
  2575 + <currency_symbol/>
  2576 + <storage_type/>
2503 </meta> </fields> <cluster_schema/> 2577 </meta> </fields> <cluster_schema/>
2504 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 2578 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
2505 - <xloc>875</xloc>  
2506 - <yloc>1001</yloc> 2579 + <xloc>847</xloc>
  2580 + <yloc>1003</yloc>
2507 <draw>Y</draw> 2581 <draw>Y</draw>
2508 </GUI> 2582 </GUI>
2509 </step> 2583 </step>
@@ -2667,10 +2741,78 @@ @@ -2667,10 +2741,78 @@
2667 </GUI> 2741 </GUI>
2668 </step> 2742 </step>
2669 2743
  2744 + <step>
  2745 + <name>&#x4e0a;&#x4e0b;&#x884c;NULL&#x5224;&#x5b9a;</name>
  2746 + <type>IfNull</type>
  2747 + <description/>
  2748 + <distribute>Y</distribute>
  2749 + <custom_distribution/>
  2750 + <copies>1</copies>
  2751 + <partitioning>
  2752 + <method>none</method>
  2753 + <schema_name/>
  2754 + </partitioning>
  2755 + <replaceAllByValue/>
  2756 + <replaceAllMask/>
  2757 + <selectFields>Y</selectFields>
  2758 + <selectValuesType>N</selectValuesType>
  2759 + <setEmptyStringAll>N</setEmptyStringAll>
  2760 + <valuetypes>
  2761 + </valuetypes>
  2762 + <fields>
  2763 + <field>
  2764 + <name>sxx</name>
  2765 + <value>0</value>
  2766 + <mask/>
  2767 + <set_empty_string>N</set_empty_string>
  2768 + </field>
  2769 + </fields>
  2770 + <cluster_schema/>
  2771 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2772 + <xloc>230</xloc>
  2773 + <yloc>946</yloc>
  2774 + <draw>Y</draw>
  2775 + </GUI>
  2776 + </step>
  2777 +
  2778 + <step>
  2779 + <name>&#x4e0a;&#x4e0b;&#x884c;&#x5224;&#x5b9a; 2</name>
  2780 + <type>IfNull</type>
  2781 + <description/>
  2782 + <distribute>Y</distribute>
  2783 + <custom_distribution/>
  2784 + <copies>1</copies>
  2785 + <partitioning>
  2786 + <method>none</method>
  2787 + <schema_name/>
  2788 + </partitioning>
  2789 + <replaceAllByValue/>
  2790 + <replaceAllMask/>
  2791 + <selectFields>Y</selectFields>
  2792 + <selectValuesType>N</selectValuesType>
  2793 + <setEmptyStringAll>N</setEmptyStringAll>
  2794 + <valuetypes>
  2795 + </valuetypes>
  2796 + <fields>
  2797 + <field>
  2798 + <name>sxx2</name>
  2799 + <value>0</value>
  2800 + <mask/>
  2801 + <set_empty_string>N</set_empty_string>
  2802 + </field>
  2803 + </fields>
  2804 + <cluster_schema/>
  2805 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  2806 + <xloc>804</xloc>
  2807 + <yloc>1081</yloc>
  2808 + <draw>Y</draw>
  2809 + </GUI>
  2810 + </step>
  2811 +
2670 <step_error_handling> 2812 <step_error_handling>
2671 <error> 2813 <error>
2672 <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail</source_step> 2814 <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_s_ttinfo_detail</source_step>
2673 - <target_step>Excel&#x8f93;&#x51fa;</target_step> 2815 + <target_step/>
2674 <is_enabled>Y</is_enabled> 2816 <is_enabled>Y</is_enabled>
2675 <nr_valuename>c1</nr_valuename> 2817 <nr_valuename>c1</nr_valuename>
2676 <descriptions_valuename>c2</descriptions_valuename> 2818 <descriptions_valuename>c2</descriptions_valuename>
src/main/resources/static/pages/scheduleApp/module/common/dts2/employeeGroup/saEmployeegroup.js
@@ -29,7 +29,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -29,7 +29,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
29 bindToController: true, 29 bindToController: true,
30 controller: function($scope) { 30 controller: function($scope) {
31 var self = this; 31 var self = this;
32 - self.$$data = []; // 选择线路后,该线路的人员配置数据 32 + self.$$dataReal = []; // 选择线路后,该线路的人员配置数据
  33 + self.$$data = []; // 页面最多显示10条,可以通过$$searchText筛选
33 34
34 // 测试数据 35 // 测试数据
35 //self.$$data = [ 36 //self.$$data = [
@@ -38,6 +39,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -38,6 +39,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
38 // {id: 3, dbbm: "3", jsy: '忍3', spy: '守3'} 39 // {id: 3, dbbm: "3", jsy: '忍3', spy: '守3'}
39 //]; 40 //];
40 41
  42 + self.$$searchText = undefined; // 搜索值
41 self.$$dataSelected = []; // 选中的人员配置列表 43 self.$$dataSelected = []; // 选中的人员配置列表
42 self.$$dataSelectedStart = undefined; // 起始人员配置 44 self.$$dataSelectedStart = undefined; // 起始人员配置
43 45
@@ -118,6 +120,48 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -118,6 +120,48 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
118 scope[ctrlAs]["$name_attr"] = $name_attr; 120 scope[ctrlAs]["$name_attr"] = $name_attr;
119 } 121 }
120 122
  123 + // 监听搜索框,keydwon,keyup事件
  124 + tElem.on('keydown', '[name=rysearch]', function(event) {
  125 + if (event.keyCode == 13) { // 阻止回车事件造成的form提交
  126 + return false;
  127 + }
  128 + });
  129 + tElem.on('keyup', '[name=rysearch]', function() {
  130 + console.log(scope[ctrlAs]["$$searchText"]);
  131 + var sText = scope[ctrlAs]["$$searchText"];
  132 + if (sText && sText != "") {
  133 + // 因为在dom事件里修改了model的值,必须写在scope.$apply中,否则页面上绑定效果无
  134 + // 另一种做法可以写在$watch方法中
  135 + scope.$apply(function() {
  136 + scope[ctrlAs].$$data = [];
  137 + for (var k = 0; k < scope[ctrlAs].$$dataReal.length; k++) {
  138 + var upTerm = sText.toUpperCase();
  139 + if (scope[ctrlAs].$$data.length < 10) {
  140 + if (scope[ctrlAs].$$dataReal[k].$fullChars.indexOf(upTerm) != -1
  141 + || scope[ctrlAs].$$dataReal[k].$camelChars.indexOf(upTerm) != -1
  142 + || scope[ctrlAs].$$dataReal[k].$str.indexOf(upTerm) != -1) {
  143 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[k]);
  144 + }
  145 + } else {
  146 + break;
  147 + }
  148 + }
  149 + });
  150 + } else {
  151 + scope.$apply(function() {
  152 + scope[ctrlAs].$$data = [];
  153 + for (var i = 0; i < scope[ctrlAs].$$dataReal.length; i++) {
  154 + if (scope[ctrlAs].$$data.length < 10) {
  155 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[i]);
  156 + } else {
  157 + break;
  158 + }
  159 + }
  160 + });
  161 + }
  162 + });
  163 +
  164 +
121 /** 165 /**
122 * 人员配置列表点击(人员配置列表中选中路牌) 166 * 人员配置列表点击(人员配置列表中选中路牌)
123 * @param $index 167 * @param $index
@@ -573,15 +617,37 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -573,15 +617,37 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
573 // 获取值了 617 // 获取值了
574 console.log("人员配置获取了"); 618 console.log("人员配置获取了");
575 619
576 - scope[ctrlAs].$$data = [];  
577 - for (var i = 0; i < result.content.length; i++) {  
578 - scope[ctrlAs].$$data.push({  
579 - id: result.content[i].id,  
580 - dbbm: result.content[i].dbbm,  
581 - jsy: result.content[i].jsy.personnelName,  
582 - spy: result.content[i].spy == null ? "" : result.content[i].spy.personnelName 620 + scope[ctrlAs].$$dataReal = [];
  621 + angular.forEach(result.content, function(obj) {
  622 + var n1 = obj.jsy == null ? "" : (obj.jsy.personnelName || "");
  623 + var n2 = obj.spy == null ? "" : (obj.spy.personnelName || "");
  624 + var c1 = obj.jsy == null ? "" : (obj.jsy.jobCode || "");
  625 + var c2 = obj.spy == null ? "" : (obj.spy.jobCode || "");
  626 + var str = [];
  627 + str.push(n1);
  628 + str.push(n2);
  629 + str.push(c1);
  630 + str.push(c2);
  631 + this.push({
  632 + id: obj.id,
  633 + dbbm: obj.dbbm,
  634 + jsy: n1,
  635 + spy: n2,
  636 + '$fullChars': pinyin.getFullChars(str.join("-")), // 全拼
  637 + '$camelChars': pinyin.getCamelChars(str.join("-")), // 简拼
  638 + '$str': str.join("-")
583 }); 639 });
  640 + }, scope[ctrlAs].$$dataReal);
  641 +
  642 + scope[ctrlAs].$$data = [];
  643 + for (var i = 0; i < scope[ctrlAs].$$dataReal.length; i++) {
  644 + if (scope[ctrlAs].$$data.length < 10) {
  645 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[i]);
  646 + } else {
  647 + break;
  648 + }
584 } 649 }
  650 +
585 if (scope[ctrlAs].$$data_init) { 651 if (scope[ctrlAs].$$data_init) {
586 scope[ctrlAs].$$dataSelected = []; 652 scope[ctrlAs].$$dataSelected = [];
587 scope[ctrlAs].$$dataSelectedStart = undefined; 653 scope[ctrlAs].$$dataSelectedStart = undefined;
@@ -591,6 +657,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -591,6 +657,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
591 scope[ctrlAs].$$dataFBSelectedStart = undefined; 657 scope[ctrlAs].$$dataFBSelectedStart = undefined;
592 658
593 scope[ctrlAs].$$internalmodel = undefined; 659 scope[ctrlAs].$$internalmodel = undefined;
  660 +
  661 + scope[ctrlAs].$$searchText = undefined;
594 } 662 }
595 scope[ctrlAs].$$data_xl_first_init = true; 663 scope[ctrlAs].$$data_xl_first_init = true;
596 }, 664 },
src/main/resources/static/pages/scheduleApp/module/common/dts2/employeeGroup/saEmployeegroupTemplate.html
@@ -72,15 +72,23 @@ @@ -72,15 +72,23 @@
72 72
73 <div class="col-md-12 employee-select"> 73 <div class="col-md-12 employee-select">
74 <div class="col-md-12 employee-input"> 74 <div class="col-md-12 employee-input">
75 - <div class="col-md-9">  
76 - 人员列表,共{{$saEmployeegroupCtrl.$$data.length}}组  
77 - 75 + <div class="col-md-7" style="padding-right: 0px;">
  76 + <small>
  77 + 人员列表,共{{$saEmployeegroupCtrl.$$dataReal.length}}组,筛选{{$saEmployeegroupCtrl.$$data.length}}组(最多10组)
  78 + </small>
  79 + </div>
  80 + <div class="col-md-3" style="padding-left: 0px;">
  81 + <input name="rysearch" ng-model="$saEmployeegroupCtrl.$$searchText"
  82 + type="text" class="input-sm" style="width: 120px; height: 20px; border: 1px solid #32C5D2;" placeholder="输入名字或工号..."/>
78 </div> 83 </div>
79 - <div class="checkbox col-md-3" style="min-height: 19px; color: black;">  
80 - <label> 84 +
  85 + <div class="col-md-2" style="min-height: 19px; color: black;">
  86 + <div class="col-md-5" style="padding-left: 0px; padding-right: 0px;">
81 <input type="checkbox" ng-model="$saEmployeegroupCtrl.$$isFB"/> 87 <input type="checkbox" ng-model="$saEmployeegroupCtrl.$$isFB"/>
82 - 是否分班  
83 - </label> 88 + </div>
  89 + <div class="col-md-7" style="padding-left: 0px; padding-right: 0px;">
  90 + <small>分班</small>
  91 + </div>
84 </div> 92 </div>
85 93
86 </div> 94 </div>
@@ -109,8 +117,11 @@ @@ -109,8 +117,11 @@
109 <!-- 不分班 --> 117 <!-- 不分班 -->
110 <div class="col-md-12 employee-input" ng-if="!$saEmployeegroupCtrl.$$isFB"> 118 <div class="col-md-12 employee-input" ng-if="!$saEmployeegroupCtrl.$$isFB">
111 <div class="col-md-12"> 119 <div class="col-md-12">
112 - 已经选中的人员列表,共{{$saEmployeegroupCtrl.$$dataSelected.length}}组,  
113 - 初始人员,{{$saEmployeegroupCtrl.$$dataSelectedStart == undefined ? "未选择" : "第" + ($saEmployeegroupCtrl.$$dataSelectedStart + 1) + "组"}} 120 + <small>
  121 + 已经选中的人员列表,共{{$saEmployeegroupCtrl.$$dataSelected.length}}组,
  122 + 初始人员,{{$saEmployeegroupCtrl.$$dataSelectedStart == undefined ? "未选择" : "第" + ($saEmployeegroupCtrl.$$dataSelectedStart + 1) + "组"}}
  123 + </small>
  124 +
114 </div> 125 </div>
115 </div> 126 </div>
116 <div class="col-md-12 employee-select-cont" ng-if="!$saEmployeegroupCtrl.$$isFB"> 127 <div class="col-md-12 employee-select-cont" ng-if="!$saEmployeegroupCtrl.$$isFB">
@@ -140,8 +151,10 @@ @@ -140,8 +151,10 @@
140 <!-- 分班 --> 151 <!-- 分班 -->
141 <div class="col-md-12 employee-input" ng-if="$saEmployeegroupCtrl.$$isFB"> 152 <div class="col-md-12 employee-input" ng-if="$saEmployeegroupCtrl.$$isFB">
142 <div class="col-md-12"> 153 <div class="col-md-12">
143 - 已经选中的分班人员列表,共{{$saEmployeegroupCtrl.$$dataFBSelected.length}}组,  
144 - 初始分班人员,{{$saEmployeegroupCtrl.$$dataFBSelectedStart == undefined ? "未选择" : "第" + ($saEmployeegroupCtrl.$$dataFBSelectedStart + 1) + "组"}} 154 + <small>
  155 + 已经选中的分班人员列表,共{{$saEmployeegroupCtrl.$$dataFBSelected.length}}组,
  156 + 初始分班人员,{{$saEmployeegroupCtrl.$$dataFBSelectedStart == undefined ? "未选择" : "第" + ($saEmployeegroupCtrl.$$dataFBSelectedStart + 1) + "组"}}
  157 + </small>
145 </div> 158 </div>
146 </div> 159 </div>
147 <div class="col-md-12 employee-select-cont" ng-if="$saEmployeegroupCtrl.$$isFB"> 160 <div class="col-md-12 employee-select-cont" ng-if="$saEmployeegroupCtrl.$$isFB">
src/main/resources/static/pages/scheduleApp/module/common/dts2/guideboardGroup/saGuideboardgroup.js
@@ -29,7 +29,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -29,7 +29,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
29 bindToController: true, 29 bindToController: true,
30 controller: function($scope) { 30 controller: function($scope) {
31 var self = this; 31 var self = this;
32 - self.$$data = []; // 选择线路后,该线路的路牌数据 32 + self.$$dataReal = []; // 选择线路后,该线路的路牌数据
  33 + self.$$data = []; // 页面最多显示10条,可以通过$$searchText筛选
33 34
34 // 测试数据 35 // 测试数据
35 //self.$$data = [ 36 //self.$$data = [
@@ -38,7 +39,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -38,7 +39,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
38 // {lpid: 3, lpname: '路3', isstart: false} 39 // {lpid: 3, lpname: '路3', isstart: false}
39 //]; 40 //];
40 41
41 - 42 + self.$$searchText = undefined; // 搜索值
42 self.$$dataSelected = []; // 选中的路牌列表 43 self.$$dataSelected = []; // 选中的路牌列表
43 self.$$dataSelectedStart = undefined; // 起始路牌 44 self.$$dataSelectedStart = undefined; // 起始路牌
44 45
@@ -100,7 +101,48 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -100,7 +101,48 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
100 scope[ctrlAs]["$name_attr"] = $name_attr; 101 scope[ctrlAs]["$name_attr"] = $name_attr;
101 } 102 }
102 103
103 - // TODO: 104 + // 监听搜索框,keydwon,keyup事件
  105 + tElem.on('keydown', '[name=lpsearch]', function(event) {
  106 + if (event.keyCode == 13) { // 阻止回车事件造成的form提交
  107 + return false;
  108 + }
  109 + });
  110 + tElem.on('keyup', '[name=lpsearch]', function() {
  111 + console.log(scope[ctrlAs]["$$searchText"]);
  112 + var sText = scope[ctrlAs]["$$searchText"];
  113 + if (sText && sText != "") {
  114 + // 因为在dom事件里修改了model的值,必须写在scope.$apply中,否则页面上绑定效果无
  115 + // 另一种做法可以写在$watch方法中
  116 + scope.$apply(function() {
  117 + scope[ctrlAs].$$data = [];
  118 + for (var k = 0; k < scope[ctrlAs].$$dataReal.length; k++) {
  119 + var upTerm = sText.toUpperCase();
  120 + if (scope[ctrlAs].$$data.length < 10) {
  121 + if (scope[ctrlAs].$$dataReal[k].$fullChars.indexOf(upTerm) != -1
  122 + || scope[ctrlAs].$$dataReal[k].$camelChars.indexOf(upTerm) != -1
  123 + || scope[ctrlAs].$$dataReal[k].lpname.indexOf(upTerm) != -1) {
  124 + //scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$dataReal[k]));
  125 +
  126 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[k]);
  127 + }
  128 + } else {
  129 + break;
  130 + }
  131 + }
  132 + });
  133 + } else {
  134 + scope.$apply(function() {
  135 + scope[ctrlAs].$$data = [];
  136 + for (var i = 0; i < scope[ctrlAs].$$dataReal.length; i++) {
  137 + if (scope[ctrlAs].$$data.length < 10) {
  138 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[i]);
  139 + } else {
  140 + break;
  141 + }
  142 + }
  143 + });
  144 + }
  145 + });
104 146
105 147
106 /** 148 /**
@@ -272,7 +314,6 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -272,7 +314,6 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
272 } 314 }
273 ); 315 );
274 316
275 -  
276 // 监控线路id的变化 317 // 监控线路id的变化
277 attr.$observe("xlidvalue", function(value) { 318 attr.$observe("xlidvalue", function(value) {
278 if (value && value != "") { 319 if (value && value != "") {
@@ -284,18 +325,32 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -284,18 +325,32 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
284 // 获取值了 325 // 获取值了
285 console.log("路牌获取了"); 326 console.log("路牌获取了");
286 327
  328 + scope[ctrlAs].$$dataReal = [];
  329 + angular.forEach(result.content, function(obj) {
  330 + this.push({
  331 + lpid: obj.id,
  332 + lpname: obj.lpName,
  333 + isstart: false,
  334 + '$fullChars': pinyin.getFullChars(obj.lpName), // 全拼
  335 + '$camelChars': pinyin.getCamelChars(obj.lpName) // 简拼
  336 + });
  337 + }, scope[ctrlAs].$$dataReal);
  338 +
287 scope[ctrlAs].$$data = []; 339 scope[ctrlAs].$$data = [];
288 - for (var i = 0; i < result.content.length; i++) {  
289 - scope[ctrlAs].$$data.push({  
290 - lpid: result.content[i].id,  
291 - lpname: result.content[i].lpName,  
292 - isstart: false  
293 - }); 340 + for (var i = 0; i < scope[ctrlAs].$$dataReal.length; i++) {
  341 + if (scope[ctrlAs].$$data.length < 10) {
  342 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[i]);
  343 + } else {
  344 + break;
  345 + }
294 } 346 }
  347 +
295 if (scope[ctrlAs].$$data_init) { 348 if (scope[ctrlAs].$$data_init) {
296 scope[ctrlAs].$$dataSelected = []; 349 scope[ctrlAs].$$dataSelected = [];
297 scope[ctrlAs].$$dataSelectedStart = undefined; 350 scope[ctrlAs].$$dataSelectedStart = undefined;
298 scope[ctrlAs].$$internalmodel = undefined; 351 scope[ctrlAs].$$internalmodel = undefined;
  352 +
  353 + scope[ctrlAs].$$searchText = undefined;
299 } 354 }
300 scope[ctrlAs].$$data_xl_first_init = true; 355 scope[ctrlAs].$$data_xl_first_init = true;
301 }, 356 },
src/main/resources/static/pages/scheduleApp/module/common/dts2/guideboardGroup/saGuideboardgroupTemplate.html
@@ -46,8 +46,14 @@ @@ -46,8 +46,14 @@
46 46
47 <div class="col-md-12 guideboard-select"> 47 <div class="col-md-12 guideboard-select">
48 <div class="col-md-12 guideboard-input"> 48 <div class="col-md-12 guideboard-input">
49 - <div class="col-md-9">  
50 - 路牌列表,共{{$saGuideboardgroupCtrl.$$data.length}}个 49 + <div class="col-md-7" style="padding-right: 0px;">
  50 + <small>
  51 + 路牌列表,共{{$saGuideboardgroupCtrl.$$dataReal.length}}个,筛选{{$saGuideboardgroupCtrl.$$data.length}}个(最多10个)
  52 + </small>
  53 + </div>
  54 + <div class="col-md-3" style="padding-left: 0px;">
  55 + <input name="lpsearch" ng-model="$saGuideboardgroupCtrl.$$searchText"
  56 + type="text" class="input-sm" style="height: 20px; border: 1px solid #32C5D2;" placeholder="输入路牌名字..."/>
51 </div> 57 </div>
52 </div> 58 </div>
53 <div class="col-md-12 guideboard-select-cont"> 59 <div class="col-md-12 guideboard-select-cont">
@@ -62,8 +68,10 @@ @@ -62,8 +68,10 @@
62 </div> 68 </div>
63 <div class="col-md-12 guideboard-input"> 69 <div class="col-md-12 guideboard-input">
64 <div class="col-md-12"> 70 <div class="col-md-12">
65 - 已经选中的路牌列表,共{{$saGuideboardgroupCtrl.$$dataSelected.length}}个,  
66 - 初始路牌,{{$saGuideboardgroupCtrl.$$dataSelectedStart == undefined ? "未选择" : "第" + ($saGuideboardgroupCtrl.$$dataSelectedStart + 1) + "个"}} 71 + <small>
  72 + 已经选中的路牌列表,共{{$saGuideboardgroupCtrl.$$dataSelected.length}}个,
  73 + 初始路牌,{{$saGuideboardgroupCtrl.$$dataSelectedStart == undefined ? "未选择" : "第" + ($saGuideboardgroupCtrl.$$dataSelectedStart + 1) + "个"}}
  74 + </small>
67 </div> 75 </div>
68 </div> 76 </div>
69 <div class="col-md-12 guideboard-select-cont"> 77 <div class="col-md-12 guideboard-select-cont">
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
@@ -2234,7 +2234,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -2234,7 +2234,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
2234 bindToController: true, 2234 bindToController: true,
2235 controller: function($scope) { 2235 controller: function($scope) {
2236 var self = this; 2236 var self = this;
2237 - self.$$data = []; // 选择线路后,该线路的路牌数据 2237 + self.$$dataReal = []; // 选择线路后,该线路的路牌数据
  2238 + self.$$data = []; // 页面最多显示10条,可以通过$$searchText筛选
2238 2239
2239 // 测试数据 2240 // 测试数据
2240 //self.$$data = [ 2241 //self.$$data = [
@@ -2243,7 +2244,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -2243,7 +2244,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
2243 // {lpid: 3, lpname: '路3', isstart: false} 2244 // {lpid: 3, lpname: '路3', isstart: false}
2244 //]; 2245 //];
2245 2246
2246 - 2247 + self.$$searchText = undefined; // 搜索值
2247 self.$$dataSelected = []; // 选中的路牌列表 2248 self.$$dataSelected = []; // 选中的路牌列表
2248 self.$$dataSelectedStart = undefined; // 起始路牌 2249 self.$$dataSelectedStart = undefined; // 起始路牌
2249 2250
@@ -2305,7 +2306,48 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -2305,7 +2306,48 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
2305 scope[ctrlAs]["$name_attr"] = $name_attr; 2306 scope[ctrlAs]["$name_attr"] = $name_attr;
2306 } 2307 }
2307 2308
2308 - // TODO: 2309 + // 监听搜索框,keydwon,keyup事件
  2310 + tElem.on('keydown', '[name=lpsearch]', function(event) {
  2311 + if (event.keyCode == 13) { // 阻止回车事件造成的form提交
  2312 + return false;
  2313 + }
  2314 + });
  2315 + tElem.on('keyup', '[name=lpsearch]', function() {
  2316 + console.log(scope[ctrlAs]["$$searchText"]);
  2317 + var sText = scope[ctrlAs]["$$searchText"];
  2318 + if (sText && sText != "") {
  2319 + // 因为在dom事件里修改了model的值,必须写在scope.$apply中,否则页面上绑定效果无
  2320 + // 另一种做法可以写在$watch方法中
  2321 + scope.$apply(function() {
  2322 + scope[ctrlAs].$$data = [];
  2323 + for (var k = 0; k < scope[ctrlAs].$$dataReal.length; k++) {
  2324 + var upTerm = sText.toUpperCase();
  2325 + if (scope[ctrlAs].$$data.length < 10) {
  2326 + if (scope[ctrlAs].$$dataReal[k].$fullChars.indexOf(upTerm) != -1
  2327 + || scope[ctrlAs].$$dataReal[k].$camelChars.indexOf(upTerm) != -1
  2328 + || scope[ctrlAs].$$dataReal[k].lpname.indexOf(upTerm) != -1) {
  2329 + //scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$dataReal[k]));
  2330 +
  2331 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[k]);
  2332 + }
  2333 + } else {
  2334 + break;
  2335 + }
  2336 + }
  2337 + });
  2338 + } else {
  2339 + scope.$apply(function() {
  2340 + scope[ctrlAs].$$data = [];
  2341 + for (var i = 0; i < scope[ctrlAs].$$dataReal.length; i++) {
  2342 + if (scope[ctrlAs].$$data.length < 10) {
  2343 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[i]);
  2344 + } else {
  2345 + break;
  2346 + }
  2347 + }
  2348 + });
  2349 + }
  2350 + });
2309 2351
2310 2352
2311 /** 2353 /**
@@ -2477,7 +2519,6 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -2477,7 +2519,6 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
2477 } 2519 }
2478 ); 2520 );
2479 2521
2480 -  
2481 // 监控线路id的变化 2522 // 监控线路id的变化
2482 attr.$observe("xlidvalue", function(value) { 2523 attr.$observe("xlidvalue", function(value) {
2483 if (value && value != "") { 2524 if (value && value != "") {
@@ -2489,18 +2530,32 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [ @@ -2489,18 +2530,32 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saGuideboardgroup&#39;, [
2489 // 获取值了 2530 // 获取值了
2490 console.log("路牌获取了"); 2531 console.log("路牌获取了");
2491 2532
  2533 + scope[ctrlAs].$$dataReal = [];
  2534 + angular.forEach(result.content, function(obj) {
  2535 + this.push({
  2536 + lpid: obj.id,
  2537 + lpname: obj.lpName,
  2538 + isstart: false,
  2539 + '$fullChars': pinyin.getFullChars(obj.lpName), // 全拼
  2540 + '$camelChars': pinyin.getCamelChars(obj.lpName) // 简拼
  2541 + });
  2542 + }, scope[ctrlAs].$$dataReal);
  2543 +
2492 scope[ctrlAs].$$data = []; 2544 scope[ctrlAs].$$data = [];
2493 - for (var i = 0; i < result.content.length; i++) {  
2494 - scope[ctrlAs].$$data.push({  
2495 - lpid: result.content[i].id,  
2496 - lpname: result.content[i].lpName,  
2497 - isstart: false  
2498 - }); 2545 + for (var i = 0; i < scope[ctrlAs].$$dataReal.length; i++) {
  2546 + if (scope[ctrlAs].$$data.length < 10) {
  2547 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[i]);
  2548 + } else {
  2549 + break;
  2550 + }
2499 } 2551 }
  2552 +
2500 if (scope[ctrlAs].$$data_init) { 2553 if (scope[ctrlAs].$$data_init) {
2501 scope[ctrlAs].$$dataSelected = []; 2554 scope[ctrlAs].$$dataSelected = [];
2502 scope[ctrlAs].$$dataSelectedStart = undefined; 2555 scope[ctrlAs].$$dataSelectedStart = undefined;
2503 scope[ctrlAs].$$internalmodel = undefined; 2556 scope[ctrlAs].$$internalmodel = undefined;
  2557 +
  2558 + scope[ctrlAs].$$searchText = undefined;
2504 } 2559 }
2505 scope[ctrlAs].$$data_xl_first_init = true; 2560 scope[ctrlAs].$$data_xl_first_init = true;
2506 }, 2561 },
@@ -2609,7 +2664,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -2609,7 +2664,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
2609 bindToController: true, 2664 bindToController: true,
2610 controller: function($scope) { 2665 controller: function($scope) {
2611 var self = this; 2666 var self = this;
2612 - self.$$data = []; // 选择线路后,该线路的人员配置数据 2667 + self.$$dataReal = []; // 选择线路后,该线路的人员配置数据
  2668 + self.$$data = []; // 页面最多显示10条,可以通过$$searchText筛选
2613 2669
2614 // 测试数据 2670 // 测试数据
2615 //self.$$data = [ 2671 //self.$$data = [
@@ -2618,6 +2674,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -2618,6 +2674,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
2618 // {id: 3, dbbm: "3", jsy: '忍3', spy: '守3'} 2674 // {id: 3, dbbm: "3", jsy: '忍3', spy: '守3'}
2619 //]; 2675 //];
2620 2676
  2677 + self.$$searchText = undefined; // 搜索值
2621 self.$$dataSelected = []; // 选中的人员配置列表 2678 self.$$dataSelected = []; // 选中的人员配置列表
2622 self.$$dataSelectedStart = undefined; // 起始人员配置 2679 self.$$dataSelectedStart = undefined; // 起始人员配置
2623 2680
@@ -2698,6 +2755,48 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -2698,6 +2755,48 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
2698 scope[ctrlAs]["$name_attr"] = $name_attr; 2755 scope[ctrlAs]["$name_attr"] = $name_attr;
2699 } 2756 }
2700 2757
  2758 + // 监听搜索框,keydwon,keyup事件
  2759 + tElem.on('keydown', '[name=rysearch]', function(event) {
  2760 + if (event.keyCode == 13) { // 阻止回车事件造成的form提交
  2761 + return false;
  2762 + }
  2763 + });
  2764 + tElem.on('keyup', '[name=rysearch]', function() {
  2765 + console.log(scope[ctrlAs]["$$searchText"]);
  2766 + var sText = scope[ctrlAs]["$$searchText"];
  2767 + if (sText && sText != "") {
  2768 + // 因为在dom事件里修改了model的值,必须写在scope.$apply中,否则页面上绑定效果无
  2769 + // 另一种做法可以写在$watch方法中
  2770 + scope.$apply(function() {
  2771 + scope[ctrlAs].$$data = [];
  2772 + for (var k = 0; k < scope[ctrlAs].$$dataReal.length; k++) {
  2773 + var upTerm = sText.toUpperCase();
  2774 + if (scope[ctrlAs].$$data.length < 10) {
  2775 + if (scope[ctrlAs].$$dataReal[k].$fullChars.indexOf(upTerm) != -1
  2776 + || scope[ctrlAs].$$dataReal[k].$camelChars.indexOf(upTerm) != -1
  2777 + || scope[ctrlAs].$$dataReal[k].$str.indexOf(upTerm) != -1) {
  2778 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[k]);
  2779 + }
  2780 + } else {
  2781 + break;
  2782 + }
  2783 + }
  2784 + });
  2785 + } else {
  2786 + scope.$apply(function() {
  2787 + scope[ctrlAs].$$data = [];
  2788 + for (var i = 0; i < scope[ctrlAs].$$dataReal.length; i++) {
  2789 + if (scope[ctrlAs].$$data.length < 10) {
  2790 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[i]);
  2791 + } else {
  2792 + break;
  2793 + }
  2794 + }
  2795 + });
  2796 + }
  2797 + });
  2798 +
  2799 +
2701 /** 2800 /**
2702 * 人员配置列表点击(人员配置列表中选中路牌) 2801 * 人员配置列表点击(人员配置列表中选中路牌)
2703 * @param $index 2802 * @param $index
@@ -3153,15 +3252,37 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -3153,15 +3252,37 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
3153 // 获取值了 3252 // 获取值了
3154 console.log("人员配置获取了"); 3253 console.log("人员配置获取了");
3155 3254
3156 - scope[ctrlAs].$$data = [];  
3157 - for (var i = 0; i < result.content.length; i++) {  
3158 - scope[ctrlAs].$$data.push({  
3159 - id: result.content[i].id,  
3160 - dbbm: result.content[i].dbbm,  
3161 - jsy: result.content[i].jsy.personnelName,  
3162 - spy: result.content[i].spy == null ? "" : result.content[i].spy.personnelName 3255 + scope[ctrlAs].$$dataReal = [];
  3256 + angular.forEach(result.content, function(obj) {
  3257 + var n1 = obj.jsy == null ? "" : (obj.jsy.personnelName || "");
  3258 + var n2 = obj.spy == null ? "" : (obj.spy.personnelName || "");
  3259 + var c1 = obj.jsy == null ? "" : (obj.jsy.jobCode || "");
  3260 + var c2 = obj.spy == null ? "" : (obj.spy.jobCode || "");
  3261 + var str = [];
  3262 + str.push(n1);
  3263 + str.push(n2);
  3264 + str.push(c1);
  3265 + str.push(c2);
  3266 + this.push({
  3267 + id: obj.id,
  3268 + dbbm: obj.dbbm,
  3269 + jsy: n1,
  3270 + spy: n2,
  3271 + '$fullChars': pinyin.getFullChars(str.join("-")), // 全拼
  3272 + '$camelChars': pinyin.getCamelChars(str.join("-")), // 简拼
  3273 + '$str': str.join("-")
3163 }); 3274 });
  3275 + }, scope[ctrlAs].$$dataReal);
  3276 +
  3277 + scope[ctrlAs].$$data = [];
  3278 + for (var i = 0; i < scope[ctrlAs].$$dataReal.length; i++) {
  3279 + if (scope[ctrlAs].$$data.length < 10) {
  3280 + scope[ctrlAs].$$data.push(scope[ctrlAs].$$dataReal[i]);
  3281 + } else {
  3282 + break;
  3283 + }
3164 } 3284 }
  3285 +
3165 if (scope[ctrlAs].$$data_init) { 3286 if (scope[ctrlAs].$$data_init) {
3166 scope[ctrlAs].$$dataSelected = []; 3287 scope[ctrlAs].$$dataSelected = [];
3167 scope[ctrlAs].$$dataSelectedStart = undefined; 3288 scope[ctrlAs].$$dataSelectedStart = undefined;
@@ -3171,6 +3292,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [ @@ -3171,6 +3292,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saEmployeegroup&#39;, [
3171 scope[ctrlAs].$$dataFBSelectedStart = undefined; 3292 scope[ctrlAs].$$dataFBSelectedStart = undefined;
3172 3293
3173 scope[ctrlAs].$$internalmodel = undefined; 3294 scope[ctrlAs].$$internalmodel = undefined;
  3295 +
  3296 + scope[ctrlAs].$$searchText = undefined;
3174 } 3297 }
3175 scope[ctrlAs].$$data_xl_first_init = true; 3298 scope[ctrlAs].$$data_xl_first_init = true;
3176 }, 3299 },