From ac9aae920082ff5011aae12828b8318d8f6f76cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=94=E8=AE=B0=E6=9C=AC=E9=87=8C=E7=9A=84=E6=B0=B8?= =?UTF-8?q?=E5=B9=B3?= Date: Tue, 22 Jul 2025 16:02:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=AC=E6=AC=A1=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9=E5=A6=82=E4=B8=8B=20?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=9E=84=E5=BB=BA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nkebao/.env.development | 2 +- nkebao/src/pages/devices/Devices.tsx | 150 +++++++++++++++------------ 2 files changed, 85 insertions(+), 67 deletions(-) diff --git a/nkebao/.env.development b/nkebao/.env.development index b60a89c6a..da6a111b9 100644 --- a/nkebao/.env.development +++ b/nkebao/.env.development @@ -1,4 +1,4 @@ # 基础环境变量示例 -VITE_API_BASE_URL=http://yishi.com +VITE_API_BASE_URL=http://www.yishi.com VITE_APP_TITLE=Nkebao Base diff --git a/nkebao/src/pages/devices/Devices.tsx b/nkebao/src/pages/devices/Devices.tsx index bb7f7f954..2692cad95 100644 --- a/nkebao/src/pages/devices/Devices.tsx +++ b/nkebao/src/pages/devices/Devices.tsx @@ -1,11 +1,13 @@ import React, { useEffect, useRef, useState, useCallback } from "react"; import { NavBar, Popup, Tabs, Toast, SpinLoading, Dialog } from "antd-mobile"; import { Button, Input, Pagination } from "antd"; +import { useNavigate } from "react-router-dom"; import { AddOutline, DeleteOutline } from "antd-mobile-icons"; import { ReloadOutlined, SearchOutlined, QrcodeOutlined, + ArrowLeftOutlined, } from "@ant-design/icons"; import Layout from "@/components/Layout/Layout"; import MeauMobile from "@/components/MeauMobile/MeauMoible"; @@ -43,6 +45,7 @@ const Devices: React.FC = () => { const [delVisible, setDelVisible] = useState(false); const [delLoading, setDelLoading] = useState(false); + const navigate = useNavigate(); // 加载设备列表 const loadDevices = useCallback( async (reset = false) => { @@ -173,64 +176,90 @@ const Devices: React.FC = () => { return ( setAddVisible(true)} - > - - 添加设备 - - } - > - - 设备管理 - - + <> + + navigate(-1)} + /> + + } + style={{ background: "#fff" }} + right={ + + } + > + + 设备管理 + + + +
+ {/* 搜索栏 */} +
+ setSearch(e.target.value)} + prefix={} + allowClear + style={{ flex: 1 }} + /> + +
+ {/* 筛选和删除 */} +
+ setStatus(k as any)} + style={{ flex: 1 }} + > + + + + + +
+
+ + } + footer={ +
+ +
} - footer={} loading={loading && devices.length === 0} >
- {/* 搜索栏 */} -
- setSearch(e.target.value)} - prefix={} - allowClear - style={{ flex: 1 }} - /> - -
- {/* 筛选和删除 */} -
- setStatus(k as any)} - style={{ flex: 1 }} - > - - - - - -
{/* 设备列表 */}
{filtered.map((device) => ( @@ -294,18 +323,7 @@ const Devices: React.FC = () => {
))} - {/* 分页组件 */} - {usePagination && ( -
- -
- )} + {/* 无限滚动提示(仅在不分页时显示) */} {!usePagination && (