feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -17,24 +17,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import TableEmpty from '../../components/common/table/TableEmpty';
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import {
|
||||
Banner,
|
||||
Button,
|
||||
Empty,
|
||||
Form,
|
||||
Select,
|
||||
Spin,
|
||||
Typography,
|
||||
} from '@/components/ui';
|
||||
import { Banner, Button, Form, Spin } from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import CardPro from '../../components/common/ui/CardPro';
|
||||
import CardTable from '../../components/common/ui/CardTable';
|
||||
import CompactModeToggle from '../../components/common/ui/CompactModeToggle';
|
||||
import {
|
||||
IllustrationNoResult,
|
||||
IllustrationNoResultDark,
|
||||
} from '../../components/common/illustrations';
|
||||
import FilterSearchButton from '../../components/common/table/FilterSearchButton';
|
||||
import '../../components/common/table/log-filters.css';
|
||||
|
||||
import { createCardProPagination } from '../../helpers/utils';
|
||||
import { useIsMobile } from '../../hooks/common/useIsMobile';
|
||||
import { useTableCompactMode } from '../../hooks/common/useTableCompactMode';
|
||||
@@ -142,7 +134,7 @@ export default function DemoReservations() {
|
||||
});
|
||||
|
||||
return (
|
||||
<div className='mt-[60px] px-2' aria-busy={loading}>
|
||||
<div className='console-content' aria-busy={loading}>
|
||||
<Spin
|
||||
spinning={loading}
|
||||
size='large'
|
||||
@@ -150,26 +142,17 @@ export default function DemoReservations() {
|
||||
data-testid='demo-reservations-loading'
|
||||
>
|
||||
<CardPro
|
||||
tableTitle={t('预约列表')}
|
||||
type='type1'
|
||||
t={t}
|
||||
descriptionArea={
|
||||
<div className='flex w-full flex-col items-start justify-between gap-2 md:flex-row md:items-center'>
|
||||
<div>
|
||||
<Typography.Title heading={4} style={{ marginBottom: 8 }}>
|
||||
{t('预约演示')}
|
||||
</Typography.Title>
|
||||
<Typography.Text type='tertiary' size='small'>
|
||||
{t('查看官网访客提交的预约信息,支持模糊查询与分页。')}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<CompactModeToggle
|
||||
compactMode={compactMode}
|
||||
setCompactMode={setCompactMode}
|
||||
t={t}
|
||||
/>
|
||||
</div>
|
||||
tableActions={
|
||||
<CompactModeToggle
|
||||
compactMode={compactMode}
|
||||
setCompactMode={setCompactMode}
|
||||
t={t}
|
||||
/>
|
||||
}
|
||||
actionsArea={
|
||||
searchArea={
|
||||
<div className='flex w-full justify-start'>
|
||||
<Form
|
||||
initValues={EMPTY_FILTERS}
|
||||
@@ -185,74 +168,35 @@ export default function DemoReservations() {
|
||||
}
|
||||
allowEmpty
|
||||
autoComplete='off'
|
||||
layout='horizontal'
|
||||
className='w-full md:w-auto'
|
||||
layout='vertical'
|
||||
className='log-filter-form w-full'
|
||||
>
|
||||
<div className='flex w-full flex-col items-center gap-2 md:w-auto md:flex-row'>
|
||||
{[
|
||||
['name', '请输入姓名'],
|
||||
['contact', '请输入联系方式'],
|
||||
['companyName', '请输入公司名称'],
|
||||
].map(([field, placeholder]) => (
|
||||
<div key={field} className='w-full md:w-44'>
|
||||
<div className='log-filter-content'>
|
||||
<div className='log-filter-grid'>
|
||||
{[
|
||||
['name', '姓名', '请输入姓名'],
|
||||
['contact', '联系方式', '请输入联系方式'],
|
||||
['companyName', '公司名称', '请输入公司名称'],
|
||||
].map(([field, label, placeholder]) => (
|
||||
<Form.Input
|
||||
key={field}
|
||||
field={field}
|
||||
aria-label={t(placeholder)}
|
||||
label={t(label)}
|
||||
placeholder={t(placeholder)}
|
||||
showClear
|
||||
pure
|
||||
size='small'
|
||||
maxLength={254}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
<div className='flex w-full gap-2 md:w-auto'>
|
||||
<Button
|
||||
type='tertiary'
|
||||
htmlType='submit'
|
||||
loading={loading}
|
||||
size='small'
|
||||
className='flex-1 md:flex-initial'
|
||||
>
|
||||
{t('查询')}
|
||||
</Button>
|
||||
<Button
|
||||
type='tertiary'
|
||||
onClick={reset}
|
||||
size='small'
|
||||
className='flex-1 md:flex-initial'
|
||||
>
|
||||
{t('重置')}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
<div className='log-filter-actions'>
|
||||
<Button onClick={reset}>{t('重置')}</Button>
|
||||
<FilterSearchButton loading={loading} />
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
}
|
||||
paginationArea={
|
||||
isMobile && result.total > 0 ? (
|
||||
<div className='flex w-full flex-col items-center gap-3'>
|
||||
<div className='flex items-center gap-3'>
|
||||
<Typography.Text type='tertiary'>
|
||||
{t('共')} {result.total} {t('条')}
|
||||
</Typography.Text>
|
||||
<Select
|
||||
aria-label={t('每页条数')}
|
||||
size='small'
|
||||
value={result.page_size ?? query.pageSize}
|
||||
onChange={changePageSize}
|
||||
optionList={[10, 20, 50, 100].map((value) => ({
|
||||
value,
|
||||
label: `${value} ${t('条/页')}`,
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
{pagination}
|
||||
</div>
|
||||
) : (
|
||||
pagination
|
||||
)
|
||||
}
|
||||
paginationArea={pagination}
|
||||
>
|
||||
{error && (
|
||||
<Banner
|
||||
@@ -270,22 +214,7 @@ export default function DemoReservations() {
|
||||
hidePagination
|
||||
className='overflow-hidden'
|
||||
size='middle'
|
||||
empty={
|
||||
<Empty
|
||||
image={
|
||||
<IllustrationNoResult style={{ width: 150, height: 150 }} />
|
||||
}
|
||||
darkModeImage={
|
||||
<IllustrationNoResultDark
|
||||
style={{ width: 150, height: 150 }}
|
||||
/>
|
||||
}
|
||||
description={t(
|
||||
error ? '预约信息加载失败' : '暂无符合条件的预约信息',
|
||||
)}
|
||||
style={{ padding: 30 }}
|
||||
/>
|
||||
}
|
||||
empty={<TableEmpty />}
|
||||
/>
|
||||
</CardPro>
|
||||
</Spin>
|
||||
|
||||
Reference in New Issue
Block a user