jform.ftl 34 KB

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