package com.yc.service.panel.v2; import com.google.gson.JsonArray; import com.yc.action.grid.GridUtils; import com.yc.service.BaseService; import com.yc.service.grid.GridServiceIfc; import com.yc.service.impl.DBHelper; import com.yc.service.panel.GetDataTypeIfc; import com.yc.service.panel.PanelParmHelper; import com.yc.service.panel.SqlDBHelperIfc; import com.yc.service.panel.SystemSettingsDao; import com.yc.utils.JOSNUtils; import com.yc.utils.Page; import org.aspectj.weaver.ast.Var; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 生成控件显示在网页上的代码 原先在这段URL(http://的路径不再传进) 而URL真正得到信息是在生产JSP后运行才得到,保证这路径绝对正确 * * @author pengbei * */ @Service("TypeControlV2") public class TypeControl extends BaseService implements TypeControlDao { @Autowired SqlDBHelperIfc sqlDBHelperIfc; @Autowired SystemSettingsDao systemSettingsDao; @Autowired GetDataTypeIfc getDataTypeIfc; @Autowired private GridServiceIfc gridService;// 表格处理的业务类 public static String PANEL_INFO="panel_info"; private String getFunctionParm(String st, String parms, Map env) { parms = JOSNUtils.prossBase64(parms); if ("".equalsIgnoreCase(st)) return ""; if ("".equalsIgnoreCase(parms)) return ""; StringBuilder sb = new StringBuilder(); String[] temp = st.split(";");// 函数后面列出的参数,有可能包括数字,字符及参数名称 int i = 0; String[] temp1 = parms.split("\\band\\b"); for (String str : temp) { if (str.matches("\\d")) {// 只是数字 if (i != 0) sb.append(","); sb.append(str); continue; } boolean fl = false; for (String ss : temp1) { int index = 0; String cv1 = ""; String cv2 = ""; try { index = ss.indexOf("="); } catch (StringIndexOutOfBoundsException e) { index = 0; } cv1 = ss.substring(0, index); cv2 = ss.substring(index + 1); if (str.trim().equalsIgnoreCase(cv1.replaceAll("\\s", ""))) { if (i != 0) sb.append(","); sb.append("'null'".equalsIgnoreCase(cv2.replaceAll("\\s", "")) ? null : cv2); i++; fl = true; break; } else if (str.indexOf("@") > -1) {// 需要从session取值 // @usercode|cltcode String[] sts = str.split("="); if (sts[1].trim().equalsIgnoreCase(cv1.replaceAll("\\s", ""))) { if (i != 0) sb.append(","); sb.append("'" + env.get(sts[0]) + "'"); i++; fl = true; break; } } } if (!fl) { if (i != 0) sb.append(","); sb.append("'").append(str).append("'"); i++; } } return sb.toString(); } public Page loadAllByFunc(Page page, Map env, boolean flg, String statisID, int formID) { /* String s1 = ""; String s2 = ""; int index = page.getWhere().indexOf("!"); if (index > -1) {// 增加处理18类型有过滤条件的情况 if (page.getWhere().substring(index + 1) != "" && page.getWhere().substring(index + 1).trim().equalsIgnoreCase("1=2")) { return page; } s1 = page.getWhere().substring(0, index); s2 = " where " + page.getWhere().substring(index + 1).replaceAll("@~", "%").replaceAll("!", " and ") + page.getDataGroup();// 增加数据组权限 12-06-11 } else { s1 = page.getWhere(); s2 = page.getDataGroup().trim().length() > 0 ? " where " + ((page.getDataGroup().trim().startsWith("and")) ? " 1=1 " + page.getDataGroup() : page.getDataGroup()) : ""; } String temp = this.getFunctionParm(page.getParms(), s1, env); if (!"".equalsIgnoreCase(temp)) temp = "(" + temp + ")"; else temp = "()"; String tableName = page.getTableName(); if (tableName.indexOf("dbo.") == -1 || tableName.indexOf("DBO.") == -1) tableName = "dbo." + tableName; if (flg) {// 为了取页数增加的处理 String sql = "select count(1) as p from " + tableName + temp + s2 + ((page.getOrderBy() == null || page.getOrderBy().length() == 0) ? "" : (page.getOrderBy().toLowerCase().indexOf("order by") > -1) ? page.getOrderBy() : " order by " + page.getOrderBy()); List> list = this.jdbcTemplate.queryForList(sql); int num = (Integer) (((Map) list.get(0)).get("p")); if (num <= page.getPageSize()) page.setTotalPageNum(1); else page.setTotalPageNum((int) Math.ceil((double) num / page.getPageSize())); return page; } else { // 修正为18类型也可以只取指定的记录数,通过新的分页函数 page.setTableName(tableName + temp); page.setWhere(s2.replace("where", "").equalsIgnoreCase("") ? " 1=1 " : s2.replace("where", "")); page.setOrderBy(((page.getOrderBy() == null || page.getOrderBy().length() == 0) ? "" : (page.getOrderBy().toLowerCase().indexOf("order by") > -1) ? page.getOrderBy().replace("order by", "") : page.getOrderBy())); // page.setTbCols(this.proccTbCols(page)); page.setEnv(env); // return this.loadAll(page); if (page.getFlag() == 2 || (page.isNull && page.getFlag() != 1) || (page.getFlag() != 1 && page.getWhere().length() == 0)) page.setWhere("1=2"); if (page.getWhere().trim().indexOf("and") == 0) page.setWhere("1=1 " + page.getWhere()); String newTbCols=""; if(StringUtils.isNotBlank(page.getTbCols())){ String tbCols=page.getTbCols(); try { tbCols = EncodeUtil.base64Decode(tbCols); tbCols = tbCols.replaceAll("%2F", "/").replaceAll("%2B", "+"); } catch (UnsupportedEncodingException e) { throw new ApplicationException(e.getMessage()); } String[] strings = tbCols.split(","); int index1=0; for (String s : strings) { String[] str = s.split("#");// 分出每个统计的列 newTbCols+=str[0].toLowerCase()+"=#"+index1+";"; index1++; } page.setNewTbCols(newTbCols); } page.setTbCols(gridService.proccTbCols(page));//增加统计列功能 //page.setPageSize(100000);//不分页,因为所以都是动态生成,每分页一次都需要重新生成一次所有 //gridService.loadAll(page); //String pageFetch = " offset ((" + page.getPageNum() + "-1)*" + page.getPageSize() + ") rows\n fetch next " + page.getPageSize() + " rows only;";//分页功能 String orderby= ((page.getOrderBy() == null || page.getOrderBy().length() == 0) ? "" : (page.getOrderBy().toLowerCase().indexOf("order by") > -1) ? page.getOrderBy() : " order by " + page.getOrderBy()); String sql = "select " + page.getSql().toLowerCase() + ",ROW_NUMBER() OVER( "+orderby+") AS _rowno from " + tableName + temp + s2 + page.getGroupby(); List> list = this.jdbcTemplate.queryForList(sql+orderby); //取页脚本统计 String querySql = "select COUNT(1) as totalCount,CEILING((COUNT(1)+0.0)/" + page.getPageSize() + ") as pageCount," + (StringUtils.isNotBlank(page.getTbCols())? page.getTbCols():"''")+ " as tbCols from (" + sql + ")a"; Map query = this.jdbcTemplate.queryForMap(querySql); page.setTbColsOut(GridUtils.prossRowSetDataType_String(query, "tbCols")); page.setTotalPageNum(GridUtils.prossRowSetDataType_Int(query, "pageCount")); page.setTotalRowNum(GridUtils.prossRowSetDataType_Int(query, "totalCount")); */ gridService.loadAllByFunc(page,env,false); //取字段对齐,数字格式 String sql1 = "select fieldid,cellAlign,displayformat FROM _sysStatisDetail where formID=" + formID + " AND statisID=" + "'" + statisID + "'" + ""; List> list1 = this.jdbcTemplate.queryForList(sql1); //处理成Map结构方便后面组装 Map> resultMap=new HashMap<>(); if(list1!=null&&list1.size()>0){ for(Map objectMap:list1){ String id=GridUtils.prossRowSetDataType_String(objectMap,"fieldID").toLowerCase(); int indexd= id.toLowerCase().lastIndexOf("as"); if(indexd>0) { id = id.substring(indexd + 2, id.length()).trim(); } // objectMap.remove("fieldID"); resultMap.put(id,objectMap); } } page.setData(page.getData()); page.setResultMap(resultMap); return page; //} } public void setFunLoadList(JsonArray fun, boolean isNew,PanelBean panelBean) { if (isNew) { panelBean.funLoadList = new JsonArray(); } else { panelBean.funLoadList.add(fun); } } public void setFunList(String fun, boolean isNew,PanelBean panelBean) { if (isNew) { panelBean.funList = new ArrayList(); } else { panelBean.funList.add(fun); } } /** * 生成设置的类型控件 筛选面板获得 */ public String get(Map map) throws Exception { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); panelBean.tabindexIs++; String id=panelBean.pHelper.id; String returnStr = ""; panelBean.getBackStr = getMassterCodeKeyDown(map, true); String fun=""; switch (DBHelper.getValueInt(map, "ControlType")) { case 1: // 文本框(text控件) fun = "getText('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')"; setFunList(fun, false,panelBean); returnStr = getText(map, true); break; case 2: // 下拉列表(select控件) // 给集合添加函数 fun = "getSelect('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')"; setFunList(fun, false,panelBean); returnStr = getOptions(map);// 有处理sql的函数,解决 break; case 3:// 弹出选择框 isTreeMus(map); fun = "getText('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')"; setFunList(fun, false,panelBean); returnStr = getShowFrom(map, true); break; case 5:// 日期选择 panelBean.pHelper.linkJsDate = "";// fun = "getBetweenDate('" + id + "','beginday','endday')"; setFunList(fun, false,panelBean); returnStr = getDate(map, true); break; case 6:// 复选框(check控件:单选项,只能选择1个打√) fun = "getCheck('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')"; setFunList(fun, false,panelBean); returnStr = getCheckBox(map, true); break; case 30:// 复选框(check控件:多选项,能选择多个打√) // 给集合添加函数 fun = "getCheckList('" + id + "','" + id + "Check','" + DBHelper.getValue(map, "CompSingle") + "')"; setFunList(fun, false,panelBean); returnStr = getCheckBoxList(map); break; case 31:// 下拉列表+SQL(select控件+SQL动态列表) // 给集合添加函数 fun = "getSelect('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')"; setFunList(fun, false,panelBean); returnStr = getOptionsSql(map);// 有处理sql的函数,解决 break; case 32:// 单选框(radio控件:多选项值,但只能选择一个) // 给集合添加函数Radio fun = "getRadio('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')"; setFunList(fun, false,panelBean); returnStr = getRadio(map);// 有处理sql的函数,解决 break; case 33:// 多功能搜索控件(文本框+下拉列表框[多字段列表]) // 给集合添加函数 fun = "multifunctional('valueis','colis','jqcz','" + DBHelper.getValue(map, "CompSingle") + "')"; setFunList(fun, false,panelBean); returnStr = getTextAndSelect(map);// //有处理sql的函数,解决 break; case 35:// 录入+下拉组合框 fun = "getSelect('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')"; setFunList(fun, false,panelBean); returnStr = getOptionEdit(map, true); break; default: break; } return returnStr; } /** * 生成页面需要的控件 获得面板显示(多数在这个方法获取控件) */ public String getComponentForPanel(Map sys, boolean shuai, Map listmax) throws Exception { PanelBean panelBean= (PanelBean) sys.get(PANEL_INFO); String type = null; try { // 查出当前窗体类型,以便处理496多表的情况, type = gridService.getSimpleJdbcTemplate().queryForObject("select formtype from _sysmenu where formid=?", new Object[] { sys.get("formid") }, String.class); } catch (Exception e) { } String id=panelBean.pHelper.id; if (id.trim().equals("")) { return "";// 无字段ID不生成控件 } if (!DBHelper.getValue(sys, "SqlScript").equals("")) { String sqlContype = ""; sqlContype ="$(function(){"; if(DBHelper.getValueInt(sys, "ControlType") != 43){ sqlContype +="getControlValue('" + id + "'," + DBHelper.getValueInt(sys, "ControlType") + ",'" + id + "','" + DBHelper.getValueInt(sys, "FT") + "','@index@');"; }else{ sqlContype +="getSelect2('" + id + "'," + DBHelper.getValueInt(sys, "ControlType") + ",'" + id + "','" + DBHelper.getValueInt(sys, "FT") + "','@index@','"+getControls(sys)+"');"; } sqlContype+="})"; panelBean.sqlContype=sqlContype; }else{ panelBean.sqlContype=""; } if (!DBHelper.getValue(sys, "dyfieldview").equals("")) { panelBean.dyfieldStr = "dyfield_view('" + panelBean.initialValue.getValRep(DBHelper.getValue(sys, "dyfieldview"), false) + "');"; } else { panelBean.dyfieldStr = ""; } if (listmax != null) { // 处理控件的输入长度 try { if (listmax.get(id) != null) {// 一一对应 panelBean.maxl = "maxLength=\"" + listmax.get(id) + "\" onkeyup=\"while(value.replace(/[^\\\\x00-\\\\xff]/g, '**').length>maxLength)value=value.slice(0,-1)\""; } else { panelBean.maxl = ""; } // 如果不存在就把maxl清空 防止出错。2014-8-30 } catch (Exception e) { panelBean.maxl = ""; } } panelBean.tabindexIs++;// 每次调用是把tabindex上升一个次序 String returnStr = ""; panelBean.getBackStr = getMassterCodeKeyDown(sys, shuai); String buttonStr = getButtonNext(sys);// 通过,驳回,下一步 等等的审核 boolean isTabs=(DBHelper.getValue(sys, "tabs38").equals("null")?false:true);//判断是否是面板上的选项卡控件-xin 2018-11-5 15:19:22 // double hei = 0; PanelParmHelper pHelper=panelBean.pHelper; switch (DBHelper.getValueInt(sys, "ControlType")) { case 1: // 文本框(text控件) returnStr = getText(sys, shuai); break; case 2: // 下拉列表(select控件) returnStr = getOptions(sys); break; case 3: // 弹出选择框 isTreeMus(sys); returnStr = getShowFrom(sys, shuai); break; case 5:// 日期选择 pHelper.linkJsDate = "";// returnStr = getDate(sys, shuai); break; case 6:// 复选框(check控件:单选项,只能选择1个打√) returnStr = getCheckBox(sys, shuai); break; case 7:// 弹出式文本编辑框 returnStr = getShowText(sys, shuai, listmax); break; case 10:// 金钱框---以输入框先代替 returnStr = getText(sys, shuai); break; case 9:// 图片预览 case 19:// 上传附件按钮 returnStr=this.createFileUPload(sys); if(DBHelper.getValueInt(sys, "ControlType")==19){ pHelper.seqtypefilde="19;"+id;//19类型控件面板需要用到 } break; case 30:// 复选框(check控件:多选项,能选择多个打√) panelBean.clickStr = "cheeckSToValue('" + id + "');"; returnStr = getCheckBoxList(sys); panelBean.clickStr = ""; break; case 31:// 下拉列表+SQL(select控件+SQL动态列表) returnStr = getOptionsSql(sys);// 有处理sql的函数,解决 break; case 32:// 单选框(radio控件:多选项值,但只能选择一个) returnStr = getRadio(sys);// 有处理sql的函数,解决 break; case 33:// 多功能搜索控件(文本框+下拉列表框[多字段列表]) returnStr = getTextAndSelect(sys);// //有处理sql的函数,解决 break; case 34:// 区域录入提示信息 String panStyle = "style=\"font-family: '黑体';font-size: 18px;\""; String invString = DBHelper.getValue(sys, "styleCss"); panStyle = invString.trim().equals("") ? panStyle : invString; returnStr += "" + DBHelper.getValue(sys, "fieldname") + "";// 只显示描述控件,设置占用一行 break; case 35:// 录入+下拉组合框 returnStr = getOptionEdit(sys, shuai); break; case 36:// 自定义HTML try { returnStr = "
"; pHelper.customHTMLList = systemSettingsDao.getCustomHTML(pHelper.formIdPan, id); for (int i = 0; i < pHelper.customHTMLList.size(); i++) { returnStr += pHelper.customHTMLList.get(i).get("htmlcontent").toString().replaceAll("\\\\", ";pbZhuan#"); } returnStr += "
"; } catch (Exception e) { e.printStackTrace(); } break; case 37:// 富文本框控件 int height = (pHelper.rowHei) * DBHelper.getValueInt(sys, "HeightNum"); if (pHelper.formTypePan != 496 || pHelper.formTypePan != 497) { pHelper.linkJsFu = "\n"; pHelper.linkJsFu += "\n"; } returnStr += "\n
"; returnStr += "\n"; break; case 38:// 控件分组显示 // hei = (pHelper.rowHei) * DBHelper.getValueInt(sys, "HeightNum"); String z_index=(isTabs?"margin-top:15px;margin-left:6px;position:absolute;z-index:0;":"margin-top:12px;margin-left:3px;position:absolute;z-index:-1;"); returnStr += "
" + "" + DBHelper.getValue(sys, "fieldname") + "
";// px;margin-top:2px; // 对面板控件边框的高度控制设置 panelBean.xuan = ""; if(isTabs && DBHelper.getValueInt(panelBean.control38height, DBHelper.getValue(sys, "tabsheetname"))==0) { panelBean.control38height.put(DBHelper.getValue(sys, "tabsheetname"),(DBHelper.getValueInt(sys, "RowNo")+DBHelper.getValueInt(sys, "HeightNum"))); } break; case 39:// 控件分组显示 int hei39 = pHelper.rowHei * DBHelper.getValueInt(sys, "HeightNum"); returnStr = ""; break; case 40:// 图片浏览控件 -xin 2020-6-15 17:24:07 int w=116*DBHelper.getValueInt(sys, "LengthNum"); int h=pHelper.rowHei * DBHelper.getValueInt(sys, "HeightNum"); pHelper.linkJsFu = "\n\">"; pHelper.linkJsFu += "\n"; pHelper.linkJsFu += "\n"; returnStr += "
" + "
    " + "
" ; // "\""+DBHelper.getValue(sys,"; // returnStr+=""; break; case 41:// 标签(label) String secc = "style=\"font-size: 16px;\""; String sytlep = DBHelper.getValue(sys, "styleCss"); secc = sytlep.trim().equals("") ? secc : sytlep; returnStr = "";//DBHelper.getValue(sys, "fieldname") break; case 42:// 文本框+录入时动态下拉提示选择框 returnStr = getShowFrom42(sys, shuai); break; case 43:// 下拉列表复选框 returnStr = getSelect43(sys, shuai); break; default: returnStr = getText(sys, shuai);// 有些控件类型暂无用此替代 break; } returnStr = "" + returnStr + ""; if (!DBHelper.getValue(sys, "HyperlinkFT").equals("")) { returnStr += ""; } if (panelBean.hasButton) {//有审核按钮(旧) returnStr = "
" + returnStr + "" + buttonStr + "
";// valign=\"top\" } getPermission(sys); if (DBHelper.getValueInt(sys, "calcuField") == 1) {// 触发公式 pHelper.gongsiCols += id + ";"; } if (!DBHelper.getValue(sys, "formula").equals("")) { pHelper.gongsiStr = id + "=" + DBHelper.getValue(sys, "formula") + ";"; } panelBean.maxl = "";// 清空该控件的输入长度,防止对 下一个控件的输入长度造成影响 return "" + returnStr + "" + getKeyInput(sys); } /** * 1类型控件。文本框(text控件) * * @param map * @param shuai * @return * @throws Exception */ private String getText(Map map, boolean shuai) throws Exception { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String str = ""; String id=panelBean.pHelper.id; String maxl=panelBean.maxl; if (shuai) { str = " 1) { int num=(panelBean.hasButton?DBHelper.getValueInt(map, "LengthNum")-1:DBHelper.getValueInt(map, "LengthNum")); str1 = ""; } else { str1 = " mapW) throws Exception { PanelBean panelBean= (PanelBean) mapW.get(PANEL_INFO); String id=panelBean.pHelper.id; String selectStr = ""; if (DBHelper.getValue(mapW, "SqlScript") == null || DBHelper.getValue(mapW, "SqlScript").trim().equals("")) { selectStr = ""; // 清除第一个默认值 selectStr += getSelectfun(getJspValue(id), id); } else { selectStr += getOptionsSql(mapW); } return selectStr; } private String getJspValue(String id) { return "<%=DBHelper.getValue(docMap,\"" + id + "\",mapAll)%>"; } /** * 3类型控件调用 * @param map * @throws Exception */ private void isTreeMus(Map map) throws Exception { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); switch (DBHelper.getValueInt(map, "FTFormType")) { case 302: panelBean.treeMus = true; break; default: panelBean.treeMus = false; break; } } /** * 3类型控件。弹出选择框 * * @param map * @param shuai * @return * @throws Exception */ private String getShowFrom(Map map, boolean shuai) throws Exception { String s_ = ""; PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; String maxl=panelBean.maxl; s_ += getReadOnly(map); // 是否只读 String getdiv = ""; String isControl42Css="";//是否也是42控件查询功能需要的样式 if (!DBHelper.getValue(map, "SuggestFileds").equals("")) {// 42类型控件js int rod = (int) (Math.random() * 100 + 1);// 生成100之内的随机数 String divId="T_"+DBHelper.getValue(map, "ft")+"_"+rod+"div"; String tableId="T_"+DBHelper.getValue(map, "ft")+"_"+rod+"CDiv"; panelBean.pHelper.div42="\t\n"; //添加data-xxx属性 xin 2021-3-17 15:54:36 getdiv="data-index=\"@index@\" data-rod=\""+rod+"\" data-relation=\""+DBHelper.getValue(map, "RelationField")+"\" data-sugges=\""+DBHelper.getValue(map, "SuggestFileds")+"\""; isControl42Css="isControl42";//赋固定值样式 // getSuggestFilds(DBHelper.getValue(map, "ft"), 0, DBHelper.getValue(map, "SuggestFileds"), // DBHelper.getValue(map, "SuggestFileds"), DBHelper.getValue(map, "SeekGroupID"), // DBHelper.getValue(map, "FK"), rod); // String col = DBHelper.getValue(map, "ft") + "#" + DBHelper.getValue(map, "fk") + "#" // + DBHelper.getValue(map, "SeekGroupID") + "#" + DBHelper.getValue(map, "SuggestFileds") + "#" // + DBHelper.getValue(map, "RelationField"); // getdiv = "getDiv42.ShowDivForPanel(document.getElementById('" + id + "'),'" + col // + "','" + DBHelper.getValue(map, "ft") + "','" + rod + "',@index@);"; // s_ += " onkeyup=\"" + getdiv + "\""; // s_ += " onkeydown=\"delemptyrefdata(document.getElementById('" + id + "'),@index@)\" "; // 键盘按下处理 // s_ += " onclick=\"try{getDiv42.closediv(document.getElementById('T_" + DBHelper.getValue(map, "ft") + "_" // + rod + "div'),'T_" + DBHelper.getValue(map, "ft") + "_" + rod + "div');}catch(e){}\""; } else {// 3类型控件 String getAll = panelBean.getBackStr + ((panelBean.keyBack) ? "keyDown('" + id + "',event);" : ""); String getAllChan = panelBean.getBackStr + ((panelBean.toKeBack) ? "keyDown('123',event);" : "");// --getBackStr // + // 不需要触发这个事件 // 2015-3-12 // 10:07:37 String getChan = ((panelBean.toKeBack) ? "keyDown('123',event);" : ""); s_ += " onPropertyChange=\"upSub('" + id + "');" + getChan + panelBean.dyfieldStr + "\" "; // 值发生改变处理 s_ += " onchange=\"getBackElse=true;" + getAllChan + "upSub('" + id + "');\""; s_ += " onkeydown=\"" + getAll + "delemptyrefdata(document.getElementById('" + id + "'),@index@);\" "; // 键盘按下处理 } String str = ""; int flag=-1; boolean bol=false; //是否有会计科目设置 xin 2020-11-6 10:44:28 if(!Objects.equals("", DBHelper.getValue(map, "glcodefield")) && (id.toLowerCase().matches("cv\\d{1}") || id.toLowerCase().matches("cv\\d{1}name"))) { try { Pattern p = Pattern.compile("[^0-9]"); Matcher m = p.matcher(id); flag = Integer.parseInt(m.replaceAll("").trim()); bol=true; } catch (Exception e) { flag = -1; } } if (DBHelper.getValueInt(map, "HeightNum") > 1) { str += ""; } else { str += ""; } String style=""; if(!DBHelper.getValue(map, "tabs38").equals("null")){ //margin-left:"+((256*DBHelper.getValueInt(map, "LengthNum"))-12-8-116-16)+"px; style="position:absolute;z-index:1;margin-top:2px;"; }else { int i=(DBHelper.getValueInt(map, "Hidelabel")==1?0:116); style="display:block;margin-left:"+(256*DBHelper.getValueInt(map, "LengthNum")-22-i)+"px;position:absolute;margin-top: -"+((DBHelper.getValueInt(map, "HeightNum")*29.2)-2-5.2)+"px;"; } str += ""//position: absolute; 加上的话在2 3窗体显示会出现问题 + ""; return str; } /** * 5类型控。日期选择 * * @param map * @param shuai * @return * @throws Exception */ private String getDate(Map map, boolean shuai) throws Exception { String str = ""; String dateForm = ""; PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; if (shuai) { str = "从" + " 到 "; } else { if (!DBHelper.getValue(map, "Displayformat").equals("")) { dateForm = "showDate('" + id + "',true,'" + DBHelper.getValue(map, "Displayformat") + "')"; } else { dateForm = "showDate('" + id + "',true,'')"; } str = " map, boolean shuai) throws Exception { String str = ""; PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; String checkId = id + "CheckBox"; String css=""; // if(panelBean.control38height>DBHelper.getValueInt(map, "RowNo")){ // css="z_indexTabs"; // }else{ // panelBean.control38height=0; // } str = " "; str = getAll(map, str, shuai); str += " onClick=\"document.getElementById('" + id + "').value=document.getElementById('" + checkId + "').checked ? '1' : '0' ;" + panelBean.clickStr + "\" />" + ""; return str; } /** * 7类型控件。弹出式文本编辑框 * @param map * @param shuai * @param listmax * @return * @throws Exception */ private String getShowText(Map map, boolean shuai, Map listmax) throws Exception { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; String str = ""; return str; } /** * 19、9类型上传附件按钮 * @param type * @return */ public String createFileUPload (Map map) { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; int ReadOnly=DBHelper.getValueInt(map, "ReadOnly");//只读设置 xin 2021-3-3 10:39:28 String upload="\n
\n" + " \n" //multiple 控制上传时可以点击多附件同时上传 + "\" type=\"hidden\" /> \n" + "
\n"; upload+=""; return upload; } /** * 30类型控件。复选框(check控件:多选项,能选择多个打√) * @param map * @return * @throws Exception */ private String getCheckBoxList(Map map) throws Exception { String returnStr = ""; PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; if (DBHelper.getValue(map, "SqlScript") == null || DBHelper.getValue(map, "SqlScript").trim().equals("")) { String sql = "select * from _sysdict where dictid = " + DBHelper.getValueInt(map, "FT"); returnStr = "" + "
    "; List> list = null; list = sqlDBHelperIfc.getHashMap(sql); int i = 0; for (HashMap mapR : list) { returnStr += "
  • " + mapR.get("dictvalue") + "
  •  "; i++; } returnStr += "
" + getCheckFun(id); } else { returnStr += "" + "
    <% outStr=\"\";"; returnStr += "\r\n int i_sql_checks=0;"; returnStr += "\r\n sql = \"" + DBHelper.replaceBr(panelBean.initialValue.getValLinShi(DBHelper.getValue(map, "SqlScript"), true)) + "\";"; returnStr += "\r\n SRS = build.getSqlRowSet(DBHelper.getValRepShi(sql,session,docMap, false));"; returnStr += "\r\n while(SRS.next()){ %>"; returnStr += "
  • \" value=\"<%=SRS.getString(1)%>\" class=\""+getControls(map)+"\" onclick=\"" + panelBean.clickStr + "\" style=\"width:20px;height:20px;\"><%=SRS.getString(2)%>
  •  "; returnStr += " <%i_sql_checks++;}%>
" + getCheckFun(id); } return returnStr; } /** * 31类型控。下拉列表+SQL(select控件+SQL动态列表) * * @param map * @return * @throws Exception */ private String getOptionsSql(Map map) throws Exception { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; String getBackStr=panelBean.getBackStr; boolean toKeBack=panelBean.toKeBack; String selectStr = ""; String getAll = getBackStr + ((panelBean.keyBack) ? "keyDown('" + id + "',event);" : ""); String getAllChan = getBackStr + ((toKeBack) ? "keyDown('123',event);" : ""); String getChan = ((toKeBack) ? "keyDown('123',event);" : ""); String sql = DBHelper.replaceBr(DBHelper.getValue(map, "SqlScript")); List list = DBHelper.getStrRepInfo(sql+DBHelper.replaceBr(DBHelper.getValue(map, "SqlWhere")), "&"); if(list!=null && list.size()>0) { HashSet set = new HashSet(list); for(String key:set) { key=key.toLowerCase(); panelBean.selectMap.put(key, id+(panelBean.selectMap.get(key)!=null?";"+panelBean.selectMap.get(key):"")); } } if ((DBHelper.getValueInt(map, "FT") < 0 && (DBHelper.getValueInt(map, "ControlType") == 2) || ("").equals(sql))) {//2类型控件 sql = "select intervalue,dictvalue from _sysdict where dictid =" + DBHelper.getValueInt(map, "FT") + " order by sequence asc"; } selectStr += "\r\n<%try{"; selectStr += "\r\n sql = \"" + sql + "\";"; if(!"".equals(DBHelper.getValue(map, "SqlWhere"))) { boolean b=false;//默认组装进行 b=(DBHelper.getValueInt(map, "ReadOnly") == 1?true:b);//只读状态不需要组装 selectStr += "\r\n sql = DBHelper.getSqlWhere(sql,"+b+",\""+DBHelper.getValue(map, "editStatus")+"\",DBHelper.getValue(docMap,\"docstatus\"),\""+DBHelper.replaceBr(DBHelper.getValue(map, "SqlWhere"))+"\");"; } selectStr += "\r\n SRS = build.getSqlRowSet(DBHelper.getValRepShi(sql,session,docMap, false));"; selectStr += "\r\n %>"; selectStr += "\r\n \r"; //onfocus=\"" + panelBean.clickStr // + "getControlValue('" + id + "'," + DBHelper.getValueInt(map, "ControlType") + ",'" + id + "','" // + DBHelper.getValueInt(map, "FT") + "','@index@');\" selectStr += ""; selectStr += "\r\n<%}catch(Exception e){"; selectStr += "\r\n throw e;"; selectStr += "\r\n}%>\r\n"; selectStr += getSelectfun(getJspValue(id), id); // selectStr += "\r\n"; return selectStr; } /** * 32类型控件。单选框(radio控件:多选项值,但只能选择一个) * * @param map * @return * @throws Exception */ private String getRadio(Map map) throws Exception { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; String returnStr = ""; if (DBHelper.getValue(map, "SqlScript") == null || DBHelper.getValue(map, "SqlScript").trim().equals("")) { String sql = "select * from _sysdict where dictid = " + DBHelper.getValueInt(map, "FT"); returnStr = ""; List> list = null; list = sqlDBHelperIfc.getHashMap(sql); int i = 0; for (HashMap mapR : list) { returnStr += "" + mapR.get("dictvalue") + "  "; i++; } returnStr += "" + getRadiosFun(id); } else { returnStr += "<% outStr=\"\";"; returnStr += "\r\n int i_sql_radio=0;"; returnStr += "\r\n sql = \"" + DBHelper.replaceBr(panelBean.initialValue.getValLinShi(DBHelper.getValue(map, "SqlScript"), true)) + "\";"; returnStr += "\r\n SRS = build.getSqlRowSet(DBHelper.getValRepShi(sql,session,docMap, false));"; returnStr += " while(SRS.next()){ "; returnStr += "if((\"" + panelBean.initialValue.getValLinShi(DBHelper.getValue(map, "initValue"), false) + "\").equals(SRS.getObject(2))||(\"" + panelBean.initialValue.getValLinShi(DBHelper.getValue(map, "initValue"), false) + "\").equals(SRS.getObject(1))){"; returnStr += " outStr += \" checked='checked' \";"; returnStr += "}else{outStr += \"\";}%>"; returnStr += " name=\"" + id + "Radio\" type=\"radio\" id=\"" + id + "_<%=i_sql_radio%>\" value=\"<%=SRS.getString(1)%>\" onclick=\"getRad('" + id + "')\"><%=SRS.getString(2)%>  "; returnStr += " <%i_sql_radio++;}%>"; returnStr += "" + getRadiosFun(id); } return returnStr; } /** * 33类型控件。多功能搜索控件(文本框+下拉列表框[多字段列表]) * @param map * @return * @throws Exception */ private String getTextAndSelect(Map map) throws Exception { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String selectStr = ""; selectStr += "  "; selectStr += "  "; selectStr += ""; selectStr += "\r\n精确查找" + getCheck("jqcz",panelBean) + "  查找"; //+ ""; // 清除第一个默认值 String showValue = panelBean.initialValue.getInv(map); if (!showValue.trim().equals("")) { selectStr += getSelectfun(showValue, "colis"); } return selectStr; } /** * 35类型控件。录入+下拉组合框 * @param mapW * @param shuai * @return * @throws Exception */ private String getOptionEdit(Map mapW, boolean shuai) throws Exception { String selectStr = ""; PanelBean panelBean= (PanelBean) mapW.get(PANEL_INFO); String id=panelBean.pHelper.id; int len = DBHelper.getValueInt(mapW, "tdLen") - 28; // 暂时用,没设置tdLen if (shuai) { len = 100; } if (DBHelper.getValue(mapW, "SqlScript") == null || DBHelper.getValue(mapW, "SqlScript").trim().equals("")) { selectStr = "
"; selectStr += "" + getSelectfun(getJspValue(id), id + "_35"); selectStr += "
"; } else { selectStr += "
" + getSelectfun(getJspValue(id), id + "_35"); } return selectStr; } /** * 42类型控件。文本框+录入时动态下拉提示选择框 * @param map * @param shuai * @return * @throws Exception */ private String getShowFrom42(Map map, boolean shuai) throws Exception { int rod = (int) (Math.random() * 1000 + 1);// 生成1000之内的随机数 PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; // panelBean.pHelper.div42 = getSuggestFilds(DBHelper.getValue(map, "ft"), 0, DBHelper.getValue(map, "SuggestFileds"), // DBHelper.getValue(map, "SuggestFileds"), DBHelper.getValue(map, "SeekGroupID"), // DBHelper.getValue(map, "FK"), rod); String divId="T_"+DBHelper.getValue(map, "ft")+"_"+rod+"div"; String tableId="T_"+DBHelper.getValue(map, "ft")+"_"+rod+"CDiv"; panelBean.pHelper.div42="\t\n"; String s_ = ""; s_ += getReadOnly(map); // 是否只读 // String col = DBHelper.getValue(map, "ft") + "#" + DBHelper.getValue(map, "fk") + "#" // + DBHelper.getValue(map, "SeekGroupID") + "#" + DBHelper.getValue(map, "SuggestFileds") + "#" // + DBHelper.getValue(map, "RelationField"); // String getAll = "getDiv42.ShowDivForPanel(document.getElementById('" + id + "'),'" + col // + "','" + DBHelper.getValue(map, "ft") + "','" + rod + "',@index@);"; // s_ += " onkeyup=\"" + getAll + "\""; // s_ += " onclick=\"try{getDiv42.closediv(document.getElementById('T_" + DBHelper.getValue(map, "ft") + "_" + rod // + "div'),'T_" + DBHelper.getValue(map, "ft") + "_" + rod + "div');closeOther();}catch(e){}\""; // s_ += " onkeydown=\"delemptyrefdata(document.getElementById('" + id + "'),@index@)\" "; // 键盘按下处理 //添加data-xxx属性 xin 2021-3-17 15:54:36 String data="data-index=\"@index@\" data-rod=\""+rod+"\" data-relation=\""+DBHelper.getValue(map, "RelationField")+"\" data-sugges=\""+DBHelper.getValue(map, "SuggestFileds")+"\""; String str = ""; if (DBHelper.getValueInt(map, "HeightNum") > 1) { str += ""; } else { str += ""; } return str; } /** * 43类型控件。下拉列表复选框 * * @param map * @param shuai * @return * @throws Exception */ private String getSelect43(Map map, boolean shuai) throws Exception { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String id=panelBean.pHelper.id; List list = DBHelper.getStrRepInfo(DBHelper.replaceBr(DBHelper.getValue(map, "SqlScript"))+DBHelper.replaceBr(DBHelper.getValue(map, "SqlWhere")), "&"); if(list!=null && list.size()>0) { HashSet set = new HashSet(list); for(String key:set) { key=key.toLowerCase(); panelBean.selectMap.put(key, id+(panelBean.selectMap.get(key)!=null?";"+panelBean.selectMap.get(key):"")); } } String select = "\r"; select += " <%}%>";// +"<%}%>";//<%if(docstatePan==DBHelper.getValueInt(atMap,\""+DBHelper.getValue(buttonMap, // "buttonID")+"\")){%> panelBean.hasButton = true; } } } if (panelBean.hasButton) { int tdLen = DBHelper.getValueInt(map, "tdLen") - 120; map.remove("tdLen"); map.put("tdLen", tdLen); } buttonStr = buttonStr.replace("@butwidth@", butwidht); buttonStr += "<%}%>";// <%}%> return panelBean.hasButton ? buttonStr : ""; } private String getMassterCodeKeyDown(Map map, boolean shuai) throws Exception {// 这有一定用,很多没有设置信息却又带回了值,依照这个解决 String iniv = DBHelper.getValue(map, "InitValue"); PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String reString = ""; String upinv = null; if (DBHelper.getValueInt(map, "FT") != 0) { reString = "(event,'" + panelBean.pHelper.id + "','@index@');"; if (iniv != null) { upinv = iniv.toUpperCase().trim(); reString = (("MASTERCODE".equals(upinv)) ? "getBackAll" : "getBack") + reString; } else { reString = "getBack" + reString; } } return reString; } public String getSelectAndCheckBox(String fieldid, String StatisID, String StatisType, String fieldCaption, PanelBean panelBean) throws Exception { panelBean.bian38++;// panelBean.pHelper.id = fieldid.toLowerCase();// "checkId__" + bian38; String checkId2 = panelBean.pHelper.id + "vulue"; // 复选框 String str = ""; str += "";// 后改 // by // danaus // 因为字段名有可能是自定义sql,会存在,号的情况 return str; } public String getSelectAndCheckBoxs(String s, String StatisID, String fieldid, String FieldAlias, String StatisType, String Sequence, String DisplayWidth, String displayformat, String displayYN, String isFilterZero, String jionFlag, String jionFlagGroup, String conFlag, String modfvalues, String modfvalues2, String FieldCaption,PanelBean panelBean) throws Exception { panelBean. bian38++;// panelBean.pHelper.id = fieldid.toLowerCase();// "checkId__" + bian38; // int a=0; String checkId2 = s; // 复选框 // a++; String str = ""; str += "";// 后改 // by // danaus // 因为字段名有可能是自定义sql,会存在,号的情况 return str; } public String getSelectAndCheckBoxss(String StatisID, String fieldid, String FieldAlias, String StatisType, String Sequence, String DisplayWidth, String displayformat, String displayYN, String isFilterZero, String jionFlag, String jionFlagGroup, String conFlag, String modfvalues, String modfvalues2, String FieldCaption, PanelBean panelBean) throws Exception { panelBean.bian38++;// panelBean.pHelper.id = fieldid.toLowerCase();// "checkId__" + bian38; String str = StatisID + "#P#" + fieldid + "#P#" + FieldAlias + "#P#" + StatisType + "#P#" + Sequence + "#P#" + DisplayWidth + "#P#" + displayformat + "#P#" + displayYN + "#P#" + isFilterZero + "#P#" + jionFlag + "#P#" + jionFlagGroup + "#P#" + conFlag + "#P#" + modfvalues + "#P#" + modfvalues2 + "#P#" + FieldCaption + "'";// 后改 by danaus // 因为字段名有可能是自定义sql,会存在,号的情况 return str; } /** * 给控件设置长高 * @param map * @return */ private String getControls(Map map) { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); String controls = (DBHelper.getValueInt(map, "Hidelabel") == 1 ? "controlsm" : "controlsc"); controls += DBHelper.getValueInt(map, "LengthNum"); controls += " AllControlsWH"; if (DBHelper.getValueInt(map, "ControlType") == 38) { controls += " controlsd"+DBHelper.getValueInt(map, "HeightNum"); } else { controls += ((DBHelper.getValueInt(map, "ControlType") == 9 || DBHelper.getValueInt(map, "ControlType") == 19 ) ? "" : " controlsr" + DBHelper.getValueInt(map, "HeightNum")); } //在选页卡里面的控件需要添加这个css-xin 2018-11-5 15:20:33 if(!DBHelper.getValue(map, "tabs38").equals("null")){ int i=DBHelper.getValueInt(panelBean.control38height, DBHelper.getValue(map, "tabsheetname")); if(i>0 && DBHelper.getValueInt(map, "RowNo")0 && DBHelper.getValueInt(map, "RowNo")==i) { controls+=" jiaNum"; } } return controls; } /** * 精准查找 * @param ids * @return * @throws Exception */ private String getCheck(String ids,PanelBean panelBean) throws Exception { String str = ""; String checkId = ids + "CheckBox"; str += "" + ""; return str; } /** * 42类型控件调用到 * sugg--列表显示的字段 backFilds-取外表字段,以便选择后返回哪些值。 tp ---自表字段,返回给哪些字段 */ public String getSuggestFilds(String ft, int type, String sugg) {// 取得需要的字段名称 int flg = this.setGetPrivaryTable(type); List> suglit = new ArrayList<>(); try { String sql = " select FieldID,fieldname,GridCaption,ShowOnGrid from gfield where formid=? and HeadFlag=? order by statisid asc"; List> list = gridService.getSimpleJdbcTemplate().queryForList(sql, new Object[] { ft, flg }); String[] tem = sugg.replaceAll(",", ";").split(";"); for (String sug : tem){ for (Map map : list) { if (sug.equalsIgnoreCase((String) map.get("FieldID"))) { Map sugMap = new HashMap<>(); sugMap.put("field", sug.toLowerCase()); sugMap.put("title", map.get("fieldname") == null ? (String) map.get("GridCaption") : (String) map.get("fieldname")); // sugMap.put("width", 150); sugMap.put("align", "center"); if (GridUtils.prossRowSetDataType_Int(map, "ShowOnGrid") <= 0) { sugMap.put("hide", true);//隐藏 } suglit.add(sugMap); } } } return "data-title=\""+GridUtils.toJson(suglit).replaceAll("\"", "'")+"\" "; }catch (Exception e){ return ""; } // for (String s : tem) { // for (Map map : list) { // if (s.equalsIgnoreCase((String) map.get("FieldID"))) { // if (GridUtils.prossRowSetDataType_Int(map, "ShowOnGrid") > 0) // sb.append("").append(map.get("fieldname") == null // ? (String) map.get("GridCaption") : (String) map.get("fieldname")).append(""); // else { // if (str == "") // str += map.get("FieldID"); // else // str += ";" + map.get("FieldID"); // sb.append("").append(map.get("fieldname") == null // ? (String) map.get("GridCaption") : (String) map.get("fieldname")).append(""); // } // break; // } // } // } // String json = "{\"data\":\";" + str + ";\",\"backfilds\":\"" + backFilds + "\",\"to\":\"" + to // + "\",\"form\":\"" + form + "\",\"one\":\"0\"}"; // return "\t\n"; } /** * 根据窗体类型取得应当读取哪一个表的数据. * * **/ private synchronized int setGetPrivaryTable(int winType) { switch (winType) { case 5: case 9: case 2: case 30: case 301: case 10: case 19: case 304: return 1;// 从表 case 8:// 三表 return 2; default: return 0; } } private String getSelectfun(String showValue, String kongId) throws Exception { return getScriptFun("seletMorenOrValue('" + showValue + "','" + kongId + "');");// 转换一个函数,避免与页面逻辑共用一个函数出错 } private String getCheckFun(String kongId) throws Exception { return getScriptFun("cheeckSValueChan('" + kongId + "');"); } private String getRadiosFun(String id) throws Exception { return getScriptFun("radioValueChan('" + id + "');"); } private String getScriptFun(String fun) throws Exception { return "\r\n";//language=\"javascript\" } // ----------------map private String getAll(Map sys, String str, boolean shuai) throws Exception { PanelBean panelBean=(PanelBean)sys.get(PANEL_INFO); if (shuai) { str += getReadOnly(sys); // 是否只读 str += getKeyDown(panelBean); // 键盘按下处理 } else { str += getReadOnly(sys); // 是否只读 str += getChange(panelBean); // 值发生改变处理 str += getKeyDown(panelBean); // 键盘按下处理 } return str; } private String getChange(PanelBean panelBean) throws Exception { String yanZheng = "";// 添加验证脚本 yanZheng = getVerification(panelBean).trim(); String str = " onPropertyChange=\"" + yanZheng + panelBean.dyfieldStr + "upSub('" + panelBean.pHelper.id + "');\" onChange=\"" + yanZheng + "upSub('" + panelBean.pHelper.id + "');\""; return str; } private String getVerification(PanelBean panelBean) throws Exception { String yanZheng = ""; if (panelBean.pHelper.verificationMap != null && panelBean.pHelper.verificationMap.size() > 0) { if (panelBean.pHelper.verificationMap.get(panelBean.pHelper.id) != null) { switch (Integer.parseInt(panelBean.pHelper.verificationMap.get(panelBean.pHelper.id))) { case 1:// 数字 yanZheng = "math(/^[-]?[0-9]*[.]?[0-9]*$/,'" + panelBean.pHelper.id + "','输入必须数字');"; break; case 2:// 表示text,ntext,image之类 break; case 3:// 字符 break; case 4:// 日期 break; default: break; } } } return yanZheng; } private String getKeyDown(PanelBean panelBean) throws Exception { return (panelBean.keyBack) ? " onkeydown=\"keyDown('" + panelBean.pHelper.id + "',event);\" " : ""; } /** * 只读 * @param map * @return * @throws Exception */ private String getReadOnly(Map map) throws Exception { PanelBean panelBean= (PanelBean) map.get(PANEL_INFO); PanelParmHelper pHelper = panelBean.pHelper; int hei = pHelper.rowHei * DBHelper.getValueInt(map, "HeightNum"); hei = ((pHelper.kongHei != pHelper.rowHei && DBHelper.getValueInt(map, "HeightNum") != 1) ? 2 * hei - pHelper.rowHei - 6 : hei) - 6; String str = "style=\""; if (DBHelper.getValue(map, "styleCss").indexOf("!") != -1) { } else { String fenh = DBHelper.getValue(map, "styleCss"); if (!"".equals(fenh)) { boolean bol = (fenh.substring(fenh.length() - 1, fenh.length()).indexOf(";") != -1); str += DBHelper.getValue(map, "styleCss") + (bol ? "" : ";"); } else { str += fenh; } } if (DBHelper.getValueInt(map, "uppercase") == 1) {// 大写形式输入 str += " text-transform: uppercase;"; } if(DBHelper.getValueInt(map, "ControlType")==31 || DBHelper.getValueInt(map, "ControlType")==2){ str += "height:24px;"; } if (DBHelper.getValueInt(map, "ReadOnly") == 1) { panelBean.tabindexIs--;// 只读tabindex还原 if (DBHelper.getValue(map, "styleCss") == "" || DBHelper.getValue(map, "styleCss") == null) { str += " background:#CCC; border:#999 1px solid; color:#000;\" readonly=\"readonly\" ";// } else { if (DBHelper.getValue(map, "styleCss").indexOf("background") != -1) { } else { str += " background:#CCC; "; } if (DBHelper.getValue(map, "styleCss").indexOf("border") != -1) { } else { str += "border:#999 1px solid; "; } if (DBHelper.getValue(map, "styleCss").indexOf("color") != -1) { } else { str += "color:#000;"; } str += " readonly=\"readonly\""; } } else { str += " \" tabindex=\"" + panelBean.tabindexIs + "\""; } return str; } /** * * * 38类型面板上增加的下拉编码实现 * * @param colId * 列名 * @param ft * 设置下拉到外表id * @param invalue * 给定的初始值(默认选择项) * @return 下拉的网页编码 */ public String getOptions(String colId, int ft, String invalue) throws Exception { String selectStr = ""; return selectStr; } /** * 是否必录 * @param map * @return * @throws Exception */ private static String getKeyInput(Map map) throws Exception { String style=""; if(!DBHelper.getValue(map, "tabs38").equals("null")){ style="style=\"margin-left:"+((256*DBHelper.getValueInt(map, "LengthNum"))-12-8)+"px;position:absolute;\""; } return (DBHelper.getValueInt(map, "KeyInput") == 1? "
":"
"); } // 得到隐藏网页代码 public String getHidText(Map sys) throws Exception { PanelBean panelBean= (PanelBean) sys.get(PANEL_INFO); getPermission(sys); if ((DBHelper.getValueInt(sys, "isCustomHTMLComponent") == 1 && DBHelper.getValueInt(sys, "MasterFieldShowLocation") == 0)) { return "";// 因为是36控件字段 ,不输出控件,如果不在第二个面板则输出 } return ""; } // 得到_expr隐藏网页代码 public String getHidTextexpr(Map sys) throws Exception { PanelBean panelBean= (PanelBean) sys.get(PANEL_INFO); String id=panelBean.pHelper.id; getPermission(sys); if ((DBHelper.getValueInt(sys, "isCustomHTMLComponent") == 1 && DBHelper.getValueInt(sys, "MasterFieldShowLocation") == 0)) { return "";// 因为是36控件字段 不输出控件,如果不在第二个面板则输出 } String inp = ""; if (!DBHelper.getValue(sys, "showfieldvalueexpression").equals("")) { inp += ""; } if (!DBHelper.getValue(sys, "stylecss").equals("")) { inp += ""; } return inp; } }