jform.ftl 36 KB

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