|
@@ -9,7 +9,7 @@ import { approvalTypeMap } from '../..'
|
|
|
|
|
|
type LeftMenuProps = {
|
|
|
title?: string
|
|
|
- onChange: (key: string, option: { key: string; label: string }) => void
|
|
|
+ onChange?: (key: string, option: { key: string; label: string }) => void
|
|
|
}
|
|
|
|
|
|
export const businessOptions = [
|
|
@@ -30,10 +30,12 @@ const LeftMenu: React.FC<LeftMenuProps> = ({ title = '业务主体列表', onCha
|
|
|
const handleOnSelect = ({ key }) => {
|
|
|
const [value, label] = key.split('_')
|
|
|
const option = {
|
|
|
- key: value,
|
|
|
+ value,
|
|
|
label: approvalTypeMap[label] + '审核'
|
|
|
}
|
|
|
- onChange(key, option)
|
|
|
+ if (onChange) {
|
|
|
+ onChange(key, option)
|
|
|
+ }
|
|
|
}
|
|
|
useRequest(() => querySubjectList({ current: 1, pageSize: 214000 }), {
|
|
|
onSuccess: async result => {
|
|
@@ -44,7 +46,7 @@ const LeftMenu: React.FC<LeftMenuProps> = ({ title = '业务主体列表', onCha
|
|
|
activeKey,
|
|
|
openKeys: [result?.items[0]?.ID]
|
|
|
})
|
|
|
- handleOnSelect({ key: activeKey, selectedKeys: activeKey })
|
|
|
+ handleOnSelect({ key: activeKey })
|
|
|
}
|
|
|
})
|
|
|
const rootSubmenuKeys = state.subjectList.map(item => item.ID)
|