fix(AccountListModal): 更新账号状态显示逻辑和颜色标识
修改账号状态显示逻辑,将字符串状态改为数字类型,并更新对应的颜色标识和状态文本。同时更新构建产物的文件引用路径。
This commit is contained in:
16
Cunkebao/dist/.vite/manifest.json
vendored
16
Cunkebao/dist/.vite/manifest.json
vendored
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"_charts-BY5IGS3y.js": {
|
"_charts-62ymwWYF.js": {
|
||||||
"file": "assets/charts-BY5IGS3y.js",
|
"file": "assets/charts-62ymwWYF.js",
|
||||||
"name": "charts",
|
"name": "charts",
|
||||||
"imports": [
|
"imports": [
|
||||||
"_ui-g-9w80lh.js",
|
"_ui-DUe_gloh.js",
|
||||||
"_vendor-2vc8h_ct.js"
|
"_vendor-2vc8h_ct.js"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
"file": "assets/ui-D0C0OGrH.css",
|
"file": "assets/ui-D0C0OGrH.css",
|
||||||
"src": "_ui-D0C0OGrH.css"
|
"src": "_ui-D0C0OGrH.css"
|
||||||
},
|
},
|
||||||
"_ui-g-9w80lh.js": {
|
"_ui-DUe_gloh.js": {
|
||||||
"file": "assets/ui-g-9w80lh.js",
|
"file": "assets/ui-DUe_gloh.js",
|
||||||
"name": "ui",
|
"name": "ui",
|
||||||
"imports": [
|
"imports": [
|
||||||
"_vendor-2vc8h_ct.js"
|
"_vendor-2vc8h_ct.js"
|
||||||
@@ -33,15 +33,15 @@
|
|||||||
"name": "vendor"
|
"name": "vendor"
|
||||||
},
|
},
|
||||||
"index.html": {
|
"index.html": {
|
||||||
"file": "assets/index-D1PYRHiS.js",
|
"file": "assets/index-BmpchxsT.js",
|
||||||
"name": "index",
|
"name": "index",
|
||||||
"src": "index.html",
|
"src": "index.html",
|
||||||
"isEntry": true,
|
"isEntry": true,
|
||||||
"imports": [
|
"imports": [
|
||||||
"_vendor-2vc8h_ct.js",
|
"_vendor-2vc8h_ct.js",
|
||||||
"_utils-6WF66_dS.js",
|
"_utils-6WF66_dS.js",
|
||||||
"_ui-g-9w80lh.js",
|
"_ui-DUe_gloh.js",
|
||||||
"_charts-BY5IGS3y.js"
|
"_charts-62ymwWYF.js"
|
||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
"assets/index-ejYsXKTB.css"
|
"assets/index-ejYsXKTB.css"
|
||||||
|
|||||||
6
Cunkebao/dist/index.html
vendored
6
Cunkebao/dist/index.html
vendored
@@ -11,11 +11,11 @@
|
|||||||
</style>
|
</style>
|
||||||
<!-- 引入 uni-app web-view SDK(必须) -->
|
<!-- 引入 uni-app web-view SDK(必须) -->
|
||||||
<script type="text/javascript" src="/websdk.js"></script>
|
<script type="text/javascript" src="/websdk.js"></script>
|
||||||
<script type="module" crossorigin src="/assets/index-D1PYRHiS.js"></script>
|
<script type="module" crossorigin src="/assets/index-BmpchxsT.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="/assets/vendor-2vc8h_ct.js">
|
<link rel="modulepreload" crossorigin href="/assets/vendor-2vc8h_ct.js">
|
||||||
<link rel="modulepreload" crossorigin href="/assets/utils-6WF66_dS.js">
|
<link rel="modulepreload" crossorigin href="/assets/utils-6WF66_dS.js">
|
||||||
<link rel="modulepreload" crossorigin href="/assets/ui-g-9w80lh.js">
|
<link rel="modulepreload" crossorigin href="/assets/ui-DUe_gloh.js">
|
||||||
<link rel="modulepreload" crossorigin href="/assets/charts-BY5IGS3y.js">
|
<link rel="modulepreload" crossorigin href="/assets/charts-62ymwWYF.js">
|
||||||
<link rel="stylesheet" crossorigin href="/assets/ui-D0C0OGrH.css">
|
<link rel="stylesheet" crossorigin href="/assets/ui-D0C0OGrH.css">
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-ejYsXKTB.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-ejYsXKTB.css">
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -61,29 +61,40 @@ const AccountListModal: React.FC<AccountListModalProps> = ({
|
|||||||
}, [visible, ruleId]);
|
}, [visible, ruleId]);
|
||||||
|
|
||||||
const title = ruleName ? `${ruleName} - 已添加账号列表` : "已添加账号列表";
|
const title = ruleName ? `${ruleName} - 已添加账号列表` : "已添加账号列表";
|
||||||
const getStatusColor = (status?: string) => {
|
const getStatusColor = (status?: string | number) => {
|
||||||
switch (status) {
|
// 确保status是数字类型
|
||||||
case "normal":
|
const statusNum = Number(status);
|
||||||
return "#52c41a";
|
|
||||||
case "limited":
|
switch (statusNum) {
|
||||||
return "#faad14";
|
case 0:
|
||||||
case "blocked":
|
return "#faad14"; // 待添加 - 黄色警告色
|
||||||
return "#ff4d4f";
|
case 1:
|
||||||
|
return "#1890ff"; // 添加中 - 蓝色进行中
|
||||||
|
case 2:
|
||||||
|
return "#ff4d4f"; // 添加失败 - 红色错误色
|
||||||
|
case 3:
|
||||||
|
return "#ff4d4f"; // 添加失败 - 红色错误色
|
||||||
|
case 4:
|
||||||
|
return "#52c41a"; // 已添加 - 绿色成功色
|
||||||
default:
|
default:
|
||||||
return "#d9d9d9";
|
return "#d9d9d9"; // 未知状态 - 灰色
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getStatusText = (status?: string) => {
|
const getStatusText = (status?: number) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case "normal":
|
case 0:
|
||||||
return "正常";
|
return "待添加";
|
||||||
case "limited":
|
case 1:
|
||||||
return "受限";
|
return "添加中";
|
||||||
case "blocked":
|
case 2:
|
||||||
return "封禁";
|
return "添加失败";
|
||||||
|
case 3:
|
||||||
|
return "添加失败";
|
||||||
|
case 4:
|
||||||
|
return "已添加";
|
||||||
default:
|
default:
|
||||||
return "未知";
|
return "未知状态";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -149,7 +160,7 @@ const AccountListModal: React.FC<AccountListModalProps> = ({
|
|||||||
style={{ backgroundColor: getStatusColor(account.status) }}
|
style={{ backgroundColor: getStatusColor(account.status) }}
|
||||||
/>
|
/>
|
||||||
<span className={style.statusText}>
|
<span className={style.statusText}>
|
||||||
{getStatusText(account.status)}
|
{getStatusText(Number(account.status))}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user