Kaynağa Gözat

update: rm menu hardcode

dev
powersir 1 yıl önce
ebeveyn
işleme
16d34577a6
3 değiştirilmiş dosya ile 20 ekleme ve 238 silme
  1. +2
    -238
      src/layout/slide/menus.tsx
  2. +9
    -0
      src/pages/system/role/index.tsx
  3. +9
    -0
      src/pages/system/user/index.tsx

+ 2
- 238
src/layout/slide/menus.tsx Dosyayı Görüntüle

@@ -7,240 +7,6 @@ import { antdIcons } from '@/assets/antd-icons';
import { Menu as MenuType } from '@/models';
import { useMenusStore } from '@/store/global/menu';

import {
AccountBookOutlined,
AppstoreOutlined,
BarChartOutlined,
BgColorsOutlined,
CustomerServiceOutlined,
DeploymentUnitOutlined,
GlobalOutlined,
HighlightOutlined,
HomeOutlined,
InboxOutlined,
SettingOutlined,
ShopOutlined,
} from '@ant-design/icons';
import type { MenuProps, MenuTheme } from 'antd/es/menu';

type MenuItem = Required<MenuProps>['items'][number];

function getItem(
label: React.ReactNode,
key: React.Key,
icon?: React.ReactNode,
children?: MenuItem[],
type?: 'group',
): MenuItem {
return {
key,
icon,
children,
label,
type
} as MenuItem;
}

const items: MenuItem[] = [
getItem('首页', 'home', <HomeOutlined />),

getItem('定制选品', 'custom-made', <BgColorsOutlined />, [
getItem('定制商品', 'custom-product', null, [
getItem('样机', 'sample'),
getItem('素材', 'material'),
getItem('款式', 'shape'),
getItem('成品', 'finished-product'),
], 'group'),
getItem('模板配置', 'template', null, [
getItem('数据字典', 'dict'),
getItem('虾皮模板', 'xp-template'),
getItem('规则引擎', 'rules')
], 'group'),
getItem('平台商品', 'platform-product', null, [
getItem('虾皮', 'xp'),
getItem('亚马逊', 'amazone'),
], 'group'),
getItem('SDS商品', 'sds', null, [
getItem('成品库', 'finished-product-warehouse'),
getItem('款式', 'sds-shape'),
getItem('图案素材', 'pattern-material'),
], 'group'),
]),

getItem('AI应用', 'ai', <HighlightOutlined />, [
getItem('AI 作图', 'ai-picture'),
getItem('AI 画背景', 'ai-background'),
getItem('图片裂变', 'picture-split'),
getItem('轮廓出图', 'outline-drawing'),
getItem('一键白底', 'white-background'),
getItem('AI P图', 'ai-ps'),
getItem('AI 试装', 'ai-try'),
getItem('AI 作图2', 'ai-makeup'),
getItem('旺嘉智库', 'vogcom-libs'),
]),
getItem('商品', 'product', <AppstoreOutlined />, [
getItem('主库', 'main-db', null, [
getItem('商品列表', 'product-list'),
getItem('类目', 'category'),
getItem('商品属性设置', 'product-attr-settings'),
getItem('关键词组', 'keywords'),
getItem('子属性sku绑定', 'sub-sku-binding'),
getItem('spu商品合成', 'spu-product-compound'),
getItem('海外商品管理', 'overseas-product'),
], 'group'),
getItem('平台库', 'platform-db', null, [
getItem('敦煌商品列表', 'dh-product-list'),
getItem('速卖通商品列表', 'smt-product-list'),
], 'group'),
getItem('子库', 'sub-db', null, [
getItem('敦煌商品列表', 'sub-dh-product-list'),
getItem('速卖通商品列表', 'sub-smt-product-list'),
], 'group'),
]),
getItem('订单', 'order', <ShopOutlined />, [
getItem('订单管理', 'order-manager', null, [
getItem('订单列表', 'order-list'),
getItem('合并包裹', 'merge-package'),
], 'group'),
getItem('订单异常', 'order-exception', null, [
getItem('物流异常', 'logistics-anomalies'),
getItem('同步异常', 'sync-exception'),
getItem('订单同步日志', 'order-sync-logs'),
], 'group'),
getItem('RAM管理', 'ram-manager', null, [
getItem('纠纷订单', 'dispute-order'),
getItem('退款&退货', 'refund-return'),
], 'group'),
]),

getItem('仓库', 'warehouse', <InboxOutlined />, [
getItem('仓库管理', 'warehouse-manage', null, [
getItem('库存列表', 'stock-list'),
getItem('仓库列表', 'warehouse-list'),
getItem('篮子管理', 'box-manager'),
getItem('盘点计划管理', 'inventory-plan')
], 'group'),
getItem('包裹', 'packages', null, [
getItem('包裹列表', 'package-list'),
getItem('重打面单', 're-print'),
getItem('包裹退回清单', 'returned-package-list'),
getItem('包裹扫描换单', 'scan-parcels-exchange-orders'),
getItem('物流汇总报表', 'logistics-summary-report'),
getItem('转单号批量更换', 'batch-replacement-transfer-order-no'),
getItem('包裹换单', 'exchange-pkg'),
getItem('包裹退单', 'return-pkg'),
], 'group'),
getItem('快速出库', 'rapid-exit', null, [
getItem('配货', 'distribution'),
getItem('单sku复核打包', 'sku-review-packaging'),
getItem('多sku复核', 'multi-sku-review'),
getItem('多sku打包', 'multi-sku-packaging'),
getItem('出库', 'export')
], 'group'),
getItem('柔性定制', 'flexible-customization', null, [
getItem('柔性定制', 'customization'),
getItem('一次复核', 'first-review'),
getItem('二次复核', 'second-review'),
getItem('印花', 'printing'),
getItem('扫描入库', 'scan-into-warehouse'),
getItem('异常素材补打', 'abnormal-material-reprinting')
], 'group'),
getItem('入库', 'sub-db', null, [
getItem('签收', 'sign'),
getItem('入库日志管理', 'inbound-log-management')
], 'group'),
]),
getItem('供应链', 'supply-chain', <DeploymentUnitOutlined />, [
getItem('采购流程', 'main-db', null, [
getItem('缺货采购列表', 'out-of-stock-purchase-list'),
getItem('采购管理', 'purchase-management'),
getItem('备货管理', 'stocking-management'),
getItem('待申请付款', 'payment-pending'),
getItem('非常规采购入库', 'unconventional-procurement')
], 'group'),
getItem('退货流程', 'return-process', null, [
getItem('退货单', 'return-form'),
getItem('滞留品列表', 'retained-goods-list'),
], 'group'),
getItem('供应商', 'supplier', null, [
getItem('供应商品列表', 'supply-product-list'),
getItem('供应商商品信息', 'supply-product-information')
], 'group'),
]),

getItem('物流', 'logistics', <GlobalOutlined />, [
getItem('物流管理', 'logistics-management', null, [
getItem('物流管理', 'logistics-management1'),
getItem('物流服务商', 'logistics-server'),
getItem('回邮地址', 'email-address'),
getItem('寄件地址', 'post-address'),
getItem('包材管理', 'package-material-management')
], 'group'),
getItem('物流费用', 'platform-db', null, [
getItem('包裹物流费用', 'package-logistics-fee'),
getItem('物流资费计算', 'logistics-fee-calc'),
getItem('物流运费模板管理', 'logistics-fee-template-management'),
], 'group'),
]),
getItem('客服', 'service', <CustomerServiceOutlined />, [
getItem('客户管理', 'customer-management', null, [
getItem('客户列表', 'customer-list'),
getItem('客户类型列表', 'customer-type-list'),
getItem('推广客户列表', 'promotion-customer-list')
], 'group'),
getItem('客诉任务管理', 'customer-complaint-task-management', null, [
getItem('敦煌客诉管理', 'dh-customer-complaint')
], 'group'),
]),

getItem('财务', 'financial', <AccountBookOutlined />, [
getItem('账户', 'account', null, [
getItem('账户管理', 'account-management'),
getItem('商户充值', 'merchant-recharge'),
getItem('商户流水管理', 'merchant-flow-management'),
], 'group'),
getItem('订单', 'platform-db', null, [
getItem('订单流水', 'order-flow'),
], 'group'),
getItem('供应处理', 'supply-management', null, [
getItem('采购付款', 'purchase-payment'),
getItem('供应商商品信息', 'supplier-product-info'),
getItem('退货单审核', 'return-list-review'),
getItem('备货单审核', 'stocking-list-review')
], 'group'),
]),

getItem('报表', 'report', <BarChartOutlined />, [
getItem('销售报表', 'sale-report', null, [
getItem('收支报表', 'income-report'),
getItem('订单状态报表', 'order-status-report'),
getItem('订单状态报表2', 'order-status-report-2'),
], 'group'),
getItem('物流报表', 'logistics-report', null, [
getItem('质检报表', 'quality-inspection-report'),
getItem('发货报表', 'shipping-report')
], 'group'),
]),

getItem('基础配置', 'settings', <SettingOutlined />, [
getItem('基础配置', 'basic-settings', null, [
getItem('组织权限', 'organization-permissions'),
getItem('图片空间', 'pic-space'),
getItem('平台内部消息', 'platform-message'),
getItem('汇率管理', 'exchange-rate-manager'),
getItem('国家管理', 'country-manager'),
], 'group'),
getItem('商户&店铺', 'retailer', null, [
getItem('商铺管理', 'retailer-manager'),
getItem('商户信息', 'merchant-information'),
getItem('商户等级', 'merchant-level')
], 'group'),
]),
];


