update 优化 代码生成 增加多前端模板选择
This commit is contained in:
@@ -6,6 +6,7 @@ export interface TableVO extends BaseEntity {
|
|||||||
tableComment: string;
|
tableComment: string;
|
||||||
className: string;
|
className: string;
|
||||||
tplCategory: string;
|
tplCategory: string;
|
||||||
|
frontendType: string;
|
||||||
packageName: string;
|
packageName: string;
|
||||||
moduleName: string;
|
moduleName: string;
|
||||||
businessName: string;
|
businessName: string;
|
||||||
@@ -80,6 +81,7 @@ export interface DbTableVO {
|
|||||||
tableComment: string;
|
tableComment: string;
|
||||||
className?: any;
|
className?: any;
|
||||||
tplCategory?: any;
|
tplCategory?: any;
|
||||||
|
frontendType?: string;
|
||||||
packageName?: any;
|
packageName?: any;
|
||||||
moduleName?: any;
|
moduleName?: any;
|
||||||
businessName?: any;
|
businessName?: any;
|
||||||
@@ -181,6 +183,7 @@ export interface DbTableForm extends BaseEntity {
|
|||||||
tableComment: string;
|
tableComment: string;
|
||||||
className: string;
|
className: string;
|
||||||
tplCategory: string;
|
tplCategory: string;
|
||||||
|
frontendType: string;
|
||||||
packageName: string;
|
packageName: string;
|
||||||
moduleName: string;
|
moduleName: string;
|
||||||
businessName: string;
|
businessName: string;
|
||||||
|
|||||||
@@ -220,11 +220,13 @@ onMounted(async () => {
|
|||||||
uniqueFields: detail.info.uniqueFields ?? [],
|
uniqueFields: detail.info.uniqueFields ?? [],
|
||||||
enableSort: detail.info.enableSort ?? false,
|
enableSort: detail.info.enableSort ?? false,
|
||||||
sortField: detail.info.sortField ?? '',
|
sortField: detail.info.sortField ?? '',
|
||||||
|
frontendType: detail.info.frontendType ?? 'vue',
|
||||||
treeRootValue: detail.info.treeRootValue ?? '0',
|
treeRootValue: detail.info.treeRootValue ?? '0',
|
||||||
treeAncestorsField: detail.info.treeAncestorsField ?? '',
|
treeAncestorsField: detail.info.treeAncestorsField ?? '',
|
||||||
treeOrderField: detail.info.treeOrderField ?? '',
|
treeOrderField: detail.info.treeOrderField ?? '',
|
||||||
...detail.info
|
...detail.info
|
||||||
};
|
};
|
||||||
|
info.value.frontendType ||= 'vue';
|
||||||
const response = await getDictOptionselect();
|
const response = await getDictOptionselect();
|
||||||
dictOptions.value = response.data;
|
dictOptions.value = response.data;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -82,6 +82,22 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item prop="frontendType">
|
||||||
|
<template #label>
|
||||||
|
前端模板
|
||||||
|
<el-tooltip content="对应后端 resources/vm 下的模板目录,例如 vue、react" placement="top">
|
||||||
|
<el-icon><question-filled /></el-icon>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
<el-radio-group v-model="infoForm.frontendType">
|
||||||
|
<el-radio v-for="item in frontendTypeOptions" :key="item.value" :value="item.value">
|
||||||
|
{{ item.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<h4 class="form-header">增强选项</h4>
|
<h4 class="form-header">增强选项</h4>
|
||||||
@@ -311,6 +327,10 @@ interface MenuOptionsType {
|
|||||||
|
|
||||||
const menuOptions = ref<Array<MenuOptionsType>>([]);
|
const menuOptions = ref<Array<MenuOptionsType>>([]);
|
||||||
const formRef = ref<FormInstance>();
|
const formRef = ref<FormInstance>();
|
||||||
|
const frontendTypeOptions = [
|
||||||
|
{ label: 'Vue', value: 'vue' },
|
||||||
|
{ label: 'React', value: 'react' }
|
||||||
|
];
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
info: propTypes.any.isRequired,
|
info: propTypes.any.isRequired,
|
||||||
@@ -328,6 +348,10 @@ const sortableColumns = computed(() =>
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
tplCategory: [{ required: true, message: '请选择生成模板', trigger: 'blur' }],
|
tplCategory: [{ required: true, message: '请选择生成模板', trigger: 'blur' }],
|
||||||
|
frontendType: [
|
||||||
|
{ required: true, message: '请选择前端模板', trigger: 'change' },
|
||||||
|
{ pattern: /^[A-Za-z0-9_-]+$/, message: '仅支持字母、数字、下划线和中划线', trigger: 'change' }
|
||||||
|
],
|
||||||
packageName: [{ required: true, message: '请输入生成包路径', trigger: 'blur' }],
|
packageName: [{ required: true, message: '请输入生成包路径', trigger: 'blur' }],
|
||||||
moduleName: [{ required: true, message: '请输入生成模块名', trigger: 'blur' }],
|
moduleName: [{ required: true, message: '请输入生成模块名', trigger: 'blur' }],
|
||||||
businessName: [{ required: true, message: '请输入生成业务名', trigger: 'blur' }],
|
businessName: [{ required: true, message: '请输入生成业务名', trigger: 'blur' }],
|
||||||
|
|||||||
Reference in New Issue
Block a user