<%@ page language="java" contentType="text/html; charset=UTF-8"
|
pageEncoding="UTF-8"%>
|
<%@page import="com.yc.factory.FactoryBean"%>
|
<%@page import="com.yc.service.commons.GfieldIfc"%>
|
<%@page import="java.util.List"%>
|
<%@page import="java.util.Map"%>
|
<%@page import="com.google.gson.Gson"%>
|
<%@page import="com.google.gson.reflect.TypeToken"%>
|
<%@page import="com.yc.service.build.top.BuildTopIfc"%>
|
<%@page import="org.springframework.web.context.WebApplicationContext"%>
|
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
|
<%
|
//跟据功能号查询,查询DIV页面须要的字段
|
GfieldIfc gfieldIfc = (GfieldIfc)FactoryBean.getBean("GfieldImpl");
|
StringBuilder sb = new StringBuilder();
|
List<Map<String,Object>> list = gfieldIfc.getAllowQueryFields(formId);
|
Gson gson = new Gson();
|
String t = gson.toJson(list,new TypeToken<List<Map<String,Object>>>(){}.getType());
|
sb.append(t);
|
sb.insert(0,"{rows:");
|
sb.append("}");
|
|
StringBuilder printLink = new StringBuilder();//打印下来按钮
|
StringBuilder printButton = new StringBuilder();//打印button按钮
|
StringBuilder funcLink = new StringBuilder();//链接下拉按钮
|
StringBuilder funcLinkButton = new StringBuilder();//链接button按钮
|
String _1 = "1".intern(); //标识1
|
boolean printHasExpression = [?printHasExpression];//是否有表达式
|
//boolean linkHasExpression = [?linkHasExpression];//是否有表达式
|
if(printHasExpression){//有表达式拼装sql
|
String reportSql = "[?getReportSQL]";
|
reportSql = com.yc.utils.RequestParameterUtils.replaceRequestExpression(reportSql,request,session);
|
List<Map<String,Object>> reportInfo =null;
|
try{
|
com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
|
reportInfo=sqlQueryIfc.queryForList(reportSql,null);//打印链接信息
|
com.yc.service.build.top.PrintLinkSpellUtils.spellPrintLink(reportInfo,formId,formType,printLink,printButton);
|
}catch(Exception e){
|
throw new Exception(e.getMessage().replace("'","\\'")+"-打印设置表达式有错误!");
|
//out.println("<script>$.messager.alert('操作提示','"+e.getMessage().replace("'","\\'")+"-打印设置表达式有错误!','warning')</script>");
|
// return;
|
}finally{
|
com.yc.multiData.SpObserver.setDBtoInstance();
|
}
|
}
|
|
String notExpressionFuncLink="[?notExpressionFuncLink]";
|
String notExpressionFuncLinkButton="[?notExpressionFuncLinkButton]";
|
WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
|
BuildTopIfc buildTopIfc = (BuildTopIfc)wac.getBean("BuildTopImpl");
|
Map<String,Object> map =null;
|
try{
|
com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
|
map=buildTopIfc.buildFuncLinkExpression(formId,formType,doccode,request,session,notExpressionFuncLink,notExpressionFuncLinkButton);
|
|
}catch(Exception e){
|
throw new Exception(e.getMessage().replace("'","\\'")+"-功能链接设置表达式有错误!");
|
// out.println("<script>alert('"+e.getMessage().replace("'","\\'")+"-功能链接设置表达式有错误!')</script>");
|
// return;
|
}finally{
|
com.yc.multiData.SpObserver.setDBtoInstance();
|
}
|
|
%>
|
<script type="text/javascript">
|
var data = <%=sb.toString() %>;
|
var reportprompts="[?reportprompts]";
|
</script>
|
<style type="text/css">
|
.queryField{width:150px;overflow: hidden;height: 20px;float: left;}
|
</style>
|
<div id="func" style="width:170px;">
|
|
<%if(map.size()>0){ %>
|
<%=map.get("funcLink").toString() %>
|
<%} %>
|
</div>
|
<div id="print" style="width:170px;">
|
<%if(printHasExpression){ %>
|
<%=printLink %>
|
<%}else{ %>
|
[?printLink]
|
<%}if(_1==isSuperUser){%>
|
<div id="otherFormats">其他格式</div>
|
<%} %>
|
</div>
|
<div id="tool">
|
<%if((profile&FormOpUtil.openQuery)>0||_1==isSuperUser){%>
|
<a id="selectinfo" onmousedown="showselectDiv();" class="easyui-linkbutton"
|
plain="true" iconCls="icon-search">搜索</a>
|
<%}%>
|
<img height="29px" src="/images/space.jpg" align="top"/>
|
<% if((profile&FormOpUtil.saveRecord)>0||_1==isSuperUser){%>
|
<a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-save" onclick="showLoading();save(function(){closeLoading();});">保存</a>
|
<%}%>
|
|
<img height="29px" src="/images/space.jpg" align="top"/>
|
|
<a class="easyui-linkbutton" id="showRestmenuDiv" onclick="showrestmenu();" iconCls="icon-down" onblur="restmenuclose();"
|
plain="true">更多</a>
|
|
<a id="bhelp" href="javascript:openHelpPage('[?title]');" class="easyui-linkbutton" plain="true" iconCls="icon-help">帮助</a>
|
|
<%
|
////打印链接
|
if(printHasExpression){ %>
|
<%=printButton %>
|
<%}else{ %>
|
[?printButton]
|
<%}
|
////////功能链接
|
%>
|
|
<%if(map.get("funcLinkButton").toString().length()>0){ %>
|
<%=map.get("funcLinkButton") %>
|
<%} %>
|
<div id="tpUpDownDoc">
|
<a href="javascript:editCustomControl();" class="easyui-linkbutton first" plain="true" title='自定义控件布局' iconCls="icon-scok">布局</a>
|
<a href="javascript:void(0);" onclick="refresh();" class="easyui-linkbutton" plain="true" title='刷新(Alt+R)' iconCls="icon-reload">刷新</a>
|
</div>
|
</div>
|
<div id="selectDiv" class="selectDiv">
|
<div class="easyui-tabs" border="true" style="width:497px;height:365px;">
|
<div id="generalQuery" title="简单查询" fit="true" border="true" style="padding:0px;">
|
<div style="margin-left:20px;width: 450px;height: 150px;float: left;">
|
<div> </div>
|
输入查询内容:<input id="queryValue" type="text" style="border: 1px solid #cccccc;width: 300px;"/><br><br><br><br>
|
<div align="center"><a iconCls="icon-ok" class="easyui-linkbutton" onclick="tw.simpConfirm();">确 定</a>
|
<a iconCls="icon-cancel" class="easyui-linkbutton" onclick="winClose();">关 闭</a></div>
|
</div>
|
<div style="margin-left:20px;margin-top:10px;width:450px;font-weight: bold;color: #666666;float: left;">
|
可查询字段:<br></br>
|
<%
|
Map<String,Object> temp = null;
|
for(int i=0;i<list.size();i++){
|
temp = list.get(i);
|
%>
|
<div class="queryField" field="<%=temp.get("fieldid") %>"><%=temp.get("fieldname") %></div>
|
<%} %>
|
</div>
|
|
</div>
|
<div id="advancedQuery" title="高级查询" style="padding:0px;">
|
<div id="query">
|
<table id="tt" style="width:495px;height:290px;border-bottom: 1px solid;" border="false" singleSelect="true" >
|
<thead>
|
<tr>
|
<th field="fieldid" width="80" hidde="true">ID</th>
|
<th field="cont" width="60" formatter="contFormatter" align=center editor="{type:'combobox',options:{valueField:'contid',textField:'text',data:cont,editable:false}}" >连接符</th>
|
<th field="fieldname" width="100" >字段名</th>
|
<th field="opt" formatter="opttFormatter" editor="{type:'combobox',options:{valueField:'opid',textField:'text',data:opts,editable:false,onChange:optSelect}}" width="80" >比较符</th>
|
<th field="opt2" formatter="opt2Formatter" width="10" align="center" ></th>
|
<th field="fieldvalue1" width="95" editor="{type:'text'}">字段值</th>
|
<th field="fieldvalue2" width="95" editor="{type:'text'}">字段值2</th>
|
</tr>
|
</thead>
|
</table>
|
<div style="100%;margin-left:20px;">
|
<br /><label for="more">更多选项</label><span style="position:fixed;margin-top:3px;"><input id="more" type="checkbox" /></span>
|
<a iconCls="icon-ok" class="easyui-linkbutton" onclick="tw.confirm2();">确 定</a>
|
<a iconCls="icon-cancel" class="easyui-linkbutton" onclick="winClose();">关 闭</a>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="restmenuDiv" id="restmenuDiv"
|
onmouseover="showrestmenu();" onmouseout="restmenuclose();">
|
<table width="520px">
|
<%if(map.get("funcLink").toString().length()>0){ %>
|
<tr >
|
<td width="80px;"><strong>功能链接:</strong></td>
|
<td>
|
<%=map.get("funcLink") %>
|
</td>
|
|
</tr>
|
<%} %>
|
<% if(((profile&FormOpUtil.printButton)>0&&[?printLinkLength]>0)||printLink.length()>0||_1==isSuperUser){%>
|
<tr>
|
<td width="80px"><strong>打印格式:</strong></td>
|
<td>
|
<%if(printHasExpression){ %>
|
<%=printLink %>
|
<%}else{ %>
|
[?printLink]
|
<%}if(_1==isSuperUser){%>
|
<div style="width:80px;display:inline;cursor:pointer" id="otherFormat">其他格式</div>
|
<%} %>
|
</td>
|
</tr>
|
<%} %>
|
|
<%
|
List<Map<String, Object>> exportList =null;
|
StringBuilder sb1 = new StringBuilder();
|
try{
|
com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
|
exportList=gfieldIfc.getExportInfo(formId);
|
com.yc.service.build.top.ExportSpellUtils.spellLink(exportList, sb1,profile);
|
}catch(Exception e){
|
throw e;
|
//out.println("<script>alert('"+e.getMessage().replace("'","\\'")+"')</script>");
|
}finally{
|
com.yc.multiData.SpObserver.setDBtoInstance();
|
}
|
if(sb1.length()>0){ %>
|
<tr>
|
<td width="80px"><strong>导入导出:<strong></td>
|
<td><%out.print(sb1.toString());%></td>
|
</tr>
|
<%} %>
|
</table>
|
</div>
|
<%_1 = null;printLink=null;printButton=null;funcLink=null;funcLinkButton=null;%>
|