$(function(){ var path=""; // var _deptid="bba80316d8d246da9970fdece8c6f779"; var _deptid="b36b28ce91204159b602d612cca92622"; var newpath = '//www.xjnj.gov.cn', site = '&site=6500000011',//站点代号 xjurl = '/hd/hd_xjxq',//ejs信件详情 ftr = '/hd/zxdc_result',//ejs调查结果 dcurl = '/hd/zxdc_details',//ejs调查详情 xjstrurl = '/xjnj/zxzx/new_hd_xjxq.shtml',//new信件详情 dcxqstrurl = '/xjnj/wsdc/new_hd_zxdc_details.shtml',//new调查详情 dcrstrurl = '/xjnj/wsdc/new_hd_zxdc_result.shtml';//new调查结果 // 饼图 function tjbt(frontdata){ $("#xjtotal").html(frontdata.ybj); $("#xjfinish").html(frontdata.blz); $("#xjhand").html(frontdata.ybj-frontdata.blz); var dom = document.getelementbyid("tjbt"); var mychart = echarts.init(dom); var app = {}; option = null; app.title = '环形图'; option = { tooltip: { trigger: 'item', formatter: "{a}
{b}: {c} ({d}%)" }, series: [ { name:'总调查数', type:'pie', radius: ['50%;', '30%'], avoidlabeloverlap: false, label: { normal: { show: false, position: 'center' }, emphasis: { show: false, } }, labelline: { normal: { show: false } }, color:['#9cc3f9','#578add'], data:[ {value:frontdata.blz, name:'办理中'}, {value:frontdata.ybj, name:'已完成'} ] } ] }; if (option && typeof option === "object") { mychart.setoption(option, true); } } function xjtj(){ $.ajax({ type: "get", url: path+"/communication/api-mailbox/frontmail/selectmailhistorybydept?deptid="+_deptid, success: function (response) { console.log(response) var _data=response.data; $("#xjtotal").html(_data.total); $("#xjfinish").html(_data.finish); $("#xjhand").html(_data.total-_data.finish); } }); } function xjlist(){ var data = { pagenum: '1', pagesize: '5', sortmap: {starttime1: "desc"}, params: { deptid: _deptid } } var xqurl=""+"?id="; jquery.support.cors = true; $.ajax({ url: path + "/communication/api-mailbox/frontmail/maillist", data: json.stringify(data), type: 'post', datatype: 'json', contenttype: "application/json", success: function(json) { //console.log(json); var _num=0; $.each(json.data.rows, function(index, item) { _num++; var time=item.createtime.split(" "); var _title=item.title; _title=(_title.length>27)?(_title.substring(0, 27)+"..."):(_title); var lxxd_list ='' +''+_num+'' +'' +''+ _title +'' +''+item.replycontent.substring(0,18)+'...' +''+item.status+'' +''+time[0]+''; $('#xjxdlist').append(lxxd_list); }) }, error: function(xhr) { console.log('error:' + json.stringify(xhr)); } }) } // 截止日期 function jztime(){ var date = new date(); var year = date.getfullyear(); // 返回的是年份 var month = date.getmonth() + 1; // 返回的月份上个月的月份,记得+1才是当月 var dates = date.getdate(); // 返回的是几号 var _tiames=year + "年" + month + "月" + dates + "日 调查情况统计"; $("#xjdate").html(_tiames); } //网上调查 function onlinesurvey() { var data = { pagenum: 1, pagesize: 5, params:{ deptid: _deptid }, sortmap:{ starttime1:"desc" } } $.ajax({ url: path + "/communication/api-question/frontquestionpaper/pagelist1", data: json.stringify(data), type: 'post', datatype: 'json', contenttype: "application/json", success: function(json) { if(json.status == 'success') { $.each(json.data.rows, function(index, item) { var _title=item.title; _title=(_title.length>32)?(_title.substring(0, 32)+"..."):(_title); if(item.collecttype==0){ if(item.issurvey == "2"){ //dcurl= '/slt/dcxq/hd_zxdcxq.shtml?id=' + item.id; dcurl = newpath + dcurl + '?id=' + item.id + site + '&url=' + dcxqstrurl; }else{ //dcurl='/slt/dcjg/hd_zxdc_result.shtml?id='+item.id dcurl = newpath + ftr + '?id=' + item.id + site + '&url=' + dcrstrurl; } }else{ dcurl=item.outjoin; } var wsdc_list ='
· ' + _title+ ' '+item.endtime.substring(0,12)+'
' $("#wsdc_list").append(wsdc_list); }) var frontdata={}; frontdata.ybj=json.data.total; frontdata.blz=json.data.total; tjbt(frontdata); } }, error: function(xhr) { } }) } onlinesurvey();//网上调查 jztime();//当前时间 xjtj();//信件统计 xjlist();//信件列表 })