公开信箱
办理数据公开
' +title+
'
' +
' '+ openDate +'
' +
' '
}
$("#list").html(html);
}
},error:function(data){
}
})
}
//获取当月统计
function getStatistics(){
var beginTime=selbeginTime+' 00:00:00',endTime=selendTime+' 23:59:59';
$.ajax({
url:'/IGI/nbhd/openGovmsgbox.do',
type:"get",
data:{ siteId:siteId,beginTime:beginTime,endTime:endTime,method:'govmsgboxReplyReport',appId:appId },
async:false,
timeout:3000,
dataType:"json",
xhrFields: {
withCredentials: true //解决跨服务传递时不传递cookie的问题,允许携带证书
},
success:function(data){
if(data.statusCode == 200&&data.datas){
initEcharts(data.datas)
}
},
error:function(data){
}
});
}
layui.use('laydate', function(){
var laydate = layui.laydate;
//执行一个laydate实例
laydate.render({
elem: '#sjStartTime', //指定元素
type: 'date',
value: selbeginTime, //必须遵循format参数设定的格式
format: 'yyyy-MM-dd', //可任意组合
showBottom: false,
max: (new Date).getDate(),
done: function(value, date){
selbeginTime=value;
getStatistics()
}
});
laydate.render({
elem: '#sjEndTime', //指定元素
type: 'date',
value: selendTime, //必须遵循format参数设定的格式
format: 'yyyy-MM-dd', //可任意组合
showBottom: false,
max: (new Date).getDate(),
done: function(value, date){
selendTime=value;
getStatistics()
}
});
getStatistics();
});
function initEcharts (ecVal) {
// 饼图1
var option1 = {
tooltip: {
trigger: 'item'
},
color:['#62a7ff'],
series: [
{
type: 'pie',
radius: ['75%', '90%'],
avoidLabelOverlap: false,
hoverAnimation:false,
label: {
show: false,
position: 'center'
},
data: [
{
value: ecVal.total,
name: '信件总数',
label: {
show:true,
formatter: '{c}\n{b}',
color: '#404447',
fontSize:18,
lineHeight:30
}
}
]
}
]
};
var chartDom1 = document.getElementById('cir-pie1');
var myChart1 = echarts.init(chartDom1);
myChart1.setOption(option1);
// 饼图2
var option2 = {
tooltip: {
trigger: 'item'
},
color:['#58deb6','#eeeeee'],
series: [
{
type: 'pie',
radius: ['75%', '90%'],
avoidLabelOverlap: false,
hoverAnimation:false,
label: {
show: false,
position: 'center'
},
data: [
{
value: ecVal.hasReply,
name: '已答复',
label: {
show:true,
formatter: '{c}\n{b}',
color: '#404447',
fontSize:18,
lineHeight:30
}
},
{
value: ecVal.hasReply==0&&ecVal.total-ecVal.hasReply==0?1:(ecVal.total-ecVal.hasReply),
name: '',
tooltip:{
show:false
}
},
]
}
]
};
var chartDom2 = document.getElementById('cir-pie2');
var myChart2 = echarts.init(chartDom2);
myChart2.setOption(option2);
//颜色过钱防止消失
myChart2.on('mouseover', function (e) {
var op = myChart2.getOption();
myChart2.dispatchAction({
type: 'downplay',
seriesIndex: 0,
dataIndex: e.dataIndex,
color: e.color
});
myChart2.setOption(op, true)
})
// 饼图3
var option3 = {
tooltip: {
trigger: 'item'
},
color:['#eecb5f','#eeeeee'],
series: [
{
type: 'pie',
radius: ['75%', '90%'],
avoidLabelOverlap: false,
hoverAnimation:false,
label: {
show: false,
position: 'center'
},
data: [
{
value: ecVal.replying,
name: '答复中',
label: {
show:true,
formatter: '{c}\n{b}',
color: '#404447',
fontSize:18,
lineHeight:30
}
},
{
value: ecVal.replying==0&&ecVal.total-ecVal.replying==0?1:(ecVal.total-ecVal.replying),
name: '',
tooltip:{
show:false
}
},
]
}
]
};
var chartDom3 = document.getElementById('cir-pie3');
var myChart3 = echarts.init(chartDom3);
myChart3.setOption(option3);
//颜色过钱防止消失
myChart3.on('mouseover', function (e) {
var op = myChart3.getOption();
myChart3.dispatchAction({
type: 'downplay',
seriesIndex: 0,
dataIndex: e.dataIndex,
color: e.color
});
myChart3.setOption(op, true)
})
}
})