123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- <%@ page language="java" contentType="text/html;charset=utf-8"%>
- <%@include file="/pages/includes/taglibs.jsp"%>
- <head>
- <script type="text/javascript"
- src="<%=request.getContextPath()%>/resource/js/jquery-1.8.3.js">
- </script>
- <script type="text/ecmascript"
- src="<%=request.getContextPath()%>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js">
- </script>
- <script type="text/ecmascript"
- src="<%=request.getContextPath()%>/resource/plugin/jqgrid/js/i18n/grid.locale-cn.js">
- </script>
- <script type="text/ecmascript"
- src="<%=request.getContextPath()%>/resource/js/system/jqdatagridpage.js">
- </script>
- <script
- src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js"
- type="text/javascript">
- </script>
- <link rel="stylesheet" type="text/css"
- href="<%=request.getContextPath()%>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
- <link rel="stylesheet" type="text/css" media="screen"
- href="<%=request.getContextPath()%>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
- <link rel="stylesheet"
- href="<%=request.getContextPath()%>/resource/css/ztree/zTreeStyle.css"
- type="text/css">
- <script
- src="<%=request.getContextPath()%>/resource/js/ztree/jquery.ztree.all.min.js"
- type="text/javascript">
- </script>
- <script
- src="<%=request.getContextPath()%>/resource/js/highcharts/highcharts.src.js"
- type="text/javascript">
- </script>
- <script
- src="<%=request.getContextPath()%>/resource/js/highcharts/highcharts-more.js">
- </script>
- <script type="text/javascript">
- var inital=1;
- function changeFc(windfarm, windturbineid) {
- var url = "../warn/changeFc.action?fcId=" + windfarm;
- $.ajax( {
- type : "post",
- url : url,
- dataType : "json",
- success : function(data) {
- if (data.length != 0) {
- eval(data);
- $("#windturbineid").empty();
- for ( var i = 0; i < data.length; i++) {
- $("#windturbineid").append(
- "<option value='" + data[i].id + "'>" + data[i].code
- + "</option>");
- }
- $("#windturbineid").val(windturbineid);
- } else {
- $("#windturbineid").empty();
- }
- }
- });
- if(inital!=1)
- {
- setTimeout(queryData, 1000 );
- }else
- {
- inital++;
- }
- }
- var series;
- var options;
- var chart;
- $(function() {
- var wf = '<s:property value="windfarm"/>';
- var wt = '<s:property value="windturbineid"/>';
- changeFc(wf, wt);
- showJqGrid();
- options = {
- chart : {
- renderTo : 'container',
- width:1600,
- height:300,
- type : 'line'
- },
- title : {
- text : '功率曲线'
- },
- xAxis : {
- categories : [],
- labels : {
- rotation : -45,
- align : 'right',
- style : {
- fontSize : '13px',
- fontFamily : 'Verdana, sans-serif'
- }
- }
- },
- yAxis : {
- title : {
- text : '功率(kW)'
- }
- },
- tooltip : {
- headerFormat : '<b>{series.name}</b><br/>',
- pointFormat : ' {point.y}MW'
- },
- plotOptions : {
- spline : {
- marker : {
- enable : false
- }
- }
- },
- series : [ {
- name : '实际功率',
- data : []
- }, {
- name : '最优拟合功率',
- data : []
- }, {
- name : '保证功率',
- data : []
- } ]
- }
- chartAjax();
- })
- var temp = 0;
- function chartAjax() {
- var url;
- var windturbineid = $("#windturbineid").val();
- url = "../compareown/compareAmountchatAjax.action?windturbineid=" + windturbineid;
- $.ajax( {
- url : url,
- type : "get",
- cache : false,
- dataType : "json",
- data : {},
- ifModified : false,
- success : function(result) {
- var sj = [];
- var zy = [];
- var bz = [];
- var fu = [];
- if (null != result) {
- $.each(result, function(m, obj) {
- if (obj.value1 != null) {
- fu.push(parseFloat(obj.value1));
- }
- if (obj.value2 != null) {
- sj.push(parseFloat(obj.value2));
- }
- if (obj.value3 != null) {
- zy.push(parseFloat(obj.value3));
- }
- if (obj.value4 != null) {
- bz.push(parseFloat(obj.value4));
- }
- });
- }
- options.series[0].data = sj;
- options.series[1].data = zy;
- options.series[2].data = bz;
- options.xAxis.categories = fu;
- chart = new Highcharts.Chart(options);
- //alert(options.xAxis.categories);
- }
- });
- }
- function queryData() {
- var windturbineid = $("#windturbineid").val();
- var windfarm = $("#windfarm").val();
- if (windfarm == "") {
- alert("请选择风场!");
- return;
- }
- if (windturbineid == "") {
- alert("请选择风机!");
- return;
- }
- $("#gridTable").jqGrid('GridUnload');
- showJqGrid();
- chartAjax();
- }
- function editData(id) {
- $("#f1").attr("action", "updateindex.action?wtid=" + id).submit();
- }
- function toExcel() {
- var windturbineid = $("#windturbineid").val();
- var windfarm = $("#windfarm").val();
- if (windfarm == "") {
- alert("请选择风场!");
- return;
- }
-
-
- var temp = "compareExcel.action?windfarm=" + windfarm + "&windturbineid="
- + windturbineid ;
- var url = encodeURI(encodeURI(temp));
- $('#toexcel').attr('href', url);
- }
- function displaybuttons(cellvalue, options, rawObject) {
- var detail = "<input type='button' value='修改' onclick=editData('"
- + rawObject.id + "')>";
- return " \t" + detail;
- };
- function showJqGrid() {
-
- var windturbineid = $("#windturbineid").val();
- var windfarm = $("#windfarm").val();
- var id = 'gridTable';
- var url = '<%=request.getContextPath()%>/compareown/compareAmountlist.action?windfarm='
- + windfarm
- + "&windturbineid="
- + windturbineid;
- var datatype = 'json';
- var colNames = [ '编号', '风机','编码', '风速', '实际功率', '最优拟合功率' ];
- var colModel = [
- {
- name : 'id',
- index : 'id',
- width : 100,
- align : 'center',
- hidden : true
- }, {
- name : 'windturbineid',
- index : 'windturbineid',
- width : 200,
- align : 'center',
- hidden : true
- }, {
- name : 'code',
- index : 'code',
- width : 200,
- align : 'center'
- }, {
- name : 'speed',
- index : 'speed',
- width : 200,
- align : 'center'
- }, {
- name : 'actualpower',
- actualpower : 'modelid',
- width : 200,
- align : 'center'
- }, {
- name : 'optimalpower',
- index : 'optimalpower',
- width : 200,
- align : 'center'
- } ];
- var caption = '单机总功率信息列表';
- var sortname = 'speed';
- var gridPagerID = 'gridPager';
- var sortorder = 'asc';
- var height='300';
-
- var width='1600';
- var rownumbers = true;
- var multiselect = false;
- myJqGrid(id, url, datatype, colNames, colModel, caption, sortname,
- gridPagerID, sortorder, height, width, multiselect, rownumbers);
- }
- </script>
- <style type="text/css">
- .a { /* 统一设置所以样式 */
- font-family: Arial;
- font-size: 12px;
- text-align: center;
- margin: 3px;
- }
- .a:link,a:visited { /* 超链接正常状态、被访问过的样式 */
- color: #fff;
- padding: 4px 10px 4px 10px;
- background-color: #083772;
- text-decoration: none;
- border-top: 1px solid #EEEEEE; /* 边框实现阴影效果 */
- border-left: 1px solid #EEEEEE;
- border-bottom: 1px solid #717171;
- border-right: 1px solid #717171;
- }
- .a:hover { /* 鼠标指针经过时的超链接 */
- color: #fff; /* 改变文字颜色 */
- padding: 5px 8px 3px 12px; /* 改变文字位置 */
- background-color: #083772; /* 改变背景色 */
- border-top: 1px solid #717171; /* 边框变换,实现“按下去”的效果 */
- border-left: 1px solid #717171;
- border-bottom: 1px solid #EEEEEE;
- border-right: 1px solid #EEEEEE;
- }
- </style>
- </head>
- <body>
- <form action="" method="post" id="f1">
- <fieldset style="height: 50px" id="fst">
- <legend class="item_Name">
- 查询条件
- </legend>
- <table width="100%" cellpadding="0" cellspacing="0" class="dataform">
- <tr>
- <th width="5%" class="item_Name">
- 风电电场:
- </th>
- <td width="20%">
- <s:if test="u.wpId == null">
- <s:select list="wps" cssStyle="width:90%" listKey="id"
- listValue="name" id="windfarm" name="windfarm" headerKey=""
- headerValue="请选择" onchange="javascript:changeFc(this.value);"></s:select>
- </s:if>
- <s:else>
- <s:select list="wps" cssStyle="width:90%" listKey="id"
- listValue="name" id="windfarm" name="windfarm" headerKey=""
- headerValue="请选择" onchange="javascript:changeFc(this.value);"></s:select>
- </s:else>
- </td>
- <th width="5%" class="item_Name">
- 风机:
- </th>
- <td width="20%">
- <select name="windturbineid" id="windturbineid" style="width: 90%"
- onchange="javascript:queryData();">
- <option value="">
- 请选择
- </option>
- </select>
- </td>
-
- </tr>
- </table>
- </fieldset>
- <table id='gridTable'>
- </table>
- <div id='gridPager'></div>
- <div id="container"
- style="background-color: '#ffffff'; vertical-align: middle; width: 100%; height: 100%"></div>
- </form>
- </body>
|