From 56e2f21d1a8f7eef87f94268d1335d723ccaaa20 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 26 Mar 2023 22:15:45 +0800 Subject: [PATCH] =?UTF-8?q?Vue3=20=E9=87=8D=E6=9E=84=EF=BC=9AREVIEW=20?= =?UTF-8?q?=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/menu/index.ts | 15 +- .../codegen/components/BasicInfoForm.vue | 4 +- src/views/system/menu/MenuForm.vue | 253 +++++++++++++++ src/views/system/menu/form.vue | 297 ------------------ src/views/system/menu/index.vue | 89 +++--- src/views/system/role/index.vue | 4 +- src/views/system/tenantPackage/index.vue | 4 +- 7 files changed, 316 insertions(+), 350 deletions(-) create mode 100644 src/views/system/menu/MenuForm.vue delete mode 100644 src/views/system/menu/form.vue diff --git a/src/api/system/menu/index.ts b/src/api/system/menu/index.ts index 5913972b..13736215 100644 --- a/src/api/system/menu/index.ts +++ b/src/api/system/menu/index.ts @@ -18,18 +18,13 @@ export interface MenuVO { createTime: Date } -export interface MenuPageReqVO { - name?: string - status?: number -} - // 查询菜单(精简)列表 -export const listSimpleMenusApi = () => { +export const getSimpleMenusList = () => { return request.get({ url: '/system/menu/list-all-simple' }) } // 查询菜单列表 -export const getMenuListApi = (params: MenuPageReqVO) => { +export const getMenuList = (params) => { return request.get({ url: '/system/menu/list', params }) } @@ -39,16 +34,16 @@ export const getMenuApi = (id: number) => { } // 新增菜单 -export const createMenuApi = (data: MenuVO) => { +export const createMenu = (data: MenuVO) => { return request.post({ url: '/system/menu/create', data }) } // 修改菜单 -export const updateMenuApi = (data: MenuVO) => { +export const updateMenu = (data: MenuVO) => { return request.put({ url: '/system/menu/update', data }) } // 删除菜单 -export const deleteMenuApi = (id: number) => { +export const deleteMenu = (id: number) => { return request.delete({ url: '/system/menu/delete?id=' + id }) } diff --git a/src/views/infra/codegen/components/BasicInfoForm.vue b/src/views/infra/codegen/components/BasicInfoForm.vue index 2009553f..5ab820a2 100644 --- a/src/views/infra/codegen/components/BasicInfoForm.vue +++ b/src/views/infra/codegen/components/BasicInfoForm.vue @@ -6,7 +6,7 @@ import { useForm } from '@/hooks/web/useForm' import { FormSchema } from '@/types/form' import { CodegenTableVO } from '@/api/infra/codegen/types' import { getIntDictOptions } from '@/utils/dict' -import { listSimpleMenusApi } from '@/api/system/menu' +import { getSimpleMenusList } from '@/api/system/menu' import { handleTree, defaultProps } from '@/utils/tree' import { PropType } from 'vue' @@ -21,7 +21,7 @@ const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_T const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE) const menuOptions = ref([]) // 树形结构 const getTree = async () => { - const res = await listSimpleMenusApi() + const res = await getSimpleMenusList() menuOptions.value = handleTree(res) } diff --git a/src/views/system/menu/MenuForm.vue b/src/views/system/menu/MenuForm.vue new file mode 100644 index 00000000..45bcedfb --- /dev/null +++ b/src/views/system/menu/MenuForm.vue @@ -0,0 +1,253 @@ + + diff --git a/src/views/system/menu/form.vue b/src/views/system/menu/form.vue deleted file mode 100644 index cf1583ec..00000000 --- a/src/views/system/menu/form.vue +++ /dev/null @@ -1,297 +0,0 @@ - - diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 41d1bd67..3baf3148 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -1,49 +1,63 @@ - + + - +