| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476 |
- <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <#include "../../ui/datatype.ftl"/>
- <#include "../../ui/dictInfo.ftl"/>
- <#-- update--end--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <!DOCTYPE html>
- <#assign callbackFlag = false />
- <#assign fileName = "" />
- <#list pageColumns as callBackTestPo>
- <#if callBackTestPo.showType=='file' || callBackTestPo.showType=='image'>
- <#assign callbackFlag = true />
- <#break>
- </#if>
- </#list>
- <html>
- <head>
- <title>${ftl_description}</title>
- <style>
- .ui-button {
- display: inline-block;
- padding: 2px 2px;
- margin-bottom: 0;
- font-size: 8px;
- font-weight: normal;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
- }
- </style>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <#if callbackFlag == true>
- <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css" />
- <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
- </#if>
- <script type="text/javascript">
- $(document).ready(function(){
- $('#tt').tabs({
- onSelect:function(title){
- $('#tt .panel-body').css('width','auto');
- }
- });
- $(".tabs-wrap").css('width','100%');
- });
- </script>
- </head>
- <body style="overflow-x: hidden;">
- <#-- update--begin--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
- <#assign ue_widget_count = 0>
- <#-- update--end--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
- <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" tiptype="1" action="${entityName?uncap_first}Controller.do?doUpdate" ${callbackFlag?string("callback=\"jeecgFormFileCallBack@Override\"", "")}>
- <#list columns as po>
- <#if po.isShow == 'N'>
- <#-- update--begin--author:zhoujf date:20170622 for:TASK #1967 【代码生成器优化】online生成代码,无用太多,简化代码(1. 系统标准字段,表单页面,添加和修改页面,不生成隐藏字段) -->
- <#if po.fieldName == 'id'>
- <input id="${po.fieldName}" name="${po.fieldName}" type="hidden" value="${'$'}{${entityName?uncap_first}Page.${po.fieldName} }"/>
- </#if>
- <#-- update--end--author:zhoujf date:20170622 for:TASK #1967 【代码生成器优化】online生成代码,无用太多,简化代码(1. 系统标准字段,表单页面,添加和修改页面,不生成隐藏字段) -->
- </#if>
- </#list>
- <table cellpadding="0" cellspacing="1" class="formtable">
- <#list pageColumns as po>
- <#if po_index%2==0>
- <tr>
- </#if>
- <td align="right">
- <label class="Validform_label">${po.content}:</label>
- </td>
- <td class="value">
- <#if po.showType=='text'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <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!''}" /> value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}'/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='popup'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <input id="${po.fieldName}" name="${po.fieldName}" type="text" style="width: 150px" class="searchbox-inputtext" <@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}}'/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='textarea'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <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>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='password'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <input id="${po.fieldName}" name="${po.fieldName}" type="password" style="width: 150px" class="inputxt" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" /> value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}'/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <t:dictSelect field="${po.fieldName}" type="${po.showType?if_exists?html}" <@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>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='date'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <input id="${po.fieldName}" name="${po.fieldName}" type="text" style="width: 150px" <@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"/>'/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='datetime'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <input id="${po.fieldName}" name="${po.fieldName}" type="text" style="width: 150px" <@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"/>'/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='file' || po.showType == 'image'>
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:数据回显表格ID区分 -->
- <table id="${fieldMeta[po.fieldName]?lower_case}_fileTable"></table>
- <#-- update--end--author:zhangjiaqiang date:20170531 for:数据回显表格ID区分 -->
- <#if !(po.operationCodesReadOnly ??)>
- <#assign fileName = fileName + "${po.fieldName}," />
- <table></table>
- <script type="text/javascript">
- var serverMsg="";
- $(function(){
- $('#${po.fieldName}').uploadify({
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <#if po.showType == 'image'>
- buttonText:'添加图片',
- <#else>
- buttonText:'添加文件',
- </#if>
- <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- auto:false,
- progressData:'speed',
- multi:true,
- height:25,
- overrideEvents:['onDialogClose'],
- fileTypeDesc:'文件格式:',
- queueID:'filediv_${po.fieldName}',
- <#-- fileTypeExts:'*.rar;*.zip;*.doc;*.docx;*.txt;*.ppt;*.xls;*.xlsx;*.html;*.htm;*.pdf;*.jpg;*.gif;*.png', 页面弹出很慢解决 20170317 scott -->
- fileSizeLimit:'15MB',
- swf:'plug-in/uploadify/uploadify.swf',
- uploader:'cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
- onUploadStart : function(file) {
- var cgFormId=$("input[name='id']").val();
- $('#${po.fieldName}').uploadify("settings", "formData", {
- 'cgFormId':cgFormId,
- 'cgFormName':'${tableName}',
- 'cgFormField':'${fieldMeta[po.fieldName]}'
- });
- } ,
- onQueueComplete : function(queueData) {
- var win = frameElement.api.opener;
- win.reloadTable();
- win.tip(serverMsg);
- frameElement.api.close();
- },
- 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("上传的文件数量已经超出系统限制的" + $('#file').uploadify('settings', 'queueSizeLimit') + "个文件!");
- break;
- case - 110 : tip("文件 [" + file.name + "] 大小超出系统限制的" + $('#file').uploadify('settings', 'fileSizeLimit') + "大小!");
- break;
- case - 120 : tip("文件 [" + file.name + "] 大小异常!");
- break;
- case - 130 : tip("文件 [" + file.name + "] 类型不正确!");
- break;
- }
- },
- onUploadProgress: function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) {}
- });
- });
- </script>
- <span id="file_uploadspan"><input type="file" name="${po.fieldName}" id="${po.fieldName}" /></span>
- <div class="form" id="filediv_${po.fieldName}"></div>
- </#if>
- <#--update-start--Author: jg_huangxg Date:20160421 for:TASK #1027 【online】代码生成器模板不支持UE编辑器 -->
- <#elseif po.showType='umeditor'>
- <#-- update--begin--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
- <#assign ue_widget_count = ue_widget_count + 1>
- <#if ue_widget_count == 1>
- <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
- <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
- </#if>
- <#-- update--end--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
- <#--update-start--Author: dangzhenghui Date:20170510 for:TASK #1899 【代码生成器bug】控件类型为UE编辑器 ,编辑页面内容显示为空-->
- <textarea name="${po.fieldName}" id="${po.fieldName}" style="width: 650px;height:300px">${'$'}{${entityName?uncap_first}Page.${po.fieldName} }</textarea>
- <#--update-end--Author: dangzhenghui Date:20170510 for:TASK #1899 【代码生成器bug】控件类型为UE编辑器 ,编辑页面内容显示为空-->
- <script type="text/javascript">
- <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
- var ${po.fieldName}_editor = UE.getEditor('${po.fieldName}');
- <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
- </script>
- <#--update-end--Author: jg_huangxg Date:20160421 for:TASK #1027 【online】代码生成器模板不支持UE编辑器 -->
- <#else>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <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}}'/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- </#if>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
- </td>
- <#if (po_index+1)%2==0>
- </tr>
- <#else>
- <#if !po_has_next>
- </tr>
- </#if>
- </#if>
- </#list>
-
- <#-- update--begin--author:zhoujf Date:20170523 for:TASK #1961 【代码生成器】一对多富文本编辑器,生成代码格式问题 -->
- <#list pageAreatextColumns as po>
- <tr>
- <td align="right">
- <label class="Validform_label">${po.content}:</label>
- </td>
- <td class="value" colspan="3">
- <#if po.showType=='textarea'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <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>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType='umeditor'>
- <#-- update--begin--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
- <#assign ue_widget_count = ue_widget_count + 1>
- <#if ue_widget_count == 1>
- <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.config.js"></script>
- <script type="text/javascript" charset="utf-8" src="plug-in/ueditor/ueditor.all.min.js"></script>
- </#if>
- <#-- update--end--author:zhangjiaqiang date:20170522 for:ueditor配置文件只加载一次 -->
- <#--update-start--Author: dangzhenghui Date:20170510 for:TASK #1899 【代码生成器bug】控件类型为UE编辑器 ,编辑页面内容显示为空-->
- <textarea name="${po.fieldName}" id="${po.fieldName}" style="width: 650px;height:300px">${'$'}{${entityName?uncap_first}Page.${po.fieldName} }</textarea>
- <#--update-end--Author: dangzhenghui Date:20170510 for:TASK #1899 【代码生成器bug】控件类型为UE编辑器 ,编辑页面内容显示为空-->
- <script type="text/javascript">
- <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
- var ${po.fieldName}_editor = UE.getEditor('${po.fieldName}');
- <#-- update--begin--author:zhangjiaqiang date:20170522 for:editor编辑器变量唯一 -->
- </script>
- </#if>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
- </td>
- </tr>
- </#list>
- <#-- update--end--author:zhoujf Date:20170523 for:TASK #1961 【代码生成器】一对多富文本编辑器,生成代码格式问题 -->
- </table>
- <div style="width: auto;height: 200px;">
- <%-- 增加一个div,用于调节页面大小,否则默认太小 --%>
- <div style="width:800px;height:1px;"></div>
- <t:tabs id="tt" iframe="false" tabPosition="top" fit="false">
- <#list subTab as sub>
- <t:tab href="${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>" icon="icon-search" title="${sub.ftlDescription}" id="${sub.entityName?uncap_first}"></t:tab>
- </#list>
- </t:tabs>
- </div>
- </t:formvalid>
- <!-- 添加 附表明细 模版 -->
- <table style="display:none">
- <#list subTab as sub>
- <tbody id="add_${sub.entityName?uncap_first}_table_template">
- <tr>
- <td align="center"><div style="width: 25px;" name="xh"></div></td>
- <td align="center"><input style="width:20px;" type="checkbox" name="ck"/></td>
- <#list subPageColumnsMap[sub.tableName] as po>
- <#assign check = 0 >
- <#list sub.foreignKeys as key>
- <#if subFieldMeta[po.fieldName]==key?uncap_first>
- <#assign check = 1 >
- <#break>
- </#if>
- </#list>
- <#if check==0>
- <td align="left">
- <#if po.showType == "text">
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" type="text" class="inputxt" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" />/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='password'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" type="password" class="inputxt" style="width:120px;"<@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" />/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <t:dictSelect field="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" type="${po.showType?if_exists?html}" <@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="" hasLabel="false" title="${po.content}"></t:dictSelect>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='date'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" type="text" class="Wdate" onClick="WdatePicker()" style="width:120px;" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#elseif po.showType=='datetime'>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" <@datatype showType="2" validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/> type="text" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="width:120px;" />
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <#elseif po.showType=='file' || po.showType == 'image'>
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <input type="hidden" id="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" />
- <a target="_blank" id="${sub.entityName?uncap_first}List[#index#].${po.fieldName}_href">未上传</a>
- <br>
- <input class="ui-button" type="button" value="上传附件"
- onclick="commonUpload(commonUploadDefaultCallBack,'${sub.entityName?uncap_first}List\\[#index#\\]\\.${po.fieldName}')"/>
- <#else>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- <input name="${sub.entityName?uncap_first}List[#index#].${po.fieldName}" maxlength="${po.length?c}" type="text" class="inputxt" style="width:120px;" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" isNull="${po.isNull}"/>/>
- <#-- update--begin--author:zhangjiaqiangDate:20170509 for:修订生成代码不美观 -->
- </#if>
- <label class="Validform_label" style="display: none;">${po.content?if_exists?html}</label>
- </td>
- </#if>
- </#list>
- </tr>
- </tbody>
- </#list>
- </table>
- </body>
- <script src = "webpage/${bussiPackage?replace('.','/')}/${entityPackage}/${entityName?uncap_first}.js"></script>
- <#if callbackFlag == true>
- <script type="text/javascript">
- //加载 已存在的 文件
- $(function(){
- var cgFormId=$("input[name='id']").val();
- $.ajax({
- type: "post",
- url: "${entityName?uncap_first}Controller.do?getFiles&id=" + cgFormId,
- success: function(data){
- var arrayFileObj = jQuery.parseJSON(data).obj;
-
- $.each(arrayFileObj,function(n,file){
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:多个附件的数据显示 -->
- var fieldName = file.field.toLowerCase();
- var table = $("#"+fieldName+"_fileTable");
- <#-- update--end--author:zhangjiaqiang date:20170531 for:多个附件的数据显示 -->
- var tr = $("<tr style=\"height:34px;\"></tr>");
- <#-- update--begin--author:zhangjiaqiang date:20170614 for:文件名称太长显示问题 -->
- var title = file.title;
- if(title.length > 15){
- title = title.substring(0,12) + "...";
- }
- var td_title = $("<td>" + title + "</td>");
- <#-- update--end--author:zhangjiaqiang date:20170614 for:文件名称太长显示问题 -->
- <#-- update--begin--author:zhangjiaqiang date:20170614 for:操作按钮之间增加间隔 -->
- 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>")
- 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>");
- 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>");
- <#-- update--end--author:zhangjiaqiang date:20170614 for:操作按钮之间增加间隔 -->
- tr.appendTo(table);
- td_title.appendTo(tr);
- td_download.appendTo(tr);
- td_view.appendTo(tr);
- td_del.appendTo(tr);
- });
- }
- });
- })
-
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:附件资源删除处理 -->
- /**
- * 删除图片数据资源
- */
- function del(url,obj){
- var content = "请问是否要删除该资源";
- var navigatorName = "Microsoft Internet Explorer";
- if( navigator.appName == navigatorName ){
- $.dialog.confirm(content, function(){
- submit(url,obj);
- }, function(){
- });
- }else{
- layer.open({
- title:"提示",
- content:content,
- icon:7,
- yes:function(index){
- submit(url,obj);
- },
- btn:['确定','取消'],
- btn2:function(index){
- layer.close(index);
- }
- });
- }
- }
-
- function submit(url,obj){
- $.ajax({
- async : false,
- cache : false,
- type : 'POST',
- url : url,// 请求的action路径
- error : function() {// 请求失败处理函数
- },
- success : function(data) {
- var d = $.parseJSON(data);
- if (d.success) {
- var msg = d.msg;
- tip(msg);
- obj.parentNode.parentNode.parentNode.deleteRow(obj.parentNode.parentNode);
- } else {
- tip(d.msg);
- }
- }
- });
- }
- <#-- update--end--author:zhangjiaqiang date:20170531 for:附件资源删除处理 -->
-
- function jeecgFormFileCallBack(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();
- }
- }
- function upload() {
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <#assign subFileName = fileName?substring(0,fileName?length - 1) />
- <#list subFileName?split(",") as name>
- $('#${name}').uploadify('upload', '*');
- </#list>
- <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- }
-
- var neibuClickFlag = false;
- function neibuClick() {
- neibuClickFlag = true;
- $('#btn_sub').trigger('click');
- }
- function cancel() {
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <#assign subFileName = fileName?substring(0,fileName?length - 1) />
- <#list subFileName?split(",") as name>
- $('#${name}').uploadify('cancel', '*');
- </#list>
- <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- }
- function uploadFile(data){
- if(!$("input[name='id']").val()){
- if(data.obj!=null && data.obj!='undefined'){
- $("input[name='id']").val(data.obj.id);
- }
- }
- if($(".uploadify-queue-item").length>0){
- upload();
- }else{
- if (neibuClickFlag){
- alert(data.msg);
- neibuClickFlag = false;
- }else {
- var win = frameElement.api.opener;
- win.reloadTable();
- win.tip(data.msg);
- frameElement.api.close();
- }
- }
- }
- </script>
- </#if>
|