提交 | 用户 | age
|
a6a76f
|
1 |
//检查系统是否停止使用 Added by Johns Wang ,2017-05-26 |
F |
2 |
var maintaince={ |
bd5ba7
|
3 |
dbid:null, |
X |
4 |
isStop:null, |
|
5 |
checkSysIsExpired:function(){ |
|
6 |
if (!maintaince.dbid || maintaince.dbid == "" || maintaince.dbid == "null") { |
|
7 |
location.reload(); |
|
8 |
return ; |
|
9 |
} |
|
10 |
$.post("/shopping/maintaince/maintaince.do?m=info&data_base_id="+maintaince.dbid, |
|
11 |
function(data){ |
|
12 |
var isSystemStop = data["isstop"] ; |
|
13 |
var redirect = data["redirect"]; |
|
14 |
//处理重定向到 login.jsp 页面 |
|
15 |
if(isSystemStop && maintaince.isStop && maintaince.isStop != isSystemStop && redirect){ |
|
16 |
location = redirect; |
|
17 |
return ; |
|
18 |
} |
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
},"json") |
a6a76f
|
23 |
} |
F |
24 |
} |
|
25 |
var messagehint={ |
|
26 |
//获取系统级提示消息 |
bd5ba7
|
27 |
popupMessageHint:function(){ |
X |
28 |
$.post("/messagehint.do", |
|
29 |
function(data){ |
|
30 |
for (i in data["warning"]) { |
|
31 |
if (data["warning"][i]["messagetxt"]) { |
|
32 |
var messageType = data["warning"][i]["messagetype"] ; |
|
33 |
var myMessages = data["warning"][i]["messagetxt"] ; |
|
34 |
//myMessages += data["warning"][i]["topic"] + "<hr/>" ; |
|
35 |
|
|
36 |
//替换所有的制表符 |
|
37 |
myMessages = myMessages.replace(/\t/g," "); |
|
38 |
|
|
39 |
//替换所有的换行符 |
|
40 |
myMessages = myMessages.replace(/\r\n/g,"<br>") |
|
41 |
myMessages = myMessages.replace(/\n/g,"<br>"); |
|
42 |
|
|
43 |
//替换所有的空格(中文空格、英文空格都会被替换) |
|
44 |
myMessages = myMessages.replace(/\s/g," "); |
|
45 |
|
|
46 |
myMessages +="<br/><br/><hr/>" ; |
|
47 |
myMessages += data["warning"][i]["createusername"] + " " |
|
48 |
+ data["warning"][i]["createtime"] ; |
|
49 |
/* |
|
50 |
//显示提示框 |
|
51 |
$().toastmessage('showToast', { |
|
52 |
inEffectDuration:600, |
|
53 |
stayTime: 100000000, //停留10秒(10000),然后关闭 , |
|
54 |
text : myMessages, |
|
55 |
sticky : false, |
|
56 |
position : 'top-right', |
|
57 |
type : messageType |
|
58 |
}); |
|
59 |
*/ |
|
60 |
$.toast({ |
|
61 |
text: myMessages, // Text that is to be shown in the toast |
|
62 |
heading: data["warning"][i]["topic"] , // Optional heading to be shown on the toast |
|
63 |
|
|
64 |
showHideTransition: 'plain', // fade, slide or plain |
|
65 |
allowToastClose: true, // Boolean value true or false |
|
66 |
hideAfter: false, // false to make it sticky or number representing the miliseconds as time after which toast needs to be hidden |
|
67 |
stack: 5, // false if there should be only one toast at a time or a number representing the maximum number of toasts to be shown at a time |
|
68 |
position: 'top-right', // bottom-left or bottom-right or bottom-center or top-left or top-right or top-center or mid-center or an object representing the left, right, top, bottom values |
|
69 |
|
|
70 |
bgColor: '#444444', // Background color of the toast |
|
71 |
textColor: '#eeeeee', // Text color of the toast |
|
72 |
textAlign: 'left', // Text alignment i.e. left, right or center |
|
73 |
loader: true, // Whether to show loader or not. True by default |
|
74 |
loaderBg: '#9ec600', // Background color of the toast loader |
|
75 |
beforeShow: function () {}, // will be triggered before the toast is shown |
|
76 |
afterShown: function () {}, // will be triggered after the toat has been shown |
|
77 |
beforeHide: function () {}, // will be triggered before the toast gets hidden |
|
78 |
afterHidden: function () {} // will be triggered after the toast has been hidden |
|
79 |
}); |
|
80 |
|
|
81 |
} |
|
82 |
|
|
83 |
} |
|
84 |
},"json") |
|
85 |
} |
|
86 |
|
a6a76f
|
87 |
} |