Commit 70c987ab authored by XieZhiXiong's avatar XieZhiXiong

调整路由

parent 408bd4ff
......@@ -4,51 +4,90 @@
* @Date: 2020-07-10 11:36:32
* @Last Modified by: ghua
* @Last Modified time: 2020-07-18 11:19:36
* @Description: 商品能力路由相关
*/
import { RouterChild } from '../utils';
const CommodityRoute = {
const CommodityRoute: RouterChild = {
path: '/memberCenter/commodityAbility',
name: 'commodityAbility',
key: 'commodityAbility',
icon: 'smile',
routes: [
// 品类及属性
{
path: '/memberCenter/commodityAbility/classAndProperty',
name: 'classAndProperty',
key: 'classAndProperty',
routes: [
// 品类
{
path: '/memberCenter/commodityAbility/classAndProperty/class',
name: 'class',
icon: 'smile',
component: '@/pages/classAndProperty/class',
},
// 属性
{
path: '/memberCenter/commodityAbility/classAndProperty/attribute',
name: 'attribute',
icon: 'smile',
component: '@/pages/classAndProperty/attribute',
},
// 属性-新增
{
path: '/memberCenter/commodityAbility/classAndProperty/attribute/addAttribute',
path: '/memberCenter/commodityAbility/classAndProperty/attribute/add',
name: 'addAttribute',
icon: 'smile',
component: '@/pages/classAndProperty/attribute/addAttribute',
hideInMenu: true,
},
// 属性-编辑
{
path: '/memberCenter/commodityAbility/classAndProperty/attribute/edit',
name: 'editAttribute',
icon: 'smile',
component: '@/pages/classAndProperty/attribute/addAttribute',
hideInMenu: true,
},
// 属性-详情
{
path: '/memberCenter/commodityAbility/classAndProperty/attribute/detail',
name: 'attributeDetail',
icon: 'smile',
component: '@/pages/classAndProperty/attribute/addAttribute',
hideInMenu: true,
},
// 属性值
{
path: '/memberCenter/commodityAbility/classAndProperty/propertyValue',
name: 'propertyValue',
icon: 'smile',
component: '@/pages/classAndProperty/propertyValue',
},
// 属性值-新增
{
path: '/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue',
path: '/memberCenter/commodityAbility/classAndProperty/propertyValue/add',
name: 'addPropertyValue',
icon: 'smile',
component: '@/pages/classAndProperty/propertyValue/addPropertyValue',
hideInMenu: true,
},
// 属性值-编辑
{
path: '/memberCenter/commodityAbility/classAndProperty/propertyValue/edit',
name: 'editPropertyValue',
icon: 'smile',
component: '@/pages/classAndProperty/propertyValue/addPropertyValue',
hideInMenu: true,
},
// 属性值-详情
{
path: '/memberCenter/commodityAbility/classAndProperty/propertyValue/detail',
name: 'propertyValueDetail',
icon: 'smile',
component: '@/pages/classAndProperty/propertyValue/addPropertyValue',
hideInMenu: true,
},
// 关联品类属性
{
path: '/memberCenter/commodityAbility/classAndProperty/categoryAttributes',
name: 'categoryAttributes',
......@@ -64,33 +103,49 @@ const CommodityRoute = {
},
]
},
// 品牌
{
path: '/memberCenter/commodityAbility/trademark',
name: 'trademark',
// key: 'trademark',
icon: 'smile',
component: '@/pages/trademark',
},
// 品牌-新增
{
path: '/memberCenter/commodityAbility/trademark/addBrand',
name: 'addBrand',
key: 'addBrand',
icon: 'smile',
hideInMenu: true,
component: '@/pages/trademark/addBrand',
},
// 品牌-新增
{
path: '/memberCenter/commodityAbility/trademark/add',
name: 'addBrand',
icon: 'smile',
hideInMenu: true,
component: '@/pages/trademark/addBrand',
},
// 品牌-编辑
{
path: '/memberCenter/commodityAbility/trademark/edit',
name: 'editBrand',
icon: 'smile',
hideInMenu: true,
component: '@/pages/trademark/addBrand',
},
// 品牌-查看
{
path: '/memberCenter/commodityAbility/trademark/viewBrand',
name: 'viewBrand',
key: 'viewBrand',
path: '/memberCenter/commodityAbility/trademark/detail',
name: 'brandDetail',
hideInMenu: true,
icon: 'smile',
component: '@/pages/trademark/viewBrand',
},
// 商品
{
path: '/memberCenter/commodityAbility/commodity',
name: 'commodity',
key: 'commodity',
icon: 'smile',
routes: [
{
......@@ -172,7 +227,6 @@ const CommodityRoute = {
{
path: '/memberCenter/commodityAbility/repositories/addRepository',
name: 'addRepository',
key: 'addRepository',
icon: 'smile',
hideInMenu: true,
component: './repositories/addRepository',
......@@ -180,7 +234,6 @@ const CommodityRoute = {
{
path: '/memberCenter/commodityAbility/repositories/adjustRepository',
name: 'adjustRepository',
key: 'adjustRepository',
icon: 'smile',
hideInMenu: true,
component: './repositories/adjustRepository',
......
......@@ -45,13 +45,18 @@ export default {
'menu.commodityAbility.classAndProperty.class': '品类',
'menu.commodityAbility.classAndProperty.attribute': '属性',
'menu.commodityAbility.classAndProperty.addAttribute': '新建属性',
'menu.commodityAbility.classAndProperty.editAttribute': '编辑属性',
'menu.commodityAbility.classAndProperty.attributeDetail': '查看属性',
'menu.commodityAbility.classAndProperty.propertyValue': '属性值',
'menu.commodityAbility.classAndProperty.addPropertyValue': '新建属性值',
'menu.commodityAbility.classAndProperty.editPropertyValue': '编辑属性值',
'menu.commodityAbility.classAndProperty.propertyValueDetail': '查看属性值',
'menu.commodityAbility.classAndProperty.categoryAttributes': '关联品类属性',
'menu.commodityAbility.classAndProperty.viewAttributes': '品类属性',
'menu.commodityAbility.trademark': '品牌',
'menu.commodityAbility.addBrand': '新建品牌',
'menu.commodityAbility.viewBrand': '品牌详情',
'menu.commodityAbility.editBrand': '编辑品牌',
'menu.commodityAbility.brandDetail': '查看品牌',
'menu.commodityAbility.commodity': '商品',
'menu.commodityAbility.commodity.goods': '货品',
'menu.commodityAbility.commodity.addGoods': '新建货品',
......
......@@ -96,7 +96,7 @@ const Attribute: React.FC<{}> = () => {
];
const handleSee = (record: any) => {
history.push(`/memberCenter/commodityAbility/classAndProperty/attribute/addAttribute?id=${record.id}&isSee=true`)
history.push(`/memberCenter/commodityAbility/classAndProperty/attribute/detail?id=${record.id}&isSee=true`)
}
const confirm = (record: any) => {
......@@ -115,7 +115,7 @@ const Attribute: React.FC<{}> = () => {
}
const handleEdit = (record: any) => {
history.push(`/memberCenter/commodityAbility/classAndProperty/attribute/addAttribute?id=${record.id}`)
history.push(`/memberCenter/commodityAbility/classAndProperty/attribute/edit?id=${record.id}`)
}
const cancel = () => {
......@@ -169,7 +169,7 @@ const Attribute: React.FC<{}> = () => {
},
children: (
<>
<Button type="primary" icon={<PlusOutlined />} onClick={() => { history.push('/memberCenter/commodityAbility/classAndProperty/attribute/addAttribute') }}>
<Button type="primary" icon={<PlusOutlined />} onClick={() => { history.push('/memberCenter/commodityAbility/classAndProperty/attribute/add') }}>
新建
</Button>
</>
......
......@@ -95,7 +95,7 @@ const PropertyValue: React.FC<{}> = () => {
}
const handleSee = (record: any) => {
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue?attrId=${selectKey}&attrName=${record.customerAttribute.name}&attrValueId=${record.id}&isSee=true&type=${record.type}`)
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/detail?attrId=${selectKey}&attrName=${record.customerAttribute.name}&attrValueId=${record.id}&isSee=true&type=${record.type}`)
}
const columns: ColumnType<any>[] = [
......@@ -148,7 +148,7 @@ const PropertyValue: React.FC<{}> = () => {
record.isEnable ? '' : <>
<Button
type='link'
onClick={() => history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue?attrId=${selectKey}&attrName=${record.customerAttribute.name}&attrValueId=${record.id}`)}
onClick={() => history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/edit?attrId=${selectKey}&attrName=${record.customerAttribute.name}&attrValueId=${record.id}`)}
>
编辑
</Button>
......@@ -243,7 +243,7 @@ const PropertyValue: React.FC<{}> = () => {
type="primary"
icon={<PlusOutlined />}
onClick={() => {
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/addPropertyValue?attrId=${selectKey||history.location.query.attrId}&attrName=${selectNode?._title||history.location.query.attrName}&type=${selectNode?.type||history.location.query.type}`)
history.push(`/memberCenter/commodityAbility/classAndProperty/propertyValue/add?attrId=${selectKey||history.location.query.attrId}&attrName=${selectNode?._title||history.location.query.attrName}&type=${selectNode?.type||history.location.query.type}`)
}}
>
新建
......
......@@ -106,7 +106,7 @@ const Trademark: React.FC<{}> = () => {
<Dropdown overlay={
<Menu>
<Menu.Item>
<Button type='link' onClick={()=>history.push(`/memberCenter/commodityAbility/trademark/addBrand?id=${record.id}`)}>修改</Button>
<Button type='link' onClick={()=>history.push(`/memberCenter/commodityAbility/trademark/edit?id=${record.id}`)}>修改</Button>
</Menu.Item>
<Menu.Item>
{record.status === 1 ? <Button type='link' onClick={()=>handleApplyCheck(record)}>提交审核</Button> : ''}
......@@ -127,7 +127,7 @@ const Trademark: React.FC<{}> = () => {
const handleSee = (record: any) => {
// console.log('see')
history.push(`/memberCenter/commodityAbility/trademark/viewBrand?id=${record.id}`)
history.push(`/memberCenter/commodityAbility/trademark/detail?id=${record.id}`)
}
const confirm = (record: any) => {
......@@ -219,7 +219,7 @@ const Trademark: React.FC<{}> = () => {
},
children: (
<>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push('/memberCenter/commodityAbility/trademark/addBrand')}>
<Button type="primary" icon={<PlusOutlined />} onClick={() => history.push('/memberCenter/commodityAbility/trademark/add')}>
新建
</Button>
</>
......
......@@ -150,7 +150,7 @@ const viewBrand: React.FC<{}> = () => {
icon={<FormOutlined />}
key="1"
type="primary"
onClick={()=>history.push(`/memberCenter/commodityAbility/trademark/addBrand?id=${brandInfo.id}`)}
onClick={()=>history.push(`/memberCenter/commodityAbility/trademark/edit?id=${brandInfo.id}`)}
disabled={!(brandInfo.status===1||brandInfo.status===3)}
style={{display: !(brandInfo.status===1||brandInfo.status===3)?'none':'block'}}
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment