You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

249 lines
9.3 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>设置查询条件</title>
<link href="../../../DataUser/Style/ccbpm.css" rel="Stylesheet" />
<script src="../../Scripts/easyUI/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="../../Scripts/config.js" type="text/javascript"></script>
<script src="../../Comm/Gener.js"></script>
<script src="../../Scripts/QueryString.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
var frmID = GetQueryString("FrmID");
//页面启动函数.
$(function () {
$("#Msg").html("<img src=../../../Img/loading.gif />&nbsp;正在加载,请稍后......");
InitPage();
$("#Msg").html("");
});
function InitPage() {
var mapAttrs = new Entities("BP.Sys.MapAttrs");
mapAttrs.Retrieve("FK_MapData", frmID);
var mapData = new Entity("BP.Sys.MapData", frmID);
var isSearchKey = mapData.GetPara("IsSearchKey") == "1" ? true : false;
document.getElementById("CB_Key_0").checked = isSearchKey;
document.getElementById("CB_Key_1").checked = isSearchKey == true ? false : true;
var StringSearchKeys = mapData.GetPara("StringSearchKeys");
var RptSearchKeys = mapData.GetPara("RptSearchKeys");
var DTSearchWay = mapData.GetPara("DTSearchWay");
var DTSearchKey = mapData.GetPara("DTSearchKey");
//绑定外键字段.
var dateMapAttrs = [];
var count = 0;
for (var i = 0, length = mapAttrs.length; i < length; i++) {
var attr = mapAttrs[i];
if (attr.MyDataType == 6 || attr.MyDataType == 7) {
dateMapAttrs.push(attr);
continue;
}
if (attr.UIVisible == 0) {
continue;
}
//文本字段
if (attr.MyDataType == 1 && attr.UIContralType == 0) {
count++;
flag = false;
if (StringSearchKeys) {
flag = (StringSearchKeys.indexOf("*" + attr.KeyOfEn + ",") != -1);
}
$("#StringKeys").append("<input type='checkbox' " + (flag ? "checked = 'checked'" : "") + " id='" + attr.KeyOfEn + "' data-name='" + attr.Name + "'/><label for='" + attr.KeyOfEn + "' >" + attr.Name + "(" + attr.KeyOfEn + ")</label>&nbsp;&nbsp;&nbsp;");
if (count == 3) {
$("#StringKeys").append("<br/>");
count = 0;
}
continue;
}
if (attr.UIBindKey == "") {
continue;
}
flag = false;
if (RptSearchKeys) {
flag = (RptSearchKeys.indexOf("*" + attr.KeyOfEn + "*") != -1);
}
$("#FKeys").append("<input type='checkbox' " + (flag ? "checked = 'checked'" : "") + " id='" + attr.KeyOfEn + "' /><label for='" + attr.KeyOfEn + "' >" + attr.Name + "(" + attr.KeyOfEn + ")</label></br>");
}
$("#DDL_DTSearchWay").val(DTSearchWay);
//绑定日期下拉框.
if (dateMapAttrs != null) {
GenerBindDDL("DDL_DTSearchKey", dateMapAttrs, "KeyOfEn", "Name", DTSearchKey);
}
var hidenField = mapData.GetPara("HidenField");
while (hidenField.indexOf("[%]") != -1)
hidenField = hidenField.replace("[%]", "%");
$("#TB_HidenField").val(hidenField);
}
function Save() {
var mapData = new Entity("BP.Sys.MapData", frmID);
var IsSearchKey = document.getElementById("CB_Key_0").checked ? 1 : 0;
mapData.SetPara("IsSearchKey", IsSearchKey);
mapData.SetPara("DTSearchWay", document.getElementById("DDL_DTSearchWay").value);
mapData.SetPara("DTSearchKey", document.getElementById("DDL_DTSearchKey").value);
mapData.SetPara("DTSearchLabel", $("#DDL_DTSearchKey").find("option:selected").text());
var hidenField = $("#TB_HidenField").val();
hidenField = hidenField.replace(/%/g, '[%]');
mapData.SetPara("HidenField", hidenField);
var fields = "";
var oChecks = document.getElementById("FKeys").getElementsByTagName("input");
for (var i = 0, len = oChecks.length; i < len; i++) {
var item = oChecks[i];
if (item.checked) {
fields += "*" + item.id;
}
}
if (fields == "") {
mapData.SetPara("RptSearchKeys", "");
} else {
mapData.SetPara("RptSearchKeys", fields + "*");
}
fields = "";
oChecks = document.getElementById("StringKeys").getElementsByTagName("input");
for (var i = 0, len = oChecks.length; i < len; i++) {
var item = oChecks[i];
if (item.checked) {
fields += "*" + item.id + "," + item.getAttribute("data-name");
}
}
if (fields == "") {
mapData.SetPara("StringSearchKeys", "");
} else {
mapData.SetPara("StringSearchKeys", fields + "*");
}
mapData.Update();
Reload();
}
function changeStringKeysState(val) {
if (val == 0) {
$("#StringKeys input[type=checkbox]").attr("disabled", 'disabled');
$("#StringKeys input[type=checkbox]").removeAttr("checked");
}
if (val == 1) {
$("#StringKeys input[type=checkbox]").removeAttr("disabled");
}
}
</script>
<base target="_self" />
</head>
<body>
<form id="cc">
<table style="width: 96%;">
<caption>
设置查询条件
</caption>
<tr>
<th>
关键字查询
</th>
</tr>
<tr>
<td>
<fieldset>
<legend>
<label><input type="radio" name="CB_Key" id="CB_Key_0" value="0" onchange="changeStringKeysState(this.value)" />是否增加关键字查询</label>
</legend>
<ul>
<li> 关键字查询是接受用户输入一个关键字在整个报表的显示列中使用like查询(外键、枚举、数值类型的除外) </li>
<li> 关键字搜索提示, 默认为:请输入关键字... </li>
<li>
<input id="TB_Alert" name="TB_Alert" type="text" value="" />
</li>
</ul>
</fieldset>
<fieldset>
<legend>
<label><input type="radio" name="CB_Key" id="CB_Key_1" value="1" onchange="changeStringKeysState(this.value)" />是否增加特定字段的查询</label>
</legend>
<ul>
<li>选择特定字段在报表中根据like模糊查询 </li>
</ul>
<div id="StringKeys" style="margin-left:15px"> </div>
</fieldset>
</td>
</tr>
<tr>
<th>
外键与枚举类型,的查询
</th>
</tr>
<tr>
<td>
<div id="FKeys">
</div>
</td>
</tr>
<tr>
<th>
时间段的查询
</th>
</tr>
<tr>
<td>
对数据按照时间段进行查询,比如:按流程的发起时间,在指定时间段内进行查询。<br />
选择方式:<select name="DDL_DTSearchWay" id="DDL_DTSearchWay">
<option selected="selected" value="0">不启用</option>
<option value="1">按日期</option>
<option value="2">按日期时间</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字段:<select name="DDL_DTSearchKey" id="DDL_DTSearchKey">
</select>
</td>
</tr>
<tr>
<th>
增加隐藏查询条件and,or
</th>
</tr>
<tr>
<th> <input id="TB_HidenField" name="TB_HidenField" type="text" value="" placeholder="例如:Age=18 AND Name like '%XX%'" style="width:98%" /></th>
</tr>
</table>
<input type="button" value="保存" onclick="Save();" />
<fieldset>
<legend id="help"> 自定义查询条件样式1 </legend>
<img src="SearchCond.png" class="HelpImg" style="border:2px;" />
</fieldset>
</form>
</body>
</html>