<%@ page contentType="text/html; charset=GBK"%>
<%@ page import = "zr.zrpower.common.util.SysPreperty"%>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService"%>
<%@ page import = "zr.zrpower.analyseengine.service.StatisticsConfig"%>

<%@ page import = "zr.zrpower.analyseengine.mode.ANALYSE_STATISTICS_MAIN"%>

<%@ page import = "java.lang.Object"%>
<%@ page import = "java.util.*"%>
<%@ page import = "java.text.*"%>
<%@ page import = "zr.zrpower.common.web.SelectBox"%>

<HTML>
<%
UIService userUI =new UIService();
SessionUser user = (SessionUser)session.getAttribute("userinfo");
StatisticsConfig StatisticsCfg =  new StatisticsConfig();

SelectBox sb = new SelectBox(StatisticsCfg.GetTableList());
String ID=request.getParameter("SelectedItems");
ANALYSE_STATISTICS_MAIN[] STATISTICS = StatisticsCfg.getANALYSE_STATISTICS_MAIN(ID);
String strTemplat = SysPreperty.getProperty().LogFilePath;
strTemplat = strTemplat.substring(0,strTemplat.length()-3)+"StatExcel";

String showcode = STATISTICS[0].getSINPUTTYPE();
 if (showcode.equals("3") || showcode.equals("B") || showcode.equals("9") || showcode.equals("A") || showcode.equals("C"))
 {
    showcode = "";
 }else
 {
    showcode = "none";
 }

 String strISZERO = STATISTICS[0].getISZERO();
 if (strISZERO==null){strISZERO="0";}

%>
<HEAD>
<TITLE><%=SysPreperty.getProperty().SystemName%><%=SysPreperty.getProperty().Versoin%></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<LINK type="text/css" rel="stylesheet" href="../../zrsysmanage/css/<%=user.getUserCSS()%>">

<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/script/Public.js"></SCRIPT>
<script type='text/javascript' src='../../dwr/engine.js'></script>
<script type='text/javascript' src='../../dwr/util.js'></script>
<script type='text/javascript' src='../../dwr/interface/AnalyseConfigBean.js'></script>

<script type="text/javascript" src="../../ZrwebGui/tab/tab.js"></script>
<link rel="stylesheet" type="text/css" href="../../ZrwebGui/tab/tab.css">

<STYLE type=text/css>
#con { FONT-SIZE: 12px; MARGIN: 0px auto; WIDTH: 98% }
#tags { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 10px; WIDTH: 98% ; PADDING-TOP: 0px; HEIGHT: 23px }
#tags LI { BACKGROUND: url(../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/tagleft.gif) no-repeat left bottom; FLOAT: left; MARGIN-RIGHT: 1px; LIST-STYLE-TYPE: none; HEIGHT: 23px }
#tags LI A { PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: url(../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/tagright.gif) no-repeat right bottom; FLOAT: left; PADDING-BOTTOM: 0px; COLOR: #999;
LINE-HEIGHT: 23px; PADDING-TOP: 0px; HEIGHT: 23px; TEXT-DECORATION: none }
.tagContent { PADDING-RIGHT: 10px; DISPLAY: none; PADDING-LEFT: 10px; BACKGROUND: url(../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/bg.gif) repeat-x; PADDING-BOTTOM: 10px; WIDTH: 100%; COLOR: #474747;
PADDING-TOP: 10px; }
</STYLE>


<script language="JavaScript" type="text/javascript">
function Check(theForm){
//判断配置名称不能为空
  if (theForm.STATISTICSNAME.value == ""){

    <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('统计配置名称不能为空!', {icon: 7});
    <%}else{%>
    alert("统计配置名称不能为空！");
    <%}%>

    theForm.STATISTICSNAME.focus();
    return (false);
  }
