You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.7 KiB
JavaScript

9 months ago
function $(id){
return document.getElementById(id);
}
function saveSetting(){
var ckTimes = $("ck_interval").checked;
var txtTimesVal = $("txt_interval").value;
var iTimes = parseInt(txtTimesVal);
if(iTimes < 1 || iTimes > 30){
alert("间隔时间不能小于1分钟 大于30分钟");
}
var isSys = $("ck_sys").checked?1:0;
var isApply = $("ck_apply").checked?1:0;
var isAudit = $("ck_audit").checked?1:0;
if(ckTimes && iTimes > 0){
var readUrl = "MessageService.aspx?handle=saveuserset&times="+iTimes+"&issys="+isSys+"&isapp="+isApply+"&isaudit="+isAudit+"&uid="+newGuid();
var loader = dhtmlxAjax.getSync(readUrl);
var loadVal = loader.xmlDoc.responseText;
var state = parseInt(loadVal);
if(state == 1){
window.close();
}
}else if(!ckTimes){
var readUrl = "MessageService.aspx?handle=deleteuserset&uid="+newGuid();
var loader = dhtmlxAjax.getSync(readUrl);
var loadVal = loader.xmlDoc.responseText;
var state = parseInt(loadVal);
if(state == 1){
window.close();
}
}
}
this.newGuid = function(){
var guid = "";
for (var i = 1; i <= 32; i++){
var n = Math.floor(Math.random()*16.0).toString(16);
guid += n;
if((i==8)||(i==12)||(i==16)||(i==20))
guid += "-";
}
return guid.toUpperCase();
};
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,""); }
function checkInterval(id){
var ckboxState = $(id).checked;
if(ckboxState){
$("txt_interval").disabled = false;
}else{
$("txt_interval").disabled = true;
}
}