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 | 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 | 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 | 588 | $("#loginShowName").text(fn.getUserName()); | ... | ... |
topages/hourscount/hourscount.js
topages/staffmanage/staffmanage.js
topages/workfill/workfill.js
... | ... | @@ -49,7 +49,7 @@ var fun = { |
49 | 49 | }, |
50 | 50 | //退出 |
51 | 51 | logout:function(){ |
52 | - $(document).on('click','#logoutId',function(){ | |
52 | + documentBindFunc.on('click','#logoutId',function(){ | |
53 | 53 | fn.loginOut(); |
54 | 54 | }); |
55 | 55 | }, |
... | ... | @@ -215,18 +215,18 @@ var fun = { |
215 | 215 | }; |
216 | 216 | fun.init(); |
217 | 217 | // 上一周点击time-opr-prevbtn |
218 | -$('#time-opr-prevbtn').on('click',function () { | |
218 | +documentBindFunc.on('click','#time-opr-prevbtn',function () { | |
219 | 219 | fun.timeoprprevbtn(); |
220 | 220 | fun.getAsraDailyListMsg(); |
221 | 221 | }); |
222 | 222 | // 下一周点击time-opr-nextbtn |
223 | -$('#time-opr-nextbtn').on('click',function () { | |
223 | +documentBindFunc.on('click','#time-opr-nextbtn',function () { | |
224 | 224 | fun.timeoprnextbtn(); |
225 | 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 | 230 | var _this=$(this); |
231 | 231 | if(_this.parent().parent().find('.workfill-list-projectnamewrap .workfill-projectCon').hasClass('display-none')){ |
232 | 232 | _this.text('提交'); | ... | ... |
topages/workquery/workquery.js