<#setting url_escaping_charset='UTF-8'> <#-- 提取java枚举类型--> <#assign GtType={ "LABEL":"01", "INPUT":"02", "TEXTAREA":"03", "COMBOBOX":"05", "DATEPICKER":"06", "RADIOBOX":"08", "CHECKBOX":"09", "BUTTON":"10", "LINK":"11", "IMG":"12", "SFZ":"18" }> <#-- 准备单选控件的值--> <#assign inputSets= { <#--子类型:[type类型,class名称,最大长度] --> "p":["text","postbox",6],<#-- 邮件编码--> "n":["text","numberbox",50],<#-- 只能输入数字--> "c":["text","chinessbox",50],<#-- 只能输入中文--> "f":["text","floatbox",50],<#-- 只能输入浮点数--> "d":["text","yearmonthbox",6],<#-- 只能输入YYYYMM格式的日期--> "t":["text","timebox",8],<#-- 只能输入时间格式--> "s":["text","datetime",19],<#-- 只能输入日期+时间 格式--> "m":["password","textbox",50],<#-- 密码输入框--> "x":["text","notpastebox",50],<#-- 不能粘贴的输入框--> " ":["text","textbox",50],<#-- 默认--> "b":["text","textbox",50]<#-- 默认--> }> <#assign colNames=(parameters.options.data.headers![])> <#--macro 生成TD--> <#macro GT_TD v_input_comp v_data_one v_row_pos v_col_pos> <#assign v_pname=colNames[v_col_pos]!"" > <#assign compValue = v_data_one[("_DIC_"+v_pname)]!"" hiddenValue = v_data_one[v_pname]!""> <#if compValue==""> <#assign compValue = hiddenValue> <#if hiddenValue?index_of("href")!=-1> <#assign hiddenValue = ""> <#--全部的控件都不用NAME 用rw来表示行 用nd来表示列名,目的为了减少submit时提交的数据量--> <#switch v_input_comp.type> <#case GtType.LABEL> <#break> <#case GtType.INPUT ><#--处理单行输入控件--> <#assign inputTmp=inputSets[v_input_comp.subtype]> <#if (compValue?is_sequence)> <#assign compValue=(compValue[0]?string)!""> <#break> <#case GtType.SFZ ><#--处理身份证 --> <#if (compValue?is_sequence)> <#assign compValue=(compValue[0]?string)!""> <#break> <#case GtType.TEXTAREA ><#--处理多行输入控件 --> <#if (compValue?is_sequence)> <#assign compValue=(compValue[0]?string)!""> <#break> <#case GtType.DATEPICKER ><#--处理日期控件 --> <#if (compValue?is_sequence)> <#assign compValue=(compValue[0]?string)!""> <#break> <#case GtType.BUTTON ><#--处理按钮--> <#if (compValue?is_sequence)> <#assign compValue=(compValue[0]?string)!""> ${compValue} <#break> <#case GtType.CHECKBOX > <#-- 取控件的值--> <#if (hiddenValue?is_sequence)> <#assign hiddenValue=(hiddenValue[0]?string)!""> #assign ck="" value=(v_input_comp.value)!"" chk=v_data_one[v_input_comp.chk]!"" > <#if chk=="1"> <#assign ck="checked"> <#-- 单checkbox处理 --> <#break> <#case GtType.RADIOBOX > <#if (hiddenValue?is_sequence)> <#assign hiddenValue=(hiddenValue[0]?string)!""> <#if (parameters.glt.dict[v_pname])??> <#-- 字典项处理 --> <#assign dicts=parameters.options.data.dicts[v_pname]!{} v_colNum=(v_input_comp.colNum?number)!10 > <#list dicts?keys?chunk(v_colNum) as subkeys> <#list subkeys as key>
<#else> <#break> <#case GtType.COMBOBOX> <#if v_input_comp.subtype!='b'> <#assign v_readOnly='readOnly=true'> <#assign inputTmp=inputSets[v_input_comp.subtype]> /> <#break> <#default> <#--生成单行记录的函数 --> <#macro GLT_TR v_rows_arr v_data_one bFixed irow icolOffset> <#if ((v_rows_arr?size)>0)> <#if bFixed> ${irow+1} <#if parameters.showDelete=="true" > 删除 <#list v_rows_arr as cols> <@GT_TD cols v_data_one irow icolOffset+cols_index/> <#else> <#if bFixed> ${irow+1} <#if parameters.showDelete=="true" > 删除 <#--生成整个表单记录的函数 --> <#macro GLT_DATA v_data_arr bFixed> <#if ((v_data_arr?size)>0)> <#if bFixed> <#list v_data_arr as rows> <@GLT_TR parameters.lastHeaderRow rows true rows_index 0/> <#else> <#list v_data_arr as rows> <@GLT_TR v_colHead rows false rows_index parameters.options.frozenColumns/> <#else> <#if bFixed> <@GLT_TR parameters.lastHeaderRow {} true 0 0/> <#else> <@GLT_TR v_colHead {} false 0 0/> <#macro GLT_HEADER v_head_arr isFixed>
<#if ((v_head_arr?size) > 0 )> <#assign td_rownumber> <#if parameters.showDelete=="true" > <#list v_head_arr as row> <#if isFixed ><#--固定表头前才需要先输出一个空列 --> ${td_rownumber!""}<#assign td_rownumber=""><#--只在第一行生成,其他行输出空 --> <#list row as col><#--列数据生成 --> <#if !(col.lastRowIndex??)><#--标题组生成方式 --> <#elseif isFixed> <#if parameters.showDelete=="true" > <@GLT_DATA parameters.options.data.rows true />
操作
<#if col.checkbox??><#--生成checkbox --> <#else> ${col.title!""} <#else><#--非标题组生成方式 --> <#if col.checkbox??><#--生成checkbox --> ${col.title!""} <#else> ${col.title!""} 
操作
<#-- 开始生成多记录表脚本--> <#if parameters.hasTitle!true >
${parameters.title!(parameters.glt.title!'')}
<#assign buildPage=(parameters.options.hasPage||(parameters.options.expbtn?length!"")>0) > <#if (["TOP","BOTH"]?seq_contains(parameters.pageAlign!"BOTTOM"))&&buildPage >
<@GLT_HEADER parameters.mergeHeader true />
<#if (["BOTTOM","BOTH"]?seq_contains(parameters.pageAlign!"BOTTOM"))&&buildPage >
<#if parameters.hasTitle!true >
<#-- 生成多记录表对应js脚本的区域--> <#compress>