<%if("6".equals(user.getUserWINDOWTYPE())){%>
   RegForm.Act.value='savemain';
    document.RegForm.submit();
         window.parent.document.location.reload();
    <%}else{%>
    RegForm.Act.value='savemain';
   return true;
    <%}%>

}
function Check1(theForm)
{
<%if("6".equals(user.getUserWINDOWTYPE())){%>
  parent.layer.confirm('确定要删除当前选中的字段吗？', {
      btn: ['确定','取消'] //按钮
      }, function(index){
         RegForm.Act.value='delmain';
         document.RegForm.submit();
         window.parent.document.location.reload();
      }, function(){
      });
  <%}else{%>
  if (confirm("确定要删除当前数据统计及相关的信息吗？"))
  {RegForm.Act.value='delmain';
      return true;}
  else
  {return false;}
  <%}%>
}
</script>
</HEAD>
<BODY class="BodyMain">
<FORM action="../../actionstatistics.do" method="post" name="RegForm"  enctype="multipart/form-data" onsubmit="return Check(this);">
<input type="hidden" id="Act" name="Act" value="">
<input type="hidden" name="ID" value="<%=ID%>">
<input type="hidden" name="MONTH" value="">
<input type="hidden" name="WEEK" value="">
<input type="hidden" name="DAY" value="">
<input type="hidden" name="HOUR" value="">
<input type="hidden" name="MINUTE" value="">
<input type="hidden" name="TIMESTYPE" value="<%=STATISTICS[0].getTIMESTYPE()%>">
<input type="hidden" id="PIEGRP" name="PIEGRP" value="">
<input type="hidden" id="COLUMNGRP" name="COLUMNGRP" value="">
<input type="hidden" id="LINESGRP" name="LINESGRP" value="">
<input type="hidden" id="EVENTGRP" name="EVENTGRP" value="">
<input type="hidden" id="MIXGRP" name="MIXGRP" value="">
<input type="hidden" id="BARGRP" name="BARGRP" value="">
<input type="hidden" id="CURVEGRP" name="CURVEGRP" value="">
<input type="hidden" id="PIEDGRP" name="PIEDGRP" value="">
<input type="hidden" id="STACKGRP" name="STACKGRP" value="">
<input type="hidden" id="BARSTACKGRP" name="BARSTACKGRP" value="">


<DIV id="con">
  <%if("6".equals(user.getUserWINDOWTYPE())){ %>
<UL id="tags">
    <LI >
    <a style="" onClick="selectTag('tagContent0',this)"  href="javascript:void(0)" class="btn1 btn-medium btn-blue btn-radius">
      基本属性
    </a>
    </LI>
     <LI>
     <a style="" onClick="selectTag('tagContent1',this)"  href="javascript:void(0)" class="btn1 btn-medium btn-blue btn-radius">
      其它属性
    </a>

     </LI>
     </UL>
<%}else{ %>
  <UL id="tags">
    <LI class="selectTag">
      <A onClick="selectTag('tagContent0',this)"  href="javascript:void(0)">
      <IMG src="../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/page.gif" align='absmiddle' border=0>
      基本属性
      </A>
    </LI>
     <LI>
       <A onClick="selectTag('tagContent1',this)" href="javascript:void(0)">
       <IMG src="../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/page.gif" align='absmiddle' border=0>
         其它属性
       </A>
     </LI>
  </UL>
  <%} %>
  <DIV id="tagContent" style="height: 465px">
    <DIV class="tagContent selectTag" id="tagContent0">



