fix(ui): 完善界面交互与开发配置

This commit is contained in:
zhanjunhao
2026-11-18 19:09:00 +08:00
parent ef3769e8b0
commit d071672c83
87 changed files with 2212 additions and 2823 deletions
+25 -15
View File
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
import { theme } from 'antd';
import { Button, Progress, Tag, Timeline, Typography } from '@/components/ui';
import {
IconAlertTriangle,
@@ -35,13 +36,14 @@ import './skill-components.css';
const { Text, Title, Paragraph } = Typography;
const SemanticTag = ({ value, fallback, className = '' }) => {
const SemanticTag = ({ value, fallback, className = '', style }) => {
const { t } = useTranslation();
const token = getSkillTagToken(value);
return (
<Tag
color={token.color}
className={className}
style={style}
aria-label={t(fallback || token.label)}
>
{t(fallback || token.label)}
@@ -62,20 +64,26 @@ export const ScopeSourceBadge = ({ source, detail }) => {
);
};
export const LicenseBadge = ({ expression, decision }) => (
<span className='skill-license-badge'>
<SemanticTag
value={
decision === 'blocked'
? 'deny'
: decision === 'approved'
? 'allow'
: 'license_pending'
}
fallback={expression || '许可证未知'}
/>
</span>
);
export const LicenseBadge = ({ expression, decision }) => {
const { token } = theme.useToken();
const value =
decision === 'blocked'
? 'deny'
: decision === 'approved'
? 'allow'
: 'license_pending';
const { color } = getSkillTagToken(value);
return (
<span className='skill-license-badge'>
<SemanticTag
value={value}
fallback={expression || '许可证未知'}
// 第 9 档在浅色下更深、暗色下更亮,保证小字号许可证的对比度。
style={{ color: token[`${color}-9`] }}
/>
</span>
);
};
export const RiskBadge = ({ conclusion }) => (
<SemanticTag
@@ -168,6 +176,7 @@ export const GrayscaleProgress = ({ percent = 0, label }) => (
);
export const SkillDetailSideSheet = ({
className,
visible,
onCancel,
title,
@@ -175,6 +184,7 @@ export const SkillDetailSideSheet = ({
footer,
}) => (
<OrgSideSheet
className={className}
visible={visible}
onCancel={onCancel}
title={title}