| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- <%@ 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>
- <#if cgformConfig.cgFormHead.isTree == 'Y'>
- <style type="text/css">
- .combo_self{height: 22px !important;width: 150px !important;}
- .layout-header .btn {
- margin:0;
- float: none !important;
- }
- .btn-default {
- height: 35px;
- line-height: 35px;
- font-size:14px;
- }
- </style>
-
- <script type="text/javascript">
- $(function(){
- $(".combo").removeClass("combo").addClass("combo combo_self");
- $(".combo").each(function(){
- $(this).parent().css("line-height","0px");
- });
- });
-
- /**树形列表数据转换**/
- function convertTreeData(rows, textField) {
- for(var i = 0; i < rows.length; i++) {
- var row = rows[i];
- row.text = row[textField];
- if(row.children) {
- row.state = "open";
- convertTreeData(row.children, textField);
- }
- }
- }
- /**树形列表加入子元素**/
- function joinTreeChildren(arr1, arr2) {
- for(var i = 0; i < arr1.length; i++) {
- var row1 = arr1[i];
- for(var j = 0; j < arr2.length; j++) {
- if(row1.id == arr2[j].id) {
- var children = arr2[j].children;
- if(children) {
- row1.children = children;
- }
-
- }
- }
- }
- }
- </script>
- </#if>
- <html>
- <head>
- <title>${ftl_description}</title>
- <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>
- </head>
- <body>
- <#-- 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="div" action="${entityName?uncap_first}Controller.do?doAdd" ${callbackFlag?string("callback=\"jeecgFormFileCallBack@Override\"", "")}>
- <#list columns as po>
- <#if po.isShow == 'N'>
- <input id="${po.fieldName}" name="${po.fieldName}" type="hidden" value="${'$'}{${entityName?uncap_first}Page.${po.fieldName} }">
- </#if>
- </#list>
- <fieldset class="step">
- <#list columns as po>
- <#if po.isShow == 'Y'>
- <div class="form">
- <label class="Validform_label">${po.content}:</label>
- <#if cgformConfig.cgFormHead.isTree=='Y' && cgformConfig.cgFormHead.treeParentIdFieldNamePage==po.fieldName>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <input id="${po.fieldName}" name="${po.fieldName}" type="text" style="width: 150px" class="inputxt easyui-combotree" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}"/>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- data-options="panelHeight:'220',
- url: '${entityName?uncap_first}Controller.do?datagrid&field=id,${cgformConfig.cgFormHead.treeFieldnamePage}',
- loadFilter: function(data) {
- var rows = data.rows || data;
- var win = frameElement.api.opener;
- var listRows = win.getDataGrid().treegrid('getData');
- joinTreeChildren(rows, listRows);
- convertTreeData(rows, '${cgformConfig.cgFormHead.treeFieldnamePage}');
- return rows;
- },
- <#-- update--begin--author:zhangjiaqiang Date:20170518 for:修订树形菜单选择必填项问题-->
- onSelect:function(node){
- $('#${po.fieldName}').val(node.id);
- },
- <#-- update--end--author:zhangjiaqiang Date:20170518 for:修订树形菜单选择必填项问题 -->
- onLoadSuccess: function() {
- var win = frameElement.api.opener;
- var currRow = win.getDataGrid().treegrid('getSelected');
- if(!'${'$'}{${entityName?uncap_first}Page.id}') {
- //增加时,选择当前父菜单
- if(currRow) {
- $('#${po.fieldName}').combotree('setValue', currRow.id);
- }
- }else {
- //编辑时,选择当前父菜单
- if(currRow) {
- $('#${po.fieldName}').combotree('setValue', currRow.${po.fieldName});
- }
- }
- }"/>
- <#elseif po.showType=='text'>
- <#-- update--begin--author:zhangjiaqiang Date: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!''}"/>/>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <#elseif po.showType=='popup'>
- <#-- update--begin--author:zhangjiaqiang Date: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>/>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <#elseif po.showType=='textarea'>
- <#-- update--begin--author:zhangjiaqiang Date: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!''}"/>></textarea>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <#elseif po.showType=='password'>
- <#-- update--begin--author:zhangjiaqiang Date: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!''}"/>/>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <#elseif po.showType=='radio' || po.showType=='select' || po.showType=='checkbox' || po.showType=='list'>
- <#-- update--begin--author:zhangjiaqiang Date: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:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <#elseif po.showType=='date'>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <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}"/>/>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <#elseif po.showType=='datetime'>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <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}"/>/>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <#elseif po.showType=='file' || po.showType == 'image'>
- <#assign fileName = fileName + "${po.fieldName}," />
- <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <table></table>
- <div class="form jeecgDetail">
- <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:'文件格式:',
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- queueID:'filediv_${po.fieldName}',
- <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <#-- 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>
- <#-- update--begin--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <div class="form" id="filediv_${po.fieldName}"></div>
- <#-- update--end--author:zhangjiaqiang date:20170531 for:增加图片和文件的支持 -->
- <#--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配置文件只加载一次 -->
- <textarea name="${po.fieldName}" id="${po.fieldName}" style="width: 650px;height:300px"></textarea>
- <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:zhangjiaqiang Date: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}"/>/>
- <#-- update--begin--author:zhangjiaqiang Date:20170509 for:修订生成页面乱 -->
- </#if>
- <span class="Validform_checktip"></span>
- </div>
- </#if>
- </#list>
- </fieldset>
- </t:formvalid>
- </body>
- <script src = "webpage/${bussiPackage?replace('.','/')}/${entityPackage}/${entityName?uncap_first}.js"></script>
- <#if callbackFlag == true>
- <script type="text/javascript">
- 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>
|