feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -54,7 +54,6 @@ export default function WebsiteSettings() {
|
||||
const [dirty, setDirty] = useState(false);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [loadError, setLoadError] = useState('');
|
||||
const [loadVersion, setLoadVersion] = useState(0);
|
||||
const originalConfig = useRef({});
|
||||
const savePending = useRef(false);
|
||||
useEffect(() => {
|
||||
@@ -79,7 +78,7 @@ export default function WebsiteSettings() {
|
||||
return () => {
|
||||
active = false;
|
||||
};
|
||||
}, [loadVersion]);
|
||||
}, []);
|
||||
const disabled = saving || loading || Boolean(loadError);
|
||||
useEffect(() => {
|
||||
if (!dirty) return;
|
||||
@@ -161,24 +160,17 @@ export default function WebsiteSettings() {
|
||||
childStyle={{ flex: 1, display: 'flex', flexDirection: 'column' }}
|
||||
data-testid='website-settings-loading'
|
||||
>
|
||||
<Card className='website-settings-card'>
|
||||
<Typography.Title heading={4} style={{ marginBottom: 8 }}>
|
||||
{t('官网设置')}
|
||||
</Typography.Title>
|
||||
<Typography.Paragraph type='tertiary'>
|
||||
{t('配置官网展示内容与商务联系信息')}
|
||||
</Typography.Paragraph>
|
||||
<Card
|
||||
className={`website-settings-card${loadError ? ' website-settings-card--error' : ''}`}
|
||||
>
|
||||
{loadError ? (
|
||||
<Banner
|
||||
type='danger'
|
||||
closeIcon={null}
|
||||
description={t(loadError)}
|
||||
fullMode={false}
|
||||
>
|
||||
<Button onClick={() => setLoadVersion((version) => version + 1)}>
|
||||
{t('重新加载')}
|
||||
</Button>
|
||||
</Banner>
|
||||
className='website-settings-load-error'
|
||||
style={{ marginBlock: '0 8px' }}
|
||||
/>
|
||||
) : null}
|
||||
<Tabs type='line' activeKey={activeTab} onChange={setActiveTab}>
|
||||
{TABS.map((item) => (
|
||||
@@ -217,6 +209,14 @@ export default function WebsiteSettings() {
|
||||
>
|
||||
<WebsiteField
|
||||
name={name}
|
||||
labelSuffix={
|
||||
activeTab === 'home' && name === 'teamMembers' ? (
|
||||
<span className='website-research-ratio-hint'>
|
||||
({t('研发人员占比')}:
|
||||
{values.researchRatio || t('未配置')})
|
||||
</span>
|
||||
) : undefined
|
||||
}
|
||||
value={values[name]}
|
||||
error={errors[name]}
|
||||
disabled={disabled}
|
||||
@@ -239,12 +239,6 @@ export default function WebsiteSettings() {
|
||||
/>
|
||||
)}
|
||||
</WebsiteField>
|
||||
{activeTab === 'home' && name === 'teamMembers' && (
|
||||
<Typography.Text type='tertiary' size='small'>
|
||||
{t('研发人员占比')}:
|
||||
{values.researchRatio || t('未配置')}
|
||||
</Typography.Text>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -256,6 +250,10 @@ export default function WebsiteSettings() {
|
||||
style={{
|
||||
marginTop: 10,
|
||||
marginBottom: 2,
|
||||
marginBlock:
|
||||
activeTab === 'insights'
|
||||
? '0 var(--website-insights-footer-gap)'
|
||||
: undefined,
|
||||
paddingTop: 2,
|
||||
paddingBottom: 2,
|
||||
}}
|
||||
@@ -263,7 +261,7 @@ export default function WebsiteSettings() {
|
||||
/>
|
||||
<div
|
||||
className='flex justify-center gap-2'
|
||||
style={{ marginTop: 18 }}
|
||||
style={{ marginTop: activeTab === 'insights' ? 0 : 18 }}
|
||||
>
|
||||
<Button onClick={clear} disabled={disabled}>
|
||||
{t('清空')}
|
||||
|
||||
Reference in New Issue
Block a user