From cdac5de56fc925910c6eceb6bd82980b4dc60eef Mon Sep 17 00:00:00 2001
From: ray <1490493387@qq.com>
Date: Thu, 1 Aug 2024 07:56:12 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E7=94=9F=E6=88=90=E6=B7=BB=E5=8A=A0=E8=8F=9C=E5=8D=95=E7=94=9F?=
=?UTF-8?q?=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/generator.ts | 3 +++
src/views/generator/index.vue | 37 ++++++++++++++++++++++++++++-------
2 files changed, 33 insertions(+), 7 deletions(-)
diff --git a/src/api/generator.ts b/src/api/generator.ts
index 1f716a91..2ff8d4d8 100644
--- a/src/api/generator.ts
+++ b/src/api/generator.ts
@@ -107,6 +107,9 @@ export interface GenConfigForm {
/** 作者 */
author?: string;
+ /** 上级菜单 */
+ parentMenuId?: number;
+
/** 字段配置列表 */
fieldConfigs?: FieldConfig[];
}
diff --git a/src/views/generator/index.vue b/src/views/generator/index.vue
index 016b9ab7..e091885f 100644
--- a/src/views/generator/index.vue
+++ b/src/views/generator/index.vue
@@ -45,7 +45,7 @@
/>
-
+
-
+
@@ -109,12 +109,15 @@
-
+
-
+
@@ -122,12 +125,27 @@
-
+
-
+
+
+
+
+
+
+
+
+
@@ -361,6 +379,7 @@ import GeneratorAPI, {
} from "@/api/generator";
import DictAPI from "@/api/dict";
+import MenuAPI from "@/api/menu";
const queryFormRef = ref(ElForm);
@@ -376,6 +395,7 @@ const formData = ref({});
const formTypeOptions: Record = FormTypeEnum;
const queryTypeOptions: Record = QueryTypeEnum;
const dictOptions = ref();
+const menuOptions = ref([]);
const dialog = reactive({
visible: false,
@@ -463,9 +483,11 @@ function handleResetQuery() {
}
/** 打开弹窗 */
-function handleOpenDialog(tableName: string) {
+async function handleOpenDialog(tableName: string) {
dialog.visible = true;
+ menuOptions.value = await MenuAPI.getOptions();
+
// 获取字典数据
DictAPI.getList().then((data) => {
dictOptions.value = data;
@@ -494,6 +516,7 @@ function handleResetConfig(tableName: string) {
type: "warning",
}).then(() => {
GeneratorAPI.resetGenConfig(tableName).then(() => {
+ ElMessage.success("重置成功");
handleQuery();
});
});