mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2026-07-11 07:06:08 +00:00
update 优化 如果是react前端生成代码 目录使用pages命名
This commit is contained in:
@@ -85,6 +85,11 @@ public interface GenConstants {
|
||||
*/
|
||||
String FRONTEND_TYPE_VUE = "vue";
|
||||
|
||||
/**
|
||||
* React 前端模板类型,对应模板根目录下的 react 目录。
|
||||
*/
|
||||
String FRONTEND_TYPE_REACT = "react";
|
||||
|
||||
/**
|
||||
* 树根节点值
|
||||
*/
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
private final GenTableMapper tableMapper;
|
||||
private final GenTableColumnMapper genTableColumnMapper;
|
||||
|
||||
private static final String[] TABLE_IGNORE = new String[]{"sj_", "flow_", "gen_"};
|
||||
private static final String[] TABLE_IGNORE = new String[]{"sai_", "sj_", "flow_", "gen_"};
|
||||
|
||||
/**
|
||||
* 查询业务字段列表
|
||||
|
||||
+13
-2
@@ -358,6 +358,7 @@ public class TemplateEngineUtils {
|
||||
String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/");
|
||||
String mybatisPath = MYBATIS_PATH + "/" + moduleName;
|
||||
String frontendPath = getFrontendPath(genTable.getFrontendType());
|
||||
String frontendPagePath = getFrontendPagePath(genTable.getFrontendType());
|
||||
// templatePath
|
||||
// genFilePathFormat
|
||||
if (template.contains("domain.java.")) {
|
||||
@@ -383,10 +384,10 @@ public class TemplateEngineUtils {
|
||||
} else if (template.contains("types.ts.")) {
|
||||
fileName = StringUtils.format("{}/api/{}/{}/types.ts", frontendPath, moduleName, businessName);
|
||||
} else if (isFrontendPageTemplate(template, GenConstants.FRONTEND_INDEX_TEMPLATE_PREFIX)) {
|
||||
fileName = StringUtils.format("{}/views/{}/{}/index.{}", frontendPath, moduleName, businessName,
|
||||
fileName = StringUtils.format("{}/{}/{}/{}/index.{}", frontendPath, frontendPagePath, moduleName, businessName,
|
||||
getFrontendPageExtension(template, GenConstants.FRONTEND_INDEX_TEMPLATE_PREFIX));
|
||||
} else if (isFrontendPageTemplate(template, GenConstants.FRONTEND_INDEX_TREE_TEMPLATE_PREFIX)) {
|
||||
fileName = StringUtils.format("{}/views/{}/{}/index.{}", frontendPath, moduleName, businessName,
|
||||
fileName = StringUtils.format("{}/{}/{}/{}/index.{}", frontendPath, frontendPagePath, moduleName, businessName,
|
||||
getFrontendPageExtension(template, GenConstants.FRONTEND_INDEX_TREE_TEMPLATE_PREFIX));
|
||||
}
|
||||
return fileName;
|
||||
@@ -402,6 +403,16 @@ public class TemplateEngineUtils {
|
||||
return resolveFrontendType(frontendType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取前端页面输出目录。
|
||||
*
|
||||
* @param frontendType 前端模板类型
|
||||
* @return 页面输出目录
|
||||
*/
|
||||
private static String getFrontendPagePath(String frontendType) {
|
||||
return GenConstants.FRONTEND_TYPE_REACT.equals(resolveFrontendType(frontendType)) ? "pages" : "views";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取前端页面文件扩展名。
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user