cgform_jspTemplate_update.ftl 22 KB

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