updata:icon替换

This commit is contained in:
xiaozhu
2026-09-02 10:10:41 +08:00
committed by tao.chen
parent 3a5cc12782
commit af2f035d03
17 changed files with 159 additions and 304 deletions
+25 -16
View File
@@ -1,4 +1,11 @@
import Icon from "../../components/common/Icon";
import {
Calendar,
Check,
FileText,
LayoutGrid,
Settings,
type LucideIcon,
} from "lucide-react";
import { useAuth, usePermission } from "../../context/AuthContext";
const TREND_VALUES = [38, 55, 44, 73, 61, 86, 78] as const;
@@ -50,22 +57,24 @@ export function DashboardPage({
</div>
<div className="mt-[18px] grid grid-cols-4 gap-3.5">
{[
{ icon: "script" as const, value: scriptCount, label: "工作副本" },
{ icon: "workspace" as const, value: 2, label: "Workspace" },
{ icon: "settings" as const, value: 4, label: "平台用户" },
{
icon: "check" as const,
value: online ? "正常" : "检查中",
label: "平台状态",
},
].map((item) => (
{(
[
{ Icon: FileText, value: scriptCount, label: "工作副本" },
{ Icon: LayoutGrid, value: 2, label: "Workspace" },
{ Icon: Settings, value: 4, label: "平台用户" },
{
Icon: Check,
value: online ? "正常" : "检查中",
label: "平台状态",
},
] as Array<{ Icon: LucideIcon; value: number | string; label: string }>
).map((item) => (
<article
key={item.label}
className="flex items-center gap-3.5 rounded-[9px] border border-[#e0e8ef] bg-white p-5"
>
<span className="text-brand">
<Icon name={item.icon} />
<item.Icon />
</span>
<span className="flex flex-col">
<b className="text-[21px] text-[#20364c]">{item.value}</b>
@@ -81,7 +90,7 @@ export function DashboardPage({
className="flex cursor-pointer items-center gap-2 rounded-[7px] border border-[#d8e4ef] bg-white px-[18px] py-[13px] text-[#346587]"
onClick={() => onNavigate("scripts")}
>
<Icon name="script" />
<FileText />
</button>
<button
@@ -89,7 +98,7 @@ export function DashboardPage({
className="flex cursor-pointer items-center gap-2 rounded-[7px] border border-[#d8e4ef] bg-white px-[18px] py-[13px] text-[#346587]"
onClick={() => onNavigate("schedules")}
>
<Icon name="schedule" />
<Calendar />
</button>
{hasSystemView && (
@@ -98,7 +107,7 @@ export function DashboardPage({
className="flex cursor-pointer items-center gap-2 rounded-[7px] border border-[#d8e4ef] bg-white px-[18px] py-[13px] text-[#346587]"
onClick={() => onNavigate("system")}
>
<Icon name="settings" />
<Settings />
</button>
)}
@@ -226,7 +235,7 @@ export function DashboardPage({
>
<span className="flex items-center gap-[9px] text-[#344c63]">
<i className="grid size-[25px] place-items-center rounded-md bg-[#eaf4ff] text-[#277fcc]">
<Icon name="check" size={13} />
<Check size={13} />
</i>
{row[0]}
</span>
@@ -1,5 +1,5 @@
import { type Workspace, type WorkspaceMember } from "../../services/api";
import Icon from "../../components/common/Icon";
import { Plus, X } from "lucide-react";
export function ProjectMembersDrawer({
open,
@@ -60,7 +60,7 @@ export function ProjectMembersDrawer({
<p style={{ margin: "4px 0 0", fontSize: 13, color: "#888" }}>{selectedProject.workspace_name}</p>
</div>
<button className="icon-button" type="button" onClick={() => onClose()}>
<Icon name="close" />
<X />
</button>
</div>
@@ -80,7 +80,7 @@ export function ProjectMembersDrawer({
onClick={() => onAddMembers()}
style={{ fontSize: 13, padding: "6px 12px" }}
>
<Icon name="plus" size={14} />
<Plus size={14} />
</button>
</div>