row.toggleSelected(!!value)}
- aria-label="Select row"
- />
- ),
- enableSorting: false,
- enableHiding: false,
- },
- {
- id: "PatientName",
- accessorKey: "PatientName",
- header: columnsAlias["PatientName"],
- cell: ({ row }) => (
- {row.getValue("PatientName")}
- ),
- },
- {
- id: "PatientAge",
- accessorKey: "PatientAge",
- header: columnsAlias["PatientAge"],
- cell: ({ row }) => (
- {row.getValue("PatientAge")}
- ),
- },
- {
- id: "PatientSex",
- accessorKey: "PatientSex",
- header: columnsAlias["PatientSex"],
- cell: ({ row }) => (
- {row.getValue("PatientSex")}
- ),
- },
- {
- id: "SeriesInstanceUID",
- accessorKey: "SeriesInstanceUID",
- header: columnsAlias["SeriesInstanceUID"],
- cell: ({ row }) => (
- {row.getValue("SeriesInstanceUID")}
- ),
- },
- {
- id: "filePaths",
- accessorKey: "filePaths",
- header: columnsAlias["filePaths"],
- cell: ({ row }) => (
-
- {(row.getValue("filePaths") as string[]).length}
-
- ),
- },
- {
- id: "AcquisitionDate",
- accessorKey: "AcquisitionDate",
- header: ({ column }) => {
- return (
-
- {columnsAlias["AcquisitionDate"]}
-
-
- );
- },
- cell: ({ row }) =>
- row.getValue("AcquisitionDate") && (
-
- {row.getValue("AcquisitionDate")}
-
- ),
- },
-
- {
- id: "createTime",
- accessorKey: "createTime",
- header: ({ column }) => {
- return (
-
- {columnsAlias["createTime"]}
-
-
- );
- },
- cell: ({ row }) =>
- row.getValue("createTime") && (
-
- {dayjs(row.getValue("createTime")).format("YYYYMMDD")}
-
- {timeAgo(row.getValue("createTime"))}
-
-
- ),
- },
- {
- id: "updateTime",
- accessorKey: "updateTime",
- header: ({ column }) => {
- return (
-
- {columnsAlias["updateTime"]}
-
-
- );
- },
- cell: ({ row }) =>
- row.getValue("updateTime") && (
-
- {dayjs(row.getValue("updateTime")).format("YYYYMMDD")}
-
- {timeAgo(row.getValue("updateTime"))}
-
-
- ),
- },
- {
- id: "actions",
- header: "操作",
- enableHiding: false,
- cell: ({ row }) => {
- const payment = row.original;
-
- return (
-
-
-
-
-
- Actions
- navigator.clipboard.writeText(payment.id)}
- >
- Copy payment ID
-
-
- View customer
- View payment details
-
-
- );
- },
- },
-];
-
interface SeriesTableProps {
data: Series[];
}
@@ -265,6 +86,183 @@ export function SeriesTable(props: SeriesTableProps) {
const [rowSelection, setRowSelection] = useState({});
const navigate = useNavigate();
+ const columns: ColumnDef[] = [
+ {
+ id: "select",
+ header: ({ table }) => (
+ table.toggleAllPageRowsSelected(!!value)}
+ aria-label="Select all"
+ />
+ ),
+ cell: ({ row }) => (
+ row.toggleSelected(!!value)}
+ aria-label="Select row"
+ />
+ ),
+ enableSorting: false,
+ enableHiding: false,
+ },
+ {
+ id: "PatientName",
+ accessorKey: "PatientName",
+ header: columnsAlias["PatientName"],
+ cell: ({ row }) => (
+ {row.getValue("PatientName")}
+ ),
+ },
+ {
+ id: "PatientAge",
+ accessorKey: "PatientAge",
+ header: columnsAlias["PatientAge"],
+ cell: ({ row }) => (
+ {row.getValue("PatientAge")}
+ ),
+ },
+ {
+ id: "PatientSex",
+ accessorKey: "PatientSex",
+ header: columnsAlias["PatientSex"],
+ cell: ({ row }) => (
+ {row.getValue("PatientSex")}
+ ),
+ },
+ {
+ id: "SeriesInstanceUID",
+ accessorKey: "SeriesInstanceUID",
+ header: columnsAlias["SeriesInstanceUID"],
+ cell: ({ row }) => (
+ {row.getValue("SeriesInstanceUID")}
+ ),
+ },
+ {
+ id: "filePaths",
+ accessorKey: "filePaths",
+ header: columnsAlias["filePaths"],
+ cell: ({ row }) => (
+
+ {(row.getValue("filePaths") as string[]).length}
+
+ ),
+ },
+ {
+ id: "AcquisitionDate",
+ accessorKey: "AcquisitionDate",
+ header: ({ column }) => {
+ return (
+
+ {columnsAlias["AcquisitionDate"]}
+
+
+ );
+ },
+ cell: ({ row }) =>
+ row.getValue("AcquisitionDate") && (
+
+ {row.getValue("AcquisitionDate")}
+
+ ),
+ },
+
+ {
+ id: "createTime",
+ accessorKey: "createTime",
+ header: ({ column }) => {
+ return (
+
+ {columnsAlias["createTime"]}
+
+
+ );
+ },
+ cell: ({ row }) =>
+ row.getValue("createTime") && (
+
+ {dayjs(row.getValue("createTime")).format("YYYYMMDD")}
+
+ {timeAgo(row.getValue("createTime"))}
+
+
+ ),
+ },
+ {
+ id: "updateTime",
+ accessorKey: "updateTime",
+ header: ({ column }) => {
+ return (
+
+ {columnsAlias["updateTime"]}
+
+
+ );
+ },
+ cell: ({ row }) =>
+ row.getValue("updateTime") && (
+
+ {dayjs(row.getValue("updateTime")).format("YYYYMMDD")}
+
+ {timeAgo(row.getValue("updateTime"))}
+
+
+ ),
+ },
+ {
+ id: "actions",
+ header: "操作",
+ enableHiding: false,
+ cell: ({ row }) => {
+ const dicom = row.original;
+
+ return (
+
+
+
+
+
+ 操作
+ handle2Viewer(dicom)}
+ >阅片
+
+ 移除
+ 重新测量
+
+
+ );
+ },
+ },
+ ];
+
const table = useReactTable({
data: props.data,
columns,
@@ -295,6 +293,11 @@ export function SeriesTable(props: SeriesTableProps) {
navigate("/", { state: { selectDicoms } });
};
+ const handle2Viewer = (dicom) => {
+ const { SeriesInstanceUID } = dicom
+ navigate(`/viewer?SeriesInstanceUID=${SeriesInstanceUID}`)
+ }
+
return (
@@ -387,9 +390,9 @@ export function SeriesTable(props: SeriesTableProps) {
{header.isPlaceholder
? null
: flexRender(
- header.column.columnDef.header,
- header.getContext()
- )}
+ header.column.columnDef.header,
+ header.getContext()
+ )}
);
})}
diff --git a/apps/desktop/src/pages/Viewer/index.tsx b/apps/desktop/src/pages/Viewer/index.tsx
new file mode 100644
index 0000000..3efb8ef
--- /dev/null
+++ b/apps/desktop/src/pages/Viewer/index.tsx
@@ -0,0 +1,12 @@
+import { useLocation } from "react-router-dom"
+
+export const Viewer = () => {
+ const location = useLocation()
+ const queryParams = new URLSearchParams(location.search);
+ const SeriesInstanceUID = queryParams.get('SeriesInstanceUID'); // 获取URL参数
+
+ return
+ {SeriesInstanceUID}
+
找到一个本地dicom的mpr方案
+
+}
\ No newline at end of file