/**
|
* 角色管理的单例
|
*/
|
var Statistics = {
|
id: "StatisticsTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
Statistics.initColumn = function () {
|
var columns = [
|
{field: 'select_item', radio: true},
|
{title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
{title: '活动ID', field: 'code', align: 'center', valign: 'middle'},
|
{title: '活动名称', field: 'name', align: 'center', valign: 'middle'},
|
{title: '其他参数', field: 'customParameter', align: 'center', valign: 'middle', width: '150px'},
|
{title: '活动游览pv', field: 'browse_pv', align: 'center', valign: 'middle'},
|
{title: '活动游览uv', field: 'browse_uv', align: 'center', valign: 'middle'},
|
{title: '导航点击pv', field: 'navigation_pv', align: 'center', valign: 'middle'},
|
{title: '导航点击uv', field: 'navigation_uv', align: 'center', valign: 'middle'}
|
]
|
return columns;
|
};
|
|
|
/**
|
* 检查是否选中
|
*/
|
Statistics.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if (selected.length == 0) {
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
} else {
|
Statistics.seItem = selected[0];
|
return true;
|
}
|
};
|
|
|
Statistics.exportStatistics = function(){
|
const code = $("#code").val();
|
const time = $("#time").val();
|
const customParameter = $("#customParameter").val()
|
let url = Feng.ctxPath + "/statistics/exportSalesPromotionStatistics?";
|
if(null != code && '' != code){
|
url += "code=" + code + "&";
|
}
|
if(null != time && '' != time){
|
url += "time=" + time + "&";
|
}
|
if(null != customParameter && '' != customParameter){
|
url += "customParameter=" + customParameter + "&";
|
}
|
window.location.href = url;
|
}
|
|
|
/**
|
* 搜索
|
*/
|
Statistics.search = function () {
|
var queryData = {};
|
queryData['code'] = $("#code").val();
|
queryData['time'] = $("#time").val();
|
queryData['customParameter'] = $("#customParameter").val();
|
Statistics.table.setQueryParams({});
|
Statistics.table.refresh({query: queryData});
|
}
|
|
/**
|
* 重置
|
*/
|
Statistics.resetSearch = function(){
|
var queryData = {};
|
$("#code").val('');
|
$("#time").val('');
|
$("#customParameter").val('');
|
Statistics.table.setQueryParams({});
|
Statistics.table.refresh({query: queryData});
|
}
|
|
|
$(function () {
|
var defaultColunms = Statistics.initColumn();
|
var table = new BSTable(Statistics.id, "/statistics/querySalesPromotionStatistics", defaultColunms);
|
table.setPaginationType("server");
|
Statistics.table = table.init();
|
|
});
|