123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- var pageParam={};
- var chart=null;
- var utils=new Util();
- /***
- * 初始化方法里填写标题,当前单位名称:广东电网 暂时写死。
- * 可以通过下面方法获取到当前单位名称,上系统时请改成下面这种写法:
- * var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- * **/
- $(function(){
- pageParam.style=utils.resolveUrl()["style"]||"style3";
- pageParam.title=utils.resolveUrl()["title"]||"广东电网";//pageParam.title=utils.resolveUrl()["title"]||deptName + "预案修编统计";
- pageParam.number=utils.resolveUrl()["number"]||warnningnumber;
- init();
- });
-
- /**
- *初始化方法
- */
- function init(){
- loadChart(pageParam);
- }
-
- function loadChart(jsonParam){
-
- //演练类别的饼图
- getViewType1(jsonParam);
- //演练形式的饼图
- getViewType(jsonParam);
-
- }
-
- //根据演练类别:综合演练、专项演练展示的饼图,演练类别的饼图
- function getViewType1(jsonParam){
-
- /**
- * 获取数据;
- * param :id;
- * 备注:由于不在系统框架内,获取不到登录人单位的ID,现在传入的单位ID写死。上线的时候请更改过来。
- * 用这个方法取当前登录人单位ID:
- * var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- * 将第32行代替换34行代码。
- * $.post("/nwyj//ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanInfo2",{id : deptId},function(result){
- * ***/
- $.post("/nwyj/ws/DrillCount/DrillCountService/getDrillInfo",{id : "11"},function(result){
- alert(JSON.stringify(result));
-
- var sArr=[{type:"pie",data:[]}];
- var xAxis=[];
- var item=result.rows[0];
- sArr[0].data=[
- {value:utils.changeQ(item["Drill_param"]),
- name:"综合演练",
- compId:item["Drill_param"],
- data:{number:jsonParam.number},
- itemStyle: {
- normal: {color:pageStyle[jsonParam.style]["chartColor"][0],
-
- label : { show : true,
- position: "insideTop",
- textStyle: {fontSize: 14,fontStyle: "normal",fontWeight: "bold"},
- formatter: "{b} : {c} ({d}%)"
- }
- }
-
-
- }
- },
-
- {value:utils.changeQ(item["Drill_test"]),
- name:"专项演练",
- compId:item["Drill_test"],
- data:{number:jsonParam.number},
-
- itemStyle: {
- normal: {color:pageStyle[jsonParam.style]["chartColor"][1],
- label : { show : true,
- position: "insideTop",
- textStyle: {fontSize: 14,fontStyle: "normal",fontWeight: "bold"},
- formatter: "{b} : {c} ({d}%)"
- }}}
- }
- ];
-
- pageParam.opParams={
- title:"广东",//标题
- unit:"个",//单位
- leArr:["综合演练","专项演练"],//图例
- xAxis:xAxis,//x轴
- sArr:sArr//主数据
- };
-
- setTitle(item,"(个)");
- chart=getEchart($("#i_page_chart2"),getOption,pageParam.opParams,null);
- bindEvent();
- },"json");
- }
-
-
- function getViewType(jsonParam){
-
- /**
- * 获取数据;
- * param :id;
- * 备注:由于不在系统框架内,获取不到登录人单位的ID,现在传入的单位ID写死。上线的时候请更改过来。
- * 用这个方法取当前登录人单位ID:
- * var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- * 将第32行代替换34行代码。
- * $.post("/nwyj//ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanInfo2",{id : deptId},function(result){
- * ***/
- $.post("/nwyj/ws/DrillCount/DrillCountService/getDrillInfo",{id : "11"},function(result){
-
-
- var sArr=[{type:"pie",data:[]}];
- var xAxis=[];
- var item=result.rows[0];
- sArr[0].data=[
- {value:utils.changeQ(item["locale"]),
- name:"现场演练",
- compId:item["locale"],
- data:{number:jsonParam.number},
- itemStyle: {
- normal: {color:pageStyle[jsonParam.style]["chartColor"][0],
-
- label : { show : true,
- position: "insideTop",
- textStyle: {fontSize: 14,fontStyle: "normal",fontWeight: "bold"},
- formatter: "{b} : {c} ({d}%)"
- }
- }
-
-
- }
- },
-
- {value:utils.changeQ(item["desktop"]),
- name:"桌面演练",
- compId:item["desktop"],
- data:{number:jsonParam.number},
-
- itemStyle: {
- normal: {color:pageStyle[jsonParam.style]["chartColor"][1],
- label : { show : true,
- position: "insideTop",
- textStyle: {fontSize: 14,fontStyle: "normal",fontWeight: "bold"},
- formatter: "{b} : {c} ({d}%)"
- }}}
- },
- {value:utils.changeQ(item["sm_locale"]),
- name:"双盲现场",
- compId:item["sm_locale"],
- data:{number:jsonParam.number},
-
- itemStyle: {
- normal: {color:pageStyle[jsonParam.style]["chartColor"][2],
- label : { show : true,
- position: "insideTop",
- textStyle: {fontSize: 14,fontStyle: "normal",fontWeight: "bold"},
- formatter: "{b} : {c} ({d}%)"
- }}}
- },
- {value:utils.changeQ(item["sm_desktop"]),
- name:"双盲桌面",
- compId:item["sm_desktop"],
- data:{number:jsonParam.number},
-
- itemStyle: {
- normal: {color:pageStyle[jsonParam.style]["chartColor"][3],
- label : { show : true,
- position: "insideTop",
- textStyle: {fontSize: 14,fontStyle: "normal",fontWeight: "bold"},
- formatter: "{b} : {c} ({d}%)"
- }}}
- }
- ];
-
- pageParam.opParams={
- title:"广东",//标题
- unit:"个",//单位
- leArr:["现场演练","桌面演练","双盲现场","双盲桌面"],//图例
- xAxis:xAxis,//x轴
- sArr:sArr//主数据
- };
-
- setTitle(item,"(个)");
- chart=getEchart($("#i_page_chart1"),getOption,pageParam.opParams,null);
- bindEvent();
- },"json");
- }
-
-
- /**
- * 绑定事件
- */
- function bindEvent(){
- //点击事件
- chart.on("click",function(params){
- if(params.data.name=="配网"){
- var pathStr=url["http_path"]+"page/cockpit/echart_maticView/line_trip/line_trip_sum_chart_peiwang_grid.html?"+$.param(params.data.data);
- }else{
- alert("主网信息");
- }
- utils.openIframe(pathStr);
- });
- //自适应
- $(window).resize(function(){
- chart.resize();
- });
- }
- /**
- * 设置标题
- * 获取系统时间:(由于不在系统框架内,无法获取系统时间,上线时可用下面函数获取系统时间)
- * var currDate = getNowFormatDate(); YYYY-MM-DD HH:MM:SS
- * 将获取的系统时间填充到下面代码:
- * $("#i_page_head_subtitle").append("<div>截止时间:"+currDate+"</div><div>修编个数:"+jsonParam["zTotal"]+unit+"</div>");
- */
- function setTitle(jsonParam,unit){
- $("#i_page_head_title").empty();
- $("#i_page_head_subtitle").empty();
- $("#i_page_head_title").append("<h2>"+pageParam.title+"</h2>");
- $("#i_page_head_subtitle").append("<div>截止时间:"+jsonParam["APPEAR_TIME"]+"</div><div>演练计划个数:"+jsonParam["zTotal"]+unit+"</div>");
- }
|