fix(ui): 统一表格筛选分页和用量明细,升级 ESLint
This commit is contained in:
@@ -52,7 +52,6 @@ import {
|
||||
TextArea,
|
||||
} from '@/components/ui';
|
||||
import { useOrgTokens } from '../../hooks/org/useOrgData';
|
||||
import { useIsMobile } from '../../hooks/common/useIsMobile';
|
||||
import {
|
||||
API,
|
||||
copy,
|
||||
@@ -145,9 +144,6 @@ const OrgTokens = ({ orgId, orgRole }) => {
|
||||
fetchTokenKey,
|
||||
} = useOrgTokens(orgId);
|
||||
const [page, setPage] = useState(1);
|
||||
// 窄屏下两侧固定列(名称+操作≈400px)会占满可视宽度,中间列无处可显示,故仅桌面端固定
|
||||
const isMobile = useIsMobile();
|
||||
const fixedSide = (side) => (isMobile ? undefined : side);
|
||||
const [pageSize, setPageSize] = useState(20);
|
||||
const [visibleColumns, setVisibleColumns] = useState([
|
||||
'name',
|
||||
@@ -307,9 +303,7 @@ const OrgTokens = ({ orgId, orgRole }) => {
|
||||
title: t('名称'),
|
||||
key: 'name',
|
||||
dataIndex: 'name',
|
||||
width: 230,
|
||||
// 列数较多,常规桌面宽度也会横向滚动:名称与操作列固定在两侧,滚动时始终可见
|
||||
fixed: fixedSide('left'),
|
||||
width: 150,
|
||||
ellipsis: { showTitle: false },
|
||||
render: (name, record) => (
|
||||
<Tooltip content={name} position='topLeft'>
|
||||
@@ -333,7 +327,7 @@ const OrgTokens = ({ orgId, orgRole }) => {
|
||||
title: t('密钥'),
|
||||
key: 'key',
|
||||
dataIndex: 'key',
|
||||
width: 335,
|
||||
width: 300,
|
||||
render: (key, record) => {
|
||||
// key 为后端脱敏值(前 4 + **** + 后 4)
|
||||
const fullKey = revealedKeys[record.id];
|
||||
@@ -529,7 +523,6 @@ const OrgTokens = ({ orgId, orgRole }) => {
|
||||
title: t('操作'),
|
||||
key: 'actions',
|
||||
width: 90,
|
||||
fixed: fixedSide('right'),
|
||||
render: (_, record) => {
|
||||
// 管理员/超管可操作所有Token,普通成员只能操作自己创建的。
|
||||
if (!canOperateRow(record)) return '-';
|
||||
|
||||
Reference in New Issue
Block a user