|
@@ -1,4 +1,5 @@
|
|
|
import { Card, Checkbox } from 'antd'
|
|
|
+import { flatMapDeep } from 'lodash'
|
|
|
|
|
|
export enum MatterPerm {
|
|
|
FORM = 'formPermission',
|
|
@@ -24,12 +25,13 @@ type MatterPermissionProps = {
|
|
|
}
|
|
|
|
|
|
const MatterPermission: React.FC<MatterPermissionProps> = ({ defaultValue, toggleMatter, matterList }) => {
|
|
|
+ const matterFlattenList = flatMapDeep(matterList, item => [item, ...item.children])
|
|
|
return defaultValue.map(matter => (
|
|
|
<Card
|
|
|
key={matter.matterID}
|
|
|
size="small"
|
|
|
className="mb-2"
|
|
|
- title={matterList.find(item => item.ID === matter.matterID)?.name}>
|
|
|
+ title={matterFlattenList.find(item => item.ID === matter.matterID)?.name}>
|
|
|
{[MatterPerm.COST, MatterPerm.FORM, MatterPerm.PROFILE].map(item => (
|
|
|
<div key={item} className="flex justify-between items-center my-1">
|
|
|
<div className="flex-1">{matterPermMap[item]}</div>
|