feat: ✨ 代码生成添加菜单生成
This commit is contained in:
@@ -107,6 +107,9 @@ export interface GenConfigForm {
|
|||||||
/** 作者 */
|
/** 作者 */
|
||||||
author?: string;
|
author?: string;
|
||||||
|
|
||||||
|
/** 上级菜单 */
|
||||||
|
parentMenuId?: number;
|
||||||
|
|
||||||
/** 字段配置列表 */
|
/** 字段配置列表 */
|
||||||
fieldConfigs?: FieldConfig[];
|
fieldConfigs?: FieldConfig[];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
/>
|
/>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||||
|
|
||||||
<el-table-column fixed="right" label="操作" width="150">
|
<el-table-column fixed="right" label="操作" width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="业务名">
|
<el-form-item label="业务名">
|
||||||
<el-input v-model="formData.businessName" />
|
<el-input v-model="formData.businessName" placeholder="用户" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -109,12 +109,15 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="模块名">
|
<el-form-item label="模块名">
|
||||||
<el-input v-model="formData.moduleName" />
|
<el-input v-model="formData.moduleName" placeholder="system" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="包名">
|
<el-form-item label="包名">
|
||||||
<el-input v-model="formData.packageName" />
|
<el-input
|
||||||
|
v-model="formData.packageName"
|
||||||
|
placeholder="com.youlai.boot"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -122,12 +125,27 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="实体名">
|
<el-form-item label="实体名">
|
||||||
<el-input v-model="formData.entityName" />
|
<el-input v-model="formData.entityName" placeholder="User" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="作者">
|
<el-form-item label="作者">
|
||||||
<el-input v-model="formData.author" />
|
<el-input v-model="formData.author" placeholder="youlai" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="父菜单">
|
||||||
|
<el-tree-select
|
||||||
|
v-model="formData.parentMenuId"
|
||||||
|
placeholder="选择父菜单"
|
||||||
|
:data="menuOptions"
|
||||||
|
filterable
|
||||||
|
check-strictly
|
||||||
|
:render-after-expand="false"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -361,6 +379,7 @@ import GeneratorAPI, {
|
|||||||
} from "@/api/generator";
|
} from "@/api/generator";
|
||||||
|
|
||||||
import DictAPI from "@/api/dict";
|
import DictAPI from "@/api/dict";
|
||||||
|
import MenuAPI from "@/api/menu";
|
||||||
|
|
||||||
const queryFormRef = ref(ElForm);
|
const queryFormRef = ref(ElForm);
|
||||||
|
|
||||||
@@ -376,6 +395,7 @@ const formData = ref<GenConfigForm>({});
|
|||||||
const formTypeOptions: Record<string, OptionType> = FormTypeEnum;
|
const formTypeOptions: Record<string, OptionType> = FormTypeEnum;
|
||||||
const queryTypeOptions: Record<string, OptionType> = QueryTypeEnum;
|
const queryTypeOptions: Record<string, OptionType> = QueryTypeEnum;
|
||||||
const dictOptions = ref<OptionType[]>();
|
const dictOptions = ref<OptionType[]>();
|
||||||
|
const menuOptions = ref<OptionType[]>([]);
|
||||||
|
|
||||||
const dialog = reactive({
|
const dialog = reactive({
|
||||||
visible: false,
|
visible: false,
|
||||||
@@ -463,9 +483,11 @@ function handleResetQuery() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
function handleOpenDialog(tableName: string) {
|
async function handleOpenDialog(tableName: string) {
|
||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
|
|
||||||
|
menuOptions.value = await MenuAPI.getOptions();
|
||||||
|
|
||||||
// 获取字典数据
|
// 获取字典数据
|
||||||
DictAPI.getList().then((data) => {
|
DictAPI.getList().then((data) => {
|
||||||
dictOptions.value = data;
|
dictOptions.value = data;
|
||||||
@@ -494,6 +516,7 @@ function handleResetConfig(tableName: string) {
|
|||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
GeneratorAPI.resetGenConfig(tableName).then(() => {
|
GeneratorAPI.resetGenConfig(tableName).then(() => {
|
||||||
|
ElMessage.success("重置成功");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user