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 && (