fix(web): offset sticky table headers below layout header
This commit is contained in:
@@ -10,7 +10,7 @@ import { PlusOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import { remove, creatorUpdate, creatorGet, creatorAction } from '@/services/api';
|
||||
import { accountReadiness, conflictMessage, dateTime } from '@/utils/helpers';
|
||||
import { fixedLeft, fixedRight, tablePagination } from '@/utils/table';
|
||||
import { fixedLeft, fixedRight, tablePagination, useTableSticky } from '@/utils/table';
|
||||
import AccountLoginModal from '@/components/accounts/AccountLoginModal';
|
||||
import AccountCreateModal from '@/components/accounts/AccountCreateModal';
|
||||
|
||||
@@ -70,6 +70,7 @@ export default function AccountManagementList() {
|
||||
const [actionBusy, setActionBusy] = useState('');
|
||||
const [loginTarget, setLoginTarget] = useState<Row | null>(null);
|
||||
const { message: messageApi } = App.useApp();
|
||||
const sticky = useTableSticky();
|
||||
|
||||
const load = useCallback(async () => {
|
||||
setPending(true);
|
||||
@@ -333,7 +334,7 @@ export default function AccountManagementList() {
|
||||
columns={columns}
|
||||
dataSource={rows}
|
||||
loading={pending}
|
||||
sticky
|
||||
sticky={sticky}
|
||||
pagination={tablePagination()}
|
||||
scroll={{ x: 'max-content' }}
|
||||
locale={{ emptyText: '暂无账号或待登录环境。' }}
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { ColumnsType } from 'antd/es/table';
|
||||
import { CloudUploadOutlined, ReloadOutlined } from '@ant-design/icons';
|
||||
import { getList, remove, creatorAction, creatorUpdate } from '@/services/api';
|
||||
import { conflictMessage, dateTime } from '@/utils/helpers';
|
||||
import { fixedLeft, fixedRight, tablePagination } from '@/utils/table';
|
||||
import { fixedLeft, fixedRight, tablePagination, useTableSticky } from '@/utils/table';
|
||||
|
||||
interface CompetitorRow {
|
||||
id: string;
|
||||
@@ -46,6 +46,7 @@ export default function MonitoringAccountList() {
|
||||
const [actionBusy, setActionBusy] = useState('');
|
||||
const { message: messageApi } = App.useApp();
|
||||
const horizontal = !Grid.useBreakpoint().xl;
|
||||
const sticky = useTableSticky();
|
||||
|
||||
const load = useCallback(async () => {
|
||||
setPending(true);
|
||||
@@ -227,7 +228,7 @@ export default function MonitoringAccountList() {
|
||||
columns={columns}
|
||||
dataSource={rows}
|
||||
loading={pending}
|
||||
sticky
|
||||
sticky={sticky}
|
||||
pagination={tablePagination()}
|
||||
locale={{ emptyText: '暂无监控账号。' }}
|
||||
scroll={{ x: horizontal ? 1100 : undefined }}
|
||||
|
||||
Reference in New Issue
Block a user