mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-17 10:56:39 +08:00
Pre Merge pull request !67 from 大熊/code-generator
This commit is contained in:
commit
b41f689bff
@ -47,7 +47,8 @@ public class ListVariableService extends CodeGenerateBaseVariableService {
|
||||
CodeField codeField = getCodeFieldByColumnName(queryField.getColumnNameList().get(0), form);
|
||||
|
||||
if (CodeQueryFieldQueryTypeEnum.ENUM.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
objectMap.put("frontEnumName", codeField.getEnumName());
|
||||
String upperUnderscoreEnum = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codeField.getEnumName());
|
||||
objectMap.put("frontEnumName", upperUnderscoreEnum);
|
||||
frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';");
|
||||
}
|
||||
|
||||
@ -76,6 +77,12 @@ public class ListVariableService extends CodeGenerateBaseVariableService {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 是否存在枚举
|
||||
if (SmartStringUtil.isNotBlank(codeField.getEnumName())) {
|
||||
String upperUnderscoreEnum = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codeField.getEnumName());
|
||||
objectMap.put("frontEnumPlugin", "$smartEnumPlugin.getDescByValue('" + upperUnderscoreEnum + "', text)");
|
||||
}
|
||||
|
||||
// 是否存在字典
|
||||
if (SmartStringUtil.isNotBlank(codeField.getDict())) {
|
||||
objectMap.put("dict", codeField.getDict());
|
||||
|
@ -18,7 +18,7 @@ public class ${name.upperCamel}Entity {
|
||||
#foreach ($field in $fields)
|
||||
|
||||
/**
|
||||
* $field.label
|
||||
* $field.columnComment
|
||||
*/
|
||||
#if($field.primaryKeyFlag && $field.autoIncreaseFlag)
|
||||
@TableId(type = IdType.AUTO)
|
||||
|
@ -89,6 +89,7 @@
|
||||
<!---------- 表格 begin ----------->
|
||||
<a-table
|
||||
size="small"
|
||||
:scroll="{ y: 800 }"
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="$!{primaryKeyFieldName}"
|
||||
@ -108,6 +109,13 @@
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.frontEnumPlugin)
|
||||
<template v-if="column.dataIndex === '$!{field.fieldName}'">
|
||||
<span>{{ $!{field.frontEnumPlugin} }}</span>
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.dict)
|
||||
<template v-if="column.dataIndex === '$!{field.fieldName}'">
|
||||
|
@ -48,7 +48,8 @@ public class ListVariableService extends CodeGenerateBaseVariableService {
|
||||
CodeField codeField = getCodeFieldByColumnName(queryField.getColumnNameList().get(0), form);
|
||||
|
||||
if (CodeQueryFieldQueryTypeEnum.ENUM.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
objectMap.put("frontEnumName", codeField.getEnumName());
|
||||
String upperUnderscoreEnum = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codeField.getEnumName());
|
||||
objectMap.put("frontEnumName", upperUnderscoreEnum);
|
||||
frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';");
|
||||
}
|
||||
|
||||
@ -77,6 +78,12 @@ public class ListVariableService extends CodeGenerateBaseVariableService {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 是否存在枚举
|
||||
if (SmartStringUtil.isNotBlank(codeField.getEnumName())) {
|
||||
String upperUnderscoreEnum = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codeField.getEnumName());
|
||||
objectMap.put("frontEnumPlugin", "$smartEnumPlugin.getDescByValue('" + upperUnderscoreEnum + "', text)");
|
||||
}
|
||||
|
||||
// 是否存在字典
|
||||
if (SmartStringUtil.isNotBlank(codeField.getDict())) {
|
||||
objectMap.put("dict", codeField.getDict());
|
||||
|
@ -18,7 +18,7 @@ public class ${name.upperCamel}Entity {
|
||||
#foreach ($field in $fields)
|
||||
|
||||
/**
|
||||
* $field.label
|
||||
* $field.columnComment
|
||||
*/
|
||||
#if($field.primaryKeyFlag && $field.autoIncreaseFlag)
|
||||
@TableId(type = IdType.AUTO)
|
||||
|
@ -89,6 +89,7 @@
|
||||
<!---------- 表格 begin ----------->
|
||||
<a-table
|
||||
size="small"
|
||||
:scroll="{ y: 800 }"
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="$!{primaryKeyFieldName}"
|
||||
@ -108,6 +109,13 @@
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.frontEnumPlugin)
|
||||
<template v-if="column.dataIndex === '$!{field.fieldName}'">
|
||||
<span>{{ $!{field.frontEnumPlugin} }}</span>
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.dict)
|
||||
<template v-if="column.dataIndex === '$!{field.fieldName}'">
|
||||
|
Loading…
Reference in New Issue
Block a user