JEECG 3.7.5 VUE+ElementUI SPA单页面应用版本发布
parent
7d18b6a6b5
commit
80dd3bd7bf
|
@ -123,7 +123,7 @@ public class SystemController extends BaseController {
|
||||||
public ModelAndView druid() {
|
public ModelAndView druid() {
|
||||||
return new ModelAndView(new RedirectView("druid/index.html"));
|
return new ModelAndView(new RedirectView("druid/index.html"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(params = "typeListJson")
|
@RequestMapping(params = "typeListJson")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxJson typeListJson(@RequestParam(required=true)String typeGroupName) {
|
public AjaxJson typeListJson(@RequestParam(required=true)String typeGroupName) {
|
||||||
|
@ -139,13 +139,13 @@ public class SystemController extends BaseController {
|
||||||
for (TSType type : typeList) {
|
for (TSType type : typeList) {
|
||||||
JSONObject typeJson = new JSONObject();
|
JSONObject typeJson = new JSONObject();
|
||||||
typeJson.put("typecode", type.getTypecode());
|
typeJson.put("typecode", type.getTypecode());
|
||||||
|
//update-begin-author:taoyan 数据字典加载国际化---
|
||||||
String typename = type.getTypename();
|
String typename = type.getTypename();
|
||||||
if(MutiLangUtil.existLangKey(typename)){
|
if(MutiLangUtil.existLangKey(typename)){
|
||||||
typename = MutiLangUtil.doMutiLang(typename,"");
|
typename = MutiLangUtil.doMutiLang(typename,"");
|
||||||
}
|
}
|
||||||
typeJson.put("typename",typename );
|
typeJson.put("typename",typename );
|
||||||
|
//update-end-author:taoyan 数据字典加载国际化---
|
||||||
typeArray.add(typeJson);
|
typeArray.add(typeJson);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,6 @@ public class SystemController extends BaseController {
|
||||||
}
|
}
|
||||||
return ajaxJson;
|
return ajaxJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型字典列表页面跳转
|
* 类型字典列表页面跳转
|
||||||
|
@ -201,7 +200,6 @@ public class SystemController extends BaseController {
|
||||||
@RequestMapping(params = "typeGroupGrid")
|
@RequestMapping(params = "typeGroupGrid")
|
||||||
public void typeGroupGrid(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid, TSTypegroup typegroup) {
|
public void typeGroupGrid(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid, TSTypegroup typegroup) {
|
||||||
CriteriaQuery cq = new CriteriaQuery(TSTypegroup.class, dataGrid);
|
CriteriaQuery cq = new CriteriaQuery(TSTypegroup.class, dataGrid);
|
||||||
|
|
||||||
String typegroupname = request.getParameter("typegroupname");
|
String typegroupname = request.getParameter("typegroupname");
|
||||||
if(oConvertUtils.isNotEmpty(typegroupname)) {
|
if(oConvertUtils.isNotEmpty(typegroupname)) {
|
||||||
typegroupname = typegroupname.trim();
|
typegroupname = typegroupname.trim();
|
||||||
|
@ -220,10 +218,10 @@ public class SystemController extends BaseController {
|
||||||
this.systemService.getDataGridReturn(cq, true);
|
this.systemService.getDataGridReturn(cq, true);
|
||||||
MutiLangUtil.setMutiLangValueForList(dataGrid.getResults(), "typegroupname");
|
MutiLangUtil.setMutiLangValueForList(dataGrid.getResults(), "typegroupname");
|
||||||
|
|
||||||
|
|
||||||
TagUtil.datagrid(response, dataGrid);
|
TagUtil.datagrid(response, dataGrid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
|
@ -252,7 +250,6 @@ public class SystemController extends BaseController {
|
||||||
return new ArrayList<ComboTree>(){{add(rootCombotree);}};
|
return new ArrayList<ComboTree>(){{add(rootCombotree);}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* easyuiAJAX请求数据
|
* easyuiAJAX请求数据
|
||||||
*
|
*
|
||||||
|
@ -268,15 +265,11 @@ public class SystemController extends BaseController {
|
||||||
CriteriaQuery cq = new CriteriaQuery(TSType.class, dataGrid);
|
CriteriaQuery cq = new CriteriaQuery(TSType.class, dataGrid);
|
||||||
cq.eq("TSTypegroup.id", typegroupid);
|
cq.eq("TSTypegroup.id", typegroupid);
|
||||||
cq.like("typename", typename);
|
cq.like("typename", typename);
|
||||||
|
|
||||||
cq.addOrder("createDate", SortDirection.desc);
|
cq.addOrder("createDate", SortDirection.desc);
|
||||||
|
|
||||||
cq.add();
|
cq.add();
|
||||||
this.systemService.getDataGridReturn(cq, true);
|
this.systemService.getDataGridReturn(cq, true);
|
||||||
|
|
||||||
MutiLangUtil.setMutiLangValueForList(dataGrid.getResults(), "typename");
|
MutiLangUtil.setMutiLangValueForList(dataGrid.getResults(), "typename");
|
||||||
|
|
||||||
|
|
||||||
TagUtil.datagrid(response, dataGrid);
|
TagUtil.datagrid(response, dataGrid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,7 +284,6 @@ public class SystemController extends BaseController {
|
||||||
request.setAttribute("typegroupid", typegroupid);
|
request.setAttribute("typegroupid", typegroupid);
|
||||||
return new ModelAndView("system/type/typeListForTypegroup");
|
return new ModelAndView("system/type/typeListForTypegroup");
|
||||||
}
|
}
|
||||||
|
|
||||||
// @RequestMapping(params = "typeGroupTree")
|
// @RequestMapping(params = "typeGroupTree")
|
||||||
// @ResponseBody
|
// @ResponseBody
|
||||||
// public List<ComboTree> typeGroupTree(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
|
// public List<ComboTree> typeGroupTree(HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) {
|
||||||
|
@ -342,16 +334,13 @@ public class SystemController extends BaseController {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cq = new CriteriaQuery(TSTypegroup.class);
|
cq = new CriteriaQuery(TSTypegroup.class);
|
||||||
|
|
||||||
String typegroupcode = request.getParameter("typegroupcode");
|
String typegroupcode = request.getParameter("typegroupcode");
|
||||||
if(typegroupcode != null ) {
|
if(typegroupcode != null ) {
|
||||||
|
|
||||||
HqlRuleEnum rule = PageValueConvertRuleEnum
|
HqlRuleEnum rule = PageValueConvertRuleEnum
|
||||||
.convert(typegroupcode);
|
.convert(typegroupcode);
|
||||||
Object value = PageValueConvertRuleEnum.replaceValue(rule,
|
Object value = PageValueConvertRuleEnum.replaceValue(rule,
|
||||||
typegroupcode);
|
typegroupcode);
|
||||||
ObjectParseUtil.addCriteria(cq, "typegroupcode", rule, value);
|
ObjectParseUtil.addCriteria(cq, "typegroupcode", rule, value);
|
||||||
|
|
||||||
cq.add();
|
cq.add();
|
||||||
}
|
}
|
||||||
String typegroupname = request.getParameter("typegroupname");
|
String typegroupname = request.getParameter("typegroupname");
|
||||||
|
@ -360,7 +349,6 @@ public class SystemController extends BaseController {
|
||||||
List<String> typegroupnameKeyList = systemService.findByQueryString("select typegroupname from TSTypegroup");
|
List<String> typegroupnameKeyList = systemService.findByQueryString("select typegroupname from TSTypegroup");
|
||||||
MutiLangSqlCriteriaUtil.assembleCondition(typegroupnameKeyList, cq, "typegroupname", typegroupname);
|
MutiLangSqlCriteriaUtil.assembleCondition(typegroupnameKeyList, cq, "typegroupname", typegroupname);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TSTypegroup> typeGroupList = systemService.getListByCriteriaQuery(cq, false);
|
List<TSTypegroup> typeGroupList = systemService.getListByCriteriaQuery(cq, false);
|
||||||
for (TSTypegroup obj : typeGroupList) {
|
for (TSTypegroup obj : typeGroupList) {
|
||||||
TreeGrid treeNode = new TreeGrid();
|
TreeGrid treeNode = new TreeGrid();
|
||||||
|
@ -447,7 +435,6 @@ public class SystemController extends BaseController {
|
||||||
String message = null;
|
String message = null;
|
||||||
AjaxJson j = new AjaxJson();
|
AjaxJson j = new AjaxJson();
|
||||||
typegroup = systemService.getEntity(TSTypegroup.class, typegroup.getId());
|
typegroup = systemService.getEntity(TSTypegroup.class, typegroup.getId());
|
||||||
|
|
||||||
message = "类型分组: " + mutiLangService.getLang(typegroup.getTypegroupname()) + " 被删除 成功";
|
message = "类型分组: " + mutiLangService.getLang(typegroup.getTypegroupname()) + " 被删除 成功";
|
||||||
if (ListUtils.isNullOrEmpty(typegroup.getTSTypes())) {
|
if (ListUtils.isNullOrEmpty(typegroup.getTSTypes())) {
|
||||||
systemService.delete(typegroup);
|
systemService.delete(typegroup);
|
||||||
|
@ -457,7 +444,6 @@ public class SystemController extends BaseController {
|
||||||
} else {
|
} else {
|
||||||
message = "类型分组: " + mutiLangService.getLang(typegroup.getTypegroupname()) + " 下有类型信息,不能删除!";
|
message = "类型分组: " + mutiLangService.getLang(typegroup.getTypegroupname()) + " 下有类型信息,不能删除!";
|
||||||
}
|
}
|
||||||
|
|
||||||
j.setMsg(message);
|
j.setMsg(message);
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
|
@ -502,7 +488,8 @@ public class SystemController extends BaseController {
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新字典分组缓存&字典缓存
|
* 刷新字典分组缓存&字典缓存
|
||||||
*
|
*
|
||||||
|
@ -523,7 +510,6 @@ public class SystemController extends BaseController {
|
||||||
j.setMsg(message);
|
j.setMsg(message);
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加类型分组
|
* 添加类型分组
|
||||||
|
@ -705,7 +691,6 @@ public class SystemController extends BaseController {
|
||||||
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
|
systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// String orgCode = systemService.generateOrgCode(depart.getId(), pid);
|
// String orgCode = systemService.generateOrgCode(depart.getId(), pid);
|
||||||
// depart.setOrgCode(orgCode);
|
// depart.setOrgCode(orgCode);
|
||||||
if(oConvertUtils.isNotEmpty(pid)){
|
if(oConvertUtils.isNotEmpty(pid)){
|
||||||
|
@ -716,7 +701,6 @@ public class SystemController extends BaseController {
|
||||||
String localMaxCode = getMaxLocalCode(null);
|
String localMaxCode = getMaxLocalCode(null);
|
||||||
depart.setOrgCode(YouBianCodeUtil.getNextYouBianCode(localMaxCode));
|
depart.setOrgCode(YouBianCodeUtil.getNextYouBianCode(localMaxCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
userService.save(depart);
|
userService.save(depart);
|
||||||
message = MutiLangUtil.paramAddSuccess("common.department");
|
message = MutiLangUtil.paramAddSuccess("common.department");
|
||||||
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
|
systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO);
|
||||||
|
@ -733,28 +717,22 @@ public class SystemController extends BaseController {
|
||||||
int localCodeLength = parentCode.length() + YouBianCodeUtil.zhanweiLength;
|
int localCodeLength = parentCode.length() + YouBianCodeUtil.zhanweiLength;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("SELECT org_code FROM t_s_depart");
|
sb.append("SELECT org_code FROM t_s_depart");
|
||||||
|
|
||||||
if(ResourceUtil.getJdbcUrl().indexOf(JdbcDao.DATABSE_TYPE_SQLSERVER)!=-1){
|
if(ResourceUtil.getJdbcUrl().indexOf(JdbcDao.DATABSE_TYPE_SQLSERVER)!=-1){
|
||||||
sb.append(" where LEN(org_code) = ").append(localCodeLength);
|
sb.append(" where LEN(org_code) = ").append(localCodeLength);
|
||||||
}else{
|
}else{
|
||||||
sb.append(" where LENGTH(org_code) = ").append(localCodeLength);
|
sb.append(" where LENGTH(org_code) = ").append(localCodeLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(oConvertUtils.isNotEmpty(parentCode)){
|
if(oConvertUtils.isNotEmpty(parentCode)){
|
||||||
sb.append(" and org_code like '").append(parentCode).append("%'");
|
sb.append(" and org_code like '").append(parentCode).append("%'");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
sb.append(" and LEFT(org_code,1)='A'");
|
sb.append(" and LEFT(org_code,1)='A'");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.append(" ORDER BY org_code DESC");
|
sb.append(" ORDER BY org_code DESC");
|
||||||
List<Map<String, Object>> objMapList = systemService.findForJdbc(sb.toString(), 1, 1);
|
List<Map<String, Object>> objMapList = systemService.findForJdbc(sb.toString(), 1, 1);
|
||||||
String returnCode = null;
|
String returnCode = null;
|
||||||
if(objMapList!=null && objMapList.size()>0){
|
if(objMapList!=null && objMapList.size()>0){
|
||||||
returnCode = (String)objMapList.get(0).get("org_code");
|
returnCode = (String)objMapList.get(0).get("org_code");
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnCode;
|
return returnCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1130,7 +1108,7 @@ public class SystemController extends BaseController {
|
||||||
public ModelAndView commonUpload(HttpServletRequest req) {
|
public ModelAndView commonUpload(HttpServletRequest req) {
|
||||||
return new ModelAndView("common/upload/uploadView");
|
return new ModelAndView("common/upload/uploadView");
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(params = "commonWebUpload")
|
@RequestMapping(params = "commonWebUpload")
|
||||||
public ModelAndView commonWebUpload(HttpServletRequest req) {
|
public ModelAndView commonWebUpload(HttpServletRequest req) {
|
||||||
return new ModelAndView("common/upload/uploadView2");
|
return new ModelAndView("common/upload/uploadView2");
|
||||||
|
@ -1223,7 +1201,7 @@ public class SystemController extends BaseController {
|
||||||
for (String string : set) {
|
for (String string : set) {
|
||||||
DataLogDiff dataLogDiff = new DataLogDiff();
|
DataLogDiff dataLogDiff = new DataLogDiff();
|
||||||
dataLogDiff.setName(string);
|
dataLogDiff.setName(string);
|
||||||
|
|
||||||
if (map1.containsKey(string)) {
|
if (map1.containsKey(string)) {
|
||||||
if ("createDate".equals(string)&&StringUtil.isNotEmpty(map1.get(string))){
|
if ("createDate".equals(string)&&StringUtil.isNotEmpty(map1.get(string))){
|
||||||
java.util.Date date=new Date((String) map1.get(string));
|
java.util.Date date=new Date((String) map1.get(string));
|
||||||
|
@ -1232,7 +1210,6 @@ public class SystemController extends BaseController {
|
||||||
}else {
|
}else {
|
||||||
value1 = map1.get(string).toString();
|
value1 = map1.get(string).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value1 == null) {
|
if (value1 == null) {
|
||||||
dataLogDiff.setValue1("");
|
dataLogDiff.setValue1("");
|
||||||
}else {
|
}else {
|
||||||
|
@ -1241,7 +1218,6 @@ public class SystemController extends BaseController {
|
||||||
}else{
|
}else{
|
||||||
dataLogDiff.setValue1("");
|
dataLogDiff.setValue1("");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map2.containsKey(string)) {
|
if (map2.containsKey(string)) {
|
||||||
if ("createDate".equals(string)&&StringUtil.isNotEmpty(map2.get(string))){
|
if ("createDate".equals(string)&&StringUtil.isNotEmpty(map2.get(string))){
|
||||||
java.util.Date date=new Date((String) map2.get(string));
|
java.util.Date date=new Date((String) map2.get(string));
|
||||||
|
@ -1250,7 +1226,6 @@ public class SystemController extends BaseController {
|
||||||
}else {
|
}else {
|
||||||
value2 = map2.get(string).toString();
|
value2 = map2.get(string).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value2 == null) {
|
if (value2 == null) {
|
||||||
dataLogDiff.setValue2("");
|
dataLogDiff.setValue2("");
|
||||||
}else {
|
}else {
|
||||||
|
@ -1259,7 +1234,6 @@ public class SystemController extends BaseController {
|
||||||
}else {
|
}else {
|
||||||
dataLogDiff.setValue2("");
|
dataLogDiff.setValue2("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (value1 == null && value2 == null) {
|
if (value1 == null && value2 == null) {
|
||||||
dataLogDiff.setDiff("N");
|
dataLogDiff.setDiff("N");
|
||||||
|
@ -1289,7 +1263,6 @@ public class SystemController extends BaseController {
|
||||||
return new ModelAndView("system/dataLog/diffDataVersion");
|
return new ModelAndView("system/dataLog/diffDataVersion");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ftpUploader
|
* ftpUploader
|
||||||
* ftp实现 文件上传处理/删除处理
|
* ftp实现 文件上传处理/删除处理
|
||||||
|
@ -1528,7 +1501,7 @@ public class SystemController extends BaseController {
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WebUploader
|
* WebUploader
|
||||||
|
@ -1606,10 +1579,12 @@ public class SystemController extends BaseController {
|
||||||
public void getImgByurl(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
public void getImgByurl(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
||||||
String flag=request.getParameter("down");//是否下载否则展示图片
|
String flag=request.getParameter("down");//是否下载否则展示图片
|
||||||
String dbpath = request.getParameter("dbPath");
|
String dbpath = request.getParameter("dbPath");
|
||||||
|
if(oConvertUtils.isNotEmpty(dbpath)&&dbpath.endsWith(",")){
|
||||||
|
dbpath = dbpath.substring(0, dbpath.length()-1);
|
||||||
|
}
|
||||||
if("1".equals(flag)){
|
if("1".equals(flag)){
|
||||||
response.setContentType("application/x-msdownload;charset=utf-8");
|
response.setContentType("application/x-msdownload;charset=utf-8");
|
||||||
String fileName=dbpath.substring(dbpath.lastIndexOf(File.separator)+1);
|
String fileName=dbpath.substring(dbpath.lastIndexOf(File.separator)+1);
|
||||||
|
|
||||||
String userAgent = request.getHeader("user-agent").toLowerCase();
|
String userAgent = request.getHeader("user-agent").toLowerCase();
|
||||||
if (userAgent.contains("msie") || userAgent.contains("like gecko") ) {
|
if (userAgent.contains("msie") || userAgent.contains("like gecko") ) {
|
||||||
fileName = URLEncoder.encode(fileName, "UTF-8");
|
fileName = URLEncoder.encode(fileName, "UTF-8");
|
||||||
|
@ -1617,7 +1592,6 @@ public class SystemController extends BaseController {
|
||||||
fileName = new String(fileName.getBytes("UTF-8"), "iso-8859-1");
|
fileName = new String(fileName.getBytes("UTF-8"), "iso-8859-1");
|
||||||
}
|
}
|
||||||
response.setHeader("Content-disposition", "attachment; filename="+ fileName);
|
response.setHeader("Content-disposition", "attachment; filename="+ fileName);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
response.setContentType("image/jpeg;charset=utf-8");
|
response.setContentType("image/jpeg;charset=utf-8");
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,23 @@
|
||||||
valid=$("#form").Validform({
|
valid=$("#form").Validform({
|
||||||
tiptype:function(msg,o,cssctl){
|
tiptype:function(msg,o,cssctl){
|
||||||
if(o.type==3){
|
if(o.type==3){
|
||||||
validationMessage(o.obj,msg);
|
var oopanel = $(o.obj).closest(".el-tab-pane");
|
||||||
|
var a = 0;
|
||||||
|
if(oopanel.length>0){
|
||||||
|
var panelID = oopanel.attr("id");
|
||||||
|
if(!!panelID){
|
||||||
|
var waitActive = $("#tab-"+panelID.substring(panelID.indexOf("-")+1));
|
||||||
|
if(!waitActive.attr(".aria-selected")){
|
||||||
|
waitActive.click();
|
||||||
|
a = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(a==1){
|
||||||
|
setTimeout(function(){validationMessage(o.obj,msg);},500);
|
||||||
|
}else{
|
||||||
|
validationMessage(o.obj,msg);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
removeMessage(o.obj);
|
removeMessage(o.obj);
|
||||||
}
|
}
|
||||||
|
@ -225,8 +241,6 @@
|
||||||
</#list>
|
</#list>
|
||||||
},
|
},
|
||||||
|
|
||||||
addFormVisible: false,//新增界面是否显示
|
|
||||||
addLoading: false,
|
|
||||||
//新增界面数据
|
//新增界面数据
|
||||||
addForm: {
|
addForm: {
|
||||||
<#list pageColumns as po>
|
<#list pageColumns as po>
|
||||||
|
@ -367,15 +381,23 @@
|
||||||
initForm: function (row) {
|
initForm: function (row) {
|
||||||
if(!!row){
|
if(!!row){
|
||||||
this.addForm = Object.assign({}, row);
|
this.addForm = Object.assign({}, row);
|
||||||
this.formFile={
|
|
||||||
<#list pageColumns as po>
|
<#list pageColumns as po>
|
||||||
<#if po.showType=='file' || po.showType == 'image'>
|
<#if po.showType=='file' || po.showType == 'image'>
|
||||||
main_${po.fieldName}:[{
|
var ${po.fieldName}=[];
|
||||||
|
if(!!this.addForm.${po.fieldName}){
|
||||||
|
${po.fieldName}=[{
|
||||||
name:this.addForm.${po.fieldName}.substring(this.addForm.${po.fieldName}.lastIndexOf('\\')+1),
|
name:this.addForm.${po.fieldName}.substring(this.addForm.${po.fieldName}.lastIndexOf('\\')+1),
|
||||||
url:this.addForm.${po.fieldName}
|
url:this.addForm.${po.fieldName}
|
||||||
}],
|
}]
|
||||||
|
}
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
|
this.formFile={
|
||||||
|
<#list pageColumns as po>
|
||||||
|
<#if po.showType=='file' || po.showType == 'image'>
|
||||||
|
${po.fieldName}:${po.fieldName},
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
};
|
};
|
||||||
//加载子表列表
|
//加载子表列表
|
||||||
<#list subtables as key>
|
<#list subtables as key>
|
||||||
|
|
|
@ -108,7 +108,11 @@
|
||||||
<#if po.showType=='file' || po.showType == 'image'>
|
<#if po.showType=='file' || po.showType == 'image'>
|
||||||
<el-table-column prop="${po.fieldName}" label="${po.content}" min-width="${po.fieldLength}" sortable="custom" show-overflow-tooltip>
|
<el-table-column prop="${po.fieldName}" label="${po.content}" min-width="${po.fieldLength}" sortable="custom" show-overflow-tooltip>
|
||||||
<template slot-scope="scope" v-if="scope.row.${po.fieldName}">
|
<template slot-scope="scope" v-if="scope.row.${po.fieldName}">
|
||||||
|
<#if po.showType=='file'>
|
||||||
<el-button size="mini" type="primary" @click="handleDownFile('1',scope.row.${po.fieldName})">文件下载</el-button>
|
<el-button size="mini" type="primary" @click="handleDownFile('1',scope.row.${po.fieldName})">文件下载</el-button>
|
||||||
|
<#else>
|
||||||
|
<img width="100%" :src="'systemController/showOrDownByurl.do?dbPath='+scope.row.${po.fieldName}" alt="${po.content}">
|
||||||
|
</#if>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<#else>
|
<#else>
|
||||||
|
@ -293,7 +297,7 @@
|
||||||
var data = datas[i];
|
var data = datas[i];
|
||||||
<#list columns as po>
|
<#list columns as po>
|
||||||
<#if po.showType=='checkbox'>
|
<#if po.showType=='checkbox'>
|
||||||
data.${po.fieldName}=data.${po.fieldName}.split(',');
|
data.${po.fieldName}=!!data.${po.fieldName}?data.${po.fieldName}.split(','):[];
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,8 @@ public class ${entityName}ServiceImpl extends CommonServiceImpl implements ${ent
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void doAddBus(${entityName}Entity t) throws Exception{
|
private void doAddBus(${entityName}Entity t) throws Exception{
|
||||||
<#list buttonSqlMap['add'] as sql>
|
//-----------------sql增强 start----------------------------
|
||||||
|
<#list buttonSqlMap['add'] as sql>
|
||||||
//sql增强第${sql_index+1}条
|
//sql增强第${sql_index+1}条
|
||||||
String sqlEnhance_${sql_index+1} ="${sql}";
|
String sqlEnhance_${sql_index+1} ="${sql}";
|
||||||
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
||||||
|
@ -95,14 +96,16 @@ public class ${entityName}ServiceImpl extends CommonServiceImpl implements ${ent
|
||||||
Map<String,Object> data = populationMap(t);
|
Map<String,Object> data = populationMap(t);
|
||||||
executeJavaExtend("${buttonJavaMap['add'].cgJavaType}","${buttonJavaMap['add'].cgJavaValue}",data);
|
executeJavaExtend("${buttonJavaMap['add'].cgJavaType}","${buttonJavaMap['add'].cgJavaValue}",data);
|
||||||
</#if>
|
</#if>
|
||||||
}
|
//-----------------java增强 end-----------------------------
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 更新操作增强业务
|
* 更新操作增强业务
|
||||||
* @param t
|
* @param t
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void doUpdateBus(${entityName}Entity t) throws Exception{
|
private void doUpdateBus(${entityName}Entity t) throws Exception{
|
||||||
<#list buttonSqlMap['update'] as sql>
|
//-----------------sql增强 start----------------------------
|
||||||
|
<#list buttonSqlMap['update'] as sql>
|
||||||
//sql增强第${sql_index+1}条
|
//sql增强第${sql_index+1}条
|
||||||
String sqlEnhance_${sql_index+1} ="${sql}";
|
String sqlEnhance_${sql_index+1} ="${sql}";
|
||||||
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
||||||
|
@ -116,14 +119,16 @@ public class ${entityName}ServiceImpl extends CommonServiceImpl implements ${ent
|
||||||
Map<String,Object> data = populationMap(t);
|
Map<String,Object> data = populationMap(t);
|
||||||
executeJavaExtend("${buttonJavaMap['update'].cgJavaType}","${buttonJavaMap['update'].cgJavaValue}",data);
|
executeJavaExtend("${buttonJavaMap['update'].cgJavaType}","${buttonJavaMap['update'].cgJavaValue}",data);
|
||||||
</#if>
|
</#if>
|
||||||
}
|
//-----------------java增强 end-----------------------------
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 删除操作增强业务
|
* 删除操作增强业务
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void doDelBus(${entityName}Entity t) throws Exception{
|
private void doDelBus(${entityName}Entity t) throws Exception{
|
||||||
<#list buttonSqlMap['delete'] as sql>
|
//-----------------sql增强 start----------------------------
|
||||||
|
<#list buttonSqlMap['delete'] as sql>
|
||||||
//sql增强第${sql_index+1}条
|
//sql增强第${sql_index+1}条
|
||||||
String sqlEnhance_${sql_index+1} ="${sql}";
|
String sqlEnhance_${sql_index+1} ="${sql}";
|
||||||
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
||||||
|
@ -137,7 +142,8 @@ public class ${entityName}ServiceImpl extends CommonServiceImpl implements ${ent
|
||||||
Map<String,Object> data = populationMap(t);
|
Map<String,Object> data = populationMap(t);
|
||||||
executeJavaExtend("${buttonJavaMap['delete'].cgJavaType}","${buttonJavaMap['delete'].cgJavaValue}",data);
|
executeJavaExtend("${buttonJavaMap['delete'].cgJavaType}","${buttonJavaMap['delete'].cgJavaValue}",data);
|
||||||
</#if>
|
</#if>
|
||||||
}
|
//-----------------java增强 end-----------------------------
|
||||||
|
}
|
||||||
|
|
||||||
private Map<String,Object> populationMap(${entityName}Entity t){
|
private Map<String,Object> populationMap(${entityName}Entity t){
|
||||||
Map<String,Object> map = new HashMap<String,Object>();
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
|
|
@ -105,7 +105,11 @@
|
||||||
<#if po.showType=='file' || po.showType == 'image'>
|
<#if po.showType=='file' || po.showType == 'image'>
|
||||||
<el-table-column prop="${po.fieldName}" label="${po.content}" min-width="${po.fieldLength}" sortable="custom" show-overflow-tooltip>
|
<el-table-column prop="${po.fieldName}" label="${po.content}" min-width="${po.fieldLength}" sortable="custom" show-overflow-tooltip>
|
||||||
<template slot-scope="scope" v-if="scope.row.${po.fieldName}">
|
<template slot-scope="scope" v-if="scope.row.${po.fieldName}">
|
||||||
|
<#if po.showType=='file'>
|
||||||
<el-button size="mini" type="primary" @click="handleDownFile('1',scope.row.${po.fieldName})">文件下载</el-button>
|
<el-button size="mini" type="primary" @click="handleDownFile('1',scope.row.${po.fieldName})">文件下载</el-button>
|
||||||
|
<#else>
|
||||||
|
<img width="100%" :src="'systemController/showOrDownByurl.do?dbPath='+scope.row.${po.fieldName}" alt="${po.content}">
|
||||||
|
</#if>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<#else>
|
<#else>
|
||||||
|
@ -171,7 +175,7 @@
|
||||||
:action="url.upload"
|
:action="url.upload"
|
||||||
:data="{isup:'1'}"
|
:data="{isup:'1'}"
|
||||||
:on-success="handle${po.fieldName?cap_first}UploadFile"
|
:on-success="handle${po.fieldName?cap_first}UploadFile"
|
||||||
:on-remove="handleRemoveFile"
|
:on-remove="handle${po.fieldName?cap_first}RemoveFile"
|
||||||
:file-list="formFile.${po.fieldName}">
|
:file-list="formFile.${po.fieldName}">
|
||||||
<el-button size="small" type="primary">点击上传</el-button>
|
<el-button size="small" type="primary">点击上传</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
@ -336,14 +340,15 @@
|
||||||
<#if po.showType=='file' || po.showType == 'image'>
|
<#if po.showType=='file' || po.showType == 'image'>
|
||||||
handle${po.fieldName?cap_first}UploadFile: function(response, file, fileList){
|
handle${po.fieldName?cap_first}UploadFile: function(response, file, fileList){
|
||||||
file.url=response.obj;
|
file.url=response.obj;
|
||||||
|
this.addForm.${po.fieldName}=response.obj;
|
||||||
if(fileList.length>1){
|
if(fileList.length>1){
|
||||||
this.handleRemoveFile(fileList.splice(0,1)[0],fileList);
|
this.handleRemoveFile(fileList.splice(0,1)[0],fileList);
|
||||||
}
|
}
|
||||||
this.addForm.${po.fieldName}=response.obj;
|
|
||||||
},
|
},
|
||||||
</#if>
|
handle${po.fieldName?cap_first}RemoveFile: function(file, fileList){
|
||||||
</#list>
|
if(fileList.length==0){
|
||||||
handleRemoveFile: function(file, fileList){
|
this.addForm.${po.fieldName}="";
|
||||||
|
}
|
||||||
this.$http.get(this.url.upload,{
|
this.$http.get(this.url.upload,{
|
||||||
params:{
|
params:{
|
||||||
isdel:'1',
|
isdel:'1',
|
||||||
|
@ -352,6 +357,8 @@
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
handleSortChange(sort){
|
handleSortChange(sort){
|
||||||
this.sort={
|
this.sort={
|
||||||
sort:sort.prop,
|
sort:sort.prop,
|
||||||
|
@ -456,7 +463,7 @@
|
||||||
var data = datas[i];
|
var data = datas[i];
|
||||||
<#list columns as po>
|
<#list columns as po>
|
||||||
<#if po.showType=='checkbox'>
|
<#if po.showType=='checkbox'>
|
||||||
data.${po.fieldName}=data.${po.fieldName}.split(',');
|
data.${po.fieldName}=!!data.${po.fieldName}?data.${po.fieldName}.split(','):[];
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
}
|
}
|
||||||
|
@ -488,15 +495,23 @@
|
||||||
handleEdit: function (index, row) {
|
handleEdit: function (index, row) {
|
||||||
this.editFormVisible = true;
|
this.editFormVisible = true;
|
||||||
this.addForm = Object.assign({}, row);
|
this.addForm = Object.assign({}, row);
|
||||||
this.formFile={
|
|
||||||
<#list pageColumns as po>
|
<#list pageColumns as po>
|
||||||
<#if po.showType=='file' || po.showType == 'image'>
|
<#if po.showType=='file' || po.showType == 'image'>
|
||||||
${po.fieldName}:[{
|
var ${po.fieldName}=[];
|
||||||
|
if(!!this.addForm.${po.fieldName}){
|
||||||
|
${po.fieldName}=[{
|
||||||
name:this.addForm.${po.fieldName}.substring(this.addForm.${po.fieldName}.lastIndexOf('\\')+1),
|
name:this.addForm.${po.fieldName}.substring(this.addForm.${po.fieldName}.lastIndexOf('\\')+1),
|
||||||
url:this.addForm.${po.fieldName}
|
url:this.addForm.${po.fieldName}
|
||||||
}],
|
}]
|
||||||
|
}
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
|
this.formFile={
|
||||||
|
<#list pageColumns as po>
|
||||||
|
<#if po.showType=='file' || po.showType == 'image'>
|
||||||
|
${po.fieldName}:${po.fieldName},
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//显示新增界面
|
//显示新增界面
|
||||||
|
|
|
@ -138,49 +138,54 @@
|
||||||
</#list>
|
</#list>
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init: function(){
|
loadData:function(){
|
||||||
var _this = this;
|
return new Promise(function(resolve, reject){
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
url: "${entityName?uncap_first}Controller.do?initFormData",
|
url: "${entityName?uncap_first}Controller.do?initFormData",
|
||||||
type:"GET",
|
type:"GET",
|
||||||
dataType:"JSON",
|
dataType:"JSON",
|
||||||
success: function (back) {
|
success: function (back) {
|
||||||
if(back.success){
|
if(back.success){
|
||||||
var backtemp = back.obj;
|
resolve(back.obj);
|
||||||
<#list pageColumns as po>
|
}
|
||||||
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
}
|
||||||
<#-- 主表checkbox值替换 -->
|
});
|
||||||
backtemp.${po.fieldName} = (!!backtemp.${po.fieldName})?backtemp.${po.fieldName}.split(","):[];
|
});
|
||||||
</#if>
|
},
|
||||||
</#list>
|
init: function(backtemp){
|
||||||
<#list subtables as key>
|
var _this = this;
|
||||||
var temp${subsG['${key}'].entityName}List = backtemp.${subsG['${key}'].entityName?uncap_first}List;
|
<#list pageColumns as po>
|
||||||
<#if subsG['${key}'].cgFormHead.relationType==1>
|
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
||||||
<#-- 1对1子表值替换为单个实体 -->
|
<#-- 主表checkbox值替换 -->
|
||||||
_this.${subsG['${key}'].entityName?uncap_first}Data = temp${subsG['${key}'].entityName}List[0];
|
backtemp.${po.fieldName} = (!!backtemp.${po.fieldName})?backtemp.${po.fieldName}.split(","):[];
|
||||||
<#list subColumnsMap['${key}'] as po>
|
</#if>
|
||||||
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
</#list>
|
||||||
<#-- 1对1子表checkbox值替换 -->
|
<#list subtables as key>
|
||||||
_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName}=(!!_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName})?_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName}.split(","):[];
|
var temp${subsG['${key}'].entityName}List = backtemp.${subsG['${key}'].entityName?uncap_first}List;
|
||||||
</#if>
|
<#if subsG['${key}'].cgFormHead.relationType==1>
|
||||||
</#list>
|
<#-- 1对1子表值替换为单个实体 -->
|
||||||
<#else>
|
_this.${subsG['${key}'].entityName?uncap_first}Data = temp${subsG['${key}'].entityName}List[0];
|
||||||
<#list subColumnsMap['${key}'] as po>
|
<#list subColumnsMap['${key}'] as po>
|
||||||
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
||||||
<#-- 1对n子表checkbox值替换 需要循环 -->
|
<#-- 1对1子表checkbox值替换 -->
|
||||||
if(!!temp${subsG['${key}'].entityName}List && temp${subsG['${key}'].entityName}List.length>0){
|
_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName}=(!!_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName})?_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName}.split(","):[];
|
||||||
for(var a = 0;a<temp${subsG['${key}'].entityName}List.length;a++){
|
</#if>
|
||||||
temp${subsG['${key}'].entityName}List[a].${po.fieldName} = (!!temp${subsG['${key}'].entityName}List[a].${po.fieldName})?temp${subsG['${key}'].entityName}List[a].${po.fieldName}.split(","):[];
|
</#list>
|
||||||
}
|
<#else>
|
||||||
}
|
<#list subColumnsMap['${key}'] as po>
|
||||||
</#if>
|
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
||||||
</#list>
|
<#-- 1对n子表checkbox值替换 需要循环 -->
|
||||||
</#if>
|
if(!!temp${subsG['${key}'].entityName}List && temp${subsG['${key}'].entityName}List.length>0){
|
||||||
</#list>
|
for(var a = 0;a<temp${subsG['${key}'].entityName}List.length;a++){
|
||||||
_this.formdata = backtemp;
|
temp${subsG['${key}'].entityName}List[a].${po.fieldName} = (!!temp${subsG['${key}'].entityName}List[a].${po.fieldName})?temp${subsG['${key}'].entityName}List[a].${po.fieldName}.split(","):[];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
</#if>
|
||||||
|
</#list>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
_this.formdata = backtemp;
|
||||||
|
_this.addValidType();
|
||||||
},
|
},
|
||||||
initDictsData:function(){
|
initDictsData:function(){
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
@ -209,20 +214,20 @@
|
||||||
</#list>
|
</#list>
|
||||||
},
|
},
|
||||||
addValidType:function(){
|
addValidType:function(){
|
||||||
<#list pageColumns as po>
|
this.$nextTick(() => {
|
||||||
<#if po.isShow == 'Y' && po.showType !='input' && po.showType !='checkbox'>
|
<#list pageColumns as po>
|
||||||
<@datatypeJs descriptb="${ftl_description}" po = po/>
|
<#if po.isShow == 'Y' && po.showType !='input' && po.showType !='checkbox'>
|
||||||
</#if>
|
<@datatypeJs descriptb="${ftl_description}" po = po/>
|
||||||
</#list>
|
</#if>
|
||||||
setTimeout(function(){
|
</#list>
|
||||||
<#list subtables as key>
|
<#list subtables as key>
|
||||||
<#list subColumnsMap['${key}'] as spo>
|
<#list subColumnsMap['${key}'] as spo>
|
||||||
<#if spo.isShow == 'Y' && spo.showType !='input' && spo.showType !='checkbox'>
|
<#if spo.isShow == 'Y' && spo.showType !='input' && spo.showType !='checkbox'>
|
||||||
<@datatypeJs descriptb="${subsG['${key}'].ftlDescription}" po = spo/>
|
<@datatypeJs descriptb="${subsG['${key}'].ftlDescription}" po = spo/>
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
</#list>
|
</#list>
|
||||||
},1000);
|
});
|
||||||
},
|
},
|
||||||
<#list subTab as sub>
|
<#list subTab as sub>
|
||||||
delete${sub.entityName}:function(index, row) {
|
delete${sub.entityName}:function(index, row) {
|
||||||
|
@ -287,10 +292,12 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted:function() {
|
||||||
this.init();
|
var _this = this;
|
||||||
this.initDictsData();
|
_this.loadData().then(function(data){
|
||||||
this.addValidType();
|
_this.init(data);
|
||||||
|
});
|
||||||
|
_this.initDictsData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<el-main>
|
<el-main>
|
||||||
<form class="form-horizontal" role="form" id="dailogForm" action="" method="POST">
|
<form class="form-horizontal" role="form" id="dailogForm" action="" method="POST">
|
||||||
<button type="button" id="btn_sub" class="btn_sub" @click="doSubmitForm()" style="display:none"></button>
|
<button type="button" id="btn_sub" class="btn_sub" @click="doSubmitForm()" style="display:none"></button>
|
||||||
<input name = "id" type = "hidden" value = "${formId}" />
|
<input name = "id" type = "hidden" value = "${'$'}{formId}" />
|
||||||
<div class="main-form">
|
<div class="main-form">
|
||||||
<el-form label-width="110px">
|
<el-form label-width="110px">
|
||||||
<#list pageColumns as po>
|
<#list pageColumns as po>
|
||||||
|
@ -138,50 +138,54 @@
|
||||||
</#list>
|
</#list>
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init:function(){
|
loadData:function(){
|
||||||
var _this = this;
|
return new Promise(function(resolve, reject){
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
url: "${entityName?uncap_first}Controller.do?initFormData&id=${'$'}{formId}",
|
url: "${entityName?uncap_first}Controller.do?initFormData&id=${'$'}{formId}",
|
||||||
type:"GET",
|
type:"GET",
|
||||||
dataType:"JSON",
|
dataType:"JSON",
|
||||||
success: function (back) {
|
success: function (back) {
|
||||||
if(back.success){
|
if(back.success){
|
||||||
var backtemp = back.obj;
|
resolve(back.obj);
|
||||||
<#list pageColumns as po>
|
}
|
||||||
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
}
|
||||||
<#-- 主表checkbox值替换 -->
|
});
|
||||||
backtemp.${po.fieldName} = (!!backtemp.${po.fieldName})?backtemp.${po.fieldName}.split(","):[];
|
});
|
||||||
</#if>
|
},
|
||||||
</#list>
|
init:function(backtemp){
|
||||||
<#list subtables as key>
|
var _this = this;
|
||||||
var temp${subsG['${key}'].entityName}List = backtemp.${subsG['${key}'].entityName?uncap_first}List;
|
<#list pageColumns as po>
|
||||||
<#if subsG['${key}'].cgFormHead.relationType==1>
|
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
||||||
<#-- 1对1子表值替换为单个实体 -->
|
<#-- 主表checkbox值替换 -->
|
||||||
_this.${subsG['${key}'].entityName?uncap_first}Data = temp${subsG['${key}'].entityName}List[0];
|
backtemp.${po.fieldName} = (!!backtemp.${po.fieldName})?backtemp.${po.fieldName}.split(","):[];
|
||||||
<#list subColumnsMap['${key}'] as po>
|
</#if>
|
||||||
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
</#list>
|
||||||
<#-- 1对1子表checkbox值替换 -->
|
<#list subtables as key>
|
||||||
_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName}=(!!_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName})?_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName}.split(","):[];
|
var temp${subsG['${key}'].entityName}List = backtemp.${subsG['${key}'].entityName?uncap_first}List;
|
||||||
</#if>
|
<#if subsG['${key}'].cgFormHead.relationType==1>
|
||||||
</#list>
|
<#-- 1对1子表值替换为单个实体 -->
|
||||||
<#else>
|
_this.${subsG['${key}'].entityName?uncap_first}Data = temp${subsG['${key}'].entityName}List[0];
|
||||||
<#list subColumnsMap['${key}'] as po>
|
<#list subColumnsMap['${key}'] as po>
|
||||||
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
||||||
<#-- 1对n子表checkbox值替换 需要循环 -->
|
<#-- 1对1子表checkbox值替换 -->
|
||||||
if(!!temp${subsG['${key}'].entityName}List && temp${subsG['${key}'].entityName}List.length>0){
|
_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName}=(!!_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName})?_this.${subsG['${key}'].entityName?uncap_first}Data.${po.fieldName}.split(","):[];
|
||||||
for(var a = 0;a<temp${subsG['${key}'].entityName}List.length;a++){
|
</#if>
|
||||||
temp${subsG['${key}'].entityName}List[a].${po.fieldName} = (!!temp${subsG['${key}'].entityName}List[a].${po.fieldName})?temp${subsG['${key}'].entityName}List[a].${po.fieldName}.split(","):[];
|
</#list>
|
||||||
}
|
<#else>
|
||||||
}
|
<#list subColumnsMap['${key}'] as po>
|
||||||
</#if>
|
<#if po.isShow == 'Y' && po.showType=='checkbox'>
|
||||||
</#list>
|
<#-- 1对n子表checkbox值替换 需要循环 -->
|
||||||
</#if>
|
if(!!temp${subsG['${key}'].entityName}List && temp${subsG['${key}'].entityName}List.length>0){
|
||||||
</#list>
|
for(var a = 0;a<temp${subsG['${key}'].entityName}List.length;a++){
|
||||||
_this.formdata = backtemp;
|
temp${subsG['${key}'].entityName}List[a].${po.fieldName} = (!!temp${subsG['${key}'].entityName}List[a].${po.fieldName})?temp${subsG['${key}'].entityName}List[a].${po.fieldName}.split(","):[];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
</#if>
|
||||||
});
|
</#list>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
_this.formdata = backtemp;
|
||||||
|
_this.addValidType();
|
||||||
},
|
},
|
||||||
initDictsData:function(){
|
initDictsData:function(){
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
@ -210,20 +214,20 @@
|
||||||
</#list>
|
</#list>
|
||||||
},
|
},
|
||||||
addValidType:function(){
|
addValidType:function(){
|
||||||
<#list pageColumns as po>
|
this.$nextTick(() => {
|
||||||
<#if po.isShow == 'Y' && po.showType !='input' && po.showType !='checkbox'>
|
<#list pageColumns as po>
|
||||||
<@datatypeJs descriptb="${ftl_description}" po = po />
|
<#if po.isShow == 'Y' && po.showType !='input' && po.showType !='checkbox'>
|
||||||
</#if>
|
<@datatypeJs descriptb="${ftl_description}" po = po />
|
||||||
</#list>
|
</#if>
|
||||||
setTimeout(function(){
|
</#list>
|
||||||
<#list subtables as key>
|
<#list subtables as key>
|
||||||
<#list subColumnsMap['${key}'] as spo>
|
<#list subColumnsMap['${key}'] as spo>
|
||||||
<#if spo.isShow == 'Y' && spo.showType !='input' && spo.showType !='checkbox'>
|
<#if spo.isShow == 'Y' && spo.showType !='input' && spo.showType !='checkbox'>
|
||||||
<@datatypeJs descriptb="${subsG['${key}'].ftlDescription}" po = spo />
|
<@datatypeJs descriptb="${subsG['${key}'].ftlDescription}" po = spo />
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
</#list>
|
</#list>
|
||||||
},1000);
|
});
|
||||||
},
|
},
|
||||||
<#list subTab as sub>
|
<#list subTab as sub>
|
||||||
delete${sub.entityName}:function(index, row) {
|
delete${sub.entityName}:function(index, row) {
|
||||||
|
@ -288,10 +292,12 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted:function() {
|
||||||
this.init();
|
var _this = this;
|
||||||
this.initDictsData();
|
_this.loadData().then(function(data){
|
||||||
this.addValidType();
|
_this.init(data);
|
||||||
|
});
|
||||||
|
_this.initDictsData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
|
@ -45,11 +45,11 @@
|
||||||
<#if uploadFlag==1>
|
<#if uploadFlag==1>
|
||||||
<#assign fileName = "" />
|
<#assign fileName = "" />
|
||||||
<!-- 上传组件 -->
|
<!-- 上传组件 -->
|
||||||
<link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css" />
|
<link rel="stylesheet" type="text/css" href="plug-in/webuploader/custom.css"></link>
|
||||||
<script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
|
<script type="text/javascript" src="plug-in/webuploader/webuploader.min.js"></script>
|
||||||
</#if>
|
</#if>
|
||||||
</head>
|
</head>
|
||||||
<body style="overflow:hidden;margin-top: 20px">
|
<body style="overflow:hidden;overflow-y:auto;margin-top: 20px">
|
||||||
<form id="formobj" action="${entityName?uncap_first}Controller.do?doAdd" class="form-horizontal validform" role="form" method="post">
|
<form id="formobj" action="${entityName?uncap_first}Controller.do?doAdd" class="form-horizontal validform" role="form" method="post">
|
||||||
<input type="hidden" id="btn_sub" class="btn_sub"/>
|
<input type="hidden" id="btn_sub" class="btn_sub"/>
|
||||||
<input type="hidden" id="id" name="id"/>
|
<input type="hidden" id="id" name="id"/>
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
<span class="glyphicon glyphicon-calendar"></span>
|
<span class="glyphicon glyphicon-calendar"></span>
|
||||||
</span>
|
</span>
|
||||||
<#elseif po.showType=='file' || po.showType == 'image'>
|
<#elseif po.showType=='file' || po.showType == 'image'>
|
||||||
<@uploadtag po = po/>
|
<@webuploadtag po = po defval=""/>
|
||||||
<#else>
|
<#else>
|
||||||
<input id="${po.fieldName}" name="${po.fieldName}" type="text" maxlength="${po.length?c}" class="form-control input-sm" placeholder="请输入${po.content}" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" tableName="${po.table.tableName}" fieldName="${po.oldFieldName}"/>/>
|
<input id="${po.fieldName}" name="${po.fieldName}" type="text" maxlength="${po.length?c}" class="form-control input-sm" placeholder="请输入${po.content}" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" tableName="${po.table.tableName}" fieldName="${po.oldFieldName}"/>/>
|
||||||
</#if>
|
</#if>
|
||||||
|
@ -149,11 +149,7 @@
|
||||||
callback : function(data) {
|
callback : function(data) {
|
||||||
var win = frameElement.api.opener;
|
var win = frameElement.api.opener;
|
||||||
if (data.success == true) {
|
if (data.success == true) {
|
||||||
<#if uploadFlag==1>
|
|
||||||
callbackUpload(data);
|
|
||||||
<#else>
|
|
||||||
frameElement.api.close();
|
frameElement.api.close();
|
||||||
</#if>
|
|
||||||
win.reloadTable();
|
win.reloadTable();
|
||||||
win.tip(data.msg);
|
win.tip(data.msg);
|
||||||
} else {
|
} else {
|
||||||
|
@ -176,29 +172,6 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
<#if uploadFlag==1>
|
|
||||||
function callbackUpload(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){
|
|
||||||
<#assign subFileName = fileName?substring(0,fileName?length - 1) />
|
|
||||||
<#list subFileName?split(",") as name>
|
|
||||||
$('#${name}').uploadify('upload', '*');
|
|
||||||
</#list>
|
|
||||||
}else{
|
|
||||||
frameElement.api.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function cancel() {
|
|
||||||
<#assign subFileName2 = fileName?substring(0,fileName?length - 1) />
|
|
||||||
<#list subFileName2?split(",") as name>
|
|
||||||
$('#${name}').uploadify('cancel', '*');
|
|
||||||
</#list>
|
|
||||||
}
|
|
||||||
</#if>
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -45,13 +45,11 @@
|
||||||
<#if uploadFlag==1>
|
<#if uploadFlag==1>
|
||||||
<#assign fileName = "" />
|
<#assign fileName = "" />
|
||||||
<!-- 上传组件 -->
|
<!-- 上传组件 -->
|
||||||
<link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css" />
|
<link rel="stylesheet" type="text/css" href="plug-in/webuploader/custom.css"></link>
|
||||||
<script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
|
<script type="text/javascript" src="plug-in/webuploader/webuploader.min.js"></script>
|
||||||
<script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
|
|
||||||
<script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
|
|
||||||
</#if>
|
</#if>
|
||||||
</head>
|
</head>
|
||||||
<body style="overflow:hidden;margin-top: 20px">
|
<body style="overflow:hidden;overflow-y:auto;margin-top: 20px">
|
||||||
<form id="formobj" action="${entityName?uncap_first}Controller.do?doUpdate" class="form-horizontal validform" role="form" method="post">
|
<form id="formobj" action="${entityName?uncap_first}Controller.do?doUpdate" class="form-horizontal validform" role="form" method="post">
|
||||||
<input type="hidden" id="btn_sub" class="btn_sub"/>
|
<input type="hidden" id="btn_sub" class="btn_sub"/>
|
||||||
<input type="hidden" id="id" name="id" value="${'$'}{${entityName?uncap_first}Page.id}"/>
|
<input type="hidden" id="id" name="id" value="${'$'}{${entityName?uncap_first}Page.id}"/>
|
||||||
|
@ -81,7 +79,7 @@
|
||||||
<span class="glyphicon glyphicon-calendar"></span>
|
<span class="glyphicon glyphicon-calendar"></span>
|
||||||
</span>
|
</span>
|
||||||
<#elseif po.showType=='file' || po.showType == 'image'>
|
<#elseif po.showType=='file' || po.showType == 'image'>
|
||||||
<@uploadtag po = po opt = "update"/>
|
<@webuploadtag po = po defval="${'$'}{${entityName?uncap_first}Page.${po.fieldName}}"/>
|
||||||
<#else>
|
<#else>
|
||||||
<input id="${po.fieldName}" name="${po.fieldName}" value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}' type="text" maxlength="${po.length?c}" class="form-control input-sm" placeholder="请输入${po.content}" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" tableName="${po.table.tableName}" fieldName="${po.oldFieldName}"/>/>
|
<input id="${po.fieldName}" name="${po.fieldName}" value='${'$'}{${entityName?uncap_first}Page.${po.fieldName}}' type="text" maxlength="${po.length?c}" class="form-control input-sm" placeholder="请输入${po.content}" <@datatype validType="${po.fieldValidType!''}" isNull="${po.isNull}" type="${po.type}" mustInput="${po.fieldMustInput!''}" tableName="${po.table.tableName}" fieldName="${po.oldFieldName}"/>/>
|
||||||
</#if>
|
</#if>
|
||||||
|
@ -160,11 +158,7 @@
|
||||||
callback : function(data) {
|
callback : function(data) {
|
||||||
var win = frameElement.api.opener;
|
var win = frameElement.api.opener;
|
||||||
if (data.success == true) {
|
if (data.success == true) {
|
||||||
<#if uploadFlag==1>
|
|
||||||
callbackUpload(data);
|
|
||||||
<#else>
|
|
||||||
frameElement.api.close();
|
frameElement.api.close();
|
||||||
</#if>
|
|
||||||
win.reloadTable();
|
win.reloadTable();
|
||||||
win.tip(data.msg);
|
win.tip(data.msg);
|
||||||
} else {
|
} else {
|
||||||
|
@ -187,84 +181,5 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<#if uploadFlag==1>
|
|
||||||
<script>
|
|
||||||
$(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){
|
|
||||||
var fieldName = file.field.toLowerCase();
|
|
||||||
var table = $("#"+fieldName+"_fileTable");
|
|
||||||
var tr = $("<tr style=\"height:34px;\"></tr>");
|
|
||||||
var title = file.title;
|
|
||||||
if(title.length > 15){
|
|
||||||
title = title.substring(0,12) + "...";
|
|
||||||
}
|
|
||||||
var td_title = $("<td title='"+file.title+"'>" + title + "</td>");
|
|
||||||
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>");
|
|
||||||
tr.appendTo(table);
|
|
||||||
td_title.appendTo(tr);
|
|
||||||
td_download.appendTo(tr);
|
|
||||||
td_view.appendTo(tr);
|
|
||||||
td_del.appendTo(tr);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
//表单提交成功后上传文件
|
|
||||||
function callbackUpload(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){
|
|
||||||
<#assign subFileName = fileName?substring(0,fileName?length - 1) />
|
|
||||||
<#list subFileName?split(",") as name>
|
|
||||||
$('#${name}').uploadify('upload', '*');
|
|
||||||
</#list>
|
|
||||||
}else{
|
|
||||||
frameElement.api.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function cancel() {
|
|
||||||
<#assign subFileName2 = fileName?substring(0,fileName?length - 1) />
|
|
||||||
<#list subFileName2?split(",") as name>
|
|
||||||
$('#${name}').uploadify('cancel', '*');
|
|
||||||
</#list>
|
|
||||||
}
|
|
||||||
//删除单个文件
|
|
||||||
function del(url,obj){
|
|
||||||
$.dialog.setting.zIndex =9999;
|
|
||||||
$.dialog.confirm("确认删除该条记录?", function(){
|
|
||||||
$.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).closest("tr").hide("slow");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, function(){
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</#if>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -85,6 +85,21 @@
|
||||||
<i class="fa fa-trash"></i>
|
<i class="fa fa-trash"></i>
|
||||||
<span>批量删除</span>
|
<span>批量删除</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button type="button" class="tool-btn tool-btn-default tool-btn-xs" onclick="openuploadwin('Excel导入', '${entityName?uncap_first}Controller.do?upload', '${entityName?uncap_first}List')">
|
||||||
|
<i class="fa fa-download"></i>
|
||||||
|
<span>导入</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button" class="tool-btn tool-btn-default tool-btn-xs" onclick="JeecgExcelExport('${entityName?uncap_first}Controller.do?exportXls','${entityName?uncap_first}List')">
|
||||||
|
<i class="fa fa-upload"></i>
|
||||||
|
<span>导出</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button" class="tool-btn tool-btn-default tool-btn-xs" onclick="JeecgExcelExport('${entityName?uncap_first}Controller.do?exportXlsByT','${entityName?uncap_first}List')">
|
||||||
|
<i class="fa fa-upload"></i>
|
||||||
|
<span>模版下载</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
<button type="button" class="tool-btn tool-btn-default tool-btn-xs" onclick="$('.toolbar-search').slideToggle();">
|
<button type="button" class="tool-btn tool-btn-default tool-btn-xs" onclick="$('.toolbar-search').slideToggle();">
|
||||||
<i class="fa fa-arrow-circle-left"></i>
|
<i class="fa fa-arrow-circle-left"></i>
|
||||||
|
@ -354,13 +369,15 @@ function listFileImgFormat(value,type){
|
||||||
if(value==null || value.length==0){
|
if(value==null || value.length==0){
|
||||||
return href;
|
return href;
|
||||||
}
|
}
|
||||||
|
var value1 = "systemController/showOrDownByurl.do?dbPath="+value;
|
||||||
if("image"==type){
|
if("image"==type){
|
||||||
href+="<img src='"+value+"' width=30 height=30 onmouseover='tipImg(this)' onmouseout='moveTipImg()' style='vertical-align:middle'/>";
|
href+="<img src='"+value1+"' width=30 height=30 onmouseover='tipImg(this)' onmouseout='moveTipImg()' style='vertical-align:middle'/>";
|
||||||
}else{
|
}else{
|
||||||
if(value.indexOf(".jpg")>-1 || value.indexOf(".gif")>-1 || value.indexOf(".png")>-1){
|
if(value.indexOf(".jpg")>-1 || value.indexOf(".gif")>-1 || value.indexOf(".png")>-1){
|
||||||
href+="<img src='"+value+"' onmouseover='tipImg(this)' onmouseout='moveTipImg()' width=30 height=30 />";
|
href+="<img src='"+value1+"' onmouseover='tipImg(this)' onmouseout='moveTipImg()' width=30 height=30 style='vertical-align:middle'/>";
|
||||||
}else{
|
}else{
|
||||||
href+="<a href='"+value+"' class='ace_button' style='text-decoration:none;' target=_blank><u><i class='fa fa-download'></i>点击下载</u></a>";
|
var value2 = "systemController/showOrDownByurl.do?down=1&dbPath="+value;
|
||||||
|
href+="<a href='"+value2+"' class='ace_button' style='text-decoration:none;' target=_blank><u><i class='fa fa-download'></i>点击下载</u></a>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return href;
|
return href;
|
||||||
|
|
|
@ -81,7 +81,8 @@ public class ${entityName}ServiceImpl extends CommonServiceImpl implements ${ent
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void doAddBus(${entityName}Entity t) throws Exception{
|
private void doAddBus(${entityName}Entity t) throws Exception{
|
||||||
<#list buttonSqlMap['add'] as sql>
|
//-----------------sql增强 start----------------------------
|
||||||
|
<#list buttonSqlMap['add'] as sql>
|
||||||
//sql增强第${sql_index+1}条
|
//sql增强第${sql_index+1}条
|
||||||
String sqlEnhance_${sql_index+1} ="${sql}";
|
String sqlEnhance_${sql_index+1} ="${sql}";
|
||||||
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
||||||
|
@ -95,14 +96,16 @@ public class ${entityName}ServiceImpl extends CommonServiceImpl implements ${ent
|
||||||
Map<String,Object> data = populationMap(t);
|
Map<String,Object> data = populationMap(t);
|
||||||
executeJavaExtend("${buttonJavaMap['add'].cgJavaType}","${buttonJavaMap['add'].cgJavaValue}",data);
|
executeJavaExtend("${buttonJavaMap['add'].cgJavaType}","${buttonJavaMap['add'].cgJavaValue}",data);
|
||||||
</#if>
|
</#if>
|
||||||
}
|
//-----------------java增强 end-----------------------------
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 更新操作增强业务
|
* 更新操作增强业务
|
||||||
* @param t
|
* @param t
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void doUpdateBus(${entityName}Entity t) throws Exception{
|
private void doUpdateBus(${entityName}Entity t) throws Exception{
|
||||||
<#list buttonSqlMap['update'] as sql>
|
//-----------------sql增强 start----------------------------
|
||||||
|
<#list buttonSqlMap['update'] as sql>
|
||||||
//sql增强第${sql_index+1}条
|
//sql增强第${sql_index+1}条
|
||||||
String sqlEnhance_${sql_index+1} ="${sql}";
|
String sqlEnhance_${sql_index+1} ="${sql}";
|
||||||
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
||||||
|
@ -116,14 +119,16 @@ public class ${entityName}ServiceImpl extends CommonServiceImpl implements ${ent
|
||||||
Map<String,Object> data = populationMap(t);
|
Map<String,Object> data = populationMap(t);
|
||||||
executeJavaExtend("${buttonJavaMap['update'].cgJavaType}","${buttonJavaMap['update'].cgJavaValue}",data);
|
executeJavaExtend("${buttonJavaMap['update'].cgJavaType}","${buttonJavaMap['update'].cgJavaValue}",data);
|
||||||
</#if>
|
</#if>
|
||||||
}
|
//-----------------java增强 end-----------------------------
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 删除操作增强业务
|
* 删除操作增强业务
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private void doDelBus(${entityName}Entity t) throws Exception{
|
private void doDelBus(${entityName}Entity t) throws Exception{
|
||||||
<#list buttonSqlMap['delete'] as sql>
|
//-----------------sql增强 start----------------------------
|
||||||
|
<#list buttonSqlMap['delete'] as sql>
|
||||||
//sql增强第${sql_index+1}条
|
//sql增强第${sql_index+1}条
|
||||||
String sqlEnhance_${sql_index+1} ="${sql}";
|
String sqlEnhance_${sql_index+1} ="${sql}";
|
||||||
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
<#-- update--begin--author:zhoujf date:20180413 for:TASK #2623 【bug】生成代码sql 不支持表达式-->
|
||||||
|
@ -137,7 +142,8 @@ public class ${entityName}ServiceImpl extends CommonServiceImpl implements ${ent
|
||||||
Map<String,Object> data = populationMap(t);
|
Map<String,Object> data = populationMap(t);
|
||||||
executeJavaExtend("${buttonJavaMap['delete'].cgJavaType}","${buttonJavaMap['delete'].cgJavaValue}",data);
|
executeJavaExtend("${buttonJavaMap['delete'].cgJavaType}","${buttonJavaMap['delete'].cgJavaValue}",data);
|
||||||
</#if>
|
</#if>
|
||||||
}
|
//-----------------java增强 end-----------------------------
|
||||||
|
}
|
||||||
|
|
||||||
private Map<String,Object> populationMap(${entityName}Entity t){
|
private Map<String,Object> populationMap(${entityName}Entity t){
|
||||||
Map<String,Object> map = new HashMap<String,Object>();
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
|
|
@ -35,6 +35,29 @@
|
||||||
</#if>
|
</#if>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
<#-- 文件上传使用新标签
|
||||||
|
po: 对象
|
||||||
|
opt:操作类型 add/update
|
||||||
|
-->
|
||||||
|
<#macro webuploadtag po defval="">
|
||||||
|
<#local validType="${po.fieldValidType!''}"/>
|
||||||
|
<#local isNull="${po.isNull}"/>
|
||||||
|
<t:webUploader name="${po.fieldName}" outJs="true" auto="true" showImgDiv="filediv_${po.fieldName}"<#rt/>
|
||||||
|
<#if po.showType == 'image'><#rt/>
|
||||||
|
type="image" buttonText='添加图片' displayTxt="false"<#rt/>
|
||||||
|
</#if><#rt/>
|
||||||
|
<#if defval != ''><#rt/>
|
||||||
|
pathValues="${defval}"<#rt/>
|
||||||
|
</#if><#rt/>
|
||||||
|
<#if validType?if_exists?html != ''><#rt/>
|
||||||
|
datatype="${validType?if_exists?html}"<#rt/>
|
||||||
|
<#elseif isNull != 'Y'><#rt/>
|
||||||
|
datatype="*"<#rt/>
|
||||||
|
</#if><#rt/>
|
||||||
|
></t:webUploader>
|
||||||
|
<div class="form" id="filediv_${po.fieldName}"></div>
|
||||||
|
</#macro>
|
||||||
|
|
||||||
<#-- 树控件使用标签 -->
|
<#-- 树控件使用标签 -->
|
||||||
<#macro treetag po formStyle="" opt="">
|
<#macro treetag po formStyle="" opt="">
|
||||||
<t:treeSelectTag id="${po.fieldName}" field="${po.fieldName}" code = "${po.dictField}"<#rt/>
|
<t:treeSelectTag id="${po.fieldName}" field="${po.fieldName}" code = "${po.dictField}"<#rt/>
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue