270 lines
6.1 KiB
TypeScript
270 lines
6.1 KiB
TypeScript
import { defineConfig } from '@umijs/max';
|
|
import { codeInspectorPlugin } from 'code-inspector-plugin';
|
|
|
|
const isDev = process.env.NODE_ENV === 'development';
|
|
const UMI_APP_API_URL = isDev
|
|
? 'http://localhost:7001'
|
|
: 'https://api.yoone.ca';
|
|
|
|
export default defineConfig({
|
|
hash: true,
|
|
antd: {},
|
|
access: {},
|
|
model: {},
|
|
initialState: {},
|
|
request: {},
|
|
layout: {
|
|
title: 'YOONE',
|
|
},
|
|
define: {
|
|
UMI_APP_API_URL,
|
|
},
|
|
chainWebpack(config) {
|
|
config.plugin('code-inspector-plugin').use(
|
|
codeInspectorPlugin({
|
|
bundler: 'webpack',
|
|
}),
|
|
);
|
|
},
|
|
routes: [
|
|
{ path: '/', redirect: '/home' },
|
|
{ name: '追踪', path: '/track', component: './Track', layout: false },
|
|
{ name: '登录', path: '/login', component: './Login', layout: false },
|
|
{ name: '首页', path: '/home', component: './Home' },
|
|
{
|
|
name: '组织架构',
|
|
path: '/organiza',
|
|
access: 'canSeeOrganiza',
|
|
routes: [
|
|
{
|
|
name: '用户管理',
|
|
path: '/organiza/user',
|
|
component: './Organiza/User',
|
|
},
|
|
],
|
|
},
|
|
|
|
{
|
|
name: '字典管理',
|
|
path: '/dict',
|
|
access: 'canSeeDict',
|
|
routes: [
|
|
{
|
|
name: '字典列表',
|
|
path: '/dict/list',
|
|
component: './Dict/List',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
// 模板管理
|
|
name: '模板管理',
|
|
path: '/template',
|
|
access: 'canSeeDict', // 权限暂用 canSeeDict
|
|
routes: [
|
|
{
|
|
// 模板列表
|
|
name: '模板列表',
|
|
path: '/template/list',
|
|
component: './Template', // 对应 src/pages/Template/index.tsx
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: '地点管理',
|
|
path: '/area',
|
|
access: 'canSeeArea',
|
|
routes: [
|
|
{
|
|
name: '地点列表',
|
|
path: '/area/list',
|
|
component: './Area/List',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: '站点管理',
|
|
path: '/site',
|
|
access: 'canSeeSite',
|
|
routes: [
|
|
{
|
|
name: '站点列表',
|
|
path: '/site/list',
|
|
component: './Site/List',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: '商品管理',
|
|
path: '/product',
|
|
access: 'canSeeProduct',
|
|
routes: [
|
|
{
|
|
name: '产品列表',
|
|
path: '/product/list',
|
|
component: './Product/List',
|
|
},
|
|
{
|
|
name: '产品属性',
|
|
path: '/product/attribute',
|
|
component: './Product/Attribute',
|
|
},
|
|
|
|
{
|
|
name: 'WP商品列表',
|
|
path: '/product/wp_list',
|
|
component: './Product/WpList',
|
|
},
|
|
{
|
|
name: 'WP工具箱',
|
|
path: '/product/wp_tool',
|
|
component: './Product/WpTool',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: '库存管理',
|
|
path: '/stock',
|
|
access: 'canSeeStock',
|
|
routes: [
|
|
{
|
|
name: '库存列表',
|
|
path: '/stock/list',
|
|
component: './Stock/List',
|
|
},
|
|
{
|
|
name: '仓库点',
|
|
path: '/stock/warehouse',
|
|
component: './Stock/Warehouse',
|
|
},
|
|
{
|
|
name: '采购管理',
|
|
path: '/stock/purchaseOrder',
|
|
component: './Stock/PurchaseOrder',
|
|
},
|
|
{
|
|
name: '发货管理',
|
|
path: '/stock/transfer',
|
|
component: './Stock/Transfer',
|
|
},
|
|
{
|
|
name: '库存记录',
|
|
path: '/stock/record',
|
|
component: './Stock/Record',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: '订单管理',
|
|
path: '/order',
|
|
access: 'canSeeOrder',
|
|
routes: [
|
|
{
|
|
name: '订单列表',
|
|
path: '/order/list',
|
|
component: './Order/List',
|
|
},
|
|
{
|
|
name: '待发货产品',
|
|
path: '/order/item',
|
|
component: './Order/PendingItems',
|
|
},
|
|
],
|
|
},
|
|
// 新增:订阅管理路由分组(权限复用 canSeeOrder)
|
|
{
|
|
name: '订阅管理',
|
|
path: '/subscription',
|
|
access: 'canSeeOrder',
|
|
routes: [
|
|
{
|
|
name: '订阅列表',
|
|
path: '/subscription/list',
|
|
component: './Subscription/List',
|
|
},
|
|
{
|
|
name: '订单管理',
|
|
path: '/subscription/orders',
|
|
component: './Subscription/Orders',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: '客户管理',
|
|
path: '/customer',
|
|
access: 'canSeeCustomer',
|
|
routes: [
|
|
{
|
|
name: '客户列表',
|
|
path: '/customer/list',
|
|
component: './Customer/List',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: '物流管理',
|
|
path: '/logistics',
|
|
access: 'canSeeLogistics',
|
|
routes: [
|
|
{
|
|
name: '服务商',
|
|
path: '/logistics/services',
|
|
component: './Logistics/Services',
|
|
},
|
|
{
|
|
name: '地址管理',
|
|
path: '/logistics/address',
|
|
component: './Logistics/Address',
|
|
},
|
|
{
|
|
name: '物流列表',
|
|
path: '/logistics/list',
|
|
component: './Logistics/List',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: '数据统计',
|
|
path: '/statistics',
|
|
access: 'canSeeStatistics',
|
|
routes: [
|
|
{
|
|
name: '销售统计',
|
|
path: '/statistics/sales',
|
|
component: './Statistics/Sales',
|
|
},
|
|
{
|
|
name: '订单统计',
|
|
path: '/statistics/order',
|
|
component: './Statistics/Order',
|
|
},
|
|
{
|
|
name: '订单来源',
|
|
path: '/statistics/orderSource',
|
|
component: './Statistics/OrderSource',
|
|
},
|
|
{
|
|
name: '客户统计',
|
|
path: '/statistics/customer',
|
|
component: './Statistics/Customer',
|
|
},
|
|
{
|
|
name: '库存预测',
|
|
path: '/statistics/inventoryForecast',
|
|
component: './Statistics/InventoryForecast',
|
|
},
|
|
{
|
|
name: '补货',
|
|
path: '/statistics/restocking',
|
|
component: './Statistics/Restocking',
|
|
},
|
|
],
|
|
},
|
|
// {
|
|
// path: '*',
|
|
// component: './404',
|
|
// },
|
|
],
|
|
npmClient: 'pnpm',
|
|
});
|