| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733 |
- <#-- 提取java枚举类型-->
- <#assign GtType= enum["cn.sinobest.framework.service.tags.Gt$GtType"] >
- <#-- 准备用户右对齐的类型,目前知道的是 文本、单选和多选-->
- <#assign rightAlign= [GtType.LABEL,GtType.CHECKBOX,GtType.RADIOBOX] >
- <#-- 准备动态字典-->
- <#assign gtDicts= parameters.gtDicts >
- <#-- 准备值-->
- <#assign gtValues= parameters.gtValues >
- <#-- 查询条件集合-->
- <#assign whereClsMap= parameters.whereClsMap!{} >
- <#-- 多记录表配置集合-->
- <#assign gltMap= parameters.gltMap!{} >
- <#-- 快速字典默认表头定义-->
- <#assign COMBOBOX_P_HEADER =
- [{"field":"AAA102","title":"字典代码","width":60},
- {"field":"AAA103","title":"字典值","width":100},
- {"field":"AAA101","title":"分类名称","width":120},
- {"field":"AAA100","title":"分类代码","width":100}]
- >
- <#-- 准备单选控件的值-->
- <#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],<#-- 不能粘贴的输入框-->
- "q":["text","searchgrid-text 05q",1000],<#-- 不能粘贴的输入框-->
- "y":["text","bankaccount",50],<#-- 银行账号每4位隔开 -->
- " ":["text","textbox",50]<#-- 默认-->
- }>
- <#assign multipleNames = []>
- <#--解析单记录表的控件内容 -->
- <#macro GT_COMPOMENT v_comp>
- <#--控件只读判断 -->
- <#assign v_readOnly=((parameters.readOnly!false)||((v_comp.readOnly!"")=="true"))?string("disabled","") />
- <#--分控件类型处理 -->
- <#switch v_comp.type!"">
- <#case GtType.LABEL ><#--处理文本 -->
- <#if (v_comp.nClass!"")=="tdprompt_n_v2">
- <span class="vldnn" style="font-size:13px;color:red;vertical-align: -11%;font-weight: bold;" >* </span>
- <#elseif (v_comp.nClass!"")=="tdprompt_n_v3">
- <span class="vldnn" style="font-size:13px;color:red;vertical-align: -11%;font-weight: bold;" >* </span>
- </#if>
- ${v_comp.label!" "}
-
- <#if v_comp.fdj??><#--处理放大镜 -->
- <span style="padding-left:2px" title="${v_comp.fdjhint!"单击可以打开查询窗口"
- }"><a href="javascript:void(0)" class="fdj" tabindex="10000" onclick="${v_comp.fdj!"void(0)"}"></a></span>
- </#if>
- <#break>
- <#case GtType.INPUT ><#--处理单行输入控件-->
- <#assign inputTmp=inputSets[v_comp.subtype!" "]>
- <#assign compValue=gtValues[v_comp.pname]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=(compValue[0]?string)!"">
- </#if>
- <#switch v_comp.subtype!"">
- <#case "q">
- <input title="${v_comp.tip!""}" type="${inputTmp[0]}" class="${inputTmp[1]}" name="${v_comp.pname!""
- }" valueValidate="${v_comp.valueValidate!""}" vldStr="${v_comp.vld!""}" ${v_comp.cus!""} ${v_readOnly} value=${compValue?html}
- >
- <script language="javascript">
- $(function(){
- var arr=[];
- var columnheaders=${(tojson(gltMap[v_comp.glt][0].colHead))!"{}"};
- <#-- 转化列定义,用列表展现-->
- jQuery.each(columnheaders,function(indexInArray, valueOfElement){
- jQuery.each(valueOfElement,function(indexInArray, valueOfElement2){
- if(typeof valueOfElement2['field']=='undefined'){
- valueOfElement2['field']=(1+indexInArray).toString();
- }
- });
- });
- $('table#${parameters.id} .05q[name="${v_comp.pname!""}"]').filter(function(index){
- //避免重复初始化
- return $(this).data('_hasinit')==null;
- }).data('_hasinit',true).searchgrid({
- confid:${tojson(v_comp.glt)!"null"},
- whereCls:${(tojson(whereClsMap[v_comp.glt]))!"null"},
- url:"${request.contextPath!""}/gltPage.do",
- localdb:${v_comp.localdb!"false"},
- remotedb:${v_comp.remotedb!"false"},
- onselect:${v_comp.onselect!"null"},
- width:"${v_comp.ddWidth!"auto"}",
- height:"${v_comp.ddHeight!"auto"}",
- fieldIndices:[0,0],
- textFieldOnly:true,
- columns:columnheaders
- });
- });
- </script>
- <#break>
- <#case "y">
- <input title="${v_comp.tip!""}" type="${inputTmp[0]}" class="${inputTmp[1]}" maxlength="${v_comp.maxlength!inputTmp[2]}" name="_HID_${v_comp.pname!""
- }" value="${compValue?html}" valueValidate="${v_comp.valueValidate!""}" vldStr="${v_comp.vld!""}" ${v_comp.cus!""} ${v_readOnly}/>
- <input type="hidden" name="${v_comp.pname!""}" value="${(compValue)}" class="${inputTmp[1]}hid" />
- <#break>
- <#default>
- <input title="${v_comp.tip!""}" type="${inputTmp[0]}" class="${inputTmp[1]}" maxlength="${v_comp.maxlength!inputTmp[2]}" name="${v_comp.pname!""
- }" value="${compValue?html}" valueValidate="${v_comp.valueValidate!""}" vldStr="${v_comp.vld!""}" ${v_comp.cus!""} ${v_readOnly}/>
- <#break>
- </#switch>
- <#break>
- <#case GtType.SFZ ><#--处理身份证 -->
- <#assign compValue=gtValues[v_comp.pname]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=(compValue[0]?string)!"">
- </#if>
- <input type="text" title="${v_comp.tip!""}" class="idcardbox" maxlength="${v_comp.maxlength!19}" name="${v_comp.pname!""}" value="${compValue?html}"
- valueValidate="${v_comp.valueValidate!""}" vldStr="${v_comp.vld!""}" ${v_comp.cus!""} ${v_readOnly}/>
- <#break>
- <#case GtType.TEXTAREA ><#--处理多行输入控件 -->
- <#assign compValue=gtValues[v_comp.pname]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=(compValue[0]?string)!"">
- </#if>
- <#switch v_comp.subtype!""><#case "q">
- <textarea class="textareabox 03q" title="${v_comp.tip!""}" rows="${v_comp.rows!3}" name="${v_comp.pname}" valueValidate="${v_comp.valueValidate!""}" vldStr="${
- v_comp.vld!((v_comp.label!"")+"="+"l(0-150)")}" ${v_comp.cus!""} ${v_readOnly}>${compValue?html}</textarea>
- <script language="javascript">
- $(function(){
- var arr=[];
- var columnheaders=${(tojson(gltMap[v_comp.glt][0].colHead))!"{}"};
- <#-- 转化列定义,用列表展现-->
- jQuery.each(columnheaders,function(indexInArray, valueOfElement){
- jQuery.each(valueOfElement,function(indexInArray, valueOfElement2){
- if(typeof valueOfElement2['field']=='undefined'){
- valueOfElement2['field']=(1+indexInArray).toString();
- }
- });
- });
- $('table#${parameters.id} .03q[name="${v_comp.pname!""}"]').filter(function(index){
- //避免重复初始化
- return $(this).data('_hasinit')==null;
- }).data('_hasinit',true).searchgrid({
- confid:${tojson(v_comp.glt)!"null"},
- whereCls:${(tojson(whereClsMap[v_comp.glt]))!"null"},
- url:"${request.contextPath!""}/gltPage.do",
- localdb:${v_comp.localdb!"false"},
- remotedb:${v_comp.remotedb!"false"},
- onselect:${v_comp.onselect!"null"},
- width:"${v_comp.ddWidth!"auto"}",
- height:"${v_comp.ddHeight!"auto"}",
- fieldIndices:[0,0],
- textFieldOnly:true,
- columns:columnheaders
- });
- });
- </script>
- <#break>
- <#default>
- <textarea class="textareabox" title="${v_comp.tip!""}" rows="${v_comp.rows!3}" name="${v_comp.pname}" valueValidate="${v_comp.valueValidate!""}" vldStr="${
- v_comp.vld!((v_comp.label!"")+"="+"l(0-150)")}" ${v_comp.cus!""} ${v_readOnly}>${compValue?html}</textarea>
- <#break>
- </#switch>
- <#break>
- <#case GtType.COMBOBOX ><#--处理字典控件 -->
- <#switch v_comp.subtype!"">
- <#case "p">
- <#assign compValue=gtValues[v_comp.pname]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=(compValue[0]?string)!"">
- </#if>
- <input type="text" title="${v_comp.tip!""}" class="searchgridbox" dsId="${parameters.dsId!""}" subtype="${v_comp.subtype}" name="${v_comp.pname!""
- }" textfield="${(gtDicts[v_comp.dname][compValue].AAA103)!""}" value="${
- compValue!"10"?html}" ${v_comp.cus!""} valueValidate="${v_comp.valueValidate!""}" vldStr="${v_comp.vld!""}" ${v_readOnly}>
- <script language="javascript">
- $(function(){
- <#if v_comp.colHeads??>
- var columnheaders=${tojson(v_comp.colHeads)};
- <#else>
- var columnheaders=
- [{"field":"AAA102","title":"字典代码","width":60},
- {"field":"AAA103","title":"字典值","width":100},
- {"field":"AAA101","title":"分类名称","width":120},
- {"field":"AAA100","title":"分类代码","width":100}];
- </#if>
- var dicts=${tojson(gtDicts[v_comp.dname!""])!"null"};
- var arr=[];
- <#-- 转化字典,用列表展现-->
- for(key in dicts){
- arr.push(dicts[key]);
- }
- $('table#${parameters.id} .searchgridbox[name="${v_comp.pname!""}"]').filter(function(index){
- //避免重复初始化
- return $(this).data('_hasinit')==null;
- }).data('_hasinit',true).searchgrid({
- width:"${v_comp.ddWidth!"auto"}",
- height:"${v_comp.ddHeight!"auto"}",
- idField:'AAA102',
- textField:'AAA103',
- initdata:{"rows":arr},
- columns:[columnheaders]
- });
- });
- </script>
- <#break>
- <#case "q">
- <#assign compValue=gtValues[v_comp.pname]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=(compValue[0]?string)!"">
- </#if>
- <#assign disaplayValue=gtValues['_DIC_'+v_comp.pname]!"">
- <#if (disaplayValue?is_sequence)>
- <#assign disaplayValue=(disaplayValue[0]?string)!"">
- </#if>
- <input type="text" title="${v_comp.tip!""}" class="searchgridbox" dsId="${parameters.dsId!""}" subtype="${v_comp.subtype}" name="${v_comp.pname!""
- }" textfield="${(gtDicts[v_comp.dname][compValue].AAA103)!""}" value="${
- compValue?html}" ${v_comp.cus!""} valueValidate="${v_comp.valueValidate!""}" vldStr="${v_comp.vld!""}" ${v_readOnly} displayValue="${disaplayValue}">
- <script language="javascript">
- $(function(){
- var arr=[];
- var columnheaders=${(tojson(gltMap[v_comp.glt][0].colHead))!{}};
- <#-- 在fw_gentbl_conf表的ATTR字段获取05q控件的idfield和attrfield -->
- var attr="${(gltMap[v_comp.glt][0].attr)!""}";
- var selectstrFields=${(tojson(gltMap[v_comp.glt][0].fields))!{}};<#-- 默认第一个是idfield,第二个是textfield -->
- var attrIdField = selectstrFields[0];
- var attrTextField = selectstrFields[1];
- var attrIdFieldType = "STRING";
- var jsonGltAttr = {};
- if(attr != ""){
- var fields = attr.split("|");
- for(var i=0;i<fields.length;i++){
- var field = fields[i];
- var firstEqualPos = field.indexOf('=');
- if(-1 == firstEqualPos ){
- continue;
- }
- var key = field.substring(0,firstEqualPos).toLowerCase();
- var value = {};
- fieldAttributes = field.split('*');
- for(var j=0;j<fieldAttributes.length;j++){
- var fieldAttributePair = fieldAttributes[j].split('=');
- value[fieldAttributePair[0].toLowerCase()] = fieldAttributePair[1];
- }
- jsonGltAttr[key] = value;
- }
- if(jsonGltAttr["idfield"]!=null){
- attrIdField = jsonGltAttr["idfield"].idfield;
- if(jsonGltAttr["idfield"].type != null){
- attrIdFieldType = jsonGltAttr["idfield"].type;
- }
- }
- if(jsonGltAttr["textfield"]!=null){
- attrTextField = jsonGltAttr["textfield"].textfield;
- }
- }
- if(null != attrIdField){
- attrIdField = attrIdField.toUpperCase();
- }
- if(null != attrTextField){
- attrTextField = attrTextField.toUpperCase();
- }
-
- <#-- 转化列定义,用列表展现-->
- jQuery.each(columnheaders,function(indexInArray, valueOfElement){
- jQuery.each(valueOfElement,function(indexInArray, valueOfElement2){
- if(typeof valueOfElement2['field']=='undefined'){
- valueOfElement2['field']=(1+indexInArray).toString();
- }
- });
- });
- $('table#${parameters.id} .searchgridbox[name="${v_comp.pname!""}"]').filter(function(index){
- //避免重复初始化
- return $(this).data('_hasinit')==null;
- }).data('_hasinit',true).searchgrid({
- confid:${tojson(v_comp.glt)!"null"},
- whereCls:${(tojson(whereClsMap[v_comp.glt]))!"null"},
- url:"${request.contextPath!""}/gltPage.do",
- localdb:${v_comp.localdb!"false"},
- remotedb:${v_comp.remotedb!"false"},
- initshow:${v_comp.initshow!"false"},
- onselect:${v_comp.onselect!"null"},
- width:"${v_comp.ddWidth!"auto"}",
- height:"${v_comp.ddHeight!"auto"}",
- idField:attrIdField,
- idFieldType:attrIdFieldType,
- textField:attrTextField,
- fieldIndices:[0,1],
- columns:columnheaders
- });
- });
- </script>
- <#break>
- <#case "m">
- <#if !multipleNames?seq_contains(v_comp.pname)>
- <#assign multipleNames=multipleNames+[v_comp.pname]>
- </#if>
- <#assign compValue=gtValues[v_comp.pname]![]>
- <#if !(compValue?is_sequence)>
- <#assign compValue=[compValue?string]>
- </#if>
- <select class="incombox mutiplebox" title="${v_comp.tip!""}" name="${v_comp.pname!""}" dsId="${parameters.dsId!""}" dname="${v_comp.dname!""}" vldStr="${v_comp.vld!""}"
- ${v_comp.cus!""} ${v_readOnly} displayCol="${v_comp.displayCol!"BOTH"}" <#rt>
- fwpanelWidth="${v_comp.ddWidth!"auto"}" <#rt>
- fwpanelHeight="${v_comp.ddHeight!"auto"}" <#rt>
- onselect="${v_comp.onselect!""}" whereCls=${(tojson(whereClsMap[v_comp.dname]))!""} <#rt>
- style="display:none;" dictType="${v_comp.dictType!"default"}" multiple="multiple">
- <#list (gtDicts[v_comp.dname]!{})?values as dict>
- <#if compValue?seq_contains(dict.AAA102) >
- <option value="${dict.AAA102!""}" selected >${dict.AAA102!""}-${dict.AAA103!""}</option>
- </#if>
- </#list>
- <option value=""></option>
- </select>
- <SPAN class="fwcombox" >
- <INPUT class="fwcombox-text" autocomplete="off" ><SPAN class="fwcombox-arrow" ></SPAN>
- </SPAN>
- <#break>
- <#case "s">
- <#assign compValue=gtValues[v_comp.pname]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=(compValue[0]?string)!"">
- </#if>
- <select class="combobox" title="${v_comp.tip!""}" name="${v_comp.pname!""}" dsId="${parameters.dsId!""}" dname="${v_comp.dname!""}" vldStr="${v_comp.vld!""}" ${v_comp.cus!""} ${v_readOnly}
- fwpanelWidth="${v_comp.ddWidth!"auto"}" <#rt>
- fwpanelHeight="${v_comp.ddHeight!"auto"}" <#rt>
- onselect="${v_comp.onselect!""}" whereCls=${(tojson(whereClsMap[v_comp.dname]))!""}<#rt>
- style="display:none;" dictType="s" >
- <#list (gtDicts[v_comp.dname]!{})?values as dict>
- <#if dict.AAA102==(compValue?string)>
- <option value="${dict.AAA102!""}" selected >${dict.AAA103!""}</option>
- <#break>
- </#if>
- </#list>
- <option value=""></option>
- </select>
- <SPAN class="fwcombox" >
- <INPUT class="fwcombox-text" autocomplete="off" ><SPAN class="fwcombox-arrow" ></SPAN>
- </SPAN>
- <#break>
- <#default>
- <#assign compValue=gtValues[v_comp.pname]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=(compValue[0]?string)!"">
- </#if>
- <select class="incombox" title="${v_comp.tip!""}" name="${v_comp.pname!""}" dsId="${parameters.dsId!""}" dname="${v_comp.dname!""}" vldStr="${v_comp.vld!""}"
- ${v_comp.cus!""} ${v_readOnly} displayCol="${v_comp.displayCol!"BOTH"}" <#rt>
- fwpanelWidth="${v_comp.ddWidth!"auto"}" <#rt>
- fwpanelHeight="${v_comp.ddHeight!"auto"}" <#rt>
- onselect="${v_comp.onselect!""}" whereCls=${(tojson(whereClsMap[v_comp.dname]))!""} <#rt>
- style="display:none;" dictType="${v_comp.dictType!"default"}" >
- <#list (gtDicts[v_comp.dname]!{})?values as dict>
- <#if dict.AAA102==(compValue?string)>
- <option value="${dict.AAA102!""}" selected >${dict.AAA102!""}-${dict.AAA103!""}</option>
- <#break>
- </#if>
- </#list>
- <option value=""></option>
- </select>
- <SPAN class="fwcombox" >
- <INPUT class="fwcombox-text" autocomplete="off" ><SPAN class="fwcombox-arrow" ></SPAN>
- </SPAN>
- <#break>
- </#switch>
- <#break>
- <#case GtType.DATEPICKER ><#--处理日期控件 -->
- <#assign compValue=gtValues[v_comp.pname]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=(compValue[0]?string)!"">
- </#if>
-
- <#switch v_comp.subtype!"">
- <#case "y">
- <input type="text" class="${v_comp.timeClass!"datebox"}" title="${v_comp.tip!""}" name="${v_comp.pname!""}" dateFormat="yyyy-mm" boxLength="${v_comp.boxLength!"5"}" vldStr="${v_comp.vld!""}"
- maxlength="${v_comp.maxlength!50}" valueValidate="${v_comp.valueValidate!""}" value="${compValue?html}" ${v_comp.cus!""} ${v_readOnly}/>
- <#break>
-
- <#case "s">
- <input type="text" class="datetimenew" title="${v_comp.tip!""}" dateFormat='yyyy-MM-dd HH:mm:ss' name="${v_comp.pname!""}" vldStr="${v_comp.vld!""}"
- maxlength="${v_comp.maxlength!50}" valueValidate="${v_comp.valueValidate!""}" value="${compValue?html}" ${v_comp.cus!""} ${v_readOnly}/>
- <#break>
-
- <#case "t">
- <input type="text" class="datetimenew" title="${v_comp.tip!""}" dateFormat='HH:mm:ss' name="${v_comp.pname!""}" vldStr="${v_comp.vld!""}"
- maxlength="${v_comp.maxlength!50}" valueValidate="${v_comp.valueValidate!""}" value="${compValue?html}" ${v_comp.cus!""} ${v_readOnly}/>
- <#break>
-
- <#case "m">
- <input type="text" class="datetimenew" title="${v_comp.tip!""}" dateFormat='yyyy' name="${v_comp.pname!""}" vldStr="${v_comp.vld!""}"
- maxlength="${v_comp.maxlength!50}" valueValidate="${v_comp.valueValidate!""}" value="${compValue?html}" ${v_comp.cus!""} ${v_readOnly}/>
- <#break>
-
- <#default>
- <input type="text" class="${v_comp.timeClass!"datebox"}" title="${v_comp.tip!""}" name="${v_comp.pname!""}" vldStr="${v_comp.vld!""}"
- maxlength="${v_comp.maxlength!50}" valueValidate="${v_comp.valueValidate!""}" value="${compValue?html}" ${v_comp.cus!""} ${v_readOnly}/>
- </#switch>
- <#break>
- <#case GtType.FILE ><#--处理上传控件 -->
- <#assign compValue=gtValues[v_comp.pname]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=(compValue[0]?string)!"">
- </#if>
- <input type="file" class="filebox" title="${v_comp.tip!""}" name="${v_comp.pname!""}" vldStr="${v_comp.vld!""}" maxlength="${
- v_comp.maxlength!50}" value="${compValue?html}" ${v_comp.cus!""} ${v_readOnly}/>
- <#break>
- <#case GtType.LINK ><#--处理超级链接 -->
- <a href="${v_comp.href!("javascript:void(0)")}" ${v_comp.cus!""} ${v_readOnly} title="${v_comp.tip!""}" >${v_comp.label}</a>
- <#break>
- <#case GtType.BUTTON ><#--处理按钮-->
- <a class="buttonlink" name="${v_comp.pname!""}" href="${v_comp.href!("javascript:void(0)")}" ${v_readOnly} ${v_comp.cus!""} title="${v_comp.tip!""}" >${v_comp.label}</a>
- <#break>
- <#case GtType.IMG ><#--处理图片-->
- <img title="${v_comp.tip!""}" src="${request.contextPath}${v_comp.src!""}" ${v_comp.cus!""} alt="${v_comp.label}" ${v_readOnly}></img>
- <#break>
- <#case GtType.CHECKBOX >
- <#-- 标记该控件多值-->
- <#if !multipleNames?seq_contains(v_comp.pname)>
- <#assign multipleNames=multipleNames+[v_comp.pname]>
- </#if>
- <#-- 取控件的值-->
- <#assign compValue=gtValues[v_comp.pname]![]>
- <#if !(compValue?is_sequence)>
- <#assign compValue=[compValue?string]>
- </#if>
- <#if v_comp.dname??>
- <table class="inputSet">
- <#list (gtDicts[v_comp.dname]!{})?values?chunk(((v_comp.colNum)?number)!10) as dicts>
- <tr>
- <#list dicts as dict>
- <td align="right">
- <label>${dict.AAA103!""}<input title="${v_comp.tip!""}" type="checkbox" class="checkbox" ${v_comp.cus!""} name="${v_comp.pname!""}" value="${dict.AAA102!""}" ${
- (compValue?seq_contains(dict.AAA102))?string("checked","")} ${v_readOnly}/></label>
- </td>
- </#list>
- </tr>
- </#list>
- </table>
- <#else>
- <label>${v_comp.text}<input title="${v_comp.tip!""}" type="checkbox" class="checkbox" ${v_comp.cus!""} name="${v_comp.pname!""}" value="${v_comp.value!""}" vldStr="${v_comp.vld!""}" ${
- (compValue?seq_contains(v_comp.value!""))?string("checked","")} ${v_readOnly}/></label>
- </#if>
- <#break>
- <#case GtType.RADIOBOX >
- <#assign compValue=gtValues[v_comp.pname]![]>
- <#if !(compValue?is_sequence)>
- <#assign compValue=[compValue?string]>
- </#if>
- <#if v_comp.dname??>
- <table class="inputSet">
- <#list (gtDicts[v_comp.dname]!{})?values?chunk(((v_comp.colNum)?number)!10) as dicts>
- <tr>
- <#list dicts as dict>
- <td><label>${dict.AAA103!""}<input type="radio" title="${v_comp.tip!""}" class="checkbox" ${v_comp.cus!""} name="${v_comp.pname!""}" value="${dict.AAA102!""}" ${
- (compValue?seq_contains(dict.AAA102))?string("checked","")} ${v_readOnly}/></label></td>
- </#list>
- </tr>
- </#list>
- </table>
- <#else>
- <label>${v_comp.text}<input type="radio" title="${v_comp.tip!""}" class="checkbox" ${v_comp.cus!""} name="${v_comp.pname!""}" value="${v_comp.value!""}" vldStr="${v_comp.vld!""}" ${
- (compValue?seq_contains(v_comp.value!""))?string("checked","")} ${v_readOnly}/></label>
- </#if>
- <#break>
- <#case GtType.NESTTABLE >
- <@GT_TABLE_CONTENT v_comp.gt true/>
- <#break>
- <#default>
- </#switch>
- </#macro>
- <#--解析单记录表的表单内容模板-->
- <#macro GT_TABLE_CONTENT v_gt v_nested>
- <#if !v_nested>
- <table class="datatable" cellpadding="0" cellspacing="0" border=0 align="center" name="${v_gt.id}1"
- id="${v_gt.id}" width=98%>
- <#else>
- <table class="datatable" cellpadding="0" cellspacing="0" border=0 align="center" >
- </#if>
- <#-- 计算单记录表中一个td的默认宽度 -->
- <#assign def_td_width= ((100/(v_gt.colNum))/100)?string("percent") >
- <#assign rowNum = 0 >
- <#list v_gt.renders as row><#--行数据生成 -->
- <#assign rowNum = rowNum + 1 >
- <tr id="${rowNum}" name="${((parameters.rowHid!0)>1 && (parameters.rowHid!0)<=rowNum)?string("trHid","")}" style="display: ${((parameters.rowHid!0)>1 && (parameters.rowHid!0)<=rowNum)?string("none","")}">
- <#list row as col><#--列数据生成 -->
- <#if (col[0].nClass!"")=="tdprompt_n_v2">
- <td width="${col[0].width!def_td_width}" rowspan="${col[0].rowspan!1}" colspan="${col[0].colspan!1}" class="${
- rightAlign?seq_contains(col[0].type!"")?string("tdprompt","tdinput")} " <#rt>
- <#if col[0].align??>style="text-align:${col[0].align};"</#if> >
- <#elseif (col[0].nClass!"")=="tdprompt_n_v3">
- <td width="${col[0].width!def_td_width}" rowspan="${col[0].rowspan!1}" colspan="${col[0].colspan!1}" class="${
- rightAlign?seq_contains(col[0].type!"")?string("tdprompt","tdinput")} ${"tdprompt_n"}" <#rt>
- <#if col[0].align??>style="text-align:${col[0].align};"</#if> >
- <#else>
- <td width="${((col[0].type!"")==GtType.LABEL)?string(def_td_width,col[0].width!((100/(v_gt.colNum))*(col[0].colspan!1)/100)?string("percent"))}" rowspan="${col[0].rowspan!1}" colspan="${col[0].colspan!1}" class="${
- rightAlign?seq_contains(col[0].type!"")?string("tdprompt","tdinput")} ${col[0].nClass!""}" <#rt>
- <#if col[0].align??>style="text-align:${col[0].align};"</#if> >
- </#if>
- <#if (parameters.rowHid!0) == rowNum>
- <input id="${parameters.id}_rowHid_init" type="hidden" value="" />
- </#if>
- <#list col as comp>
- <@GT_COMPOMENT comp />
- </#list>
- </td>
- </#list>
- </tr>
- </#list>
- </table>
- <#-- 生成单记录表HIDDENT区域-->
- <#if v_gt.hiddens??>
- <#list v_gt.hiddens as hidden>
- <#assign compValue=gtValues[hidden]!"">
- <#if (compValue?is_sequence)>
- <#assign compValue=compValue[0]?string!"">
- </#if>
- <input type="hidden" name="${hidden}" value="${compValue?html}"/>
- </#list>
- </#if>
- </#macro>
- <#-- 开始生成单记录表脚本-->
- <#--若没有标题也没有边框,就不需要DIV也不需要fieldset-->
- <#if (parameters.hasTitle!true)||(parameters.hasBorder!true) >
- <#--只要标题不要边框-->
- <#if parameters.hasBorder!true >
-
- <fieldset class="fieldset" align="center" style="cursor:default;width:95%" >
- <#else>
- <fieldset align="center" style="border:none;cursor:default;width:95%" >
- </#if>
- <#if parameters.hasTitle!true ><#-- 生成标题-->
-
- <legend class="legend" style="cursor:hand;" >
- <span onclick="_FW.oFtl.fnShowTable('img_${parameters.id}1','div_${parameters.id}')" >
- <img id="img_${parameters.id}1" src="${request.contextPath}/themes/default/images/query_icon_right.gif">
- </span>
- <span title="单击展开或收缩查询条件" onclick="_FW.oFtl.fnShowTable('img_${parameters.id}1','div_${parameters.id}')">
- ${parameters.title!(parameters.gt.description!'')}
- </span>
- </legend>
-
-
-
- </#if>
-
- <#if parameters.hasBorder!true ><#-- 生成边框-->
- <div id="div_${parameters.id}" class="tablediv">
- <#else>
- <div id="div_${parameters.id}">
- </#if>
- <#else>
- <div> <#-- 没有边框和标题时需要加一个DIV否则 排在它后面的标签能居中-->
-
- </#if>
- <@GT_TABLE_CONTENT parameters.gt false/>
- <#-- 标识哪那些是可以多值的-->
- <input type="hidden" name="_multiple" value="<#rt/>
- <#list multipleNames as name>${name}<#if name_has_next>,</#if></#list>">
- <#--若没有标题也没有边框,就不需要DIV-->
- <#if (parameters.hasTitle!true)||(parameters.hasBorder!true) >
- </div>
- </#if>
- <#--若没有标题也没有边框,就不需要fieldset-->
- <#if (parameters.hasTitle!true)||(parameters.hasBorder!true) >
- </fieldset>
- <#if ((parameters.rowHid!0) > 1)>
- <div align="left" style="display:block;cursor:hand;position:relative;width:95%;top:-10px;left:5px;">
-
- <span id="text_${parameters.id}_rowHid" style="background:#ffffff;" title="单击展开隐藏字段"
- onclick="changeMoreImgButton('text_${parameters.id}_rowHid', 'trHid', '${parameters.id}_rowHid_init');">
- <img src="${request.contextPath}/themes/default/images/more.gif">
- </span>
- </div>
- </#if>
- <#else>
- </div>
-
- </#if>
- <#--根据配置显示归档查询按钮-->
- <#if (parameters.hasArchive) && (parameters.permitArchive) >
- <div id="${parameters.id}_archive_div" style="position:absolute;z-index:0;left:0px;top:0px;width:100px;height:100px;display:block;">
- <div style="position:absolute;">
- <a class="buttonlink" href="javascript:void(0)" name="btnQuery" onclick="queryArchive_${parameters.id}(${parameters.id},_FW.oFtl.fnGetForm($('#${parameters.id}').closest('form')));return false;">归档查询</a>
- </div>
- </div>
- <script>
- <#-- 动态加载单点登陆所需JS -->
- function queryArchive_${parameters.id}(id,data){
- _FW.oFtl.fnLoadScript({
- url:contextPath + "/js/fw/encrypt.js",
- beforeFunc: function(){return null==document.getElementById("fwencrypt");},
- afterFunc: function(script){
- if(null != script){
- script.id = "fwencrypt";
- }
- _FW.oFtl.fnLoadScript({
- url:contextPath + "/js/fw/encrypt2.js",
- beforeFunc: function(){return null==document.getElementById("fwencrypt2");},
- afterFunc: function(script){
- if(null != script){
- script.id = "fwencrypt2";
- }
- <#--回调单点登陆 -->
- queryArchive_${parameters.id}_login(id,data);
- }
- });
- }
- });
- }
- <#--单点登陆 -->
- function queryArchive_${parameters.id}_login(id,data){
- ssoLogin("${parameters.archiveUrl}",readCookie("LOGINID"),getSsoUid(),
- function(jsonpdata){
- if(data.FHZ<0){
- alert(jsonpdata.MSG);
- return;
- }else{
- <#--回调归档查询 -->
- _queryArchive_${parameters.id}(id,data);
- }
- }
- );
- }
- <#--真正的归档查询的代码,主要是拼接url参数字符串,然后在新窗口打开-->
- function _queryArchive_${parameters.id}(id,data){
- var querystr = "";
- for(var key in data){
- querystr += "&"+key+"="+encodeURIComponent(data[key]);
- }
- querystr += "&archiveGtId=" + encodeURIComponent(id);
- <#--检查gt是否在一个Tab里面,如果是在一个Tab里面,则获取Tab的顺序号,为了让归档页面自动打开相应的Tab-->
- var $tabPanel = $('#${parameters.id}').closest('div.ui-tabs-panel');
- if(0 != $tabPanel.size()){
- var tabPanelId = $tabPanel.attr("id");
- var number = parseInt(tabPanelId.substring(tabPanelId.lastIndexOf("-")+1),10)-1;
- querystr += "&selectedTabNo=" + number;
- }
- var href = document.location.href;
- if(href.indexOf('?')==-1 && querystr.length>2){
- querystr = '?' + querystr.substring(1);
- }
- querystr += "&t="+new Date().getTime();
- var destHref = "";
- for(var i=0,count=0,len=href.length;i<len;i++){
- if('/'==href.charAt(i)){
- count++;
- }
- if(4==count){
- destHref = "${parameters.archiveUrl}"+href.substring(i)+querystr;
- break;
- }
- }
- var url = destHref;
- var position = "resizable:1;status:0;help:0;scroll:1;center:1;dialogWidth:1024px;dialogHeight:600px";
- window.showModelessDialog(url,window,position);
- }
- </script>
- </#if>
- <#-- 生成单记录表对应js脚本的区域-->
- <script language="javascript">
- $(function(){
- if($(${parameters.id}).data('_init')){return;}
- //标志已经初始化,无需重新初始化
- $(${parameters.id}).data('_init',true);
- <#if !(parameters.showContent!true)>
- _FW.oFtl.fnShowTable('img_${parameters.id}1','div_${parameters.id}')
- </#if>
- _FW.oFtl.fnInitObject('${parameters.id}');
- //响应窗体的重新排列事件
- $(window).resize(function(){_FW.oFtl.fnResizeFWObj(${parameters.id});});
- //最后再重新排列下,原字典控件的宽度可能会变化,而导致不对齐
- _FW.oFtl.fnResizeFWObj(${parameters.id});
- <#--归档查询按钮定位-->
- <#if (parameters.hasArchive) && (parameters.permitArchive) >
- <#--在收缩或者展开fieldset的时候是否需要同时调整归档查询按钮的位置-->
- var needMoveArchiveBtn = "true";
- <#if !(parameters.hasTitle!true)&&!(parameters.hasBorder!true) >
- var _archiveTop = $("#${parameters.id}").offset().top + $("#${parameters.id}").outerHeight()+5 ;
- var _archiveLeft = $("#${parameters.id}").offset().left + $("#${parameters.id}").outerWidth()-84;
- ${parameters.id}_archive_div.style.top = _archiveTop;
- ${parameters.id}_archive_div.style.left = _archiveLeft;
- needMoveArchiveBtn = "false";<#--由于gt没有配置fieldset,所以归档按钮的层是位于开发人员自定义的fieldset里面,所以不需要重新定位归档按钮-->
- <#else>
- var _archiveTop = $("#${parameters.id}").offset().top + $("#${parameters.id}").outerHeight()+8 ;
- var _archiveLeft = $("#${parameters.id}").offset().left + $("#${parameters.id}").outerWidth()-74;
- ${parameters.id}_archive_div.style.top = _archiveTop;
- ${parameters.id}_archive_div.style.left = _archiveLeft;
- </#if>
- <#--在包围框fieldset设置单记录表的ID-->
- var $parent = $("#${parameters.id}");
- while($parent != null && $parent.get(0).tagName != null){
- if("fieldset" == $parent.get(0).tagName.toLowerCase()){
- $parent.get(0).fwgtid = "${parameters.id}";
- $parent.get(0).needMoveArchiveBtn = needMoveArchiveBtn;
- break;
- }else{
- $parent = $parent.parent();
- }
- }
- </#if>
- });
- function _gt_${parameters.id}_getParam(){
- var param={};
- param.actionType="${parameters.actionType}";
- param.actionID="${parameters.actionID}";
- return param;
- }
- function changeMoreImgButton(textId, trId, initId){
- var initObj = $("input[id='"+initId+"']");
- var text = "";
- $("tr[name='"+trId+"']").each(function () {
- if(this.style.display == "none"){
- this.style.display = "";
- if(initObj.value != 1){
- $(':input', this).each(function(){
- CFW.oGt._fnObjInit(this);
- });
- }
- text = " 收起 ";
- }else{
- this.style.display = "none";
- text = "<img src='${request.contextPath}/themes/default/images/more.gif'>"
- }
-
- });
- document.getElementById(textId).innerHTML=text;
- }
- </script>
|