initTab: function() { var _this = this; var widget = this.get('doms').widget_tab; var titles = widget.find('[data-elems="tabtitle"]'); var tab = new Tab({ doms: { widget: widget, titles: titles, bodys: widget.find('[data-elems="tabbody"]') } }); tab.on('change:tab', function(e) { if (e.idx == 3) { } else { $('#comp_detail').off(); } }); },
require.async(['calendar','holiday','gri.chart'], function() { var widget = $('#widget-tab'); var tab = new Tab({ doms: { widget: widget, titles: widget.find('[data-elems="tabtitle"]'), bodys: widget.find('[data-elems="tabbody"]') } }); var $content = $('#content'); new Logout(); var vg = new ViewGx(); var vd; var vw; var vgx; tab.on('change:tab', function(e) { $content.find('.content-header-title h2').text(e.title.text()); var hash = e.title.attr('data-hash'); if (hash) { $.history.load(hash); } //window.scrollTo(0,0); switch (parseInt(e.idx)) { case 1: if (!vd) { vd = new ViewData(); } break; case 2: if (!vw) { vw = new ViewWg(); } break; case 3: if (!vgx) { vgx = new ViewGtx(); } default: } }); // 0 管理员列表,1数据管理员,2单位用户,3个人用户 $.history.init(function(hash){ if (hash == 'gx') { tab.change(0); } else if (hash == 'hz') { if (userType == '3') { tab.change(0); }else{ tab.change(1); if (!vd) { vd = new ViewData(); } } } else if (hash == 'gt') { tab.change(2); }else{ tab.change(0); } /*else if(hash == 'gtx'){ tab.change(3); }*/ }); if (!vw) { vw = new ViewWg(); } vw.on('view:index',function(e){ if (!vgx) { vgx = new ViewGtx(); } tab.change(3); vgx.emit('view:index',e); }); });