(1)实时报表动作替换为serviceId

(2)配置日志总量统计查询条件action替换为serviceId
(3)配置列表日志总量列加入serviceId
(4)配置日志总量跳转到日志列表action替换为serviceId
(5)配置日志相关js提取到pzLog。js中
This commit is contained in:
wangxin
2018-09-30 10:54:30 +08:00
parent e69191219a
commit 025182e551
51 changed files with 235 additions and 240 deletions

View File

@@ -345,8 +345,6 @@ $(function(){
$("input[name$='exprType']:checked").each(function(){
//setDefaultMatchMethod(this);
});
//获取配置日志总数
getTotalLog();
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
@@ -1346,120 +1344,6 @@ var viewAreaInfo=function(path,areaEffectiveIds,compileId){
});
}
var getTotalLog=function(){
/*
td需要配置属性有audit,functionIdcompileIdaction
*/
var data={};
//data.date=new Date();
data.compileIds=[];
data.actions=[];
data.objs=[];
$("td[compileId]").each(function(){
var audit=$(this).attr("audit");
var compileId=$(this).attr("compileId");
var action=$(this).attr("action");
var functionId=$(this).attr("functionId");
if(audit&&compileId&&action&&functionId){
if(audit == 1){
var has=false;
for(var i=0;i<data.actions.length;i++){
if(data.actions[i]==$(this).attr("action")){
has=true;
}
}
if(!has){
data.actions.push($(this).attr("action"));
}
//$(this).attr("date",data.date.getTime());
data.compileIds.push($(this).attr("compileId"));
data.functionId=$(this).attr("functionId");
data.objs.push($(this));
}else{
$(this).html("0");
}
}else{
$(this).html("0");
}
});
if(data.compileIds.length>0){
GetLogTotal(data);
}
}
var GetLogTotal=function(_data){
var pathName=window.document.location.pathname.substring(0,window.document.location.pathname.indexOf("/nis")+4);
var timeStamp;
if(_data.date){
timeStamp=_data.date.valueOf();
}/*else{
timeStamp=(new Date()).valueOf();
}*/
var totalTrs=$(_data.objs);
var timeout=$.validator.messages.timeout;
var failed=$.validator.messages.failed;
var request=$.ajax({
type:'post',
timeout:10000,//超时时间设置,查询接口时间过长超时
url:pathName+'/report/ajaxGetLogTotal',
data:{"endTime":timeStamp,"actions":_data.actions.join(','),"functionId":_data.functionId,"compileIds":_data.compileIds.join(',')},
dataType:'json',
async:true,
success:function(data,textStatus){//处理返回结果
if(textStatus=="success"){
totalTrs.each(function(){
var hasLog=false;
for(var i=0;i<data.length;i++){
if($(this).attr("compileId")==data[i].compileId){
$(this).attr("id",i+"logTotal");
$(this).html("<a href='javascript:;' onclick='toLogSearch("+i+")'>"+data[i].sum+"<a>");
hasLog=true;
}
}
if(!hasLog){
$(this).html("0");
}
})
}
},
complete:function(XMLHttpRequest,status){//超时设置
if(status=="timeout"){
totalTrs.each(function(){
$(this).html(timeout);
})
}else if(status !="success"){
totalTrs.each(function(){
$(this).html(failed);
})
}
}
});
}
var toLogSearch = function(index){
// 保存配置界面URL
$("#searchForm").each(function(){
var cfgUrl = $(this).attr("action");
sessionStorage.removeItem('cfgUrl');
sessionStorage.setItem('cfgUrl',cfgUrl);
});
var td = document.getElementById(index+"logTotal");
$("td[compileId]").each(function(){
if($(this).attr("id") == index+"logTotal"){
// 获取检索日志参数
var action=$(this).attr("action");
var compileId=$(this).attr("compileId");
var functionId=$(this).attr("functionId");
var date=$(this).attr("date");
var pathName=window.document.location.pathname.substring(0,window.document.location.pathname.indexOf("/nis")+4);
window.location.href = pathName+"/toLogSearch?action="+action+"&functionId="+functionId+"&cfgId="+compileId+"&date="+date+"&isLogTotalSearch=yes";
}
});
}
//删除区域IP
function delAreaIp(obj){