xinyb
2024-03-27 f87909326c2ff2c58da027163f64d9d8f9424b17
提交 | 用户 | age
a6a76f 1 <%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
F 2 <%@page import="com.yc.factory.FactoryBean"%>
3 <%@page import="com.yc.service.commons.GfieldIfc"%>
4 <%@page import="java.util.List"%>
5 <%@page import="java.util.Map"%>
6 <%@page import="com.google.gson.Gson"%>
7 <%@page import="com.google.gson.reflect.TypeToken"%> 
8 <%@page import="com.yc.service.build.top.BuildTopIfc"%>
9 <%@page import="org.springframework.web.context.WebApplicationContext"%>
10 <%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
11 <% 
12   //跟据功能号查询,查询DIV页面须要的字段
13   GfieldIfc gfieldIfc = (GfieldIfc)FactoryBean.getBean("GfieldImpl");
14   StringBuilder sb = new StringBuilder();
15   List<Map<String,Object>> list =null;
16   try{
17         com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
bbb528 18        //允许搜索的字段集合(这里的第二个参数值:1 表示 查询的是从表,如果只有一个参数那就是查询主表)。
X 19        // 之前是没有查询从表的,现在改成查询从表。xin 2023-9-18 17:10:04
20         list=gfieldIfc.getAllowQueryFields(formId,1);
a6a76f 21   }catch(Exception e){
F 22         throw e;
23       //out.println("<script>alert('"+e.getMessage().replace("'","\\'")+"')</script>");
24       //return;
25   }finally{
26         com.yc.multiData.SpObserver.setDBtoInstance();
27   }    
28   Gson gson = new Gson();
29   String t = gson.toJson(list,new TypeToken<List<Map<String,Object>>>(){}.getType());
30   sb.append(t);
31   sb.insert(0,"{rows:");
32   sb.append("}");
33   StringBuilder printLink = new StringBuilder();//打印下来按钮
34   StringBuilder printButton = new StringBuilder();//打印button按钮
35   StringBuilder funcLink = new StringBuilder();//链接下拉按钮
36   StringBuilder funcLinkButton = new StringBuilder();//链接button按钮
37   String _1 = "1".intern(); //标识1
38   boolean printHasExpression = [?printHasExpression];//是否有表达式
39   //boolean linkHasExpression = [?linkHasExpression];//是否有表达式
40   if(printHasExpression){//有表达式拼装sql
41          String reportSql = "[?getReportSQL]";
42          reportSql = com.yc.utils.RequestParameterUtils.replaceRequestExpression(reportSql,request,session);
43            List<Map<String,Object>> reportInfo =null;
44            try{
45                 com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
46                 reportInfo=sqlQueryIfc.queryForList(reportSql,null);//打印链接信息
47                 com.yc.service.build.top.PrintLinkSpellUtils.spellPrintLink(reportInfo,formId,formType,printLink,printButton);
48            }catch(Exception e){
49                 throw new Exception(e.getMessage().replace("'","\\'")+"-打印设置表达式有错误!");
50             //out.println("<script>$.messager.alert('操作提示','"+e.getMessage().replace("'","\\'")+"-打印设置表达式有错误!','warning')</script>");
51            // return;
52          }finally{
53              com.yc.multiData.SpObserver.setDBtoInstance();
54          }
55   }
56   String notExpressionFuncLink="[?notExpressionFuncLink]";
57   String notExpressionFuncLinkButton="[?notExpressionFuncLinkButton]";
58   WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
59   BuildTopIfc buildTopIfc = (BuildTopIfc)wac.getBean("BuildTopImpl");
60   Map<String,Object> map =null;
61   try{
62         com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
63         map=buildTopIfc.buildFuncLinkExpression(formId,formType,doccode,request,session,notExpressionFuncLink,notExpressionFuncLinkButton);
64   }catch(Exception e){
65         throw new Exception(e.getMessage().replace("'","\\'")+"-功能链接设置表达式有错误!");
66         // out.println("<script>alert('"+e.getMessage().replace("'","\\'")+"-功能链接设置表达式有错误!')</script>");
67         // return;
68   }finally{
69         com.yc.multiData.SpObserver.setDBtoInstance();
70   }
71 %>
72 <script type="text/javascript">
73 var data = <%=sb.toString() %>;
74 var reportprompts="[?reportprompts]";
75 </script>
76 <style type="text/css">
77 .queryField{width:150px;overflow: hidden;height: 20px;float: left;}
78 </style>
79 <div id="func" style="width:170px;">
80     <%if(map.size()>0){ %>
81     <%=map.get("funcLink").toString() %>
82     <%} %>
83 </div>
84 <div id="print" style="width:170px;">
85     <%if(printHasExpression){ %>
86         <%=printLink %>
87       <%}else{ %>
88         [?printLink]
89     <%}if(_1==isSuperUser){%>
90     <div id="otherFormats">其他格式</div>
91     <%} %>
92 </div>
93 [?TopBigTitle]
94 <div id="tool">
95         <%if((profile&FormOpUtil.openQuery)>0){%>
96 <a id="selectinfo" onmousedown="select();" class="easyui-linkbutton"
97     plain="true" iconCls="icon-search">搜索</a><!-- showselectDiv -->
98         <%}%>
99         <img height="29px" src="/images/space.jpg" align="top"/>
100         <% if((profile&FormOpUtil.saveRecord)>0){%>
101         <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-save" onclick="save();">保存</a>
102         <%}%>
103     
104         <a id="tpselect"  class="easyui-linkbutton"  plain="true" iconCls="icon-select">选择</a>
105         <img height="29px" src="/images/space.jpg" align="top"/>
106
107         <a class="easyui-linkbutton" id="showRestmenuDiv"  onclick="moreSelect();"  iconCls="icon-down" onblur="restmenuclose();" 
108     plain="true">更多</a> 
109     
110     <a id="bhelp" href="javascript:openHelpPage('[?title]');"  class="easyui-linkbutton"  plain="true" iconCls="icon-help">帮助</a>
111     
112     
113         <%
114         ////打印链接
115         if((profile&FormOpUtil.printButton)>0){
116         if(printHasExpression){ %>
117             <%=printButton %>
118           <%}else{ %>
119             [?printButton]
120         <%}
121         }
122         ////////功能链接
123         %>
124             
125           <%if(map.get("funcLinkButton").toString().length()>0){  %>
126           <%=map.get("funcLinkButton") %>
127           <%} %>
128           <div id="tpUpDownDoc">
f87909 129               <a href="javascript:editCustomControl();" class="easyui-linkbutton first" plain="true" title='自定义控件布局' iconCls="icon-scok">布局</a>
34fadb 130          <a href="javascript:void(0);" onclick="refresh();" class="easyui-linkbutton" plain="true" title='刷新(Alt+R)' iconCls="icon-reload">刷新</a>
a6a76f 131          </div>
F 132 </div>
133 <div id="selectDiv" style="width:520px;height:490px;left: 1px;top:30px;" class="easyui-window" collapsible="false" minimizable="false" maximizable="false" title="搜索" closed="true">
134     <div class="easyui-tabs" border="true" style="width:500px;height:450px;">
135         <div id="generalQuery" title="简单查询" fit="true" border="true" style="padding:0px;">
136                     <div style="margin-left:20px;width: 450px;height: 150px;float: left;">
137                         <div>&nbsp;</div>
138                         输入查询内容:<input id="queryValue" type="text" style="border: 1px solid #cccccc;width: 300px;"/><br><br><br><br>
139                         <div align="center"><a iconCls="icon-ok" class="easyui-linkbutton" onclick="selectSimpConfirm();">确 定</a>&nbsp;
140                         <a iconCls="icon-cancel" class="easyui-linkbutton" onclick="windowClose();">关 闭</a></div>
141                     </div>
142                     <div style="margin-left:20px;margin-top:10px;width:450px;font-weight: bold;color: #666666;float: left;">
143                         可查询字段:<br></br>
144                         <%
145                         Map<String,Object> temp = null;
146                         for(int i=0;i<list.size();i++){ 
147                             temp = list.get(i);
148                         %>
149                             <div class="queryField" field="<%=temp.get("fieldid") %>"><%=temp.get("fieldname") %></div>
150                         <%} %>
151                     </div>                    
152         </div>
153         <div id="advancedQuery" title="高级查询" style="padding:0px;">
154              <div id="query">
155                 <table id="tt" style="width:495px;height:380px;border-bottom: 1px solid;" border="false" singleSelect="true" >
156                     <thead>
157                         <tr>
158                             <th field="fieldid" width="80" hidde="true">ID</th>
159                             <th field="cont" width="60" formatter="contFormatter" align=center editor="{type:'combobox',options:{valueField:'contid',textField:'text',data:cont,editable:false}}" >连接符</th>
160                             <th field="fieldname" width="100" >字段名</th>
161                             <th field="opt" formatter="opttFormatter"  editor="{type:'combobox',options:{valueField:'opid',textField:'text',data:opts,editable:false,onChange:optSelect}}" width="80" >比较符</th>
162                             <th field="opt2" formatter="opt2Formatter" width="10" align="center" ></th>
163                             <th field="fieldvalue1"  width="95" editor="{type:'text'}">字段值</th>
164                             <th field="fieldvalue2" width="95" editor="{type:'text'}">字段值2</th>
165                         </tr>
166                    </thead>
167                </table>
168                <div    style="100%;margin-left:20px;">
169                        <br /><label for="more">更多选项</label><input id="more" type="checkbox" />
170                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a iconCls="icon-ok" class="easyui-linkbutton" onclick="selectSimpConfirm2();">确 定</a>&nbsp;
171                     <a iconCls="icon-cancel" class="easyui-linkbutton" onclick="windowClose();">关 闭</a>
172                </div>
173             </div>
174         </div>
175     </div>
176 </div>
177
178 <div class="easyui-window" style="width:auto;height:auto;background-color:#DEEDF7;" id="restmenuDiv"
179 collapsible="false" draggable="false" minimizable="false" maximizable="false" title="更多" closed="true" >
180 <table width="520px">
181 <%if(map.get("funcLink").toString().length()>0){ %>
182 <tr >
183     <td width="80px;" style="font-size: 13px;"><strong>功能链接:</strong></td>
184     <td style="font-size: 13px;">
185     <%=map.get("funcLink") %>
186     </td>
187     
188 </tr>
189 <%} %>
190
191 <% if(((profile&FormOpUtil.printButton)>0&&[?printLinkLength]>0)||printLink.length()>0||_1==isSuperUser){%>
192 <tr>
193     <td width="80px" style="font-size: 13px;"><strong>打印格式:</strong></td>
194     <td style="font-size: 13px;">
195         <%if(printHasExpression){ %>
196                 <%=printLink %>
197           <%}else{ %>
198             [?printLink]
199         <%}if(_1==isSuperUser){%>
200             <div style="width:80px;display:inline;cursor:pointer" id="otherFormat">其他格式</div>
201         <%} %>
202     </td>
203 </tr>
204
205 <%}
206   List<Map<String, Object>> exportList =null;
207   StringBuilder sb1 = new StringBuilder();
208   try{
209         com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
210         exportList=gfieldIfc.getExportInfo(formId);        
211         com.yc.service.build.top.ExportSpellUtils.spellLink(exportList, sb1,profile);
212   }catch(Exception e){
213         throw e;
214       //out.println("<script>alert('"+e.getMessage().replace("'","\\'")+"')</script>");
215   }finally{
216         com.yc.multiData.SpObserver.setDBtoInstance();
217   }        
218   if(sb1.length()>0){ %>
219 <tr>
220     <td width="80px"><strong>导入导出:<strong></td>
221     <td><%out.print(sb1.toString());%></td>
222 </tr>
223 <%} %>
224 </table>
225 </div>
226 <%_1 = null;
227 printLink=null;
228 printButton=null;
229 funcLink=null;
230 funcLinkButton=null;
231 %>
232