function InitMapAttrOfCtrl(mapAttr, frmData) { var defValue = mapAttr.DefVal; var eleHtml = ''; //外部数据源类型. if (mapAttr.LGType == "0" && mapAttr.MyDataType == "1" && mapAttr.UIContralType == "1") { //枚举类型. if (mapAttr.UIIsEnable == 1) enableAttr = ""; else enableAttr = "disabled='disabled'"; return ""; } //外键类型. if (mapAttr.LGType == "2" && mapAttr.MyDataType == "1") { //枚举类型. if (mapAttr.UIIsEnable == 1) enableAttr = ""; else enableAttr = "disabled='disabled'"; //判断外键是否为树形结构 var uiBindKey = mapAttr.UIBindKey; if (uiBindKey != null && uiBindKey != undefined && uiBindKey != "") { var sfTable = new Entity("BP.Sys.SFTable"); sfTable.SetPKVal(uiBindKey); var count = sfTable.RetrieveFromDBSources(); if (count != 0 && sfTable.CodeStruct == "1") { return ""; } } return ""; } //外部数据类型. if (mapAttr.LGType == "0" && mapAttr.MyDataType == "1" && mapAttr.UIContralType == 1) { //枚举类型. if (mapAttr.UIIsEnable == 1) enableAttr = ""; else enableAttr = "disabled='disabled'"; if (mapAttr.UIContralType == 1) return ""; if (mapAttr.UIContralType == 3) { //横向排列 var RBShowModel = 3; if (mapAttr.AtPara.indexOf("@RBShowModel=3") == -1) RBShowModel = 0; return InitRBShowContent(frmData, mapAttr, defValue, RBShowModel, enableAttr); } } //添加文本框 ,日期控件等 //AppString if (mapAttr.MyDataType == "1" && mapAttr.UIContralType == 0) { //不是外键 if (mapAttr.UIHeight <= 40) //普通的文本框. { //如果是图片签名,并且可以编辑 if (mapAttr.IsSigan == "1" && mapAttr.UIIsEnable == 1) { var html = ""; //是否签过 var sealData = new Entities("BP.Tools.WFSealDatas"); sealData.Retrieve("OID", GetQueryString("WorkID"), "FK_Node", GetQueryString("FK_Node"), "SealData", GetQueryString("UserNo")); if (sealData.length > 0) { eleHtml += "" + defValue+"" + html; isSigantureChecked = true; } else { eleHtml += "" + html; } return eleHtml; } //如果不可编辑,并且是图片名称 if (mapAttr.IsSigan == "1") { var val = ConvertDefVal(frmData, mapAttr.DefVal, mapAttr.KeyOfEn); var html = ""; eleHtml += "" + html; return eleHtml; } var enableAttr = ''; if (mapAttr.UIIsEnable == 0) enableAttr = "disabled='disabled'"; return ""; } if (mapAttr.AtPara && mapAttr.AtPara.indexOf("@IsRichText=1") >= 0) { var eleHtml = ""; //如果是富文本就使用百度 UEditor if (mapAttr.UIIsEnable == "0") { //只读状态直接 div 展示富文本内容 //eleHtml += ""; //eleHtml += "
" + defValue + "
"; eleHtml += "
" + defValue + "
"; } else { document.BindEditorMapAttr = mapAttr; //存到全局备用. //设置编辑器的默认样式 var styleText = "text-align:left;font-size:12px;"; styleText += "width:100%;"; styleText += "height:" + mapAttr.UIHeight + "px;"; //注意这里 name 属性是可以用来绑定表单提交时的字段名字的 eleHtml += ""; } eleHtml = "
" + eleHtml + "
"; return eleHtml } //普通的大块文本. return "