mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### 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:
3
web/src/pages/chunk/chunk-result/index.tsx
Normal file
3
web/src/pages/chunk/chunk-result/index.tsx
Normal file
@ -0,0 +1,3 @@
|
||||
export default function ChunkResult() {
|
||||
return <div>ChunkResult</div>;
|
||||
}
|
||||
21
web/src/pages/chunk/index.tsx
Normal file
21
web/src/pages/chunk/index.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
3
web/src/pages/chunk/parsed-result/index.tsx
Normal file
3
web/src/pages/chunk/parsed-result/index.tsx
Normal file
@ -0,0 +1,3 @@
|
||||
export default function ParsedResult() {
|
||||
return <div>ParsedResult</div>;
|
||||
}
|
||||
3
web/src/pages/chunk/result-view/index.tsx
Normal file
3
web/src/pages/chunk/result-view/index.tsx
Normal file
@ -0,0 +1,3 @@
|
||||
export default function ResultView() {
|
||||
return <div>ResultView</div>;
|
||||
}
|
||||
@ -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>
|
||||
),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user