fix: align case-file rule filters with business types
This commit is contained in:
@@ -136,13 +136,14 @@ export function Layout({ children, userRole = 'developer' as UserRole, frontendJ
|
||||
const isRulesTestTopbarPage = isRulesTestDetail;
|
||||
const rulesTestDetailData = matches.find(match => match.pathname.startsWith('/rulesTest/detail'))?.data as RulesTestDetailData | undefined;
|
||||
const detailPack = rulesTestDetailData?.pack;
|
||||
const detailPackFilterMainType = detailPack?.businessType || detailPack?.mainType || '';
|
||||
const isContractDetail = !!detailPack?.documentType?.includes('合同');
|
||||
const isCaseFileDetail = !!detailPack?.documentType?.includes('案卷');
|
||||
const showFieldNav = isContractDetail && (detailPack?.fields?.length || 0) > 0;
|
||||
const showSubDocumentNav = isCaseFileDetail && (detailPack?.subDocuments?.length || 0) > 0;
|
||||
const showVisualNav = (detailPack?.visualElements?.length || 0) > 0;
|
||||
const rulesListHref = detailPack?.documentType
|
||||
? `/rulesTest/list?documentType=${encodeURIComponent(detailPack.documentType)}${detailPack.mainType ? `&mainType=${encodeURIComponent(detailPack.mainType)}` : ''}`
|
||||
? `/rulesTest/list?documentType=${encodeURIComponent(detailPack.documentType)}${detailPackFilterMainType ? `&mainType=${encodeURIComponent(detailPackFilterMainType)}` : ''}`
|
||||
: '/rulesTest/list';
|
||||
|
||||
return (
|
||||
|
||||
@@ -344,22 +344,8 @@ export function Sidebar({ onToggle, collapsed, userRole, frontendJWT = '' }: Sid
|
||||
if (isCaseFileModule) {
|
||||
return {
|
||||
...item,
|
||||
children: [
|
||||
{
|
||||
id: 'rules-admin-penalty',
|
||||
title: '行政处罚',
|
||||
path: buildRulesTestListPath('行政处罚'),
|
||||
icon: 'ri-list-check-3',
|
||||
order: 1
|
||||
},
|
||||
{
|
||||
id: 'rules-admin-license',
|
||||
title: '行政许可',
|
||||
path: buildRulesTestListPath('行政许可'),
|
||||
icon: 'ri-list-check-3',
|
||||
order: 2
|
||||
}
|
||||
]
|
||||
path: buildRulesTestListPath(),
|
||||
children: undefined
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user