From 57fd8def590194f8d7a1801db88ec098f5203042 Mon Sep 17 00:00:00 2001 From: mozzie Date: Mon, 2 Sep 2024 15:05:38 +0800 Subject: [PATCH] feat: change zinc theme --- README.md | 9 +++ apps/desktop/electron/main.ts | 2 +- .../src/pages/Datasource/SeriesTable.tsx | 77 +++++++++++++++++-- apps/desktop/src/style/global.css | 68 ++++++++-------- 4 files changed, 114 insertions(+), 42 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ca1b0f1 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# 分析失败处理机制 + +- 分割阶段 +- 测量阶段 + +# 解剖结构 - 模型的关系 1:1 or 1:n + +- 换版本重新测量 +- \ No newline at end of file diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts index 1b6f8e8..fa6d4c0 100644 --- a/apps/desktop/electron/main.ts +++ b/apps/desktop/electron/main.ts @@ -29,7 +29,7 @@ process.env.VITE_PUBLIC = VITE_DEV_SERVER_URL let win: BrowserWindow | null; let tray: Tray | null = null; let pythonManager: PythonManager | null; -const theme: "dark" | "light" = "dark"; +const theme: "dark" | "light" = "light"; const themeTitleBarStyles = { dark: { color: "rgb(32,32,32)", symbolColor: "#fff" }, diff --git a/apps/desktop/src/pages/Datasource/SeriesTable.tsx b/apps/desktop/src/pages/Datasource/SeriesTable.tsx index ea68155..46e22fe 100644 --- a/apps/desktop/src/pages/Datasource/SeriesTable.tsx +++ b/apps/desktop/src/pages/Datasource/SeriesTable.tsx @@ -11,6 +11,7 @@ import { getSortedRowModel, useReactTable, } from "@tanstack/react-table"; +import { ArrowUpDown, ChevronDown, MoreHorizontal } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; @@ -18,6 +19,9 @@ import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; @@ -44,6 +48,16 @@ export type Series = { filePaths: string[]; }; +const columnsAlias: { [K in keyof Partial]: string } = { + PatientName: "姓名", + PatientAge: "年龄", + PatientSex: "性别", + SeriesInstanceUID: "序列UID", + filePaths: "层数", + createTime: "创建时间", + updateTime: "修改时间", +}; + export const columns: ColumnDef[] = [ { id: "select", @@ -68,36 +82,41 @@ export const columns: ColumnDef[] = [ enableHiding: false, }, { + id: "PatientName", accessorKey: "PatientName", - header: "姓名", + header: columnsAlias["PatientName"], cell: ({ row }) => (
{row.getValue("PatientName")}
), }, { + id: "PatientAge", accessorKey: "PatientAge", - header: "年龄", + header: columnsAlias["PatientAge"], cell: ({ row }) => (
{row.getValue("PatientAge")}
), }, { + id: "PatientSex", accessorKey: "PatientSex", - header: "性别", + header: columnsAlias["PatientSex"], cell: ({ row }) => (
{row.getValue("PatientSex")}
), }, { + id: "SeriesInstanceUID", accessorKey: "SeriesInstanceUID", - header: "序列UID", + header: columnsAlias["SeriesInstanceUID"], cell: ({ row }) => (
{row.getValue("SeriesInstanceUID")}
), }, { + id: "filePaths", accessorKey: "filePaths", - header: "层数", + header: columnsAlias["filePaths"], cell: ({ row }) => (
{(row.getValue("filePaths") as string[]).length} @@ -105,8 +124,19 @@ export const columns: ColumnDef[] = [ ), }, { + id: "createTime", accessorKey: "createTime", - header: "创建时间", + header: ({ column }) => { + return ( + + ); + }, cell: ({ row }) => (
{new Date(row.getValue("createTime")).toLocaleString()} @@ -114,14 +144,45 @@ export const columns: ColumnDef[] = [ ), }, { + id: "updateTime", accessorKey: "updateTime", - header: "修改时间", + header: columnsAlias["updateTime"], cell: ({ row }) => (
{new Date(row.getValue("updateTime")).toLocaleString()}
), }, + { + 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 + + + ); + }, + }, ]; export function SeriesTable() { @@ -197,7 +258,7 @@ export function SeriesTable() { column.toggleVisibility(!!value) } > - {column.columnDef.header} + {columnsAlias[column.id]} ); })} diff --git a/apps/desktop/src/style/global.css b/apps/desktop/src/style/global.css index b0cc14e..78ad8e5 100644 --- a/apps/desktop/src/style/global.css +++ b/apps/desktop/src/style/global.css @@ -12,27 +12,28 @@ body, + @layer base { :root { --background: 0 0% 100%; - --foreground: 240 10% 3.9%; + --foreground: 222.2 84% 4.9%; --card: 0 0% 100%; - --card-foreground: 240 10% 3.9%; + --card-foreground: 222.2 84% 4.9%; --popover: 0 0% 100%; - --popover-foreground: 240 10% 3.9%; - --primary: 142.1 76.2% 36.3%; - --primary-foreground: 355.7 100% 97.3%; - --secondary: 240 4.8% 95.9%; - --secondary-foreground: 240 5.9% 10%; - --muted: 240 4.8% 95.9%; - --muted-foreground: 240 3.8% 46.1%; - --accent: 240 4.8% 95.9%; - --accent-foreground: 240 5.9% 10%; + --popover-foreground: 222.2 84% 4.9%; + --primary: 222.2 47.4% 11.2%; + --primary-foreground: 210 40% 98%; + --secondary: 210 40% 96.1%; + --secondary-foreground: 222.2 47.4% 11.2%; + --muted: 210 40% 96.1%; + --muted-foreground: 215.4 16.3% 46.9%; + --accent: 210 40% 96.1%; + --accent-foreground: 222.2 47.4% 11.2%; --destructive: 0 84.2% 60.2%; - --destructive-foreground: 0 0% 98%; - --border: 240 5.9% 90%; - --input: 240 5.9% 90%; - --ring: 142.1 76.2% 36.3%; + --destructive-foreground: 210 40% 98%; + --border: 214.3 31.8% 91.4%; + --input: 214.3 31.8% 91.4%; + --ring: 222.2 84% 4.9%; --radius: 0.5rem; --chart-1: 12 76% 61%; --chart-2: 173 58% 39%; @@ -42,25 +43,25 @@ body, } .dark { - --background: 20 14.3% 4.1%; - --foreground: 0 0% 95%; - --card: 24 9.8% 10%; - --card-foreground: 0 0% 95%; - --popover: 0 0% 9%; - --popover-foreground: 0 0% 95%; - --primary: 142.1 70.6% 45.3%; - --primary-foreground: 144.9 80.4% 10%; - --secondary: 240 3.7% 15.9%; - --secondary-foreground: 0 0% 98%; - --muted: 0 0% 15%; - --muted-foreground: 240 5% 64.9%; - --accent: 12 6.5% 15.1%; - --accent-foreground: 0 0% 98%; + --background: 222.2 84% 4.9%; + --foreground: 210 40% 98%; + --card: 222.2 84% 4.9%; + --card-foreground: 210 40% 98%; + --popover: 222.2 84% 4.9%; + --popover-foreground: 210 40% 98%; + --primary: 210 40% 98%; + --primary-foreground: 222.2 47.4% 11.2%; + --secondary: 217.2 32.6% 17.5%; + --secondary-foreground: 210 40% 98%; + --muted: 217.2 32.6% 17.5%; + --muted-foreground: 215 20.2% 65.1%; + --accent: 217.2 32.6% 17.5%; + --accent-foreground: 210 40% 98%; --destructive: 0 62.8% 30.6%; - --destructive-foreground: 0 85.7% 97.3%; - --border: 240 3.7% 15.9%; - --input: 240 3.7% 15.9%; - --ring: 142.4 71.8% 29.2%; + --destructive-foreground: 210 40% 98%; + --border: 217.2 32.6% 17.5%; + --input: 217.2 32.6% 17.5%; + --ring: 212.7 26.8% 83.9; --chart-1: 220 70% 50%; --chart-2: 160 60% 45%; --chart-3: 30 80% 55%; @@ -70,6 +71,7 @@ body, } + @layer base { * { @apply border-border;