FEAT => 本次更新项目为:

bu修复
This commit is contained in:
2025-07-30 15:37:13 +08:00
parent f430718e5f
commit e3ccf61fd2

View File

@@ -8,9 +8,9 @@ import {
fetchDeviceRelatedAccounts, fetchDeviceRelatedAccounts,
fetchDeviceHandleLogs, fetchDeviceHandleLogs,
updateDeviceTaskConfig, updateDeviceTaskConfig,
} from "@/api/devices"; } from "./api";
import type { Device, WechatAccount, HandleLog } from "@/types/device"; import type { Device, WechatAccount, HandleLog } from "@/types/device";
import NavCommon from "@/components/NavCommon";
const DeviceDetail: React.FC = () => { const DeviceDetail: React.FC = () => {
const { id } = useParams<{ id: string }>(); const { id } = useParams<{ id: string }>();
const navigate = useNavigate(); const navigate = useNavigate();
@@ -118,19 +118,50 @@ const DeviceDetail: React.FC = () => {
return ( return (
<Layout <Layout
header={ header={
<NavBar <>
onBack={() => navigate(-1)} <NavCommon title="设备详情" />
style={{ background: "#fff" }}
right={ {/* 基本信息卡片 */}
<Button size="small" color="primary"> {device && (
<SettingOutlined /> <div
</Button> style={{
} background: "#fff",
> borderRadius: 12,
<span style={{ color: "var(--primary-color)", fontWeight: 600 }}> padding: 16,
marginBottom: 16,
</span> boxShadow: "0 1px 4px #eee",
</NavBar> margin: "0 12px",
}}
>
<div style={{ fontWeight: 600, fontSize: 18 }}>
{device.memo || "未命名设备"}
</div>
<div style={{ fontSize: 13, color: "#888", marginTop: 4 }}>
IMEI: {device.imei}
</div>
<div style={{ fontSize: 13, color: "#888", marginTop: 4 }}>
: {device.wechatId || "未绑定"}
</div>
<div style={{ fontSize: 13, color: "#888", marginTop: 4 }}>
: {device.totalFriend ?? "-"}
</div>
<div
style={{
fontSize: 13,
color:
device.status === "online" || device.alive === 1
? "#52c41a"
: "#aaa",
marginTop: 4,
}}
>
{device.status === "online" || device.alive === 1
? "在线"
: "离线"}
</div>
</div>
)}
</>
} }
loading={loading} loading={loading}
> >
@@ -141,43 +172,6 @@ const DeviceDetail: React.FC = () => {
</div> </div>
) : ( ) : (
<div style={{ padding: 12 }}> <div style={{ padding: 12 }}>
{/* 基本信息卡片 */}
<div
style={{
background: "#fff",
borderRadius: 12,
padding: 16,
marginBottom: 16,
boxShadow: "0 1px 4px #eee",
}}
>
<div style={{ fontWeight: 600, fontSize: 18 }}>
{device.memo || "未命名设备"}
</div>
<div style={{ fontSize: 13, color: "#888", marginTop: 4 }}>
IMEI: {device.imei}
</div>
<div style={{ fontSize: 13, color: "#888", marginTop: 4 }}>
: {device.wechatId || "未绑定"}
</div>
<div style={{ fontSize: 13, color: "#888", marginTop: 4 }}>
: {device.totalFriend ?? "-"}
</div>
<div
style={{
fontSize: 13,
color:
device.status === "online" || device.alive === 1
? "#52c41a"
: "#aaa",
marginTop: 4,
}}
>
{device.status === "online" || device.alive === 1
? "在线"
: "离线"}
</div>
</div>
{/* 标签页 */} {/* 标签页 */}
<Tabs activeKey={tab} onChange={setTab} style={{ marginBottom: 12 }}> <Tabs activeKey={tab} onChange={setTab} style={{ marginBottom: 12 }}>
<Tabs.Tab title="功能开关" key="info" /> <Tabs.Tab title="功能开关" key="info" />