xinyb
2024-07-01 41485264ec9de48ffde1e506b897962e20c8440e
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
<%@ page contentType="text/html;charset=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"%>
<%
    //@author hq
    //2011-4-11
%>
<%
    //得到URL
    String URL = (request.getRequestURL() + "").replace(request
            .getRequestURI(), "")
            + request.getContextPath();
int formId = -1;
String str_formId = request.getParameter("formId");
try{
    formId = Integer.parseInt(str_formId);
}catch(Exception e){
    return;
}
GfieldIfc gfieldIfc = (GfieldIfc)FactoryBean.getBean("GfieldImpl");
List<Map<String,Object>> list = gfieldIfc.getAllowQueryFields(formId);
Gson gson = new Gson();
String t = gson.toJson(list,new TypeToken<List<Map<String,Object>>>(){}.getType());
StringBuilder sb = new StringBuilder(t);
sb.insert(0,"{rows:");
sb.append("}");
%>
<!DOCTYPE HTML >
 
 
 
<%@page import="com.google.gson.Gson"%>
<%@page import="com.google.gson.reflect.TypeToken"%><html>
<head>
<base href="<%=URL%>">
<title>查询</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css" href="/style/icon.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/style/icon.css")%>">
<link rel="stylesheet" type="text/css" href="/style/default/easyui.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/style/default/easyui.css")%>">
<script type="text/javascript" src="/js/jquery-1.4.4.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/jquery-1.4.4.min.js")%>"></script>
<script type="text/javascript" src="/js/jquery.easyui.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/jquery.easyui.min.js")%>"></script>
<script type="text/javascript" src="/js/locale/easyui-lang-zh_CN.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/locale/easyui-lang-zh_CN.js")%>"></script>
<script type="text/javascript" src="/js/query/query.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/query/query.js")%>"></script>
<script type="text/javascript">
var data = <%=sb.toString() %>;
</script>
<style type="text/css">
.queryField{width:150px;overflow: hidden;height: 20px;float: left;}
</style>
</head>
<body style="margin: 0px;padding:0px;">
    <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;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 style="margin-left:20px;width: 450px;height: 150px;">
                        <div>&nbsp;</div>
                        输入查询内容:<input id="queryValue" type="text" style="border: 1px solid #cccccc;width: 300px;"/><br></br>
                        <a iconCls="icon-ok" class="easyui-linkbutton" onclick="simpConfirm();">确 定</a>&nbsp;
                        <a iconCls="icon-cancel" class="easyui-linkbutton" onclick="winClose();">取 消</a>
                    </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>
                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a iconCls="icon-ok" class="easyui-linkbutton" onclick="confirm2();">确 定</a>&nbsp;
                    <a iconCls="icon-cancel" class="easyui-linkbutton" onclick="winClose();">取 消</a>
               </div>
            </div>
        </div>
    </div>
</body>
</html>