优化
This commit is contained in:
@@ -53,20 +53,17 @@ describe('adminNavigation', () => {
|
||||
expect(adminNavigation.find((item) => item.key === 'general')?.children?.map((item) => item.title)).toEqual([
|
||||
'产品信息',
|
||||
'费用项目',
|
||||
'FBA编码地址',
|
||||
'仓库管理',
|
||||
'船期价格表',
|
||||
'车辆列表',
|
||||
'仓库管理',
|
||||
'头程订单',
|
||||
'头程计费',
|
||||
'下载中心',
|
||||
'菜单权限',
|
||||
])
|
||||
expect(adminNavigation.find((item) => item.key === 'system')?.children?.map((item) => item.title)).toEqual([
|
||||
'用户管理',
|
||||
'角色权限',
|
||||
'租户管理',
|
||||
'品牌设置',
|
||||
'菜单权限',
|
||||
])
|
||||
})
|
||||
|
||||
@@ -76,8 +73,8 @@ describe('adminNavigation', () => {
|
||||
const permissions = leaves.flatMap((item) => item.permission ? [item.permission] : [])
|
||||
|
||||
expect(paths).toContain('/dashboard')
|
||||
expect(paths).toContain('/orders/first-leg')
|
||||
expect(paths).toContain('/first-leg-pricing/customer-rules')
|
||||
expect(paths).not.toContain('/orders/first-leg')
|
||||
expect(paths).not.toContain('/first-leg-pricing/customer-rules')
|
||||
expect(paths).toContain('/downloads')
|
||||
expect(paths).toContain('/prototype/finance/profit-report')
|
||||
expect(paths).toContain('/prototype/system-management/brand-settings')
|
||||
@@ -95,9 +92,9 @@ describe('adminNavigation', () => {
|
||||
expect(paths).toContain('/system/permissions')
|
||||
expect(paths).not.toContain('/prototype/finance/profit-report')
|
||||
expect(paths).not.toContain('/customers')
|
||||
expect(filtered.map((item) => item.title)).toEqual(['通用'])
|
||||
expect(filtered.map((item) => item.title)).toEqual(['首页数据看板', '系统管理'])
|
||||
expect(filtered).not.toBe(adminNavigation)
|
||||
expect(filtered[0]).not.toBe(adminNavigation.find((item) => item.key === 'general'))
|
||||
expect(filtered[0]).not.toBe(adminNavigation.find((item) => item.key === 'system'))
|
||||
expect(JSON.stringify(adminNavigation, (key, value) => key === 'icon' ? '[icon]' : value)).toBe(sourceSnapshot)
|
||||
})
|
||||
|
||||
@@ -110,14 +107,15 @@ describe('adminNavigation', () => {
|
||||
]))
|
||||
const paths = getNavigationLeaves(filtered).map((item) => item.path)
|
||||
|
||||
expect(filtered.map((item) => item.title)).toEqual(['国内仓', '供应商中心', '通用'])
|
||||
expect(filtered.map((item) => item.title)).toEqual(['首页数据看板', '国内仓', '供应商中心', '通用'])
|
||||
expect(paths).toEqual([
|
||||
'/dashboard',
|
||||
'/inbounds',
|
||||
'/master-data/express-companies',
|
||||
'/master-data/counterparties',
|
||||
'/warehouses',
|
||||
])
|
||||
expect(paths).not.toContain('/dashboard')
|
||||
expect(paths).toContain('/dashboard')
|
||||
expect(paths).not.toContain('/orders/first-leg')
|
||||
expect(paths).not.toContain('/prototype/finance/profit-report')
|
||||
})
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Component } from 'vue'
|
||||
import {
|
||||
Building2,
|
||||
BarChart3,
|
||||
ContactRound,
|
||||
ClipboardList,
|
||||
CircleDollarSign,
|
||||
@@ -35,7 +36,7 @@ export interface AdminNavigationLeaf extends AdminNavigationNode {
|
||||
}
|
||||
|
||||
export const adminNavigation: AdminNavigationNode[] = [
|
||||
{ key: 'dashboard', title: '首页数据看板', icon: ClipboardList, path: '/dashboard', hidden: true },
|
||||
{ key: 'dashboard', title: '首页数据看板', icon: BarChart3, path: '/dashboard' },
|
||||
{
|
||||
key: 'customers',
|
||||
title: '客户管理',
|
||||
@@ -159,22 +160,12 @@ export const adminNavigation: AdminNavigationNode[] = [
|
||||
icon: Database,
|
||||
iconColor: '#722ed1',
|
||||
children: [
|
||||
// { key: 'general-fba', title: 'FBA编码地址', icon: Database, path: '/prototype/general/fba-address', hidden: true },
|
||||
// { key: 'general-voyage', title: '船期价格表', icon: Database, path: '/prototype/general/voyage-price-list', hidden: true },
|
||||
// { key: 'first-leg-orders', title: '头程订单', icon: ClipboardList, path: '/orders/first-leg', permission: 'platform:order:list', hidden: true },
|
||||
// {
|
||||
// key: 'first-leg-pricing',
|
||||
// title: '头程计费',
|
||||
// icon: CircleDollarSign,
|
||||
// children: [
|
||||
// { key: 'fba-customer-rules', title: '客户计费规则', icon: Database, path: '/first-leg-pricing/customer-rules', permission: 'firstleg:fba-pricing:rule:view' },
|
||||
// ],
|
||||
// },
|
||||
{ key: 'general-product', title: '产品信息', icon: Database, path: '/prototype/general/product-information', hidden: false },
|
||||
{ key: 'general-fee', title: '费用项目', icon: Database, path: '/prototype/general/fee-items', hidden: false },
|
||||
{ key: 'general-product', title: '产品信息', icon: Database, path: '/prototype/general/product-information', hidden: true },
|
||||
{ key: 'general-fee', title: '费用项目', icon: Database, path: '/prototype/general/fee-items', hidden: true },
|
||||
{ key: 'warehouses', title: '仓库管理', icon: WarehouseIcon, path: '/warehouses', permission: 'platform:warehouse:list' },
|
||||
{ key: 'fba-carrier-rates', title: '船期价格表', icon: CircleDollarSign, path: '/first-leg-pricing/carrier-rates', permission: 'firstleg:fba-pricing:rate:view' },
|
||||
{ key: 'vehicle-list', title: '车辆列表', icon: Truck, path: '/prototype/vehicle-management/vehicle-list', hidden: false },
|
||||
{ key: 'vehicle-list', title: '车辆列表', icon: Truck, path: '/prototype/vehicle-management/vehicle-list', hidden: true },
|
||||
{ key: 'download-center', title: '下载中心', icon: Download, path: '/downloads', permission: 'platform:download:list' },
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user