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); // getTreeValue(); } var deptId = "11"; //重新打开一个窗口展示下级单位的预案修编数据 function getNewCompId(){ var type = $('#WRITE_DEPT_365').attr("relvalue"); //var pathStr=url["http_path"]+"page/cockpit/echart_maticView/amResource/ContingencyPlanHuiZongZtNew1.html?"+type; window.open("/nwyj/page/cockpit/echart_maticView/amResource/ContingencyPlanHuiZongZtNew1.html?"+type); //utils.openIframe(pathStr); } function loadChart(jsonParam){ /** * param :id; * 备注:由于不在系统框架内,获取不到登录人单位的ID,现在传入的单位ID写死。上线的时候请更改过来。 * 用这个方法取当前登录人单位ID: * var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids(); * * **/ $.post("/nwyj/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanInfo",{id : deptId},function(result){ //alert(JSON.stringify(result)); var length = result.rows.length; var zongti = result.rows[length-1].ztPlan; var zhuanxiang = result.rows[length-1].zxPlan; var xianchang = result.rows[length-1].xcczPlan; var bumen = result.rows[length-1].bmhj; $('#shaq').html("111111"); var sArr=[ { type:"tree", stack:"zTotal", name:"预案数量", data:[], orient: 'horizontal', // vertical horizontal rootLocation: {x: 200,y: 150}, // 根节点位置 {x: 100, y: 'center'} nodePadding: 20, layerPadding: 500, hoverable: false, roam: true, symbolSize: 30, itemStyle: { normal: { color: '#4883b4', label: { show: true, position: 'right', formatter: "{a}", textStyle: { color: '#fff', fontSize: 25 } }, lineStyle: { color: '#ccc', type: 'broken' // 'curve'|'broken'|'solid'|'dotted'|'dashed' } }, emphasis: { color: '#4883b4', label: { show: false }, borderWidth: 0 } } } ]; var xAxis=[]; //var data=result.rows[0]; //初始化总数量,默认值为:0. var sumTotle=0; /** * 下面的循环:index"+pageParam.title+""); } /** * 绑定事件 */ function bindEvent(){ /*** * 点击事件 * URL:page/cockpit/echart_maticView/amResource/ContingencyPlanHuiZong.html(饼图) * * url是链接到饼图的链接。 * 如有别的链接需求,需要另外配置。 * * **/ //页面跳转到预案的主页面,传入condition chart.on("click",function(params){ var id =JSON.stringify(params.data.name1); id = id.substring(1,id.length-1); var pathStr=url["http_path"]+"page/cockpit/echart_maticView/amResource/ContingencyPlanXiubian.html?"+id; utils.openIframe(pathStr); }); //自适应 $(window).resize(function(){ chart.resize(); }); }