From 99e5469386fd161100419366dc55b1c91792e88f Mon Sep 17 00:00:00 2001 From: powersir <1576775122@qq.com> Date: Fri, 22 Sep 2023 15:19:31 +0800 Subject: [PATCH] update: rm mock menu --- mock/menu.json | 343 -------------------------- src/layout/index.tsx | 33 +-- src/layout/slide/menus.tsx | 5 +- src/pages/system/menu/index.tsx | 2 +- src/pages/system/menu/menu-editor.tsx | 63 +++-- 5 files changed, 44 insertions(+), 402 deletions(-) delete mode 100644 mock/menu.json diff --git a/mock/menu.json b/mock/menu.json deleted file mode 100644 index d1b78c4..0000000 --- a/mock/menu.json +++ /dev/null @@ -1,343 +0,0 @@ -[ - { - "id": 1100, - "parentId": 0, - "name": "首页", - "icon": "HomeOutlined", - "type":0, - "path": "/dashboard", - "component": "/dashboard/index.tsx", - "keepAlive": false, - "visible":true - }, - { - "id": 1200, - "parentId": 0, - "name": "定制选品", - "icon": "BgColorsOutlined", - "type":0, - "path": "/custom", - "component": "", - "keepAlive": false, - "visible":true - }, - - { - "id": 1210, - "parentId": 1200, - "name": "定制商品", - "icon": "", - "type":2, - "path": "/product", - "component": "", - "orderNumber": 2, - "keepAlive": false, - "visible":true - }, - { - "id": 1211, - "parentId": 1210, - "name": "样机", - "icon": "", - "type":0, - "path": "/sample", - "component": "/custom/product/sample/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1212, - "parentId": 1210, - "name": "素材", - "icon": "", - "type":0, - "path": "/material", - "component": "/custom/product/material/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1213, - "parentId": 1210, - "name": "款式", - "icon": "", - "type":0, - "path": "/shape", - "component": "/custom/product/shape/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1214, - "parentId": 1210, - "name": "成品", - "icon": "", - "type":0, - "path": "/finished", - "component": "/custom/product/finished/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - - - { - "id": 1220, - "parentId": 1200, - "name": "模板配置", - "icon": "", - "type":2, - "path": "/template", - "component": "", - "orderNumber": 2, - "keepAlive": false, - "visible":true - }, - { - "id": 1221, - "parentId": 1220, - "name": "数据字典", - "icon": "", - "type":0, - "path": "/dict", - "component": "/custom/template/dict/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1222, - "parentId": 1220, - "name": "虾皮模板", - "icon": "", - "type":0, - "path": "/xiapi", - "component": "/custom/template/xiapi/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id":1223, - "parentId": 1220, - "name": "规则引擎", - "icon": "", - "type":0, - "path": "/rules", - "component": "/custom/template/rules/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - - - { - "id": 1230, - "parentId": 1200, - "name": "平台商品", - "icon": "", - "type":2, - "path": "/platform-product", - "component": "", - "orderNumber": 2, - "keepAlive": false, - "visible":true - }, - { - "id": 1231, - "parentId": 1230, - "name": "虾皮", - "icon": "", - "type":0, - "path": "/xiapi", - "component": "/custom/platform-product/xiapi/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1232, - "parentId": 1230, - "name": "亚马逊", - "icon": "", - "type":0, - "path": "/amazone", - "component": "/custom/platform-product/amazone/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - - { - "id": 1240, - "parentId": 1200, - "name": "SDS商品", - "icon": "", - "type":2, - "path": "/sds", - "component": "", - "orderNumber": 2, - "keepAlive": false, - "visible":true - }, - { - "id": 1241, - "parentId": 1240, - "name": "成品库", - "icon": "", - "type":0, - "path": "/finished-product-warehouse", - "component": "/custom/sds/finished-product-warehouse/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1242, - "parentId": 1240, - "name": "款式", - "icon": "", - "type":0, - "path": "/sds-shape", - "component": "/custom/sds/sds-shape/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1243, - "parentId": 1240, - "name": "图案素材", - "icon": "", - "type":0, - "path": "/pattern-material", - "component": "/custom/sds/pattern-material/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - - - { - "id": 1300, - "parentId": 0, - "name": "AI应用", - "icon": "HighlightOutlined", - "type":0, - "path": "/ai", - "component": "", - "keepAlive": false, - "visible":true - }, - { - "id": 1310, - "parentId": 1300, - "name": "AI 作图", - "icon": "", - "type":0, - "path": "/makeup", - "component": "/ai/makeup/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id":1320, - "parentId": 1300, - "name": "AI 画背景", - "icon": "", - "type":0, - "path": "/background", - "component": "/ai/background/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1330, - "parentId": 1300, - "name": "图片裂变", - "icon": "", - "type":0, - "path": "/fission", - "component": "/ai/fission/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1340, - "parentId": 1300, - "name": "轮廓出图", - "icon": "", - "type":0, - "path": "/outline", - "component": "/ai/outline/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1350, - "parentId": 1300, - "name": "一键白底", - "icon": "", - "type":0, - "path": "/white-background", - "component": "/ai/white-background/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1360, - "parentId": 1300, - "name": "AI P图", - "icon": "", - "type":0, - "path": "/ps", - "component": "/ai/ps/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1370, - "parentId": 1300, - "name": "AI 试装", - "icon": "", - "type":0, - "path": "/try", - "component": "/ai/try/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1380, - "parentId": 1300, - "name": "AI 作图2", - "icon": "", - "type":0, - "path": "/makeup2", - "component": "/ai/makeup2/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - }, - { - "id": 1390, - "parentId": 1300, - "name": "旺嘉智库", - "icon": "", - "type":0, - "path": "/smart-libs", - "component": "/ai/smart-libs/index.tsx", - "orderNumber": 3, - "keepAlive": false, - "visible":true - } -] diff --git a/src/layout/index.tsx b/src/layout/index.tsx index ab9378c..d04b16e 100644 --- a/src/layout/index.tsx +++ b/src/layout/index.tsx @@ -17,7 +17,7 @@ import TabsLayout from './tabs-layout'; import Content from './content'; import userService from '@/request/service/user'; import { useRequest } from "@/hooks/use-request"; -import menuData from '../../mock/menu.json' +// import menuData from '../../mock/menu.json' const BasicLayout: React.FC = () => { @@ -76,25 +76,7 @@ const BasicLayout: React.FC = () => { useEffect(() => { if (!currentUserProfile || !menuList?.data) return; - const menus:Array