提交 6d1921de authored 作者: 王鹏飞's avatar 王鹏飞

chore(admin): 修改页面布局和样式

上级 f0d76e9d
...@@ -5,34 +5,50 @@ ...@@ -5,34 +5,50 @@
&__filters { &__filters {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: nowrap;
align-items: flex-end; align-items: flex-end;
justify-content: space-between; justify-content: space-between;
gap: 16px; gap: 16px;
} }
&__filter-main {
display: flex;
flex: 0 1 auto;
align-items: flex-end;
gap: 16px;
min-width: 0;
}
&__filter-items { &__filter-items {
display: flex; display: flex;
flex: 1; flex: 0 1 auto;
flex-wrap: wrap; flex-wrap: wrap;
align-items: flex-end; align-items: flex-end;
gap: 16px; gap: 16px;
} }
&__filter-actions {
flex: 0 0 auto;
}
&__filter-item { &__filter-item {
display: flex; display: flex;
flex-direction: column; flex-direction: row;
align-items: center;
gap: 8px; gap: 8px;
} }
&__filter-label { &__filter-label {
flex: 0 0 auto;
color: rgb(0 0 0 / 88%); color: rgb(0 0 0 / 88%);
white-space: nowrap;
} }
&__toolbar { &__toolbar {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: 8px;
flex: 0 0 auto;
} }
&__blocking-error { &__blocking-error {
......
...@@ -53,6 +53,7 @@ export function AppList<Row extends object, Filters extends object = Record<stri ...@@ -53,6 +53,7 @@ export function AppList<Row extends object, Filters extends object = Record<stri
<div className="app-list"> <div className="app-list">
{filters ? ( {filters ? (
<section className="app-list__filters" aria-label="筛选条件"> <section className="app-list__filters" aria-label="筛选条件">
<div className="app-list__filter-main">
<div className="app-list__filter-items"> <div className="app-list__filter-items">
{filters.items.map((item) => ( {filters.items.map((item) => (
<div className="app-list__filter-item" key={String(item.name)}> <div className="app-list__filter-item" key={String(item.name)}>
...@@ -64,7 +65,7 @@ export function AppList<Row extends object, Filters extends object = Record<stri ...@@ -64,7 +65,7 @@ export function AppList<Row extends object, Filters extends object = Record<stri
</div> </div>
))} ))}
</div> </div>
<Space wrap> <Space wrap className="app-list__filter-actions">
<Button type="primary" icon={<SearchOutlined />} onClick={filters.onSearch}> <Button type="primary" icon={<SearchOutlined />} onClick={filters.onSearch}>
搜索 搜索
</Button> </Button>
...@@ -72,10 +73,12 @@ export function AppList<Row extends object, Filters extends object = Record<stri ...@@ -72,10 +73,12 @@ export function AppList<Row extends object, Filters extends object = Record<stri
重置 重置
</Button> </Button>
</Space> </Space>
</div>
{toolbar ? <div className="app-list__toolbar">{toolbar}</div> : null}
</section> </section>
) : null} ) : null}
{toolbar ? <div className="app-list__toolbar">{toolbar}</div> : null} {!filters && toolbar ? <div className="app-list__toolbar">{toolbar}</div> : null}
{hasRefreshError ? ( {hasRefreshError ? (
<Alert <Alert
......
import { Button } from "antd"; import { Link } from "react-router";
import { LeftOutlined } from "@ant-design/icons";
import { useLocation, useNavigate } from "react-router";
export default function Breadcrumb() { export default function Breadcrumb({ parent }) {
const { pathname } = useLocation(); if (!parent) return null;
const navigate = useNavigate();
// const hasBack = currentMenusList.find(item => {
// const regExp = new RegExp(`^${item.path}`)
// return regExp.test(pathname) && item.path !== pathname
// })
const hasBack = [
"/books/management/add-edit",
"/setting/help/addedit",
"/books/management/chapter",
"/userinfo",
"/books/audit/detail",
"/books/sale/discussP",
"/books/sale/discuss-detail",
"/member/list/detail",
"/books/sale/detail",
].includes(pathname);
if (!hasBack) return null;
return ( return (
<div className="layout-breadcrumb"> <div className="layout-breadcrumb">
<Button type="text" icon={<LeftOutlined />} onClick={() => navigate(-1)}> <Link to={parent.parent}>{parent.parentTitle}</Link>
返回 <span aria-hidden="true">/</span>
</Button>
</div> </div>
); );
} }
.layout-container { .layout-container {
min-height: 100vh; min-height: 100vh;
background: #f6f7f9; background: #fff;
} }
.layout-sider { .layout-sider {
position: fixed !important; position: sticky !important;
top: 84px; top: 0;
bottom: 0; height: 100vh;
left: 0;
height: auto;
overflow: hidden; overflow: hidden;
background: #f6f7f9 !important; background: #f5f6f7 !important;
border-inline-end: 0 !important; border-inline-end: 0 !important;
box-shadow: none; box-shadow: none;
z-index: 100; z-index: 100;
...@@ -28,20 +26,11 @@ ...@@ -28,20 +26,11 @@
overflow-y: auto; overflow-y: auto;
} }
.layout-body {
min-height: calc(100vh - 84px);
padding-left: 200px;
}
.layout-body--collapsed {
padding-left: 56px;
}
.layout-brand { .layout-brand {
display: flex; display: flex;
align-items: center; align-items: center;
height: 84px; height: 84px;
padding: 0; padding: 0 20px;
.layout-brand__logo { .layout-brand__logo {
display: inline-flex; display: inline-flex;
...@@ -68,7 +57,7 @@ ...@@ -68,7 +57,7 @@
margin: 0 10px 10px; margin: 0 10px 10px;
padding: 0; padding: 0;
color: #6f7886; color: #6f7886;
background: #f6f7f9; background: #f5f6f7;
border: 0; border: 0;
border-radius: 8px; border-radius: 8px;
cursor: pointer; cursor: pointer;
...@@ -253,7 +242,7 @@ ...@@ -253,7 +242,7 @@
.layout-main { .layout-main {
min-width: 0; min-width: 0;
background: #f6f7f9; background: #fff;
} }
.layout-header { .layout-header {
...@@ -264,16 +253,16 @@ ...@@ -264,16 +253,16 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
height: 84px; height: 84px;
padding: 0 32px 0 20px; padding: 0 32px;
line-height: normal; line-height: normal;
background: #f6f7f9; background: #fff;
border-bottom: 0; border-bottom: 1px solid #1f23290a;
} }
.layout-page-title { .layout-page-title {
display: flex; display: flex;
align-items: center; align-items: center;
height: 60px; height: 56px;
color: #252b36; color: #252b36;
font-size: 22px; font-size: 22px;
font-weight: 600; font-weight: 600;
...@@ -281,7 +270,10 @@ ...@@ -281,7 +270,10 @@
} }
.layout-page-header { .layout-page-header {
min-height: 60px; display: flex;
align-items: center;
gap: 8px;
min-width: 0;
} }
.layout-header__actions { .layout-header__actions {
...@@ -307,16 +299,31 @@ ...@@ -307,16 +299,31 @@
.layout-breadcrumb { .layout-breadcrumb {
display: flex; display: flex;
align-items: center; align-items: center;
height: 40px; height: 56px;
margin-top: -8px; margin: 0;
padding: 0; padding: 0;
a {
color: #646a73;
font-size: 14px;
text-decoration: none;
&:hover {
color: #1f2329;
}
}
span {
margin-left: 8px;
color: #b0b5bd;
}
} }
.layout-content { .layout-content {
min-height: calc(100vh - 84px); min-height: calc(100vh - 84px);
margin: 0 32px 40px 20px; margin: 0;
padding: 0; padding: 24px 32px 40px;
background: transparent; background: #fff;
border-radius: 0; border-radius: 0;
box-shadow: none; box-shadow: none;
} }
...@@ -355,9 +362,9 @@ ...@@ -355,9 +362,9 @@
margin-top: 16px; margin-top: 16px;
overflow: hidden; overflow: hidden;
background: #fff; background: #fff;
border: 1px solid #e7eaee; border: 0;
border-radius: 12px; border-radius: 0;
box-shadow: 0 1px 2px rgb(31 41 55 / 2%); box-shadow: none;
} }
.ant-table, .ant-table,
...@@ -377,13 +384,13 @@ ...@@ -377,13 +384,13 @@
font-size: 13px; font-size: 13px;
font-weight: 500; font-weight: 500;
background: #f8f9fb !important; background: #f8f9fb !important;
border-bottom: 1px solid #edf0f3; border-bottom: 1px solid #1f232926;
} }
.ant-table-tbody > tr > td { .ant-table-tbody > tr > td {
height: 52px; height: 52px;
color: #303641; color: #303641;
border-bottom: 1px solid #f0f2f4; border-bottom: 1px solid #1f232926;
} }
.ant-table-tbody > tr:nth-child(2n) { .ant-table-tbody > tr:nth-child(2n) {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论