|
|
@ -8,7 +8,8 @@ |
|
|
|
this.ReLayout(); |
|
|
|
this.InitDate(); |
|
|
|
this.InitDataGrid(); |
|
|
|
|
|
|
|
|
|
|
|
$('.statistic-type span').on('click', this.OnStatisticTypeClick.bind(this)); |
|
|
|
$('#query-btn').on('click', this.OnQueryButtonClick.bind(this)); |
|
|
|
$('#query-btn').trigger('click'); |
|
|
|
|
|
|
@ -24,6 +25,11 @@ |
|
|
|
this.formatLastColumn(); |
|
|
|
}; |
|
|
|
|
|
|
|
this.OnStatisticTypeClick = function (event) { |
|
|
|
$('.statistic-type span').removeClass("active"); |
|
|
|
$(event.target).addClass("active"); |
|
|
|
}; |
|
|
|
|
|
|
|
this.OnQueryButtonClick = function () { |
|
|
|
this.ReLoadTableData(); |
|
|
|
}; |
|
|
@ -33,6 +39,7 @@ |
|
|
|
method: "POST", |
|
|
|
url: '/StatisticAnalysis/Query', |
|
|
|
queryParams: { |
|
|
|
typeCode: $('.statistic-type span.active').attr('type'), |
|
|
|
fromTime: $("#from-date").datetimebox('getValue'), |
|
|
|
toTime: $("#to-date").datetimebox('getValue'), |
|
|
|
} |
|
|
@ -84,6 +91,7 @@ |
|
|
|
columns: [[ |
|
|
|
{ field: 'UserName', title: '姓名', align: 'center', width: 120 }, |
|
|
|
{ field: 'OrgName', title: '所属机构', align: 'left', width: 180 }, |
|
|
|
{ field: 'OrgName2', title: '机构名称', align: 'left', width: 180, hidden: 'true' }, |
|
|
|
{ field: 'ComputeCount', title: '计算次数', align: 'center', width: 100 }, |
|
|
|
{ field: 'LastComputeTime', title: '最后计算时间', align: 'center', width: 160, formatter: this.formatTime.bind(this) }, |
|
|
|
{ field: 'Null', title: '', align: 'left' } |
|
|
@ -106,18 +114,38 @@ |
|
|
|
body.append('<div class="null-data"><span></span><p>暂无数据</p></div>'); |
|
|
|
} |
|
|
|
|
|
|
|
if ($('.statistic-type span.active').attr('type') === 'user') { |
|
|
|
this.statisticGrid.datagrid('showColumn', 'UserName'); |
|
|
|
this.statisticGrid.datagrid('showColumn', 'OrgName'); |
|
|
|
this.statisticGrid.datagrid('hideColumn', 'OrgName2'); |
|
|
|
} |
|
|
|
else { |
|
|
|
this.statisticGrid.datagrid('hideColumn', 'UserName'); |
|
|
|
this.statisticGrid.datagrid('hideColumn', 'OrgName'); |
|
|
|
this.statisticGrid.datagrid('showColumn', 'OrgName2'); |
|
|
|
} |
|
|
|
|
|
|
|
this.formatLastColumn(); |
|
|
|
}.bind(this) |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
this.formatLastColumn = function () { |
|
|
|
var type = $('.statistic-type span.active').attr('type'); |
|
|
|
var width = $('.container').width(); |
|
|
|
var headerTable = $('.datagrid-header'); |
|
|
|
var bodyTable = $('.datagrid-body'); |
|
|
|
var headerTd = headerTable.find('td:last'); |
|
|
|
headerTd.css('width', (width - 562) + 'px'); |
|
|
|
bodyTable.find('tr').find('td:last').css('width', (width - 562) + 'px'); |
|
|
|
var clipWidth = type === 'user' ? 562 : 442; |
|
|
|
headerTd.css('width', (width - clipWidth) + 'px'); |
|
|
|
bodyTable.find('tr').find('td:last').css('width', (width - clipWidth) + 'px'); |
|
|
|
}; |
|
|
|
|
|
|
|
this.toggleUserColuum = function () { |
|
|
|
if ($('.statistic-type span.active').attr('type') === 'user') |
|
|
|
this.statisticGrid.datagrid('showColumn', 'UserName'); |
|
|
|
else |
|
|
|
this.statisticGrid.datagrid('hideColumn', 'UserName'); |
|
|
|
}; |
|
|
|
|
|
|
|
this.formatTime = function (time) { |
|
|
|