xinyb
2024-03-20 4885f794b55c8beb28d7f3d89dedee84f423145e
提交 | 用户 | age
a6a76f 1 package com.yc.service.panel.v2;
F 2
3 import com.google.gson.JsonArray;
4 import com.yc.action.grid.GridUtils;
839a7f 5 import com.yc.exception.ApplicationException;
a6a76f 6 import com.yc.service.BaseService;
F 7 import com.yc.service.grid.GridServiceIfc;
8 import com.yc.service.impl.DBHelper;
9 import com.yc.service.panel.GetDataTypeIfc;
10 import com.yc.service.panel.PanelParmHelper;
11 import com.yc.service.panel.SqlDBHelperIfc;
12 import com.yc.service.panel.SystemSettingsDao;
839a7f 13 import com.yc.utils.EncodeUtil;
a6a76f 14 import com.yc.utils.JOSNUtils;
F 15 import com.yc.utils.Page;
839a7f 16 import org.apache.commons.lang3.StringUtils;
a6a76f 17 import org.springframework.beans.factory.annotation.Autowired;
F 18 import org.springframework.stereotype.Service;
19
839a7f 20 import java.io.UnsupportedEncodingException;
a6a76f 21 import java.util.*;
F 22 import java.util.regex.Matcher;
23 import java.util.regex.Pattern;
24
25 /**
26  * 生成控件显示在网页上的代码 原先在这段URL(http://的路径不再传进) 而URL真正得到信息是在生产JSP后运行才得到,保证这路径绝对正确
27  *
28  * @author pengbei
29  *
30  */
31 @Service("TypeControlV2")
32 public class TypeControl extends BaseService implements TypeControlDao {
33     @Autowired
34     SqlDBHelperIfc sqlDBHelperIfc;
35     @Autowired
36     SystemSettingsDao systemSettingsDao;
37     @Autowired
38     GetDataTypeIfc getDataTypeIfc;
39     @Autowired
40     private GridServiceIfc gridService;// 表格处理的业务类
41
42     public  static  String  PANEL_INFO="panel_info";
43     private String getFunctionParm(String st, String parms, Map<String, String> env) {
44         parms = JOSNUtils.prossBase64(parms);
45         if ("".equalsIgnoreCase(st))
46             return "";
47         if ("".equalsIgnoreCase(parms))
48             return "";
49         StringBuilder sb = new StringBuilder();
50         String[] temp = st.split(";");// 函数后面列出的参数,有可能包括数字,字符及参数名称
51         int i = 0;
52         String[] temp1 = parms.split("\\band\\b");
53         for (String str : temp) {
54             if (str.matches("\\d")) {// 只是数字
55                 if (i != 0)
56                     sb.append(",");
57                 sb.append(str);
58                 continue;
59             }
60             boolean fl = false;
61             for (String ss : temp1) {
62                 int index = 0;
63                 String cv1 = "";
64                 String cv2 = "";
65                 try {
66                     index = ss.indexOf("=");
67                 } catch (StringIndexOutOfBoundsException e) {
68                     index = 0;
69                 }
70                 cv1 = ss.substring(0, index);
71                 cv2 = ss.substring(index + 1);
72                 if (str.trim().equalsIgnoreCase(cv1.replaceAll("\\s", ""))) {
73                     if (i != 0)
74                         sb.append(",");
75                     sb.append("'null'".equalsIgnoreCase(cv2.replaceAll("\\s", "")) ? null : cv2);
76                     i++;
77                     fl = true;
78                     break;
79                 } else if (str.indexOf("@") > -1) {// 需要从session取值
80                     // @usercode|cltcode
81                     String[] sts = str.split("=");
82                     if (sts[1].trim().equalsIgnoreCase(cv1.replaceAll("\\s", ""))) {
83                         if (i != 0)
84                             sb.append(",");
85                         sb.append("'" + env.get(sts[0]) + "'");
86                         i++;
87                         fl = true;
88                         break;
89                     }
90                 }
91             }
92             if (!fl) {
93                 if (i != 0)
94                     sb.append(",");
95                 sb.append("'").append(str).append("'");
96                 i++;
97             }
98         }
99         return sb.toString();
100     }
101
102     public Page loadAllByFunc(Page page, Map<String, String> env, boolean flg, String statisID, int formID) {
103
839a7f 104         String newTbCols="";
F 105         if(StringUtils.isNotBlank(page.getTbCols())){
106             String tbCols=page.getTbCols();
107             try {
108                 tbCols = EncodeUtil.base64Decode(tbCols);
109                 tbCols = tbCols.replaceAll("%2F", "/").replaceAll("%2B", "+");
110             } catch (UnsupportedEncodingException e) {
111                 throw  new ApplicationException(e.getMessage());
a6a76f 112             }
839a7f 113             String[] strings = tbCols.split(",");
fb4bd7 114             int index1 = 0;
839a7f 115             for (String s : strings) {
F 116                 String[] str = s.split("#");// 分出每个统计的列
fb4bd7 117                 newTbCols += str[0].toLowerCase() + "=#" + index1 + ";";
839a7f 118                 index1++;
F 119             }
120             page.setNewTbCols(newTbCols);
a6a76f 121         }
fb4bd7 122         gridService.loadAllByFunc(page, env, false);
F 123         //取字段对齐,数字格式,长度
e23226 124         String sql1 = "select fieldid,cellAlign,cellAlign as appCellAlign,displayformat,displayWidth as gridlength FROM _sysStatisDetail where formID=" + formID + " AND statisID="
fb4bd7 125                 + "'" + statisID + "'" + "";
F 126         List<Map<String, Object>> list1 = this.jdbcTemplate.queryForList(sql1);
127         //处理成Map结构方便后面组装
128         Map<String, Map<String, Object>> resultMap = new HashMap<>();
129         if (list1 != null && list1.size() > 0) {
130             for (Map<String, Object> objectMap : list1) {
f49f98 131
fb4bd7 132                 String id = GridUtils.prossRowSetDataType_String(objectMap, "fieldID").toLowerCase();
f49f98 133                 final String[] byAsOfEnd = id.split("\\s*\\b(?i)as\\b\\s*");
F 134                 if (byAsOfEnd.length > 1) {
135                     id = byAsOfEnd[1];
136                 }
a6a76f 137                     resultMap.put(id,objectMap);
F 138                 }
139             }
140             page.setData(page.getData());
141             page.setResultMap(resultMap);
142             return page;
143         //}
144     }
145
146
147
148
149     public void setFunLoadList(JsonArray fun, boolean isNew,PanelBean panelBean) {
150         if (isNew) {
151             panelBean.funLoadList = new JsonArray();
152         } else {
153             panelBean.funLoadList.add(fun);
154         }
155     }
156
157
158     public void setFunList(String fun, boolean isNew,PanelBean panelBean) {
159         if (isNew) {
160             panelBean.funList = new ArrayList<String>();
161         } else {
162             panelBean.funList.add(fun);
163         }
164     }
165
166     /**
167      * 生成设置的类型控件 筛选面板获得
168      */
169     public String get(Map<String, Object> map) throws Exception {
170         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
171         panelBean.tabindexIs++;
172         String id=panelBean.pHelper.id;
173         String returnStr = "";
174         panelBean.getBackStr = getMassterCodeKeyDown(map, true);
175         String fun="";
176         switch (DBHelper.getValueInt(map, "ControlType")) {
177             case 1: // 文本框(text控件)
178                 fun = "getText('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')";
179                 setFunList(fun, false,panelBean);
180                 returnStr = getText(map, true);
181                 break;
182             case 2: // 下拉列表(select控件)
183                 // 给集合添加函数
184                 fun = "getSelect('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')";
185                 setFunList(fun, false,panelBean);
186                 returnStr = getOptions(map);// 有处理sql的函数,解决
187                 break;
188             case 3:// 弹出选择框
189                 isTreeMus(map);
190                 fun = "getText('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')";
191                 setFunList(fun, false,panelBean);
192                 returnStr = getShowFrom(map, true);
193                 break;
194             case 5:// 日期选择
195                 panelBean.pHelper.linkJsDate = "<script type=\"text/javascript\" src=\"/js/calendar/WdatePicker.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,\"/js/calendar/WdatePicker.js\")%>\" defer=\"defer\"></script>";//
196                 fun = "getBetweenDate('" + id + "','beginday','endday')";
197                 setFunList(fun, false,panelBean);
198                 returnStr = getDate(map, true);
199                 break;
200             case 6:// 复选框(check控件:单选项,只能选择1个打√)
201                 fun = "getCheck('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')";
202                 setFunList(fun, false,panelBean);
203                 returnStr = getCheckBox(map, true);
204                 break;
205             case 30:// 复选框(check控件:多选项,能选择多个打√)
206                 // 给集合添加函数
207                 fun = "getCheckList('" + id + "','" + id + "Check','" + DBHelper.getValue(map, "CompSingle") + "')";
208                 setFunList(fun, false,panelBean);
209                 returnStr = getCheckBoxList(map);
210                 break;
211             case 31:// 下拉列表+SQL(select控件+SQL动态列表)
212                 // 给集合添加函数
213                 fun = "getSelect('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')";
214                 setFunList(fun, false,panelBean);
215                 returnStr = getOptionsSql(map);// 有处理sql的函数,解决
216                 break;
217             case 32:// 单选框(radio控件:多选项值,但只能选择一个)
218                 // 给集合添加函数Radio
219                 fun = "getRadio('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')";
220                 setFunList(fun, false,panelBean);
221                 returnStr = getRadio(map);// 有处理sql的函数,解决
222                 break;
223             case 33:// 多功能搜索控件(文本框+下拉列表框[多字段列表])
224                 // 给集合添加函数
225                 fun = "multifunctional('valueis','colis','jqcz','" + DBHelper.getValue(map, "CompSingle") + "')";
226                 setFunList(fun, false,panelBean);
227                 returnStr = getTextAndSelect(map);// //有处理sql的函数,解决
228                 break;
229             case 35:// 录入+下拉组合框
230                 fun = "getSelect('" + id + "','" + DBHelper.getValue(map, "CompSingle") + "')";
231                 setFunList(fun, false,panelBean);
232                 returnStr = getOptionEdit(map, true);
233                 break;
234             default:
235                 break;
236         }
237         return returnStr;
238     }
239
240     /**
241      * 生成页面需要的控件 获得面板显示(多数在这个方法获取控件)
242      */
243     public String getComponentForPanel(Map<String, Object> sys, boolean shuai, Map<String, Integer> listmax) throws Exception {
244         PanelBean panelBean= (PanelBean) sys.get(PANEL_INFO);
245         String type = null;
246         try {
247             // 查出当前窗体类型,以便处理496多表的情况,
248             type = gridService.getSimpleJdbcTemplate().queryForObject("select formtype from _sysmenu where formid=?",
249                     new Object[] { sys.get("formid") }, String.class);
250         } catch (Exception e) {
251         }
252         String id=panelBean.pHelper.id;
253         if (id.trim().equals("")) {
254             return "";// 无字段ID不生成控件
255         }
256         if (!DBHelper.getValue(sys, "SqlScript").equals("")) {
257             String sqlContype = "";
258             sqlContype ="$(function(){";
259             if(DBHelper.getValueInt(sys, "ControlType") != 43){
260                 sqlContype +="getControlValue('" + id + "'," + DBHelper.getValueInt(sys, "ControlType") + ",'" + id + "','"
261                         + DBHelper.getValueInt(sys, "FT") + "','@index@');";
262             }else{
263                 sqlContype +="getSelect2('" + id + "'," + DBHelper.getValueInt(sys, "ControlType") + ",'" + id
264                         + "','" + DBHelper.getValueInt(sys, "FT") + "','@index@','"+getControls(sys)+"');";
265             }
266             sqlContype+="})";
267             panelBean.sqlContype=sqlContype;
268         }else{
269             panelBean.sqlContype="";
270         }
271         if (!DBHelper.getValue(sys, "dyfieldview").equals("")) {
272             panelBean.dyfieldStr = "dyfield_view('" + panelBean.initialValue.getValRep(DBHelper.getValue(sys, "dyfieldview"), false)
273                     + "');";
274         } else {
275             panelBean.dyfieldStr = "";
276         }
277         if (listmax != null) { // 处理控件的输入长度
278             try {
279                 if (listmax.get(id) != null) {// 一一对应
280                     panelBean.maxl = "maxLength=\"" + listmax.get(id)
281                             + "\" onkeyup=\"while(value.replace(/[^\\\\x00-\\\\xff]/g, '**').length>maxLength)value=value.slice(0,-1)\"";
282                 } else {
283                     panelBean.maxl = "";
284                 } // 如果不存在就把maxl清空 防止出错。2014-8-30
285             } catch (Exception e) {
286                 panelBean.maxl = "";
287             }
288         }
289         panelBean.tabindexIs++;// 每次调用是把tabindex上升一个次序
290         String returnStr = "";
291         panelBean.getBackStr = getMassterCodeKeyDown(sys, shuai);
292         String buttonStr = getButtonNext(sys);// 通过,驳回,下一步 等等的审核
293         boolean isTabs=(DBHelper.getValue(sys, "tabs38").equals("null")?false:true);//判断是否是面板上的选项卡控件-xin 2018-11-5 15:19:22
294         // double hei = 0;
295         PanelParmHelper pHelper=panelBean.pHelper;
296         switch (DBHelper.getValueInt(sys, "ControlType")) {
297             case 1: // 文本框(text控件)
298                 returnStr = getText(sys, shuai);
299                 break;
300             case 2: // 下拉列表(select控件)
301                 returnStr = getOptions(sys);
302                 break;
303             case 3: // 弹出选择框
304                 isTreeMus(sys);
305                 returnStr = getShowFrom(sys, shuai);
306                 break;
307             case 5:// 日期选择
308                 pHelper.linkJsDate = "<script type=\"text/javascript\" src=\"/js/calendar/WdatePicker.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,\"/js/calendar/WdatePicker.js\")%>\" defer=\"defer\"></script>";//
309                 returnStr = getDate(sys, shuai);
310                 break;
311             case 6:// 复选框(check控件:单选项,只能选择1个打√)
312                 returnStr = getCheckBox(sys, shuai);
313                 break;
314             case 7:// 弹出式文本编辑框
315                 returnStr = getShowText(sys, shuai, listmax);
316                 break;
317             case 10:// 金钱框---以输入框先代替
318                 returnStr = getText(sys, shuai);
319                 break;
320             case 9:// 图片预览
321             case 19:// 上传附件按钮
322                 returnStr=this.createFileUPload(sys);
323                 if(DBHelper.getValueInt(sys, "ControlType")==19){
324                     pHelper.seqtypefilde="19;"+id;//19类型控件面板需要用到
325                 }
326                 break;
327             case 30:// 复选框(check控件:多选项,能选择多个打√)
328                 panelBean.clickStr = "cheeckSToValue('" + id + "');";
329                 returnStr = getCheckBoxList(sys);
330                 panelBean.clickStr = "";
331                 break;
332             case 31:// 下拉列表+SQL(select控件+SQL动态列表)
333                 returnStr = getOptionsSql(sys);// 有处理sql的函数,解决
334                 break;
335             case 32:// 单选框(radio控件:多选项值,但只能选择一个)
336                 returnStr = getRadio(sys);// 有处理sql的函数,解决
337                 break;
338             case 33:// 多功能搜索控件(文本框+下拉列表框[多字段列表])
339                 returnStr = getTextAndSelect(sys);// //有处理sql的函数,解决
340                 break;
341             case 34:// 区域录入提示信息
342                 String panStyle = "style=\"font-family: '黑体';font-size: 18px;\"";
343                 String invString = DBHelper.getValue(sys, "styleCss");
344                 panStyle = invString.trim().equals("") ? panStyle : invString;
345                 returnStr += "<span " + panStyle + ">" + DBHelper.getValue(sys, "fieldname") + "</span>";// 只显示描述控件,设置占用一行
346                 break;
347             case 35:// 录入+下拉组合框
348                 returnStr = getOptionEdit(sys, shuai);
349                 break;
350             case 36:// 自定义HTML
351                 try {
352                     returnStr = "<div style=\"width:auto; table-layout:fixed; word-break: break-all; overflow:auto; \"><span id=\""
353                             + id + "SetHtml\"><input id=\"" + id + "\" value=\"\" type=\"hidden\" />";
354                     pHelper.customHTMLList = systemSettingsDao.getCustomHTML(pHelper.formIdPan, id);
355                     for (int i = 0; i < pHelper.customHTMLList.size(); i++) {
356                         returnStr += pHelper.customHTMLList.get(i).get("htmlcontent").toString().replaceAll("\\\\",
357                                 ";pbZhuan#");
358                     }
359                     returnStr += "</span></div>";
360                 } catch (Exception e) {
361                     e.printStackTrace();
362                 }
363                 break;
364             case 37:// 富文本框控件
365                 int  height = (pHelper.rowHei) * DBHelper.getValueInt(sys, "HeightNum");
366                 if (pHelper.formTypePan != 496 || pHelper.formTypePan != 497) {
367                     pHelper.linkJsFu = "\n<script type=\"text/javascript\" src=\"/ckeditor/ckeditor.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,\"/ckeditor/ckeditor.js\")%>\"></script>";
368                     pHelper.linkJsFu += "\n<script type=\"text/javascript\" src=\"/ckeditor/samples/js/ckimpl.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,\"/ckeditor/samples/js/ckimpl.js\")%>\"></script>";
369                 }
370                 returnStr += "\n<form><textarea id=\"" + id + "\" name=\"" + id + "\">" + getJspValue(id) + "</textarea></form>";
371                 returnStr += "\n<script type=\"text/javascript\">$(function(){initSample('" + id + "',"+height+");})</script>";
372                 break;
373             case 38:// 控件分组显示
374                 // hei = (pHelper.rowHei) * DBHelper.getValueInt(sys, "HeightNum");
375                 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;");
fc3567 376                 returnStr += "<div class=\"controls38Div controls38c"+DBHelper.getValueInt(sys, "LengthNum")
176200 377                         +" controls38r"+DBHelper.getValueInt(sys, "HeightNum")+"\" style=\"border:1px #75a3e1 solid;border-radius:6px;"+z_index+"\">"
a6a76f 378                         + "<span style=\"margin-top:-10px;background:#FFFFFF;width:auto;left:10px;position:absolute\">"
fc3567 379                         + DBHelper.getValue(sys, "fieldname") + "</span></div>";// px;margin-top:2px;
a6a76f 380                 // 对面板控件边框的高度控制设置
F 381                 panelBean.xuan = "";
382                 if(isTabs && DBHelper.getValueInt(panelBean.control38height, DBHelper.getValue(sys, "tabsheetname"))==0) {
383                     panelBean.control38height.put(DBHelper.getValue(sys, "tabsheetname"),(DBHelper.getValueInt(sys, "RowNo")+DBHelper.getValueInt(sys, "HeightNum")));
384                 }                
385                 break;
386             case 39:// 控件分组显示
387                 int hei39 = pHelper.rowHei * DBHelper.getValueInt(sys, "HeightNum");
388                 returnStr = "<input type='text' value='" + getJspValue(id) + "' id=\"" + id
389                         + "\" readonly=\"readonly\" style='width: " + (DBHelper.getValueInt(sys, "tdlen") - 25)
390                         + "px ; height: " + hei39 + "px;" + DBHelper.getValue(sys, "styleCss")
391                         + "'><input type=\"button\" id='" + id + "_dibang' onclick=\"stopOrStart(this,'" + id
392                         + "')\" value=\"解锁\"><script>stopOrStartBegin(document.getElementById('" + id + "_dibang'),'" + id
393                         + "')</script>";
394                 break;
395             case 40:// 图片浏览控件 -xin 2020-6-15 17:24:07
396                 int w=116*DBHelper.getValueInt(sys, "LengthNum");
397                 int h=pHelper.rowHei * DBHelper.getValueInt(sys, "HeightNum");
398                 pHelper.linkJsFu = "\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/general/Viewer/css/viewer.min.css?v=<%=com.yc.utils.FileUtil.getVerstion(request,\"/general/Viewer/css/viewer.min.css\")%>\">";
399                 pHelper.linkJsFu += "\n<script type=\"text/javascript\" src=\"/general/Viewer/js/viewer-jquery.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,\"/general/Viewer/js/viewer-jquery.min.js\")%>\"></script>";
400                 pHelper.linkJsFu += "\n<script type=\"text/javascript\" src=\"/general/Viewer/js/viewer.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,\"/general/Viewer/js/viewer.min.js\")%>\"></script>";
631e91 401                 returnStr += "<div style=\"border: 1px solid #99BBE8;border-radius: 5px;\">"
281048 402                         + "<ul id=\""+id+"\" class=\"isViewer40\" data-value=\""+getJspValue(id)+"\">" +
X 403                         "</ul></div>" ;
404 //                        "<img id="+id+" src=\""+getJspValue(id)+"\" value=\""+getJspValue(id)+"\" alt=\""+DBHelper.getValue(sys, "fieldname")+"\""
405 //                        + " src-source style=\"width:100%;height:150px;\"/>";
631e91 406 //                returnStr+="<script>$(function(){OpenImage40('"+id+"')})</script>";
a6a76f 407                 break;
F 408             case 41:// 标签(label)
409                 String secc = "style=\"font-size: 16px;\"";
410                 String sytlep = DBHelper.getValue(sys, "styleCss");
411                 secc = sytlep.trim().equals("") ? secc : sytlep;
823e43 412                 //标签控件那就是静态的显示字段描述内容就可以了,所以直接取fieldName的值 xin 2023-4-27 17:23:36
X 413                 returnStr = "<label  id=\""+id+"\" " + secc + ">" + DBHelper.getValue(sys, "fieldname") + "</label>";//getJspValue(id)
a6a76f 414                 break;
F 415             case 42:// 文本框+录入时动态下拉提示选择框
416                 returnStr = getShowFrom42(sys, shuai);
417                 break;
418             case 43:// 下拉列表复选框
419                 returnStr = getSelect43(sys, shuai);
420                 break;
45dcf7 421             case 44://静态图标控件
X 422                 returnStr=getBigIcon44(sys,shuai);
423                 break;
5b18c2 424             case 46:
X 425                 returnStr=getColorFinder(sys,shuai);
426                 break;
427             case 47:
428                 returnStr=getProgressBar(sys,shuai);
429                 break;
a724cc 430             case 48://css样式控件
X 431                 returnStr=getTextCssEdit(sys,shuai);
432                 break;
a6a76f 433             default:
F 434                 returnStr = getText(sys, shuai);// 有些控件类型暂无用此替代
435                 break;
436         }
437         returnStr = "<span id=\"" + id + "_show_type\">" + returnStr + "</span>";
438         if (!DBHelper.getValue(sys, "HyperlinkFT").equals("")) {
439             returnStr += "<span id=\"" + id
440                     + "_show_link\" style='display:none'><a href=\"javascript:void(0)\" onclick=\"windowLink('" + id
176200 441                     + "');\"><span id=\"" + id + "_Link\" style=\"display: block;margin-top: 5px;\"></span></a></span>";
a6a76f 442         }
F 443         if (panelBean.hasButton) {//有审核按钮(旧)
fc3567 444             returnStr = "<table style=\"width:72%;\"><tr><td>" + returnStr + "</td><td>" + buttonStr + "</td></tr></table>";// valign=\"top\"
a6a76f 445         }
F 446         getPermission(sys);
875a46 447         if (DBHelper.getValueInt(sys, "calcuField") != 0 ) {// 触发公式
X 448             pHelper.gongsiCols.add(id);
449 //            pHelper.gongsiCols += id + ";";
a6a76f 450         }
F 451         if (!DBHelper.getValue(sys, "formula").equals("")) {
875a46 452             pHelper.gongsiStr.add(id + "=" + DBHelper.getValue(sys, "formula").replaceAll("\'", "\\\\\'"));
X 453 //            pHelper.gongsiStr += id + "=" + DBHelper.getValue(sys, "formula") + ";";
a6a76f 454         }
F 455         panelBean.maxl = "";// 清空该控件的输入长度,防止对 下一个控件的输入长度造成影响
456         return "<span id=\"" + id + "_dynamic\">" + returnStr + "</span></span></div>" + getKeyInput(sys);
457     }
458
459     /**
460      * 1类型控件。文本框(text控件)
461      *
462      * @param map
463      * @param shuai
464      * @return
465      * @throws Exception
466      */
467     private String getText(Map<String, Object> map, boolean shuai) throws Exception {
468         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
469         String str = "";
470         String id=panelBean.pHelper.id;
471         String maxl=panelBean.maxl;
472         if (shuai) {
db63a0 473             str = "<input id=\"" + id + "\" type=\"text\" autocomplete=\"off\" name=\"" + id + "\" " + maxl + " ";
a6a76f 474             str = getAll(map, str, shuai);
F 475             str += " />";
476         } else {
477             String str1 = "";
478             if (DBHelper.getValueInt(map, "HeightNum") > 1) {
479                 int num=(panelBean.hasButton?DBHelper.getValueInt(map, "LengthNum")-1:DBHelper.getValueInt(map, "LengthNum"));
480                 str1 = "<textarea ";
db63a0 481                 str += str1 + " id=\"" + id + "\"  name=\"" + id + "\" " + maxl + " autocomplete=\"off\" class=\"text "+getControls(map)+ "\"";
a6a76f 482                 str = getAll(map, str, shuai) + " ><%=DBHelper.replaceBlankOnWeb(DBHelper.getValue(docMap,\"" + id
F 483                         + "\",mapAll))%>";
484                 str += "</textarea>";
485             } else {
486                 str1 = "<input type=\"" + ((DBHelper.getValueInt(map, "passwordchar") == 1) ? "password" : "text")
487                         + "\" ";
db63a0 488                 str += str1 + " id=\"" + id + "\"  name=\"" + id + "\" " + maxl + " autocomplete=\"off\" class=\"text " + getControls(map)
a6a76f 489                         + "\" value=\"" + getJspValue(id) + "\" ";
F 490                 str = getAll(map, str, shuai);// 这里可以提出来,还是提出来
491                 str += " />";
492             }
493         }
494         return str;
495     }
496
497     /**
498      * 2类型控。下拉列表(select控件)
499      *
500      * @param mapW
501      * @return
502      * @throws Exception
503      */
504     private String getOptions(Map<String, Object> mapW) throws Exception {
505         PanelBean panelBean= (PanelBean) mapW.get(PANEL_INFO);
506         String id=panelBean.pHelper.id;
507         String selectStr = "";
508         if (DBHelper.getValue(mapW, "SqlScript") == null || DBHelper.getValue(mapW, "SqlScript").trim().equals("")) {
509             selectStr = "<select class=\""+getControls(mapW)+"\" onfocus=\"" + panelBean.sqlContype + "\"  " + panelBean.onClickStr + " onkeydown=\"keyDown('" + id
510                     + "',event);key_Delete_Selete(event,'" + id + "');\" ";
511             selectStr += getChange(panelBean);
512             selectStr += getReadOnly(mapW);// 后加
513             selectStr += " onblur=\"" + panelBean.clickStr + "\" name=\"" + id + "\" size=\"1\" id=\"" + id + "\">";
514             String sql = "select * from _sysdict where dictid = " + DBHelper.getValueInt(mapW, "FT");
515             List<HashMap<String, String>> list = null;
516             list = sqlDBHelperIfc.getHashMap(sql);
c8bf0a 517             if (DBHelper.getValueInt(mapW, "issuppressblanklinefordropdown") != 1) {
X 518                 selectStr += "\r\n      <option value></option>";
519             }
520 //            selectStr += "\r\n<option value=\"\"></option>";
a6a76f 521             for (HashMap<String, String> map : list) {
F 522                 selectStr += "\r\n<option value=\"" + DBHelper.replaceBlank(map.get("intervalue")) + "\" ";
523                 selectStr += ">" + map.get("dictvalue") + "</option>";
524             }
525             selectStr += "</select>";
526             // 清除第一个默认值
527             selectStr += getSelectfun(getJspValue(id), id);
528         } else {
529             selectStr += getOptionsSql(mapW);
530         }
531         return selectStr;
532     }
533
f60489 534     /**
X 535      * 46控件颜色下拉 2类型
536      * @param mapW
537      * @return
538      * @throws Exception
539      */
540     private String getColorOptions(Map<String, Object> mapW) throws Exception {
541         PanelBean panelBean = (PanelBean) mapW.get(PANEL_INFO);
542         String id = panelBean.pHelper.id;
543         String selectStr = "";
544         selectStr = "<select class=\"" + getControls(mapW) + "\" onchange=\"getColors46('" + id + "');\" onfocus=\"" + panelBean.sqlContype + "\"  " + panelBean.onClickStr + " onkeydown=\"keyDown('" + id
545                 + "',event);key_Delete_Selete(event,'" + id + "');\" ";
546         selectStr += getChange(panelBean);
547         selectStr += getReadOnly(mapW);// 后加
548         selectStr += " onblur=\"" + panelBean.clickStr + "\" name=\"" + id + "\" size=\"1\" id=\"" + id + "\">";
549         String sql = "select HexColor as intervalue from t9685 where formid=120201 order by DocItem asc";//"select * from _sysdict where dictid = " + DBHelper.getValueInt(mapW, "FT");
550         List<HashMap<String, String>> list = null;
551         list = sqlDBHelperIfc.getHashMap(sql);
552         selectStr += "\r\n<option value=\"\" style=\"background-color:white;color:white\"></option>";
553         for (HashMap<String, String> map : list) {
364610 554             if(StringUtils.isBlank(DBHelper.replaceBlank(map.get("intervalue")))){
X 555                 continue;
556             }
f60489 557             selectStr += "\r\n<option value=\"" + DBHelper.replaceBlank(map.get("intervalue")) + "\" ";
X 558             selectStr += " style=\"background-color:" + DBHelper.replaceBlank(map.get("intervalue")) + "\"></option>";
559         }
560         selectStr += "</select>";
561         // 清除第一个默认值
562         selectStr += getSelectfun(getJspValue(id), id);
563         return selectStr;
564     }
565
a6a76f 566     private String getJspValue(String id) {
F 567         return "<%=DBHelper.getValue(docMap,\"" + id + "\",mapAll)%>";
568     }
569
570     /**
571      * 3类型控件调用
572      * @param map
573      * @throws Exception
574      */
575     private void isTreeMus(Map<String, Object> map) throws Exception {
576         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
577         switch (DBHelper.getValueInt(map, "FTFormType")) {
578             case 302:
579                 panelBean.treeMus = true;
580                 break;
581             default:
582                 panelBean.treeMus = false;
583                 break;
584         }
585     }
586
587     /**
588      * 3类型控件。弹出选择框
589      *
590      * @param map
591      * @param shuai
592      * @return
593      * @throws Exception
594      */
595     private String getShowFrom(Map<String, Object> map, boolean shuai) throws Exception {
596         String s_ = "";
597         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
598         String id=panelBean.pHelper.id;
599         String maxl=panelBean.maxl;
600         s_ += getReadOnly(map); // 是否只读
601         String getdiv = "";
5f1f90 602         String isControl42Css="";//是否也是42控件查询功能需要的样式
a6a76f 603         if (!DBHelper.getValue(map, "SuggestFileds").equals("")) {// 42类型控件js
F 604             int rod = (int) (Math.random() * 100 + 1);// 生成100之内的随机数
5f1f90 605             String divId="T_"+DBHelper.getValue(map, "ft")+"_"+rod+"div";
X 606             String tableId="T_"+DBHelper.getValue(map, "ft")+"_"+rod+"CDiv";
607             panelBean.pHelper.div42="<div id=\""+divId+"\" style=\"z-index:9999;display:none;position:absolute;height:auto;max-height:320px;overflow:auto;\">" +
608                     "<table id=\""+tableId+"\" lay-filter=\""+tableId+"\" " +
9c003c 609                     getSuggestFilds(DBHelper.getValue(map, "ft"),DBHelper.getValue(map, "SuggestFileds"),DBHelper.getValueInt(map, "ftformtype"))+">" +
5f1f90 610                     "</table></div>\t\n";
X 611             //添加data-xxx属性 xin 2021-3-17 15:54:36
612             getdiv="data-index=\"@index@\" data-rod=\""+rod+"\" data-relation=\""+DBHelper.getValue(map, "RelationField")+"\" data-sugges=\""+DBHelper.getValue(map, "SuggestFileds")+"\"";
613             isControl42Css="isControl42";//赋固定值样式
a6a76f 614         } else {// 3类型控件
F 615             String getAll = panelBean.getBackStr + ((panelBean.keyBack) ? "keyDown('" + id + "',event);" : "");
616             String getAllChan = panelBean.getBackStr + ((panelBean.toKeBack) ? "keyDown('123',event);" : "");// --getBackStr
617             // +
618             // 不需要触发这个事件
619             // 2015-3-12
620             // 10:07:37
621             String getChan = ((panelBean.toKeBack) ? "keyDown('123',event);" : "");
780a47 622             s_ += " onPropertyChange=\"upSub('" + id + "',@index@);" + getChan + panelBean.dyfieldStr + "\"  "; // 值发生改变处理
X 623             s_ += " onchange=\"getBackElse=true;" + getAllChan + "upSub('" + id + "',@index@);\"";
a6a76f 624             s_ += " onkeydown=\"" + getAll + "delemptyrefdata(document.getElementById('" + id + "'),@index@);\" "; // 键盘按下处理
F 625         }
626         String str = "<input id=\"" + id + "Tree\" value=\""
627                 + ((DBHelper.getValueInt(map, "ReadOnly") == 1) ? "0" : "1") + "\" type=\"hidden\" />";
628        
629         int flag=-1;
630         boolean bol=false;
631         //是否有会计科目设置    xin 2020-11-6 10:44:28
632         if(!Objects.equals("", DBHelper.getValue(map, "glcodefield")) &&
633                 (id.toLowerCase().matches("cv\\d{1}") || id.toLowerCase().matches("cv\\d{1}name"))) {
634             try {
635                 Pattern p = Pattern.compile("[^0-9]");
636                 Matcher m = p.matcher(id);
637                 flag = Integer.parseInt(m.replaceAll("").trim());
638                 bol=true;
639             } catch (Exception e) {
640                 flag = -1;
641             }            
642         }
643         if (DBHelper.getValueInt(map, "HeightNum") > 1) {
5f1f90 644             str += "<textarea class=\""+isControl42Css+" Three_show " + getControls(map) + "\" id=\"" + id + "\" "
a6a76f 645                     + (getdiv.equals("") ? maxl : "") + (bol?" data-flcode=\""+DBHelper.getValue(map, "glcodefield")+"\" data-flag="+flag+" ":" ")
5f1f90 646                     + "name=\"" + id + "\" " + s_ + " "+getdiv+">" + getJspValue(id)
a6a76f 647                     + "</textarea>";
F 648         } else {
db63a0 649             str += "<input autocomplete=\"off\" class=\""+isControl42Css+" Three_show " + getControls(map) + "\" id=\"" + id + "\"  "
a6a76f 650                     + (getdiv.equals("") ? maxl : "") + (bol?" data-flcode=\""+DBHelper.getValue(map, "glcodefield")+"\" data-flag="+flag+" ":" ")
5f1f90 651                     + "name=\"" + id + "\" size=\"15\" " + s_ + " "+getdiv+" value=\""
a6a76f 652                     + getJspValue(id) + "\"  />";
F 653         }
654         String style="";
655         if(!DBHelper.getValue(map, "tabs38").equals("null")){
656             //margin-left:"+((256*DBHelper.getValueInt(map, "LengthNum"))-12-8-116-16)+"px;
657             style="position:absolute;z-index:1;margin-top:2px;";
658         }else {
659              int i=(DBHelper.getValueInt(map, "Hidelabel")==1?0:116);
660              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;";
661         }
fc3567 662         str += "<span  class=\"AllShowType\" style=\""+style+"border:0px solid #000000;\">"//position: absolute; 加上的话在2 3窗体显示会出现问题
a6a76f 663                 + "<img src=\"/images/ppp.gif\" id=\"" + id + "_click\" style=\"cursor: pointer;margin-left:-16px;\"  onclick=\""
F 664                 + (panelBean.treeMus ? "musChoies=true;" : "") + "windowOpen('" + id + "','@index@','"
665                 + DBHelper.getValueInt(map, "onlyOne") + "');" + (panelBean.treeMus ? "musChoies=false;" : "") + "\"/></span>";
666         return str;
667     }
668
669     /**
670      * 5类型控。日期选择
671      *
672      * @param map
673      * @param shuai
674      * @return
675      * @throws Exception
676      */
677     private String getDate(Map<String, Object> map, boolean shuai) throws Exception {
678         String str = "";
679         String dateForm = "";
680         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
681         String id=panelBean.pHelper.id;
682         if (shuai) {
683             str = "从<input id=\"begindayDate\" value=\"1\" type=\"hidden\" /><INPUT name=\"beginday\" style=\"height:24px;\" id=\"beginday\" onclick=\"showDate('beginday',true,'');"
db63a0 684                     + panelBean.clickStr + "\"  value=\"\" autocomplete=\"off\" class=\"Wdate\" realValue My97Mark=\"true\">"
X 685                     + "&nbsp;到&nbsp;<input id=\"enddayDate\" value=\"1\" type=\"hidden\" /><INPUT name=\"endday\"  autocomplete=\"off\" style=\"height:24px;\" id=\"endday\" onclick=\"showDate('endday',true,'');"
a6a76f 686                     + panelBean.clickStr + "\"  value=\"\" class=\"Wdate\" realValue>";
F 687         } else {
688             if (!DBHelper.getValue(map, "Displayformat").equals("")) {
689                 dateForm = "showDate('" + id + "',true,'" + DBHelper.getValue(map, "Displayformat") + "')";
690             } else {
691                 dateForm = "showDate('" + id + "',true,'')";
692             }
693             str = "<input id=\"" + id + "Date\" value=\"" + ((DBHelper.getValueInt(map, "ReadOnly") == 1) ? "0" : "1")
694                     + "\" type=\"hidden\" /><input id=\"" + id + "\" name=\"" + id
db63a0 695                     + "\" type=\"text\" autocomplete=\"off\" class=\"Wdate "+getControls(map)+"\" onclick=\"" + dateForm + "\" ";// onfocus= controlsc1 controlsr1
a6a76f 696             str += " value=\"" + getJspValue(id) + "\" ";
F 697             str = getAll(map, str, shuai);
698             str += " />";
699         }
700         return str;
701     }
702
703     /**
704      * 6类型控件。复选框(check控件:单选项,只能选择1个打√)
705      *
706      * @param map
707      * @param shuai
708      * @return
709      * @throws Exception
710      */
711     private String getCheckBox(Map<String, Object> map, boolean shuai) throws Exception {
712         String str = "";
713         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
714         String id=panelBean.pHelper.id;
715         String checkId = id + "CheckBox";
716         String css="";
717 //        if(panelBean.control38height>DBHelper.getValueInt(map, "RowNo")){
718 //            css="z_indexTabs";
719 //       }else{
720 //             panelBean.control38height=0;
721 //       }
722         str = "<input id=\"" + checkId + "\" name=\"" + checkId
723                 + "\" type=\"checkbox\" class=\"controls6 "+css+"\" <%=DBHelper.getValue(docMap,\"" + id
724                 + "\",mapAll).equals(\"1\")?\"checked\":\"\"%> ";
725         str = getAll(map, str, shuai);
726         str += " onClick=\"document.getElementById('" + id + "').value=document.getElementById('" + checkId
727                 + "').checked ? '1' : '0' ;" + panelBean.clickStr + "\" />" + "<input type=\"hidden\" id='" + id + "' name=\""
728                 + id + "\" value=\"" + getJspValue(id) + "\" onPropertyChange=\"cheeckValueChan('" + id + "')\">";
729         return str;
730     }
731
732
733     /**
734      * 7类型控件。弹出式文本编辑框
735      * @param map
736      * @param shuai
737      * @param listmax
738      * @return
739      * @throws Exception
740      */
741     private String getShowText(Map<String, Object> map, boolean shuai, Map<String, Integer> listmax) throws Exception {
742         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
743         String id=panelBean.pHelper.id;
744         String str = "<input id=\"" + id + "Text\" value=\"1\" type=\"hidden\" /><textarea class=\""+getControls(map)+"\" id=\"" + id + "\" name=\""
745                 + id + "\" " + panelBean.maxl + " rows=\"" + DBHelper.getValueInt(map, "HeightNum") + "\" ";
746         str = getAll(map, str, shuai);
747         str += " ><%=DBHelper.replaceBlankOnWeb(DBHelper.getValue(docMap,\"" + id
748                 + "\",mapAll))%></textarea><img onClick=\"show('" + id + "'," + listmax.get(id)
749                 + ");\" style=\"position:absolute;margin-left:-19px;margin-top:1px;height:" + (panelBean.pHelper.rowHei-4)
750                 + "px;width:18px;cursor:hand;\" src=\"/images/dian.jpg\">";
751         return str;
752     }
753
754     /**
755      * 19、9类型上传附件按钮
db63a0 756      * @param map
a6a76f 757      * @return
F 758      */
759     public String createFileUPload (Map<String, Object> map) {
760         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
761         String id=panelBean.pHelper.id;
762         int ReadOnly=DBHelper.getValueInt(map, "ReadOnly");//只读设置 xin 2021-3-3 10:39:28
763         String upload="\n <div class=\"form-group "+getControls(map)+"\" id=\"uploadDiv_"+id+"\" style=\""+(ReadOnly==1?"background: #CCC;":"")+"\">\n"
764                 + "<input id=\""+id+"_up\" type=\"file\" "+(ReadOnly==1?"disabled = \"disabled\"":"")+" class=\"file\" multiple data-preview-file-type=\"any\" data-overwrite-initial=\"false\" data-min-file-count=\"1\"> \n"   //multiple 控制上传时可以点击多附件同时上传
765                 + "<input id=\""+id+"\" name=\""+id+"\" value=\"<%=DBHelper.getValue(docMap,\""+id+"\")%>\" type=\"hidden\" /> \n"
766                 + "</div>\n";
767         upload+="<script>"//<%=DBHelper.getValueInt(docMap,\"rowid\")%>
768                 +"\n onfileiput('"+panelBean.pHelper.formIdPan+"','"+id+"','"+DBHelper.getValueInt(map, "ControlType")+"','<%=DBHelper.getValueInt(docMap,\"docstatus\")%>','','<%=session.getAttribute(SessionKey.USERCODE)%>',null,"+DBHelper.getValueInt(map, "maxFileSize")+");//加载附件"
769                 +"\n picevent('"+id+"');//事件\r";
770         upload+="\n </script>";
9c003c 771 //        String upload="\n <div class=\"form-group "+getControls(map)+"\" style=\""+(ReadOnly==1?"background:#CCC;":"")+"\">" +
X 772 //                "<input id=\""+id+"\" name=\""+id+"\" data-readonly=\""+(ReadOnly==1?"true":"false")+"\" " +
773 //                "data-status=\"<%=DBHelper.getValueInt(docMap,\"docstatus\")%>\" " +
774 //                "data-size=\""+DBHelper.getValueInt(map, "maxFileSize")+"\" " +
775 //                "data-type=\""+DBHelper.getValueInt(map, "ControlType")+"\" " +
776 //                "value=\"<%=DBHelper.getValue(docMap,\""+id+"\")%>\" " +
777 //                "type=\"hidden\" class=\"isFileInput\"/>";
778 //        upload+="<input id=\""+id+"_upload\" "+(ReadOnly==1?"disabled = \"disabled\"":"")+" type=\"file\"/></div>";
a6a76f 779         return upload;
F 780     }
781
782     /**
783      * 30类型控件。复选框(check控件:多选项,能选择多个打√)
784      * @param map
785      * @return
786      * @throws Exception
787      */
788     private String getCheckBoxList(Map<String, Object> map) throws Exception {
789         String returnStr = "";
790         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
791         String id=panelBean.pHelper.id;
792         if (DBHelper.getValue(map, "SqlScript") == null || DBHelper.getValue(map, "SqlScript").trim().equals("")) {
793             String sql = "select * from _sysdict where dictid = " + DBHelper.getValueInt(map, "FT");
794             returnStr = "<span id=\"" + id + "Span\"  name=\"" + id    + "Span\" style=\"border:0px solid #a5a6ad; height:26px;\">"
795                     + "<input id=\"" + id + "\"  name=\"" + id + "\" value=\"" + getJspValue(id) + "\" type=\"hidden\" "
796                     + "onPropertyChange=\"cheeckSValueChan('" + id + "')\" /><ul class=\"checkcss\">";
797             List<HashMap<String, String>> list = null;
798             list = sqlDBHelperIfc.getHashMap(sql);
799             int i = 0;
800             for (HashMap<String, String> mapR : list) {
801                 returnStr += "<li><input type=\"checkbox\" name=\"" + id + "Check\"  id=\"" + id
802                         + "_" + i + "\" value=\"" + mapR.get("intervalue") + "\"  class=\""+getControls(map)+"\" onclick=\"" + panelBean.clickStr
803                         + "\" style=\"width:20px;height:20px;\"><span class=\"checkcsstxt\">" + mapR.get("dictvalue")
804                         + "</span></li>&nbsp;";
805                 i++;
806             }
807             returnStr += "</ul></span>" + getCheckFun(id);
808         } else {
809             returnStr += "<span id=\"" + id + "Span\"  name=\"" + id + "Span\" style=\"border:0px solid #a5a6ad; height:24px;\">"
810                     + "<input id=\"" + id + "\"  name=\"" + id + "\" value=\"" + getJspValue(id) + "\" type=\"hidden\" "
811                     + "onPropertyChange=\"cheeckSValueChan('" + id + "')\" /><ul class=\"checkcss\"><%  outStr=\"\";";
477643 812             returnStr += "\r\ntry{\r\n  int i_sql_checks=0;";
a6a76f 813             returnStr += "\r\n  sql = \""
F 814                     + DBHelper.replaceBr(panelBean.initialValue.getValLinShi(DBHelper.getValue(map, "SqlScript"), true)) + "\";";
815             returnStr += "\r\n  SRS =  build.getSqlRowSet(DBHelper.getValRepShi(sql,session,docMap, false));";
816             returnStr += "\r\n    while(SRS.next()){ %>";
817             returnStr += "<li><input name=\"" + id + "Check\" type=\"checkbox\" id=\"" + id
818                     + "_<%=i_sql_checks%>\" value=\"<%=SRS.getString(1)%>\" class=\""+getControls(map)+"\" onclick=\"" + panelBean.clickStr
819                     + "\" style=\"width:20px;height:20px;\"><span class=\"checkcsstxt\"><%=SRS.getString(2)%></span></li>&nbsp;";
477643 820             returnStr += " <%i_sql_checks++;}}finally {}%></ul></span>" + getCheckFun(id);
a6a76f 821         }
F 822         return returnStr;
823     }
824
825     /**
826      * 31类型控。下拉列表+SQL(select控件+SQL动态列表)
827      *
828      * @param map
829      * @return
830      * @throws Exception
831      */
832     private String getOptionsSql(Map<String, Object> map) throws Exception {
833         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
834         String id=panelBean.pHelper.id;
835         String getBackStr=panelBean.getBackStr;
836         boolean toKeBack=panelBean.toKeBack;
837         String selectStr = "";
838         String getAll = getBackStr + ((panelBean.keyBack) ? "keyDown('" + id + "',event);" : "");
839         String getAllChan = getBackStr + ((toKeBack) ? "keyDown('123',event);" : "");
840         String getChan = ((toKeBack) ? "keyDown('123',event);" : "");
841         String sql = DBHelper.replaceBr(DBHelper.getValue(map, "SqlScript"));
842         List<String> list = DBHelper.getStrRepInfo(sql+DBHelper.replaceBr(DBHelper.getValue(map, "SqlWhere")), "&");
843         if(list!=null && list.size()>0) {
844              HashSet<String> set = new HashSet<String>(list); 
845              for(String key:set) {
846                 key=key.toLowerCase();
847                  panelBean.selectMap.put(key, id+(panelBean.selectMap.get(key)!=null?";"+panelBean.selectMap.get(key):""));
848              }   
849         }            
850         if ((DBHelper.getValueInt(map, "FT") < 0 && (DBHelper.getValueInt(map, "ControlType") == 2)
851                 || ("").equals(sql))) {//2类型控件
852             sql = "select  intervalue,dictvalue from _sysdict where dictid =" + DBHelper.getValueInt(map, "FT")
853                     + " order by sequence asc";
854         }
855         selectStr += "\r\n<%try{";
856         selectStr += "\r\n      sql = \"" + sql + "\";";
bd6d64 857         String sqlWhere=DBHelper.replaceBr(DBHelper.getValue(map, "SqlWhere"));
X 858         if(StringUtils.isNotBlank(sqlWhere)){
859             boolean b = false;//默认组装进行
860             b = (DBHelper.getValueInt(map, "ReadOnly") == 1 ? true : b);//只读状态不需要组装
861             sqlWhere = b ? null : "\""+sqlWhere+"\"";//只读情况不传sqlWhere值  xin 2023-3-15 14:35:18
00c21c 862             selectStr += "\r\n      if(\"\".equals(DBHelper.getValue(docMap,\"docstatus\")) && request.getAttribute(\"docStatue\") != null){";
X 863             selectStr += "\r\n          docMap.put(\"docstatus\",request.getAttribute(\"docStatue\"));//这里是为了在多表情况,子功能没状态值,这里获取主表的状态值";
864             selectStr += "\r\n      }";//docStatus=((\"\".equals(docStatus) && request.getAttribute(\"docStatue\") != null)?(String)request.getAttribute(\"docStatue\"):docStatus);";
6e18b5 865             selectStr += "\r\n      sql = DBHelper.getSqlWhere(sql," + b + ",DBHelper.getValue(docMap,\""+id+"_expr\")," +
00c21c 866                     "\"" + DBHelper.getValue(map, "editStatus") + "\",DBHelper.getValue(docMap,\"docstatus\")," + sqlWhere + ");";
a6a76f 867         }
F 868         selectStr += "\r\n      SRS = build.getSqlRowSet(DBHelper.getValRepShi(sql,session,docMap, false));";
869         selectStr += "\r\n %>";
870         selectStr += "\r\n <input id=\"" + id + "text\" name=\"" + id + "text\" value=\"" + getJspValue(id)
871                 + "\" type=\"hidden\">\r";
872         //onfocus=\"" + panelBean.clickStr
873         // + "getControlValue('" + id + "'," + DBHelper.getValueInt(map, "ControlType") + ",'" + id + "','"
874         // + DBHelper.getValueInt(map, "FT") + "','@index@');\" 
875         selectStr += "<select class=\""+getControls(map)+"\" onchange=\"getSelect31('" + id + "');getBackElse=true;"
780a47 876                 + getAllChan + "upSub('" + id + "',@index@);\" "+getReadOnly(map)// 后加
X 877                 + " onPropertyChange=\"if(panMain[panIndex].no_load_first){upSub('" + id + "',@index@);" + getChan
a6a76f 878                 + "}\" onkeydown=\"" + getAll + "key_Delete_Selete(event,'" + id + "');\" name=\"" + id + "\" size=\"1\" id=\"" + id + "\">";
c8bf0a 879         if (DBHelper.getValueInt(map, "issuppressblanklinefordropdown") != 1) {
X 880             selectStr += "\r\n      <option value></option>";
881         }
a6a76f 882         selectStr += "\r   <% while(SRS!=null && SRS.next()){%> ";
F 883         selectStr += "\r\n      <option value=\"<%= DBHelper.replaceBlank(SRS.getString(1))%>\"><%=SRS.getObject(2)%></option>";
884         selectStr += "\r\n <% }%>";
885         if (DBHelper.getValueInt(map, "FT") != 0) {
886             selectStr += "\r\n  <option value=\"pb_xinzen\"><<新增>></option>";
887         }
888         selectStr += "\r\n </select>";
889         selectStr += "\r\n<%}catch(Exception e){";
890         selectStr += "\r\n      throw e;";
891         selectStr += "\r\n}%>\r\n";
892         selectStr += getSelectfun(getJspValue(id), id);
893 //        selectStr += "<script>" + panelBean.sqlContype + "</script>\r\n";
894         return selectStr;
895     }
896
897     /**
898      * 32类型控件。单选框(radio控件:多选项值,但只能选择一个)
899      *
900      * @param map
901      * @return
902      * @throws Exception
903      */
904     private String getRadio(Map<String, Object> map) throws Exception {
905         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
906         String id=panelBean.pHelper.id;
907         String returnStr = "";
908         if (DBHelper.getValue(map, "SqlScript") == null || DBHelper.getValue(map, "SqlScript").trim().equals("")) {
909             String sql = "select * from _sysdict where dictid = " + DBHelper.getValueInt(map, "FT");
910             returnStr = "<span id=\"" + id + "Span\" style=\"border:0px solid #a5a6ad; height:24px;\">";
911             List<HashMap<String, String>> list = null;
912             list = sqlDBHelperIfc.getHashMap(sql);
913             int i = 0;
914             for (HashMap<String, String> mapR : list) {
915                 returnStr += "<input  name=\"" + id + "Radio\" type=\"radio\" id=\"" + id + "_" + i + "\" value=\""
916                         + mapR.get("intervalue") + "\" onclick=\"getRad('" + id + "')\">" + mapR.get("dictvalue")
917                         + "&nbsp;&nbsp;";
918                 i++;
919             }
920             returnStr += "</span><input id=\"" + id + "\" value=\"" + getJspValue(id)
921                     + "\" type=\"hidden\" onPropertyChange=\"radioValueChan('" + id + "')\">" + getRadiosFun(id);
922         } else {
923             returnStr += "<span id=\"" + id
924                     + "Span\" style=\"border:0px solid #a5a6ad; height:24px;\"><%  outStr=\"\";";
4885f7 925             returnStr += "\r\ntry{\r\n  int i_sql_radio=0;";
a6a76f 926             returnStr += "\r\n  sql = \""
F 927                     + DBHelper.replaceBr(panelBean.initialValue.getValLinShi(DBHelper.getValue(map, "SqlScript"), true)) + "\";";
928             returnStr += "\r\n  SRS = build.getSqlRowSet(DBHelper.getValRepShi(sql,session,docMap, false));";
929             returnStr += "  while(SRS.next()){ ";
930             returnStr += "if((\"" + panelBean.initialValue.getValLinShi(DBHelper.getValue(map, "initValue"), false)
931                     + "\").equals(SRS.getObject(2))||(\""
932                     + panelBean.initialValue.getValLinShi(DBHelper.getValue(map, "initValue"), false)
933                     + "\").equals(SRS.getObject(1))){";
934             returnStr += "   outStr += \" checked='checked' \";";
935             returnStr += "}else{outStr += \"\";}%>";
936             returnStr += "<input <%=outStr%> name=\"" + id + "Radio\" type=\"radio\" id=\"" + id
937                     + "_<%=i_sql_radio%>\" value=\"<%=SRS.getString(1)%>\" onclick=\"getRad('" + id
938                     + "')\"><%=SRS.getString(2)%>&nbsp;&nbsp;";
4885f7 939             returnStr += " <%i_sql_radio++;}}finally {}%>";
a6a76f 940             returnStr += "</span><input id=\"" + id + "\" value=\"" + getJspValue(id)
F 941                     + "\" type=\"hidden\" onPropertyChange=\"radioValueChan('" + id + "')\">" + getRadiosFun(id);
942         }
943         return returnStr;
944     }
945
946     /**
947      * 33类型控件。多功能搜索控件(文本框+下拉列表框[多字段列表])
948      * @param map
949      * @return
950      * @throws Exception
951      */
952     private String getTextAndSelect(Map<String, Object> map) throws Exception {
953         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
954         String selectStr = "";
955         selectStr += "<input type=\"text\" id=\"valueis\" style=\"border: 1px solid #a5a6ad;\" class=\"controlsr1\" />&nbsp;&nbsp;";
956         selectStr += "<select onkeydown=\"keyDown('colis',event);colisKey(event);\" " + panelBean.onClickStr + " ";
957         selectStr += " name=\"colis\" size=\"1\" style=\"width:168px;height:25px;\" class=\"controlsr1\" id=\"colis\">";
958         String optionStr = "";
959         String colAll = "";
960         String colAllDataType = "";
961         for (Map<String, Object> sys : panelBean.queryList) {
962             Object obj = getDataTypeIfc.getDataTypeByName(panelBean.pHelper.tableIs, DBHelper.getValue(sys, "FieldID"));
963             colAllDataType += obj.toString() + ";";
964             colAll += DBHelper.getValue(sys, "FieldID") + ";";
965             optionStr += "\r\n<option value=\"" + DBHelper.getValue(sys, "FieldID") + "\" ";
966             optionStr += ">" + DBHelper.getValue(sys, "fieldname") + "</option>";
967         }
968         if (colAll.lastIndexOf(";") != -1) {
969             colAll = colAll.substring(0, colAll.lastIndexOf(";"));
970         }
971
972         if (colAllDataType.lastIndexOf(";") != -1) {
973             colAllDataType = colAllDataType.substring(0, colAllDataType.lastIndexOf(";"));
974         }
975         colAll = colAll + "|" + colAllDataType;
976
977         selectStr += "\r\n<option value=\"" + colAll + "\" selected=\"selected\">查询所有字段</option>";
978         selectStr += optionStr;
979         selectStr += "</select>&nbsp;&nbsp;";
980         selectStr += "<input id=\"dataType\" type=\"hidden\" value=" + colAll + "/>";
a6789a 981         selectStr += "\r\n<span class=\"preciseQuery\">精确查询" + getCheck("jqcz",panelBean)
X 982                 + "</span>&nbsp;&nbsp;<a href=\"javascript:getOder();\" class=\"easyui-linkbutton\" data-options=\"iconCls:'icon-search'\" style=\"width:80px\">查询</a>";
a6a76f 983         //+ "<a href=\"\" class=\"easyui-linkbutton\" onclick=\"getOder();\" value=\"查找\"/>";
F 984         // 清除第一个默认值
985         String showValue = panelBean.initialValue.getInv(map);
986         if (!showValue.trim().equals("")) {
987             selectStr += getSelectfun(showValue, "colis");
988         }
989         return selectStr;
990     }
991
992     /**
993      * 35类型控件。录入+下拉组合框
994      * @param mapW
995      * @param shuai
996      * @return
997      * @throws Exception
998      */
999     private String getOptionEdit(Map<String, Object> mapW, boolean shuai) throws Exception {
1000         String selectStr = "";
1001         PanelBean panelBean= (PanelBean) mapW.get(PANEL_INFO);
1002         String id=panelBean.pHelper.id;
1003         int len = DBHelper.getValueInt(mapW, "tdLen") - 28;
1004         // 暂时用,没设置tdLen
1005         if (shuai) {
1006             len = 100;
1007         }
1008         if (DBHelper.getValue(mapW, "SqlScript") == null || DBHelper.getValue(mapW, "SqlScript").trim().equals("")) {
1009             selectStr = "<div style=\"position:relative;\"><span style=\"width:" + (len + 23)
1010                     + "px;overflow:hidden;\"><select onmouseover=\"" + panelBean.sqlContype + "\"  onkeydown=\"keyDown('" + id
1011                     + "',event);\"  style=\"\" onPropertyChange=\"set35('" + id //width:" + (len + 18) + "px;height:20px;
780a47 1012                     + "');upSub('" + id + "',@index@)\" onchange=\"set35('" + id + "');upSub('" + id + "',@index@)\" onclick=\"set35('"
a6a76f 1013                     + id + "');\" id=\"" + id + "_35\" class=\"" + getControls(mapW) + "\">";
F 1014             String sql = "select * from _sysdict where dictid = " + DBHelper.getValueInt(mapW, "FT");
1015             List<HashMap<String, String>> list = null;
1016             list = sqlDBHelperIfc.getHashMap(sql);
1017             for (HashMap<String, String> map : list) {
1018                 selectStr += "\r\n<option value=\"" + DBHelper.replaceBr(map.get("intervalue")) + "\" ";
1019                 selectStr += ">" + map.get("dictvalue") + "</option>";
1020             }
1021             selectStr += "</select></span>";
1022             selectStr += "<input type = \"text\" name=\"" + id + "\" id=\"" + id + "\" " + panelBean.maxl + "  style=\"position:absolute;left:0px;border-radius: 5px 0px 0px 5px;\" "
1023                     + "class=\"controlszh"+DBHelper.getValueInt(mapW, "LengthNum")+" controlsr" + DBHelper.getValueInt(mapW, "HeightNum") + "\" value=\"" + getJspValue(id)//input35
1024                     + "\">" + getSelectfun(getJspValue(id), id + "_35");
1025             selectStr += "</div>";
1026         } else {
1027             selectStr += "<div style=\"position:relative;\"><span style=\"width:" + (len + 23)
1028                     + "px;overflow:hidden;\"><select onmouseover=\"" + panelBean.sqlContype + "\"  onkeydown=\"keyDown('" + id
1029                     + "',event);\"  style=\"\" onPropertyChange=\"set35('" + id//width:" + (len + 18) + "px;height:20px;
780a47 1030                     + "');upSub('" + id + "',@index@)\" onchange=\"set35('" + id + "');upSub('" + id + "',@index@)\" onclick=\"set35('"
a6a76f 1031                     + id + "');\" id=\"" + id + "_35\" class=\"" + getControls(mapW) + "\"><%";
F 1032             selectStr += "\r\n  sql = \""
1033                     + DBHelper.replaceBr(panelBean.initialValue.getValLinShi(DBHelper.getValue(mapW, "SqlScript"), true)) + "\";";
1034             selectStr += "\r\n  SRS = build.getSqlRowSet(DBHelper.getValRepShi(sql,session,docMap, false));";
1035             selectStr += "\r\n    while(SRS.next()){ ";
1036             selectStr += "%><option value=\"<%=DBHelper.replaceBr(SRS.getString(1)) %>\" ><%=SRS.getObject(2) %></option>";
1037             selectStr += " <%}%>";
1038             selectStr += "</select></span><input type = \"text\" name=\"" + id + "\" id=\"" + id + "\" " + panelBean.maxl
1039                     + "  style=\"position:absolute;left:0px;border-radius: 5px 0px 0px 5px;\" class=\"controlszh"+DBHelper.getValueInt(mapW, "LengthNum")+" controlsr" + DBHelper.getValueInt(mapW, "HeightNum") + "\" value=\"" + getJspValue(id)//input35
1040                     + "\"></div>" + getSelectfun(getJspValue(id), id + "_35");
1041         }
1042         return selectStr;
1043     }
1044
1045     /**
1046      * 42类型控件。文本框+录入时动态下拉提示选择框
1047      * @param map
1048      * @param shuai
1049      * @return
1050      * @throws Exception
1051      */
1052     private String getShowFrom42(Map<String, Object> map, boolean shuai) throws Exception {
5f1f90 1053         int rod = (int) (Math.random() * 1000 + 1);// 生成1000之内的随机数
a6a76f 1054         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
F 1055         String id=panelBean.pHelper.id;
5f1f90 1056         String divId="T_"+DBHelper.getValue(map, "ft")+"_"+rod+"div";
X 1057         String tableId="T_"+DBHelper.getValue(map, "ft")+"_"+rod+"CDiv";
1058         panelBean.pHelper.div42="<div id=\""+divId+"\" style=\"z-index:9999;display:none;position:absolute;height:auto;max-height:320px;overflow:auto;\">" +
1059                 "<table id=\""+tableId+"\" lay-filter=\""+tableId+"\" " +
9c003c 1060                 getSuggestFilds(DBHelper.getValue(map, "ft"),DBHelper.getValue(map, "SuggestFileds"),DBHelper.getValueInt(map, "ftformtype"))+">" +
5f1f90 1061                 "</table></div>\t\n";
a6a76f 1062         String s_ = "";
F 1063         s_ += getReadOnly(map); // 是否只读
5f1f90 1064         //添加data-xxx属性 xin 2021-3-17 15:54:36
X 1065         String data="data-index=\"@index@\" data-rod=\""+rod+"\" data-relation=\""+DBHelper.getValue(map, "RelationField")+"\" data-sugges=\""+DBHelper.getValue(map, "SuggestFileds")+"\"";
a6a76f 1066         String str = "<input id=\"" + id + "Tree\" value=\""
F 1067                 + ((DBHelper.getValueInt(map, "ReadOnly") == 1) ? "0" : "1") + "\" type=\"hidden\" />";
1068         if (DBHelper.getValueInt(map, "HeightNum") > 1) {
db63a0 1069             str += "<textarea autocomplete=\"off\" class=\"isControl42 Three_show " + getControls(map) + "\" id=\"" + id + "\"  name=\"" + id + "\" "
a6a76f 1070                     + s_ + ">" + getJspValue(id) + "</textarea>";
F 1071         } else {
db63a0 1072             str += "<input autocomplete=\"off\" class=\"isControl42 Three_show " + getControls(map) + "\" id=\"" + id + "\"  name=\"" + id
5f1f90 1073                     + "\" size=\"15\" " + s_ + " value=\"" + getJspValue(id) + "\"  "+data+" />";
a6a76f 1074         }
F 1075         return str;
1076     }
1077
1078     /**
1079      * 43类型控件。下拉列表复选框
1080      *
1081      * @param map
1082      * @param shuai
1083      * @return
1084      * @throws Exception
1085      */
1086     private String getSelect43(Map<String, Object> map, boolean shuai) throws Exception {
1087         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
1088         String id=panelBean.pHelper.id;
1089         List<String> list = DBHelper.getStrRepInfo(DBHelper.replaceBr(DBHelper.getValue(map, "SqlScript"))+DBHelper.replaceBr(DBHelper.getValue(map, "SqlWhere")), "&");
1090         if(list!=null && list.size()>0) {
1091              HashSet<String> set = new HashSet<String>(list); 
1092              for(String key:set) {
1093                 key=key.toLowerCase();
1094                  panelBean.selectMap.put(key, id+(panelBean.selectMap.get(key)!=null?";"+panelBean.selectMap.get(key):""));
1095              }   
1096         }       
1097         String select = "<input id=\"" + id + "text\" name=\"" + id + "text\" value=\"" + getJspValue(id)
1098                 + "\" type=\"hidden\">\r";
1099         select += " <select id=\"" + id + "\" class=\"js-" + id + " " + getControls(map) + "\" multiple=\"multiple\" ";
1100         select += getReadOnly(map);// style样式 1
1101         select += " ></select>\r";
1102         select += " <script>" + panelBean.sqlContype + "</script>";
1103         if (shuai) {
1104             select = getAll(map, select, shuai);// 权限控制
1105         }
1106         return select;
1107     }
1108
45dcf7 1109     /**
X 1110      * 静态图标控件
1111      * @param map
1112      * @param shuai
1113      * @return
1114      * @throws Exception
1115      */
1116     private String getBigIcon44(Map<String, Object> map, boolean shuai) throws Exception {
1117         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
1118         String id=panelBean.pHelper.id;
1119         String maxl=panelBean.maxl;
1120         map.put("readonly",1);//只读
1121         String icon = "<input type=\"" + ((DBHelper.getValueInt(map, "passwordchar") == 1) ? "password" : "text")
1122                 + "\" ";
1123         icon += icon + " id=\"" + id + "\"  name=\"" + id + "\" " + maxl + " class=\"text isBigIcon " + getControls(map)
1124                 + "\" value=\"" + getJspValue(id) + "\" ";
1125         icon = getAll(map, icon, true);// 这里可以提出来,还是提出来
1126         icon += getChange(panelBean); // 值发生改变处理
1127         icon += " />";
1128         icon +="<span class=\"bigIconImg44\" onclick=\"openIcon('"+id+"')\" title=\"点击浏览\">" +
1129                 "<img id=\""+id+"-img44\" src=\"" + getJspValue(id) + "\"></span>";
1130         return icon;
1131     }
5b18c2 1132
X 1133     /**
1134      * 获取取色器
1135      * @param map
1136      * @param shuai
1137      * @return
1138      * @throws Exception
1139      */
1140     private String getColorFinder(Map<String, Object> map, boolean shuai) throws Exception {
1141         PanelBean panelBean = (PanelBean) map.get(PANEL_INFO);
1142         String id = panelBean.pHelper.id;
f60489 1143         //设置有sql条件(31控件类型)
X 1144         if(StringUtils.isNotBlank(DBHelper.getValue(map,"SqlWhere"))){
1145             String sql=DBHelper.getValue(map,"SqlWhere");
1146             String getBackStr=panelBean.getBackStr;
1147             boolean toKeBack=panelBean.toKeBack;
1148             String getAll = getBackStr + ((panelBean.keyBack) ? "keyDown('" + id + "',event);" : "");
1149             String getAllChan = getBackStr + ((toKeBack) ? "keyDown('123',event);" : "");
1150             String getChan = ((toKeBack) ? "keyDown('123',event);" : "");
1151             //判断是否只读
1152             boolean b=false;//默认组装进行
1153             b=(DBHelper.getValueInt(map, "ReadOnly") == 1?true:b);//只读状态不需要组装
1154             String selectStr="";
1155             selectStr += "\r\n<%try{";
1156             selectStr += "\r\n      sql = \"" + sql + "\";";
1157             selectStr += "\r\n      sql = DBHelper.getSqlWhere(sql,"+b+",\""+DBHelper.getValue(map, "editStatus")+"\",DBHelper.getValue(docMap,\"docstatus\"),\""+DBHelper.replaceBr(DBHelper.getValue(map, "SqlWhere"))+"\");";
1158             selectStr += "\r\n      SRS = build.getSqlRowSet(DBHelper.getValRepShi(sql,session,docMap, false));";
1159             selectStr += "\r\n %>";
1160             selectStr += "\r\n <input id=\"" + id + "text\" name=\"" + id + "text\" value=\"" + getJspValue(id)
1161                     + "\" type=\"hidden\">\r";
1162             selectStr += "<select class=\""+getControls(map)+"\" onchange=\"getColors46('" + id + "');getBackElse=true;"
780a47 1163                     + getAllChan + "upSub('" + id + "',@index@);\" "+getReadOnly(map)// 后加
X 1164                     + " onPropertyChange=\"if(panMain[panIndex].no_load_first){upSub('" + id + "',@index@);" + getChan
f60489 1165                     + "}\" onkeydown=\"" + getAll + "key_Delete_Selete(event,'" + id + "');\" name=\"" + id + "\" size=\"1\" id=\"" + id + "\">";
c8bf0a 1166             if (DBHelper.getValueInt(map, "issuppressblanklinefordropdown") != 1) {
X 1167                 selectStr += "\r\n      <option value style=\"background-color:white;color:white\"></option>";
1168             }
f60489 1169             selectStr += "\r   <% while(SRS!=null && SRS.next()){%> ";
X 1170             selectStr += "\r\n      <option value=\"<%= DBHelper.replaceBlank(SRS.getString(1))%>\" " +
1171                     "    style=\"background-color:<%= DBHelper.replaceBlank(SRS.getString(1))%>\"></option>";//<%=SRS.getObject(2)%>
1172             selectStr += "\r\n <% }%>";
1173             selectStr += "\r\n </select>";
1174             selectStr += "\r\n<%}catch(Exception e){";
1175             selectStr += "\r\n      throw e;";
1176             selectStr += "\r\n}%>\r\n";
1177             selectStr += getSelectfun(getJspValue(id), id);
1178             return selectStr;
1179         }
1180         //设置有外表单号(2控件类型)
1181         if(StringUtils.isNotBlank(DBHelper.getValue(map,"FT"))){
1182             return getColorOptions(map);
1183         }
c112a6 1184         String color = "<input type=\"color\" id=\""+id+"\" class=\""+getControls(map)+"\" value=\""+getJspValue(id)+"\"";
5b18c2 1185         color += getReadOnly(map);// 这里可以提出来,还是提出来
c112a6 1186         color += "/>";
5b18c2 1187         return color;
X 1188     }
1189
1190     /**
1191      * 进度条
1192      * @param map
1193      * @param shuai
1194      * @return
1195      * @throws Exception
1196      */
1197     private String getProgressBar(Map<String, Object> map, boolean shuai) throws Exception {
1198         PanelBean panelBean = (PanelBean) map.get(PANEL_INFO);
1199         String id = panelBean.pHelper.id;
1200         String data="data-id=\""+id+"\"";
1201         String bar = "<div "+data+" class=\"progressBar47 " + getControls(map) + "\"></div>";
1202         bar += "<input type=\"hidden\" id=\"" + id + "\" value=\"" + getJspValue(id) + "\">";
1203         return bar;
1204     }
1205
a6a76f 1206     /**
a724cc 1207      * css样式控件生成
X 1208      * @param map
1209      * @param shuai
1210      * @return
1211      * @throws Exception
1212      */
1213     private String getTextCssEdit(Map<String, Object> map, boolean bol)throws Exception{
1214         PanelBean panelBean = (PanelBean) map.get(PANEL_INFO);
1215         String id = panelBean.pHelper.id;
1216         String str = "";
1217         String s_ = getReadOnly(map); // 是否只读
1218         if (DBHelper.getValueInt(map, "HeightNum") > 1) {
1219             str += "<textarea class=\" Three_show " + getControls(map) + "\" id=\"" + id + "\" "
1220                     + "name=\"" + id + "\" " + s_ + " >" + getJspValue(id)
1221                     + "</textarea>";
1222         } else {
1223             str += "<input autocomplete=\"off\" class=\" Three_show " + getControls(map) + "\" id=\"" + id + "\"  "
1224                     + "name=\"" + id + "\" size=\"15\" " + s_ + "  value=\""
1225                     + getJspValue(id) + "\"  />";
1226         }
1227         String style = "";
1228         if (!DBHelper.getValue(map, "tabs38").equals("null")) {
1229             style = "position:absolute;z-index:1;margin-top:2px;";
1230         } else {
1231             int i = (DBHelper.getValueInt(map, "Hidelabel") == 1 ? 0 : 116);
1232             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;";
1233         }
1234         str += "<span  class=\"AllShowType\" style=\"" + style + "border:0px solid #000000;\">"
1235                 + "<img src=\"/images/ppp.gif\" id=\"" + id + "_click\" style=\"cursor: pointer;margin-left:-16px;\"  onclick=\""
1236                 + (panelBean.treeMus ? "musChoies=true;" : "") + "getTextCssEdit({'id':'" + id + "','index':'@index@','onlyOne':'"
1237                 + DBHelper.getValueInt(map, "onlyOne") + "'});" + (panelBean.treeMus ? "musChoies=false;" : "") + "\"/></span>";
1238         return str;
1239     }
1240
1241     /**
a6a76f 1242      * 获得权限控制
F 1243      * @param sys
1244      * @throws Exception
1245      */
1246     private void getPermission(Map<String, Object> sys) throws Exception {
1247         PanelBean panelBean= (PanelBean) sys.get(PANEL_INFO);
1248         if (";34;".indexOf(";" + DBHelper.getValue(sys, "ControlType") + ";") == -1) {
1249             if (!DBHelper.getValue(sys, "EditStatus").trim().equals("")) {// 再加上判断状态,看看是否可以编辑,则此控件基本就可以了
1250                 JsonArray read=new JsonArray();
1251 //                fun = "0;pb#" + DBHelper.getValue(sys, "EditStatus") + ";pb#" + id + ";pb#"
1252 //                        + ((hasButton) ? "true" : "false") + ";pb#" + DBHelper.getValue(sys, "ControlType");
1253                 read.add(0);
1254                 read.add(DBHelper.getValue(sys, "EditStatus"));
1255                 read.add(panelBean.pHelper.id);
1256                 read.add(((panelBean.hasButton) ? "true" : "false"));
1257                 read.add(DBHelper.getValue(sys, "ControlType"));
1258                 setFunLoadList(read, false,panelBean);
1259             }
1260             if (DBHelper.getValueInt(sys, "ReadOnly") == 1) {// 只读,js处理,避免一些未能考虑到,可以在js中逐步实现,不必要来更改类
1261                 JsonArray read=new JsonArray();
1262 //                fun = "1;pb#" + id + ";pb#" + DBHelper.getValue(sys, "ControlType");
1263                 read.add(1);
1264                 read.add(panelBean.pHelper.id);
1265                 read.add(DBHelper.getValue(sys, "ControlType"));
1266                 setFunLoadList(read, false,panelBean);
1267             }
1268         }
1269     }
1270
1271     /**
1272      * f 通过,驳回,下一步 等等的审核
1273      *
1274      * @param map
1275      * @return
1276      * @throws Exception
1277      */
1278     private String getButtonNext(Map<String, Object> map) throws Exception {
1279         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
1280         String id=panelBean.pHelper.id;
1281         panelBean.hasButton = false;
1282         String buttonStr = "<span id=\"" + id + "ButtonS\" style=\"position: absolute; margin-top: -15;\">"
1283                 + "<%if(bdMap.size()>0){%><table width=\"@butwidth@\"> <tr>";// <%if(atMap.size()>0&&nb){%>
1284         String addtd = "<td align=\"right\">";
1285         String onclickStr = "";
1286         String butwidht = "145";
1287         int cont = 0;
1288         if (panelBean.buttonList != null && panelBean.buttonList.size() > 0) {
1289             for (Map<String, Object> buttonMap : panelBean.buttonList) {// 查询按钮集合中是否有当前字段,有则在此上加按钮
1290                 if (DBHelper.getValue(buttonMap, "fieldid").toLowerCase().equals(id)) {
1291                     String pawString = (DBHelper.getValueInt(buttonMap, "isShowPwdEdit") == 1) ? "true" : "false";// 弹出密码框
1292                     String ReturnCurChecker = DBHelper.getValue(buttonMap, "ReturnCurChecker");
1293                     String ReturnCurCheckerName = DBHelper.getValue(buttonMap, "ReturnCurCheckerName");
1294                     boolean isInspection = (DBHelper.getValueInt(buttonMap, "isInspection") == 1 ? true : false);// 是否禁止必录检查
1295                     String getBtnStr = pawString + ",'" + DBHelper.getValueInt(buttonMap, "formid") + "',"
1296                             + "'<%=URL%>/',this," + isInspection + ",'" + DBHelper.getValue(buttonMap, "ExternalURL")
1297                             + "'," + DBHelper.getValueInt(buttonMap, "UrlShowLocation") + ","
1298                             + DBHelper.getValue(buttonMap, "buttonID");
1299                     String url1 = DBHelper.getValueInt(buttonMap, "FT") + "/"
1300                             + DBHelper.getValueInt(buttonMap, "FTFormType") + "/index.jsp";
1301                     switch (DBHelper.getValueInt(buttonMap, "SelectChecker")) {
1302                         case 0:
1303                             onclickStr = "getBtn(" + getBtnStr + ");";
1304                             break;
1305                         case 1:
1306                             onclickStr = "createPopSelect('" + ReturnCurChecker + "','" + ReturnCurCheckerName + "',"
1307                                     + getBtnStr + ");";
1308                             break;
1309                         case 2:
1310                             onclickStr = "mulChoice2('" + DBHelper.getValue(buttonMap, "FK") + "','"
1311                                     + DBHelper.getValue(buttonMap, "SeekGroupID") + "','"
1312                                     + DBHelper.getValue(buttonMap, "sPremissField") + "','"
1313                                     + DBHelper.getValue(buttonMap, "dPremissField") + "','"
1314                                     + DBHelper.getValue(buttonMap, "FKeFilter") + "','<%=URL%>/app'+spellPath+'" + url1
1315                                     + "'," + getBtnStr + ");";
1316                             break;
1317                         default:
1318                             break;
1319                     }
1320                     if (cont > 1) {
1321                         butwidht = "175";
1322                     }
1323                     cont++;
1324                     String parString = id + ";" + DBHelper.getValue(buttonMap, "docitem");
1325                     String bds = "<%if(DBHelper.getValue(bdMap,\"" + DBHelper.getValue(buttonMap, "buttonID")
1326                             + "\").equals(\"1\")){%>";
1327                     buttonStr += addtd + bds + "<input id=\"" + DBHelper.getValue(buttonMap, "buttonID")
1328                             + "\" type=\"button\" class=\"easyui-linkbutton l-btn-text\" style=\"width:"+(DBHelper.getValue(buttonMap, "ButtonName").length())*20+"px;\" "
1329                             + "value=\"" + DBHelper.getValue(buttonMap, "ButtonName")
1330                             + "\" onClick=\"setOa('" + parString + "');" + onclickStr + "\" /><%}%></td>";// +"<%}%>";//<%if(docstatePan==DBHelper.getValueInt(atMap,\""+DBHelper.getValue(buttonMap,
1331                     // "buttonID")+"\")){%>
1332                     panelBean.hasButton = true;
1333                 }
1334             }
1335         }
1336         if (panelBean.hasButton) {
1337             int tdLen = DBHelper.getValueInt(map, "tdLen") - 120;
1338             map.remove("tdLen");
1339             map.put("tdLen", tdLen);
1340         }
1341         buttonStr = buttonStr.replace("@butwidth@", butwidht);
1342         buttonStr += "</tr></table><%}%></span>";// <%}%>
1343         return panelBean.hasButton ? buttonStr : "";
1344     }
1345
1346     private String getMassterCodeKeyDown(Map<String, Object> map, boolean shuai) throws Exception {// 这有一定用,很多没有设置信息却又带回了值,依照这个解决
1347         String iniv = DBHelper.getValue(map, "InitValue");
1348         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
1349         String reString = "";
1350         String upinv = null;
1351         if (DBHelper.getValueInt(map, "FT") != 0) {
1352             reString = "(event,'" + panelBean.pHelper.id + "','@index@');";
1353             if (iniv != null) {
1354                 upinv = iniv.toUpperCase().trim();
1355                 reString = (("MASTERCODE".equals(upinv)) ? "getBackAll" : "getBack") + reString;
1356             } else {
1357                 reString = "getBack" + reString;
1358             }
1359         }
1360         return reString;
1361     }
1362
1363
1364     public String getSelectAndCheckBox(String fieldid, String StatisID, String StatisType, String fieldCaption, PanelBean panelBean)
1365             throws Exception {
1366         panelBean.bian38++;//
1367         panelBean.pHelper.id = fieldid.toLowerCase();// "checkId__" + bian38;
1368         String checkId2 = panelBean.pHelper.id + "vulue"; // 复选框
1369         String str = "<input id=\"" + panelBean.pHelper.id + "\" name=\"checkName\" type=\"checkbox\" onchange='checkChange()' />";
1370         str += "<input type=\"hidden\" id='" + checkId2 + "' name=\"" + checkId2 + "\" value=\"" + StatisID + "#P#"
1371                 + fieldid + "#P#" + StatisType + "#P#" + fieldCaption + "\">";// 后改
1372         // by
1373         // danaus
1374         // 因为字段名有可能是自定义sql,会存在,号的情况
1375         return str;
1376     }
1377
1378     public String getSelectAndCheckBoxs(String s, String StatisID, String fieldid, String FieldAlias, String StatisType,
1379                                         String Sequence, String DisplayWidth, String displayformat, String displayYN, String isFilterZero,
1380                                         String jionFlag, String jionFlagGroup, String conFlag, String modfvalues, String modfvalues2,
1381                                         String FieldCaption,PanelBean panelBean) throws Exception {
1382         panelBean. bian38++;//
1383         panelBean.pHelper.id = fieldid.toLowerCase();// "checkId__" + bian38;
1384         // int a=0;
1385         String checkId2 = s; // 复选框
1386         // a++;
1387         String str = "<input id=\"" + panelBean.pHelper.id + "\" name=\"checkName\" type=\"hidden\" onchange='checkChange()' />";
1388         str += "<input type=\"hidden\" id='" + checkId2 + "' name=\"" + checkId2 + "\" value=\"" + StatisID + "#P#"
1389                 + fieldid + "#P#" + FieldAlias + "#P#" + StatisType + "#P#" + Sequence + "#P#" + DisplayWidth + "#P#"
1390                 + displayformat + "#P#" + displayYN + "#P#" + isFilterZero + "#P#" + jionFlag + "#P#" + jionFlagGroup
1391                 + "#P#" + conFlag + "#P#" + modfvalues + "#P#" + modfvalues2 + "#P#" + FieldCaption + "\"></input>";// 后改
1392         // by
1393         // danaus
1394         // 因为字段名有可能是自定义sql,会存在,号的情况
1395
1396         return str;
1397     }
1398
1399     public String getSelectAndCheckBoxss(String StatisID, String fieldid, String FieldAlias, String StatisType,
1400                                          String Sequence, String DisplayWidth, String displayformat, String displayYN, String isFilterZero,
1401                                          String jionFlag, String jionFlagGroup, String conFlag, String modfvalues, String modfvalues2,
1402                                          String FieldCaption, PanelBean panelBean) throws Exception {
1403         panelBean.bian38++;//
1404         panelBean.pHelper.id = fieldid.toLowerCase();// "checkId__" + bian38;
1405         String str = StatisID + "#P#" + fieldid + "#P#" + FieldAlias + "#P#" + StatisType + "#P#" + Sequence + "#P#"
1406                 + DisplayWidth + "#P#" + displayformat + "#P#" + displayYN + "#P#" + isFilterZero + "#P#" + jionFlag
1407                 + "#P#" + jionFlagGroup + "#P#" + conFlag + "#P#" + modfvalues + "#P#" + modfvalues2 + "#P#"
1408                 + FieldCaption + "&#039;";// 后改 by danaus
1409         // 因为字段名有可能是自定义sql,会存在,号的情况
1410
1411         return str;
1412     }
1413
1414     /**
1415      * 给控件设置长高
1416      * @param map
1417      * @return
1418      */
1419     private String getControls(Map<String, Object> map) {
1420         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
1421         String controls = (DBHelper.getValueInt(map, "Hidelabel") == 1 ? "controlsm" : "controlsc");
1422         controls += DBHelper.getValueInt(map, "LengthNum");
fc3567 1423         controls += " AllControlsWH";
a6a76f 1424         if (DBHelper.getValueInt(map, "ControlType") == 38) {
F 1425             controls += " controlsd"+DBHelper.getValueInt(map, "HeightNum");
1426         } else {
1427             controls += ((DBHelper.getValueInt(map, "ControlType") == 9
1428                     || DBHelper.getValueInt(map, "ControlType") == 19 ) ? ""
1429                     : " controlsr" + DBHelper.getValueInt(map, "HeightNum"));
1430         }
1431         //在选页卡里面的控件需要添加这个css-xin 2018-11-5 15:20:33       
1432         if(!DBHelper.getValue(map, "tabs38").equals("null")){
1433              int i=DBHelper.getValueInt(panelBean.control38height, DBHelper.getValue(map, "tabsheetname"));
1434              if(i>0 && DBHelper.getValueInt(map, "RowNo")<i) {
1435                  controls+=" z_indexTabs";
1436              }else if(i>0 && DBHelper.getValueInt(map, "RowNo")==i) {
1437                  controls+=" jiaNum";
1438              }
1439         }
1440         return controls;
1441     }
1442
1443     /**
1444      * 精准查找
1445      * @param ids
1446      * @return
1447      * @throws Exception
1448      */
1449     private String getCheck(String ids,PanelBean panelBean) throws Exception {
1450         String str = "";
1451         String checkId = ids + "CheckBox";
1452         str += "<input id=\"" + checkId + "\" name=\"" + checkId + "\" type=\"checkbox\" ";
8fc570 1453         str += " style=\"width:15px;height:15px;margin-left:5px;\" ";
a6a76f 1454         str += getKeyDown(panelBean);
F 1455         str += " onClick=\"document.getElementById('" + ids + "').value=document.getElementById('" + checkId
1456                 + "').checked ? '1' : '0' ;\" />" + "<input type=\"hidden\" id='" + ids + "' name=\"" + ids
1457                 + "\" value=\"0\" onPropertyChange=\"cheeckValueChan('" + panelBean.pHelper.id + "')\">";
1458         return str;
1459     }
1460
1461     /**
1462      * 42类型控件调用到
1463      * sugg--列表显示的字段 backFilds-取外表字段,以便选择后返回哪些值。 tp ---自表字段,返回给哪些字段
9c003c 1464      * ftformtype的值是关联表号的对应窗体类型
a6a76f 1465      */
9c003c 1466     public String getSuggestFilds(String ft, String sugg,int ftformtype) {// 取得需要的字段名称
X 1467         int flg = 0;
1468         if (ftformtype == 20) {//20窗体类型是从表
1469             flg = 1;
1470         }
1471         List<Map<String, Object>> suglit = new ArrayList<>();
5f1f90 1472         try {
701c49 1473             String sql = " select FieldID,fieldname,controltype,displayformat,GridCaption,ShowOnGrid from gfield where formid=? and HeadFlag=?  order by statisid asc";
5f1f90 1474             List<Map<String, Object>> list = gridService.getSimpleJdbcTemplate().queryForList(sql,
9c003c 1475                     new Object[]{ft, flg});
5f1f90 1476             String[] tem = sugg.replaceAll(",", ";").split(";");
9c003c 1477             for (String sug : tem) {
5f1f90 1478                 for (Map<String, Object> map : list) {
X 1479                     if (sug.equalsIgnoreCase((String) map.get("FieldID"))) {
9c003c 1480                         Map<String, Object> sugMap = new HashMap<>();
5f1f90 1481                         sugMap.put("field", sug.toLowerCase());
X 1482                         sugMap.put("title", map.get("fieldname") == null
1483                                 ? (String) map.get("GridCaption") : (String) map.get("fieldname"));
701c49 1484                         sugMap.put("controlType", DBHelper.getValueInt(map,"controltype"));
X 1485                         sugMap.put("displayformat", DBHelper.getValue(map,"displayformat"));
b2d631 1486 //                        sugMap.put("width", 150);
5f1f90 1487                         sugMap.put("align", "center");
X 1488                         if (GridUtils.prossRowSetDataType_Int(map, "ShowOnGrid") <= 0) {
1489                             sugMap.put("hide", true);//隐藏
1490                         }
1491                         suglit.add(sugMap);
a6a76f 1492                     }
F 1493                 }
1494             }
9c003c 1495             return "data-title=\"" + GridUtils.toJson(suglit).replaceAll("\"", "'") + "\" ";
X 1496         } catch (Exception e) {
1497             return "";
a6a76f 1498         }
F 1499     }
1500
1501     private String getSelectfun(String showValue, String kongId) throws Exception {
1502         return getScriptFun("seletMorenOrValue('" + showValue + "','" + kongId + "');");// 转换一个函数,避免与页面逻辑共用一个函数出错
1503     }
1504
1505     private String getCheckFun(String kongId) throws Exception {
1506         return getScriptFun("cheeckSValueChan('" + kongId + "');");
1507     }
1508
1509     private String getRadiosFun(String id) throws Exception {
1510         return getScriptFun("radioValueChan('" + id + "');");
1511     }
1512
1513     private String getScriptFun(String fun) throws Exception {
1514         return "<script type=\"text/javascript\">" + fun + "</script>\r\n";//language=\"javascript\"
1515     }
1516
1517     // ----------------map
1518     private String getAll(Map<String, Object> sys, String str, boolean shuai) throws Exception {
1519         PanelBean   panelBean=(PanelBean)sys.get(PANEL_INFO);
1520         if (shuai) {
1521             str += getReadOnly(sys); // 是否只读
1522             str += getKeyDown(panelBean); // 键盘按下处理
1523         } else {
1524             str += getReadOnly(sys); // 是否只读
1525             str += getChange(panelBean); // 值发生改变处理
1526             str += getKeyDown(panelBean); // 键盘按下处理
1527         }
1528
1529         return str;
1530     }
1531
1532     private String getChange(PanelBean panelBean) throws Exception {
1533         String yanZheng = "";// 添加验证脚本
1534         yanZheng = getVerification(panelBean).trim();
780a47 1535         String str = " onPropertyChange=\"" + yanZheng + panelBean.dyfieldStr + "upSub('" + panelBean.pHelper.id + "',@index@);\" onChange=\"" + yanZheng
X 1536                 + "upSub('" + panelBean.pHelper.id + "',@index@);\"";
a6a76f 1537         return str;
F 1538     }
1539
1540     private String getVerification(PanelBean panelBean) throws Exception {
1541         String yanZheng = "";
1542         if (panelBean.pHelper.verificationMap != null && panelBean.pHelper.verificationMap.size() > 0) {
1543             if (panelBean.pHelper.verificationMap.get(panelBean.pHelper.id) != null) {
1544                 switch (Integer.parseInt(panelBean.pHelper.verificationMap.get(panelBean.pHelper.id))) {
1545                     case 1:// 数字
1546                         yanZheng = "math(/^[-]?[0-9]*[.]?[0-9]*$/,'" + panelBean.pHelper.id + "','输入必须数字');";
1547                         break;
1548                     case 2:// 表示text,ntext,image之类
1549                         break;
1550                     case 3:// 字符
1551                         break;
1552                     case 4:// 日期
1553                         break;
1554                     default:
1555                         break;
1556                 }
1557             }
1558         }
1559         return yanZheng;
1560     }
1561
1562     private String getKeyDown(PanelBean panelBean) throws Exception {
1563         return (panelBean.keyBack) ? " onkeydown=\"keyDown('" + panelBean.pHelper.id + "',event);\" " : "";
1564     }
1565
1566     /**
1567      * 只读
1568      * @param map
1569      * @return
1570      * @throws Exception
1571      */
1572     private String getReadOnly(Map<String, Object> map) throws Exception {
1573         PanelBean panelBean= (PanelBean) map.get(PANEL_INFO);
1574         PanelParmHelper pHelper = panelBean.pHelper;
1575         int hei = pHelper.rowHei * DBHelper.getValueInt(map, "HeightNum");
1576         hei = ((pHelper.kongHei != pHelper.rowHei && DBHelper.getValueInt(map, "HeightNum") != 1)
1577                 ? 2 * hei - pHelper.rowHei - 6 : hei) - 6;
1578         String str = "style=\"";
1579         if (DBHelper.getValue(map, "styleCss").indexOf("!") != -1) {
1580         } else {
1581             String fenh = DBHelper.getValue(map, "styleCss");
1582             if (!"".equals(fenh)) {
1583                 boolean bol = (fenh.substring(fenh.length() - 1, fenh.length()).indexOf(";") != -1);
1584                 str += DBHelper.getValue(map, "styleCss") + (bol ? "" : ";");
1585             } else {
1586                 str += fenh;
1587             }
1588         }
1589         if (DBHelper.getValueInt(map, "uppercase") == 1) {// 大写形式输入
1590             str += " text-transform: uppercase;";
1591         }
1592         if(DBHelper.getValueInt(map, "ControlType")==31 || DBHelper.getValueInt(map, "ControlType")==2){
1593             str += "height:24px;";
1594         }
1595         if (DBHelper.getValueInt(map, "ReadOnly") == 1) {
1596             panelBean.tabindexIs--;// 只读tabindex还原
1597             if (DBHelper.getValue(map, "styleCss") == "" || DBHelper.getValue(map, "styleCss") == null) {
1598                 str += " background:#CCC; border:#999 1px solid; color:#000;\"  readonly=\"readonly\"  ";//
1599             } else {
1600                 if (DBHelper.getValue(map, "styleCss").indexOf("background") != -1) {
1601                 } else {
1602                     str += " background:#CCC; ";
1603                 }
1604                 if (DBHelper.getValue(map, "styleCss").indexOf("border") != -1) {
1605                 } else {
1606                     str += "border:#999 1px solid; ";
1607                 }
1608                 if (DBHelper.getValue(map, "styleCss").indexOf("color") != -1) {
1609                 } else {
1610                     str += "color:#000;";
1611                 }
1612                 str += " readonly=\"readonly\"";
1613             }
1614         } else {
1615             str += " \" tabindex=\"" + panelBean.tabindexIs + "\"";
1616         }
1617         return str;
1618     }
1619
1620     /**
1621      *
1622      *
1623      * 38类型面板上增加的下拉编码实现
1624      *
1625      * @param colId
1626      *            列名
1627      * @param ft
1628      *            设置下拉到外表id
1629      * @param invalue
1630      *            给定的初始值(默认选择项)
1631      * @return 下拉的网页编码
1632      */
1633     public String getOptions(String colId, int ft, String invalue) throws Exception {
1634         String selectStr = "<select ";
1635         selectStr += " name=\"" + colId + "\" size=\"1\" id=\"" + colId + "\">";
1636         String sql = "select * from _sysdict where dictid = " + ft;
1637         List<HashMap<String, String>> list = null;
1638         list = sqlDBHelperIfc.getHashMap(sql);
1639         for (HashMap<String, String> map : list) {
1640             selectStr += "\r\n<option value=\"" + map.get("intervalue") + "\" ";
1641             if (invalue.trim().equals(map.get("dictvalue").trim())) {
1642                 selectStr += " selected ";
1643             }
1644             selectStr += ">" + map.get("dictvalue") + "</option>";
1645         }
1646         selectStr += "</select>";
1647         return selectStr;
1648     }
1649
1650     /**
1651      * 是否必录
1652      * @param map
1653      * @return
1654      * @throws Exception
1655      */
1656     private static String getKeyInput(Map<String, Object> map) throws Exception {
1657         String style="";
1658         if(!DBHelper.getValue(map, "tabs38").equals("null")){
1659             style="style=\"margin-left:"+((256*DBHelper.getValueInt(map, "LengthNum"))-12-8)+"px;position:absolute;\"";
1660         }
1661         return (DBHelper.getValueInt(map, "KeyInput") == 1?
a724cc 1662                 "<div class=\"bilus\" "+style+" title=\"必录\">✲</div>":"<div class=\"bilus\"></div>");
a6a76f 1663     }
F 1664
1665     // 得到隐藏网页代码
1666     public String getHidText(Map<String, Object> sys) throws Exception {
1667         PanelBean panelBean= (PanelBean) sys.get(PANEL_INFO);
1668         getPermission(sys);
1669         if ((DBHelper.getValueInt(sys, "isCustomHTMLComponent") == 1
1670                 && DBHelper.getValueInt(sys, "MasterFieldShowLocation") == 0)) {
1671             return "";// 因为是36控件字段 ,不输出控件,如果不在第二个面板则输出
1672         }
1673         return "<input id=\"" + panelBean.pHelper.id + "\" value=\"" + getJspValue(panelBean.pHelper.id) + "\" type=\"hidden\" />";
1674     }
1675
1676     // 得到_expr隐藏网页代码
1677     public String getHidTextexpr(Map<String, Object> sys) throws Exception {
1678         PanelBean panelBean= (PanelBean) sys.get(PANEL_INFO);
1679         String id=panelBean.pHelper.id;
1680         getPermission(sys);
1681         if ((DBHelper.getValueInt(sys, "isCustomHTMLComponent") == 1
1682                 && DBHelper.getValueInt(sys, "MasterFieldShowLocation") == 0)) {
1683             return "";// 因为是36控件字段 不输出控件,如果不在第二个面板则输出
1684         }
1685         String inp = "";
1686         if (!DBHelper.getValue(sys, "showfieldvalueexpression").equals("")) {
1687             inp += "<input id=\"" + id + "_expr\" value=\"" + getJspValue(id + "_expr") + "\" type=\"hidden\" />";
1688         }
1689         if (!DBHelper.getValue(sys, "stylecss").equals("")) {
1690             inp += "<input id=\"" + id + "_css\" value=\"" + getJspValue(id + "_css") + "\" type=\"hidden\" />";
1691         }
1692         return inp;
1693     }
1694
1695
1696
1697 }