jformhead.ftl 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <#--update-start--Author:luobaoli Date:20150614 for:表单(主表/单表)属性中增加了扩展参数 ${po.extend_json?if_exists}-->
  2. <input type="hidden" name="tableName" value="${tableName?if_exists?html}" >
  3. <input type="hidden" name="id" value="${id?if_exists?html}" >
  4. <#list columnhidden as po>
  5. <input type="hidden" id="${po.field_name}" name="${po.field_name}" value="${data['${tableName}']['${po.field_name}']?if_exists?html}" >
  6. </#list>
  7. <table cellpadding="0" cellspacing="1" class="formtable">
  8. <#list columns as po>
  9. <#if po_index%2==0>
  10. <tr>
  11. </#if>
  12. <td align="right">
  13. <label class="Validform_label">
  14. <@mutiLang langKey="${po.content?if_exists?html}"/>:
  15. </label>
  16. </td>
  17. <td class="value">
  18. <#if po.show_type=='text'>
  19. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  20. style="width: 150px" class="inputxt" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  21. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  22. <#if po.field_must_input??><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  23. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  24. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  25. <#if po.field_valid_type?if_exists?html != ''>
  26. datatype="${po.field_valid_type?if_exists?html}"
  27. <#else>
  28. <#if po.type == 'int'>
  29. datatype="n"
  30. <#elseif po.type=='double'>
  31. datatype="/^(-?\d+)(\.\d+)?$/"
  32. <#else>
  33. <#if po.is_null != 'Y'>datatype="*"</#if>
  34. </#if></#if>>
  35. <#elseif po.show_type=='password'>
  36. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="password"
  37. style="width: 150px" class="inputxt" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  38. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  39. <#if po.field_must_input??><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  40. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  41. <#if po.operationCodesReadOnly?if_exists> readonly = "readonly"</#if>
  42. <#if po.field_valid_type?if_exists?html != ''>
  43. datatype="${po.field_valid_type?if_exists?html}"
  44. <#else>
  45. <#if po.is_null != 'Y'>datatype="*"</#if>
  46. </#if>>
  47. <#elseif po.show_type=='radio'>
  48. <@DictData name="${po.dict_field?if_exists?html}" text="${po.dict_text?if_exists?html}" tablename="${po.dict_table?if_exists?html}" var="dataList">
  49. <#list dataList as dictdata>
  50. <input value="${dictdata.typecode?if_exists?html}" ${po.extend_json?if_exists} name="${po.field_name}" type="radio"
  51. <#-- update--begin--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  52. <#if dictdata_index == 0>
  53. <#if po.field_valid_type?if_exists?html != ''>
  54. datatype="${po.field_valid_type?if_exists?html}"
  55. <#elseif po.is_null != 'Y'>
  56. datatype="*"
  57. </#if>
  58. <#if po.field_must_input?if_exists?html != ''><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  59. </#if>
  60. <#-- update--end--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  61. <#if po.operationCodesReadOnly?if_exists>onclick="return false;"</#if>
  62. <#if dictdata.typecode?if_exists?html=="${data['${tableName}']['${po.field_name}']?if_exists?html}"> checked="true" </#if>>
  63. ${dictdata.typename?if_exists?html}
  64. </#list>
  65. </@DictData>
  66. <#elseif po.show_type=='checkbox'>
  67. <#assign checkboxstr>${data['${tableName}']['${po.field_name}']?if_exists?html}</#assign>
  68. <#assign checkboxlist=checkboxstr?split(",")>
  69. <@DictData name="${po.dict_field?if_exists?html}" text="${po.dict_text?if_exists?html}" tablename="${po.dict_table?if_exists?html}" var="dataList">
  70. <#list dataList as dictdata>
  71. <input value="${dictdata.typecode?if_exists?html}" ${po.extend_json?if_exists} name="${po.field_name}" type="checkbox"
  72. <#-- update--begin--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  73. <#if dictdata_index == 0>
  74. <#if po.field_valid_type?if_exists?html != ''>
  75. datatype="${po.field_valid_type?if_exists?html}"
  76. <#elseif po.is_null != 'Y'>
  77. datatype="*"
  78. </#if>
  79. <#if po.field_must_input?if_exists?html != ''><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  80. </#if>
  81. <#-- update--end--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  82. <#if po.operationCodesReadOnly?if_exists>onclick="return false;"</#if>
  83. <#list checkboxlist as x >
  84. <#if dictdata.typecode?if_exists?html=="${x?if_exists?html}"> checked="true" </#if></#list>>
  85. ${dictdata.typename?if_exists?html}
  86. </#list>
  87. </@DictData>
  88. <#elseif po.show_type=='list'>
  89. <@DictData name="${po.dict_field?if_exists?html}" text="${po.dict_text?if_exists?html}" tablename="${po.dict_table?if_exists?html}" var="dataList">
  90. <select id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" <#if po.operationCodesReadOnly?if_exists>onfocus="this.defOpt=this.selectedIndex" onchange="this.selectedIndex=this.defOpt;"</#if>
  91. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  92. <#if po.field_must_input??><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  93. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  94. <#-- update--begin--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  95. <#if po.field_valid_type?if_exists?html != ''>
  96. datatype="${po.field_valid_type?if_exists?html}"
  97. <#elseif po.is_null != 'Y'>
  98. datatype="*"
  99. </#if>
  100. <#-- update--end--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  101. <#list dataList as dictdata>
  102. <option value="${dictdata.typecode?if_exists?html}"
  103. <#if dictdata.typecode?if_exists?html=="${data['${tableName}']['${po.field_name}']?if_exists?html}"> selected="selected" </#if>>
  104. ${dictdata.typename?if_exists?html}
  105. </option>
  106. </#list>
  107. </select>
  108. </@DictData>
  109. <#elseif po.show_type=='date'>
  110. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  111. style="width: 150px" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  112. class="Wdate" onClick="WdatePicker({<#if po.operationCodesReadOnly?if_exists> readonly = true</#if>})"
  113. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  114. <#if po.field_must_input??><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  115. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  116. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  117. <#if po.field_valid_type?if_exists?html != ''>
  118. datatype="${po.field_valid_type?if_exists?html}"
  119. <#else>
  120. <#if po.is_null != 'Y'>datatype="*"</#if>
  121. </#if>>
  122. <#elseif po.show_type=='datetime'>
  123. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  124. style="width: 150px" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  125. class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'<#if po.operationCodesReadOnly?if_exists> ,readonly = true</#if>})"
  126. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  127. <#if po.field_must_input??><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  128. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  129. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  130. <#if po.field_valid_type?if_exists?html != ''>
  131. datatype="${po.field_valid_type?if_exists?html}"
  132. <#else>
  133. <#if po.is_null != 'Y'>datatype="*"</#if>
  134. </#if>>
  135. <#elseif po.show_type=='popup'>
  136. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  137. style="width: 150px" class="searchbox-inputtext"
  138. value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  139. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  140. <#if po.field_must_input??><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  141. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  142. <#if po.operationCodesReadOnly?if_exists>
  143. readonly = "readonly"
  144. <#else>
  145. onClick="inputClick(this,'${po.dict_text?if_exists?html}','${po.dict_table?if_exists?html}');"
  146. </#if>
  147. <#if po.field_valid_type?if_exists?html != ''>
  148. datatype="${po.field_valid_type?if_exists?html}"
  149. <#else>
  150. <#if po.is_null != 'Y'>datatype="*"</#if>
  151. </#if>>
  152. <#elseif po.show_type=='file'>
  153. <table>
  154. <#list filesList as fileB>
  155. <#-- update--begin--author:zhangjiaqiang date:20170608 for:修订字段为小写 -->
  156. <#if fileB['field']?lower_case == po.field_name>
  157. <#-- update--end--author:zhangjiaqiang date:20170608 for:修订字段为小写 -->
  158. <tr style="height:34px;">
  159. <td>${fileB['title']}</td>
  160. <td><a href="${basePath}/commonController.do?viewFile&fileid=${fileB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity" title="下载">下载</a></td>
  161. <td><a href="javascript:void(0);" onclick="openwindow('预览','${basePath}/commonController.do?openViewFile&fileid=${fileB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity','fList',700,500)">预览</a></td>
  162. <td><a href="javascript:void(0)" class="jeecgDetail" onclick="del('${basePath}/cgUploadController.do?delFile&id=${fileB['fileKey']}',this)">删除</a></td>
  163. </tr>
  164. </#if>
  165. </#list>
  166. </table>
  167. <#if !(po.operationCodesReadOnly ??)>
  168. <div class="form jeecgDetail">
  169. <script type="text/javascript">
  170. var serverMsg="";
  171. var m = new Map();
  172. $(function(){$('#${po.field_name}').uploadify(
  173. {buttonText:'添加文件',
  174. auto:false,
  175. progressData:'speed',
  176. multi:true,
  177. height:25,
  178. overrideEvents:['onDialogClose'],
  179. fileTypeDesc:'文件格式:',
  180. queueID:'filediv_${po.field_name}',
  181. <#-- fileTypeExts:'*.rar;*.zip;*.doc;*.docx;*.txt;*.ppt;*.xls;*.xlsx;*.html;*.htm;*.pdf;*.jpg;*.gif;*.png', 页面弹出很慢解决 20170317 scott -->
  182. fileSizeLimit:'15MB',swf:'${basePath}/plug-in/uploadify/uploadify.swf',
  183. uploader:'${basePath}/cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
  184. onUploadStart : function(file) {
  185. var cgFormId=$("input[name='id']").val();
  186. $('#${po.field_name}').uploadify("settings", "formData", {'cgFormId':cgFormId,'cgFormName':'${tableName?if_exists?html}','cgFormField':'${po.field_name}'});} ,
  187. onQueueComplete : function(queueData) {
  188. var win = frameElement.api.opener;
  189. win.reloadTable();
  190. win.tip(serverMsg);
  191. frameElement.api.close();},
  192. onUploadSuccess : function(file, data, response) {var d=$.parseJSON(data);if(d.success){var win = frameElement.api.opener;serverMsg = d.msg;}},onFallback : function(){tip("您未安装FLASH控件,无法上传图片!请安装FLASH控件后再试")},onSelectError : function(file, errorCode, errorMsg){switch(errorCode) {case -100:tip("上传的文件数量已经超出系统限制的"+$('#${po.field_name}').uploadify('settings','queueSizeLimit')+"个文件!");break;case -110:tip("文件 ["+file.name+"] 大小超出系统限制的"+$('#${po.field_name}').uploadify('settings','fileSizeLimit')+"大小!");break;case -120:tip("文件 ["+file.name+"] 大小异常!");break;case -130:tip("文件 ["+file.name+"] 类型不正确!");break;}},
  193. onUploadProgress : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { }});});
  194. </script><span id="file_uploadspan"><input type="file" name="${po.field_name}" id="${po.field_name}" /></span>
  195. </div>
  196. <div class="form" id="filediv_${po.field_name}"> </div>
  197. </#if>
  198. <#-- update--begin--author:zhangjiaqiang date:20170607 for:增加图片格式的上传 -->
  199. <#elseif po.show_type=='image'>
  200. <table>
  201. <#-- update--begin--author:zhangjiaqiang date:20170519 for:修订资源预览关联错误 -->
  202. <#list imageList as imageB>
  203. <#-- update--begin--author:zhangjiaqiang date:20170608 for:修订字段为小写 -->
  204. <#if imageB['field']?lower_case == po.field_name>
  205. <#-- update--end--author:zhangjiaqiang date:20170608 for:修订字段为小写 -->
  206. <tr style="height:34px;">
  207. <td>${imageB['title']}</td>
  208. <td><a href="${basePath}/commonController.do?viewFile&fileid=${imageB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity" title="下载">下载</a></td>
  209. <td><a href="javascript:void(0);" onclick="openwindow('预览','${basePath}/commonController.do?openViewFile&fileid=${imageB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity','fList',700,500)">预览</a></td>
  210. <td><a href="javascript:void(0)" class="jeecgDetail" onclick="del('${basePath}/cgUploadController.do?delFile&id=${imageB['fileKey']}',this)">删除</a></td>
  211. </tr>
  212. </#if>
  213. </#list>
  214. <#-- update--end--author:zhangjiaqiang date:20170519 for:修订资源预览关联错误 -->
  215. </table>
  216. <#if !(po.operationCodesReadOnly ??)>
  217. <div class="form jeecgDetail">
  218. <script type="text/javascript">
  219. var serverMsg="";
  220. var m = new Map();
  221. $(function(){$('#${po.field_name}').uploadify(
  222. {buttonText:'添加图片',
  223. auto:false,
  224. progressData:'speed',
  225. multi:true,
  226. height:25,
  227. overrideEvents:['onDialogClose'],
  228. fileTypeDesc:'图片格式:',
  229. queueID:'imagediv_${po.field_name}',
  230. fileTypeExts:'*.jpg;*.jpeg;*.gif;*.png;*.bmp',
  231. fileSizeLimit:'15MB',swf:'${basePath}/plug-in/uploadify/uploadify.swf',
  232. uploader:'${basePath}/cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
  233. onUploadStart : function(file) {
  234. var cgFormId=$("input[name='id']").val();
  235. $('#${po.field_name}').uploadify("settings", "formData", {'cgFormId':cgFormId,'cgFormName':'${tableName?if_exists?html}','cgFormField':'${po.field_name}'});} ,
  236. onQueueComplete : function(queueData) {
  237. var win = frameElement.api.opener;
  238. win.reloadTable();
  239. win.tip(serverMsg);
  240. frameElement.api.close();},
  241. onUploadSuccess : function(file, data, response) {var d=$.parseJSON(data);if(d.success){var win = frameElement.api.opener;serverMsg = d.msg;}},onFallback : function(){tip("您未安装FLASH控件,无法上传图片!请安装FLASH控件后再试")},onSelectError : function(file, errorCode, errorMsg){switch(errorCode) {case -100:tip("上传的文件数量已经超出系统限制的"+$('#${po.field_name}').uploadify('settings','queueSizeLimit')+"个文件!");break;case -110:tip("文件 ["+file.name+"] 大小超出系统限制的"+$('#${po.field_name}').uploadify('settings','fileSizeLimit')+"大小!");break;case -120:tip("文件 ["+file.name+"] 大小异常!");break;case -130:tip("文件 ["+file.name+"] 类型不正确!");break;}},
  242. onUploadProgress : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { }});});
  243. </script><span id="image_uploadspan"><input type="file" name="${po.field_name}" id="${po.field_name}" /></span>
  244. </div>
  245. <div class="form" id="imagediv_${po.field_name}"> </div>
  246. </#if>
  247. <#-- update--end--author:zhangjiaqiang date:20170607 for:增加图片格式的上传 -->
  248. <#else>
  249. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  250. style="width: 150px" class="inputxt" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  251. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  252. <#if po.field_must_input??><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  253. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  254. <#if po.field_valid_type?if_exists?html != ''>
  255. datatype="${po.field_valid_type?if_exists?html}"
  256. <#else>
  257. <#if po.type == 'int'>
  258. datatype="n"
  259. <#elseif po.type=='double'>
  260. datatype="/^(-?\d+)(\.\d+)?$/"
  261. <#else>
  262. <#if po.is_null != 'Y'>datatype="*"</#if>
  263. </#if></#if>>
  264. </#if>
  265. <span class="Validform_checktip"></span>
  266. <label class="Validform_label" style="display: none;"><@mutiLang langKey="${po.content?if_exists?html}"/></label>
  267. </td>
  268. <#if (po_index%2==0)&&(!po_has_next)>
  269. <td align="right">
  270. <label class="Validform_label">
  271. </label>
  272. </td>
  273. <td class="value">
  274. </td>
  275. </#if>
  276. <#if (po_index%2!=0)||(!po_has_next)>
  277. </tr>
  278. </#if>
  279. </#list>
  280. <#list columnsarea as po>
  281. <tr>
  282. <td align="right">
  283. <label class="Validform_label">
  284. <@mutiLang langKey="${po.content?if_exists?html}"/>:
  285. </label>
  286. </td>
  287. <td class="value" colspan="3">
  288. <textarea id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" style="width:${po.field_length}px;
  289. <#if po.show_type!='umeditor'>class="inputxt"</#if> rows="6"
  290. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  291. <#if po.field_must_input??><#if po.field_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  292. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  293. <#if po.operationCodesReadOnly?if_exists> readonly = "readonly"</#if>
  294. <#if po.field_valid_type?if_exists?html != ''>
  295. datatype="${po.field_valid_type?if_exists?html}"
  296. <#else>
  297. <#if po.is_null != 'Y'>datatype="*"</#if>
  298. </#if>>${data['${tableName}']['${po.field_name}']?if_exists?html}</textarea>
  299. <span class="Validform_checktip"></span>
  300. <label class="Validform_label" style="display: none;"><@mutiLang langKey="${po.content?if_exists?html}"/></label>
  301. <#if po.show_type=='umeditor'>
  302. <script type="text/javascript">
  303. //实例化编辑器
  304. var ${po.field_name}_ue = UE.getEditor('${po.field_name}',{initialFrameWidth:${po.field_length}}).setHeight(260);
  305. </script>
  306. </#if>
  307. </td>
  308. </tr>
  309. </#list>
  310. </table>
  311. <#--update-end--Author:luobaoli Date:20150614 for:表单(主表/单表)属性中增加了扩展参数 ${po.extend_json?if_exists}-->