123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393 |
- <%@ page language="java" import="java.util.*" pageEncoding="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/jqdatagrid.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" />
- <script type="text/javascript" src="<%=request.getContextPath()%>/resource/plugin/highslide/highslide-with-html.js"></script>
- <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resource/plugin/highslide/highslide.css" />
-
-
-
- <style type="text/css">
- #username{
- height: 15px;
- }
- #password{
- height: 15px;
- }
- a.url{ /* 统一设置所以样式 */
- font-family:Arial;
- font-size:12px;
- text-align:center;
- margin:3px;
- }
- a:link.url ,a:visited.url{ /* 超链接正常状态、被访问过的样式 */
- color:#000000;
- padding:4px 10px 4px 10px;
- background-color:#f1f1f1;
- 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.url{ /* 鼠标指针经过时的超链接 */
- color:#821818; /* 改变文字颜色 */
- padding:5px 8px 3px 12px; /* 改变文字位置 */
- background-color:#e2c4c9; /* 改变背景色 */
- border-top:1px solid #717171; /* 边框变换,实现“按下去”的效果 */
- border-left:1px solid #717171;
- border-bottom:1px solid #EEEEEE;
- border-right:1px solid #EEEEEE;
- }
-
- </style>
- <script type="text/javascript">
- hs.graphicsDir = '<%=request.getContextPath()%>/resource/plugin/highslide/graphics/';
- hs.outlineType = 'rounded-white';
- hs.wrapperClassName = 'draggable-header';
- var action = -99;
- function showDiv1(a) {
- var hc = $("#container");
- action = a;
- return hs.htmlExpand(hc[0], {
- contentId : 'showDiv2',
- width : 300,
- height : 200,
- align : 'center',
- headingText : '输入账号密码'
- });
- }
- function hsreset(){
- $("#operator").val("");
- $("#username").val("");
- $("#password").val("");
- }
- function check(){
- var operator = $("#operator").val();
- var username = $("#username").val();
- var password = $("#password").val();
- if(operator=="" || operator==null){
- alert("请输操作人姓名");
- }else if(username=="" || username==null){
- alert("请输入用户名");
- }else if(password=="" || password==null){
- alert("请输入密码");
- }else{
- $.post("/statisticsAnalysis/reportusers_check.action",{username:username,password:password,action:action,wpid:$("#wfId").val()},function(data){
- if(data==1){
- if(action ==1){
- $.post("/statisticsAnalysis/statisticsstate_save.action",{state:1,tbid:username,action:1,tbname:operator,tid:$("#stId").val()},function(data){
- hs.close();
- hsreset();
- saveData();
- return;
- })
- }else if(action ==2 ){
- $.post("/statisticsAnalysis/statisticsstate_save.action",{state:2,shid:username,action:2,shname:operator,tid:$("#stId").val()},function(data){
- alert("审核成功");
- hsreset();
- hs.close();
- status();
- return;
- })
- }else if(action ==3){
- $.post("/statisticsAnalysis/statisticsstate_save.action",{state:3,qrid:username,action:3,qrname:operator,tid:$("#stId").val()},function(data){
- alert("确认成功");
- hsreset();
- hs.close();
- status();
- return;
- })
- }
- }else{
- alert("账号密码不正确或您的权限不足!")
- }
- })
- }
- }
- function queryClear(){
- $("#targetName").val("");
- }
- function returnMainPage(){
- // 场站查询条件
- var wfIdQ = $("#wfIdQ").val();
- // 日期查询条件
- var recordDateQ = $("#recordDateQ").val();
- $("#formView").attr("action", "/statisticsAnalysis/analysismain.action?wfIdQ="+wfIdQ+"&recordDateQ="+recordDateQ).submit();
- }
- function queryData(){
- $("#gridTable").jqGrid('GridUnload');
- showJqGrid();
- // 风场ID
- //var stId = $("#stId").val();
- // 指标名称
- //var targetName = $("#targetName").val();
-
- //jQuery("#gridTable").jqGrid('setGridParam',{url:encodeURI(encodeURI("analysisList.action?targetName="+ targetName + "&stId="+stId))}).trigger("reloadGrid");
- }
- function saveData() {
- // 风场ID
- var wfId = $("#wfId").val();
- // 日期
- var recordDate = $("#recordDate").val();
- var array = [];
-
- $("#gridTable").find("tr").each(function(i){
- if(i>0){
- var tempid = $(this).find("td").eq(0).text();
- var tempVal = '';
- var temptype = $(this).find("td").eq(9).text();
- if(temptype != '计算' && temptype != '特殊'){
- tempVal = $(this).find("td").eq(4).find("input").val();
- // 为空判断
- tempVal = tempVal.replace(/\s+/g, "");
- if(tempVal==""){
- alert("当日值不能为空");
- return false;
- }
-
- // 非法数字判断
- if(isNaN(tempVal)){
- alert("当日值必须为数字");
- return false;
- }
-
- array.push(tempid+"/"+tempVal);
- } else {
- tempVal = $(this).find("td").eq(4).text();
- array.push(tempid+"/"+tempVal);
- }
- }
- });
- $.ajax({
- type: "POST",
- url: "/statisticsAnalysis/batchSave.action?wfId="+wfId+"&recordDate="+recordDate+"&idsStr="+array,
- dataType:"json",
- complete:function (XMLHttpRequest, textStatus) {
- queryData();
- alert('保存成功');
- status();
- }
- });
- }
- function status(){
- $.post("/statisticsAnalysis/statisticsstate_status.action",{tid:$("#stId").val()},function(data){
- if(data==-1){
- $("#baocun").removeAttr("disabled");
- $("#shenhe").attr({"disabled":"disabled"});
- $("#queren").attr({"disabled":"disabled"});
- }
- if(data==1){
- $("#baocun").attr({"disabled":"disabled"});
- $("#shenhe").removeAttr("disabled");
- $("#queren").attr({"disabled":"disabled"});
- }
- if(data==2){
- $("#baocun").attr({"disabled":"disabled"});
- $("#shenhe").attr({"disabled":"disabled"});
- $("#queren").removeAttr("disabled");
- }
- if(data==3){
- $("#baocun").attr({"disabled":"disabled"});
- $("#shenhe").attr({"disabled":"disabled"});
- $("#queren").attr({"disabled":"disabled"});
- }
- })
- }
- $(function(){
- status();
- showJqGrid();
-
- // 风场名称
- var wsnametext = $("#wfId").find("option:selected").text();
- $("#wsname").text(wsnametext);
-
- // 日期
- var wstimetext = $("#recordDate").val();
- $("#wstime").text(wstimetext);
- });
-
- // 加载jqgrid表格
- function showJqGrid(){
- // 场站
- var stId = $("#stId").val();
- // 日期
- var targetName = $("#targetName").val();
- //+'&targetName='+targetName
-
- jQuery("#gridTable").jqGrid({
- url:'/statisticsAnalysis/analysisList.action?stId='+stId,
- mtype:'POST',
- postData:{targetName:targetName},
- datatype: "json",
- colNames:['编号','指标名称','单位','当日值(只读)','当日值(可变)','当前星期值','当前月份值','当前季度值','当前年值','类别','公式描述'],
- colModel:[
- { name: 'id', index: 'id', width: 200, align: 'center', hidden: true},
- { name: 'targetName', index: 'targetName', width: 200, align: 'center'},
- { name: 'unit', index: 'unit', width: 100, align: 'center'},
- { name: 'dayValueR', index: 'dayValueR', width: 100, align: 'center'},
- { name: 'dayValue', index: 'dayValue', width: 100, align: 'center',editable : true},
- { name: 'weekValue', index: 'weekValue', width: 100, align: 'center'},
- { name: 'monthValue', index: 'monthValue', width: 100, align: 'center'},
- { name: 'quarterValue', index: 'wpId', width: 100, align: 'center'},
- { name: 'yearValue', index: 'wpName', width: 100, align: 'center'},
- { name: 'type', index: 'recordDate', width: 100, align: 'center'},
- { name: 'formulaDesc', index: 'operate', width: 600, align: 'center'}
- ],
- rowNum:1000,
- height:630,
- width:1000,
- editurl : '/statisticsAnalysis/analysisList.action?stId='+stId+'&targetName='+targetName+"/RowEditing",
- autowidth: true,
- sortorder: "desc",
- caption: "统计分析列表",
- pager: '#gridPager',
- viewrecords: true,
- afterInsertRow:function(rowid,rowdata,rowelem){
- var operateLink = "<a href=\"#\" onclick=\"requestAction('/statisticsAnalysis/index.action?wfId=" + rowdata.wpId + "&stId=" + rowdata.id + "&recordDate=" + rowdata.recordDate + "&wfIdQ=" + wfIdQ + "&recordDateQ=" + recordDateQ + "')\">场站统计分析</a> / "+
- "<a href=\"#\" onclick=\"requestAction('/windTurbineAnalysis/windturbineanalysismain.action?wfId=" + rowdata.wpId + "&stId=" + rowdata.id + "&recordDate=" + rowdata.recordDate + "&wfIdQ=" + wfIdQ + "&recordDateQ=" + recordDateQ + "')\">设备统计分析</a>";
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{operate:operateLink});
-
- if(rowdata.type == '基础' ){
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Green>"+rowdata.targetName+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Green>"+rowdata.unit+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Green>"+rowdata.dayValueR+"</font>"});
- jQuery("#gridTable").jqGrid('editRow', rowdata.id);
- //jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValue:"<input type='text' style='width: inherit;' name='names' value='"+rowdata.dayValue+"'></input>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Green>"+rowdata.weekValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Green>"+rowdata.monthValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Green>"+rowdata.quarterValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Green>"+rowdata.yearValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Green>"+rowdata.type+"</font>"});
- } else if(rowdata.type == '计算' ){
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Purple>"+rowdata.targetName+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Purple>"+rowdata.unit+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Green>"+rowdata.dayValueR+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValue:"<font color=Purple>"+rowdata.dayValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Purple>"+rowdata.weekValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Purple>"+rowdata.monthValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Purple>"+rowdata.quarterValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Purple>"+rowdata.yearValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Purple>"+rowdata.type+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{formulaDesc:"<font color=Purple>"+rowdata.formulaDesc+"</font>"});
- } else if(rowdata.type == '默认' ){
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Orange>"+rowdata.targetName+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Orange>"+rowdata.unit+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Orange>"+rowdata.dayValueR+"</font>"});
- jQuery("#gridTable").jqGrid('editRow', rowdata.id);
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Orange>"+rowdata.weekValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Orange>"+rowdata.monthValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Orange>"+rowdata.quarterValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Orange>"+rowdata.yearValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Orange>"+rowdata.type+"</font>"});
- } else if(rowdata.type == '手填' ){
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Blue>"+rowdata.targetName+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Blue>"+rowdata.unit+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Blue>"+rowdata.dayValueR+"</font>"});
- jQuery("#gridTable").jqGrid('editRow', rowdata.id);
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Blue>"+rowdata.weekValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Blue>"+rowdata.monthValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Blue>"+rowdata.quarterValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Blue>"+rowdata.yearValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Blue>"+rowdata.type+"</font>"});
- } else if(rowdata.type == '特殊' ){
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{targetName:"<font color=Red>"+rowdata.targetName+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{unit:"<font color=Red>"+rowdata.unit+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValueR:"<font color=Red>"+rowdata.dayValueR+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{dayValue:"<font color=Red>"+rowdata.dayValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{weekValue:"<font color=Red>"+rowdata.weekValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{monthValue:"<font color=Red>"+rowdata.monthValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{quarterValue:"<font color=Red>"+rowdata.quarterValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{yearValue:"<font color=Red>"+rowdata.yearValue+"</font>"});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{type:"<font color=Red>"+rowdata.type+"</font>"});
- }
- }
- });
- }
-
- </script>
- </head>
- <body>
- <div class="highslide-html-content" id="showDiv2" style="width: 1100">
- <div class="highslide-header">
- <ul>
- <li class="highslide-move">
- <a href="#" onclick="return false">Move</a>
- </li>
- <li class="highslide-close" >
- <a href="#" onclick="return hs.close(this)"></a>
- </li>
- </ul>
- </div>
- <div class="highslide-body" id="container" style="width: 289px">
- <table height="180px">
- <tr><td width="100px" align="right" style="font-size: 16px;font-weight: bold;">操 作 人:</td><td width="190px"><input type="text" name="operator" id="operator" placeholder= "请输入操作人姓名" /> </td></tr>
- <tr><td width="100px" align="right" style="font-size: 16px;font-weight: bold;">用 户 名:</td><td width="190px"><input type="text" name="username" id="username" placeholder= "请输入用户名" /> </td></tr>
- <tr><td width="100px" align="right" style="font-size: 16px;font-weight: bold;">密 码:</td><td width="190px"><input type="password" name="password" id="password" placeholder= "请输入密码"/> </td></tr>
- <tr><td width="100px" align="center" colspan="2"><input type="button" class="button" onclick="javascript:check();" value="确定"/> <input type="reset" class="button" onclick="javascript:hs.close();" value="取消"/></td>
- </tr>
- </table>
-
-
- </div>
- </div>
- <table width="100%">
- <tr>
- <td align="left" class="navbar" style="font-size: 12px;"><font id="wsname"></font>统计分析<font id="wstime"></font></td>
- <td align="right">
- <input type="button" id = 'baocun' class="button" onclick="javascript:showDiv1(1);" value="保存"/>
- <input type="button" id="shenhe" class="button" onclick="javascript:showDiv1(2);" value="审核"/>
- <input type="button" id="queren" class="button" onclick="javascript:showDiv1(3);" value="确认"/>
- <a href="/statisticsAnalysis/analysisListexcel.action?stId=${stId}" class="url" id="toexcel">导出</a>
- <input type="button" class="button" onclick="javascript:returnMainPage();" value="返回"/>
- </td>
- </tr>
- </table>
- <hr/>
- <fieldset id="fst">
- <legend class="item_Name">查询条件</legend>
- <table width="1000px" cellpadding="0" cellspacing="0" class="dataform">
- <tr>
- <td align="left" >
- <input type="text" name="wfIdQ" id="wfIdQ" value="${wfIdQ}" style="display:none;"/>
- <input type="text" name="stId" id="stId" value="${stId}" style="display:none;"/>
- <s:textfield
- cssClass="Wdate"
- onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
- id="recordDateQ" name="recordDateQ" title="日期" style="display:none;"/>
- <s:select list="windpowers" cssStyle="width:173px;display:none" listKey="id" listValue="name" id="wfId" name="wfId" headerKey="" headerValue="请选择" onchange="javascript:queryData()" ></s:select>
- <input type="text" name="stId" id="stId" value="${stId}" style="display: none;"/>
- <s:textfield
- cssClass="Wdate"
- onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
- id="recordDate" name="recordDate" title="日期" onchange="javascript:queryData()" style="display:none"/>
- 指标名称:<s:textfield name="targetName" id="targetName">${targetName}</s:textfield>
- <input type="button" class="button" onclick="javascript:queryData();" value="查询"/>
- <input type="button" class="button" onclick="javascript:queryClear();" value="清空"/>
- </td>
- </tr>
- </table>
- </fieldset>
- <br/>
- <table id='gridTable'></table>
- <div id='gridPager'></div>
- <form action="" method="post" id="formView">
- </form>
- </body>
|