Commit 856b02ac authored by alwayOnlie's avatar alwayOnlie

修改三级路由

parent bd978386
......@@ -92,10 +92,10 @@ const router = [
path: '/',
component: '@/layouts/index',
routes: [
{
path: '/',
redirect: '/home'
},
// {
// path: '/',
// redirect: '/home'
// },
// {
// path: '/pageCustomized/mobile/template/category',
// name: '品类导航页装修',
......
......@@ -36,7 +36,7 @@ const Attribute: React.FC<{}> = () => {
dataIndex: 'name',
key: 'name',
render: (text: any, record: any) => <EyePreview
url={`/classAndProperty/attribute/detail?id=${record.id}&preview=1`}
url={`/rootcommodity/classAndProperty/attribute/detail?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
......@@ -93,10 +93,10 @@ const Attribute: React.FC<{}> = () => {
];
const confirm = (record: any) => {
PublicApi.postProductPlatformUpdateAttributeStatus({id: record.id, isEnable: !record.isEnable}).then(res=>{
if(res.code===43018){
PublicApi.postProductPlatformUpdateAttributeStatus({ id: record.id, isEnable: !record.isEnable }).then(res => {
if (res.code === 43018) {
message.error(res.message)
}else{
} else {
ref.current.reload()
}
})
......@@ -104,13 +104,13 @@ const Attribute: React.FC<{}> = () => {
const clickDelete = (record: any) => {
PublicApi.postProductPlatformDeleteAttribute({ id: record.id }).then(res=>{
PublicApi.postProductPlatformDeleteAttribute({ id: record.id }).then(res => {
ref.current.reload()
})
}
const handleEdit = (record: any) => {
history.push(`/classAndProperty/attribute/edit?id=${record.id}`)
history.push(`/rootcommodity/classAndProperty/attribute/edit?id=${record.id}`)
}
const cancel = () => {
......@@ -124,7 +124,7 @@ const Attribute: React.FC<{}> = () => {
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
pagination={{showQuickJumper: true}}
pagination={{ showQuickJumper: true }}
formilyLayouts={{
justify: 'space-between'
}}
......@@ -165,7 +165,7 @@ const Attribute: React.FC<{}> = () => {
},
children: (
<>
<Button type="primary" icon={<PlusOutlined />} onClick={() => { history.push('/classAndProperty/attribute/add') }}>
<Button type="primary" icon={<PlusOutlined />} onClick={() => { history.push('/rootcommodity/classAndProperty/attribute/add') }}>
新建
</Button>
</>
......
......@@ -62,7 +62,7 @@ const CategoryAttributes: React.FC<{}> = () => {
const fetchLinkAttributeData = (params: any) => {
console.log(params, 'params')
return new Promise((resolve, reject) => {
PublicApi.getProductPlatformGetCategoryAttributeList({...params, categoryId: selectKey, name: params.name || '', isByCategory: true}).then(res=>{
PublicApi.getProductPlatformGetCategoryAttributeList({ ...params, categoryId: selectKey, name: params.name || '', isByCategory: true }).then(res => {
resolve(res.data)
setLinkTableRowData(res.data.data)
})
......@@ -72,21 +72,21 @@ const CategoryAttributes: React.FC<{}> = () => {
// 获取所有属性列表 modal
const fetchAttributeData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getProductPlatformGetCategoryAttributeList({...params, categoryId: selectKey, name: params.name || '', isByCategory: false}).then(res=>{
PublicApi.getProductPlatformGetCategoryAttributeList({ ...params, categoryId: selectKey, name: params.name || '', isByCategory: false }).then(res => {
resolve(res.data)
})
})
}
const handleSee = (record: any) => {
history.push(`/classAndProperty/categoryAttributes/viewAttributes?id=${record.id}`)
history.push(`/rootcommodity/classAndProperty/categoryAttributes/viewAttributes?id=${record.id}`)
console.log(record)
}
const handleSelectOk = () => {
setRoleVisible(false)
PublicApi.postProductPlatformSaveCategoryAttribute({ categoryId: selectKey, attributeIds: attributeRowCtl.selectedRowKeys }).then(res=>{
if(res.code === 1000)
PublicApi.postProductPlatformSaveCategoryAttribute({ categoryId: selectKey, attributeIds: attributeRowCtl.selectedRowKeys }).then(res => {
if (res.code === 1000)
setTimeout(() => ref.current.reload(), 500)
})
}
......@@ -149,7 +149,7 @@ const CategoryAttributes: React.FC<{}> = () => {
<>
<Popconfirm
title="是否解除关联?"
onConfirm={()=>clickRelief(record.id)}
onConfirm={() => clickRelief(record.id)}
okText="是"
cancelText="否"
>
......@@ -202,7 +202,7 @@ const CategoryAttributes: React.FC<{}> = () => {
]
const clickRelief = (paramsId: number) => {
PublicApi.postProductPlatformDeleteCategoryAttribute({ categoryId: currentCategoryRef.current, attributeIds: [paramsId] }).then(res=>{
PublicApi.postProductPlatformDeleteCategoryAttribute({ categoryId: currentCategoryRef.current, attributeIds: [paramsId] }).then(res => {
ref.current.reload()
})
}
......@@ -232,7 +232,7 @@ const CategoryAttributes: React.FC<{}> = () => {
{
treeData && treeData.length > 0
? <TabTree
fetchData = {params => fetchCategoryTreeData(params)}
fetchData={params => fetchCategoryTreeData(params)}
treeData={treeData}
handleSelect={(key, node) => onHandleSelect(key, node)}
customKey="id"
......@@ -279,7 +279,7 @@ const CategoryAttributes: React.FC<{}> = () => {
},
children: (
<>
<Button type="primary" icon={<PlusOutlined />} onClick={handleNewLink} style={{marginBottom: 24}}>
<Button type="primary" icon={<PlusOutlined />} onClick={handleNewLink} style={{ marginBottom: 24 }}>
新建
</Button>
</>
......
......@@ -19,7 +19,7 @@ const formActions = createFormActions()
const treeActions = createTreeActions()
const fetchAttributeTreeData = async (params?) => {
const res = await PublicApi.getProductPlatformGetAttributeTree({filterInput: true})
const res = await PublicApi.getProductPlatformGetAttributeTree({ filterInput: true })
return res
}
......@@ -49,7 +49,7 @@ const PropertyValue: React.FC<{}> = () => {
let prefix = sessionStorage.getItem('beforeKeyPrefix')
let beforeKey: any = history.location.query.attrId
if(beforeKey){ // 展开之前的选择项 拼接含有字母字符串的key
if (beforeKey) { // 展开之前的选择项 拼接含有字母字符串的key
setSelectKey(beforeKey)
let evilKey = `${prefix}_${beforeKey}`
treeActions.setExpandedKeys([evilKey])
......@@ -59,20 +59,20 @@ const PropertyValue: React.FC<{}> = () => {
}
}, [])
useEffect(()=>{
if(selectKey)
useEffect(() => {
if (selectKey)
ref.current.reload()
// ref.current.reload({current: 1, pageSize: 10, name: '', attributeId: selectKey})
}, [selectKey])
const onHandleSelect = (key, node) => {
if (node.children && node.children.length > 0) {
return ;
return;
}
if(key){
if (key) {
let arr = key.split('_');
sessionStorage.setItem('beforeKeyPrefix', arr[0])
setSelectKey(arr[arr.length-1])
setSelectKey(arr[arr.length - 1])
setSelectNode(node)
}
}
......@@ -83,7 +83,7 @@ const PropertyValue: React.FC<{}> = () => {
...params,
name: params.name || '',
attributeId: selectKey
}).then(res=>{
}).then(res => {
const { data } = res
resolve(data)
})
......@@ -91,7 +91,7 @@ const PropertyValue: React.FC<{}> = () => {
}
const handleSee = (record: any) => {
history.push(`/classAndProperty/propertyValue/detail?attrId=${selectKey}&attrName=${selectNode._title}&attrValueId=${record.id}&isSee=true&type=${record.type}`)
history.push(`/rootcommodity/classAndProperty/propertyValue/detail?attrId=${selectKey}&attrName=${selectNode._title}&attrValueId=${record.id}&isSee=true&type=${record.type}`)
}
const columns: ColumnType<any>[] = [
......@@ -166,13 +166,13 @@ const PropertyValue: React.FC<{}> = () => {
];
const confirm = (record: any) => {
PublicApi.postProductPlatformUpdateAttributeValueStatus({id: record.id, isEnable: !record.isEnable}).then(res=>{
PublicApi.postProductPlatformUpdateAttributeValueStatus({ id: record.id, isEnable: !record.isEnable }).then(res => {
ref.current.reload()
})
}
const clickDelete = (record: any) => {
PublicApi.postProductPlatformDeleteAttributeValue({ id: record.id }).then(res=>{
PublicApi.postProductPlatformDeleteAttributeValue({ id: record.id }).then(res => {
ref.current.reload()
})
}
......@@ -189,7 +189,7 @@ const PropertyValue: React.FC<{}> = () => {
{
treeData && treeData.length > 0
? <TabTree
fetchData = {params => fetchAttributeTreeData(params)}
fetchData={params => fetchAttributeTreeData(params)}
treeData={treeData}
actions={treeActions}
handleSelect={(key, node) => onHandleSelect(key, node)}
......@@ -224,7 +224,7 @@ const PropertyValue: React.FC<{}> = () => {
'x-component-props': {
placeholder: '属性值名称',
style: {
marginBottom:24
marginBottom: 24
}
},
'x-component': 'Search'
......@@ -243,9 +243,9 @@ const PropertyValue: React.FC<{}> = () => {
type="primary"
icon={<PlusOutlined />}
onClick={() => {
history.push(`/classAndProperty/propertyValue/add?attrId=${selectKey||history.location.query.attrId}&attrName=${selectNode?._title||history.location.query.attrName}&type=${selectNode?.type||history.location.query.type}`)
history.push(`/classAndProperty/propertyValue/add?attrId=${selectKey || history.location.query.attrId}&attrName=${selectNode?._title || history.location.query.attrName}&type=${selectNode?.type || history.location.query.type}`)
}}
style={{marginBottom: 24}}
style={{ marginBottom: 24 }}
>
新建
</Button>
......
......@@ -32,7 +32,7 @@ const Products: React.FC<{}> = () => {
key: 'name',
className: 'commonPickColor',
render: (text: any, record: any) => <EyePreview
url={`/commodity/products/detail?id=${record.id}`}
url={`/rootcommodity/commodity/productWillCheck/detail?id=${record.id}`}
>
{text}
</EyePreview>
......
......@@ -32,7 +32,7 @@ const Products: React.FC<{}> = () => {
className: 'commonPickColor',
// eslint-disable-next-line react/display-name
render: (text: any, record: any) => <EyePreview
url={`/commodity/products/detail?id=${record.id}`}
url={`/rootcommodity/commodity/products/detail?id=${record.id}`}
>
{text}
</EyePreview>
......@@ -66,12 +66,12 @@ const Products: React.FC<{}> = () => {
title: '产品定价',
dataIndex: 'priceType',
key: 'priceType',
render: (text:any, reocrd:any)=>{
if(text===1)
render: (text: any, reocrd: any) => {
if (text === 1)
return '现货价格'
else if(text===2)
else if (text === 2)
return '价格需要询价'
else if(text===3)
else if (text === 3)
return '积分兑换商品'
},
},
......@@ -79,20 +79,20 @@ const Products: React.FC<{}> = () => {
title: '价格',
dataIndex: 'min',
key: 'min',
render: (text:any, reocrd:any) => {
if(reocrd.priceType === 1){
if(reocrd.max === reocrd.min)
render: (text: any, reocrd: any) => {
if (reocrd.priceType === 1) {
if (reocrd.max === reocrd.min)
return <>{reocrd.min}</>
else
return <>{reocrd.min} ~ ¥{reocrd.max}</>
}
if(reocrd.priceType === 3){
if(reocrd.max === reocrd.min)
if (reocrd.priceType === 3) {
if (reocrd.max === reocrd.min)
return <>{reocrd.min}</>
else
return <>{reocrd.min} ~ {reocrd.max}</>
}
if(reocrd.priceType === 2)
if (reocrd.priceType === 2)
return null
}
},
......@@ -100,7 +100,7 @@ const Products: React.FC<{}> = () => {
title: '申请审核时间',
dataIndex: 'applyTime',
key: 'applyTime',
render: (text:any, record:any)=>text && moment(text).format('YYYY-MM-DD HH:mm:ss'),
render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss'),
defaultSortOrder: 'descend',
sorter: (a, b) => a.applyTime - b.applyTime,
},
......@@ -142,12 +142,12 @@ const Products: React.FC<{}> = () => {
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{rowKey: 'id'}}
tableProps={{ rowKey: 'id' }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values =>ref.current.reload(values)}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
......
......@@ -37,7 +37,7 @@ const Trademark: React.FC<{}> = () => {
key: 'name',
className: 'commonPickColor',
render: (text: any, record: any) => <EyePreview
url={`/trademark/trademarkSearch/detail?id=${record.id}&preview=1`}
url={`/rootcommodity/trademark/trademarkSearch/detail?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
......@@ -94,7 +94,7 @@ const Trademark: React.FC<{}> = () => {
inline: false,
effects: ($, action) => {
$('onFieldValueChange', 'status').subscribe(state => {
ref.current.reload({current:1, pageSize: 10, status: state.value})
ref.current.reload({ current: 1, pageSize: 10, status: state.value })
})
},
schema: {
......@@ -135,9 +135,9 @@ const Trademark: React.FC<{}> = () => {
},
}}
formilyChilds={{
children: ({actions}) => (
children: ({ actions }) => (
<>
<Button onClick={() => handleReset(actions) } style={{marginLeft:16}}>
<Button onClick={() => handleReset(actions)} style={{ marginLeft: 16 }}>
重置
</Button>
</>
......
......@@ -39,7 +39,7 @@ const Trademark: React.FC<{}> = () => {
key: 'name',
className: 'commonPickColor',
render: (text: any, record: any) => <EyePreview
url={`/trademark/trademarkSearch/detail?id=${record.id}&preview=1`}
url={`/rootcommodity/trademark/trademarkWillCheck/detail?id=${record.id}&preview=1`}
>
{text}
</EyePreview>
......@@ -80,7 +80,7 @@ const Trademark: React.FC<{}> = () => {
render: (text: any, record: any) => {
return (
<>
<Button type='link' onClick={()=> history.push(`/trademark/trademarkWillCheck/detail?id=${record.id}`)}>审核</Button>
<Button type='link' onClick={() => history.push(`/trademark/trademarkWillCheck/detail?id=${record.id}`)}>审核</Button>
</>
)
}
......@@ -107,8 +107,8 @@ const Trademark: React.FC<{}> = () => {
ref.current.reload()
})
}
const handleApplyCheck = (record:any) => {
PublicApi.postProductBrandApplyCheckBrand({id: record.id}).then(res=>{
const handleApplyCheck = (record: any) => {
PublicApi.postProductBrandApplyCheckBrand({ id: record.id }).then(res => {
ref.current.reload()
})
}
......
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