const SlideMenu = () => {

const matches = useMatches();
@@ -248,9 +14,7 @@ const SlideMenu = () => {
const [openKeys, setOpenKeys] = useState<string[]>([]);
const [selectKeys, setSelectKeys] = useState<string[]>([]);

const {
collapsed,
} = useGlobalStore();
const { collapsed, } = useGlobalStore();

useEffect(() => {
if (collapsed) {
@@ -285,7 +49,7 @@ const SlideMenu = () => {
const treeMenuData = useCallback((menus: MenuType[]): ItemType[] => {
return (menus).map((menu: MenuType) => {
const children = menu?.children?.filter(menu => menu.visible) || [];
const type = (children.length > 0 && (menu.parentPaths?.length??0 > 0)) ? 'group': ''
const type = ''//(children.length > 0 && (menu.parentPaths?.length??0 > 0)) ? 'group': ''
return {
type: type,
key: menu.path,


+ 9
- 0
src/pages/system/role/index.tsx Dosyayı Görüntüle

@@ -0,0 +1,9 @@
import { Empty } from 'antd';

const CustomMade = () => {
return (
<Empty />
);
};

export default CustomMade;

+ 9
- 0
src/pages/system/user/index.tsx Dosyayı Görüntüle

@@ -0,0 +1,9 @@
import { Empty } from 'antd';

const CustomMade = () => {
return (
<Empty />
);
};

export default CustomMade;

Yükleniyor…
İptal
Kaydet