<table border="0" class="inputTable" cellspacing="0" cellpadding="0" align="center">
           <tr >
               <td height="30" width = "25%" align="right">统计配置名称：</td>
               <td height="30" class="inputTd"><input class="text" type="text" name="STATISTICSNAME"  value="<%=STATISTICS[0].getSTATISTICSNAME()%>" size="50" maxlength="100"><Font class="WriteSign">*</Font></td>
           </tr>
           <tr>
               <td height="30" width = "25%" align="right">统计配置描述：</td>
               <td height="30" class="inputTd" ><input class="text" type="text" name="SDESC" size="50"   value="<%=STATISTICS[0].getSDESC()%>" maxlength="100"></td>
          </tr>
          <tr>
               <td  height="30" width = "25%" align="right">统计表：</td>
               <td  height="30" class="inputTd" >
                  <table cellspacing="0" cellpadding="0" border='0'>
                       <tr>
                          <td>
                               <input class="text" type="text"  id="TABLEID" name="TABLEID" value="<%=STATISTICS[0].getTABLEID()%>" size="50"><%=userUI.ClickButton("选择","JavaScript:ShowModalTableTree();","buttonSelect.gif",user.getUserImage())%>
                          </td>
                       </tr>
              </table>
              </td>
          </tr>



          <tr><td  height="30" colspan="2" width = "100%" align="center">

           <tr>
            <td width = "30%" align="right">二维数据对应的表：</td>
            <td class="inputTd">
             <table cellspacing="0" cellpadding="0" border='0'>
                       <tr>
                          <td>
                               <input class="text" type="text"  id="PLANARTABLE" name="PLANARTABLE"  value="<%=STATISTICS[0].getPLANARTABLE()%>" size="50"><%=userUI.ClickButton("选择","JavaScript:ShowModalTableTree1();","buttonSelect.gif",user.getUserImage())%>
                          </td>
                       </tr>
              </table>
            </td>
          </tr>

          <tr>
            <td  height="30" width = "30%" align="right">维数据项是否包含统计单位：</td>
            <td  height="30" class="inputTd">
               <input type="radio" name="WISMATCH"  id="WISMATCH"  value=1 <% if (STATISTICS[0].getWISMATCH().equals("1")){%>checked<%}%>>
              是　　
              <input type="radio" name="WISMATCH" id="WISMATCH" value=0 <% if (STATISTICS[0].getWISMATCH().equals("0")){%>checked<%}%>>
              否&nbsp;&nbsp;<Font class="WriteSign">注：当二维数据对应的表为单位表时填写。</Font>
            </td>
          </tr>

           <tr>
            <td   height="30" width = "30%" align="right">是否是与单位表相似的字典表：</td>
            <td   height="30" class="inputTd">
               <input type="radio" name="ISUNIT"  id="ISUNIT" value=1 <% if (STATISTICS[0].getISUNIT().equals("1")){%>checked<%}%>>
              是　　
              <input type="radio" name="ISUNIT" id="ISUNIT" value=0 <% if (STATISTICS[0].getISUNIT().equals("0")){%>checked<%}%>>
              否&nbsp;&nbsp;<Font class="WriteSign">注：设置后按单位相似的多级统计方式。</Font>
            </td>
          </tr>

           <tr>
            <td  height="30" width = "30%" align="right">二维表的关联字段：</td>
            <td  height="30" class="inputTd">
              <table cellspacing="0" cellpadding="0" border='0'>
                       <tr>
                          <td>
                               <input class="text" type="text"  id="PLANARFIELD" name="PLANARFIELD" value="<%=STATISTICS[0].getPLANARFIELD()%>" size="50"><%=userUI.ClickButton("选择","JavaScript:ShowModalFieldList11();","buttonSelect.gif",user.getUserImage())%>
                          </td>
                       </tr>
              </table>
            </td>
          </tr>

           <tr>
            <td  height="30" width = "30%" align="right">二维表的关联中文字段：</td>
            <td  height="30" class="inputTd">
             <table cellspacing="0" cellpadding="0" border='0'>
                       <tr>
                          <td>
                               <input class="text" type="text"  id="PLANARFIELDNAME" name="PLANARFIELDNAME" value="<%=STATISTICS[0].getPLANARFIELDNAME()%>" size="50"><%=userUI.ClickButton("选择","JavaScript:ShowModalFieldList12();","buttonSelect.gif",user.getUserImage())%>
                          </td>
                       </tr>
              </table>
            </td>
          </tr>
            <tr>
            <td  height="30" width = "30%" align="right">当前表与二维表对应的字段：</td>
            <td  height="30" class="inputTd">
             <table cellspacing="0" cellpadding="0" border='0'>
                       <tr>
                          <td>
                          <select name="CJOIN" id="CJOIN"  style="width=100">
                  <option value="1" <% if (STATISTICS[0].getCJOIN().equals("1")){%>selected<%}%>>等于
                  <option value="2" <% if (STATISTICS[0].getCJOIN().equals("2")){%>selected<%}%>>全包含
                  <option value="3" <% if (STATISTICS[0].getCJOIN().equals("3")){%>selected<%}%>>左包含
                  <option value="4" <% if (STATISTICS[0].getCJOIN().equals("4")){%>selected<%}%>>右包含
               </select><input class="text" type="text"  id="CPLANARFIELD" name="CPLANARFIELD"  value="<%=STATISTICS[0].getCPLANARFIELD()%>" size="33"><%=userUI.ClickButton("选择","JavaScript:ShowModalFieldList();","buttonSelect.gif",user.getUserImage())%>
                          </td>
                       </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td  height="30" width = "30%" align="right">二维数据的条件：</td>
            <td  height="30" class="inputTd">
             <table cellspacing="0" cellpadding="0" border='0'>
                       <tr>
                          <td>
                               <input class="text" type="text"  id="WHEREVALUE" name="WHEREVALUE" value="<%=STATISTICS[0].getWHEREVALUE()%>" size="50"><%=userUI.ClickButton("设置","JavaScript:ShowModal();","buttonSelect.gif",user.getUserImage())%>
                          </td>
                       </tr>
          </table>
            </td>
          </tr>

 <tr>
            <td   height="30" width = "30%" align="right">是否显示序号列：</td>
            <td   height="30" class="inputTd">
             <table cellspacing="0" cellpadding="0" border='0'>
                       <tr>
                          <td>
                               <input type="radio" name="ISNUMBER"  id="ISNUMBER" value=1 <% if (STATISTICS[0].getISNUMBER().equals("1")){%>checked<%}%>>
                                 是　　
                                 <input type="radio" name="ISNUMBER" id="ISNUMBER" value=0 <% if (STATISTICS[0].getISNUMBER().equals("0")){%>checked<%}%>>
                                 否
                                 &nbsp;&nbsp;&nbsp;
                                 是否显示全为零的行:
                                 <input type="radio" name="ISZERO" id="ISZERO" value=1  <%if (strISZERO.equals("1")){%>checked<%}%>>
                                 是　　
                                 <input type="radio" name="ISZERO" id="ISZERO" value=0  <%if (strISZERO.equals("0")){%>checked<%}%>>
                                 否

                          </td>
                       </tr>
          </table>

            </td>
          </tr>


           <tr>
            <td   height="30" width = "30%" align="right">二维表附加显示字段：</td>
            <td   height="30" class="inputTd">
             <table cellspacing="0" cellpadding="0" border='0'>
                       <tr>
                          <td>
                               <input class="text" type="text"  id="ADDFIELD" name="ADDFIELD" size="35" value="<%=STATISTICS[0].getADDFIELD()%>">
                               多个字段间用,号分隔。
                          </td>
                       </tr>
          </table>

            </td>
          </tr>

           <tr>
                  <td class="PutdSet" width="30%">报表表头模板：</td>
                  <td>
                    <%=STATISTICS[0].getTIMETEMPLATE()%>
                    <%
                       String mb = STATISTICS[0].getTIMETEMPLATE();
                       if (mb == null){mb = "";}
                       if (mb.length()==0)
                       {
                    %>
                    <a href=JavaScript:sc(); title="点击生成默认模板">[<font color="#000080">生成默认模板</font>]</a>

                    <%}else{%>

                    &nbsp;
                    <a href="../../serverfile.do?type=7&file=<%=STATISTICS[0].getTIMETEMPLATE()%>" title="点击下载模板">[<font color="#000080">下载模板</font>]</a>

                    <%}%>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <a href=JavaScript:ReloadExcel(); title='上传报表表头模板'><img border='0' align='absmiddle' src='../../zrsysmanage/images/<%=user.getUserImage()%>/dataedit.gif'>&nbsp;上传报表表头模板</a>
                    <br>对于模板不太明白时生成默认模板，下载修改后再上传。
                  </td>
                </tr>
          </table>



    </DIV>
    <DIV class="tagContent" id="tagContent1">

    <br>注意：设置各种日期选择类型时注意所传参数P1到P5值的变化，然后在统计初始条件中引用相关参数即可。
               <br><br>

         <fieldset>
           <legend>自定义统计前选择的条件</legend>
           <table border="0" class="inputTable" cellspacing="0" cellpadding="0" align="center">

          <tr>
               <td width = "30%" align="right">日期选择类型：</td>
               <td class="inputTd" >

               <select name="SINPUTTYPE" id="SINPUTTYPE"  style="width=220"  onchange="ChangradItem2()">
                  <option value="1"  <% if (STATISTICS[0].getSINPUTTYPE().equals("1")){%>selected<%}%>>无
                  <option value="2"  <% if (STATISTICS[0].getSINPUTTYPE().equals("2")){%>selected<%}%>>年月周日固定格式条件
                  <option value="3"  <% if (STATISTICS[0].getSINPUTTYPE().equals("3")){%>selected<%}%>>日报固定格式条件
                  <option value="B"  <% if (STATISTICS[0].getSINPUTTYPE().equals("B")){%>selected<%}%>>日报固定格式条件(默认上一天日期)
                  <option value="9"  <% if (STATISTICS[0].getSINPUTTYPE().equals("9")){%>selected<%}%>>年报固定格式条件
                  <option value="A"  <% if (STATISTICS[0].getSINPUTTYPE().equals("A")){%>selected<%}%>>月报固定格式条件
                  <option value="C"  <% if (STATISTICS[0].getSINPUTTYPE().equals("C")){%>selected<%}%>>月报固定格式条件(默认上月)
                  <option value="4"  <% if (STATISTICS[0].getSINPUTTYPE().equals("4")){%>selected<%}%>>自定义条件
                  <option value="5"  <% if (STATISTICS[0].getSINPUTTYPE().equals("5")){%>selected<%}%>>自定义条件录入页面
                  <option value="6"  <% if (STATISTICS[0].getSINPUTTYPE().equals("6")){%>selected<%}%>>年份比较条件
                  <option value="7"  <% if (STATISTICS[0].getSINPUTTYPE().equals("7")){%>selected<%}%>>年份月份比较条件
                  <option value="8"  <% if (STATISTICS[0].getSINPUTTYPE().equals("8")){%>selected<%}%>>年份季度比较条件
               </select>

              <div id="show_cs" <% if (STATISTICS[0].getSINPUTTYPE().equals("4")){%>style="display:'';"<%} else {%>style="display:none;"<%}%>>
              <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("自定义条件设置","JavaScript:zdy();","buttonSelect.gif",user.getUserImage())%>
              </tr></table>
              </div>

               </td>
          </tr>

          <tr>
            <td width = "30%" align="right">
              <div id="show_zd1" style="display:<%=showcode%>;">
              统计字典表：
              </div>
            </td>
            <td   height="30">
            <div id="show_zd2"  style="display:<%=showcode%>;">
             <br>
               <input class="text" type="text"  id="CODETABLE" name="CODETABLE"  value="<%=STATISTICS[0].getCODETABLE()%>" size="30">
               <br>字典表的内容下拉作为选择的条件时设置,单独年、月、日报条件时生效。
             </div>
             </td>
          </tr>



          <tr>
            <td width = "30%" align="right" height="12"></td>
            <td class="inputTd">
             </td>
          </tr>
       <tr>
            <td width = "30%" align="right"><div id="div25" <% if (STATISTICS[0].getSINPUTTYPE().equals("5")){%>style="display:'';"<%} else {%>style="display:none;"<%}%>>条件录入页面：</div></td>
            <td class="inputTd"><div id="div26" <% if (STATISTICS[0].getSINPUTTYPE().equals("5")){%>style="display:'';"<%} else {%>style="display:none;"<%}%>>
            <input class="text" type="text"  id="SINPUTPAGE" name="SINPUTPAGE" value="<%=STATISTICS[0].getSINPUTPAGE()%>" size="50">
            <br>设置时调用时转入自定义页面，在自定义页面中选择条件后再次调用统计引擎，把条件通过P1-P5参数传回即可。
           </div>
              </td>
          </tr>
           </table>
          <br>
            </fieldset>
            <fieldset>
           <legend>自动计算及报表形式</legend>
           <table border="0" class="inputTable" cellspacing="0" cellpadding="0" align="center">
          <tr>
               <td width = "30%" align="right">是否显示平均值统计行：</td>
               <td class="inputTd" >
              <input type="radio" name="ISAGV"  id="ISAGV" value=1   <% if (STATISTICS[0].getISAGV().equals("1")){%>checked<%}%>>
              是　　
              <input type="radio" name="ISAGV" id="ISAGV" value=0   <% if (STATISTICS[0].getISAGV().equals("0")){%>checked<%}%>>
              否</td>
          </tr>
          <tr>
               <td width = "30%" align="right">是否显示合计统计行：</td>
               <td class="inputTd" >
              <input type="radio" name="ISSUM"  id="ISSUM" value=1  <% if (STATISTICS[0].getISSUM().equals("1")){%>checked<%}%>>
              是　　
              <input type="radio" name="ISSUM" id="ISSUM" value=0  <% if (STATISTICS[0].getISSUM().equals("0")){%>checked<%}%>>
              否</td>
          </tr>
         <tr>
               <td width = "30%" align="right">报表显示类型：</td>
               <td class="inputTd" >
              <input type="radio" name="ISSHOWTYPE"  id="ISSHOWTYPE" value=1  <% if (STATISTICS[0].getISSHOWTYPE().equals("1")){%>checked<%}%>>
              一般　　
              <input type="radio" name="ISSHOWTYPE" id="ISSHOWTYPE" value=2  <% if (STATISTICS[0].getISSHOWTYPE().equals("2")){%>checked<%}%>>
              嵌入式</td>
          </tr>

           </table>
          <br>
            </fieldset>

            <fieldset>
           <legend>其它设置</legend>
           <table border="0" class="inputTable" cellspacing="0" cellpadding="0" align="center">
           <tr>
               <td width = "30%" align="right">单元格的详细信息链接设置：</td>
               <td class="inputTd">
                 <input class="text" type="text"  id="SHOWLINK" name="SHOWLINK" size="50" value="<%=STATISTICS[0].getSHOWLINK()%>">
                 <br>设置后报表点击到最后一层时可打开相应地址，可用来显示明细等。
               </td>
                </tr>
                 <tr>
                <td width = "30%" align="right">统计按钮描述：</td>
               <td class="inputTd">
                 <input class="text" type="text"  id="TBUTTON" name="TBUTTON"  value="<%=STATISTICS[0].getTBUTTON()%>" size="50">
                 <br>生成统计时,默认的"统计"按钮名称叫其它名称时可设置。
               </td>


           </tr>
           </table>
          <br>
          </fieldset>




    </DIV>
  </DIV>
