123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>日常应急预案修订</title>
- <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <script type="text/javascript" src="/nwyj/page/cockpit/context.js"></script>
- <!--框架必需start-->
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/main.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/framework.js"></script>
- <link href="/nwyj/scripts/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
- <link rel="stylesheet" type="text/css" id="skin" prePath="/nwyj/scripts/qui/" scrollerY="false"/>
- <link rel="stylesheet" type="text/css" id="customSkin"/>
- <!--框架必需end-->
- <!--树组件start-->
- <link rel="stylesheet" type="text/css" href="/nwyj/scripts/qui/libs/js/tree/ztree/ztree.css" />
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/tree/ztree/ztree.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/form/selectTree.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/form/listerTree.js"></script>
- <!--树组件end-->
- <link rel="stylesheet" type="text/css" href="/nwyj/page/cockpit/chartPage.css">
- <script type="text/javascript" src="/nwyj/page/cockpit/echarts-2.2.7/build/dist/echarts-all.js"></script>
- <script type="text/javascript" src="/nwyj/page/cockpit/echarts-2.2.7/build/dist/chart/bar.js"></script>
- <script type="text/javascript" src=" /nwyj/page/cockpit/cockpit_echart.js"></script>
- <script type="text/javascript" src="/nwyj/page/cockpit/laydate/laydate.js"></script>
- <script type="text/javascript" src="/nwyj/page/cockpit/webgis/util.js"></script>
-
- <link rel="stylesheet" type="text/css" href="/nwyj/css/cockpit/charTitle.css">
- </head>
- <body>
- <div id="container" class="jsc_chartitle"></div>
- <div id="choose_content">
- <h2>单位:</h2>
- <div id="compTree" class="selectTree _left_margin" selWidth="280" asyncMode="true" multiMode="true"></div></br>
- <h2>电压等级:</h2>
- <div class="selectTree _left_margin" id="levelTree" selWidth="280" multiMode="true" keepDefaultStyle="true"></div></br>
- <h2>数据源:</h2>
- <div id="from">
- <input type="radio" class="_left_margin" name="from" value="sys">系统数据源
- <input type="radio" class="_left_margin" name="from" value="peo" checked="checked">人工数据源
- </div>
- <h2>间隔时间:</h2>
- <select id="selectList" value=""></select><br/>
- <div class="_startTime _hide">
- <h2>起始时间:</h2>
- <input id="startTime" class="_left_margin" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
- </div>
- <div class="_endTime">
- <h2>时间:</h2>
- <input id="dataTime" class="_left_margin" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
- </div>
- <h2 class="_center"><span class="_query_command">查询</span><span class="_rend_command">刷新</span></h2>
- </div>
-
-
- <script type="text/javascript">
-
- /******************************************************查询条件***********************************************************/
- //图表用参数
- // dept_id//user_id//user_name//dept_name
- var customMadeTool=["search","render","list","enlarge","resource"];//父页面显示的工具栏
- var interval=null;//定时器
- var dataFrom="peo";//数据源的状态
- var n=xn;//初始化默认刷新时间
- var list=intervalList
- var urlParams=resolveUrl();
- HTitle["fixed"]=urlParams["dept_name"];
- HTitle["change"]=urlParams["dept_name"];
- var text=HTitle[tState]+planReviseChart;
- var childId="'"+urlParams["dept_id"]+"'";
- var bindChildId=childId.split(",");//绑定点击事件查询id
- var parentId=urlParams["parentId"];
- var dateTime=getNowDateTime();
- var chart;
- var categorie=[{name:urlParams["dept_name"],column:urlParams["dept_name"]}];
- //默认查询全信息
- var level=planLevel;
- //查询条件配置参数
- var deptUrl=deptTreePath;
- var zNodes2 ={"treeNodes":planLevel};
-
- function init(){
- //添加预案种类列表
- loadSelect($("#selectList"),list);
- // 添加额外属性主要用于最初的初始节点
- $("#compTree").attr('params', '{"deptId":"'+urlParams["dept_id"]+'"}');
- // 异步加载请求地址
- $("#compTree").attr('url', deptUrl);
- $.post(deptUrl, {"id" : urlParams["dept_id"]}, function(data) {$("#compTree").data("data", data);$("#compTree").render();}, "json");
- $("#levelTree").data("data",zNodes2);
- $("#levelTree").render();
- //绑定查询历史事件
- $("._query_command").on("click",query);
- //绑定时时刷新事件
- $("._rend_command").on("click",rend);
- }
-
- //切换查询条件
- function query(){
- //alert("query start...");
- //移除定时器
- interval=removeRendChart(interval);
- //获取部门
- getDepartment();
- //获取预案类型
- level=getLevel($("#levelTree"),level);
- //校验数据
- alert("parentId="+parentId+";categorie="+JSON.stringify({categorie:categorie})+",childId="+childId+"level="+JSON.stringify({categorie:categorie}));
- rendChart();
- }
- function rend(){
- alert("rend start...");
- //移除定时器
- interval=removeRendChart(interval);
- //获取刷新间隔时间
- n=getInterval($("#selectList"),n);
- //获取部门
- getDepartment();
- //获取预案类型
- level=getLevel($("#levelTree"),level);
- //检查数据
- alert("parentId="+parentId+";categorie="+JSON.stringify({categorie:categorie})+",childId="+childId+"level="+JSON.stringify({categorie:categorie}));
- //获取电压等级信息
- rendChart();
- //加载表格
- interval=outoRendChart(interval,n,rendChart);
- }
- //获取部门相关信息
- function getDepartment(){
- if($("#compTree").data("selectedNodes").length>0){
- HTitle["change"]="";
- categorie=[];
- childId="";
- bindChildId=[];
- $.each($("#compTree").data("selectedNodes"),function(index,item){
- HTitle["change"]+=',"'+item.name+'"';
- categorie.push({name:item.name,column:item.id})
- childId+="'"+item.id+"',"
- });
- childId=childId.substring(0,childId.lastIndexOf(","));
- bindChildId=childId.split(",");
- HTitle["change"]=HTitle["change"].substring(1,HTitle["change"].length);
- text=HTitle[tState]+planReviseChart;
- }
- return false;
- }
- function getInitParams(){
- if(loadState["planChart"]==0){
- rendChart();
- interval=outoRendChart(interval,n,rendChart);
- }else{
- $.post(path+"ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getParentsInfo",{comId:urlParams["dept_id"],count:loadState["planChart"]},function(result){
- categorie=[];
- for(var item in result.rows.childId){
- categorie.push({name:result.rows.childName[item],column:result.rows.childId[item]})
- }
- HTitle["change"]="";
- bindChildId=result.rows.childId;
- HTitle["change"]='"'+categorie.join('","')+'"';
- text=HTitle[tState]+planReviseChart;
- //alert("parentId="+parentId+";childId="+childId+";dateTime="+dateTime);
- rendChart();
- interval=outoRendChart(interval,n,rendChart);
- // outoRendChart();
- },"json");
- }
- }
-
- function appendJSONColumnToStr(params,column,cStr){
- var temp=[];
- for(var index in params){
- temp.push(params[index][column]);
- }
- return temp.join(cStr);
- }
-
- //初始化
- $(function(){
- init();
- getInitParams();
- });
-
- function rendChart(){
- loadChart(appendJSONColumnToStr(categorie,"column","-"),appendJSONColumnToStr(level,"column","-"));
- }
- /*****************************************************************************************************************/
- function loadChart(compId,typeId){
- var leArr=[];
- var xArr=[];
- var sArr=[];
- $.post(path+"ws/ChartDaoServiceImpl/ChartDaoServiceImpl/getEmergencyPlans",{comId:compId,typeId:typeId},function(result){
- console.log("result======"+JSON.stringify(result));
- console.log("result_length====="+result.length);
- for(var index in level){
- var temp={name:level[index]["name"],
- type:'bar',
- data:[]
- };
- leArr.push(temp.name);
- for(var item in categorie){
- //x轴坐标
- if(index==0){
- xArr.push(categorie[item].name);
- }
- //获取主数据
- //alert(JSON.stringify(result));
- ///nwyj/WebContent/page/cockpit/emergency_daily/contingency_plans_revised_grid.html
- //alert("===1");
- //alert("==="+bindChildId[item/bindChildId.length]+":"+categorie[item].name);
- //alert("==="+bindChildId[item/bindChildId.length]+":"+categorie[item].name);
- temp.data.push({ data:{url:path+"page/cockpit/emergency_daily/contingency_plans_revised_grid.html",comId:categorie[item].column,state:"NO_RECOVER_",
- childId:bindChildId[item/bindChildId.length],
- typeId:typeId,
- level:level,
- deptName:categorie[item].name},
- value:changeQ(result.rows[categorie[item].column][index]["AMOUNT"])});
-
- }
- sArr.push(temp);
-
-
- }
- /* for(var index=0,len=result.length;index<len;index++){
- series[0].data.push({data:{url:path+"page/cockpit/line_trip/line_trip_grid.html",comId:compId,state:"NO_RECOVER_",
- childId:bindChildId[index/bindChildId.length],typeId:"1",date:date,level:level,deptName:categorie[index]},
- y:changeQ(result[index]["AMOUNT"])});
- }
- console.log("categories===="+JSON.stringify({categories:categories}))
- console.log("series===="+JSON.stringify({series:series}))
- */
- var opParams={
- title:"",//标题
- unit:"单位:台",//单位
- leArr:leArr,//图例
- xArr:xArr,//x轴
- sArr:sArr//主数据
- };
- //console.log("==="+JSON.stringify(opParams))
- chart=getEchart($("#container"),getOption,opParams,chart);
- chart.on("click",function(params){
- alert("===");
- var str =encodeURI("params="+JSON.stringify(params.data.data));
- alert("==="+JSON.stringify(params.data.data));
- alert(params.data.data.url+"?"+str);
- location.href =params.data.data.url+"?"+str;
-
- });
- $(window).resize(function(){
- chart.resize();
- });
- },"json");
- $("#title").html(text) ;
- }
-
-
- /**********************************************************************************/
- </script>
- </body>
- </html>
|