cgform_jspTemplate_add.ftl 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  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. <#if callBackTestPo.showType=='file' || callBackTestPo.showType == 'image'>
  12. <#assign callbackFlag = true />
  13. <#break>
  14. </#if>
  15. </#list>
  16. <html lang="zh-CN">
  17. <head>
  18. <meta charset="utf-8">
  19. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  20. <title>${ftl_description}</title>
  21. <meta name="description" content="">
  22. <meta name="viewport" content="width=device-width, initial-scale=1">
  23. <link rel="stylesheet" href="online/template/ledefault/css/vendor.css">
  24. <link rel="stylesheet" href="online/template/ledefault/css/bootstrap-theme.css">
  25. <link rel="stylesheet" href="online/template/ledefault/css/bootstrap.css">
  26. <link rel="stylesheet" href="online/template/ledefault/css/app.css">
  27. <link rel="stylesheet" href="plug-in/Validform/css/metrole/style.css" type="text/css"/>
  28. <link rel="stylesheet" href="plug-in/Validform/css/metrole/tablefrom.css" type="text/css"/>
  29. <script type="text/javascript" src="plug-in/jquery/jquery-1.9.0.js"></script>
  30. <script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
  31. <script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
  32. <script type="text/javascript" src="plug-in/easyui/locale/zh-cn.js"></script>
  33. <script type="text/javascript" src="plug-in/tools/syUtil.js"></script>
  34. <script type="text/javascript" src="plug-in/My97DatePicker/WdatePicker.js"></script>
  35. <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
  36. <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
  37. <script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
  38. <script type="text/javascript" src="plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
  39. <script type="text/javascript" src="plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
  40. <script type="text/javascript" src="plug-in/Validform/js/datatype_zh-cn.js"></script>
  41. <script type="text/javascript" src="plug-in/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
  42. <#if callbackFlag == true>
  43. <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css" />
  44. <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
  45. </#if>
  46. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
  47. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
  48. </head>
  49. <script type="text/javascript">
  50. $(document).ready(function(){
  51. init();
  52. $("#jform_tab .con-wrapper").hide(); //Hide all tab content
  53. $("#jform_tab li:first").addClass("active").show(); //Activate first tab
  54. $("#jform_tab .con-wrapper:first").show(); //Show first tab content
  55. //On Click Event
  56. $("#jform_tab li").click(function() {
  57. $("#jform_tab li").removeClass("active"); //Remove any "active" class
  58. $(this).addClass("active"); //Add "active" class to selected tab
  59. $("#jform_tab .con-wrapper").hide(); //Hide all tab content
  60. var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
  61. $(activeTab).fadeIn(); //Fade in the active content
  62. //$(""+activeTab).show();
  63. if( $(activeTab).html()!="") {
  64. return false;
  65. }else{
  66. $(activeTab).html('正在加载内容,请稍后...');
  67. var url = $(this).attr("tab-ajax-url");
  68. $.post(url, {}, function(data) {
  69. //$(this).attr("tab-ajax-cached", true);
  70. $(activeTab).html(data);
  71. });
  72. }
  73. return false;
  74. });
  75. });
  76. //初始化下标
  77. function resetTrNum(tableId) {
  78. $tbody = $("#"+tableId+"");
  79. $tbody.find('>tr').each(function(i){
  80. $(':input, select', this).each(function(){
  81. var $this = $(this), name = $this.attr('name'), val = $this.val();
  82. if(name!=null){
  83. if (name.indexOf("#index#") >= 0){
  84. $this.attr("name",name.replace('#index#',i));
  85. }else{
  86. var s = name.indexOf("[");
  87. var e = name.indexOf("]");
  88. var new_name = name.substring(s+1,e);
  89. $this.attr("name",name.replace(new_name,i));
  90. }
  91. }
  92. });
  93. $(this).find('div[name=\'xh\']').html(i+1);
  94. });
  95. }
  96. function init(){
  97. var tabHead =$("#jform_tab li:first");
  98. var tabBox = $("#jform_tab .con-wrapper:first");
  99. var url = tabHead.attr("tab-ajax-url");
  100. tabBox.html('正在加载内容,请稍后...');
  101. $.post(url, {}, function(data) {
  102. tabBox.html(data);
  103. //tabHead.attr("tab-ajax-cached", true);
  104. });
  105. }
  106. </script>
  107. <body>
  108. <#-- update--begin--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  109. <#assign ue_widget_count = 0>
  110. <#-- update--end--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  111. <form id="formobj" action="${entityName?uncap_first}Controller.do?doAdd" name="formobj" method="post">
  112. <input type="hidden" id="btn_sub" class="btn_sub"/>
  113. <#-- update--begin--author:zhangjiaqiang date:20170607 for:隐藏字段显示 -->
  114. <#list columns as po>
  115. <#if po.isShow == 'N'>
  116. <input id="${po.fieldName}" name="${po.fieldName}" type="hidden">
  117. </#if>
  118. </#list>
  119. <#-- update--end--author:zhangjiaqiang date:20170607 for:隐藏字段显示 -->
  120. <div class="tab-wrapper">
  121. <!-- tab -->
  122. <ul class="nav nav-tabs">
  123. <li role="presentation" class="active"><a href="javascript:void(0);">${ftl_description}</a></li>
  124. </ul>
  125. <!-- tab内容 -->
  126. <div class="con-wrapper" style="display: block;">
  127. <div class="row form-wrapper">
  128. <#list pageColumns as po>
  129. <#if (pageColumns?size>1)>
  130. <#if po_index%2==0>
  131. <div class="row show-grid">
  132. </#if>
  133. <#else>
  134. <div class="row show-grid">
  135. </#if>
  136. <div class="col-xs-3 text-center">
  137. <b>${po.content}:</b>
  138. </div>
  139. <div class="col-xs-3">
  140. <#if po.showType=='text'>
  141. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  142. <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!''}" /> />
  143. <#-- update--end--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  144. <#elseif po.showType=='popup'>
  145. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  146. <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> />
  147. <#-- update--end--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  148. <#elseif po.showType=='textarea'>
  149. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  150. <textarea id="${po.fieldName}" class="form-control" rows="6" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" /> name="${po.fieldName}"></textarea>
  151. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  152. <#elseif po.showType=='password'>
  153. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  154. <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!''}"/> />
  155. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  156. <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
  157. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  158. <t:dictSelect field="${po.fieldName}" type="${po.showType?if_exists?html}" extendJson="{class:'form-control',style:'width:150px'}" <@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}" /> hasLabel="false" title="${po.content}"></t:dictSelect>
  159. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  160. <#elseif po.showType=='date'>
  161. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  162. <input id="${po.fieldName}" name="${po.fieldName}" type="text" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;" class="form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
  163. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  164. <#elseif po.showType=='datetime'>
  165. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  166. <input id="${po.fieldName}" name="${po.fieldName}" type="text" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> 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'})" />
  167. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  168. <#elseif po.showType=='file' || po.showType == 'image'>
  169. <#assign fileName = fileName + "${po.fieldName}," />
  170. <table></table>
  171. <div class="form jeecgDetail">
  172. <script type="text/javascript">
  173. var serverMsg="";
  174. $(function(){
  175. $('#${po.fieldName}').uploadify({
  176. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  177. <#if po.showType == 'image'>
  178. buttonText:'添加图片',
  179. <#else>
  180. buttonText:'添加文件',
  181. </#if>
  182. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  183. auto:false,
  184. progressData:'speed',
  185. multi:true,
  186. height:25,
  187. overrideEvents:['onDialogClose'],
  188. fileTypeDesc:'文件格式:',
  189. queueID:'filediv_${po.fieldName}',
  190. <#-- update--begin--author:zhangjiaqiang date:20170608 for:注释格式的获取 -->
  191. <#-- fileTypeExts:'*.rar;*.zip;*.doc;*.docx;*.txt;*.ppt;*.xls;*.xlsx;*.html;*.htm;*.pdf;*.jpg;*.gif;*.png', -->
  192. <#-- update--end--author:zhangjiaqiang date:20170608 for:注释格式的获取 -->
  193. fileSizeLimit:'15MB',
  194. swf:'plug-in/uploadify/uploadify.swf',
  195. uploader:'cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
  196. onUploadStart : function(file) {
  197. var cgFormId=$("input[name='id']").val();
  198. $('#${po.fieldName}').uploadify("settings", "formData", {
  199. 'cgFormId':cgFormId,
  200. 'cgFormName':'${tableName}',
  201. 'cgFormField':'${fieldMeta[po.fieldName]}'
  202. });
  203. } ,
  204. onQueueComplete : function(queueData) {
  205. var win = frameElement.api.opener;
  206. win.reloadTable();
  207. win.tip(serverMsg);
  208. frameElement.api.close();
  209. },
  210. onUploadSuccess : function(file, data, response) {
  211. var d=$.parseJSON(data);
  212. if(d.success){
  213. var win = frameElement.api.opener;
  214. serverMsg = d.msg;
  215. }
  216. },
  217. onFallback: function() {
  218. tip("您未安装FLASH控件,无法上传图片!请安装FLASH控件后再试")
  219. },
  220. onSelectError: function(file, errorCode, errorMsg) {
  221. switch (errorCode) {
  222. case - 100 : tip("上传的文件数量已经超出系统限制的" + $('#file').uploadify('settings', 'queueSizeLimit') + "个文件!");
  223. break;
  224. case - 110 : tip("文件 [" + file.name + "] 大小超出系统限制的" + $('#file').uploadify('settings', 'fileSizeLimit') + "大小!");
  225. break;
  226. case - 120 : tip("文件 [" + file.name + "] 大小异常!");
  227. break;
  228. case - 130 : tip("文件 [" + file.name + "] 类型不正确!");
  229. break;
  230. }
  231. },
  232. onUploadProgress: function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) {}
  233. });
  234. });
  235. </script>
  236. <span id="file_uploadspan"><input type="file" name="${po.fieldName}" id="${po.fieldName}" /></span>
  237. </div>
  238. <div class="form" id="filediv_${po.fieldName}"></div>
  239. <#--update-start--Author: jg_huangxg Date:20160421 for:TASK #1027 【online】代码生成器模板不支持UE编辑器 -->
  240. <#elseif po.showType='umeditor'>
  241. <#-- update--begin--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  242. <#assign ue_widget_count = ue_widget_count + 1>
  243. <#if ue_widget_count == 1>
  244. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
  245. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
  246. </#if>
  247. <#-- update--end--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  248. <textarea name="${po.fieldName}" id="${po.fieldName}" style="width: 650px;height:300px"></textarea>
  249. <script type="text/javascript">
  250. <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
  251. var ${po.fieldName}_editor = UE.getEditor('${po.fieldName}');
  252. <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
  253. </script>
  254. <#--update-end--Author: jg_huangxg Date:20160421 for:TASK #1027 【online】代码生成器模板不支持UE编辑器 -->
  255. <#else>
  256. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  257. <input id="${po.fieldName}" name="${po.fieldName}" type="text" style="width: 150px" class="form-control" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" /> />
  258. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  259. </#if>
  260. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  261. <label class="Validform_label" style="display: none">${po.content?if_exists?html}</label>
  262. </div>
  263. <#if (pageColumns?size>1)>
  264. <#if (po_index%2==0)&&(!po_has_next)>
  265. <div class="col-xs-2 text-center"><b></b></div>
  266. <div class="col-xs-4"></div>
  267. </#if>
  268. <#if (po_index%2!=0)||(!po_has_next)>
  269. </div>
  270. </#if>
  271. <#else>
  272. </div>
  273. </#if>
  274. </#list>
  275. <#-- update--begin--author:zhoujf Date:20170523 for:TASK #1961 【代码生成器】一对多富文本编辑器,生成代码格式问题 -->
  276. <#list pageAreatextColumns as po>
  277. <div class="row show-grid">
  278. <div class="col-xs-3 text-center">
  279. <b>${po.content}:</b>
  280. </div>
  281. <div class="col-xs-3">
  282. <#if po.showType=='textarea'>
  283. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  284. <textarea id="${po.fieldName}" class="form-control" rows="6" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" /> name="${po.fieldName}"></textarea>
  285. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  286. <#elseif po.showType='umeditor'>
  287. <#-- update--begin--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  288. <#assign ue_widget_count = ue_widget_count + 1>
  289. <#if ue_widget_count == 1>
  290. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
  291. <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
  292. </#if>
  293. <#-- update--end--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
  294. <textarea name="${po.fieldName}" id="${po.fieldName}" style="width: 650px;height:300px"></textarea>
  295. <script type="text/javascript">
  296. <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
  297. var ${po.fieldName}_editor = UE.getEditor('${po.fieldName}');
  298. <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
  299. </script>
  300. </#if>
  301. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  302. <label class="Validform_label" style="display: none">${po.content?if_exists?html}</label>
  303. </div>
  304. </div>
  305. </#list>
  306. <#-- update--end--author:zhoujf Date:20170523 for:TASK #1961 【代码生成器】一对多富文本编辑器,生成代码格式问题 -->
  307. </div>
  308. </div>
  309. <div class="con-wrapper" style="display: block;"></div>
  310. </div>
  311. <script type="text/javascript">
  312. $(function(){
  313. //查看模式情况下,删除和上传附件功能禁止使用
  314. if(location.href.indexOf("load=detail")!=-1){
  315. $(".jeecgDetail").hide();
  316. }
  317. if(location.href.indexOf("mode=read")!=-1){
  318. //查看模式控件禁用
  319. $("#formobj").find(":input").attr("disabled","disabled");
  320. }
  321. if(location.href.indexOf("mode=onbutton")!=-1){
  322. //其他模式显示提交按钮
  323. $("#sub_tr").show();
  324. }
  325. });
  326. var neibuClickFlag = false;
  327. function neibuClick() {
  328. neibuClickFlag = true;
  329. $('#btn_sub').trigger('click');
  330. }
  331. </script>
  332. <div id="jform_tab" class="tab-wrapper">
  333. <!-- tab -->
  334. <ul class="nav nav-tabs">
  335. <#list subTab as sub>
  336. <li role="presentation" tab-ajax-url="${entityName?uncap_first}Controller.do?${sub.entityName?uncap_first}List<#list sub.foreignKeys as key><#if key?lower_case?index_of("${jeecg_table_id}")!=-1>&${jeecg_table_id}=${"$"}{${entityName?uncap_first}Page.${jeecg_table_id}}<#else>&${key?uncap_first}=${"$"}{${entityName?uncap_first}Page.${key?uncap_first}}</#if></#list>"><a href="#con-wrapper${sub_index}">${sub.ftlDescription}</a></li>
  337. </#list>
  338. </ul>
  339. <#list subTab as sub>
  340. <div class="con-wrapper" id="con-wrapper${sub_index}" style="display: none;"></div>
  341. </#list>
  342. </div>
  343. <div align="center" id = "sub_tr" style="display: none;" > <input type="button" value="提交" onclick="neibuClick();" class="ui_state_highlight"></div>
  344. <script src="plug-in/layer/layer.js"></script>
  345. <script type="text/javascript">
  346. $(function() {
  347. $("#formobj").Validform({
  348. tiptype: function(msg, o, cssctl) {
  349. if (o.type == 3) {
  350. layer.open({
  351. title: '提示信息',
  352. content: msg,
  353. icon: 5,
  354. shift: 6,
  355. btn: false,
  356. shade:false,time:5000,
  357. cancel: function(index) {
  358. o.obj.focus();
  359. layer.close(index);
  360. },
  361. yes: function(index) {
  362. o.obj.focus();
  363. layer.close(index);
  364. },
  365. })
  366. }
  367. },
  368. btnSubmit: "#btn_sub",
  369. btnReset: "#btn_reset",
  370. ajaxPost: true,
  371. beforeSubmit: function(curform) {
  372. var tag = true;
  373. //提交前处理
  374. return tag;
  375. },
  376. usePlugin: {
  377. passwordstrength: {
  378. minLen: 6,
  379. maxLen: 18,
  380. trigger: function(obj, error) {
  381. if (error) {
  382. obj.parent().next().find(".Validform_checktip").show();
  383. obj.find(".passwordStrength").hide();
  384. } else {
  385. $(".passwordStrength").show();
  386. obj.parent().next().find(".Validform_checktip").hide();
  387. }
  388. }
  389. }
  390. },
  391. callback: function(data) {
  392. <#-- update--begin--author:zhangjiaqiang date:20170607 for:修订回调函数的调用方式 -->
  393. <#if callbackFlag == true >
  394. jeecgFormFileCallBack(data);
  395. <#else>
  396. if (data.success == true) {
  397. var win = frameElement.api.opener;
  398. win.reloadTable();
  399. win.tip(data.msg);
  400. frameElement.api.close();
  401. } else {
  402. if (data.responseText == '' || data.responseText == undefined) {
  403. $.messager.alert('错误', data.msg);
  404. $.Hidemsg();
  405. } else {
  406. try {
  407. var emsg = data.responseText.substring(data.responseText.indexOf('错误描述'), data.responseText.indexOf('错误信息'));
  408. $.messager.alert('错误', emsg);
  409. $.Hidemsg();
  410. } catch(ex) {
  411. $.messager.alert('错误', data.responseText + '');
  412. }
  413. }
  414. return false;
  415. }
  416. </#if>
  417. <#-- update--begin--author:zhangjiaqiang date:20170607 for:修订回调函数的调用方式 -->
  418. }
  419. });
  420. });
  421. </script>
  422. </form>
  423. <!-- 添加 产品明细 模版 -->
  424. <table style="display:none">
  425. <#list subTab as sub>
  426. <tbody id="add_${sub.entityName?uncap_first}_table_template">
  427. <tr>
  428. <th scope="row"><div name="xh"></div></th>
  429. <td><input style="width:20px;" type="checkbox" name="ck"/></td>
  430. <#list subPageColumnsMap[sub.tableName] as po>
  431. <#assign check = 0 >
  432. <#list sub.foreignKeys as key>
  433. <#if subFieldMeta[po.fieldName]==key?uncap_first>
  434. <#assign check = 1 >
  435. <#break>
  436. </#if>
  437. </#list>
  438. <#if check==0>
  439. <td align="left">
  440. <#if po.showType == "text">
  441. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  442. <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" /> type="text" class="form-control" style="width:120px;" />
  443. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  444. <#elseif po.showType=='password'>
  445. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  446. <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" type="password" class="form-control" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" /> />
  447. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  448. <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
  449. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  450. <t:dictSelect field="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" type="${po.showType?if_exists?html}" extendJson="{class:'form-control',style:'width:150px'}" <#if po.isNull != 'Y'>datatype="*"</#if> <@dictInfo dictTable="${po.dictTable}" dictField="${po.dictField}" dictText="${po.dictText}" /> defaultVal="" hasLabel="false" title="${po.content}"></t:dictSelect>
  451. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  452. <#elseif po.showType=='date'>
  453. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  454. <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" onClick="WdatePicker()" style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;width:160px;"<@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>/>
  455. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  456. <#elseif po.showType=='datetime'>
  457. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  458. <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;width:160px;"<@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>/>
  459. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  460. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  461. <#elseif po.showType=='file' || po.showType == 'image'>
  462. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  463. <input type="hidden" id="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" />
  464. <a target="_blank" id="${sub.entityName?uncap_first}List[#index#].${po.fieldName}_href">未上传</a>
  465. <#-- update--begin--author:zhangjiaqiang date:20170614 for:修订上传附件按钮的大小 -->
  466. <input class="btn btn-sm btn-success" style="margin-left:10px;" type="button" value="上传附件"
  467. onclick="commonUpload(commonUploadDefaultCallBack,'${sub.entityName?uncap_first}List\\[#index#\\]\\.${po.fieldName}')"/>
  468. <#-- update--begin--author:zhangjiaqiang date:20170614 for:修订上传附件按钮的大小 -->
  469. <#else>
  470. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  471. <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" type="text" class="form-control" style="width:120px;"<@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" />/>
  472. <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
  473. </#if>
  474. <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
  475. </td>
  476. </#if>
  477. </#list>
  478. </tr>
  479. </tbody>
  480. </#list>
  481. </table>
  482. <script src = "webpage/${bussiPackage?replace('.','/')}/${entityPackage}/${entityName?uncap_first}.js"></script>
  483. <#if callbackFlag == true>
  484. <script type="text/javascript">
  485. function jeecgFormFileCallBack(data){
  486. if (data.success == true) {
  487. uploadFile(data);
  488. } else {
  489. if (data.responseText == '' || data.responseText == undefined) {
  490. $.messager.alert('错误', data.msg);
  491. $.Hidemsg();
  492. } else {
  493. try {
  494. var emsg = data.responseText.substring(data.responseText.indexOf('错误描述'), data.responseText.indexOf('错误信息'));
  495. $.messager.alert('错误', emsg);
  496. $.Hidemsg();
  497. } catch(ex) {
  498. $.messager.alert('错误', data.responseText + '');
  499. }
  500. }
  501. return false;
  502. }
  503. if (!neibuClickFlag) {
  504. var win = frameElement.api.opener;
  505. win.reloadTable();
  506. }
  507. }
  508. function upload() {
  509. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  510. <#assign subFileName = fileName?substring(0,fileName?length - 1) />
  511. <#list subFileName?split(",") as name>
  512. $('#${name}').uploadify('upload', '*');
  513. </#list>
  514. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  515. }
  516. var neibuClickFlag = false;
  517. function neibuClick() {
  518. neibuClickFlag = true;
  519. $('#btn_sub').trigger('click');
  520. }
  521. function cancel() {
  522. <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  523. <#assign subFileName = fileName?substring(0,fileName?length - 1) />
  524. <#list subFileName?split(",") as name>
  525. $('#${name}').uploadify('cancel', '*');
  526. </#list>
  527. <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
  528. }
  529. function uploadFile(data){
  530. if(!$("input[name='id']").val()){
  531. if(data.obj!=null && data.obj!='undefined'){
  532. $("input[name='id']").val(data.obj.id);
  533. }
  534. }
  535. if($(".uploadify-queue-item").length>0){
  536. upload();
  537. }else{
  538. if (neibuClickFlag){
  539. alert(data.msg);
  540. neibuClickFlag = false;
  541. }else {
  542. var win = frameElement.api.opener;
  543. win.reloadTable();
  544. win.tip(data.msg);
  545. frameElement.api.close();
  546. }
  547. }
  548. }
  549. </script>
  550. </#if>
  551. </body>
  552. </html>