cgform_jspTemplate_update.ftl 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html>
  4. <#assign callbackFlag = false />
  5. <#assign fileName = "" />
  6. <#list pageColumns as callBackTestPo>
  7. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  8. <#if callBackTestPo.showType=='file' || callBackTestPo.showType == 'image'>
  9. <#assign callbackFlag = true />
  10. <#break>
  11. </#if>
  12. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  13. </#list>
  14. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  15. <#include "../../ui/datatype.ftl"/>
  16. <#include "../../ui/dictInfo.ftl"/>
  17. <#-- update--end--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  18. <html lang="zh-CN">
  19. <head>
  20. <meta charset="utf-8">
  21. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  22. <title>${ftl_description}</title>
  23. <meta name="description" content="">
  24. <meta name="viewport" content="width=device-width, initial-scale=1">
  25. <link rel="stylesheet" href="online/template/ledefault/css/vendor.css">
  26. <link rel="stylesheet" href="online/template/ledefault/css/bootstrap-theme.css">
  27. <link rel="stylesheet" href="online/template/ledefault/css/bootstrap.css">
  28. <link rel="stylesheet" href="online/template/ledefault/css/app.css">
  29. <link rel="stylesheet" href="plug-in/Validform/css/metrole/style.css" type="text/css"/>
  30. <link rel="stylesheet" href="plug-in/Validform/css/metrole/tablefrom.css" type="text/css"/>
  31. <script type="text/javascript" src="plug-in/jquery/jquery-1.9.0.js"></script>
  32. <script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
  33. <script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
  34. <script type="text/javascript" src="plug-in/easyui/locale/zh-cn.js"></script>
  35. <script type="text/javascript" src="plug-in/tools/syUtil.js"></script>
  36. <script type="text/javascript" src="plug-in/My97DatePicker/WdatePicker.js"></script>
  37. <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
  38. <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
  39. <script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
  40. <script type="text/javascript" src="plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
  41. <script type="text/javascript" src="plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
  42. <script type="text/javascript" src="plug-in/Validform/js/datatype_zh-cn.js"></script>
  43. <script type="text/javascript" src="plug-in/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
  44. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
  45. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
  46. <#if callbackFlag == true>
  47. <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css" />
  48. <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
  49. </#if>
  50. <script type="text/javascript">
  51. //编写自定义JS代码
  52. </script>
  53. </head>
  54. <body>
  55. <#-- update--begin--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  56. <#assign ue_widget_count = 0>
  57. <#-- update--end--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  58. <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="${entityName?uncap_first}Controller.do?doUpdate" tiptype="1" ${callbackFlag?string("callback=\"jeecgFormFileCallBack@Override\"", "")}>
  59. <input type="hidden" id="btn_sub" class="btn_sub"/>
  60. <input type="hidden" name="id" value='${'$'}{${entityName?uncap_first}Page.id}' >
  61. <div class="tab-wrapper">
  62. <!-- tab -->
  63. <ul class="nav nav-tabs">
  64. <li role="presentation" class="active"><a href="javascript:void(0);">${ftl_description}</a></li>
  65. </ul>
  66. <!-- tab内容 -->
  67. <div class="con-wrapper" id="con-wrapper1" style="display: block;">
  68. <div class="row form-wrapper">
  69. <#list pageColumns as po>
  70. <#if (pageColumns?size>20)>
  71. <#if po_index%2==0>
  72. <div class="row show-grid">
  73. </#if>
  74. <#else>
  75. <div class="row show-grid">
  76. </#if>
  77. <div class="col-xs-3 text-center">
  78. <b>${po.content}:</b>
  79. </div>
  80. <div class="col-xs-3">
  81. <#if po.showType=='text'>
  82. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  83. <input id="${po.fieldName}" name="${po.fieldName}" type="text" class="form-control"<@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}"/> value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}' />
  84. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  85. <#elseif po.showType=='popup'>
  86. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  87. <input id="${po.fieldName}" name="${po.fieldName}" type="text" class="form-control" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}"/><#if po.dictTable?if_exists?html!=""> onclick="inputClick(this,'${po.dictField}','${po.dictTable}')"</#if> value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}'/>
  88. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  89. <#elseif po.showType=='textarea'>
  90. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  91. <textarea id="${po.fieldName}" class="form-control" rows="6" name="${po.fieldName}" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}"/>>${'$'}{${entityName?uncap_first}Page.${po.fieldName}}</textarea>
  92. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  93. <#elseif po.showType=='password'>
  94. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  95. <input id="${po.fieldName}" name="${po.fieldName}" type="password" class="form-control" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}"/> value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}' />
  96. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  97. <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
  98. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  99. <t:dictSelect field="${po.fieldName}" type="${po.showType?if_exists?html}" extendJson="{class:'form-control'}" <@datatype inputCheck="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> <@dictInfo dictTable="${po.dictTable}" dictField="${po.dictField}" dictText="${po.dictText}" /> defaultVal="${'$'}{${entityName?uncap_first}Page.${po.fieldName}}" hasLabel="false" title="${po.content}"></t:dictSelect>
  100. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  101. <#elseif po.showType=='date'>
  102. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  103. <input id="${po.fieldName}" name="${po.fieldName}" type="text" style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;" class="form-control" onClick="WdatePicker()"<@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> value='<fmt:formatDate value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}' type="date" pattern="yyyy-MM-dd"/>' />
  104. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  105. <#elseif po.showType=='datetime'>
  106. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  107. <input id="${po.fieldName}" name="${po.fieldName}" type="text" style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;" class="form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"<@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> value='<fmt:formatDate value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}' type="date" pattern="yyyy-MM-dd hh:mm:ss"/>' />
  108. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  109. <#-- update--begin--author:zhangjiaqiang date:20170531 for:数据回显表格ID区分 -->
  110. <#elseif po.showType=='file' || po.showType == 'image'>
  111. <table id="${fieldMeta[po.fieldName]?lower_case}_fileTable"></table>
  112. <#-- update--end--author:zhangjiaqiang date:20170531 for:数据回显表格ID区分 -->
  113. <#if !(po.operationCodesReadOnly ??)>
  114. <#assign fileName = fileName + "${po.fieldName}," />
  115. <table></table>
  116. <script type="text/javascript">
  117. var serverMsg="";
  118. $(function(){
  119. $('#${po.fieldName}').uploadify({
  120. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  121. <#if po.showType == 'image'>
  122. buttonText:'添加图片',
  123. <#else>
  124. buttonText:'添加文件',
  125. </#if>
  126. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  127. auto:false,
  128. progressData:'speed',
  129. multi:true,
  130. height:25,
  131. overrideEvents:['onDialogClose'],
  132. fileTypeDesc:'文件格式:',
  133. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  134. queueID:'filediv_${po.fieldName}',
  135. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  136. <#-- fileTypeExts:'*.rar;*.zip;*.doc;*.docx;*.txt;*.ppt;*.xls;*.xlsx;*.html;*.htm;*.pdf;*.jpg;*.gif;*.png', 页面弹出很慢解决 20170317 scott -->
  137. fileSizeLimit:'15MB',
  138. swf:'plug-in/uploadify/uploadify.swf',
  139. uploader:'cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
  140. onUploadStart : function(file) {
  141. var cgFormId=$("input[name='id']").val();
  142. $('#${po.fieldName}').uploadify("settings", "formData", {
  143. 'cgFormId':cgFormId,
  144. 'cgFormName':'${tableName}',
  145. 'cgFormField':'${fieldMeta[po.fieldName]}'
  146. });
  147. } ,
  148. onQueueComplete : function(queueData) {
  149. var win = frameElement.api.opener;
  150. win.reloadTable();
  151. win.tip(serverMsg);
  152. frameElement.api.close();
  153. },
  154. onUploadSuccess : function(file, data, response) {
  155. var d=$.parseJSON(data);
  156. if(d.success){
  157. var win = frameElement.api.opener;
  158. serverMsg = d.msg;
  159. }
  160. },
  161. onFallback: function() {
  162. tip("您未安装FLASH控件,无法上传图片!请安装FLASH控件后再试")
  163. },
  164. onSelectError: function(file, errorCode, errorMsg) {
  165. switch (errorCode) {
  166. case - 100 : tip("上传的文件数量已经超出系统限制的" + $('#file').uploadify('settings', 'queueSizeLimit') + "个文件!");
  167. break;
  168. case - 110 : tip("文件 [" + file.name + "] 大小超出系统限制的" + $('#file').uploadify('settings', 'fileSizeLimit') + "大小!");
  169. break;
  170. case - 120 : tip("文件 [" + file.name + "] 大小异常!");
  171. break;
  172. case - 130 : tip("文件 [" + file.name + "] 类型不正确!");
  173. break;
  174. }
  175. },
  176. onUploadProgress: function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) {}
  177. });
  178. });
  179. </script>
  180. <span id="file_uploadspan"><input type="file" name="${po.fieldName}" id="${po.fieldName}" /></span>
  181. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  182. <div class="form" id="filediv_${po.fieldName}"></div>
  183. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  184. </#if>
  185. <#--update-start--Author: jg_huangxg Date:20160421 for:TASK #1027 【online】代码生成器模板不支持UE编辑器 -->
  186. <#elseif po.showType='umeditor'>
  187. <#-- update--begin--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  188. <#assign ue_widget_count = ue_widget_count + 1>
  189. <#if ue_widget_count == 1>
  190. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
  191. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
  192. </#if>
  193. <#-- update--end--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  194. <#--update-start--Author: dangzhenghui Date:20170510 for:TASK #1899 【代码生成器bug】控件类型为UE编辑器 ,编辑页面内容显示为空-->
  195. <textarea name="${po.fieldName}" id="${po.fieldName}" style="width: 650px;height:300px">${'$'}{${entityName?uncap_first}Page.${po.fieldName} }</textarea>
  196. <#--update-end--Author: dangzhenghui Date:20170510 for:TASK #1899 【代码生成器bug】控件类型为UE编辑器 ,编辑页面内容显示为空-->
  197. <script type="text/javascript">
  198. <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
  199. var ${po.fieldName}_editor = UE.getEditor('${po.fieldName}');
  200. <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
  201. </script>
  202. <#--update-end--Author: jg_huangxg Date:20160421 for:TASK #1027 【online】代码生成器模板不支持UE编辑器 -->
  203. <#else>
  204. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  205. <input id="${po.fieldName}" name="${po.fieldName}" type="text" style="width: 150px" class="form-control" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}'>
  206. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  207. </#if>
  208. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  209. <label class="Validform_label" style="display: none">${po.content?if_exists?html}</label>
  210. </div>
  211. <#if (pageColumns?size>20)>
  212. <#if (po_index%2==0)&&(!po_has_next)>
  213. <div class="col-xs-2 text-center"><b></b></div>
  214. <div class="col-xs-4"></div>
  215. </#if>
  216. <#if (po_index%2!=0)||(!po_has_next)>
  217. </div>
  218. </#if>
  219. <#else>
  220. </div>
  221. </#if>
  222. </#list>
  223. <#-- update--begin--author:zhoujf Date:20170523 for:TASK #1961 【代码生成器】一对多富文本编辑器,生成代码格式问题 -->
  224. <#list pageAreatextColumns as po>
  225. <div class="row show-grid">
  226. <div class="col-xs-3 text-center">
  227. <b>${po.content}:</b>
  228. </div>
  229. <div class="col-xs-3">
  230. <#if po.showType=='textarea'>
  231. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  232. <textarea id="${po.fieldName}" class="form-control" rows="6" style="width: 600px" name="${po.fieldName}" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}"/>>${'$'}{${entityName?uncap_first}Page.${po.fieldName}}</textarea>
  233. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  234. <#elseif po.showType='umeditor'>
  235. <#-- update--begin--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  236. <#assign ue_widget_count = ue_widget_count + 1>
  237. <#if ue_widget_count == 1>
  238. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
  239. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
  240. </#if>
  241. <#-- update--end--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  242. <#--update-start--Author: dangzhenghui Date:20170510 for:TASK #1899 【代码生成器bug】控件类型为UE编辑器 ,编辑页面内容显示为空-->
  243. <textarea name="${po.fieldName}" id="${po.fieldName}" style="width: 650px;height:300px">${'$'}{${entityName?uncap_first}Page.${po.fieldName} }</textarea>
  244. <#--update-end--Author: dangzhenghui Date:20170510 for:TASK #1899 【代码生成器bug】控件类型为UE编辑器 ,编辑页面内容显示为空-->
  245. <script type="text/javascript">
  246. <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
  247. var ${po.fieldName}_editor = UE.getEditor('${po.fieldName}');
  248. <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
  249. </script>
  250. </#if>
  251. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  252. <label class="Validform_label" style="display: none">${po.content?if_exists?html}</label>
  253. </div>
  254. </div>
  255. </#list>
  256. <#-- update--end--author:zhoujf Date:20170523 for:TASK #1961 【代码生成器】一对多富文本编辑器,生成代码格式问题 -->
  257. <div class="row" id = "sub_tr" style="display: none;">
  258. <div class="col-xs-12 layout-header">
  259. <div class="col-xs-6"></div>
  260. <div class="col-xs-6"><button type="button" onclick="neibuClick();" class="btn btn-default">提交</button></div>
  261. </div>
  262. </div>
  263. </div>
  264. </div>
  265. <div class="con-wrapper" id="con-wrapper2" style="display: block;"></div>
  266. </div>
  267. </t:formvalid>
  268. <#if callbackFlag == true>
  269. <script type="text/javascript">
  270. //加载 已存在的 文件
  271. $(function(){
  272. var cgFormId=$("input[name='id']").val();
  273. $.ajax({
  274. type: "post",
  275. url: "${entityName?uncap_first}Controller.do?getFiles&id=" + cgFormId,
  276. success: function(data){
  277. var arrayFileObj = jQuery.parseJSON(data).obj;
  278. $.each(arrayFileObj,function(n,file){
  279. <#-- update--begin--author:zhangjiaqiang date:20170531 for:多个附件的数据显示 -->
  280. var fieldName = file.field.toLowerCase();
  281. var table = $("#"+fieldName+"_fileTable");
  282. <#-- update--end--author:zhangjiaqiang date:20170531 for:多个附件的数据显示 -->
  283. var tr = $("<tr style=\"height:34px;\"></tr>");
  284. <#-- update--begin--author:zhangjiaqiang date:20170614 for:文件名称太长显示问题 -->
  285. var title = file.title;
  286. if(title.length > 15){
  287. title = title.substring(0,12) + "...";
  288. }
  289. var td_title = $("<td>" + title + "</td>");
  290. <#-- update--end--author:zhangjiaqiang date:20170614 for:文件名称太长显示问题 -->
  291. <#-- update--begin--author:zhangjiaqiang date:20170614 for:操作按钮之间增加间隔 -->
  292. var td_download = $("<td><a style=\"margin-left:10px;\" href=\"commonController.do?viewFile&fileid=" + file.fileKey + "&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity\" title=\"下载\">下载</a></td>")
  293. var td_view = $("<td><a style=\"margin-left:10px;\" href=\"javascript:void(0);\" onclick=\"openwindow('预览','commonController.do?openViewFile&fileid=" + file.fileKey + "&subclassname=org.jeecgframework.web.cgform.entity.upload.CgUploadEntity','fList',700,500)\">预览</a></td>");
  294. var td_del = $("<td><a style=\"margin-left:10px;\" href=\"javascript:void(0)\" class=\"jeecgDetail\" onclick=\"del('cgUploadController.do?delFile&id=" + file.fileKey + "',this)\">删除</a></td>");
  295. <#-- update--end--author:zhangjiaqiang date:20170614 for:操作按钮之间增加间隔 -->
  296. tr.appendTo(table);
  297. td_title.appendTo(tr);
  298. td_download.appendTo(tr);
  299. td_view.appendTo(tr);
  300. td_del.appendTo(tr);
  301. });
  302. }
  303. });
  304. });
  305. <#-- update--begin--author:zhangjiaqiang date:20170531 for:附件资源删除处理 -->
  306. /**
  307. * 删除图片数据资源
  308. */
  309. function del(url,obj){
  310. var content = "请问是否要删除该资源";
  311. var navigatorName = "Microsoft Internet Explorer";
  312. if( navigator.appName == navigatorName ){
  313. $.dialog.confirm(content, function(){
  314. submit(url,obj);
  315. }, function(){
  316. });
  317. }else{
  318. layer.open({
  319. title:"提示",
  320. content:content,
  321. icon:7,
  322. yes:function(index){
  323. submit(url,obj);
  324. },
  325. btn:['确定','取消'],
  326. btn2:function(index){
  327. layer.close(index);
  328. }
  329. });
  330. }
  331. }
  332. function submit(url,obj){
  333. $.ajax({
  334. async : false,
  335. cache : false,
  336. type : 'POST',
  337. url : url,// 请求的action路径
  338. error : function() {// 请求失败处理函数
  339. },
  340. success : function(data) {
  341. var d = $.parseJSON(data);
  342. if (d.success) {
  343. var msg = d.msg;
  344. tip(msg);
  345. obj.parentNode.parentNode.parentNode.deleteRow(obj.parentNode.parentNode);
  346. } else {
  347. tip(d.msg);
  348. }
  349. }
  350. });
  351. }
  352. <#-- update--end--author:zhangjiaqiang date:20170531 for:附件资源删除处理 -->
  353. function jeecgFormFileCallBack(data){
  354. if (data.success == true) {
  355. uploadFile(data);
  356. } else {
  357. if (data.responseText == '' || data.responseText == undefined) {
  358. $.messager.alert('错误', data.msg);
  359. $.Hidemsg();
  360. } else {
  361. try {
  362. var emsg = data.responseText.substring(data.responseText.indexOf('错误描述'), data.responseText.indexOf('错误信息'));
  363. $.messager.alert('错误', emsg);
  364. $.Hidemsg();
  365. } catch(ex) {
  366. $.messager.alert('错误', data.responseText + '');
  367. }
  368. }
  369. return false;
  370. }
  371. if (!neibuClickFlag) {
  372. var win = frameElement.api.opener;
  373. win.reloadTable();
  374. }
  375. }
  376. function upload() {
  377. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  378. <#assign subFileName = fileName?substring(0,fileName?length - 1) />
  379. <#list subFileName?split(",") as name>
  380. $('#${name}').uploadify('upload', '*');
  381. </#list>
  382. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  383. }
  384. var neibuClickFlag = false;
  385. function neibuClick() {
  386. neibuClickFlag = true;
  387. $('#btn_sub').trigger('click');
  388. }
  389. function cancel() {
  390. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  391. <#assign subFileName = fileName?substring(0,fileName?length - 1) />
  392. <#list subFileName?split(",") as name>
  393. $('#${name}').uploadify('cancel', '*');
  394. </#list>
  395. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  396. }
  397. function uploadFile(data){
  398. if(!$("input[name='id']").val()){
  399. if(data.obj!=null && data.obj!='undefined'){
  400. $("input[name='id']").val(data.obj.id);
  401. }
  402. }
  403. if($(".uploadify-queue-item").length>0){
  404. upload();
  405. }else{
  406. if (neibuClickFlag){
  407. alert(data.msg);
  408. neibuClickFlag = false;
  409. }else {
  410. var win = frameElement.api.opener;
  411. win.reloadTable();
  412. win.tip(data.msg);
  413. frameElement.api.close();
  414. }
  415. }
  416. }
  417. </script>
  418. </#if>
  419. <script type="text/javascript">
  420. $(function(){
  421. //查看模式情况下,删除和上传附件功能禁止使用
  422. if(location.href.indexOf("load=detail")!=-1){
  423. $(".jeecgDetail").hide();
  424. }
  425. if(location.href.indexOf("mode=read")!=-1){
  426. //查看模式控件禁用
  427. $("#formobj").find(":input").attr("disabled","disabled");
  428. }
  429. if(location.href.indexOf("mode=onbutton")!=-1){
  430. //其他模式显示提交按钮
  431. $("#sub_tr").show();
  432. }
  433. });
  434. var neibuClickFlag = false;
  435. function neibuClick() {
  436. neibuClickFlag = true;
  437. $('#btn_sub').trigger('click');
  438. }
  439. </script>
  440. </body>
  441. <script src = "webpage/${bussiPackage?replace('.','/')}/${entityPackage}/${entityName?uncap_first}.js"></script>
  442. </html>