feat: 本次提交更新内容如下
样式构建完成
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# 基础环境变量示例
|
# 基础环境变量示例
|
||||||
VITE_API_BASE_URL=http://yishi.com
|
VITE_API_BASE_URL=http://www.yishi.com
|
||||||
VITE_APP_TITLE=Nkebao Base
|
VITE_APP_TITLE=Nkebao Base
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import React, { useEffect, useRef, useState, useCallback } from "react";
|
import React, { useEffect, useRef, useState, useCallback } from "react";
|
||||||
import { NavBar, Popup, Tabs, Toast, SpinLoading, Dialog } from "antd-mobile";
|
import { NavBar, Popup, Tabs, Toast, SpinLoading, Dialog } from "antd-mobile";
|
||||||
import { Button, Input, Pagination } from "antd";
|
import { Button, Input, Pagination } from "antd";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
import { AddOutline, DeleteOutline } from "antd-mobile-icons";
|
import { AddOutline, DeleteOutline } from "antd-mobile-icons";
|
||||||
import {
|
import {
|
||||||
ReloadOutlined,
|
ReloadOutlined,
|
||||||
SearchOutlined,
|
SearchOutlined,
|
||||||
QrcodeOutlined,
|
QrcodeOutlined,
|
||||||
|
ArrowLeftOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import Layout from "@/components/Layout/Layout";
|
import Layout from "@/components/Layout/Layout";
|
||||||
import MeauMobile from "@/components/MeauMobile/MeauMoible";
|
import MeauMobile from "@/components/MeauMobile/MeauMoible";
|
||||||
@@ -43,6 +45,7 @@ const Devices: React.FC = () => {
|
|||||||
const [delVisible, setDelVisible] = useState(false);
|
const [delVisible, setDelVisible] = useState(false);
|
||||||
const [delLoading, setDelLoading] = useState(false);
|
const [delLoading, setDelLoading] = useState(false);
|
||||||
|
|
||||||
|
const navigate = useNavigate();
|
||||||
// 加载设备列表
|
// 加载设备列表
|
||||||
const loadDevices = useCallback(
|
const loadDevices = useCallback(
|
||||||
async (reset = false) => {
|
async (reset = false) => {
|
||||||
@@ -173,8 +176,17 @@ const Devices: React.FC = () => {
|
|||||||
return (
|
return (
|
||||||
<Layout
|
<Layout
|
||||||
header={
|
header={
|
||||||
|
<>
|
||||||
<NavBar
|
<NavBar
|
||||||
back={null}
|
back={null}
|
||||||
|
left={
|
||||||
|
<div className="nav-title">
|
||||||
|
<ArrowLeftOutlined
|
||||||
|
twoToneColor="#1677ff"
|
||||||
|
onClick={() => navigate(-1)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
style={{ background: "#fff" }}
|
style={{ background: "#fff" }}
|
||||||
right={
|
right={
|
||||||
<Button
|
<Button
|
||||||
@@ -191,11 +203,8 @@ const Devices: React.FC = () => {
|
|||||||
设备管理
|
设备管理
|
||||||
</span>
|
</span>
|
||||||
</NavBar>
|
</NavBar>
|
||||||
}
|
|
||||||
footer={<MeauMobile activeKey="workspace" />}
|
<div style={{ padding: "12px 12px 0 12px", background: "#fff" }}>
|
||||||
loading={loading && devices.length === 0}
|
|
||||||
>
|
|
||||||
<div style={{ padding: 12 }}>
|
|
||||||
{/* 搜索栏 */}
|
{/* 搜索栏 */}
|
||||||
<div style={{ display: "flex", gap: 8, marginBottom: 12 }}>
|
<div style={{ display: "flex", gap: 8, marginBottom: 12 }}>
|
||||||
<Input
|
<Input
|
||||||
@@ -206,7 +215,10 @@ const Devices: React.FC = () => {
|
|||||||
allowClear
|
allowClear
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
/>
|
/>
|
||||||
<Button onClick={() => loadDevices(true)} icon={<ReloadOutlined />}>
|
<Button
|
||||||
|
onClick={() => loadDevices(true)}
|
||||||
|
icon={<ReloadOutlined />}
|
||||||
|
>
|
||||||
刷新
|
刷新
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -231,6 +243,23 @@ const Devices: React.FC = () => {
|
|||||||
删除
|
删除
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
footer={
|
||||||
|
<div style={{ padding: 16, textAlign: "center", background: "#fff" }}>
|
||||||
|
<Pagination
|
||||||
|
current={page}
|
||||||
|
pageSize={20}
|
||||||
|
total={total}
|
||||||
|
showSizeChanger={false}
|
||||||
|
onChange={handlePageChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
loading={loading && devices.length === 0}
|
||||||
|
>
|
||||||
|
<div style={{ padding: 12 }}>
|
||||||
{/* 设备列表 */}
|
{/* 设备列表 */}
|
||||||
<div style={{ display: "flex", flexDirection: "column", gap: 10 }}>
|
<div style={{ display: "flex", flexDirection: "column", gap: 10 }}>
|
||||||
{filtered.map((device) => (
|
{filtered.map((device) => (
|
||||||
@@ -294,18 +323,7 @@ const Devices: React.FC = () => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
{/* 分页组件 */}
|
|
||||||
{usePagination && (
|
|
||||||
<div style={{ padding: 16, textAlign: "center" }}>
|
|
||||||
<Pagination
|
|
||||||
current={page}
|
|
||||||
pageSize={20}
|
|
||||||
total={total}
|
|
||||||
showSizeChanger={false}
|
|
||||||
onChange={handlePageChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{/* 无限滚动提示(仅在不分页时显示) */}
|
{/* 无限滚动提示(仅在不分页时显示) */}
|
||||||
{!usePagination && (
|
{!usePagination && (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user