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.

183 lines
7.9 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>
<script language="JavaScript" src="../../../Comm/JScript.js" type="text/javascript"></script>
<script type="text/javascript" src="../../../Scripts/bootstrap/js/jquery.min.js"></script>
<script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
<link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
<!-- 引用通用的js文件. -->
<script type="text/javascript" src="../../../Scripts/config.js"></script>
<script type="text/javascript" src="../../../Comm/Gener.js"></script>
<script type="text/javascript" language="javascript">
var mapdtls = null;
//页面启动函数.
$(function () {
$("#Msg").html("<img src=../../../Img/loading.gif />&nbsp;正在加载,请稍后......");
var dbType = GetQueryString("DBType");
$("#Lab_1").html("执行的SQL");
$("#Lab_2").html("<a href=\"javascript:ShowHidden('sqlexp')\">填充SQL帮助:</a>");
if (dbType == "1") {
$("#Lab_1").html("执行的URL");
$("#Lab_2").html("<a href=\"javascript:ShowHidden('urlexp')\">填充URL帮助:</a>");
}
if (dbType == "2") {
$("#Lab_1").html("执行的SFTable");
}
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner_MapExt");
handler.AddPara("FK_MapData", GetQueryString("FK_MapData"));
handler.AddPara("KeyOfEn", GetQueryString("KeyOfEn"));
handler.AddPara("MyPK", GetQueryString("MyPK"));
var data = handler.DoMethodReturnString("TBFullCtrlDtl_Init");
if (data.indexOf('err@') == 0) {
alert(data);
return;
}
data = JSON.parse(data);
mapdtls = data;
if (data.length == 0) {
alert('该表单没有从表组件.');
Back();
return;
}
var html = '';
for (var i = 0; i < data.length; i++) {
var mapdtl = data[i];
//alert(mapdtl.Alias);
html += "<fieldset>";
html += "<legend>从表:" + mapdtl.No + " - " + mapdtl.Name + "</legend>";
html += '<textarea rows=4 name=TB_' + mapdtl.No + ' name=TB_' + mapdtl.No + ' style="width:95%;" > ' + mapdtl.MTR + '</textarea>';
html += "<br>可填充的明细表列:" + mapdtl.Alias;
html += "</fieldset>";
}
document.getElementById('tbs').innerHTML = html;
$("#Msg").html("");
return;
});
//装载模版.
function LoadTemplate() {
var url = "../../SettingTemplate.htm?TemplateType=TBFullCtrl";
WinOpen(url, 'ss');
}
</script>
</head>
<body>
<form id="cc">
<div style="right:10px; position:absolute; z-index:100; top:-3px">
<input type="button" value="保存" onclick="Save()" id="Btn_Save" />
<input type="button" value="返回" onclick="Back()" id="Btn_Back" title="" />
</div>
<table id="table" style="width: 100%; border-width: 0px;">
<caption>
为文本框填充其它控件 - 从表
</caption>
<tr style="border-width: 0px;">
<td colspan="3" style="border-width: 0px;">
<label id="Lab_1">
执行的SQL
</label>
<a href="javascript:ShowHidden('sqlexp')">
<label id="Lab_2">
填充SQL帮助:
</label>
</a>
<div id='sqlexp' style='color: Gray; display: none'>
<ul>
<li>1. 设置一个查询的SQL语句该SQL返回一个结果集用于自动填充当前从表. </li>
<li>2. 该SQL必须包含 @Key 关键字,@Key 输入文本框的值. </li>
<li>3. SQL返回的列与该从表字段名称保持一致就可以完成控件数据的自动填充。</li>
<li>
4. 比如:SELECT NianYue,GongZuoDanWei,ZhengMingRen,BeiZhu FROM Demo_Resume WHERE FK_Student='@Key'
</li>
<li>ccform为您准备了一个demo,请参考表单库\\本机数据源\\表单元素\\基础功能</li>
<li>
<img alt="" src="../Img/TBCtrlFull.png" />
</li>
</ul>
</div>
<div id='urlexp' style='color: Gray; display: none'>
<ul>
<li>1. 设置一个查询的API接口该接口返回一个结果集用于自动填充当前从表. </li>
<li>2. 该接口URL必须包含 @Key 关键字,@Key 输入文本框的值. </li>
<li>3. 接口URL返回的列与该从表字段名称保持一致就可以完成控件数据的自动填充。</li>
<li>
4. 比如:/jflow-web/WF/DemoTest/ProcessRequest.do?DoType=ReqResumeByKey&FK_Student=@Key
</li>
<li>ccform为您准备了一个demo,请参考表单库\\本机数据源\\表单元素\\基础功能</li>
<li>
<img alt="" src="../Img/TBCtrlFull.png" />
</li>
</ul>
</div>
</td>
</tr>
<tr>
<td colspan="3" style="width: 100%; border-width: 0px;">
<div id="tbs">
</div>
</td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
</table>
<div id="Msg">
</div>
<script type="text/javascript">
function Back() {
var myPK = GetQueryString('MyPK');
var fromPage = GetQueryString('FromPage');
var url = '';
if (fromPage == null)
var url = 'TBFullCtrl.htm?FK_MapData=' + GetQueryString('FK_MapData') + '&MyPK=' + myPK + "&KeyOfEn=" + GetQueryString('KeyOfEn');
else
var url = 'DDLFullCtrl.htm?FK_MapData=' + GetQueryString('FK_MapData') + '&MyPK=' + myPK + "&KeyOfEn=" + GetQueryString('KeyOfEn');
SetHref(url);
return;
}
function Save() {
$("#Msg").html("正在保存,请稍后......");
var str = "";
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner_MapExt");
handler.AddPara("FK_MapData", GetQueryString("FK_MapData"));
handler.AddPara("MyPK", GetQueryString("MyPK"));
handler.AddPara("Tag", str);
handler.AddFormData();
var data = handler.DoMethodReturnString("TBFullCtrlDtl_Save");
if (data.indexOf('err@') != -1) {
$("#Msg").html("<font color=red>" + data + "</font>");
return;
}
alert(data);
var mypk = GetQueryString('MyPK');
var url = 'DDLFullCtrl.htm?FK_MapData=' + GetQueryString('FK_MapData') + '&KeyOfEn=' + GetQueryString('KeyOfEn') + '&MyPK=' + mypk;
SetHref(url);
return;
}
</script>
</form>
</body>
</html>