1.js时间控件Mydat97
单时间
$("#publishTime").val(new Date().toString('yyyy-MM-dd'));
$("#publishTime").click(function() {
WdatePicker({isShowClear:false, dateFmt : 'yyyy-MM-dd', maxDate :'%y-%M-%d', onpicked : function(){queryLevelCount();$("#message_list").hide();}});
});
双时间
varparamStartDate;
varparamEndDate;
$("#publishTimeEnd").val(new Date().toString('yyyy-MM-dd'));
paramStartDate = {isShowClear:false, dateFmt : 'yyyy-MM-dd',maxDate : '#F{$dp.$D(\'publishTimeEnd\')}', onpicked : function(){queryWarnNewsPageList();}};
paramEndDate= {isShowClear:false, dateFmt : 'yyyy-MM-dd',minDate:'#F{$dp.$D(\'publishTimeBegin\')}', maxDate : '%y-%M-%d',onpicked : function() {queryWarnNewsPageList();}};
$("#publishTimeBegin").click(function() {
WdatePicker(paramStartDate);
});
$("#publishTimeEnd").click(function() {
WdatePicker(paramEndDate);
});
2.获得url传值
${param.xxx}
3.echarts
var areaChart;
var option;
var initChart = function(listSize){
if(null ==areaChart){
areaChart =echarts.init(document.getElementById_x('areaChart'));
}else{
areaChart.dispose();
areaChart =echarts.init(document.getElementById_x('areaChart'));
}
areaChart.showLoading({
text:'正在努力的读取数据中...',
});
option ={
tooltip : {
trigger: 'axis'
},
legend: {
data:['总量',"正面","负面"]
},
toolbox: {
show : true,
feature : {
mark : true,
dataZoom : true,
dataView : {readOnly: true},
magicType:['bar', 'line'],
restore : false,
saveAsImage : true
}
},
calculable : true,
yAxis : [
{
type : 'value',
splitArea : {show : true}
}
],
series : []
};
initOption(listSize);
};
var initAreaChart = function(list){
if(list ==null || list[0] == null || list[0].total == 0){
initOption();
return;
}
var zbdl =[];
var zmbdl =[];
var fmbdl =[];
var xAxis =[];
for(var _i =list.length -1 ; _i > 0; _i = _i-1){
var dto =list[_i];
if(dto ==null){
zbdl.push(0);
zmbdl.push(0);
fmbdl.push(0);
continue;
}
zbdl.push(dto.total);
zmbdl.push(dto.zmtotal);
fmbdl.push(dto.fmtotal);
xAxis.push(dto.areaName);
}
zbdl.reverse();
zmbdl.reverse();
fmbdl.reverse();
xAxis.reverse();
option.series = [{
name:'总量',type: 'line',data: zbdl},{
name:'正面',type: 'line',data: zmbdl},{
name:'负面',type: 'line',data: fmbdl
}];
option.xAxis= [
{
type : 'category',
data : xAxis
}
];
areaChart.setOption(option);
};
function initOption(listSize){
var array =[];
for (vari=0; i
array.push("0");
}
option.series = [{
name:'总量',type: 'line',data: array},{
name:'正面',type: 'line',data: array},{
name:'负面',type: 'line',data: array}];
areaChart.setOption(option);
};
4.分页
trunPageObj = $(".pageNext").turnPage(10,queryNewsListPageByTime);
ajax :trunPageObj.setPageData(data.data);
function initNews(id) {
$("#infoDiv").show();
timeInterval= id;
trunPageObj.gotoPage(1);
}
细节总结
最新推荐文章于 2022-07-25 16:26:08 发布