fix(ui): 统一表格筛选分页和用量明细,升级 ESLint
This commit is contained in:
@@ -37,8 +37,7 @@ import {
|
||||
import { API } from '../../helpers/api';
|
||||
import { showError, collectPagedItems } from '../../helpers';
|
||||
import OrgPageHeader from './components/OrgPageHeader';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { OrgListCard } from './components/OrgListCard';
|
||||
import { OrgListCard, OrgRowActions } from './components/OrgListCard';
|
||||
import OrgModal from './components/OrgModal';
|
||||
import OrgScopedLimitButtons from './components/OrgScopedLimitButtons';
|
||||
|
||||
@@ -310,6 +309,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
}));
|
||||
}, [members, projectMembers]);
|
||||
|
||||
// 列宽与渲染对齐原型 EnterpriseProjects(150/350/120/140/300,scroll.x 1060);
|
||||
const columns = [
|
||||
{
|
||||
title: t('项目编码'),
|
||||
@@ -352,36 +352,27 @@ const OrgProjects = ({ orgId }) => {
|
||||
},
|
||||
{
|
||||
title: t('操作'),
|
||||
width: 168,
|
||||
width: 300,
|
||||
render: (_, record) => (
|
||||
<OrgScopedLimitButtons
|
||||
orgId={orgId}
|
||||
record={record}
|
||||
apiBase='/api/org/project'
|
||||
scopeLabel='项目'
|
||||
onSaved={fetchList}
|
||||
renderActions={(limitItems) => (
|
||||
<TableRowActions
|
||||
items={[
|
||||
...limitItems,
|
||||
{
|
||||
key: 'members',
|
||||
label: t('成员'),
|
||||
onClick: () => openMembers(record),
|
||||
},
|
||||
{
|
||||
key: 'tokens',
|
||||
label: t('密钥'),
|
||||
onClick: () => openTokens(record),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Button type='link' size='small' onClick={() => openEdit(record)}>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</TableRowActions>
|
||||
)}
|
||||
/>
|
||||
<OrgRowActions>
|
||||
<OrgScopedLimitButtons
|
||||
orgId={orgId}
|
||||
record={record}
|
||||
apiBase='/api/org/project'
|
||||
scopeLabel='项目'
|
||||
onSaved={fetchList}
|
||||
variant='link'
|
||||
/>
|
||||
<Button type='link' onClick={() => openMembers(record)}>
|
||||
{t('成员')}
|
||||
</Button>
|
||||
<Button type='link' onClick={() => openTokens(record)}>
|
||||
{t('密钥')}
|
||||
</Button>
|
||||
<Button type='link' onClick={() => openEdit(record)}>
|
||||
{t('编辑')}
|
||||
</Button>
|
||||
</OrgRowActions>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -416,8 +407,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
dataSource={list}
|
||||
loading={loading}
|
||||
pagination={{
|
||||
pageSize: 15,
|
||||
showSizeChanger: false,
|
||||
resetOnDataChange: true,
|
||||
showTotal: (total) => t('共 {{total}} 条', { total }),
|
||||
}}
|
||||
rowKey='id'
|
||||
@@ -529,7 +519,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
},
|
||||
]}
|
||||
dataSource={projectMembers}
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
rowKey='org_member_id'
|
||||
size='small'
|
||||
/>
|
||||
@@ -589,7 +579,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
},
|
||||
]}
|
||||
dataSource={orgTokens}
|
||||
pagination={false}
|
||||
pagination={{ resetOnDataChange: true }}
|
||||
rowKey='id'
|
||||
size='small'
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user