123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- //数据表格
- var g;
- var myCols = [{
- display: '法律法规', name: 'law', width: "20%", align: 'center'
- },{
- display: '政府公文', name: 'administrationReg', width: "20%", align: 'center'
- },{
- display: '国标行标', name: 'localReg', width: "20%", align: 'center'
- },{
- display: '企业公文', name: 'administrationRul', width: "20%", align: 'center'
- }];
-
- var columns = [
- {display: '制度文件分类', columns: myCols, width: "80%"},
- {display: '合计', name: 'num', width: "20%", align: 'center'}
- ];
-
- var json ="";
- var loadData;
- //柱状图
- var option = {
- title : {
- text: '应急制度文件汇总统计图',
- subtext: '/个'
- },
- tooltip : {
- trigger: 'axis'
- },
- legend: {
- y : 'bottom',
- data:['法律法规','政府公文','国标行标','企业公文']
- },
- toolbox: {
- show : true,
- feature : {
- mark : {show: true},
- dataView : {show: false, readOnly: false},
- magicType : {show: false, type: ['line', 'bar']},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- data : ['应急制度文件汇总']
- }
- ],
- yAxis : [
- {
- type : 'value'
- }
- ],
- series : [
- {
- name:'法律法规',
- type:'bar',
- data:[4]
- },
- {
- name:'政府公文',
- type:'bar',
- data:[5]
- },
- {
- name:'国标行标',
- type:'bar',
- data:[6]
- },
- {
- name:'企业公文',
- type:'bar',
- data:[7]
- }
- ]
- };
- function changeBarOption(data){
- var seriesData=[];
- var data1=[];
- var data2=[];
- var data3=[];
- var data4=[];
- for(var i=0;i<data.rows.length;i++){
- data1[i]=data.rows[i].law;
- data2[i]=data.rows[i].administrationReg;
- data3[i]=data.rows[i].localReg;
- data4[i]=data.rows[i].administrationRul;
- }
- var series1={ name:'法律法规',
- type:'bar',
- data:data1
- };
- var series2={ name:'政府公文',
- type:'bar',
- data:data2
- };
- var series3={ name:'国标行标',
- type:'bar',
- data:data3
- };
- var series4={ name:'企业公文',
- type:'bar',
- data:data4
- };
- seriesData=[series1,series2,series3,series4];
- option.series=seriesData;
- }
-
- //折线图option1
- var option1 = {
- title : {
- text: '应急制度文件汇总统计图',
- subtext: '/个'
- },
- tooltip : {
- trigger: 'axis'
- },
- legend: {
- y:'bottom',
- data:['应急制度文件汇总']
- },
- toolbox: {
- show : true,
- feature : {
- mark : {show: true},
- dataView : {show: false, readOnly: false},
- magicType : {show: false, type: ['line', 'bar', 'stack', 'tiled']},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- boundaryGap : false,
- data : ['法律法规','政府公文','国标行标','企业公文']
- }
- ],
- yAxis : [
- {
- type : 'value'
- }
- ],
- series : [
- {
- name:'应急制度文件汇总',
- type:'line',
-
- data:[20, 30, 50,40]
- }
- ]
- };
- function changeLineOption(data){
- var seriesData=[];
- var data1=[data.rows[0].law,data.rows[0].administrationReg,data.rows[0].localReg,data.rows[0].administrationRul,];
- var series1={ name:'应急制度文件汇总',
- type:'line',
- data:data1
- };
-
- seriesData=[series1];
- option1.series=seriesData;
- }
- //饼图option2
- var option2 = {
- title : {
- text: '应急制度文件汇总统计图',
- subtext: '/个'
- },
- tooltip : {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- legend: {
- y : 'bottom',
- data:['法律法规','政府公文','国标行标','企业公文']
- },
- toolbox: {
- show : true,
- feature : {
- mark : {show: true},
- dataView : {show: false, readOnly: false},
- magicType : {
- show: false,
- type: ['pie', 'funnel'],
- option: {
- funnel: {
- x: '25%',
- width: '50%',
- funnelAlign: 'left',
- max: 1548
- }
- }
- },
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- series : [
- {
- name:'应急制度文件汇总',
- type:'pie',
- radius : '55%',
- center: ['50%', '55%'],
- data:[
- {value:335, name:'法律法规'},
- {value:310, name:'政府公文'},
- {value:234, name:'国标行标'},
- {value:135, name:'企业公文'}
- ]
- }
- ]
- };
- function changePieOption2(data){
- /*************************************************** 初始化解析饼图数据 start**********************************************************/
- //option2.legend.data=['总体预案','专项预案','现场处置方案','部门预案'];
- var index=data.rows.length-1;
- var seriesJson=[];
- var j=0;
- if(data.rows[index]["law"]!=undefined){
- var json={value:data.rows[index]["law"],name:'法律法规'};
- seriesJson[j]=json;
- j++;
- }
- if(data.rows[index]["administrationReg"]!=undefined){
- var json={value:data.rows[index]["administrationReg"],name:'政府公文'};
- seriesJson[j]=json;
- j++;
- }
- if(data.rows[index]["localReg"]!=undefined){
- var json={value:data.rows[index]["localReg"],name:'国标行标'};
- seriesJson[j]=json;
- j++;
- }
- if(data.rows[index]["administrationRul"]!=undefined){
- var json={value:data.rows[index]["administrationRul"],name:'企业公文'};
- seriesJson[j]=json;
- j++;
- }
- option2.series[0].data=seriesJson;
-
- /*************************************************** 初始化解析饼图数据 end **********************************************************/
- }
-
- //初始化方法
- $(function(){
- $("body").eq(0).showLoading();
-
- $.post($.pathname()+ "/ws/LAWSPOLL/LawsService/getTotalFile",{id : deptName},function (data){
- json = data;
- //给表格数据赋值
- loadData= data;
- //初始化表格
- initCompletes(json);
-
- $("body").eq(0).hideLoading();
-
- changeBarOption(data);
- changeLineOption(data);
- changePieOption2(data);
- var myChart1 = echarts.init(document.getElementById('main1'));
- myChart1.setOption(option);
- $(".basicTab").bind('actived',function(e,i){
- if(i==0){
- /***************************************** 加载柱状图 *********************************************************/
- var myChart1 = echarts.init(document.getElementById('main1'));
- myChart1.setOption(option);
- // initmyGraphic(data);
- }else if(i == 1){
- /***************************************** 加载折线图 *********************************************************/
- var myChart5 = echarts.init(document.getElementById('main2'));
- myChart5.setOption(option1);
- }else if(i==2){
- /***************************************** 加载饼图 *********************************************************/
- var myChart2 = echarts.init(document.getElementById('main3'));
- myChart2.setOption(option2);
- }
- });
- /***************************************** 加载图表 End *********************************************************/
-
-
- },"json" );
-
- });
-
-
-
- //发送请求,从后台获取数据
- function getNewValue(){
-
- //发布日期
- var pushStartTime = $('#beginTime1').val();
- var pushEndTime = $('#endTime1').val();
-
- $.post($.pathname()+ "/ws/LAWSPOLL/LawsService/getTotalFile",
- {id : deptName,StartTime:pushStartTime,EndTime:pushEndTime},
- function (data){
-
- json = data;
- //给表格数据赋值
- loadData= data;
- //初始化表格
- initCompletes(json);
-
- },"json" );
- }
-
- //点击统计按钮触发的事件
- function getCount(){
- getNewValue();
- }
-
-
- function initCompletes(json){
- g = $("#maingrid").quiGrid({
- columns: columns,
- data:json,
- rownumbers : true,
- usePager : false
- });
-
- /* //重设高度
- $(parent.document.body).find("iframe").height(480);
- $(top.document.body).find("#frmright").height(480);*/
-
- /*重新绑定父页面事件方法*/
- //绑定点击时样式变化事件
- $(parent.document.body).find(".leftnav").live("click",parent.checkedCurrent);
- //定期报送组点击事件
- $(parent.document.body).find(".baosong").live("click",parent.changebaosong);
- //定期维护组点击事件
- $(parent.document.body).find(".weihu").live("click",parent.changeweihu);
- $(parent.document.body).find(".weihu1").live("click",parent.changeweihu1);
- /*重新绑定父页面事件方法*/
- }
-
-
-
- function addStatus(rowdata, rowindex, value, column){
- var comp_id='"'+rowdata.dept_id+'"';
- var name = '"'+value+'"';
- return "<a href='javascript:newHtml("+comp_id+","+name+")'>" + value +" </a>";
- }
- function newHtml(comp_id,name){
- if(name=="总计"){
- return;
- }else if(deptName==comp_id){
- return;
- }else{
- window.open("/nwyj/page/business/am/fileManager/laws/laws_poll1.jsp?"+comp_id);
- // window.location.href = "/nwyj/page/business/am/resource/expert/expert-poll.jsp?"+comp_id;
- // alert(comp_id);
- }
-
- }
- //返回
- function goBack() {
- window.location.href="laws.jsp";
- }
-
-
- //打印
- function print(){
- //alert(1111);
- $("#maingrid").jqprint();
- }
-
-
- $.messager=top.Dialog;
|