</DIV>




                 <center><br>
                 <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("保存","JavaScript:if(Check(document.RegForm)){document.RegForm.submit();}","buttonSave.gif",user.getUserImage())%>
                 <%=userUI.ClickButton("删除","JavaScript:if(Check1(document.RegForm)){document.RegForm.submit();}","buttonDelete.gif",user.getUserImage())%>

                 <%if("6".equals(user.getUserWINDOWTYPE())){%>
     <%=userUI.ClickButton("关闭","JavaScript:parent.layer.closeAll();","buttonClose.gif",user.getUserImage())%>

  <%}else{ %>
    <%=userUI.ClickButton("关闭","JavaScript:window.opener.document.location.reload();window.close();","buttonClose.gif",user.getUserImage())%>

 <%} %>

                 </tr></table>
                 </center>


</FORM>
<%if("6".equals(user.getUserWINDOWTYPE())){ %>
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/html5/script/jquery-2.0.3.min.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/html5/layer/layer.js"></SCRIPT>
<%}%>
<script language="JavaScript" type="text/JavaScript">
function ShowModalTableTree()
{
  var url='TableTree.jsp?strResult='+RegForm.TABLEID.value;
  var status='dialogHeight:450px;dialogWidth:250px;status:0;help:no;center:yes';
  <%if("6".equals(user.getUserWINDOWTYPE())){ %>
   layer.open({
     type: 2,
     title:'选择表',
     area: ['300px', '450px'],
     fix: false, //不固定
     maxmin: false,
     content: url+'&zdid=TABLEID'
   });
  <%}else{%>
  var rtnResult=window.showModalDialog(url,window,status);
 if (rtnResult!=null)
   {
     RegForm.TABLEID.value=rtnResult;
   }
   <%}%>
}
function ShowModalTableTree1()
{
  var url='TableTree.jsp?strResult='+RegForm.PLANARTABLE.value;
  var status='dialogHeight:450px;dialogWidth:250px;status:0;help:no;center:yes';
  <%if("6".equals(user.getUserWINDOWTYPE())){ %>
   layer.open({
     type: 2,
     title:'选择表',
     area: ['300px', '450px'],
     fix: false, //不固定
     maxmin: false,
     content: url+'&zdid=PLANARTABLE'
   });
  <%}else{%>
  var rtnResult=window.showModalDialog(url,window,status);
 if (rtnResult!=null)
   {
     RegForm.PLANARTABLE.value=rtnResult;
   }<%}%>
}

