Commit f4639599 authored by 赵啸非's avatar 赵啸非

添加feign接口自动生成

parent 9d7603a0
...@@ -220,6 +220,7 @@ export default { ...@@ -220,6 +220,7 @@ export default {
"genType", "genType",
"isGenExport", "isGenExport",
"isShowControl", "isShowControl",
"detailShow",
"genFeign", "genFeign",
], // 需要把number转化为string的表单字段name数组 ], // 需要把number转化为string的表单字段name数组
}; };
......
...@@ -116,7 +116,29 @@ ...@@ -116,7 +116,29 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item prop="detailShow">
<span slot="label"
>详细页面生成方式
<el-tooltip
content="生成vue详细页面"
placement="top"
>
<i class="el-icon-question"></i>
</el-tooltip>
</span>
<el-select v-model="info.detailShow">
<el-option label="独立页面" value="0" />
<el-option label="弹出窗口" value="1" />
<el-option label="抽屉" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="packageName"> <el-form-item prop="packageName">
<span slot="label"> <span slot="label">
......
...@@ -555,7 +555,7 @@ export default { ...@@ -555,7 +555,7 @@ export default {
open: false, open: false,
title: "代码预览", title: "代码预览",
data: {}, data: {},
activeName: "entity.java", activeName: "vo.java",
}, },
docForm: {}, docForm: {},
appId: null, appId: null,
......
package com.mortals.xhx.base.system.gentable.model; package com.mortals.xhx.base.system.gentable.model;
/** /**
* * 代码生成业务实体对象
* Description:Gentable *
* date: 2021-9-29 9:35:30 * @author zxfei
*/ * @date 2022-07-04
public class GentableEntity extends GentableEntityExt{ */
public class GentableEntity extends GentableEntityExt {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
...@@ -72,6 +75,10 @@ public class GentableEntity extends GentableEntityExt{ ...@@ -72,6 +75,10 @@ public class GentableEntity extends GentableEntityExt{
* 生成feign接口,消费应用工程名称如(workflow-platform) * 生成feign接口,消费应用工程名称如(workflow-platform)
*/ */
private String feignAppName; private String feignAppName;
/**
* vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
*/
private Integer detailShow;
/** /**
* 是否生成对外api结构(0,否,1.是) * 是否生成对外api结构(0,否,1.是)
*/ */
...@@ -328,6 +335,20 @@ public class GentableEntity extends GentableEntityExt{ ...@@ -328,6 +335,20 @@ public class GentableEntity extends GentableEntityExt{
public void setFeignAppName(String feignAppName){ public void setFeignAppName(String feignAppName){
this.feignAppName = feignAppName; this.feignAppName = feignAppName;
} }
/**
* 获取 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @return Integer
*/
public Integer getDetailShow(){
return detailShow;
}
/**
* 设置 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShow
*/
public void setDetailShow(Integer detailShow){
this.detailShow = detailShow;
}
/** /**
* 获取 是否生成对外api结构(0,否,1.是) * 获取 是否生成对外api结构(0,否,1.是)
* @return Integer * @return Integer
...@@ -464,6 +485,7 @@ public class GentableEntity extends GentableEntityExt{ ...@@ -464,6 +485,7 @@ public class GentableEntity extends GentableEntityExt{
sb.append(",dividedTableType:").append(getDividedTableType()); sb.append(",dividedTableType:").append(getDividedTableType());
sb.append(",genFeign:").append(getGenFeign()); sb.append(",genFeign:").append(getGenFeign());
sb.append(",feignAppName:").append(getFeignAppName()); sb.append(",feignAppName:").append(getFeignAppName());
sb.append(",detailShow:").append(getDetailShow());
sb.append(",genApi:").append(getGenApi()); sb.append(",genApi:").append(getGenApi());
sb.append(",isGenExport:").append(getIsGenExport()); sb.append(",isGenExport:").append(getIsGenExport());
sb.append(",isShowControl:").append(getIsShowControl()); sb.append(",isShowControl:").append(getIsShowControl());
...@@ -475,28 +497,53 @@ public class GentableEntity extends GentableEntityExt{ ...@@ -475,28 +497,53 @@ public class GentableEntity extends GentableEntityExt{
} }
public void initAttrValue(){ public void initAttrValue(){
this.tableName = ""; this.tableName = "";
this.tableComment = ""; this.tableComment = "";
this.subTableName = null; this.subTableName = null;
this.subTableFkName = null; this.subTableFkName = null;
this.className = ""; this.className = "";
this.tplCategory = "crud"; this.tplCategory = "crud";
this.packageName = null; this.packageName = null;
this.moduleName = null; this.moduleName = null;
this.businessName = null; this.businessName = null;
this.functionName = null; this.functionName = null;
this.functionAuthor = null; this.functionAuthor = null;
this.cacheServiceType = null; this.cacheServiceType = null;
this.genType = 0; this.genType = 0;
this.dividedTableType = 0; this.dividedTableType = 0;
this.genFeign = 0; this.genFeign = 0;
this.feignAppName = ""; this.feignAppName = "";
this.detailShow = 1;
this.genApi = null; this.genApi = null;
this.isGenExport = null; this.isGenExport = null;
this.isShowControl = 2;
this.isShowControl = null;
this.genPath = "/"; this.genPath = "/";
this.options = null; this.options = null;
this.remark = null; this.remark = null;
this.appId = null; this.appId = null;
} }
} }
\ No newline at end of file
package com.mortals.xhx.base.system.gentable.model; package com.mortals.xhx.base.system.gentable.model;
import java.util.List; import java.util.List;
import java.util.Date;
/** /**
* * 代码生成业务查询对象
* Description:Gentable *
* date: 2021-9-28 10:10:15 * @author zxfei
*/ * @date 2022-07-04
public class GentableQuery extends GentableEntity{ */
public class GentableQuery extends GentableEntity {
/** 开始 ID,主键,自增长 */ /** 开始 ID,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -105,6 +104,18 @@ public class GentableQuery extends GentableEntity{ ...@@ -105,6 +104,18 @@ public class GentableQuery extends GentableEntity{
/** 生成feign接口,消费应用工程名称如(workflow-platform) */ /** 生成feign接口,消费应用工程名称如(workflow-platform) */
private List<String> feignAppNameList; private List<String> feignAppNameList;
/** 开始 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉) */
private Integer detailShowStart;
/** 结束 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉) */
private Integer detailShowEnd;
/** 增加 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉) */
private Integer detailShowIncrement;
/** vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)列表 */
private List <Integer> detailShowList;
/** 开始 是否生成对外api结构(0,否,1.是) */ /** 开始 是否生成对外api结构(0,否,1.是) */
private Integer genApiStart; private Integer genApiStart;
...@@ -688,6 +699,70 @@ public class GentableQuery extends GentableEntity{ ...@@ -688,6 +699,70 @@ public class GentableQuery extends GentableEntity{
public void setFeignAppNameList(List<String> feignAppNameList){ public void setFeignAppNameList(List<String> feignAppNameList){
this.feignAppNameList = feignAppNameList; this.feignAppNameList = feignAppNameList;
} }
/**
* 获取 开始 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @return detailShowStart
*/
public Integer getDetailShowStart(){
return this.detailShowStart;
}
/**
* 设置 开始 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShowStart
*/
public void setDetailShowStart(Integer detailShowStart){
this.detailShowStart = detailShowStart;
}
/**
* 获取 结束 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @return $detailShowEnd
*/
public Integer getDetailShowEnd(){
return this.detailShowEnd;
}
/**
* 设置 结束 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShowEnd
*/
public void setDetailShowEnd(Integer detailShowEnd){
this.detailShowEnd = detailShowEnd;
}
/**
* 获取 增加 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @return detailShowIncrement
*/
public Integer getDetailShowIncrement(){
return this.detailShowIncrement;
}
/**
* 设置 增加 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShowIncrement
*/
public void setDetailShowIncrement(Integer detailShowIncrement){
this.detailShowIncrement = detailShowIncrement;
}
/**
* 获取 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @return detailShowList
*/
public List<Integer> getDetailShowList(){
return this.detailShowList;
}
/**
* 设置 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShowList
*/
public void setDetailShowList(List<Integer> detailShowList){
this.detailShowList = detailShowList;
}
/** /**
* 获取 开始 是否生成对外api结构(0,否,1.是) * 获取 开始 是否生成对外api结构(0,否,1.是)
* @return genApiStart * @return genApiStart
...@@ -1536,6 +1611,51 @@ public class GentableQuery extends GentableEntity{ ...@@ -1536,6 +1611,51 @@ public class GentableQuery extends GentableEntity{
return this; return this;
} }
/**
* 设置 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShow
*/
public GentableQuery detailShow(Integer detailShow){
setDetailShow(detailShow);
return this;
}
/**
* 设置 开始 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShowStart
*/
public GentableQuery detailShowStart(Integer detailShowStart){
this.detailShowStart = detailShowStart;
return this;
}
/**
* 设置 结束 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShowEnd
*/
public GentableQuery detailShowEnd(Integer detailShowEnd){
this.detailShowEnd = detailShowEnd;
return this;
}
/**
* 设置 增加 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShowIncrement
*/
public GentableQuery detailShowIncrement(Integer detailShowIncrement){
this.detailShowIncrement = detailShowIncrement;
return this;
}
/**
* 设置 vue生成详细页面方式(0,独立页面,1.弹出窗,2.抽屉)
* @param detailShowList
*/
public GentableQuery detailShowList(List<Integer> detailShowList){
this.detailShowList = detailShowList;
return this;
}
/** /**
* 设置 是否生成对外api结构(0,否,1.是) * 设置 是否生成对外api结构(0,否,1.是)
* @param genApi * @param genApi
...@@ -1844,4 +1964,5 @@ public class GentableQuery extends GentableEntity{ ...@@ -1844,4 +1964,5 @@ public class GentableQuery extends GentableEntity{
public void setAndConditionList(List<GentableQuery> andConditionList){ public void setAndConditionList(List<GentableQuery> andConditionList){
this.andConditionList = andConditionList; this.andConditionList = andConditionList;
} }
} }
\ No newline at end of file
...@@ -12,7 +12,6 @@ import com.mortals.framework.exception.AppException; ...@@ -12,7 +12,6 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.ParamDto; import com.mortals.framework.model.ParamDto;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.EntityUtil; import com.mortals.framework.util.EntityUtil;
import com.mortals.xhx.base.system.gentable.dao.GentableDao; import com.mortals.xhx.base.system.gentable.dao.GentableDao;
import com.mortals.xhx.base.system.gentable.model.*; import com.mortals.xhx.base.system.gentable.model.*;
...@@ -96,6 +95,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge ...@@ -96,6 +95,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
table.setIsGenExport(0); table.setIsGenExport(0);
table.setGenFeign(0); table.setGenFeign(0);
table.setIsShowControl(2); table.setIsShowControl(2);
table.setDetailShow(1);
table.setGenPath("/"); table.setGenPath("/");
table.setTplCategory("crud"); table.setTplCategory("crud");
table.setAppId(appId); table.setAppId(appId);
...@@ -171,6 +171,9 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge ...@@ -171,6 +171,9 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
if (temp.contains("webForm.java.ftl")) { if (temp.contains("webForm.java.ftl")) {
continue; continue;
} }
// if (temp.contains("entity.java.ftl")||temp.contains("entityQuery.java.ftl")) {
// continue;
// }
} }
if (gentableEntity.getIsShowControl() == 0) { if (gentableEntity.getIsShowControl() == 0) {
if (temp.contains("webBody.java.ftl")) { if (temp.contains("webBody.java.ftl")) {
...@@ -178,7 +181,21 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge ...@@ -178,7 +181,21 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
} }
} }
if (temp.equals("menu.sql.ftl")||temp.equals("db.sql.ftl")||temp.equals("api.md.ftl")) { if (gentableEntity.getDetailShow() == 0) {
if (temp.contains("VueDialogShow.vue.ftl") || temp.contains("VueDrawerShow.vue.ftl")) {
continue;
}
} else if (gentableEntity.getDetailShow() == 1) {
if (temp.contains("webVueShow.vue.ftl") || temp.contains("VueDrawerShow.vue.ftl")) {
continue;
}
} else if (gentableEntity.getDetailShow() == 2) {
if (temp.contains("webVueShow.vue.ftl") || temp.contains("VueDialogShow.vue.ftl")) {
continue;
}
}
if (temp.equals("menu.sql.ftl") || temp.equals("db.sql.ftl") || temp.equals("api.md.ftl")) {
try { try {
List<GentableEntity> tableList = new ArrayList<>(); List<GentableEntity> tableList = new ArrayList<>();
tableList.add(gentableEntity); tableList.add(gentableEntity);
...@@ -353,6 +370,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge ...@@ -353,6 +370,7 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
table.setGenFeign(0); table.setGenFeign(0);
table.setIsGenExport(0); table.setIsGenExport(0);
table.setIsShowControl(2); table.setIsShowControl(2);
table.setDetailShow(1);
table.setGenPath("/"); table.setGenPath("/");
table.setTplCategory("crud"); table.setTplCategory("crud");
table.setCacheServiceType(CacheServiceTypeEnum.NORMAL_SERVICE.getValue()); table.setCacheServiceType(CacheServiceTypeEnum.NORMAL_SERVICE.getValue());
...@@ -485,6 +503,11 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge ...@@ -485,6 +503,11 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
if (temp.contains("web.java.ftl") || temp.contains("webForm.java.ftl")) { if (temp.contains("web.java.ftl") || temp.contains("webForm.java.ftl")) {
continue; continue;
} }
// if (temp.contains("entity.java.ftl")||temp.contains("entityQuery.java.ftl")) {
// continue;
// }
} else { } else {
if (temp.contains("webBody.java.ftl")) { if (temp.contains("webBody.java.ftl")) {
continue; continue;
...@@ -497,6 +520,20 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge ...@@ -497,6 +520,20 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
} }
} }
if (gentableEntity.getDetailShow() == 0) {
if (temp.contains("VueDialogShow.vue.ftl") || temp.contains("VueDrawerShow.vue.ftl")) {
continue;
}
} else if (gentableEntity.getDetailShow() == 1) {
if (temp.contains("webVueShow.vue.ftl") || temp.contains("VueDrawerShow.vue.ftl")) {
continue;
}
} else if (gentableEntity.getDetailShow() == 2) {
if (temp.contains("webVueShow.vue.ftl") || temp.contains("VueDialogShow.vue.ftl")) {
continue;
}
}
if (temp.equals("menu.sql.ftl")) { if (temp.equals("menu.sql.ftl")) {
continue; continue;
} }
......
...@@ -65,9 +65,7 @@ public class GentableController extends BaseCRUDJsonMappingController<GentableSe ...@@ -65,9 +65,7 @@ public class GentableController extends BaseCRUDJsonMappingController<GentableSe
@Override @Override
protected void doListBefore(HttpServletRequest request, HttpServletResponse response, GentableForm form, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(HttpServletRequest request, HttpServletResponse response, GentableForm form, Map<String, Object> model, Context context) throws AppException {
form.getQuery().setOrderField("tableName"); form.getQuery().setOrderField("tableName");
super.doListBefore(request, response, form, model, context); super.doListBefore(request, response, form, model, context);
} }
...@@ -85,15 +83,12 @@ public class GentableController extends BaseCRUDJsonMappingController<GentableSe ...@@ -85,15 +83,12 @@ public class GentableController extends BaseCRUDJsonMappingController<GentableSe
int code = VALUE_RESULT_SUCCESS; int code = VALUE_RESULT_SUCCESS;
try { try {
List<GentableEntity> list = this.service.selectDbTableList(form.getQuery()); List<GentableEntity> list = this.service.selectDbTableList(form.getQuery());
model.put("result", list); model.put("result", list);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
code = VALUE_RESULT_FAILURE; code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e); this.doException(request, busiDesc, model, e);
} }
ret.put(KEY_RESULT_CODE, code); ret.put(KEY_RESULT_CODE, code);
ret.put(KEY_RESULT_QUERY, form.getQuery()); ret.put(KEY_RESULT_QUERY, form.getQuery());
ret.put(KEY_RESULT_DATA, model); ret.put(KEY_RESULT_DATA, model);
......
...@@ -90,6 +90,7 @@ public class FreeMarkerUtils { ...@@ -90,6 +90,7 @@ public class FreeMarkerUtils {
templates.add("enum.java.ftl"); templates.add("enum.java.ftl");
templates.add("entity.java.ftl"); templates.add("entity.java.ftl");
templates.add("entityQuery.java.ftl"); templates.add("entityQuery.java.ftl");
// templates.add("entityAndQuery.java.ftl");
templates.add("dao.java.ftl"); templates.add("dao.java.ftl");
templates.add("daoImpl.java.ftl"); templates.add("daoImpl.java.ftl");
templates.add("web.java.ftl"); templates.add("web.java.ftl");
...@@ -101,13 +102,14 @@ public class FreeMarkerUtils { ...@@ -101,13 +102,14 @@ public class FreeMarkerUtils {
templates.add("db.sql.ftl"); templates.add("db.sql.ftl");
templates.add("menu.sql.ftl"); templates.add("menu.sql.ftl");
templates.add("api.md.ftl"); templates.add("api.md.ftl");
templates.add("httpclient.test.ftl");
if (GenConstants.TPL_CRUD.equals(tplCategory)) { if (GenConstants.TPL_CRUD.equals(tplCategory)) {
templates.add("service.java.ftl"); templates.add("service.java.ftl");
templates.add("serviceImpl.java.ftl"); templates.add("serviceImpl.java.ftl");
templates.add("webVueList.vue.ftl"); templates.add("webVueList.vue.ftl");
templates.add("VueDialogShow.vue.ftl"); templates.add("VueDialogShow.vue.ftl");
// templates.add("webVueShow.vue.ftl"); templates.add("VueDrawerShow.vue.ftl");
templates.add("webVueShow.vue.ftl");
} else if (GenConstants.TPL_TREE.equals(tplCategory)) { } else if (GenConstants.TPL_TREE.equals(tplCategory)) {
templates.add("entity-tree.java.ftl"); templates.add("entity-tree.java.ftl");
templates.add("service-tree.java.ftl"); templates.add("service-tree.java.ftl");
...@@ -118,10 +120,12 @@ public class FreeMarkerUtils { ...@@ -118,10 +120,12 @@ public class FreeMarkerUtils {
templates.add("service.java.ftl"); templates.add("service.java.ftl");
templates.add("serviceImpl.java.ftl"); templates.add("serviceImpl.java.ftl");
templates.add("webVueList.vue.ftl"); templates.add("webVueList.vue.ftl");
//templates.add("webVueShow.vue.ftl"); templates.add("webVueShow.vue.ftl");
templates.add("VueDrawerShow.vue.ftl");
templates.add("VueDialogShow.vue.ftl"); templates.add("VueDialogShow.vue.ftl");
} }
//templates.add("webVueView.vue.ftl"); templates.add("webVueView.vue.ftl");
templates.add("httpclient.test.ftl");
return templates; return templates;
} }
...@@ -415,7 +419,13 @@ public class FreeMarkerUtils { ...@@ -415,7 +419,13 @@ public class FreeMarkerUtils {
fileName = StringUtils.format("{}/{}/model/vo/{}Vo.java", javaPath, businessName, className); fileName = StringUtils.format("{}/{}/model/vo/{}Vo.java", javaPath, businessName, className);
} else if (template.contains("entityQuery.java.ftl")) { } else if (template.contains("entityQuery.java.ftl")) {
fileName = StringUtils.format("{}/{}/model/{}Query.java", javaPath, businessName, className); fileName = StringUtils.format("{}/{}/model/{}Query.java", javaPath, businessName, className);
} else if (template.contains("dao.java.ftl")) { }
// else if (template.contains("entityAndQuery.java.ftl")) {
// fileName = StringUtils.format("{}/{}/model/{}Entity.java", javaPath, businessName, className);
// }
else if (template.contains("dao.java.ftl")) {
fileName = StringUtils.format("{}/{}/dao/{}Dao.java", javaPath, businessName, className); fileName = StringUtils.format("{}/{}/dao/{}Dao.java", javaPath, businessName, className);
} else if (template.contains("daoImpl.java.ftl")) { } else if (template.contains("daoImpl.java.ftl")) {
fileName = StringUtils.format("{}/{}/dao/ibatis/{}DaoImpl.java", javaPath, businessName, className); fileName = StringUtils.format("{}/{}/dao/ibatis/{}DaoImpl.java", javaPath, businessName, className);
...@@ -441,7 +451,7 @@ public class FreeMarkerUtils { ...@@ -441,7 +451,7 @@ public class FreeMarkerUtils {
fileName = StringUtils.format("{}/views/{}/list.vue", vuePath, businessNameExt); fileName = StringUtils.format("{}/views/{}/list.vue", vuePath, businessNameExt);
} }
/* else if (template.contains("webVueShow.vue.ftl")) { else if (template.contains("webVueShow.vue.ftl")) {
String businessNameExt = getBusinessNameExt(genTable.getTableName()); String businessNameExt = getBusinessNameExt(genTable.getTableName());
businessNameExt = StringUtils.replace(businessNameExt, ".", "/"); businessNameExt = StringUtils.replace(businessNameExt, ".", "/");
fileName = StringUtils.format("{}/views/{}/show.vue", vuePath, businessNameExt); fileName = StringUtils.format("{}/views/{}/show.vue", vuePath, businessNameExt);
...@@ -450,7 +460,7 @@ public class FreeMarkerUtils { ...@@ -450,7 +460,7 @@ public class FreeMarkerUtils {
String businessNameExt = getBusinessNameExt(genTable.getTableName()); String businessNameExt = getBusinessNameExt(genTable.getTableName());
businessNameExt = StringUtils.replace(businessNameExt, ".", "/"); businessNameExt = StringUtils.replace(businessNameExt, ".", "/");
fileName = StringUtils.format("{}/views/{}/view.vue", vuePath, businessNameExt); fileName = StringUtils.format("{}/views/{}/view.vue", vuePath, businessNameExt);
}*/ }
else if (template.contains("webVueTreeList.vue.ftl")) { else if (template.contains("webVueTreeList.vue.ftl")) {
String businessNameExt = getBusinessNameExt(genTable.getTableName()); String businessNameExt = getBusinessNameExt(genTable.getTableName());
businessNameExt = StringUtils.replace(businessNameExt, ".", "/"); businessNameExt = StringUtils.replace(businessNameExt, ".", "/");
...@@ -463,7 +473,12 @@ public class FreeMarkerUtils { ...@@ -463,7 +473,12 @@ public class FreeMarkerUtils {
String businessNameExt = getBusinessNameExt(genTable.getTableName()); String businessNameExt = getBusinessNameExt(genTable.getTableName());
businessNameExt = StringUtils.replace(businessNameExt, ".", "/"); businessNameExt = StringUtils.replace(businessNameExt, ".", "/");
fileName = StringUtils.format("{}/views/{}/dialogshow.vue", vuePath, businessNameExt); fileName = StringUtils.format("{}/views/{}/dialogshow.vue", vuePath, businessNameExt);
} else if (template.contains("db.doc.ftl")) { } else if (template.contains("VueDrawerShow.vue.ftl")) {
String businessNameExt = getBusinessNameExt(genTable.getTableName());
businessNameExt = StringUtils.replace(businessNameExt, ".", "/");
fileName = StringUtils.format("{}/views/{}/drawershow.vue", vuePath, businessNameExt);
}
else if (template.contains("db.doc.ftl")) {
fileName = StringUtils.format("doc/alldoc.docx"); fileName = StringUtils.format("doc/alldoc.docx");
} else if (template.contains("api.doc.ftl")) { } else if (template.contains("api.doc.ftl")) {
fileName = StringUtils.format("doc/api.md"); fileName = StringUtils.format("doc/api.md");
......
...@@ -360,8 +360,12 @@ dict|object|字典对象 ...@@ -360,8 +360,12 @@ dict|object|字典对象
:---|:---|:---|:------- :---|:---|:---|:-------
<#list table.columns as column> <#list table.columns as column>
<#if !column.isSuperColumn(column.javaField)> <#if !column.isSuperColumn(column.javaField)>
<#if column.isRequired == 1>
${column.javaField}|${column.javaType}|是|${column.columnComment} ${column.javaField}|${column.javaType}|是|${column.columnComment}
</#if> </#if>
<#else>
${column.javaField}|${column.javaType}|否|${column.columnComment}
</#if>
</#list> </#list>
**请求样例:** **请求样例:**
......
...@@ -167,8 +167,8 @@ public class ${ClassName}Query extends ${ClassName}Entity { ...@@ -167,8 +167,8 @@ public class ${ClassName}Query extends ${ClassName}Entity {
} }
</#if> </#if>
</#list> </#list>
<#list columns as column> <#list columns as column>
<#if column.javaType == "Long"||column.javaType == "Integer"||column.javaType == "BigDecimal"> <#if column.javaType == "Long"||column.javaType == "Integer"||column.javaType == "BigDecimal">
/** /**
* 设置 ${column.columnComment} * 设置 ${column.columnComment}
......
...@@ -10,7 +10,6 @@ import javax.servlet.http.HttpServletRequest; ...@@ -10,7 +10,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import ${packageName}.model.${ClassName}Entity; import ${packageName}.model.${ClassName}Entity;
import ${packageName}.model.${ClassName}Query;
import ${packageName}.service.${ClassName}Service; import ${packageName}.service.${ClassName}Service;
<#if table.tplCategory=="tree"> <#if table.tplCategory=="tree">
import ${packageName}.model.${ClassName}TreeSelect; import ${packageName}.model.${ClassName}TreeSelect;
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
edit(row) { edit(row) {
this.reset() this.reset()
this.query = { ${pkColumn.javaField}: row.${pkColumn.javaField} }; this.query = { ${pkColumn.javaField}: row.${pkColumn.javaField} };
this.urls.currUrl =this.pageInfo.editUrl;; this.urls.currUrl ="${RequestMapping}/edit";
this.getData(); this.getData();
this.pageInfo.type="edit" this.pageInfo.type="edit"
this.title = "修改${functionName}"; this.title = "修改${functionName}";
...@@ -254,8 +254,7 @@ ...@@ -254,8 +254,7 @@
/** 新增 */ /** 新增 */
add(row) { add(row) {
this.reset() this.reset()
this.query = { ${pkColumn.javaField}: row.${pkColumn.javaField} }; this.urls.currUrl = "${RequestMapping}/add";
this.urls.currUrl = this.pageInfo.addUrl;
this.getData(); this.getData();
this.pageInfo.type="add" this.pageInfo.type="add"
this.title = "新增${functionName}"; this.title = "新增${functionName}";
...@@ -264,7 +263,7 @@ ...@@ -264,7 +263,7 @@
view(row) { view(row) {
this.reset() this.reset()
this.query = { ${pkColumn.javaField}: row.${pkColumn.javaField} }; this.query = { ${pkColumn.javaField}: row.${pkColumn.javaField} };
this.urls.currUrl =this.pageInfo.viewUrl;; this.urls.currUrl ="${RequestMapping}/view";
this.getData(); this.getData();
this.pageInfo.type="view" this.pageInfo.type="view"
this.title = "${functionName}详细"; this.title = "${functionName}详细";
......
...@@ -63,17 +63,38 @@ ...@@ -63,17 +63,38 @@
</div> </div>
</el-dialog> </el-dialog>
</#if> </#if>
<#if table.detailShow==1 >
<dialog-show ref="dialogform" @ok="getData" />
<#elseif table.detailShow==2>
<drawer-show ref="drawerform" @ok="getData" />
<#else>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
</#if>
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
<#if table.detailShow==1 >
import dialogShow from "./dialogshow"; import dialogShow from "./dialogshow";
<#elseif table.detailShow==2>
import drawerShow from "./drawershow";
<#else >
import dialogShow from "./dialogshow";
</#if>
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { export default {
name: "${ClassName}", name: "${ClassName}List",
components: {dialogShow }, components: {
<#if table.detailShow==1 >
dialogShow
<#elseif table.detailShow==2>
drawerShow
<#else >
dialogShow
</#if>},
mixins: [table], mixins: [table],
created() { created() {
}, },
...@@ -114,9 +135,10 @@ ...@@ -114,9 +135,10 @@
doExport() { doExport() {
this.isExport = true; this.isExport = true;
this.$download("/${RequestMapping}/exportExcel", { this.$download("/${RequestMapping}/exportExcel", {
"idList": this.selection,
<#list columns as column> <#list columns as column>
<#if column.isQuery == 1 > <#if column.isQuery == 1 >
'query.${column.javaField}': this.$route.query['query.${column.javaField}']<#sep>, '${column.javaField}': this.$route.query['${column.javaField}']<#sep>,
</#if> </#if>
</#list> </#list>
}, { type: "excel" }).then(() => this.isExport = false).catch(error => { }, { type: "excel" }).then(() => this.isExport = false).catch(error => {
...@@ -144,7 +166,7 @@ ...@@ -144,7 +166,7 @@
); );
}, },
</#if> </#if>
<#if table.detailShow==1 >
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
this.$refs.dialogform.add(row); this.$refs.dialogform.add(row);
...@@ -152,12 +174,38 @@ ...@@ -152,12 +174,38 @@
/** 重写编辑方法 */ /** 重写编辑方法 */
toEdit(row) { toEdit(row) {
this.$refs.dialogform.edit(row); this.$refs.dialogform.edit(row);
}, },
/** 重写查看方法 */ /** 重写查看方法 */
// toView(row) { toView(row) {
// this.$refs.dialogform.view(row); this.$refs.dialogform.view(row);
// }, },
<#elseif table.detailShow==2>
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
<#else>
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
</#if>
}, },
data() { data() {
...@@ -227,12 +275,13 @@ ...@@ -227,12 +275,13 @@
], ],
columns: [ columns: [
{type: "selection", width: 60}, {type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
<#list columns as column> <#list columns as column>
<#assign comment=column.subComment(column.columnComment) /> <#assign comment=column.subComment(column.columnComment) />
<#if column.columnName != pkColumn.columnName && !column.isSuperColumn(column.javaField)&& column.isList==1> <#if column.columnName != pkColumn.columnName && column.isList==1>
<#if column.javaType == "Long"> <#if column.javaType == "Long">
{label: "${comment}", prop: "${column.javaField}", formatter: this.formatterString}, {label: "${comment}", prop: "${column.javaField}", formatter: this.formatter},
</#if> </#if>
<#if column.javaType == "String"> <#if column.javaType == "String">
{label: "${comment}", prop: "${column.javaField}"}, {label: "${comment}", prop: "${column.javaField}"},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment