jform.ftl 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <#setting number_format="0.#####################">
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <base href="${basePath}/"/>
  6. <meta charset="utf-8">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8. <title>表单信息</title>
  9. <meta name="description" content="">
  10. <meta name="viewport" content="width=device-width, initial-scale=1">
  11. <link rel="stylesheet" href="${basePath}/online/template/ledefault/css/vendor.css">
  12. <link rel="stylesheet" href="${basePath}/online/template/ledefault/css/bootstrap-theme.css">
  13. <link rel="stylesheet" href="${basePath}/online/template/ledefault/css/bootstrap.css">
  14. <link rel="stylesheet" href="${basePath}/online/template/ledefault/css/app.css">
  15. <link rel="stylesheet" href="${basePath}/plug-in/Validform/css/metrole/style.css" type="text/css"/>
  16. <link rel="stylesheet" href="${basePath}/plug-in/Validform/css/metrole/tablefrom.css" type="text/css"/>
  17. </head>
  18. <body>
  19. <#--update-start--Author:luobaoli Date:20150614 for:表单单表属性中增加了扩展参数 ${po.extend_json?if_exists}-->
  20. <form id="formobj" action="${basePath}/cgFormBuildController.do?saveOrUpdate" name="formobj" method="post">
  21. <input type="hidden" id="btn_sub" class="btn_sub"/>
  22. <input type="hidden" name="tableName" value="${tableName?if_exists?html}" >
  23. <input type="hidden" name="id" value="${id?if_exists?html}" >
  24. <#list columnhidden as po>
  25. <input type="hidden" id="${po.field_name}" name="${po.field_name}" value="${data['${tableName}']['${po.field_name}']?if_exists?html}" >
  26. </#list>
  27. <div class="tab-wrapper">
  28. <!-- tab -->
  29. <ul class="nav nav-tabs">
  30. <li role="presentation" class="active"><a href="javascript:void(0);">表单信息管理</a></li>
  31. </ul>
  32. <!-- tab内容 -->
  33. <div class="con-wrapper" id="con-wrapper1" style="display: block;">
  34. <div class="row form-wrapper">
  35. <#list columns as po>
  36. <#if (columns?size>10)>
  37. <#if po_index%2==0>
  38. <div class="row show-grid">
  39. </#if>
  40. <#else>
  41. <div class="row show-grid">
  42. </#if>
  43. <div class="col-xs-3 text-center">
  44. <b>${po.content}:</b>
  45. </div>
  46. <div class="col-xs-3">
  47. <#if head.isTree=='Y' && head.treeParentIdFieldName==po.field_name>
  48. <!--如果为树形菜单,父id输入框设置为select-->
  49. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  50. class="form-control easyui-combotree" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  51. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  52. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  53. <#if po.file_must_input??><#if po.file_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  54. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  55. <#if po.field_valid_type?if_exists?html != ''>
  56. datatype="${po.field_valid_type?if_exists?html}"
  57. <#else>
  58. <#if po.type == 'int'>
  59. datatype="n" <#if po.is_null == 'Y'>ignore="ignore" </#if>
  60. <#elseif po.type=='double'>
  61. datatype="/^(-?\d+)(\.\d+)?$/" <#if po.is_null == 'Y'>ignore="ignore" </#if>
  62. <#else>
  63. <#if po.is_null != 'Y'>datatype="*"</#if>
  64. </#if>
  65. </#if>
  66. data-options="
  67. panelHeight:'220',
  68. url: '${basePath}/cgAutoListController.do?datagrid&configId=${tableName?if_exists?html}&field=id,${head.treeFieldname}',
  69. loadFilter: function(data) {
  70. var rows = data.rows || data;
  71. var win = frameElement.api.opener;
  72. var listRows = win.getDataGrid().treegrid('getData');
  73. joinTreeChildren(rows, listRows);
  74. convertTreeData(rows, '${head.treeFieldname}');
  75. return rows;
  76. },
  77. <#-- update--begin--author:zhangjiaqiang Date:20170518 for:修订树形菜单选择必填项问题-->
  78. onSelect:function(node){
  79. $('#${po.field_name}').val(node.id);
  80. },
  81. <#-- update--end--author:zhangjiaqiang Date:20170518 for:修订树形菜单选择必填项问题 -->
  82. onLoadSuccess: function() {
  83. var win = frameElement.api.opener;
  84. var currRow = win.getDataGrid().treegrid('getSelected');
  85. if(!'${id?if_exists?html}') {
  86. //增加时,选择当前父菜单
  87. if(currRow) {
  88. $('#${po.field_name}').combotree('setValue', currRow.id);
  89. }
  90. }else {
  91. //编辑时,选择当前父菜单
  92. if(currRow) {
  93. $('#${po.field_name}').combotree('setValue', currRow._parentId);
  94. }
  95. }
  96. }
  97. ">
  98. <#--update-end--Author:钟世云 Date:20150610 for:online支持树配置-->
  99. <#elseif po.show_type=='text'>
  100. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  101. class="form-control" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  102. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  103. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  104. <#if po.file_must_input??><#if po.file_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  105. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  106. <#if po.field_valid_type?if_exists?html != ''>
  107. datatype="${po.field_valid_type?if_exists?html}"
  108. <#else>
  109. <#if po.type == 'int'>
  110. datatype="n" <#if po.is_null == 'Y'>ignore="ignore" </#if>
  111. <#elseif po.type=='double'>
  112. datatype="/^(-?\d+)(\.\d+)?$/" <#if po.is_null == 'Y'>ignore="ignore" </#if>
  113. <#else>
  114. <#if po.is_null != 'Y'>datatype="*"</#if>
  115. </#if>
  116. </#if>>
  117. <#elseif po.show_type=='password'>
  118. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="password"
  119. class="form-control" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  120. <#if po.operationCodesReadOnly?if_exists> readonly = "readonly"</#if>
  121. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  122. <#if po.file_must_input??><#if po.file_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  123. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  124. <#if po.field_valid_type?if_exists?html != ''>
  125. datatype="${po.field_valid_type?if_exists?html}"
  126. <#else>
  127. <#if po.is_null != 'Y'>datatype="*"</#if>
  128. </#if>>
  129. <#elseif po.show_type=='radio'>
  130. <@DictData name="${po.dict_field?if_exists?html}" text="${po.dict_text?if_exists?html}" tablename="${po.dict_table?if_exists?html}" var="dataList">
  131. <#list dataList as dictdata>
  132. <input value="${dictdata.typecode?if_exists?html}" ${po.extend_json?if_exists} name="${po.field_name}" type="radio"
  133. <#-- update--begin--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  134. <#if dictdata_index==0>
  135. <#if po.field_valid_type?if_exists?html != ''>
  136. datatype="${po.field_valid_type?if_exists?html}"
  137. <#elseif po.is_null != 'Y'>
  138. datatype="*"
  139. </#if>
  140. <#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>
  141. </#if>
  142. <#-- update--end--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  143. <#if po.operationCodesReadOnly?if_exists>onclick="return false;"</#if>
  144. <#if dictdata.typecode?if_exists?html=="${data['${tableName}']['${po.field_name}']?if_exists?html}"> checked="true" </#if>>
  145. ${dictdata.typename?if_exists?html}
  146. </#list>
  147. </@DictData>
  148. <#elseif po.show_type=='checkbox'>
  149. <#assign checkboxstr>${data['${tableName}']['${po.field_name}']?if_exists?html}</#assign>
  150. <#assign checkboxlist=checkboxstr?split(",")>
  151. <@DictData name="${po.dict_field?if_exists?html}" text="${po.dict_text?if_exists?html}" tablename="${po.dict_table?if_exists?html}" var="dataList">
  152. <#list dataList as dictdata>
  153. <input value="${dictdata.typecode?if_exists?html}" ${po.extend_json?if_exists} name="${po.field_name}" type="checkbox"
  154. <#if po.operationCodesReadOnly?if_exists>onclick="return false;"</#if>
  155. <#-- update--begin--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  156. <#if dictdata_index==0>
  157. <#if po.field_valid_type?if_exists?html != ''>
  158. datatype="${po.field_valid_type?if_exists?html}"
  159. <#elseif po.is_null != 'Y'>
  160. datatype="*"
  161. </#if>
  162. <#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>
  163. </#if>
  164. <#-- update--end--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  165. <#list checkboxlist as x >
  166. <#if dictdata.typecode?if_exists?html=="${x?if_exists?html}"> checked="true" </#if></#list>>
  167. ${dictdata.typename?if_exists?html}
  168. </#list>
  169. </@DictData>
  170. <#elseif po.show_type=='list'>
  171. <@DictData name="${po.dict_field?if_exists?html}" text="${po.dict_text?if_exists?html}" tablename="${po.dict_table?if_exists?html}" var="dataList">
  172. <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>
  173. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  174. <#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>
  175. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  176. <#-- update--begin--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  177. <#if po.field_valid_type?if_exists?html != ''>
  178. datatype="${po.field_valid_type?if_exists?html}"
  179. <#elseif po.is_null != 'Y'>
  180. datatype="*"
  181. </#if>>
  182. <#-- update--end--author:zhangjiaqiang Date:20170512 for:TASK #1910 【Online 校验】radio\checkbox\select 存在问题,没有根据选择校验规则校验 -->
  183. <#list dataList as dictdata>
  184. <option value="${dictdata.typecode?if_exists?html}"
  185. <#if dictdata.typecode?if_exists?html=="${data['${tableName}']['${po.field_name}']?if_exists?html}"> selected="selected" </#if>>
  186. ${dictdata.typename?if_exists?html}
  187. </option>
  188. </#list>
  189. </select>
  190. </@DictData>
  191. <#elseif po.show_type=='date'>
  192. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  193. value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  194. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  195. <#if po.file_must_input??><#if po.file_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  196. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  197. class="form-control" onClick="WdatePicker({<#if po.operationCodesReadOnly?if_exists> readonly = true</#if>})"
  198. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  199. <#if po.field_valid_type?if_exists?html != ''>
  200. datatype="${po.field_valid_type?if_exists?html}"
  201. <#else>
  202. <#if po.is_null != 'Y'>datatype="*"</#if>
  203. </#if>>
  204. <#elseif po.show_type=='datetime'>
  205. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  206. value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  207. class="form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'<#if po.operationCodesReadOnly?if_exists> ,readonly = true</#if>})"
  208. <#if po.operationCodesReadOnly?exists> readonly = "readonly"</#if>
  209. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  210. <#if po.file_must_input??><#if po.file_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  211. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  212. <#if po.field_valid_type?if_exists?html != ''>
  213. datatype="${po.field_valid_type?if_exists?html}"
  214. <#else>
  215. <#if po.is_null != 'Y'>datatype="*"</#if>
  216. </#if>>
  217. <#elseif po.show_type=='popup'>
  218. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  219. class="searchbox-inputtext"
  220. onClick="inputClick(this,'${po.dict_text?if_exists?html}','${po.dict_table?if_exists?html}');"
  221. value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  222. <#if po.operationCodesReadOnly?if_exists> readonly = "readonly"</#if>
  223. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  224. <#if po.file_must_input??><#if po.file_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  225. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  226. <#if po.field_valid_type?if_exists?html != ''>
  227. datatype="${po.field_valid_type?if_exists?html}"
  228. <#else>
  229. <#if po.is_null != 'Y'>datatype="*"</#if>
  230. </#if>>
  231. <#elseif po.show_type=='file'>
  232. <table>
  233. <#-- update--begin--author:zhangjiaqiang date:20170519 for:修订资源预览关联错误 -->
  234. <#list filesList as fileB>
  235. <#if fileB['field'] == po.field_name>
  236. <tr style="height:34px;">
  237. <td>${fileB['title']}</td>
  238. <td><a href="${basePath}/commonController.do?viewFile&fileid=${fileB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity" title="下载">下载</a></td>
  239. <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>
  240. <td><a href="javascript:void(0)" class="jeecgDetail" onclick="del('${basePath}/cgUploadController.do?delFile&id=${fileB['fileKey']}',this)">删除</a></td>
  241. </tr>
  242. </#if>
  243. </#list>
  244. <#-- update--end--author:zhangjiaqiang date:20170519 for:修订资源预览关联错误 -->
  245. </table>
  246. <#if !(po.operationCodesReadOnly ??)>
  247. <div class="form jeecgDetail">
  248. <script type="text/javascript">
  249. var serverMsg="";
  250. var m = new Map();
  251. $(function(){$('#${po.field_name}').uploadify(
  252. {buttonText:'添加文件',
  253. auto:false,
  254. progressData:'speed',
  255. multi:true,
  256. height:25,
  257. overrideEvents:['onDialogClose'],
  258. fileTypeDesc:'文件格式:',
  259. queueID:'filediv_${po.field_name}',
  260. <#-- fileTypeExts:'*.rar;*.zip;*.doc;*.docx;*.txt;*.ppt;*.xls;*.xlsx;*.html;*.htm;*.pdf;*.jpg;*.gif;*.png', 页面弹出很慢解决 20170317 scott -->
  261. fileSizeLimit:'15MB',swf:'${basePath}/plug-in/uploadify/uploadify.swf',
  262. uploader:'${basePath}/cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
  263. onUploadStart : function(file) {
  264. var cgFormId=$("input[name='id']").val();
  265. $('#${po.field_name}').uploadify("settings", "formData", {'cgFormId':cgFormId,'cgFormName':'${tableName?if_exists?html}','cgFormField':'${po.field_name}'});} ,
  266. onQueueComplete : function(queueData) {
  267. var win = frameElement.api.opener;
  268. win.reloadTable();
  269. win.tip(serverMsg);
  270. frameElement.api.close();},
  271. 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;}},
  272. onUploadProgress : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { }});});
  273. </script><span id="file_uploadspan"><input type="file" name="${po.field_name}" id="${po.field_name}" /></span>
  274. </div>
  275. <div class="form" id="filediv_${po.field_name}"> </div>
  276. </#if>
  277. <#--update-start--Author: jg_huangxg Date:20160113 for:TASK #824 【online开发】控件类型扩展增加一个图片类型 image -->
  278. <#elseif po.show_type=='image'>
  279. <table>
  280. <#-- update--begin--author:zhangjiaqiang date:20170519 for:修订资源预览关联错误 -->
  281. <#list imageList as imageB>
  282. <#if imageB['field'] == po.field_name>
  283. <tr style="height:34px;">
  284. <td>${imageB['title']}</td>
  285. <td><a href="${basePath}/commonController.do?viewFile&fileid=${imageB['fileKey']}&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity" title="下载">下载</a></td>
  286. <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>
  287. <td><a href="javascript:void(0)" class="jeecgDetail" onclick="del('${basePath}/cgUploadController.do?delFile&id=${imageB['fileKey']}',this)">删除</a></td>
  288. </tr>
  289. </#if>
  290. </#list>
  291. <#-- update--end--author:zhangjiaqiang date:20170519 for:修订资源预览关联错误 -->
  292. </table>
  293. <#if !(po.operationCodesReadOnly ??)>
  294. <div class="form jeecgDetail">
  295. <script type="text/javascript">
  296. var serverMsg="";
  297. var m = new Map();
  298. $(function(){$('#${po.field_name}').uploadify(
  299. {buttonText:'添加图片',
  300. auto:false,
  301. progressData:'speed',
  302. multi:true,
  303. height:25,
  304. overrideEvents:['onDialogClose'],
  305. fileTypeDesc:'图片格式:',
  306. queueID:'imagediv_${po.field_name}',
  307. fileTypeExts:'*.jpg;*.jpeg;*.gif;*.png;*.bmp',
  308. fileSizeLimit:'15MB',swf:'${basePath}/plug-in/uploadify/uploadify.swf',
  309. uploader:'${basePath}/cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
  310. onUploadStart : function(file) {
  311. var cgFormId=$("input[name='id']").val();
  312. $('#${po.field_name}').uploadify("settings", "formData", {'cgFormId':cgFormId,'cgFormName':'${tableName?if_exists?html}','cgFormField':'${po.field_name}'});} ,
  313. onQueueComplete : function(queueData) {
  314. var win = frameElement.api.opener;
  315. win.reloadTable();
  316. win.tip(serverMsg);
  317. frameElement.api.close();},
  318. 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;}},
  319. onUploadProgress : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { }});});
  320. </script><span id="image_uploadspan"><input type="file" name="${po.field_name}" id="${po.field_name}" /></span>
  321. </div>
  322. <div class="form" id="imagediv_${po.field_name}"> </div>
  323. </#if>
  324. <#--update-end--Author: jg_huangxg Date:20160113 for:TASK #824 【online开发】控件类型扩展增加一个图片类型 image -->
  325. <#else>
  326. <input id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}" type="text"
  327. class="form-control" value="${data['${tableName}']['${po.field_name}']?if_exists?html}"
  328. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  329. <#if po.file_must_input??><#if po.file_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if><#elseif po.is_null != 'Y'> ignore="checked"<#else>ignore="ignore"</#if>
  330. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  331. <#if po.field_valid_type?if_exists?html != ''>
  332. datatype="${po.field_valid_type?if_exists?html}"
  333. <#else>
  334. <#if po.type == 'int'>
  335. datatype="n"
  336. <#elseif po.type=='double'>
  337. datatype="/^(-?\d+)(\.\d+)?$/"
  338. <#else>
  339. <#if po.is_null != 'Y'>datatype="*"</#if>
  340. </#if>
  341. </#if>>
  342. </#if>
  343. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  344. <label class="Validform_label" style="display: none">${po.content?if_exists?html}</label>
  345. </div>
  346. <#if (columns?size>10)>
  347. <#if (po_index%2==0)&&(!po_has_next)>
  348. <div class="col-xs-2 text-center"><b></b></div>
  349. <div class="col-xs-4"></div>
  350. </#if>
  351. <#if (po_index%2!=0)||(!po_has_next)>
  352. </div>
  353. </#if>
  354. <#else>
  355. </div>
  356. </#if>
  357. </#list>
  358. <#list columnsarea as po>
  359. <#if (columns?size>10)>
  360. <div class="row show-grid">
  361. <div class="col-xs-3 text-center"><b>${po.content}:</b></div>
  362. <div class="col-xs-3">
  363. <br/>
  364. <textarea id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}"
  365. style="width: 600px" class="form-control" rows="6"
  366. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  367. <#if po.file_must_input??><#if po.file_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if></#if>
  368. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  369. <#if po.operationCodesReadOnly?if_exists> readonly = "readonly"</#if>
  370. <#if po.field_valid_type?if_exists?html != ''>
  371. datatype="${po.field_valid_type?if_exists?html}"
  372. <#else>
  373. <#if po.is_null != 'Y'>datatype="*"</#if>
  374. </#if>>${data['${tableName}']['${po.field_name}']?if_exists?html}</textarea>
  375. <span class="Validform_checktip"></span>
  376. <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
  377. <#if po.show_type=='umeditor'>
  378. <script type="text/javascript">
  379. //实例化编辑器
  380. var ${po.field_name}_ue = UE.getEditor('${po.field_name}',{initialFrameWidth:${po.field_length}}).setHeight(260);
  381. </script>
  382. </#if>
  383. </div>
  384. </div>
  385. <#else>
  386. <div class="row show-grid">
  387. <div class="col-xs-3 text-center"><b>${po.content}:</b></div>
  388. <div class="col-xs-3">
  389. <br/>
  390. <textarea id="${po.field_name}" ${po.extend_json?if_exists} name="${po.field_name}"
  391. class="form-control" rows="7"
  392. <#-- update--begin--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  393. <#if po.file_must_input??><#if po.file_must_input == 'Y' || po.is_null != 'Y'>ignore="checked"<#else>ignore="ignore"</#if></#if>
  394. <#-- update--end--author:zhangjiaqiang Date:20170417 for:增加校验必填项 -->
  395. <#if po.operationCodesReadOnly?if_exists> readonly = "readonly"</#if>
  396. <#if po.field_valid_type?if_exists?html != ''>
  397. datatype="${po.field_valid_type?if_exists?html}"
  398. <#else>
  399. <#if po.is_null != 'Y'>datatype="*"</#if>
  400. </#if>>${data['${tableName}']['${po.field_name}']?if_exists?html}</textarea>
  401. <span class="Validform_checktip"></span>
  402. <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
  403. <#if po.show_type=='umeditor'>
  404. <script type="text/javascript">
  405. //实例化编辑器
  406. var ${po.field_name}_ue = UE.getEditor('${po.field_name}',{initialFrameWidth:${po.field_length}}).setHeight(260);
  407. </script>
  408. </#if>
  409. </div>
  410. </div>
  411. </#if>
  412. </#list>
  413. <div class="row" id = "sub_tr" style="display: none;">
  414. <div class="col-xs-12 layout-header">
  415. <div class="col-xs-6"></div>
  416. <div class="col-xs-6"><button type="button" onclick="neibuClick();" class="btn btn-default">提交</button></div>
  417. </div>
  418. </div>
  419. </div>
  420. </div>
  421. <div class="con-wrapper" id="con-wrapper2" style="display: block;"></div>
  422. </div>
  423. </form>
  424. <script type="text/javascript" src="${basePath}/plug-in/jquery/jquery-1.9.0.js"></script>
  425. <script type="text/javascript" src="${basePath}/plug-in/tools/dataformat.js"></script>
  426. <script type="text/javascript" src="${basePath}/plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
  427. <script type="text/javascript" src="${basePath}/plug-in/easyui/locale/zh-cn.js"></script>
  428. <script type="text/javascript" src="${basePath}/plug-in/tools/syUtil.js"></script>
  429. <script type="text/javascript" src="${basePath}/plug-in/My97DatePicker/WdatePicker.js"></script>
  430. <script type="text/javascript" src="${basePath}/plug-in/lhgDialog/lhgdialog.min.js"></script>
  431. <script type="text/javascript" src="${basePath}/plug-in/tools/curdtools_zh-cn.js"></script>
  432. <script type="text/javascript" src="${basePath}/plug-in/tools/easyuiextend.js"></script>
  433. <script type="text/javascript" src="${basePath}/plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
  434. <script type="text/javascript" src="${basePath}/plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
  435. <script type="text/javascript" src="${basePath}/plug-in/Validform/js/datatype_zh-cn.js"></script>
  436. <script type="text/javascript" src="${basePath}/plug-in/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
  437. <script type="text/javascript">$(function(){$("#formobj").Validform({tiptype:1,btnSubmit:"#btn_sub",btnReset:"#btn_reset",ajaxPost:true,usePlugin:{passwordstrength:{minLen:6,maxLen:18,trigger:function(obj,error){if(error){obj.parent().next().find(".Validform_checktip").show();obj.find(".passwordStrength").hide();}else{$(".passwordStrength").show();obj.parent().next().find(".Validform_checktip").hide();}}}},callback:function(data){if(data.success==true){uploadFile(data);}else{if(data.responseText==''||data.responseText==undefined){$.messager.alert('错误', data.msg);$.Hidemsg();}else{try{var emsg = data.responseText.substring(data.responseText.indexOf('错误描述'),data.responseText.indexOf('错误信息')); $.messager.alert('错误',emsg);$.Hidemsg();}catch(ex){$.messager.alert('错误',data.responseText+'');}} return false;}if(!neibuClickFlag){var win = frameElement.api.opener; win.reloadTable();}}});});</script>
  438. <#--update-end--Author:luobaoli Date:20150614 for:表单单表属性中增加了扩展参数 ${po.extend_json?if_exists}-->
  439. <script type="text/javascript">
  440. $(function(){
  441. //查看模式情况下,删除和上传附件功能禁止使用
  442. if(location.href.indexOf("goDetail.do")!=-1){
  443. $(".jeecgDetail").hide();
  444. }
  445. if(location.href.indexOf("goDetail.do")!=-1){
  446. //查看模式控件禁用
  447. $("#formobj").find(":input").attr("disabled","disabled");
  448. }
  449. if(location.href.indexOf("goAddButton.do")!=-1||location.href.indexOf("goUpdateButton.do")!=-1){
  450. //其他模式显示提交按钮
  451. $("#sub_tr").show();
  452. }
  453. });
  454. function upload() {
  455. <#list columns as po>
  456. <#if po.show_type=='file'>
  457. $('#${po.field_name}').uploadify('upload', '*');
  458. </#if>
  459. <#if po.show_type=='image'>
  460. $('#${po.field_name}').uploadify('upload', '*');
  461. </#if>
  462. </#list>
  463. }
  464. var neibuClickFlag = false;
  465. function neibuClick() {
  466. neibuClickFlag = true;
  467. $('#btn_sub').trigger('click');
  468. }
  469. function cancel() {
  470. <#list columns as po>
  471. <#if po.show_type=='file'>
  472. $('#${po.field_name}').uploadify('cancel', '*');
  473. </#if>
  474. <#if po.show_type=='image'>
  475. $('#${po.field_name}').uploadify('cancel', '*');
  476. </#if>
  477. </#list>
  478. }
  479. function uploadFile(data){
  480. if(!$("input[name='id']").val()){
  481. <#--update-start--Author:luobaoli Date:20150614 for:需要判断data.obj存在,才能取id值-->
  482. if(data.obj!=null && data.obj!='undefined'){
  483. $("input[name='id']").val(data.obj.id);
  484. }
  485. <#--update-end--Author:luobaoli Date:20150614 for:需要判断data.obj存在,才能取id值-->
  486. }
  487. if($(".uploadify-queue-item").length>0){
  488. upload();
  489. }else{
  490. if (neibuClickFlag){
  491. alert(data.msg);
  492. neibuClickFlag = false;
  493. }else {
  494. var win = frameElement.api.opener;
  495. win.reloadTable();
  496. win.tip(data.msg);
  497. frameElement.api.close();
  498. }
  499. }
  500. }
  501. $.dialog.setting.zIndex =1990;
  502. function del(url,obj){
  503. $.dialog.confirm("确认删除该条记录?", function(){
  504. $.ajax({
  505. async : false,
  506. cache : false,
  507. type : 'POST',
  508. url : url,// 请求的action路径
  509. error : function() {// 请求失败处理函数
  510. },
  511. success : function(data) {
  512. var d = $.parseJSON(data);
  513. if (d.success) {
  514. var msg = d.msg;
  515. tip(msg);
  516. $(obj).closest("tr").hide("slow");
  517. }
  518. }
  519. });
  520. }, function(){
  521. });
  522. }
  523. <#--add-start--Author:钟世云 Date:20150614 for:online支持树配置-->
  524. /**树形列表数据转换**/
  525. function convertTreeData(rows, textField) {
  526. for(var i = 0; i < rows.length; i++) {
  527. var row = rows[i];
  528. row.text = row[textField];
  529. if(row.children) {
  530. row.state = "open";
  531. convertTreeData(row.children, textField);
  532. }
  533. }
  534. }
  535. /**树形列表加入子元素**/
  536. function joinTreeChildren(arr1, arr2) {
  537. for(var i = 0; i < arr1.length; i++) {
  538. var row1 = arr1[i];
  539. for(var j = 0; j < arr2.length; j++) {
  540. if(row1.id == arr2[j].id) {
  541. var children = arr2[j].children;
  542. if(children) {
  543. row1.children = children;
  544. }
  545. }
  546. }
  547. }
  548. }
  549. <#--add-end--Author:钟世云 Date:20150614 for:online支持树配置-->
  550. </script>
  551. <script type="text/javascript">${js_plug_in?if_exists}</script>
  552. </body>
  553. </html>