Commit b047a78a55cfb152b94e5e6c492548dd787f7be8
1 parent
3c1116b3
事件解绑
Showing
5 changed files
with
26 additions
and
9 deletions
resource/js/unit.js
@@ -10,9 +10,9 @@ sysComm = { | @@ -10,9 +10,9 @@ sysComm = { | ||
10 | 10 | ||
11 | //阿里云测试环境,别删 | 11 | //阿里云测试环境,别删 |
12 | 12 | ||
13 | -//var parkcloudbaseUrl = 'http://192.168.1.196:8100/';// url公用地址 | 13 | +var parkcloudbaseUrl = 'http://192.168.1.196:8101/';// url公用地址 |
14 | 14 | ||
15 | -var parkcloudbaseUrl = 'http://127.0.0.1:8100/';// url公用地址 | 15 | +// var parkcloudbaseUrl = 'http://127.0.0.1:8100/';// url公用地址 |
16 | 16 | ||
17 | 17 | ||
18 | 18 | ||
@@ -567,5 +567,22 @@ var commonClass = { | @@ -567,5 +567,22 @@ var commonClass = { | ||
567 | } | 567 | } |
568 | } | 568 | } |
569 | } | 569 | } |
570 | +/** | ||
571 | + * jquery 解绑绑定函数.<br/> | ||
572 | + * wangfs 2018-01-11.<br/> | ||
573 | + */ | ||
574 | +var documentBindFunc ={ | ||
575 | + /** | ||
576 | + * @param event 事件名称如:click | ||
577 | + * @param element 元素 如:id,class 元素等 | ||
578 | + * @param func 函数 | ||
579 | + * 例子:documentBindFunc.on('click','#berthmanage-addBtn',function () {}); | ||
580 | + */ | ||
581 | + on: function (event, element, func) { | ||
582 | + $(document).off(event, element); | ||
583 | + $(document).on(event, element, func); | ||
584 | + } | ||
585 | + | ||
586 | +}; | ||
570 | 587 | ||
571 | $("#loginShowName").text(fn.getUserName()); | 588 | $("#loginShowName").text(fn.getUserName()); |
topages/hourscount/hourscount.js
@@ -100,7 +100,7 @@ var fun= { | @@ -100,7 +100,7 @@ var fun= { | ||
100 | }, | 100 | }, |
101 | //查询announce | 101 | //查询announce |
102 | queryBtn:function(){ | 102 | queryBtn:function(){ |
103 | - $(document).on('click','#queryBtn',function(){ | 103 | + documentBindFunc.on('click','#queryBtn',function(){ |
104 | fun.queryAsraDailyAllForList(); | 104 | fun.queryAsraDailyAllForList(); |
105 | }); | 105 | }); |
106 | }, | 106 | }, |
topages/staffmanage/staffmanage.js
@@ -88,7 +88,7 @@ var fun = { | @@ -88,7 +88,7 @@ var fun = { | ||
88 | return req; | 88 | return req; |
89 | }, | 89 | }, |
90 | queryBtn:function () { | 90 | queryBtn:function () { |
91 | - $("#queryBtn").on('click',function () { | 91 | + documentBindFunc.on('click','#queryBtn',function () { |
92 | fun.createTableData(); | 92 | fun.createTableData(); |
93 | }) | 93 | }) |
94 | } | 94 | } |
topages/workfill/workfill.js
@@ -49,7 +49,7 @@ var fun = { | @@ -49,7 +49,7 @@ var fun = { | ||
49 | }, | 49 | }, |
50 | //退出 | 50 | //退出 |
51 | logout:function(){ | 51 | logout:function(){ |
52 | - $(document).on('click','#logoutId',function(){ | 52 | + documentBindFunc.on('click','#logoutId',function(){ |
53 | fn.loginOut(); | 53 | fn.loginOut(); |
54 | }); | 54 | }); |
55 | }, | 55 | }, |
@@ -215,18 +215,18 @@ var fun = { | @@ -215,18 +215,18 @@ var fun = { | ||
215 | }; | 215 | }; |
216 | fun.init(); | 216 | fun.init(); |
217 | // 上一周点击time-opr-prevbtn | 217 | // 上一周点击time-opr-prevbtn |
218 | -$('#time-opr-prevbtn').on('click',function () { | 218 | +documentBindFunc.on('click','#time-opr-prevbtn',function () { |
219 | fun.timeoprprevbtn(); | 219 | fun.timeoprprevbtn(); |
220 | fun.getAsraDailyListMsg(); | 220 | fun.getAsraDailyListMsg(); |
221 | }); | 221 | }); |
222 | // 下一周点击time-opr-nextbtn | 222 | // 下一周点击time-opr-nextbtn |
223 | -$('#time-opr-nextbtn').on('click',function () { | 223 | +documentBindFunc.on('click','#time-opr-nextbtn',function () { |
224 | fun.timeoprnextbtn(); | 224 | fun.timeoprnextbtn(); |
225 | fun.getAsraDailyListMsg(); | 225 | fun.getAsraDailyListMsg(); |
226 | }); | 226 | }); |
227 | 227 | ||
228 | //提交事件 | 228 | //提交事件 |
229 | -$(document).on('click','.workfill-list-btn',function () { | 229 | +documentBindFunc.on('click','.workfill-list-btn',function () { |
230 | var _this=$(this); | 230 | var _this=$(this); |
231 | if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ | 231 | if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ |
232 | _this.text('提交'); | 232 | _this.text('提交'); |
topages/workquery/workquery.js
@@ -146,7 +146,7 @@ var fun={ | @@ -146,7 +146,7 @@ var fun={ | ||
146 | }, | 146 | }, |
147 | //查询announce | 147 | //查询announce |
148 | queryBtn:function(){ | 148 | queryBtn:function(){ |
149 | - $(document).on('click','#queryBtn',function(){ | 149 | + documentBindFunc.on('click','#queryBtn',function(){ |
150 | fun.queryAsraDailyAllForList(); | 150 | fun.queryAsraDailyAllForList(); |
151 | }); | 151 | }); |
152 | }, | 152 | }, |