xinyb
2024-03-27 f87909326c2ff2c58da027163f64d9d8f9424b17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.yc.service.build.top.BuildTopIfc"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<% 
  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>alert('"+e.getMessage().replace("'","\\'")+"-打印设置表达式有错误!')</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 reportprompts="[?reportprompts]";
</script>
<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){%>
        <a href="javascript:void(0);" id="tpOpen" class="easyui-linkbutton" onclick="keyDown('123','null');" plain="true" iconCls="icon-search">执行</a>
        <%}%>
        <a id="tpselect"  class="easyui-linkbutton"  plain="true" iconCls="icon-select">选择</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((profile&FormOpUtil.printButton)>0){
        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:refresh();"  class="easyui-linkbutton" plain="true" title='刷新(Alt+R)' iconCls="icon-reload">刷新</a>
         </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>
<%}
  com.yc.service.commons.GfieldIfc gfieldIfc = (com.yc.service.commons.GfieldIfc)com.yc.factory.FactoryBean.getBean("GfieldImpl");
  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;
%>