|
楼主 |
发表于 2020-10-15 14:28:57
|
显示全部楼层
Model.prototype.afterLogin = function() {
this.__logined = true;
var context = this.getContext();
this.isDebugMode = context.isDebug();
var me = this;
// 控制开发模式刷新
$(selectors.reload)[this.isDebugMode ? 'show' : 'hide']();
// 显示登陆者名称
var userName = context.getCurrentPersonName();
$(selectors.username).html(userName);
// 获取代办任务数
var waitTaskCfg = this._cfg.waitTask;
if (!waitTaskCfg.disabled) {
$(selectors.waitTask).on('click', function() {
me.showPage(waitTaskCfg.xid);
});
this.refreshWaitTaskCount();
}
// 登录后完成
if (this.hasListener('onLogin')) {
var eData = {
source : this,
context : context
};
this.fireEvent('onLogin', eData);
}
// 初始化代理
this.createAgent();
// 初始化功能树
this.createFunctionTree();
// 默认展开南宁卷烟厂
if ($(".sidebar-menu").find(".treeview.cFNvY7v")) {
$(".sidebar-menu").find(".treeview.cFNvY7v .x-functree-icon.dataControl.dataControl-enterprise.cFNvY7v").click();
}
// 加载主页面
var loginDtdResolve = function() {
if (me.loginDtd)
me.loginDtd.resolve();
};
var count = 0;
var me = this;
var params = new biz.Request.ActionParam();
var response = biz.Request.sendBizRequest({
contentType : "application/json",
dataType : "application/json",
process : "/SA/OPM/system/systemProcess",
activity : "mainActivity",
action : 'flagShowGraphAction',
directExecute : true,
parameters : params,
context : this.getContext(),
callback : function(resultData) {
if (resultData && resultData.state) {
count = resultData.response;
}
}
});
// 显示消息提醒信息
var MessageCount = 0;
biz.Request.sendBizRequest({
action : "getMessageNumAction",
context : this.getContext(),
dataType : "json",
"process" : "/yjgs/gdgl/wxtzd/process/wxtzd/wxtzdProcess",
"activity" : "mainActivity",
callback : function(result) {
if (result.state) {
MessageCount = result.response; // 获取返回的系统公告
} else {
// throw new Error("调用失败!|" + result.response.message);
}
}
});
// 大于0表示不显示,否则显示
if (count == 0) {
var me = this;
setTimeout(function() {
justep.Shell.showPage("$UI/yjgs/graphinfo/process/graphinfo/stt_TZCKGL_Activity.w?process=/yjgs/graphinfo/process/graphinfo/graphinfoProcess&activity=stt_TZCKGL_Activity");
if (MessageCount > 0) {
me.comp("messageWdg").open();
}
}, 500);
} else {
if (MessageCount > 0) {
this.comp("messageWdg").open();
}
}
if (this._cfg.main.show) {
this.showPage(mainPageKey).done(loginDtdResolve);
} else {
loginDtdResolve();
}
};
|
|