fix(ui): 修复登录和并发请求并统一页面展示
调整登录流程和请求处理,统一各中心的表格交互、主题样式和页面展示。
This commit is contained in:
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { formatIdReference } from '../../helpers/safeDisplay';
|
||||
import {
|
||||
RefreshCw as ActionRefreshCw,
|
||||
Plus as ActionPlus,
|
||||
@@ -36,7 +37,8 @@ import {
|
||||
import { API } from '../../helpers/api';
|
||||
import { showError, collectPagedItems } from '../../helpers';
|
||||
import OrgPageHeader from './components/OrgPageHeader';
|
||||
import { OrgListCard, OrgRowActions } from './components/OrgListCard';
|
||||
import { TableRowActions } from '@/components/common/table/TableToolbar';
|
||||
import { OrgListCard } from './components/OrgListCard';
|
||||
import OrgModal from './components/OrgModal';
|
||||
import OrgScopedLimitButtons from './components/OrgScopedLimitButtons';
|
||||
|
||||
@@ -105,7 +107,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
const memberNameMap = useMemo(() => {
|
||||
const m = {};
|
||||
members.forEach((mem) => {
|
||||
m[mem.id] = mem.display_name || mem.username || `#${mem.id}`;
|
||||
m[mem.id] = mem.display_name || mem.username || formatIdReference(mem.id);
|
||||
});
|
||||
return m;
|
||||
}, [members]);
|
||||
@@ -303,12 +305,11 @@ const OrgProjects = ({ orgId }) => {
|
||||
return members
|
||||
.filter((mem) => !inProject.has(mem.id))
|
||||
.map((mem) => ({
|
||||
label: mem.display_name || mem.username || `#${mem.id}`,
|
||||
label: mem.display_name || mem.username || formatIdReference(mem.id),
|
||||
value: mem.id,
|
||||
}));
|
||||
}, [members, projectMembers]);
|
||||
|
||||
// 列宽与渲染对齐原型 EnterpriseProjects(150/350/120/140/300,scroll.x 1060);
|
||||
const columns = [
|
||||
{
|
||||
title: t('项目编码'),
|
||||
@@ -351,27 +352,36 @@ const OrgProjects = ({ orgId }) => {
|
||||
},
|
||||
{
|
||||
title: t('操作'),
|
||||
width: 300,
|
||||
width: 168,
|
||||
render: (_, record) => (
|
||||
<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>
|
||||
<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>
|
||||
)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
@@ -491,7 +501,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
{
|
||||
title: t('成员'),
|
||||
dataIndex: 'org_member_id',
|
||||
render: (v) => memberNameMap[v] || `#${v}`,
|
||||
render: (v) => memberNameMap[v] || formatIdReference(v),
|
||||
},
|
||||
{
|
||||
title: t('角色'),
|
||||
@@ -550,7 +560,7 @@ const OrgProjects = ({ orgId }) => {
|
||||
</Tag>
|
||||
) : (
|
||||
<Tag color='blue' size='small'>
|
||||
{projectNameMap[v] || `#${v}`}
|
||||
{projectNameMap[v] || formatIdReference(v)}
|
||||
</Tag>
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user