function ShowModalFieldList()
{
  var url='SelectField.jsp?TableName='+RegForm.TABLEID.value+'&strResult='+RegForm.CPLANARFIELD.value;
  var status='dialogHeight:150px;dialogWidth:380px;status:0;help:no;center:yes';
  <%if("6".equals(user.getUserWINDOWTYPE())){ %>
  layer.open({
     type: 2,
     title:'选择字段',
     area: ['380px', '180px'],
     fix: false, //不固定
     maxmin: false,
     content: url+'&zdid=CPLANARFIELD'
   });
  <%}else{%>
  var rtnResult=window.showModalDialog(url,window,status);
 if (rtnResult!=null)
   {
     RegForm.CPLANARFIELD.value=rtnResult;
   }<%}%>
}
function ShowModalFieldList11()
{
  var url='SelectField.jsp?TableName='+RegForm.PLANARTABLE.value+'&strResult='+RegForm.PLANARFIELD.value;
  var status='dialogHeight:150px;dialogWidth:380px;status:0;help:no;center:yes';
   <%if("6".equals(user.getUserWINDOWTYPE())){ %>
  layer.open({
     type: 2,
     title:'选择字段',
     area: ['380px', '180px'],
     fix: false, //不固定
     maxmin: false,
     content: url+'&zdid=PLANARFIELD'
   });
  <%}else{%>
  var rtnResult=window.showModalDialog(url,window,status);
 if (rtnResult!=null)
   {
     RegForm.PLANARFIELD.value=rtnResult;
   }<%}%>
}
function ShowModalFieldList12()
{
  var url='SelectField.jsp?TableName='+RegForm.PLANARTABLE.value+'&strResult='+RegForm.PLANARFIELDNAME.value;
  var status='dialogHeight:150px;dialogWidth:380px;status:0;help:no;center:yes';
  <%if("6".equals(user.getUserWINDOWTYPE())){ %>
  layer.open({
     type: 2,
     title:'选择字段',
     area: ['380px', '180px'],
     fix: false, //不固定
     maxmin: false,
     content: url+'&zdid=PLANARFIELDNAME'
   });
  <%}else{%>
  var rtnResult=window.showModalDialog(url,window,status);
 if (rtnResult!=null)
   {
     RegForm.PLANARFIELDNAME.value=rtnResult;
   }<%}%>
}


