From 31d75be68e7c9bd6c7e9c48e82e5410e8d8c880b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Thu, 28 Aug 2025 16:06:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(AccountListModal):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=92=8C=E9=A2=9C=E8=89=B2=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改账号状态显示逻辑,将字符串状态改为数字类型,并更新对应的颜色标识和状态文本。同时更新构建产物的文件引用路径。 --- Cunkebao/dist/.vite/manifest.json | 16 +++---- Cunkebao/dist/index.html | 6 +-- .../plan/list/components/AccountListModal.tsx | 47 ++++++++++++------- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/Cunkebao/dist/.vite/manifest.json b/Cunkebao/dist/.vite/manifest.json index f5df3f32..050321b1 100644 --- a/Cunkebao/dist/.vite/manifest.json +++ b/Cunkebao/dist/.vite/manifest.json @@ -1,9 +1,9 @@ { - "_charts-BY5IGS3y.js": { - "file": "assets/charts-BY5IGS3y.js", + "_charts-62ymwWYF.js": { + "file": "assets/charts-62ymwWYF.js", "name": "charts", "imports": [ - "_ui-g-9w80lh.js", + "_ui-DUe_gloh.js", "_vendor-2vc8h_ct.js" ] }, @@ -11,8 +11,8 @@ "file": "assets/ui-D0C0OGrH.css", "src": "_ui-D0C0OGrH.css" }, - "_ui-g-9w80lh.js": { - "file": "assets/ui-g-9w80lh.js", + "_ui-DUe_gloh.js": { + "file": "assets/ui-DUe_gloh.js", "name": "ui", "imports": [ "_vendor-2vc8h_ct.js" @@ -33,15 +33,15 @@ "name": "vendor" }, "index.html": { - "file": "assets/index-D1PYRHiS.js", + "file": "assets/index-BmpchxsT.js", "name": "index", "src": "index.html", "isEntry": true, "imports": [ "_vendor-2vc8h_ct.js", "_utils-6WF66_dS.js", - "_ui-g-9w80lh.js", - "_charts-BY5IGS3y.js" + "_ui-DUe_gloh.js", + "_charts-62ymwWYF.js" ], "css": [ "assets/index-ejYsXKTB.css" diff --git a/Cunkebao/dist/index.html b/Cunkebao/dist/index.html index abe21cc7..e1fc8350 100644 --- a/Cunkebao/dist/index.html +++ b/Cunkebao/dist/index.html @@ -11,11 +11,11 @@ - + - - + + diff --git a/Cunkebao/src/pages/mobile/scenarios/plan/list/components/AccountListModal.tsx b/Cunkebao/src/pages/mobile/scenarios/plan/list/components/AccountListModal.tsx index dd8cff30..734536f2 100644 --- a/Cunkebao/src/pages/mobile/scenarios/plan/list/components/AccountListModal.tsx +++ b/Cunkebao/src/pages/mobile/scenarios/plan/list/components/AccountListModal.tsx @@ -61,29 +61,40 @@ const AccountListModal: React.FC = ({ }, [visible, ruleId]); const title = ruleName ? `${ruleName} - 已添加账号列表` : "已添加账号列表"; - const getStatusColor = (status?: string) => { - switch (status) { - case "normal": - return "#52c41a"; - case "limited": - return "#faad14"; - case "blocked": - return "#ff4d4f"; + const getStatusColor = (status?: string | number) => { + // 确保status是数字类型 + const statusNum = Number(status); + + switch (statusNum) { + case 0: + return "#faad14"; // 待添加 - 黄色警告色 + case 1: + return "#1890ff"; // 添加中 - 蓝色进行中 + case 2: + return "#ff4d4f"; // 添加失败 - 红色错误色 + case 3: + return "#ff4d4f"; // 添加失败 - 红色错误色 + case 4: + return "#52c41a"; // 已添加 - 绿色成功色 default: - return "#d9d9d9"; + return "#d9d9d9"; // 未知状态 - 灰色 } }; - const getStatusText = (status?: string) => { + const getStatusText = (status?: number) => { switch (status) { - case "normal": - return "正常"; - case "limited": - return "受限"; - case "blocked": - return "封禁"; + case 0: + return "待添加"; + case 1: + return "添加中"; + case 2: + return "添加失败"; + case 3: + return "添加失败"; + case 4: + return "已添加"; default: - return "未知"; + return "未知状态"; } }; @@ -149,7 +160,7 @@ const AccountListModal: React.FC = ({ style={{ backgroundColor: getStatusColor(account.status) }} /> - {getStatusText(account.status)} + {getStatusText(Number(account.status))}