//页面获取的参数数据 // fix firefox bug document.body.ondrop = function (event) { event.preventDefault(); event.stopPropagation(); } var pageData = { WorkID: 0, OID: 0, FK_Flow: GetQueryString("FK_Flow"), FK_Node: GetQueryString("FK_Node") } var frmID = GetQueryString("FK_MapData"); var groupID = GetQueryString("GroupField"); var webUser = new WebUser(); var workModel = GetQueryString("WorkModel"); workModel = workModel == null || workModel == undefined ? 0 : workModel; var nodeID = GetQueryString("FK_Node"); nodeID = nodeID == null || nodeID == undefined ? 0 : nodeID; var W = 0; var H = 0; layui.extend({ pinyin: "../../Scripts/layui/ext/pinyin" }); layui.use(['dropdown', 'util', 'layer', 'table', 'form', 'pinyin', 'laydate'], function () { var dropdown = layui.dropdown, form = layui.form, layer = layui.layer, laydate = layui.laydate, pinyin = layui.pinyin, $ = layui.jquery; //1.初始化二级菜单 dropdown.render({ elem: '#Btn_Save', data: CovertEleMenuToDropdownMenu(), click: function (obj) { MenuClick(obj.id, pinyin); }, mousemove: function (obj) { MenuClick(obj.id, pinyin); } }); //初演示 dropdown.render({ elem: '#Btn_TableCol', data: [ { title: '标准型4列', id: 0 }, { title: '紧凑型6列', id: 1 } ], click: function (obj) { var en = new Entity("BP.WF.Template.Frm.MapFrmFool", frmID); en.TableCol = obj.id; en.Update(); Reload(); } }); //2.设置显示或隐藏工具栏按钮 hideBtton(); //装载风格. LoadCss(); //3.获取表单数据、解析表单的数据内容 InitPage(); //4.处理工具栏的操作 $('.layui-toolbar').on('click', function () { getWindowWH(); var url = ""; var title = ""; var type = $(this).data('type'); switch (type) { case "MapDataEdit": //属性 var en = new Entity("BP.Sys.MapData", frmID); var url = "../../Comm/RefFunc/En.htm?EnName=BP.WF.Template.Frm.MapFrmFool&PKVal=" + frmID; if (en.FrmType == 9) url = "../../Comm/RefFunc/En.htm?EnName=BP.WF.Template.Frm.MapFrmWps&No=" + frmID; //url = '../../Comm/En.htm?EnName=BP.WF.Template.Frm.MapFrmFool&PKVal=' + frmID; //alert(url); title = "属性"; break; case "FrmBillEdit": //单据属性 title = "单据属性"; if (workModel == 2) url = '../../Comm/En.htm?EnName=BP.CCBill.FrmBill&PKVal=' + frmID; if (workModel == 3) url = '../../Comm/En.htm?EnName=BP.CCBill.FrmDict&PKVal=' + frmID; break; case "ImpRefDict": //导入关联表单模板 title = "导入关联表单模板"; var bill = new Entity("BP.CCBill.FrmBill", frmID); url = "./ImpRefDictField.htm?FK_MapData=" + frmID + "&RefFrm=" + bill.RefDict; break; case "ExpImp": //导入/导出 title = "导入/导出"; url = './ImpExp/Imp/Default.htm?FrmID=' + frmID + "&DoType=FunList&FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + nodeID; break; case "Batch": //导入/导出 title = "批处理"; url = './Batch/Default.htm?FrmID=' + frmID + "&DoType=FunList&FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + nodeID; break; case "FrmNodeComponent": //节点组件 if (nodeID == 0) { layer.alert('非节点表单'); return; } title = "节点组件"; url = '../../Comm/EnOnly.htm?EnName=BP.WF.Template.FrmNodeComponent&PKVal=' + nodeID; break; case "MobileFrm": title = "手机端"; url = '../MobileFrmDesigner/Default.htm?FK_Flow=' + GetQueryString("FK_Flow") + '&FK_Node=' + nodeID + '&FK_MapData=' + frmID; OpenLayuiDialog(url, title, W, 0, null, false); return; case "StyletDfine": url = "./StyletDfine/Default.htm?FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + nodeID + "&FK_MapData=" + frmID + "&FrmID=" + frmID; // window.open(url); SetHref(url); return; case "ToDevFrm": url = "../DevelopDesigner/Designer.htm?FK_Flow=" + GetQueryString("FK_Flow") + "&FK_Node=" + nodeID + "&FK_MapData=" + frmID + "&FrmID=" + frmID; // window.open(url); SetHref(url); return; default: break; } if (type != "StyletDfine" && type != "ToDevFrm") OpenLayuiDialog(url, title, W, 0, null, true); }); form.render(); //更新全部 //时间 $.each($(".ccdate"), function (i, item) { var format = $(item).attr("data-info"); if (format.indexOf("HH") != -1) { laydate.render({ elem: '#' + item.id, format: $(item).attr("data-info"), //可任意组合 type: 'datetime', trigger: 'click', ready: function (date) { var now = new Date(); var mm = ""; if (now.getMinutes() < 10) mm = "0" + now.getMinutes(); else mm = now.getMinutes(); var ss = ""; if (now.getSeconds() < 10) ss = "0" + now.getSeconds(); else ss = now.getSeconds(); this.dateTime.hours = now.getHours(); this.dateTime.minutes = mm; this.dateTime.seconds = ss; }, change: function (value, date, endDate) { $('.laydate-btns-confirm').click(); } }); } else { laydate.render({ elem: '#' + item.id, format: $(item).attr("data-info") //可任意组合 }); } }) }); //动态的装载css. function LoadCss() { // 动态加载css var loadStyle = function (url) { var link = document.createElement('link'); link.rel = "stylesheet"; link.type = "text/css"; link.href = url; var head = document.getElementsByTagName("head")[0]; head.appendChild(link); }; // css加载 var url = "../../../DataUser/Style/FoolFrmStyle/Default.css?ref=11" + Math.random(); loadStyle(url); url = "../../../DataUser/Style/GloVarsCSS.css?ref=11" + Math.random(); loadStyle(url); $('head').children(':last').attr({ rel: "stylesheet", type: 'text/css', href: url, }); } /* *获取屏幕的高度、宽度 */ function getWindowWH() { //获取页面的大小 if (window.innerWidth) W = window.innerWidth; else if ((document.body) && (document.body.clientWidth)) W = document.body.clientWidth; W = W - 400; if (window.innerHeight) H = window.innerHeight; else if ((document.body) && (document.body.clientHeight)) H = document.body.clientHeight; H = H - 80; } /** * 隐藏工具栏上的按钮 */ function hideBtton() { //导入关联表单按钮 $("#RefDict").hide(); //单据属性按钮 if (workModel == 0 || workModel == 1) $("#FrmillBtn").hide(); if (workModel == 3) $("#RefDict").show(); //如果SAAS模式. if (webUser.CCBPMRunModel == 2) { $("#StyletDfine").hide(); $("#GloValStyles").hide(); $("#BatchAddF").hide(); $("#MobileFrm").hide(); } if (nodeID == 0) $("#FrmNodeComponent").hide(); } /** * 表单数据初始化 */ function InitPage() { var isF = GetQueryString("IsFirst"); //是否第一次加载? var hander = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner"); hander.Clear(); hander.AddPara("IsFirst", isF); hander.AddPara("FK_MapData", frmID); hander.AddPara("FK_Flow", GetQueryString("FK_Flow")); hander.AddPara("FK_Node", GetQueryString("FK_Node")); var data = hander.DoMethodReturnString("Designer_Init"); if (data.indexOf('err@') == 0) { alert(data); console.log(data); return; } if (data.indexOf('url@') == 0) { data = data.replace('url@', ''); SetHref(data); return; } //里面有三个对象. Sys_MapAttr, Sys_GroupField, Sys_MapData data = JSON.parse(data); var groupFields = data.Sys_GroupField; //分组集合 var sys_MapData = data.Sys_MapData[0]; //表单属性 var frmName = sys_MapData.Name; //表单名称 var tableCol = sys_MapData.TableCol; //表单分的列数 if (tableCol == 0) $("#TB_TableCol").html("标准型4列"); else $("#TB_TableCol").html("紧凑型6列"); switch (tableCol) { case 0: tableCol = 4; break; case 1: tableCol = 6; break; case 2: tableCol = 3; break; default: ableCol = 4; break; } var _html = '
'; _html += "
"; //表头 _html += '
'; _html += '
' //_html += "
"; _html += "
" + frmName + "
"; _html += '
'; _html += '
'; //分组的解析 for (var k = 0; k < groupFields.length; k++) { var groupObj = groupFields[k]; //附件类的控件. if (groupObj.CtrlType == 'Ath') { //获取附件的主键 var MyPK = groupObj.CtrlID; if (MyPK == "") continue; //创建附件描述信息. var ath = new Entity("BP.Sys.FrmAttachment"); ath.MyPK = groupObj.CtrlID; if (ath.RetrieveFromDBSources() == 0) continue; if (ath.IsVisable == "0" || ath.NoOfObj == "FrmWorkCheck") continue; } //生成工具栏. _html += GenerGroupTR(groupObj, tableCol, data); //生成内容. _html += GenerGroupContext(groupObj, data, tableCol); //过滤attrs var mapAttrs = []; //如果分组是目录形式,即:groupObj.CtrlType = "Dir"时,不显示分组里的字段属性 if (groupObj.CtrlType == "Dir") continue; else if (groupObj.CtrlType == "Chapter") { //如果分组是章节形式,即:groupObj.CtrlType = "Chapter"时,只显示分组里MaxLen>2000的字段 mapAttrs = $.grep(data.Sys_MapAttr, function (val) { return val.GroupID == groupObj.OID && val.MaxLen > 2000; }); } else mapAttrs = $.grep(data.Sys_MapAttr, function (val) { return val.GroupID == groupObj.OID; }); if (tableCol == 4 || tableCol == 6) _html += InitMapAttr(mapAttrs, tableCol,data.Sys_MapExt); if (tableCol == 3) _html += InitThreeColMapAttr(mapAttrs, tableCol); continue; } _html += "
"; _html += "
"; $('#contentTable').html(_html); if ($("#WorkCheck").length == 1) loadScript("../../WorkOpt/WorkCheck.js", function () { NodeWorkCheck_Init(); }); if ($("#FlowBBS").length == 1) loadScript("../../WorkOpt/FlowBBS.js"); if (data.Sys_FrmAttachment.length != 0) { Skip.addJs("../../CCForm/Ath.js"); Skip.addJs("../../CCForm/JS/FileUpload/fileUpload.js"); $('head').append(""); } $.each(data.Sys_FrmAttachment, function (idex, ath) { AthTable_Init(ath, "Div_" + ath.MyPK); }); //AfterBindEn_DealMapExt(data); //增加图标 $.each(data.Sys_MapAttr, function (i, mapAttr) { if (mapAttr.UIVisible == 0) return true; AddICON(mapAttr); }); $.each($(".wapper"), function (i, item) { if (item == null) return true; var ops = { animation: 1000, draggable: ".item", ghostClass: 'form-item-drag-class', //开始拖动记录下用户点击的那个元素 onStart: function (evt) { moveItemId = evt.clone.dataset.id; layer.msg("正在移动", { offset: 'center', icon: 16 }) }, //拖动结束 onEnd: function (evt) { /** * 获取排序后的结果 * 因为之前页面结构不正确,获取不方便。 * 但可以通过获取dom元素的位置解决 * 首先拿到当前触发的元素evt.item * $(evt.item).prevAll()拿到所有前驱节点 * 从前驱节点里面找到分组标识 */ var prevNodeList = Array.from($(evt.item).prevAll()) var currentGroup = prevNodeList.filter(function (item) { return item.classList.contains('FoolFrmGroupBar') }) if (Array.isArray(currentGroup) && currentGroup.length > 0) { currentGroup = currentGroup[0] } else { layer.msg("获取的groupId为空") return } // 此时再去根据拖动后的组寻找后面所有的节点,筛选 var nextNodeList = Array.from($(currentGroup).nextAll()) var requiredList = [] nextNodeList.forEach(function (item, index) { // 到下一个组,终止循环 if (item.classList.contains('FoolFrmGroupBar')) { return } if (item.classList.contains('item')) { requiredList.push(item) } }) var currentGroupId = currentGroup.dataset.id // 当前分组节点排序 var currentMyPKs = requiredList.map(function (item) { return item.dataset.id }).join(',') var currentItemId = evt.item.dataset.id // 分别为当前移动的元素的id,移动到的组的id,移动到的组的排序 console.log('currentId:', currentItemId, 'currentGroupId:', currentGroupId, 'currentMyPKs:', currentMyPKs); var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner"); handler.AddPara("GroupID", currentGroupId); //当前的组ID。 handler.AddPara("MyPKs", currentMyPKs); //分组中的IDs handler.AddPara("MyPK", currentItemId); // 当前选择的IDs. //handler.AddPara("GroupID", groupID); var data = handler.DoMethodReturnString("Designer_Move"); //todo:这里增加气泡模式的信息提示. layer.msg(data); if (data.indexOf("err@") == 0) Reload(); return }, }; var sortable = Sortable.create(item, ops); }) } //生成鼠标移动上去的修改样式. function AddEditColTip(mapAttr) { if (mapAttr.ColSpan == 1) { return " "; } } //保存设置的宽度 function SaveColSpan(mapAttr, colspan) { mapAttr.ColSpan = colspan; mapAttr.Update(); Reload(); } function AddICON(mapAttr) { var icon = mapAttr.ICON; if (mapAttr.MyDataType == 6 || mapAttr.MyDataType == 7) icon = "icon-calendar"; if (icon == "" || icon == "0") { return; } if (icon) { var html = ""; html += ' '; var obj = $("#TB_" + mapAttr.KeyOfEn); if (obj.length == 0) obj = $("#DDL_" + mapAttr.KeyOfEn); obj.wrapAll("
"); obj.css("padding-left", "40px"); obj.before(html); } } /** * 分组标签的解析 * @param {any} groupObj 分组 * @param {any} tableCol 显示的列 * @param {any} data 表单数据集合 */ function GenerGroupTR(groupEn, tabCol, data) { var lab = groupEn.Lab; if (lab == "") lab = "编辑"; //左边的按钮. var leftBtn = "
"; var midBtn = ""; var isShow = true; var tdId = ""; switch (groupEn.CtrlType) { case "Ath": if (groupEn.CtrlID == "") { isShow = false; break; } //创建附件描述信息. var frmattachments = data.Sys_FrmAttachment; var ath = null; for (var i = 0; i < frmattachments.length; i++) { if (frmattachments[i].MyPK == groupEn.CtrlID) { ath = frmattachments[i]; break; } } if (ath == null) { isShow = false; break; } if (ath.IsVisable == "0") { //如果是节点字段附件的时候就隐藏 var mapAttr = $.grep(data.Sys_MapAttr, function (obj, i) { if (obj.MyPK == groupEn.CtrlID) return obj; }); if (mapAttr.length != 0) { isShow = false; break; } } tdId = "id='THAth_" + ath.MyPK + "'"; leftBtn += "
附件:" + lab + "
"; break; case "Frame": leftBtn += "
" + lab + "
"; break; case "SubFlow": leftBtn += "
" + lab + "
"; break; case "Dtl": leftBtn += "
从表属性:" + lab + "
"; //中间连接. midBtn = ""; midBtn += '插入列'; midBtn += ""; tdId = "id='THDtl_" + groupEn.CtrlID + "'"; break; case "FWC": leftBtn += "
审核审批
"; break; default: leftBtn += "
" + lab + "
"; break; } if (isShow == true) { leftBtn += "
"; //右边的按钮都一样. var rightBtn = "
" + midBtn; rightBtn += ""; rightBtn += ""; rightBtn += "
"; console.log(groupEn) var html = "
"; html += "
"; html += leftBtn + rightBtn; html += "
"; html += "
"; } return html; } /** * 上移 * @param {any} refOID */ function GroupFieldDoUp(refOID) { var en = new Entity("BP.Sys.GroupField", refOID); en.DoMethodReturnString("DoUp"); Reload(); } /** * 下移 * @param {any} refoid */ function GroupFieldDoDown(refoid) { var en = new Entity("BP.Sys.GroupField", refoid); en.DoMethodReturnString("DoDown"); Reload(); } /** * 生成附件,父子流程,框架,审核组件,从表,目录的内容 * @param {any} groupEn * @param {any} data * @param {any} tableCol */ function GenerGroupContext(groupEn, data, tableCol) { var _html = '
'; _html += '
' switch (groupEn.CtrlType) { case "Ath": if (groupEn.CtrlID == "") return ""; var athEn = $.grep(data.Sys_FrmAttachment, function (ath) { return ath.MyPK == groupEn.CtrlID }); if (athEn.length == 0) _html += "
附件[" + groupEn.CtrlID + "]丢失
"; if (athEn[0].IsVisable == "0") return ""; _html += "
"; break; case "SubFlow": var flowNo = GetQueryString("FK_Flow"); var nodeID = GetQueryString("FK_Node"); Skip.addJs("../../WorkOpt/SubFlow.js"); // _html += gfLabHtml; _html += "
" _html += "
"; //说明是累加表单. if (groupEn.FrmID.indexOf(nodeID) == -1) { var myNodeID = groupEn.FrmID.substring(2); var myNode = new Entity("BP.WF.Node", myNodeID); _html += "
" + SubFlow_Init(myNode) + "
"; } else { var node = new Entity("BP.WF.Node", nodeID); _html += "
" + SubFlow_Init(node) + "
"; } /* var src = "../../WorkOpt/SubFlow.htm?WorkID=0&FK_Flow=" + flowNo + "&FK_Node=" + nodeID; var compent = new Entity("BP.WF.Template.SFlow.FrmSubFlow", nodeID); var frameDocs = ""; _html += "
" + frameDocs + "
";*/ break; case "Frame": var frameEn = $.grep(data.Sys_MapFrame, function (frame) { return frame.MyPK == groupEn.CtrlID }); if (frameEn.length == 0) { _html += "
框架[" + groupEn.CtrlID + "]丢失
"; } var src = frameEn[0].URL; if (src.indexOf('?') == -1) src = frameEn[0].URL + "?PKVal=0&FK_MapData=" + frmID + "&MapFrame=" + frameEn[0].MyPK; else src = frameEn[0].URL + "&PKVal=0&FK_MapData=" + frmID + "&MapFrame=" + frameEn[0].MyPK; var frameUrl = ""; _html += "
" + frameUrl + "
"; break; case "FWC": _html += "
"; break; case "Dtl": var dtl = $.grep(data.Sys_MapDtl, function (dtl) { return dtl.No == groupEn.CtrlID }); if (dtl.length == 1) { var src = "MapDtlDe2021.htm?DoType=Edit&FK_MapData=" + frmID + "&FK_MapDtl=" + dtl[0].No; var frameUrl = ""; _html += "
" + frameUrl + "
"; } else { _html += "
从表[" + groupEn.CtrlID + "]丢失
"; } break; default: break; } _html += "
"; _html += "
"; return _html; } //解析表单字段 MapAttr.(表单4列/6列) function InitMapAttr(Sys_MapAttr, tableCol,mapExts) { var html = ""; var isDropTR = true; var colSpan = 1; var LabelColSpan = 1; var textWidth = ""; var colWidth = ""; var useColSpan = 0; for (var i = 0; i < Sys_MapAttr.length; i++) { var attr = Sys_MapAttr[i]; if (attr.UIVisible == 0) continue; //单元格和标签占的列数 colSpan = attr.ColSpan; LabelColSpan = attr.LabelColSpan; //单元格和标签占的列数对应的class colWidth = getColSpanClass(colSpan, tableCol); textWidth = getLabelColSpanClass(LabelColSpan, tableCol); //大文本备注信息 独占一行 if (attr.UIContralType == 60) { if (isDropTR == false) { // html += "
"; isDropTR = true; } textWidth = getLabelColSpanClass(tableCol, tableCol); //获取文本信息 mapExts = mapExts || []; var myExts = $.grep(mapExts, function (item) { var mypk = "HtmlText_" + attr.MyPK; return item.MyPK == mypk; }); var str = "设置大块文本说明"; if (myExts.length > 0) { var mapExt = new Entity("BP.Sys.MapExt", myExts[0]); mapExt.MyPK = myExts[0].MyPK; str = mapExt.DoMethodReturnString("ReadBigNoteHtmlText"); } html += "
"; html += ""; html += "
"; isDropTR = true; continue; } //跨列设置(显示的是文本) if (colSpan == 0) { if (LabelColSpan >= tableCol) { if (isDropTR == false) { //html += "
"; isDropTR = true; } textWidth = getLabelColSpanClass(tableCol, tableCol); html += "
"; html += "
" + GenerLabel(attr) + "
"; html += "
"; isDropTR = true; continue; } //线性展示都跨一个单元格 //换行的情况 if (isDropTR == true) { useColSpan = LabelColSpan; html += "
"; html += "
" + GenerLabel(attr) + "
"; if (useColSpan == tableCol) { isDropTR = true; //html += "
"; } else isDropTR = false; continue; } if (isDropTR == false) { useColSpan += LabelColSpan; if (useColSpan > tableCol) { useColSpan = LabelColSpan; //自动换行 //html += ""; html += "
"; html += "
" + GenerLabel(attr) + "
"; } else html += "
" + GenerLabel(attr) + "
"; if (useColSpan == tableCol) { isDropTR = true; //html += "
"; } else isDropTR = false; continue; } } //解析占一行的情况 if (colSpan == tableCol) { if (isDropTR == false) { //html += ""; isDropTR = true; } useColSpan = 0; //自动换行 html += "
"; html += "
" + GenerLabel(attr) + "
"; html += "
" + InitMapAttrOfCtrlFool(attr) + "
"; html += "
" continue; } var sumColSpan = colSpan + LabelColSpan; if (sumColSpan >= tableCol) { if (isDropTR == false) { //html += ""; isDropTR = true; } useColSpan = 0; colWidth = textWidth.replace("layui-col-xs", ""); if (colWidth.length == 0) colWidth = "layui-col-xs12"; else colWidth = "layui-col-xs" + (12 - parseInt(colWidth)); html += "
"; if (attr.MyDataType == 1 && attr.UIContralType == 0 && attr.LGType == 0 && (attr.IsSupperText == 1 || attr.UIHeight > 40)) html += "
" + GenerLabel(attr) + "
"; else html += "
" + GenerLabel(attr) + "
"; html += "
" + InitMapAttrOfCtrlFool(attr) + "
"; html += "
"; continue; } //换行的情况 if (isDropTR == true) { useColSpan = LabelColSpan + colSpan; html += "
"; html += "
" + GenerLabel(attr) + "
"; html += "
" + InitMapAttrOfCtrlFool(attr) + "
"; html += "
" if (useColSpan >= tableCol) { isDropTR = true; //html += ""; } else isDropTR = false; continue; } if (isDropTR == false) { useColSpan += LabelColSpan + colSpan; if (useColSpan > tableCol) { useColSpan = LabelColSpan + colSpan; //自动换行 //html += ""; html += "
"; // html += "
" + GenerLabel(attr) + "
"; // html += "
" + InitMapAttrOfCtrlFool(attr) + "
"; html += "
" + GenerLabel(attr) + "
"; html += "
" + InitMapAttrOfCtrlFool(attr) + "
"; html += "
" } else { html += "
"; // html += "
" + GenerLabel(attr) + "
"; // html += "
" + InitMapAttrOfCtrlFool(attr) + "
"; html += "
" + GenerLabel(attr) + "
"; html += "
" + InitMapAttrOfCtrlFool(attr) + "
"; html += "
" } if (useColSpan == tableCol) { isDropTR = true; //html += ""; } else isDropTR = false; continue; } } //if (isDropTR == false) // html += ""; html += "
" return html; } /** * 获取Lab标签的显示内容 * @param {any} attr */ function GenerLabel(attr) { var tdUp = "";// ""; var tdDown = "";//""; if (attr.UIIsInput == 1) attr.Name = attr.Name + "*"; var ccsLab = ""; if (attr.CSSLabel != "") ccsLab = " class='" + attr.CSSLabel + "'"; if (attr.LGType == 0 && attr.UIContralType == 1) { return tdUp + "" + attr.Name + "" + tdDown; } if (attr.LGType == 0) { return tdUp + "" + attr.Name + "" + tdDown; } if (attr.LGType == 1) return tdUp + "" + attr.Name + "" + tdDown; if (attr.LGType == 2) return tdUp + "" + attr.Name + "" + tdDown; } /** * 获取单元格显示的内容 * @param {any} mapAttr */ function InitMapAttrOfCtrlFool(mapAttr) { var ccsCtrl = ""; if (mapAttr.CSSCtrl != "" && mapAttr.CSSCtrl != "0") ccsCtrl = " class='" + mapAttr.CSSCtrl + "'"; var eleHtml = ""; //普通字段 if (mapAttr.LGType == 0) { switch (parseInt(mapAttr.MyDataType)) { case 1: //普通文本 switch (parseInt(mapAttr.UIContralType)) { case 4: //地图 eleHtml = "
"; eleHtml += ""; eleHtml += ""; eleHtml += "
"; return eleHtml; case 6: //字段附件 return "
"; case 12: //图片肖像. return "
"; case 8: //写字板 return ""; case 9: //超链接 return "" + mapAttr.Name + ""; case 13: //身份证 if (mapAttr.KeyOfEn == "IDCardAddress") { eleHtml = "
"; eleHtml += ""; eleHtml += ""; eleHtml += "
"; return eleHtml; } else { return ""; } break; case 16: //系统定位 debugger eleHtml = "
"; eleHtml += ""; eleHtml += "
"; return eleHtml; case 18: //按钮 return ""; case 50: //工作进度 return ""; case 101: //评分标准 eleHtml = "
"; eleHtml += ""; var num = mapAttr.Tag2; for (var i = 0; i < num; i++) { eleHtml += ""; } eleHtml += "  " + num + " 分"; eleHtml += "
"; return eleHtml; default: if (mapAttr.UIHeight <= 40) return "
"; if (mapAttr.UIHeight > 23) { var uiHeight = mapAttr.UIHeight; return "