function ShowModal()
{
  var url='ConValueSetup.jsp?strResult='+RegForm.WHEREVALUE.value;
  var status='dialogHeight:450px;dialogWidth:850px;status:0;help:no;center:yes';
  <%if("6".equals(user.getUserWINDOWTYPE())){ %>
  layer.open({
     type: 2,
     title:'设置二维数据的条件',
     area: ['700px', '408px'],
     fix: false, //不固定
     maxmin: false,
     content: url+'&zdid=WHEREVALUE'
   });
  <%}else{%>
  var rtnResult=window.showModalDialog(url,window,status);
 if (rtnResult!=null)
   {
     RegForm.WHEREVALUE.value=rtnResult;
   }<%}%>
}


function zdy()
{
  var url='List2.jsp?ID='+RegForm.ID.value+"&TABLENAME="+RegForm.TABLEID.value;
  var name="zdyWindow";
  var status="toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=400,height=300";
  <%if("6".equals(user.getUserWINDOWTYPE())){ %>
  layer.open({
     type: 2,
     area: ['400px', '320px'],
     fix: false, //不固定
     maxmin: false,
     content: url+''
   });
  <%}else{%>
  ShowPopWindow = window.open(url,name,status);
  ShowPopWindow.moveTo(260,100);
  ShowPopWindow.focus();
<%}%>
}

