2018-08-03 19:51:56 +08:00
|
|
|
|
$(document).ready(function() {
|
2018-11-28 19:23:38 +08:00
|
|
|
|
// 隱藏日誌詳情
|
2018-12-04 11:52:21 +08:00
|
|
|
|
// $("table.logTb .icon-book-open").hide();
|
2018-08-03 19:51:56 +08:00
|
|
|
|
// 界面鼠标悬停事件
|
2018-11-05 10:36:58 +08:00
|
|
|
|
/* $("table.logTb").find("td").not(":has(a)").bind("mouseover", function(){
|
2018-08-14 10:51:27 +08:00
|
|
|
|
var str = $(this).html(this.innerHTML.trim()).text();
|
|
|
|
|
|
//解决火狐title不能自动换行
|
|
|
|
|
|
var count = Math.floor(str.length/64);
|
|
|
|
|
|
for(var i=1;i<=count;i++){
|
|
|
|
|
|
str=str.substring(0,i*64-1)+"\n"+str.substring(i*64-1);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.title=str;
|
2018-08-03 19:51:56 +08:00
|
|
|
|
});
|
2018-11-05 10:36:58 +08:00
|
|
|
|
var fontSize = 0;*/
|
2018-10-31 19:48:27 +08:00
|
|
|
|
/* $("table.logTb th").each(function(j){
|
2018-08-03 19:51:56 +08:00
|
|
|
|
// 判断是否支持currentStyle属性 是:IE 否:FF or Chrome
|
|
|
|
|
|
var finalStyle = this.currentStyle ? this.currentStyle : document.defaultView.getComputedStyle(this , null);
|
2018-08-08 21:14:09 +08:00
|
|
|
|
fontSize = (finalStyle.fontSize).replace("px","");
|
|
|
|
|
|
// 设置界面标题宽度(不包括第一列)
|
2018-08-06 17:56:35 +08:00
|
|
|
|
var px = getPixelsCount($(this).text(),fontSize)+32;
|
2018-08-03 19:51:56 +08:00
|
|
|
|
this.setAttribute('width',px+'px');
|
2018-08-13 18:11:37 +08:00
|
|
|
|
// URL列加宽
|
|
|
|
|
|
var th = this;
|
|
|
|
|
|
var thText = this.innerText;
|
2018-08-27 21:16:47 +08:00
|
|
|
|
//将字符串过宽的列增加宽度
|
|
|
|
|
|
$("table.logTb tbody tr").each(function(){
|
|
|
|
|
|
$(this).find("td").each(function(i){
|
|
|
|
|
|
var tdText = this.innerText;
|
2018-08-29 15:32:06 +08:00
|
|
|
|
if((tdText.trim().length > thText.trim().length) && j==i){
|
2018-08-27 21:16:47 +08:00
|
|
|
|
var px = getPixelsCount(thText,fontSize)+100;
|
|
|
|
|
|
th.setAttribute('width',px+'px');
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2018-08-13 18:11:37 +08:00
|
|
|
|
});
|
2018-10-31 19:48:27 +08:00
|
|
|
|
});*/
|
2018-08-08 21:14:09 +08:00
|
|
|
|
|
2018-10-31 19:48:27 +08:00
|
|
|
|
/* var tdString = "";
|
2018-08-08 21:14:09 +08:00
|
|
|
|
$("table.logTb tbody tr").each(function(){
|
|
|
|
|
|
tdString = $(this).find('td:first').text();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("table.logTb th:lt(1)").each(function(){
|
|
|
|
|
|
// 设置界面第一列标题宽度
|
|
|
|
|
|
var thString = $(this).text();
|
|
|
|
|
|
if(tdString.trim().length < thString.length){
|
|
|
|
|
|
var thPx = getPixelsCount(thString,fontSize)+32;
|
|
|
|
|
|
this.setAttribute('width',thPx+'px');
|
|
|
|
|
|
}else{
|
|
|
|
|
|
var tdPx = getPixelsCount(tdString,fontSize)+45;
|
|
|
|
|
|
this.setAttribute('width',tdPx+'px');
|
|
|
|
|
|
}
|
2018-10-31 19:48:27 +08:00
|
|
|
|
});*/
|
2018-08-03 19:51:56 +08:00
|
|
|
|
|
2018-08-29 21:58:56 +08:00
|
|
|
|
// 添加由配置界面跳转到日志查询界面后的返回按钮
|
2018-09-13 16:46:56 +08:00
|
|
|
|
var isLogTotalSearch = $("#isLogTotalSearch").val();
|
|
|
|
|
|
if(isLogTotalSearch != undefined && isLogTotalSearch != ''){
|
2018-08-31 16:17:22 +08:00
|
|
|
|
$(".theme-panel").html("<button type='button' onclick='back()' class='btn btn-primary'>"+$.validator.messages.go_back+"</button>");
|
2018-08-29 21:58:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
2018-08-03 19:51:56 +08:00
|
|
|
|
|
2018-08-08 21:14:09 +08:00
|
|
|
|
// 获取字符串对等的像素值
|
2018-08-03 19:51:56 +08:00
|
|
|
|
function getPixelsCount(str, strFontSize){
|
2018-08-08 21:14:09 +08:00
|
|
|
|
// 字符个数
|
2018-08-03 19:51:56 +08:00
|
|
|
|
var stringCharsCount = str.length;
|
|
|
|
|
|
|
|
|
|
|
|
// 像素值
|
|
|
|
|
|
var stringPixelsCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
var element = document.createElement("span");
|
|
|
|
|
|
element.style.fontSize = strFontSize; // 设置span的fontSize
|
|
|
|
|
|
element.style.visibility = "hidden"; // 设置span不可见
|
|
|
|
|
|
element.style.display = "inline-block";
|
|
|
|
|
|
element.style.wordBreak = "break-all !important";
|
|
|
|
|
|
|
|
|
|
|
|
document.body.appendChild(element);
|
|
|
|
|
|
for(var i = 0; i < stringCharsCount; i++){
|
|
|
|
|
|
if(str[i] == " "){
|
|
|
|
|
|
element.innerHTML = " ";
|
|
|
|
|
|
}else{
|
|
|
|
|
|
element.innerHTML = str[i];
|
|
|
|
|
|
}
|
|
|
|
|
|
stringPixelsCount += element.offsetWidth;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return stringPixelsCount;
|
2018-08-29 21:58:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
function back(){
|
|
|
|
|
|
// 获取配置界面URl并跳转
|
2018-12-14 14:17:09 +08:00
|
|
|
|
var url = sessionStorage.getItem('cfg_url');
|
|
|
|
|
|
var oldMenuName = sessionStorage.getItem('old_memu_name');
|
|
|
|
|
|
var functionId = url.substr(url.lastIndexOf("=")+1);
|
|
|
|
|
|
switchMenu("86",functionId,oldMenuName);
|
2018-08-29 21:58:56 +08:00
|
|
|
|
window.location.href = url;
|
2018-12-13 20:37:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
//对Date的扩展,将 Date 转化为指定格式的String
|
|
|
|
|
|
//月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
|
|
|
|
|
//年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
|
|
|
|
|
//例子:
|
|
|
|
|
|
//(new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
|
|
|
|
|
|
//(new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
|
|
|
|
|
|
Date.prototype.Format = function (fmt) {
|
|
|
|
|
|
var o = {
|
|
|
|
|
|
"M+": this.getMonth() + 1, //月份
|
|
|
|
|
|
"d+": this.getDate(), //日
|
|
|
|
|
|
"H+": this.getHours(), //小时
|
|
|
|
|
|
"m+": this.getMinutes(), //分
|
|
|
|
|
|
"s+": this.getSeconds(), //秒
|
|
|
|
|
|
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
|
|
|
|
|
"S": this.getMilliseconds() //毫秒
|
|
|
|
|
|
};
|
|
|
|
|
|
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
|
|
|
|
for (var k in o)
|
|
|
|
|
|
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
|
|
|
|
return fmt;
|
2019-01-03 18:44:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-04-22 18:39:30 +08:00
|
|
|
|
function aJaxImportPost(url, params) {
|
|
|
|
|
|
top.$.jBox.tip("onloading",'loading',{opacity:0.5,persistent:true});
|
2019-01-03 18:44:13 +08:00
|
|
|
|
// 创建form元素
|
2019-04-23 16:45:09 +08:00
|
|
|
|
var temp_form = document.createElement("form");
|
2019-01-03 18:44:13 +08:00
|
|
|
|
// 设置form属性
|
2019-04-23 16:45:09 +08:00
|
|
|
|
temp_form .id = 'temp_form';
|
2019-01-03 18:44:13 +08:00
|
|
|
|
temp_form .action = url;
|
|
|
|
|
|
temp_form .target = "_self";
|
2019-01-08 10:44:30 +08:00
|
|
|
|
temp_form .method = "post";
|
2019-04-23 16:45:09 +08:00
|
|
|
|
temp_form .style.display = "none";
|
2019-01-03 18:44:13 +08:00
|
|
|
|
// 处理需要传递的参数
|
|
|
|
|
|
for (var x in params) {
|
|
|
|
|
|
var opt = document.createElement("textarea");
|
|
|
|
|
|
opt.name = x;
|
|
|
|
|
|
opt.value = params[x];
|
|
|
|
|
|
temp_form .appendChild(opt);
|
2019-04-23 16:45:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
document.body.appendChild(temp_form);
|
2019-04-22 18:39:30 +08:00
|
|
|
|
var xmlResquest = new XMLHttpRequest();
|
|
|
|
|
|
xmlResquest.open("POST", url, true);
|
2019-04-23 16:45:09 +08:00
|
|
|
|
xmlResquest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
2019-04-22 18:39:30 +08:00
|
|
|
|
xmlResquest.responseType = "blob";
|
|
|
|
|
|
xmlResquest.onload = function (oEvent) {
|
|
|
|
|
|
var contDisp = xmlResquest.getResponseHeader("content-disposition")
|
|
|
|
|
|
var fileName = contDisp.substring(contDisp.indexOf("=")+1,contDisp.length).replace(/\"/g,"")
|
2019-04-26 17:19:45 +08:00
|
|
|
|
fileName = decodeURIComponent(EncodeUtf8(fileName));
|
2019-04-22 18:39:30 +08:00
|
|
|
|
var content = xmlResquest.response;
|
|
|
|
|
|
var elink = document.createElement('a');
|
|
|
|
|
|
elink.download = fileName;
|
|
|
|
|
|
elink.style.display = 'none';
|
|
|
|
|
|
var blob = new Blob([content]);
|
|
|
|
|
|
elink.href = URL.createObjectURL(blob);
|
|
|
|
|
|
document.body.appendChild(elink);
|
|
|
|
|
|
elink.click();
|
2019-04-29 18:18:46 +08:00
|
|
|
|
document.body.removeChild(elink);
|
|
|
|
|
|
document.body.removeChild(temp_form);
|
2019-04-22 18:39:30 +08:00
|
|
|
|
};
|
|
|
|
|
|
xmlResquest.onreadystatechange = function() {
|
|
|
|
|
|
if (xmlResquest.readyState==4) {
|
|
|
|
|
|
top.$.jBox.closeTip();
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2019-04-23 16:45:09 +08:00
|
|
|
|
xmlResquest.send($("#temp_form").serialize());
|
2019-01-03 18:44:13 +08:00
|
|
|
|
}
|
2019-04-26 17:19:45 +08:00
|
|
|
|
function EncodeUtf8(s1){
|
|
|
|
|
|
var s = escape(s1);
|
|
|
|
|
|
var sa = s.split("%");
|
|
|
|
|
|
var retV ="";
|
|
|
|
|
|
if(sa[0] != ""){
|
|
|
|
|
|
retV = sa[0];
|
|
|
|
|
|
}
|
|
|
|
|
|
for(var i = 1; i < sa.length; i ++){
|
|
|
|
|
|
if(sa[i].substring(0,1) == "u")
|
|
|
|
|
|
{
|
|
|
|
|
|
retV += Hex2Utf8(Str2Hex(sa[i].substring(1,5)));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
else retV += "%" + sa[i];
|
|
|
|
|
|
}
|
|
|
|
|
|
return retV;
|
|
|
|
|
|
}
|