feat: 同步权限管理、企业成员排行与消费计费明细

- 接入平台与企业角色权限,按权限展示菜单、页面及操作。
- 企业成员排行按需加载,翻页沿用同一榜单快照,保留连续名次与前三名样式。
- 更新消费日志的费用明细、超管指标和官方价格汇率设置,补齐翻译与回归测试。
This commit is contained in:
qiubaishen
2026-11-25 21:08:24 +08:00
parent ed693a450a
commit 870b51d054
134 changed files with 20354 additions and 4133 deletions
+16 -8
View File
@@ -21,6 +21,7 @@ import {
PageGuideTrigger,
} from '../../components/common/PageGuide';
import './org-experts.css';
import { usePerm } from '../../authz';
import OrgModal from './components/OrgModal';
import OrgPageHeader from './components/OrgPageHeader';
import OrgStateBlock from './components/OrgStateBlock';
@@ -68,6 +69,9 @@ const csv = (value) =>
const OrgExperts = ({ orgId }) => {
const { t } = useTranslation();
// 按钮级权限(权限重构 P2-7):旧路径随页面权限放行,切新体系后按各自权限点
const canCreate = usePerm('org.expert.create', true);
const canSubmit = usePerm('org.expert.submit', true);
const headers = useMemo(() => ({ 'X-Org-Id': String(orgId) }), [orgId]);
const [definitions, setDefinitions] = useState([]);
const [sources, setSources] = useState([]);
@@ -256,7 +260,7 @@ const OrgExperts = ({ orgId }) => {
detail: t('选择一个平台专家作为安全基线开始创建'),
done: definitions.length > 0,
cta: t('去创建专家'),
onAction: () => beginVersion(null),
onAction: canCreate ? () => beginVersion(null) : undefined,
points: [
t('专家标识创建后不可更改;「平台来源」决定继承哪套安全基线'),
t('填写中英文名称、说明与适用场景,成员在云端大脑会看到这些信息'),
@@ -324,9 +328,11 @@ const OrgExperts = ({ orgId }) => {
)}
actions={
<>
<Button theme='solid' onClick={() => beginVersion(null)}>
{t('创建企业专家')}
</Button>
{canCreate && (
<Button theme='solid' onClick={() => beginVersion(null)}>
{t('创建企业专家')}
</Button>
)}
<PageGuideTrigger guide={guide} />
</>
}
@@ -366,7 +372,7 @@ const OrgExperts = ({ orgId }) => {
<div key={version.id}>
<span>v{version.version}</span>
<Tag variant='filled'>{version.status}</Tag>
{version.status === 'draft' && (
{canSubmit && version.status === 'draft' && (
<Button
type='link'
size='small'
@@ -379,9 +385,11 @@ const OrgExperts = ({ orgId }) => {
))}
</div>
<div className='org-expert-card-actions'>
<Button onClick={() => beginVersion(view)}>
{t('创建新版本')}
</Button>
{canCreate && (
<Button onClick={() => beginVersion(view)}>
{t('创建新版本')}
</Button>
)}
</div>
</OrgPanel>
))}