fix(ui): 完善控制台列表并优化企业中心与个人操作
This commit is contained in:
@@ -5,6 +5,7 @@ import React, {
|
||||
useMemo,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import {
|
||||
Button,
|
||||
Empty,
|
||||
@@ -51,7 +52,12 @@ const jsonList = (value) => {
|
||||
}
|
||||
};
|
||||
|
||||
const OrgSkillLibrary = ({ orgId, orgRole, canAssignSkills = false }) => {
|
||||
const OrgSkillLibrary = ({
|
||||
orgId,
|
||||
orgRole,
|
||||
canAssignSkills = false,
|
||||
actionsHost,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const [statusState] = useContext(StatusContext);
|
||||
@@ -436,23 +442,30 @@ const OrgSkillLibrary = ({ orgId, orgRole, canAssignSkills = false }) => {
|
||||
});
|
||||
return (
|
||||
<div className='org-skill-center-content'>
|
||||
<div className='org-skill-center-actions'>
|
||||
{/* 页内引入:对平台超管这是唯一可用入口(超市页解析不出其企业上下文);
|
||||
{actionsHost &&
|
||||
createPortal(
|
||||
<>
|
||||
{/* 页内引入:对平台超管这是唯一可用入口(超市页解析不出其企业上下文);
|
||||
对普通管理员是就地快速添加。数据复用已加载的 catalog,不额外发请求。 */}
|
||||
{canImport ? (
|
||||
<Button theme='solid' onClick={() => setImportOpen(true)}>
|
||||
{t('引入技能')}
|
||||
</Button>
|
||||
) : null}
|
||||
{/* 浏览完整平台目录(分页/搜索/分类)仍去超市页;超管在那里没有企业
|
||||
{canImport ? (
|
||||
<Button theme='solid' onClick={() => setImportOpen(true)}>
|
||||
{t('引入技能')}
|
||||
</Button>
|
||||
) : null}
|
||||
{/* 浏览完整平台目录(分页/搜索/分类)仍去超市页;超管在那里没有企业
|
||||
上下文,故不对其展示,避免点过去发现无法启用。 */}
|
||||
{selfEnableAllowed && !isPlatformSuperAdmin ? (
|
||||
<Button theme='borderless' onClick={() => navigate('/skill-market')}>
|
||||
{t('浏览技能超市')}
|
||||
</Button>
|
||||
) : null}
|
||||
<PageGuideTrigger guide={guide} />
|
||||
</div>
|
||||
{selfEnableAllowed && !isPlatformSuperAdmin ? (
|
||||
<Button
|
||||
theme='borderless'
|
||||
onClick={() => navigate('/skill-market')}
|
||||
>
|
||||
{t('浏览技能超市')}
|
||||
</Button>
|
||||
) : null}
|
||||
<PageGuideTrigger guide={guide} />
|
||||
</>,
|
||||
actionsHost,
|
||||
)}
|
||||
<PageGuideDrawer guide={guide} />
|
||||
{!loaded ? (
|
||||
<SkillEmptyGuide title={t('正在加载企业技能库')} />
|
||||
|
||||
Reference in New Issue
Block a user