fix(ui): 统一三中心表格交互并优化企业及配套页面
- 公共表格:统一分组标签、状态开关和危险操作确认,支持防重复提交和失败重试,修复浮层触发组件的 ref 转发。 - 控制台:统一用户和渠道编辑抽屉,修正分组回填与提交格式,对齐系统设置操作区和预约列表。 - 企业中心:调整技能中心页签和窄屏布局,优化质量监控提示栏、效能分析及成本对账,统一消耗明细和审计日志筛选。 - 用户中心及公共页面:优化密钥和消费记录展示,对齐模型超市筛选,统一公开与内嵌客户端下载页。 - 同步多语言文案、组件规范与移动端视口要求。
This commit is contained in:
@@ -39,9 +39,8 @@ import OrgPanel from './components/OrgPanel';
|
||||
import { StatusContext } from '../../context/Status';
|
||||
import { normalizeSidebarModulesAdmin } from '../../constants/sidebarModules';
|
||||
import './org-skills.css';
|
||||
import OrgBreadcrumb from './components/OrgBreadcrumb';
|
||||
|
||||
const { Title, Text, Paragraph } = Typography;
|
||||
const { Text, Paragraph } = Typography;
|
||||
|
||||
const jsonList = (value) => {
|
||||
try {
|
||||
@@ -436,36 +435,24 @@ const OrgSkillLibrary = ({ orgId, orgRole, canAssignSkills = false }) => {
|
||||
],
|
||||
});
|
||||
return (
|
||||
<main className='org-skills-page'>
|
||||
<header className='org-skills-hero'>
|
||||
<div>
|
||||
<OrgBreadcrumb current={t('企业技能库')} />
|
||||
<Title heading={3}>{t('企业技能库')}</Title>
|
||||
<Paragraph>
|
||||
{t('控制启用状态、版本锁定、紧急停用和企业展示定制。')}
|
||||
</Paragraph>
|
||||
</div>
|
||||
<div className='org-skills-hero-actions'>
|
||||
{/* 页内引入:对平台超管这是唯一可用入口(超市页解析不出其企业上下文);
|
||||
<div className='org-skill-center-content'>
|
||||
<div className='org-skill-center-actions'>
|
||||
{/* 页内引入:对平台超管这是唯一可用入口(超市页解析不出其企业上下文);
|
||||
对普通管理员是就地快速添加。数据复用已加载的 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>
|
||||
</header>
|
||||
{selfEnableAllowed && !isPlatformSuperAdmin ? (
|
||||
<Button theme='borderless' onClick={() => navigate('/skill-market')}>
|
||||
{t('浏览技能超市')}
|
||||
</Button>
|
||||
) : null}
|
||||
<PageGuideTrigger guide={guide} />
|
||||
</div>
|
||||
<PageGuideDrawer guide={guide} />
|
||||
{!loaded ? (
|
||||
<SkillEmptyGuide title={t('正在加载企业技能库')} />
|
||||
@@ -513,51 +500,55 @@ const OrgSkillLibrary = ({ orgId, orgRole, canAssignSkills = false }) => {
|
||||
}
|
||||
>
|
||||
<div className='org-skill-policy-row'>
|
||||
<label>
|
||||
<Text>{t('启用')}</Text>
|
||||
<Switch
|
||||
checked={policy.enabled}
|
||||
onChange={(enabled) => configure(policy, { enabled })}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
<Text>{t('版本策略')}</Text>
|
||||
<Select
|
||||
value={policy.version_policy || 'follow'}
|
||||
onChange={(version_policy) =>
|
||||
<div className='org-skill-policy-fields'>
|
||||
<label>
|
||||
<Text>{t('启用')}</Text>
|
||||
<Switch
|
||||
checked={policy.enabled}
|
||||
onChange={(enabled) => configure(policy, { enabled })}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
<Text>{t('版本策略')}</Text>
|
||||
<Select
|
||||
value={policy.version_policy || 'follow'}
|
||||
onChange={(version_policy) =>
|
||||
configure(policy, {
|
||||
version_policy,
|
||||
locked_version_id:
|
||||
version_policy === 'locked'
|
||||
? catalog.get(policy.skill_id)?.version?.id || 0
|
||||
: 0,
|
||||
})
|
||||
}
|
||||
>
|
||||
<Select.Option value='follow'>
|
||||
{t('跟随平台升级')}
|
||||
</Select.Option>
|
||||
<Select.Option value='locked'>
|
||||
{t('锁定版本')}
|
||||
</Select.Option>
|
||||
</Select>
|
||||
</label>
|
||||
</div>
|
||||
<div className='org-skill-policy-actions'>
|
||||
<Button
|
||||
type='danger'
|
||||
onClick={() =>
|
||||
configure(policy, {
|
||||
version_policy,
|
||||
locked_version_id:
|
||||
version_policy === 'locked'
|
||||
? catalog.get(policy.skill_id)?.version?.id || 0
|
||||
: 0,
|
||||
emergency_stopped: !policy.emergency_stopped,
|
||||
})
|
||||
}
|
||||
>
|
||||
<Select.Option value='follow'>
|
||||
{t('跟随平台升级')}
|
||||
</Select.Option>
|
||||
<Select.Option value='locked'>
|
||||
{t('锁定版本')}
|
||||
</Select.Option>
|
||||
</Select>
|
||||
</label>
|
||||
<Button
|
||||
type='danger'
|
||||
onClick={() =>
|
||||
configure(policy, {
|
||||
emergency_stopped: !policy.emergency_stopped,
|
||||
})
|
||||
}
|
||||
>
|
||||
{policy.emergency_stopped ? t('恢复') : t('紧急停用')}
|
||||
</Button>
|
||||
<Button onClick={() => openCustomization(policy)}>
|
||||
{t('企业定制')}
|
||||
</Button>
|
||||
<Button onClick={() => void openDerived(policy)}>
|
||||
{t('内容派生')}
|
||||
</Button>
|
||||
{policy.emergency_stopped ? t('恢复') : t('紧急停用')}
|
||||
</Button>
|
||||
<Button onClick={() => openCustomization(policy)}>
|
||||
{t('企业定制')}
|
||||
</Button>
|
||||
<Button onClick={() => void openDerived(policy)}>
|
||||
{t('内容派生')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</OrgPanel>
|
||||
))}
|
||||
@@ -816,7 +807,7 @@ const OrgSkillLibrary = ({ orgId, orgRole, canAssignSkills = false }) => {
|
||||
)}
|
||||
</div>
|
||||
</SideSheet>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user