123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785 |
- //var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //数据表格
- var g;
- var myCols = [{
- display: '法律', name: 'law', width: "16%", align: 'center'
- },{
- display: '行政法规', name: 'administrationreg', width: "16%", align: 'center'
- },{
- display: '地方性法规', name: 'localreg', width: "16%", align: 'center'
- },{
- display: '行政规章', name: 'administrationrul', width: "16%", align: 'center'
- },{
- display: '地方行政规章', name: 'localrul', width: "16%", align: 'center'
- }];
-
- var columns = [{display : '所属单位',"name" : 'name',id : 'name',width : "10%",dept_id:'dept_id',align : 'center',render: addStatus},
- {display: '法律法规分类', columns: myCols, width: "80%"},
- {display: '合计', name: 'num', width: "10%", 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: true, readOnly: false},
- magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
- }
- ],
- yAxis : [
- {
- type : 'value'
- }
- ],
- series : [
- {
- name:'法律',
- type:'bar',
- data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3]
- },
- {
- name:'行政法规',
- type:'bar',
- data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
- },
- {
- name:'地方性法规',
- type:'bar',
- data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
- },
- {
- name:'行政规章',
- type:'bar',
- data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
- },
- {
- name:'地方行政规章',
- type:'bar',
- data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
- }
- ]
- };
- function changeBarOption(data){
- var legendData=[];
- var seriesData=[];
- var data1=[];
- var data2=[];
- var data3=[];
- var data4=[];
- var data5=[];
- for(var i=0;i<data.rows.length-1;i++){
- //alert(data.rows[i].name);
- legendData[i]=data.rows[i].name;
- data1[i]=data.rows[i].law;
- data2[i]=data.rows[i].administrationreg;
- data3[i]=data.rows[i].localreg;
- data4[i]=data.rows[i].administrationrul;
- data5[i]=data.rows[i].localrul;
- }
- 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
- };
- var series5={ name:'地方行政规章',
- type:'bar',
- data:data5
- };
- seriesData=[series1,series2,series3,series4,series5];
- option.xAxis[0].data=legendData;
- option.series=seriesData;
- }
- function changeBarOption2(data){
- alert(JSON.stringify(data));
- var legendData=[];
- var seriesData=[];
- var data1=[];
- var data2=[];
- var data3=[];
- var data4=[];
- var data5=[];
- for(var i=0;i<data.rows.length-1;i++){
- //alert(data.rows[i].name);
- legendData[i]=data.rows[i].name;
- data1[i]=data.rows[i].law;
- data2[i]=data.rows[i].administrationreg;
- data3[i]=data.rows[i].localreg;
- data4[i]=data.rows[i].administrationrul;
- data5[i]=data.rows[i].localrul;
- }
- 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
- };
- var series5={ name:'地方行政规章',
- type:'bar',
- data:data5
- };
- //seriesData=[series1,series2,series3,series4,series5];
- option.legend.data=$("#CLASSES_243").attr("relText").split(",");
- var getInput=$("#CLASSES_243").attr("relText").split(",");
- var j=0;
- if($.inArray('法律',getInput)!=-1){
- seriesData[j]=series1;
- j++;
- }
- if($.inArray('行政法规',getInput)!=-1){
- seriesData[j]=series2;
- j++;
- }
- if($.inArray('地方性法规',getInput)!=-1){
- seriesData[j]=series3;
- j++;
- }
- if($.inArray('行政规章',getInput)!=-1){
- seriesData[j]=series4;
- j++;
- }
- if($.inArray('地方行政规章',getInput)!=-1){
- seriesData[j]=series5;
- j++;
- }
- option.xAxis[0].data=legendData;
- 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]
- },
- {
- name:'行政法规',
- type:'line',
-
- data:[10, 18, 19, 24]
- },
- {
- name:'地方性法规',
- type:'line',
-
- data:[15, 22, 20, 15]
- },
- {
- name:'行政规章',
- type:'line',
-
- data:[15, 22, 20, 15]
- },
- {
- name:'地方行政规章',
- type:'line',
-
- data:[15, 22, 20, 15]
- }
- ]
- };
- function changeLineOption(data){
- var legendData=[];
- var seriesData=[];
- var data1=[];
- var data2=[];
- var data3=[];
- var data4=[];
- var data5=[];
- for(var i=0;i<data.rows.length-1;i++){
- legendData[i]=data.rows[i].name;
- data1[i]=data.rows[i].law;
- data2[i]=data.rows[i].administrationreg;
- data3[i]=data.rows[i].localreg;
- data4[i]=data.rows[i].administrationrul;
- data5[i]=data.rows[i].localrul;
- }
- var series1={ name:'法律',
- type:'line',
- data:data1
- };
- var series2={ name:'行政法规',
- type:'line',
- data:data2
- };
- var series3={ name:'地方性法规',
- type:'line',
- data:data3
- };
- var series4={ name:'行政规章',
- type:'line',
- data:data4
- };
- var series5={ name:'地方行政规章',
- type:'line',
- data:data5
- };
- seriesData=[series1,series2,series3,series4,series5];
- option1.xAxis[0].data=legendData;
- option1.series=seriesData;
- }
- function changeLineOption2(data){
- var legendData=[];
- var seriesData=[];
- var data1=[];
- var data2=[];
- var data3=[];
- var data4=[];
- var data5=[];
- for(var i=0;i<data.rows.length-1;i++){
- //alert(data.rows[i].name);
- legendData[i]=data.rows[i].name;
- data1[i]=data.rows[i].law;
- data2[i]=data.rows[i].administrationreg;
- data3[i]=data.rows[i].localreg;
- data4[i]=data.rows[i].administrationrul;
- data5[i]=data.rows[i].localrul;
- }
- var series1={ name:'法律',
- type:'line',
- data:data1
- };
- var series2={ name:'行政法规',
- type:'line',
- data:data2
- };
- var series3={ name:'地方性法规',
- type:'line',
- data:data3
- };
- var series4={ name:'行政规章',
- type:'line',
- data:data4
- };
- var series5={ name:'地方行政规章',
- type:'line',
- data:data5
- };
-
- option1.legend.data=$("#CLASSES_243").attr("relText").split(",");
- var getInput=$("#CLASSES_243").attr("relText").split(",");
- var j=0;
- if($.inArray('法律',getInput)!=-1){
- seriesData[j]=series1;
- j++;
- }
- if($.inArray('行政法规',getInput)!=-1){
- seriesData[j]=series2;
- j++;
- }
- if($.inArray('地方性法规',getInput)!=-1){
- seriesData[j]=series3;
- j++;
- }
- if($.inArray('行政规章',getInput)!=-1){
- seriesData[j]=series4;
- j++;
- }
- if($.inArray('地方行政规章',getInput)!=-1){
- seriesData[j]=series5;
- j++;
- }
- //seriesData=[series1,series2,series3,series4,series5];
- option1.xAxis[0].data=legendData;
- 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:'行政规章'},
- {value:135, name:'地方行政规章'}
- ]
- }
- ]
- };
- function changePieOption3(data){
- //option2.legend.data=['总体预案','专项预案','现场处置方案','部门预案'];
- option2.legend.data=$("#CLASSES_243").attr("relText").split(",");
- var getInput=$("#CLASSES_243").attr("relText").split(",");
- var index=data.rows.length-1;
- var seriesJson=[];
- var j=0;
- if($.inArray('法律',getInput)!=-1){
- var json={value:data.rows[index]["law"],name:'法律'};
- seriesJson[j]=json;
- j++;
- }
- if($.inArray('行政法规',getInput)!=-1){
- var json={value:data.rows[index]["administrationreg"],name:'行政法规'};
- seriesJson[j]=json;
- j++;
- }
- if($.inArray('地方性法规',getInput)!=-1){
- var json={value:data.rows[index]["localreg"],name:'地方性法规'};
- seriesJson[j]=json;
- j++;
- }
- if($.inArray('行政规章',getInput)!=-1){
- var json={value:data.rows[index]["administrationrul"],name:'行政规章'};
- seriesJson[j]=json;
- j++;
- }
- if($.inArray('地方行政规章',getInput)!=-1){
- var json={value:data.rows[index]["localrul"],name:'地方行政规章'};
- seriesJson[j]=json;
- j++;
- }
- option2.series[0].data=seriesJson;
-
- }
- 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++;
- }
- if(data.rows[index]["localrul"]!=undefined){
- var json={value:data.rows[index]["localrul"],name:'地方行政规章'};
- seriesJson[j]=json;
- j++;
- }
- option2.series[0].data=seriesJson;
-
- /*************************************************** 初始化解析饼图数据 end **********************************************************/
- }
-
- //初始化方法
- $(function(){
-
- $("body").eq(0).showLoading();
-
- $.post($.pathname()+ "/ws/LAWSPOLL/LawsService/getLaws",{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();
- //实施日期
- var pushStartTime1 = $('#beginTime2').val();
- var pushEndTime1 = $('#endTime2').val();
-
- //状态
- var level = $('#STATE_243').attr("relValue");
- //分类
- var chunengType = $('#CLASSES_243').attr("relValue");
- //取所属单位
- var units = $('#UNITE_243').val();
-
-
- //状态
- var tempLevel = null;
- if(level.length>0){
- var temp = level.split(",");
- var tempLevel1="";
- for(var i=0; i<temp.length; i++){
- tempLevel1 +="'"+ temp[i] + "',";
- }
- tempLevel = tempLevel1.substring(0,tempLevel1.length-1);
- }
- //分类
- var temp1 = chunengType.split(",");
- var tempChunengType = "";
- for(var i=0; i<temp1.length; i++){
- tempChunengType+=temp1[i] + ",";
- }
- //分类转换
- var temp2 = tempChunengType.split(",");
- var valueType1 = "";
- for(var i=0; i<temp2.length; i++){
- if(temp2[i]=="law"){
- valueType1+= "'" + "1" +"'" +",";
- }
- if(temp2[i]=="administrationreg"){
- valueType1+= "'" + "2" +"'" +",";
- }
- if(temp2[i]=="localreg"){
- valueType1+= "'" + "3" +"'" +",";
- }
- if(temp2[i]=="administrationrul"){
- valueType1+= "'" + "4" +"'" +",";
- }
- if(temp2[i]=="localrul"){
- valueType1+= "'" + "5" +"'" +",";
- }
- }
-
- var valueType = null;
- if(chunengType.length>0){
- valueType = valueType1.substring(0,valueType1.length-1);
- }
- //单位整理
- var leng = units.length;
- var deptId = null;
- if(leng>0){
- var deptIdsTemp = units.split(",");
- var arrFF = "";
- for(var i=0; i<deptIdsTemp.length; i++){
- arrFF+="'"+deptIdsTemp[i]+"'"+",";
- }
- deptId = arrFF.substring(0,arrFF.length-1);
- }
- /*alert("发布时间:"+pushStartTime+"~"+pushEndTime);
- alert("实施时间:"+pushStartTime1+"~"+pushEndTime1);
- alert("状态:" + tempLevel);
- alert("分类:" + valueType);
- alert("单位:"+deptId);*/
- $.post($.pathname()+ "/ws/LAWSPOLL/LawsService/getLaws",
- {id : deptName,StartTime:pushStartTime,EndTime:pushEndTime,StartTime1:pushStartTime1,EndTime1:pushEndTime1,tempLevel:tempLevel,valueType:valueType,deptId:deptId},
- function (data){
-
- json = data;
- //给表格数据赋值
- loadData= data;
- //初始化表格
- initCompletes(json);
-
- 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);
- }
- });
-
- $(".basicTab").render();
-
- },"json" );
- }
-
- //点击统计按钮触发的事件
- function getCount(){
-
- getNewValue();
-
- //状态
- var level = $('#STATE_243').attr("relValue");
- //分类
- var chunengType = $('#CLASSES_243').attr("relValue");
- //取所属单位
- var units = $('#UNITE_243').val();
-
- var column = level + "," + chunengType + "," + units;
-
- /*var temp = column.split(",");
- var column1 = "";
- for(var i=0; i<temp.length; i++){
- column1+=temp[i]+ ",";
- }
- */
-
- if(chunengType==""){
- chunengType =",";
- }
-
-
- //所属单位
- var url=$.pathname()+ "/ws/Amyjyan/AmyjyanCount/getEditColumns";
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- async : false,
- data : {
- name : "EMC_AM_LAWS_REGULATIONS",column:chunengType
- },
- dataType : 'text',
- success : function(data) {
- columns=eval('('+ data+')');
- //给表格数据赋值
- loadData= eval('('+ data+')');
- //初始化表格
- initCompletes(json);
- },
- error : function(e) {
- $.messager.alert('查询表头失败!', '访问服务失败!', 'error');
- }
- });
-
- }
-
-
- function initCompletes(json){
- g = $("#maingrid").quiGrid({
- columns: columns,
- data:json,
- rownumbers : true,
- usePager : false
- });
-
- //重设高度
- $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
- $(top.document.body).find("iframe").height($(window.document.body).height()+30);
-
- /*重新绑定父页面事件方法*/
- //绑定点击时样式变化事件
- $(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){
- if("总计"==rowdata.name || deptName==rowdata.dept_id){
- return value;
- }else{
- 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);
- $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/laws/laws_poll1.jsp?"+comp_id);
- }
-
- }
- //返回
- function goBack() {
- window.location.href="laws.jsp";
- }
-
-
- //打印
- function print(){
- //alert(1111);
- $("#maingrid").jqprint();
- }
- //重置
- function resetSearch(){
- document.location.reload();
- }
-
- function export_report() {
- var sql = {
- "report_type" : "falv",
- "json" : JSON.stringify(g.getData())
- };
- excelExport(undefined, sql, "法律法规信息统计 ", ['dept_id', 'isParent', 'open'], "法律法规信息统计 ", 'rcpoll');
-
- }
-
- $.messager=top.Dialog;
|