jformhead.ftl 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. <div class="tab-wrapper">
  8. <!-- tab -->
  9. <ul class="nav nav-tabs">
  10. <li role="presentation" class="active"><a href="javascript:void(0);">表单信息管理</a></li>
  11. </ul>
  12. <!-- tab内容 -->
  13. <div class="con-wrapper" style="display: block;">
  14. <div class="row form-wrapper">
  15. <#list columns as po>
  16. <#if po_index%2==0>
  17. <div class="row show-grid">
  18. </#if>
  19. <div class="col-xs-3 text-center">
  20. <b>${po.content}:</b>
  21. </div>
  22. <div class="col-xs-3">
  23. <#if head.isTree=='Y' && head.treeParentIdFieldName==po.field_name>
  24. <!--如果为树形菜单,父id输入框设置为select-->
  25. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  26. class="form-control easyui-combotree" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  27. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  28. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  29. <#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>
  30. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  31. <#if po.field_valid_type?if_exists?html != ''>
  32. datatype="${po.field_valid_type?if_exists?html}"
  33. <#else>
  34. <#if po.type == 'int'>
  35. datatype="n"
  36. <#elseif po.type=='double'>
  37. datatype="/^(-?\d+)(\.\d+)?$/"
  38. <#else>
  39. <#if po.is_null != 'Y'>datatype="*"</#if>
  40. </#if>
  41. </#if>
  42. data-options="
  43. panelHeight:'220',
  44. url: 'cgAutoListController.do?datagrid&configId=${tableName?if_exists?html}&field=id,${head.treeFieldname}',
  45. loadFilter: function(data) {
  46. var rows = data.rows || data;
  47. var win = frameElement.api.opener;
  48. var listRows = win.getDataGrid().treegrid('getData');
  49. joinTreeChildren(rows, listRows);
  50. convertTreeData(rows, '${head.treeFieldname}');
  51. return rows;
  52. },
  53. onLoadSuccess: function() {
  54. var win = frameElement.api.opener;
  55. var currRow = win.getDataGrid().treegrid('getSelected');
  56. if(!'${id?if_exists?html}') {
  57. //增加时,选择当前父菜单
  58. if(currRow) {
  59. $('#${po.field_name}').combotree('setValue', currRow.id);
  60. }
  61. }else {
  62. //编辑时,选择当前父菜单
  63. if(currRow) {
  64. $('#${po.field_name}').combotree('setValue', currRow._parentId);
  65. }
  66. }
  67. }
  68. ">
  69. <#--update-end--Author:钟世云 Date:20150610 for:online支持树配置-->
  70. <#elseif po.show_type=='text'>
  71. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  72. class="form-control" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  73. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  74. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  75. <#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>
  76. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  77. <#if po.field_valid_type?if_exists?html != ''>
  78. datatype="${po.field_valid_type?if_exists?html}"
  79. <#else>
  80. <#if po.type == 'int'>
  81. datatype="n" <#if po.is_null == 'Y'>ignore="ignore" </#if>
  82. <#elseif po.type=='double'>
  83. datatype="/^(-?\d+)(\.\d+)?$/" <#if po.is_null == 'Y'>ignore="ignore" </#if>
  84. <#else>
  85. <#if po.is_null != 'Y'>datatype="*"</#if>
  86. </#if>
  87. </#if>>
  88. <#elseif po.show_type=='password'>
  89. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="password"
  90. class="form-control" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  91. <#if po.operationCodesReadOnly?if_exists> readonly = "readonly"</#if>
  92. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  93. <#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>
  94. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  95. <#if po.field_valid_type?if_exists?html != ''>
  96. datatype="${po.field_valid_type?if_exists?html}"
  97. <#else>
  98. <#if po.is_null != 'Y'>datatype="*"</#if>
  99. </#if>>
  100. <#elseif po.show_type=='radio'>
  101. <@DictData name="${po.dict_field?if_exists?html}" text="${po.dict_text?if_exists?html}" tablename="${po.dict_table?if_exists?html}" var="dataList">
  102. <#list dataList as dictdata>
  103. <input value="${dictdata.typecode?if_exists?html}" ${po.extend_json?if_exists} name="${po.field_name}" type="radio"
  104. <#if dictdata_index==0&&po.is_null != 'Y'>datatype="*"</#if>
  105. <#if po.operationCodesReadOnly?if_exists>onclick="return false;"</#if>
  106. <#if dictdata.typecode?if_exists?html=="${data['${tableName}']['${po.field_name}']?if_exists?html}"> checked="true" </#if>>
  107. ${dictdata.typename?if_exists?html}
  108. </#list>
  109. </@DictData>
  110. <#elseif po.show_type=='checkbox'>
  111. <#assign checkboxstr>${data['${tableName}']['${po.field_name}']?if_exists?html}</#assign>
  112. <#assign checkboxlist=checkboxstr?split(",")>
  113. <@DictData name="${po.dict_field?if_exists?html}" text="${po.dict_text?if_exists?html}" tablename="${po.dict_table?if_exists?html}" var="dataList">
  114. <#list dataList as dictdata>
  115. <input value="${dictdata.typecode?if_exists?html}" ${po.extend_json?if_exists} name="${po.field_name}" type="checkbox"
  116. <#if po.operationCodesReadOnly?if_exists>onclick="return false;"</#if>
  117. <#if dictdata_index==0&&po.is_null != 'Y'>datatype="*"</#if>
  118. <#list checkboxlist as x >
  119. <#if dictdata.typecode?if_exists?html=="${x?if_exists?html}"> checked="true" </#if></#list>>
  120. ${dictdata.typename?if_exists?html}
  121. </#list>
  122. </@DictData>
  123. <#elseif po.show_type=='list'>
  124. <@DictData name="${po.dict_field?if_exists?html}" text="${po.dict_text?if_exists?html}" tablename="${po.dict_table?if_exists?html}" var="dataList">
  125. <select id="${po.field_name}" ${po.extend_json?if_exists} class="form-control" name="${po.field_name}" <#if po.operationCodesReadOnly?if_exists>onfocus="this.defOpt=this.selectedIndex" onchange="this.selectedIndex=this.defOpt;"</#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.is_null != 'Y'>datatype="*"</#if> >
  130. <#list dataList as dictdata>
  131. <option value="${dictdata.typecode?if_exists?html}"
  132. <#if dictdata.typecode?if_exists?html=="${data['${tableName}']['${po.field_name}']?if_exists?html}"> selected="selected" </#if>>
  133. ${dictdata.typename?if_exists?html}
  134. </option>
  135. </#list>
  136. </select>
  137. </@DictData>
  138. <#elseif po.show_type=='date'>
  139. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  140. value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  141. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  142. <#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>
  143. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  144. class="form-control" onClick="WdatePicker({<#if po.operationCodesReadOnly?if_exists> readonly = true</#if>})"
  145. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  146. <#if po.field_valid_type?if_exists?html != ''>
  147. datatype="${po.field_valid_type?if_exists?html}"
  148. <#else>
  149. <#if po.is_null != 'Y'>datatype="*"</#if>
  150. </#if>>
  151. <#elseif po.show_type=='datetime'>
  152. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  153. value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  154. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  155. <#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>
  156. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  157. class="form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'<#if po.operationCodesReadOnly?if_exists> ,readonly = true</#if>})"
  158. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  159. <#if po.field_valid_type?if_exists?html != ''>
  160. datatype="${po.field_valid_type?if_exists?html}"
  161. <#else>
  162. <#if po.is_null != 'Y'>datatype="*"</#if>
  163. </#if>>
  164. <#elseif po.show_type=='popup'>
  165. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  166. class="form-control searchbox-inputtext"
  167. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  168. <#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>
  169. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  170. onClick="inputClick(this,'${po.dict_text?if_exists?html}','${po.dict_table?if_exists?html}');"
  171. value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  172. <#if po.operationCodesReadOnly?if_exists> readonly = "readonly"</#if>
  173. <#if po.field_valid_type?if_exists?html != ''>
  174. datatype="${po.field_valid_type?if_exists?html}"
  175. <#else>
  176. <#if po.is_null != 'Y'>datatype="*"</#if>
  177. </#if>>
  178. <#elseif po.show_type=='file'>
  179. <table>
  180. <#list imageList as imageB>
  181. <#if imageB['field'] == po.field_name>
  182. <tr style="height:34px;">
  183. <td>${imageB['title']}</td>
  184. <td><a href="commonController.do?viewFile&fileid=${fileB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity" title="下载">下载</a></td>
  185. <td><a href="javascript:void(0);" onclick="openwindow('预览','commonController.do?openViewFile&fileid=${fileB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity','fList',700,500)">预览</a></td>
  186. <td><a href="javascript:void(0)" class="jeecgDetail" onclick="del('cgUploadController.do?delFile&id=${fileB['fileKey']}',this)">删除</a></td>
  187. </tr>
  188. </#if>
  189. </#list>
  190. </table>
  191. <#if !(po.operationCodesReadOnly ??)>
  192. <div class="form jeecgDetail">
  193. <script type="text/javascript">
  194. var serverMsg="";
  195. var m = new Map();
  196. $(function(){$('#${po.field_name}').uploadify(
  197. {buttonText:'添加文件',
  198. auto:false,
  199. progressData:'speed',
  200. multi:true,
  201. height:25,
  202. overrideEvents:['onDialogClose'],
  203. fileTypeDesc:'文件格式:',
  204. queueID:'filediv_${po.field_name}',
  205. <#-- fileTypeExts:'*.rar;*.zip;*.doc;*.docx;*.txt;*.ppt;*.xls;*.xlsx;*.html;*.htm;*.pdf;*.jpg;*.gif;*.png', 页面弹出很慢解决 20170317 scott -->
  206. fileSizeLimit:'15MB',swf:'plug-in/uploadify/uploadify.swf',
  207. uploader:'cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
  208. onUploadStart : function(file) {
  209. var cgFormId=$("input[name='id']").val();
  210. $('#${po.field_name}').uploadify("settings", "formData", {'cgFormId':cgFormId,'cgFormName':'${tableName?if_exists?html}','cgFormField':'${po.field_name}'});} ,
  211. onQueueComplete : function(queueData) {
  212. var win = frameElement.api.opener;
  213. win.reloadTable();
  214. win.tip(serverMsg);
  215. frameElement.api.close();},
  216. 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;}},
  217. onUploadProgress : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { }});});
  218. </script><span id="file_uploadspan"><input type="file" name="${po.field_name}" id="${po.field_name}" /></span>
  219. </div>
  220. <div class="form" id="filediv_${po.field_name}"> </div>
  221. </#if>
  222. <#--update-start--Author: jg_huangxg Date:20160113 for:TASK #824 【online开发】控件类型扩展增加一个图片类型 image -->
  223. <#elseif po.show_type=='image'>
  224. <table>
  225. <#list filesList as fileB>
  226. <#if fileB['field'] == po.field_name>
  227. <tr style="height:34px;">
  228. <td>${fileB['title']}</td>
  229. <td><a href="commonController.do?viewFile&fileid=${fileB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity" title="下载">下载</a></td>
  230. <td><a href="javascript:void(0);" onclick="openwindow('预览','commonController.do?openViewFile&fileid=${fileB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity','fList',700,500)">预览</a></td>
  231. <td><a href="javascript:void(0)" class="jeecgDetail" onclick="del('cgUploadController.do?delFile&id=${fileB['fileKey']}',this)">删除</a></td>
  232. </tr>
  233. </#if>
  234. </#list>
  235. </table>
  236. <#if !(po.operationCodesReadOnly ??)>
  237. <div class="form jeecgDetail">
  238. <script type="text/javascript">
  239. var serverMsg="";
  240. var m = new Map();
  241. $(function(){$('#${po.field_name}').uploadify(
  242. {buttonText:'添加图片',
  243. auto:false,
  244. progressData:'speed',
  245. multi:true,
  246. height:25,
  247. overrideEvents:['onDialogClose'],
  248. fileTypeDesc:'图片格式:',
  249. queueID:'imagediv_${po.field_name}',
  250. fileTypeExts:'*.jpg;*.jpeg;*.gif;*.png;*.bmp',
  251. fileSizeLimit:'15MB',swf:'plug-in/uploadify/uploadify.swf',
  252. uploader:'cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
  253. onUploadStart : function(file) {
  254. var cgFormId=$("input[name='id']").val();
  255. $('#${po.field_name}').uploadify("settings", "formData", {'cgFormId':cgFormId,'cgFormName':'${tableName?if_exists?html}','cgFormField':'${po.field_name}'});} ,
  256. onQueueComplete : function(queueData) {
  257. var win = frameElement.api.opener;
  258. win.reloadTable();
  259. win.tip(serverMsg);
  260. frameElement.api.close();},
  261. 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;}},
  262. onUploadProgress : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { }});});
  263. </script><span id="image_uploadspan"><input type="file" name="${po.field_name}" id="${po.field_name}" /></span>
  264. </div>
  265. <div class="form" id="imagediv_${po.field_name}"> </div>
  266. </#if>
  267. <#--update-end--Author: jg_huangxg Date:20160113 for:TASK #824 【online开发】控件类型扩展增加一个图片类型 image -->
  268. <#else>
  269. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  270. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  271. <#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>
  272. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  273. class="form-control" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  274. <#if po.field_valid_type?if_exists?html != ''>
  275. datatype="${po.field_valid_type?if_exists?html}"
  276. <#else>
  277. <#if po.type == 'int'>
  278. datatype="n"
  279. <#elseif po.type=='double'>
  280. datatype="/^(-?\d+)(\.\d+)?$/"
  281. <#else>
  282. <#if po.is_null != 'Y'>datatype="*"</#if>
  283. </#if>
  284. </#if>>
  285. </#if>
  286. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  287. <label class="Validform_label" style="display: none">${po.content?if_exists?html}</label>
  288. </div>
  289. <#if (po_index%2==0)&&(!po_has_next)>
  290. <div class="col-xs-2 text-center"><b></b></div>
  291. <div class="col-xs-4"></div>
  292. </#if>
  293. <#if (po_index%2!=0)||(!po_has_next)>
  294. </div>
  295. </#if>
  296. </#list>
  297. <#list columnsarea as po>
  298. <div class="row show-grid">
  299. <div class="col-xs-3 text-center"><b>${po.content}:</b></div>
  300. <div class="col-xs-3">
  301. <br/>
  302. <textarea id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}"
  303. style="width: 600px" class="form-control" rows="6"
  304. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  305. <#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>
  306. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  307. <#if po.operationCodesReadOnly?if_exists> readonly = "readonly"</#if>
  308. <#if po.field_valid_type?if_exists?html != ''>
  309. datatype="${po.field_valid_type?if_exists?html}"
  310. <#else>
  311. <#if po.is_null != 'Y'>datatype="*"</#if>
  312. </#if>>${data['${tableName}']['${po.field_name}']?if_exists?html}</textarea>
  313. <span class="Validform_checktip"></span>
  314. <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
  315. <#if po.show_type=='umeditor'>
  316. <script type="text/javascript">
  317. //实例化编辑器
  318. var ${po.field_name}_ue = UE.getEditor('${po.field_name}',{initialFrameWidth:${po.field_length}}).setHeight(260);
  319. </script>
  320. </#if>
  321. </div>
  322. </div>
  323. </#list>
  324. </div>
  325. </div>
  326. <div class="con-wrapper" style="display: block;"></div>
  327. </div>
  328. <#--update-end--Author:luobaoli Date:20150614 for:表单(主表/单表)属性中增加了扩展参数 ${po.extend_json?if_exists}-->