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 (
|
||||
|
||||
Reference in New Issue
Block a user