Feat: Jump from the chunk page to the dataset page #3221 (#4961)

### What problem does this PR solve?
Feat: Jump from the chunk page to the dataset page #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-02-14 13:30:55 +08:00
committed by GitHub
parent 986062a604
commit 26add87c3d
7 changed files with 111 additions and 4 deletions

View File

@ -0,0 +1,3 @@
export default function ChunkResult() {
return <div>ChunkResult</div>;
}

View File

@ -0,0 +1,21 @@
import { PageHeader } from '@/components/page-header';
import {
QueryStringMap,
useNavigatePage,
} from '@/hooks/logic-hooks/navigate-hooks';
import { Outlet } from 'umi';
export default function ChunkPage() {
const { navigateToDataset, getQueryString } = useNavigatePage();
return (
<section>
<PageHeader
title="Editing block"
back={navigateToDataset(
getQueryString(QueryStringMap.KnowledgeId) as string,
)}
></PageHeader>
<Outlet />
</section>
);
}

View File

@ -0,0 +1,3 @@
export default function ParsedResult() {
return <div>ParsedResult</div>;
}

View File

@ -0,0 +1,3 @@
export default function ResultView() {
return <div>ResultView</div>;
}

View File

@ -15,8 +15,10 @@ import {
TooltipContent,
TooltipTrigger,
} from '@/components/ui/tooltip';
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
import { IDocumentInfo } from '@/interfaces/database/document';
import { cn } from '@/lib/utils';
import { formatDate } from '@/utils/date';
import { getExtension } from '@/utils/document-util';
import { ColumnDef } from '@tanstack/table-core';
import { ArrowUpDown, MoreHorizontal, Pencil, Wrench } from 'lucide-react';
@ -54,6 +56,8 @@ export function useDatasetTableColumns({
// showSetMetaModal();
// }, [setRecord, showSetMetaModal]);
const { navigateToChunkParsedResult } = useNavigatePage();
const columns: ColumnDef<IDocumentInfo>[] = [
{
id: 'select',
@ -93,12 +97,17 @@ export function useDatasetTableColumns({
meta: { cellClassName: 'max-w-[20vw]' },
cell: ({ row }) => {
const name: string = row.getValue('name');
// return <div className="capitalize">{row.getValue('name')}</div>;
return (
<Tooltip>
<TooltipTrigger asChild>
<div className="flex gap-2">
<div
className="flex gap-2 cursor-pointer"
onClick={navigateToChunkParsedResult(
row.original.id,
row.original.kb_id,
)}
>
<SvgIcon
name={`file-icon/${getExtension(name)}`}
width={24}
@ -127,7 +136,9 @@ export function useDatasetTableColumns({
);
},
cell: ({ row }) => (
<div className="lowercase">{row.getValue('create_time')}</div>
<div className="lowercase">
{formatDate(row.getValue('create_time'))}
</div>
),
},
{