73 lines
2.3 KiB
React
73 lines
2.3 KiB
React
import React, { useState } from 'react';
|
||
import { useTranslation } from 'react-i18next';
|
||
import OrgPageHeader from './components/OrgPageHeader';
|
||
import OrgSubpageTabs from './components/OrgSubpageTabs';
|
||
import OrgMySkills from './OrgMySkills';
|
||
import OrgMyConnectors from './OrgMyConnectors';
|
||
import './org-my-capabilities.css';
|
||
|
||
/**
|
||
* 我的 AI 能力:成员自助视图的合并入口(我的技能 + 业务系统授权)。
|
||
*
|
||
* 两个页签都是 isMemberActor 守卫的只读/自助页,各自受不同的企业功能位
|
||
* (skill_market / connector)与站点级模块开关控制,由 showSkills /
|
||
* showConnectors 决定可见性。旧路由 /org/my-skills、/org/my-connectors
|
||
* 重定向到对应页签。
|
||
*/
|
||
const OrgMyCapabilities = ({
|
||
orgId,
|
||
showSkills = true,
|
||
showConnectors = true,
|
||
}) => {
|
||
const { t } = useTranslation();
|
||
const [skillsActionsHost, setSkillsActionsHost] = useState(null);
|
||
const [connectorsActionsHost, setConnectorsActionsHost] = useState(null);
|
||
return (
|
||
<main className='uc-page oc-page org-capabilities-page'>
|
||
<OrgSubpageTabs
|
||
renderHeader={({ key, label, subtitle }) => (
|
||
<OrgPageHeader
|
||
title={label}
|
||
subtitle={subtitle}
|
||
actions={
|
||
<div
|
||
key={key}
|
||
ref={
|
||
key === 'skills'
|
||
? setSkillsActionsHost
|
||
: setConnectorsActionsHost
|
||
}
|
||
/>
|
||
}
|
||
/>
|
||
)}
|
||
tabs={[
|
||
showSkills && {
|
||
key: 'skills',
|
||
label: t('我的技能'),
|
||
subtitle: t(
|
||
'这里展示与任务运行时相同的有效能力集,以及每项技能为什么对你生效。',
|
||
),
|
||
node: <OrgMySkills orgId={orgId} actionsHost={skillsActionsHost} />,
|
||
},
|
||
showConnectors && {
|
||
key: 'connectors',
|
||
label: t('业务系统授权'),
|
||
subtitle: t(
|
||
'查看专家在任务中可代表你调用的业务系统、方法和确认策略。',
|
||
),
|
||
node: (
|
||
<OrgMyConnectors
|
||
orgId={orgId}
|
||
actionsHost={connectorsActionsHost}
|
||
/>
|
||
),
|
||
},
|
||
]}
|
||
/>
|
||
</main>
|
||
);
|
||
};
|
||
|
||
export default OrgMyCapabilities;
|