123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- var pageParam={};
- var chart=null;
- var utils=new Util();
-
- /***
- * 初始化方法里填写标题,当前单位名称:广东电网 暂时写死。
- * 可以通过下面方法获取到当前单位名称,上系统时请改成下面这种写法:
- * var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- * **/
-
- var deptId = "";
-
- $(function(){
-
- var dataTemp = (window.location.href).split('?')[1];
-
- deptId = dataTemp;
- var deptUrl = '/nwyj/ws/dept/DeptService/getDepartTree';
-
- $.post(deptUrl,{id:deptId,name:''},function(data){
- dataTemp = data;
- $("#WRITE_DEPT_365").data("data",data);
- $("#WRITE_DEPT_365").render();
- }, "json");
-
-
- 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();
- }
-
-
-
-
-
- //重新打开一个窗口展示下级单位的预案修编数据
- 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/getPlanInfo2",{id : deptId},function(result){
- var sArr=[
- {
- type:"tree",
- stack:"zTotal",
- name:"预案修编数量",
- data:[],
- orient: 'horizontal', // vertical horizontal
- rootLocation: {x: 100,y: 420}, // 根节点位置 {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: '#000',
- fontSize: 15
- }
- },
- 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<len-1
- * 因为后台返回的数据中最后有一行:总合计。
- * 不需要在柱形图里显示,所以用获取到的对象长度减一。
- *
- * ***/
- for(var index=0,len=result.rows.length;index<1;index++){
- var item=result.rows[index];
- var sum=utils.changeQ(item["zTotal"]);
-
- if(sum!=0){
- //deptId 为初始值的ID。
- var time = "2016-03-18";
- sArr[0].data.push(
- {
- "name": "广东电网公司预案统计",
- "children": [
- {
- "name": "总体预案: " + item["ztPlan"] + "(个)",
- "name1": "plan_type=|102|",
- },
- {
- "name": "专项预案: " + item["zxPlan"]+ "(个)",
- "name1": "plan_type=|103|",
- "children": [
- {
- "name": "自然灾害: "+ item["zrzh"]+ "(个)",
- "name1": "plan_type=|103|!and!BYSUNESS_TYPE=|105|",
- },
- {
- "name": "事故灾难: "+ item["sgzh"]+ "(个)",
- "name1": "plan_type=|103|!and!BYSUNESS_TYPE=|106|",
- },
- {
- "name": "公共卫生事件: "+ item["ggws"]+ "(个)",
- "name1": "plan_type=|103|!and!BYSUNESS_TYPE =|107|",
- },
- {
- "name": "社会安全事件: "+ item["shaq"]+ "(个)",
- "name1": "plan_type=|103|!and!BYSUNESS_TYPE=|108|",
- }
-
- ]
-
- },
- {
- "name": "现场处置方案: "+ item["xcczPlan"]+ "(个)",
- "name1": "plan_type=|104|",
- "children": [
- {
- "name": "自然灾害: "+ item["zrzhxc"]+ "(个)",
- "name1": "plan_type=|104|!and!BYSUNESS_TYPE=|105|",
-
- },
- {
- "name": "事故灾难: "+ item["sgzhxc"]+ "(个)",
- "name1": "plan_type=|104|!and!BYSUNESS_TYPE=|106|",
-
- },
- {
- "name": "公共卫生事件: "+ item["ggwsxc"]+ "(个)",
- "name1": "plan_type=|104|!and!BYSUNESS_TYPE=|107|",
- },
- {
- "name": "社会安全事件: "+ item["shaqxc"]+ "(个)",
- "name1": "plan_type=|104|!and!BYSUNESS_TYPE=|108|",
- }
-
- ]
-
- },
- {
- "name": "部门预案: "+ item["bmhj"]+ "(个)",
- "name1": "plan_type=|105|",
- "children": [
- {
- "name": "安全监管部: "+ item["aqjcb"]+ "(个)",
- "name1": "plan_type=|105|!and!INS_UNITS=|112|",
-
- },
- {
- "name": "系统运行部: "+ item["xtyxb"]+ "(个)",
- "name1": "plan_type=|105|!and!INS_UNITS=|113|",
-
- },
- {
- "name": "国际部: "+ item["gjb"]+ "(个)",
- "name1": "plan_type=|105|!and!INS_UNITS=|114|",
-
- },
- {
- "name": "设备管理部: "+ item["scsbglb"]+ "(个)",
- "name1": "plan_type=|105|!and!INS_UNITS=|115|",
- },{
- "name": "市场营销部: "+ item["scsbglb"]+ "(个)",
- "name1": "plan_type=|105|!and!INS_UNITS=|117|",
- },{
- "name": "信息部: "+ item["xxb"]+ "(个)",
- "name1": "plan_type=|105|!and!INS_UNITS=|116|",
- }
-
- ]
-
- },
- {
- "name": "政府预案: "+ item["zhengfu"]+ "(个)",
- "name1": "plan_type=|106|",
- }
-
- ]
- }
- );
- //每次循环取每一行数据中的合计数进行累加,形成修编总数。
- /*sumTotle = sumTotle + sum;
- xAxis.push(item["name"]);*/
- }
- }
- //将获取到的总数量转化为字符形式。
- //sumTotle = sumTotle + "";
- /**
- * 设置标题
- * 获取系统时间:(由于不在系统框架内,无法获取系统时间,上线时可用下面函数获取系统时间)
- * var currDate = getNowFormatDate(); YYYY-MM-DD HH:MM:SS
- *
- */
-
- pageParam.opParams={
- //title:"截止时间:"+data["APPEAR_TIME"],//标题
- title:"截止时间:"+"2016-03-07 11:23:00",//标题
- //subtext:"当前修编个数:" + sumTotle,
- unit:"个",//单位
- leArr:["预案修编数量"],//图例
- xAxis:xAxis,//x轴
- sArr:sArr//主数据
- };
- //setTitle(data,"(条)")
- chart=getEchart($("#i_page_chart"),getOption,pageParam.opParams,null);
- //var condition = "IS_DEL='0' and (PLAN_STAT='1' or PLAN_STAT1='1' or REMARK1='"+ getUser_id +"') and UNITS='"+parent_id+"'";
- bindEvent();
- },"json");
- //设置标题的名称
- $("#i_page_head_title").empty();
- $("#i_page_head_title").append("<h2>"+pageParam.title+"</h2>");
- }
- /**
- * 绑定事件
- */
- 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();
- });
- }
|