mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev
Conflicts: ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm ruoyi-generator/src/main/resources/vm/vue/index.vue.vm ruoyi-ui/src/main.js ruoyi-ui/src/views/system/dict/data.vue ruoyi-ui/src/views/system/dict/index.vue ruoyi-ui/src/views/system/role/index.vue ruoyi-ui/src/views/system/user/index.vue
This commit is contained in:
@ -16,7 +16,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 模板处理工具类
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class VelocityUtils
|
||||
@ -61,6 +61,7 @@ public class VelocityUtils
|
||||
velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName));
|
||||
velocityContext.put("columns", genTable.getColumns());
|
||||
velocityContext.put("table", genTable);
|
||||
velocityContext.put("dicts", getDicts(genTable));
|
||||
setMenuVelocityContext(velocityContext, genTable);
|
||||
if (GenConstants.TPL_TREE.equals(tplCategory))
|
||||
{
|
||||
@ -245,7 +246,7 @@ public class VelocityUtils
|
||||
|
||||
/**
|
||||
* 根据列类型获取导入包
|
||||
*
|
||||
*
|
||||
* @param genTable 业务表对象
|
||||
* @return 返回需要导入的包列表
|
||||
*/
|
||||
@ -273,6 +274,27 @@ public class VelocityUtils
|
||||
return importList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据列类型获取字典组
|
||||
*
|
||||
* @param genTable 业务表对象
|
||||
* @return 返回字典组
|
||||
*/
|
||||
public static String getDicts(GenTable genTable)
|
||||
{
|
||||
List<GenTableColumn> columns = genTable.getColumns();
|
||||
List<String> dicts = new ArrayList<String>();
|
||||
for (GenTableColumn column : columns)
|
||||
{
|
||||
if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny(
|
||||
column.getHtmlType(), new String[] { GenConstants.HTML_SELECT, GenConstants.HTML_RADIO }))
|
||||
{
|
||||
dicts.add("'" + column.getDictType() + "'");
|
||||
}
|
||||
}
|
||||
return StringUtils.join(dicts, ", ");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限前缀
|
||||
*
|
||||
|
Reference in New Issue
Block a user