function ReloadExcel(){
  var url="Reload.jsp?SelectedItems="+RegForm.ID.value;
  document.location.href=url;

}
function sc(){
  var url="sc.jsp?SelectedItems="+RegForm.ID.value;
  document.location.href=url;

}


function ChangradItem5(value)
{
switch(value)
{
  case '1':
  flag=1;
  break;
  default:
  flag=2;
}
if(flag==1)
{
  frm2.style.display='';
  frm3.style.display='';
}
else{
   frm2.style.display='none';
   frm3.style.display='';
  }
}
function ChangradItem2()
{
  var flag5,flag4,flag6;
switch(window.RegForm.SINPUTTYPE.value)
{
  case '5':
    flag5=1;
    break;
  case '4':
    flag4=1;
    break;
   case '3':
    flag6=1;
    break;
   case 'B':
    flag6=1;
    break;
    case '9':
    flag6=1;
    break;
    case 'A':
    flag6=1;
    break;
    case 'C':
    flag6=1;
    break;
  default:
}
if(flag5==1)
{
  div25.style.display='';
  div26.style.display='';
}
else{
  div25.style.display='none';
  div26.style.display='none';
}
if(flag4==1)
{
  show_cs.style.display='';
}
else{
  show_cs.style.display='none';
}

if(flag6==1)
{
  show_zd1.style.display='';
  show_zd2.style.display='';
}
else{
  show_zd1.style.display='none';
  show_zd2.style.display='none';
}

}
 function ShowTemplaet(value){
   if(value==1){
   div19.style.display='';
   div20.style.display='';
   }
   else{
   div19.style.display='none';
   div20.style.display='none';
   }
  }

  function Change(TypeName)
{
  if (TypeName=='day')
  {
        document.RegForm.TIMESTYPE.value = "1" ;
  }
  if (TypeName=='week')
  {
        document.RegForm.TIMESTYPE.value = "2"
  }
  if (TypeName=='month')
  {
        document.RegForm.TIMESTYPE.value = "3" ;
  }
  if (TypeName=='year')
  {
        document.RegForm.TIMESTYPE.value = "4";
  }
}

</script>
</BODY>
</HTML>
<script language="JavaScript" type="text/JavaScript">

function selectTag(showContent,selfObj){

	// 操作标签
	var tag = document.getElementById("tags").getElementsByTagName("li");
	var taglength = tag.length;

	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.parentNode.className = "selectTag";
	// 操作内容

	for(i=0; j=document.getElementById("tagContent"+i); i++){
		j.style.display = "none";
	}
	document.getElementById(showContent).style.display = "block";

}

</script>

<%
//清空相关对象
user = null;
userUI = null;
StatisticsCfg = null;
STATISTICS = null;
%>
