fix(ui): 完善界面交互与开发配置
This commit is contained in:
@@ -19,6 +19,13 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Tooltip } from 'antd';
|
||||
import {
|
||||
ChartNoAxesCombined,
|
||||
Network,
|
||||
ReceiptText,
|
||||
Wallet,
|
||||
} from 'lucide-react';
|
||||
import { API } from '../../helpers';
|
||||
import { shouldLoadHistoricalTrend } from './dashboardHistory';
|
||||
import './dashboard.css';
|
||||
@@ -90,7 +97,10 @@ export default function Dashboard({
|
||||
signal: controller.signal,
|
||||
},
|
||||
);
|
||||
if (!response.data?.success || (response.data.data != null && !Array.isArray(response.data.data))) {
|
||||
if (
|
||||
!response.data?.success ||
|
||||
(response.data.data != null && !Array.isArray(response.data.data))
|
||||
) {
|
||||
throw new Error('Invalid statement response');
|
||||
}
|
||||
return response.data.data || [];
|
||||
@@ -292,7 +302,14 @@ export default function Dashboard({
|
||||
failed: failedMonths.includes(key),
|
||||
estimated: index === 5,
|
||||
}));
|
||||
const chartMax = Math.max(1, ...chart.map((row) => Math.abs(row.value)));
|
||||
const chartMax =
|
||||
Math.max(0, ...chart.map((row) => Math.abs(row.value))) || 1e10;
|
||||
const axisFormat = new Intl.NumberFormat(i18n.language, {
|
||||
maximumFractionDigits: Math.min(
|
||||
6,
|
||||
Math.max(2, 2 - Math.floor(Math.log10(chartMax / 1e10))),
|
||||
),
|
||||
});
|
||||
|
||||
return (
|
||||
<div className='commission-dashboard'>
|
||||
@@ -300,20 +317,34 @@ export default function Dashboard({
|
||||
<h3 id='commission-month-overview'>{t('本月概览')}</h3>
|
||||
<div className='commission-dashboard-core'>
|
||||
<div className='commission-dashboard-stat'>
|
||||
<span>{t('预估有效销售额')}</span>
|
||||
<span>
|
||||
<Wallet size={16} aria-hidden />
|
||||
{t('预估有效销售额')}
|
||||
</span>
|
||||
<strong>{hasSales ? money(sales) : '—'}</strong>
|
||||
{!hasSales && <small>{t('暂无销售额数据')}</small>}
|
||||
</div>
|
||||
<div className='commission-dashboard-stat commission-dashboard-stat--featured'>
|
||||
<span>{t('预估应付提成')}</span>
|
||||
<span>
|
||||
<Wallet size={16} aria-hidden />
|
||||
{t('预估应付提成')}
|
||||
</span>
|
||||
<strong>{money(estimated)}</strong>
|
||||
</div>
|
||||
<div className='commission-dashboard-stat'>
|
||||
<span>{t('占销售额比例')}</span>
|
||||
<span>
|
||||
<ChartNoAxesCombined size={16} aria-hidden />
|
||||
{t('占销售额比例')}
|
||||
</span>
|
||||
<strong>
|
||||
{hasSales && sales > 0
|
||||
? `${numberFormat.format((estimated / sales) * 100)}%`
|
||||
: '—'}
|
||||
{hasSales && sales > 0 ? (
|
||||
<>
|
||||
{numberFormat.format((estimated / sales) * 100)}
|
||||
<small>%</small>
|
||||
</>
|
||||
) : (
|
||||
'—'
|
||||
)}
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
@@ -322,18 +353,26 @@ export default function Dashboard({
|
||||
[
|
||||
'生效合作伙伴',
|
||||
partners.filter((row) => row.status === 'active').length,
|
||||
'家',
|
||||
],
|
||||
[
|
||||
'正式归属客户',
|
||||
assignments.filter(
|
||||
(row) => row.status === 'formal' && !row.ended_at,
|
||||
).length,
|
||||
'个',
|
||||
],
|
||||
['保护期客户', protectedAssignments.length],
|
||||
].map(([label, count]) => (
|
||||
['保护期客户', protectedAssignments.length, '个'],
|
||||
].map(([label, count, unit]) => (
|
||||
<div className='commission-dashboard-stat' key={label}>
|
||||
<span>{t(label)}</span>
|
||||
<strong>{count}</strong>
|
||||
<span>
|
||||
<Network size={16} aria-hidden />
|
||||
{t(label)}
|
||||
</span>
|
||||
<strong>
|
||||
{count}
|
||||
<small>{t(unit)}</small>
|
||||
</strong>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -359,6 +398,15 @@ export default function Dashboard({
|
||||
<span>{t(todo.label)}</span>
|
||||
<strong className={`commission-dashboard-${todo.tone}`}>
|
||||
{todo.rows.length}
|
||||
<small>
|
||||
{t(
|
||||
todo.target === 'partners'
|
||||
? '家'
|
||||
: todo.target === 'exceptions'
|
||||
? '条'
|
||||
: '个',
|
||||
)}
|
||||
</small>
|
||||
</strong>
|
||||
</button>
|
||||
))}
|
||||
@@ -373,28 +421,30 @@ export default function Dashboard({
|
||||
{t(todo.label)}
|
||||
</span>
|
||||
<h4>
|
||||
{t('待处理 {{count}} 项', { count: todo.rows.length })}
|
||||
{todo.rows.length > 0
|
||||
? todo.rows
|
||||
.slice(0, 2)
|
||||
.map((row) =>
|
||||
t('{{partner}} · {{month}}', {
|
||||
partner:
|
||||
partnerById.get(String(row.partner_id))?.name ||
|
||||
t('伙伴 #{{id}}', { id: row.partner_id }),
|
||||
month: row.statement_month,
|
||||
}),
|
||||
)
|
||||
.join(' / ')
|
||||
: t('待处理 {{count}} 项', { count: todo.rows.length })}
|
||||
</h4>
|
||||
<p>{t(todo.description)}</p>
|
||||
{todo.rows.length > 0 && (
|
||||
<small>
|
||||
{todo.rows
|
||||
.slice(0, 2)
|
||||
.map((row) =>
|
||||
t('{{partner}} · {{month}}', {
|
||||
partner:
|
||||
partnerById.get(String(row.partner_id))?.name ||
|
||||
t('伙伴 #{{id}}', { id: row.partner_id }),
|
||||
month: row.statement_month,
|
||||
}),
|
||||
)
|
||||
.join(' / ')}
|
||||
{t('待处理 {{count}} 项', { count: todo.rows.length })}
|
||||
</small>
|
||||
)}
|
||||
</div>
|
||||
<button
|
||||
type='button'
|
||||
className={`commission-dashboard-button${todo.rows.length ? ' commission-dashboard-button--primary' : ''}`}
|
||||
<Button
|
||||
type={todo.rows.length ? 'primary' : 'default'}
|
||||
size='small'
|
||||
onClick={() => navigateTodo(todo)}
|
||||
aria-label={t('{{action}}:{{label}},{{count}} 项', {
|
||||
action: t(todo.action),
|
||||
@@ -403,7 +453,7 @@ export default function Dashboard({
|
||||
})}
|
||||
>
|
||||
{t(todo.action)}
|
||||
</button>
|
||||
</Button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -427,7 +477,10 @@ export default function Dashboard({
|
||||
})
|
||||
}
|
||||
>
|
||||
<span>{t('未绑定档位渠道')}</span>
|
||||
<span>
|
||||
<ReceiptText size={16} aria-hidden />
|
||||
{t('未绑定档位渠道')}
|
||||
</span>
|
||||
<strong
|
||||
className={
|
||||
unboundChannels.length
|
||||
@@ -436,6 +489,7 @@ export default function Dashboard({
|
||||
}
|
||||
>
|
||||
{unboundChannels.length}
|
||||
<small>{t('条')}</small>
|
||||
</strong>
|
||||
<small>{t('查看渠道档位')} →</small>
|
||||
</button>
|
||||
@@ -450,7 +504,10 @@ export default function Dashboard({
|
||||
})
|
||||
}
|
||||
>
|
||||
<span>{t('未绑定档位等级')}</span>
|
||||
<span>
|
||||
<ReceiptText size={16} aria-hidden />
|
||||
{t('未绑定档位等级')}
|
||||
</span>
|
||||
<strong
|
||||
className={
|
||||
unboundLevels.length
|
||||
@@ -459,6 +516,7 @@ export default function Dashboard({
|
||||
}
|
||||
>
|
||||
{unboundLevels.length}
|
||||
<small>{t('个')}</small>
|
||||
</strong>
|
||||
<p>{t('不含跟随模型或渠道档位的默认等级')}</p>
|
||||
<small>{t('查看等级档位')} →</small>
|
||||
@@ -483,67 +541,85 @@ export default function Dashboard({
|
||||
months: failedMonths.join('、'),
|
||||
})}
|
||||
</span>
|
||||
<button
|
||||
type='button'
|
||||
className='commission-dashboard-button'
|
||||
onClick={() => setRetry((value) => value + 1)}
|
||||
>
|
||||
<Button size='small' onClick={() => setRetry((value) => value + 1)}>
|
||||
{t('重试')}
|
||||
</button>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<div className='commission-dashboard-chart' aria-busy={trendLoading}>
|
||||
{chart.map((row) => (
|
||||
<button
|
||||
type='button'
|
||||
key={row.month}
|
||||
className={`commission-dashboard-chart-column${row.estimated ? ' commission-dashboard-chart-column--current' : ''}`}
|
||||
onClick={() => onNavigate?.('bills', { month: row.month })}
|
||||
aria-label={t('{{month}}:{{amount}},{{status}}', {
|
||||
month: row.month,
|
||||
amount: money(row.value),
|
||||
status: t(
|
||||
row.failed
|
||||
? '加载失败'
|
||||
<div className='commission-dashboard-chart-frame'>
|
||||
<div className='commission-dashboard-chart-axis' aria-hidden>
|
||||
{[4, 3, 2, 1, 0].map((tick) => (
|
||||
<span key={tick}>
|
||||
{axisFormat.format((chartMax * tick) / 4e10)}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<div className='commission-dashboard-chart' aria-busy={trendLoading}>
|
||||
{chart.map((row) => {
|
||||
const pending = trendLoading && !row.estimated;
|
||||
const valueLabel = row.failed || pending ? '—' : money(row.value);
|
||||
const statusLabel = t(
|
||||
row.failed
|
||||
? '加载失败'
|
||||
: pending
|
||||
? '加载中'
|
||||
: row.estimated
|
||||
? '实时预估'
|
||||
: row.hasData
|
||||
? '账单应付'
|
||||
: '暂无数据',
|
||||
),
|
||||
})}
|
||||
>
|
||||
<span className='commission-dashboard-chart-plot'>
|
||||
<span
|
||||
className='commission-dashboard-chart-bar'
|
||||
style={{
|
||||
height: `${Math.max(row.value ? 2 : 0, (Math.abs(row.value) / chartMax) * 100)}%`,
|
||||
}}
|
||||
);
|
||||
return (
|
||||
<Tooltip
|
||||
key={row.month}
|
||||
trigger={['hover', 'focus']}
|
||||
title={`${row.month} · ${valueLabel} · ${statusLabel}`}
|
||||
>
|
||||
<span className='commission-dashboard-chart-value'>
|
||||
{row.failed || (trendLoading && !row.estimated)
|
||||
? '—'
|
||||
: numberFormat.format(row.value / 1e10)}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<span className='commission-dashboard-chart-month'>
|
||||
{row.month.slice(5)}
|
||||
{t('月')}
|
||||
</span>
|
||||
<span className='commission-dashboard-chart-status'>
|
||||
{row.failed
|
||||
? t('加载失败')
|
||||
: row.estimated
|
||||
? t('预估')
|
||||
: trendLoading
|
||||
? t('加载中')
|
||||
: !row.hasData
|
||||
? t('暂无数据')
|
||||
: '\u00a0'}
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
<button
|
||||
type='button'
|
||||
key={row.month}
|
||||
className={`commission-dashboard-chart-column${row.estimated ? ' commission-dashboard-chart-column--current' : ''}`}
|
||||
onClick={() => onNavigate?.('bills', { month: row.month })}
|
||||
aria-label={t('{{month}}:{{amount}},{{status}}', {
|
||||
month: row.month,
|
||||
amount: valueLabel,
|
||||
status: statusLabel,
|
||||
})}
|
||||
>
|
||||
<span className='commission-dashboard-chart-plot'>
|
||||
<span
|
||||
className='commission-dashboard-chart-bar'
|
||||
style={{
|
||||
height: `${Math.max(row.value ? 2 : 0, (Math.abs(row.value) / chartMax) * 100)}%`,
|
||||
}}
|
||||
>
|
||||
<span className='commission-dashboard-chart-value'>
|
||||
{row.failed || (trendLoading && !row.estimated)
|
||||
? '—'
|
||||
: numberFormat.format(row.value / 1e10)}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<span className='commission-dashboard-chart-month'>
|
||||
{row.month.slice(5)}
|
||||
{t('月')}
|
||||
</span>
|
||||
<span className='commission-dashboard-chart-status'>
|
||||
{row.failed
|
||||
? t('加载失败')
|
||||
: row.estimated
|
||||
? t('预估')
|
||||
: trendLoading
|
||||
? t('加载中')
|
||||
: !row.hasData
|
||||
? t('暂无数据')
|
||||
: '\u00a0'}
|
||||
</span>
|
||||
</button>
|
||||
</Tooltip>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -19,8 +19,15 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Card, Empty, Input, Select, Table } from 'antd';
|
||||
import { Search } from 'lucide-react';
|
||||
import { Button, Empty, Input, Select } from 'antd';
|
||||
import { Table } from '@/components/ui';
|
||||
import { Search } from '@/components/common/icons/ActionIcons';
|
||||
import {
|
||||
ConsoleCard,
|
||||
ConsoleSearchBar,
|
||||
ConsoleSearchActions,
|
||||
ConsoleTabs,
|
||||
} from '../../components/console/ConsolePrimitives';
|
||||
import { filterCommissionRows, matchesStatus } from './listFilters';
|
||||
|
||||
export default function ListPanel({
|
||||
@@ -115,41 +122,43 @@ export default function ListPanel({
|
||||
setPage(1);
|
||||
server?.onChange({ ...draft, status, page: 1 });
|
||||
};
|
||||
const reset = () => {
|
||||
setDraft({ query: '', type: '', partner: '' });
|
||||
setFilters({});
|
||||
setStatus('all');
|
||||
server?.onChange({ status: 'all', page: 1 });
|
||||
setScopedIds(null);
|
||||
setPage(1);
|
||||
};
|
||||
const [filtersOpen, setFiltersOpen] = useState(false);
|
||||
return (
|
||||
<Card
|
||||
className={`commission-card commission-list commission-list--${section}`}
|
||||
>
|
||||
<div className={`commission-list commission-list--${section}`}>
|
||||
{tabSets[section] && (
|
||||
<div
|
||||
<ConsoleTabs
|
||||
className='commission-list-tabs'
|
||||
role='tablist'
|
||||
aria-label={t('状态筛选')}
|
||||
>
|
||||
{tabSets[section].map(([key, label]) => (
|
||||
<button
|
||||
key={key}
|
||||
type='button'
|
||||
role='tab'
|
||||
aria-selected={status === key}
|
||||
className={status === key ? 'is-active' : ''}
|
||||
onClick={() => {
|
||||
setStatus(key);
|
||||
setPage(1);
|
||||
server?.onChange({ ...filters, status: key, page: 1 });
|
||||
}}
|
||||
>
|
||||
{t(label)}
|
||||
activeKey={status}
|
||||
onChange={(key) => {
|
||||
setStatus(key);
|
||||
setPage(1);
|
||||
server?.onChange({ ...filters, status: key, page: 1 });
|
||||
}}
|
||||
items={tabSets[section].map(([key, label]) => ({
|
||||
key,
|
||||
label: (
|
||||
<span>
|
||||
{server
|
||||
? server.counts[
|
||||
{ enabled: 'active', scheduled: 'pending' }[key] || key
|
||||
] || 0
|
||||
: rows.filter((row) => matchesStatus(row, key, section))
|
||||
.length}
|
||||
{t(label)}{' '}
|
||||
<span className='commission-tab-count'>
|
||||
{server
|
||||
? server.counts[
|
||||
{ enabled: 'active', scheduled: 'pending' }[key] || key
|
||||
] || 0
|
||||
: rows.filter((row) => matchesStatus(row, key, section))
|
||||
.length}
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
),
|
||||
}))}
|
||||
/>
|
||||
)}
|
||||
{scopedIds && (
|
||||
<div className='commission-context-filter'>
|
||||
@@ -166,79 +175,109 @@ export default function ListPanel({
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<div className='commission-filter-bar'>
|
||||
<Input
|
||||
prefix={<Search size={16} aria-hidden />}
|
||||
value={draft.query}
|
||||
onChange={(event) => set('query', event.target.value)}
|
||||
onPressEnter={query}
|
||||
allowClear
|
||||
placeholder={t(placeholders[section])}
|
||||
aria-label={t(placeholders[section])}
|
||||
/>
|
||||
{typeOptions && (
|
||||
<Select
|
||||
aria-label={t('类型筛选')}
|
||||
value={draft.type}
|
||||
onChange={(value) => set('type', value)}
|
||||
options={[
|
||||
{
|
||||
value: '',
|
||||
label: t(
|
||||
section === 'assignments'
|
||||
? '全部客户类型'
|
||||
: section === 'tiers'
|
||||
? '全部来源'
|
||||
: '全部类型',
|
||||
),
|
||||
},
|
||||
...typeOptions.map(([value, label]) => ({
|
||||
value,
|
||||
label: t(label),
|
||||
})),
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
{section === 'partners' && (
|
||||
<Select
|
||||
aria-label={t('状态筛选')}
|
||||
value={draft.status || ''}
|
||||
onChange={(value) => set('status', value)}
|
||||
options={['', 'draft', 'active', 'suspended', 'terminated'].map(
|
||||
(value, i) => ({
|
||||
value,
|
||||
label: t(['全部状态', '草稿', '生效中', '已暂停', '已终止'][i]),
|
||||
}),
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
{['assignments', 'bills', 'adjustments'].includes(section) && (
|
||||
<Select
|
||||
aria-label={t('合作伙伴筛选')}
|
||||
showSearch={{ optionFilterProp: 'label' }}
|
||||
value={draft.partner}
|
||||
onChange={(value) => set('partner', value)}
|
||||
options={[
|
||||
{ value: '', label: t('全部合作伙伴') },
|
||||
...partners.map((row) => ({ value: row.id, label: row.name })),
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
<Button type='primary' onClick={query}>
|
||||
{t('查询')}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setDraft({ query: '', type: '', partner: '' });
|
||||
setFilters({});
|
||||
setStatus('all');
|
||||
server?.onChange({ status: 'all', page: 1 });
|
||||
setScopedIds(null);
|
||||
setPage(1);
|
||||
<Button
|
||||
className='commission-filter-toggle'
|
||||
aria-expanded={filtersOpen}
|
||||
onClick={() => setFiltersOpen((value) => !value)}
|
||||
>
|
||||
{t(filtersOpen ? '隐藏操作项' : '显示操作项')}
|
||||
</Button>
|
||||
<ConsoleSearchBar
|
||||
className={`commission-filter-card${filtersOpen ? ' is-open' : ''}`}
|
||||
>
|
||||
<form
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
query();
|
||||
}}
|
||||
>
|
||||
{t('重置')}
|
||||
</Button>
|
||||
<div className='console-search-fields'>
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('搜索')}</span>
|
||||
<Input
|
||||
prefix={<Search size={16} aria-hidden />}
|
||||
value={draft.query}
|
||||
onChange={(event) => set('query', event.target.value)}
|
||||
allowClear
|
||||
placeholder={t(placeholders[section])}
|
||||
aria-label={t(placeholders[section])}
|
||||
/>
|
||||
</label>
|
||||
{typeOptions && (
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('类型筛选')}</span>
|
||||
<Select
|
||||
aria-label={t('类型筛选')}
|
||||
value={draft.type}
|
||||
onChange={(value) => set('type', value)}
|
||||
options={[
|
||||
{
|
||||
value: '',
|
||||
label: t(
|
||||
section === 'assignments'
|
||||
? '全部客户类型'
|
||||
: section === 'tiers'
|
||||
? '全部来源'
|
||||
: '全部类型',
|
||||
),
|
||||
},
|
||||
...typeOptions.map(([value, label]) => ({
|
||||
value,
|
||||
label: t(label),
|
||||
})),
|
||||
]}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
{section === 'partners' && (
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('状态筛选')}</span>
|
||||
<Select
|
||||
aria-label={t('状态筛选')}
|
||||
value={draft.status || ''}
|
||||
onChange={(value) => set('status', value)}
|
||||
options={[
|
||||
'',
|
||||
'draft',
|
||||
'active',
|
||||
'suspended',
|
||||
'terminated',
|
||||
].map((value, i) => ({
|
||||
value,
|
||||
label: t(
|
||||
['全部状态', '草稿', '生效中', '已暂停', '已终止'][i],
|
||||
),
|
||||
}))}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
{['assignments', 'bills', 'adjustments'].includes(section) && (
|
||||
<label className='console-search-field commission-search-field'>
|
||||
<span>{t('合作伙伴筛选')}</span>
|
||||
<Select
|
||||
aria-label={t('合作伙伴筛选')}
|
||||
showSearch={{ optionFilterProp: 'label' }}
|
||||
value={draft.partner}
|
||||
onChange={(value) => set('partner', value)}
|
||||
options={[
|
||||
{ value: '', label: t('全部合作伙伴') },
|
||||
...partners.map((row) => ({
|
||||
value: row.id,
|
||||
label: row.name,
|
||||
})),
|
||||
]}
|
||||
/>
|
||||
</label>
|
||||
)}
|
||||
</div>
|
||||
<ConsoleSearchActions
|
||||
onReset={reset}
|
||||
searchLabel='查询'
|
||||
loading={server?.busy}
|
||||
/>
|
||||
</form>
|
||||
</ConsoleSearchBar>
|
||||
<ConsoleCard className='commission-card commission-list-card'>
|
||||
<div className='commission-filter-end'>
|
||||
<span>
|
||||
{t('共 {{count}} 条', {
|
||||
@@ -255,35 +294,41 @@ export default function ListPanel({
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<Table
|
||||
rowKey='id'
|
||||
loading={server?.busy}
|
||||
columns={columns}
|
||||
dataSource={filtered}
|
||||
size='middle'
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{
|
||||
size: 'small',
|
||||
pageSize: server ? 100 : 10,
|
||||
total: server ? server.total : filtered.length,
|
||||
current: server ? server.page : page,
|
||||
onChange: (next) => {
|
||||
setPage(next);
|
||||
server?.onChange({ ...filters, status, page: next });
|
||||
},
|
||||
showSizeChanger: false,
|
||||
showTotal: (total) => t('共 {{total}} 条', { total }),
|
||||
}}
|
||||
locale={{
|
||||
emptyText: (
|
||||
<Table
|
||||
rowKey='id'
|
||||
loading={server?.busy}
|
||||
columns={columns.map((column) => ({
|
||||
width: 160,
|
||||
...column,
|
||||
...(/(?:_uyuan|_yuan|_bps|amount|count|quantity)$/.test(
|
||||
column.dataIndex || '',
|
||||
)
|
||||
? { align: 'right' }
|
||||
: {}),
|
||||
}))}
|
||||
dataSource={filtered}
|
||||
size='middle'
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{
|
||||
size: 'small',
|
||||
pageSize: server ? 100 : 10,
|
||||
total: server ? server.total : filtered.length,
|
||||
current: server ? server.page : page,
|
||||
onChange: (next) => {
|
||||
setPage(next);
|
||||
server?.onChange({ ...filters, status, page: next });
|
||||
},
|
||||
showSizeChanger: false,
|
||||
showTotal: (total) => t('共 {{total}} 条', { total }),
|
||||
}}
|
||||
empty={
|
||||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
description={t('暂无数据')}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Card>
|
||||
}
|
||||
/>
|
||||
</ConsoleCard>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,13 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Alert, Button, Descriptions, Drawer, Spin, Table, Tag } from 'antd';
|
||||
import { Button, Descriptions, Spin, Tag } from 'antd';
|
||||
import { Table } from '@/components/ui';
|
||||
import {
|
||||
ConsoleAlert as Alert,
|
||||
ConsoleDrawer as Drawer,
|
||||
} from '../../components/console/ConsolePrimitives';
|
||||
import { useCommissionThemeStyle } from './commissionTheme';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { commissionActorName, commissionLabel, statusTagColor } from './labels';
|
||||
import { EvidenceLink } from './operations';
|
||||
@@ -31,6 +37,7 @@ export default function PartnerDetail({
|
||||
onClose,
|
||||
onEdit,
|
||||
}) {
|
||||
const themeStyle = useCommissionThemeStyle();
|
||||
const { t, i18n } = useTranslation();
|
||||
const [record, setRecord] = useState(null);
|
||||
const [error, setError] = useState('');
|
||||
@@ -65,6 +72,7 @@ export default function PartnerDetail({
|
||||
);
|
||||
return (
|
||||
<Drawer
|
||||
rootStyle={themeStyle}
|
||||
rootClassName='commission-profile-drawer commission-detail-drawer'
|
||||
title={
|
||||
<span>
|
||||
|
||||
@@ -58,6 +58,9 @@ import { BillingColumns, AdjustmentColumns } from './operations';
|
||||
import { commissionLabel } from './labels';
|
||||
import { PARTNER_NAVIGATION, partnerView } from './partnerNavigation';
|
||||
import './partnerPortal.css';
|
||||
import OrgPageHeader from '../Organization/components/OrgPageHeader';
|
||||
import OrgModal from '../Organization/components/OrgModal';
|
||||
import { useCommissionThemeStyle } from './commissionTheme';
|
||||
|
||||
const { Content } = Layout;
|
||||
const { Title, Text } = Typography;
|
||||
@@ -98,6 +101,8 @@ export default function PartnerPortal({
|
||||
tag,
|
||||
embedded = false,
|
||||
}) {
|
||||
const themeStyle = useCommissionThemeStyle();
|
||||
const PartnerModal = embedded ? OrgModal : Modal;
|
||||
const { t } = useTranslation();
|
||||
const location = useLocation();
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
@@ -1194,7 +1199,7 @@ export default function PartnerPortal({
|
||||
</aside>
|
||||
)}
|
||||
<Layout>
|
||||
<header className='commission-workspace-bar'>
|
||||
<header className='commission-workspace-bar' hidden={embedded}>
|
||||
<div>
|
||||
{t(embedded ? '企业分佣' : '合作分佣')}
|
||||
<span className='commission-crumb-slash'>/</span>
|
||||
@@ -1210,7 +1215,9 @@ export default function PartnerPortal({
|
||||
<span className='commission-workspace-role'>{t('伙伴工作台')}</span>
|
||||
)}
|
||||
</header>
|
||||
<Content className='commission-v2-content'>
|
||||
<Content
|
||||
className={`commission-v2-content${embedded ? ' uc-page oc-page' : ''}`}
|
||||
>
|
||||
<div className='commission-page-header'>
|
||||
<div className='commission-page-heading'>
|
||||
{selected && (
|
||||
@@ -1224,17 +1231,38 @@ export default function PartnerPortal({
|
||||
{t('返回我的提成')}
|
||||
</Button>
|
||||
)}
|
||||
<Title level={4}>{t(pageTitle)}</Title>
|
||||
<Text type='secondary'>
|
||||
{selected
|
||||
? `${t('账单号')} #${selected.id} · ${selected.statement_month}`
|
||||
: t(subtitles[active])}
|
||||
{!selected &&
|
||||
['overview', 'estimate'].includes(active) &&
|
||||
summary.updated_at
|
||||
? ` · ${t('数据更新时间')}:${formatDateTime(summary.updated_at)}`
|
||||
: ''}
|
||||
</Text>
|
||||
{embedded ? (
|
||||
<OrgPageHeader
|
||||
title={t(pageTitle)}
|
||||
subtitle={
|
||||
selected ? (
|
||||
`${t('账单号')} #${selected.id} · ${selected.statement_month}`
|
||||
) : (
|
||||
<>
|
||||
{t(subtitles[active])}
|
||||
{['overview', 'estimate'].includes(active) &&
|
||||
summary.updated_at
|
||||
? ` · ${t('数据更新时间')}:${formatDateTime(summary.updated_at)}`
|
||||
: ''}
|
||||
</>
|
||||
)
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Title level={4}>{t(pageTitle)}</Title>
|
||||
)}
|
||||
{!embedded && (
|
||||
<Text type='secondary'>
|
||||
{selected
|
||||
? `${t('账单号')} #${selected.id} · ${selected.statement_month}`
|
||||
: t(subtitles[active])}
|
||||
{!selected &&
|
||||
['overview', 'estimate'].includes(active) &&
|
||||
summary.updated_at
|
||||
? ` · ${t('数据更新时间')}:${formatDateTime(summary.updated_at)}`
|
||||
: ''}
|
||||
</Text>
|
||||
)}
|
||||
</div>
|
||||
<div className='commission-actions'>
|
||||
{selected && (
|
||||
@@ -1315,7 +1343,8 @@ export default function PartnerPortal({
|
||||
)}
|
||||
</Content>
|
||||
</Layout>
|
||||
<Modal
|
||||
<PartnerModal
|
||||
style={themeStyle}
|
||||
className='commission-modal partner-portal-modal'
|
||||
visible={!!action}
|
||||
title={`${t(action === 'reject' ? '驳回账单' : '确认账单')} · #${selected?.id || ''}`}
|
||||
@@ -1377,7 +1406,7 @@ export default function PartnerPortal({
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
</Modal>
|
||||
</PartnerModal>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright (C) 2025 QuantumNous
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { theme } from 'antd';
|
||||
|
||||
// Portal overlays need the same semantic colors as the workspace root.
|
||||
export function useCommissionThemeStyle() {
|
||||
const { token } = theme.useToken();
|
||||
return {
|
||||
'--commission-primary': token.colorPrimary,
|
||||
'--commission-primary-hover': token.colorPrimaryHover,
|
||||
'--commission-primary-soft': token.colorPrimaryBg,
|
||||
'--commission-primary-readable': token.colorLink,
|
||||
'--commission-primary-solid': token.colorPrimary,
|
||||
'--commission-on-primary': token.colorTextLightSolid,
|
||||
'--commission-success': token.colorSuccessText,
|
||||
'--commission-success-soft': token.colorSuccessBg,
|
||||
'--commission-warning': token.colorWarningText,
|
||||
'--commission-warning-soft': token.colorWarningBg,
|
||||
'--commission-danger': token.colorErrorText,
|
||||
'--commission-danger-soft': token.colorErrorBg,
|
||||
'--commission-info': token.colorInfoText,
|
||||
'--commission-info-soft': token.colorInfoBg,
|
||||
'--commission-control-border': token.colorBorder,
|
||||
'--commission-font': token.fontFamily,
|
||||
};
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
);
|
||||
--dash-text: var(--text-primary, #1d2129);
|
||||
--dash-card: var(--surface-card, #fff);
|
||||
--dash-soft: color-mix(in srgb, var(--surface-bg-base) 52%, var(--dash-card));
|
||||
--dash-soft: var(--surface-bg-base);
|
||||
--dash-featured-bg: color-mix(
|
||||
in srgb,
|
||||
var(--commission-primary-soft, #e8f0ff) 62%,
|
||||
@@ -18,11 +18,11 @@
|
||||
var(--dash-primary) 24%,
|
||||
var(--dash-line)
|
||||
);
|
||||
--dash-warning: color-mix(in srgb, #f59e0b 78%, var(--dash-text));
|
||||
--dash-danger: color-mix(in srgb, #f56c7a 82%, var(--dash-text));
|
||||
--dash-success: color-mix(in srgb, #22c55e 78%, var(--dash-text));
|
||||
--dash-warning-bg: color-mix(in srgb, #f59e0b 12%, var(--dash-card));
|
||||
--dash-danger-bg: color-mix(in srgb, #f56c7a 12%, var(--dash-card));
|
||||
--dash-warning: var(--commission-warning);
|
||||
--dash-danger: var(--commission-danger);
|
||||
--dash-success: var(--commission-success);
|
||||
--dash-warning-bg: var(--commission-warning-soft);
|
||||
--dash-danger-bg: var(--commission-danger-soft);
|
||||
--dash-grid: color-mix(in srgb, var(--dash-text) 11%, transparent);
|
||||
--dash-muted-bar: color-mix(
|
||||
in srgb,
|
||||
@@ -70,7 +70,7 @@
|
||||
.commission-dashboard-period {
|
||||
flex-shrink: 0;
|
||||
border: 1px solid var(--dash-line);
|
||||
border-radius: 4px;
|
||||
border-radius: 8px;
|
||||
background: var(--dash-card);
|
||||
padding: 6px 12px;
|
||||
font-size: 12px;
|
||||
@@ -81,26 +81,29 @@
|
||||
.commission-dashboard-support {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.commission-dashboard-stat,
|
||||
.commission-dashboard-card {
|
||||
border: 1px solid var(--dash-line);
|
||||
border-radius: 6px;
|
||||
border-radius: 10px;
|
||||
background: var(--dash-card);
|
||||
box-shadow: none;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.commission-dashboard-stat {
|
||||
padding: 16px 20px;
|
||||
padding: 22px 24px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.commission-dashboard-stat > span,
|
||||
.commission-dashboard-summary-item > span,
|
||||
.commission-dashboard-health-item > span {
|
||||
display: block;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 9px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
color: var(--dash-muted);
|
||||
@@ -111,13 +114,27 @@
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.commission-dashboard-stat > span > svg,
|
||||
.commission-dashboard-health-item > span > svg {
|
||||
flex-shrink: 0;
|
||||
color: var(--dash-primary);
|
||||
}
|
||||
|
||||
.commission-dashboard strong > small {
|
||||
margin-inline-start: 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0;
|
||||
color: var(--dash-muted);
|
||||
}
|
||||
|
||||
.commission-dashboard-stat > strong {
|
||||
display: block;
|
||||
margin-top: 8px;
|
||||
font-size: 28px;
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.7px;
|
||||
line-height: 1.3;
|
||||
line-height: 1.5;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
@@ -129,8 +146,12 @@
|
||||
}
|
||||
|
||||
.commission-dashboard-stat--featured {
|
||||
background: var(--dash-featured-bg);
|
||||
border-color: var(--dash-featured-line);
|
||||
background: linear-gradient(
|
||||
120deg,
|
||||
var(--dash-card),
|
||||
var(--commission-primary-soft)
|
||||
);
|
||||
border-color: var(--dash-line);
|
||||
}
|
||||
|
||||
.commission-dashboard-stat--featured > strong {
|
||||
@@ -138,7 +159,7 @@
|
||||
}
|
||||
|
||||
.commission-dashboard-support {
|
||||
margin-top: 12px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.commission-dashboard-support .commission-dashboard-stat {
|
||||
@@ -146,35 +167,35 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding: 14px 20px;
|
||||
padding: 16px 22px;
|
||||
}
|
||||
|
||||
.commission-dashboard-support .commission-dashboard-stat > strong {
|
||||
margin: 0;
|
||||
font-size: 22px;
|
||||
font-size: 23px;
|
||||
}
|
||||
|
||||
.commission-dashboard p.commission-dashboard-note {
|
||||
margin-top: 12px;
|
||||
margin-top: 14px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.commission-dashboard-main {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
|
||||
gap: 16px;
|
||||
margin: 16px 0;
|
||||
grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr);
|
||||
gap: 20px;
|
||||
margin: 24px 0 20px;
|
||||
}
|
||||
|
||||
.commission-dashboard-card {
|
||||
padding: 18px 20px;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.commission-dashboard-todo-summary {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
gap: 12px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.commission-dashboard button {
|
||||
@@ -188,10 +209,10 @@
|
||||
}
|
||||
|
||||
.commission-dashboard-summary-item {
|
||||
padding: 10px 12px;
|
||||
padding: 14px;
|
||||
text-align: left;
|
||||
border: 1px solid var(--dash-line);
|
||||
border-radius: 4px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 8px;
|
||||
background: var(--dash-soft);
|
||||
min-width: 0;
|
||||
}
|
||||
@@ -203,7 +224,7 @@
|
||||
.commission-dashboard-summary-item > strong {
|
||||
display: block;
|
||||
margin-top: 6px;
|
||||
font-size: 22px;
|
||||
font-size: 23px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@@ -229,7 +250,7 @@
|
||||
justify-content: space-between;
|
||||
gap: 14px;
|
||||
border-bottom: 1px solid var(--dash-line);
|
||||
padding: 15px 0;
|
||||
padding: 19px 0;
|
||||
}
|
||||
|
||||
.commission-dashboard-todo:last-child {
|
||||
@@ -241,9 +262,17 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.commission-dashboard-todo > .ant-btn {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.commission-dashboard-summary-item strong > small {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.commission-dashboard-tag {
|
||||
display: inline-block;
|
||||
border-radius: 4px;
|
||||
border-radius: 8px;
|
||||
padding: 1px 7px;
|
||||
font-size: 11px;
|
||||
line-height: 1.8;
|
||||
@@ -280,7 +309,7 @@
|
||||
.commission-dashboard-button {
|
||||
flex-shrink: 0;
|
||||
border: 1px solid var(--dash-line);
|
||||
border-radius: 4px;
|
||||
border-radius: 8px;
|
||||
padding: 6px 12px;
|
||||
color: var(--text-secondary);
|
||||
background: var(--dash-card);
|
||||
@@ -290,14 +319,19 @@
|
||||
|
||||
.commission-dashboard-button--primary {
|
||||
border-color: var(--dash-primary);
|
||||
color: #fff;
|
||||
color: var(--commission-on-primary);
|
||||
background: var(--dash-primary);
|
||||
}
|
||||
|
||||
.commission-dashboard-button:hover,
|
||||
.commission-dashboard-summary-item:hover,
|
||||
.commission-dashboard-health-item:hover {
|
||||
filter: brightness(0.97);
|
||||
border-color: var(--dash-primary);
|
||||
}
|
||||
|
||||
.commission-dashboard-chart-column:hover .commission-dashboard-chart-bar,
|
||||
.commission-dashboard-chart-column:focus-visible
|
||||
.commission-dashboard-chart-bar {
|
||||
background: var(--commission-primary-hover);
|
||||
}
|
||||
|
||||
.commission-dashboard-health h3 {
|
||||
@@ -306,11 +340,10 @@
|
||||
|
||||
.commission-dashboard-health-item {
|
||||
width: 100%;
|
||||
margin-top: 12px;
|
||||
border: 0;
|
||||
border: 1px solid var(--dash-line);
|
||||
border-radius: 4px;
|
||||
padding: 16px;
|
||||
margin-top: 18px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 8px;
|
||||
padding: 24px;
|
||||
text-align: left;
|
||||
background: var(--dash-soft);
|
||||
}
|
||||
@@ -318,7 +351,7 @@
|
||||
.commission-dashboard-health-item > strong {
|
||||
display: block;
|
||||
margin-top: 8px;
|
||||
font-size: 28px;
|
||||
font-size: 32px;
|
||||
line-height: 1.3;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -356,7 +389,7 @@
|
||||
margin: 0 0 20px;
|
||||
border: 1px solid
|
||||
color-mix(in srgb, var(--dash-warning) 24%, var(--dash-line));
|
||||
border-radius: 4px;
|
||||
border-radius: 8px;
|
||||
padding: 10px 12px;
|
||||
background: var(--dash-warning-bg);
|
||||
color: var(--dash-warning);
|
||||
@@ -366,7 +399,30 @@
|
||||
.commission-dashboard-chart {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, minmax(0, 1fr));
|
||||
padding-top: 16px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.commission-dashboard-chart-frame {
|
||||
display: grid;
|
||||
grid-template-columns: max-content minmax(0, 1fr);
|
||||
gap: 16px;
|
||||
padding: 16px 16px 0;
|
||||
}
|
||||
|
||||
.commission-dashboard-chart-axis {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height: 145px;
|
||||
color: var(--dash-muted);
|
||||
font-size: 11px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
text-align: end;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.commission-dashboard-chart-axis > span {
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.commission-dashboard-chart-column {
|
||||
@@ -384,22 +440,17 @@
|
||||
justify-content: center;
|
||||
height: 145px;
|
||||
border-bottom: 1px solid var(--dash-line);
|
||||
background: repeating-linear-gradient(
|
||||
to top,
|
||||
transparent 0,
|
||||
transparent 47px,
|
||||
var(--dash-grid) 47px,
|
||||
var(--dash-grid) 48px
|
||||
);
|
||||
background-image: linear-gradient(var(--dash-grid) 1px, transparent 1px);
|
||||
background-size: 100% 25%;
|
||||
}
|
||||
|
||||
.commission-dashboard-chart-bar {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 42%;
|
||||
max-width: 72px;
|
||||
max-width: 44px;
|
||||
min-height: 1px;
|
||||
border-radius: 2px 2px 0 0;
|
||||
border-radius: 4px 4px 0 0;
|
||||
background: var(--dash-muted-bar);
|
||||
}
|
||||
|
||||
@@ -430,7 +481,7 @@
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
@media (max-width: 1150px) {
|
||||
@media (max-width: 1300px) {
|
||||
.commission-dashboard-todo-summary {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
@@ -444,16 +495,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
@media (max-width: 1000px) {
|
||||
.commission-dashboard-main {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.commission-dashboard-core,
|
||||
.commission-dashboard-support {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.commission-dashboard-health-metrics {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
@@ -461,6 +507,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.commission-dashboard-core,
|
||||
.commission-dashboard-support {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.commission-dashboard-todo-summary {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.commission-dashboard-summary-item {
|
||||
padding: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 520px) {
|
||||
.commission-dashboard-heading,
|
||||
.commission-dashboard-trend-heading {
|
||||
@@ -489,4 +551,9 @@
|
||||
.commission-dashboard-chart-value {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.commission-dashboard-chart-frame {
|
||||
gap: 8px;
|
||||
padding-inline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
}
|
||||
|
||||
.commission-form-section-grid .commission-form-field {
|
||||
gap: 6px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.commission-form-section-grid .ant-input-number,
|
||||
@@ -45,7 +45,7 @@
|
||||
}
|
||||
|
||||
.commission-partner-sheet {
|
||||
--commission-control-height: 32px;
|
||||
--commission-control-height: 34px;
|
||||
}
|
||||
|
||||
.commission-partner-sheet .ant-drawer-body {
|
||||
@@ -75,19 +75,19 @@
|
||||
.commission-partner-sheet-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 14px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.commission-partner-sheet .ant-radio-group {
|
||||
min-height: 32px;
|
||||
min-height: 34px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.commission-partner-sheet .commission-evidence-upload-button {
|
||||
height: 32px;
|
||||
border-radius: 4px;
|
||||
height: 34px;
|
||||
border-radius: var(--commission-radius);
|
||||
}
|
||||
|
||||
.commission-partner-sheet .commission-evidence-meta {
|
||||
@@ -97,7 +97,7 @@
|
||||
.commission-settlement-context {
|
||||
grid-column: 1 / -1;
|
||||
padding: 12px 16px;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--surface-card);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,15 @@ import {
|
||||
partnerWorkspaceFallback,
|
||||
} from '../PartnerPortal/redirect';
|
||||
import Loading from '../../components/common/ui/Loading';
|
||||
import OrgPageHeader from '../Organization/components/OrgPageHeader';
|
||||
import { useCommissionThemeStyle } from './commissionTheme';
|
||||
import { Table } from '@/components/ui';
|
||||
import {
|
||||
ConsoleAlert as Alert,
|
||||
ConsoleCard as Card,
|
||||
ConsoleModal as Modal,
|
||||
ConsoleTabs as Tabs,
|
||||
} from '../../components/console/ConsolePrimitives';
|
||||
import {
|
||||
Home,
|
||||
Users,
|
||||
@@ -57,17 +66,12 @@ import PartnerPortal from './PartnerPortal';
|
||||
import { partnerScope, createPartnerTransport } from './partnerScope';
|
||||
import { tierStatus } from './listFilters';
|
||||
import {
|
||||
Alert,
|
||||
Button,
|
||||
Card,
|
||||
DatePicker,
|
||||
Dropdown,
|
||||
Empty,
|
||||
Modal,
|
||||
Select,
|
||||
Spin,
|
||||
Table,
|
||||
Tabs,
|
||||
Tag,
|
||||
Typography,
|
||||
} from 'antd';
|
||||
@@ -237,7 +241,7 @@ function PaymentTable({ payments, admin = false }) {
|
||||
rowKey='id'
|
||||
dataSource={payments}
|
||||
pagination={false}
|
||||
locale={{ emptyText: emptyState(t('暂无付款记录')) }}
|
||||
empty={emptyState(t('暂无付款记录'))}
|
||||
columns={[
|
||||
{ title: t('打款日期'), dataIndex: 'paid_at', render: formatDateTime },
|
||||
{ title: t('实付金额'), dataIndex: 'amount_uyuan', render: money },
|
||||
@@ -448,7 +452,7 @@ function AdminStatementDetail({
|
||||
pageSize: 10,
|
||||
}}
|
||||
scroll={{ x: 1800 }}
|
||||
locale={{ emptyText: emptyState(t('暂无计费明细')) }}
|
||||
empty={emptyState(t('暂无计费明细'))}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
@@ -463,7 +467,7 @@ function AdminStatementDetail({
|
||||
rowKey='id'
|
||||
dataSource={operations}
|
||||
pagination={false}
|
||||
locale={{ emptyText: emptyState(t('暂无操作记录')) }}
|
||||
empty={emptyState(t('暂无操作记录'))}
|
||||
columns={[
|
||||
{
|
||||
title: t('操作'),
|
||||
@@ -519,7 +523,7 @@ function AdminStatementDetail({
|
||||
rowKey='id'
|
||||
dataSource={adjustments}
|
||||
pagination={false}
|
||||
locale={{ emptyText: emptyState(t('暂无调整单')) }}
|
||||
empty={emptyState(t('暂无调整单'))}
|
||||
columns={[
|
||||
...AdjustmentColumns(t, money),
|
||||
{ title: t('状态'), dataIndex: 'status', render: tag },
|
||||
@@ -565,6 +569,7 @@ function AdminStatementDetail({
|
||||
);
|
||||
}
|
||||
function AdminPage() {
|
||||
const themeStyle = useCommissionThemeStyle();
|
||||
const [userState] = useContext(UserContext);
|
||||
const { t } = useTranslation();
|
||||
const location = useLocation();
|
||||
@@ -1531,7 +1536,10 @@ function AdminPage() {
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<div className='commission-v2 commission-admin-workspace'>
|
||||
<div
|
||||
className='commission-v2 commission-admin-workspace'
|
||||
style={themeStyle}
|
||||
>
|
||||
<div className='commission-admin-main'>
|
||||
<header className='commission-workspace-bar'>
|
||||
<span>
|
||||
@@ -1849,6 +1857,7 @@ export function PartnerWorkspace({ organizationId = null }) {
|
||||
}
|
||||
|
||||
function ScopedPartnerWorkspace({ scope, isCurrent }) {
|
||||
const themeStyle = useCommissionThemeStyle();
|
||||
const [userState] = useContext(UserContext);
|
||||
const { t } = useTranslation();
|
||||
const { status, partnerType, retry } = usePartnerWorkspaceAccess(
|
||||
@@ -1874,11 +1883,13 @@ function ScopedPartnerWorkspace({ scope, isCurrent }) {
|
||||
return <Navigate to={COMPANY_PARTNER_WORKSPACE_PATH} replace />;
|
||||
if (status === 'denied')
|
||||
return scope.enterprise ? (
|
||||
<Alert
|
||||
type='warning'
|
||||
showIcon
|
||||
title={t('当前企业没有可用的分佣访问权限')}
|
||||
/>
|
||||
<div
|
||||
className='uc-page oc-page commission-access-state'
|
||||
style={themeStyle}
|
||||
>
|
||||
<OrgPageHeader title={t('企业分佣')} />
|
||||
<Alert type='warning' title={t('当前企业没有可用的分佣访问权限')} />
|
||||
</div>
|
||||
) : (
|
||||
<Navigate to={partnerWorkspaceFallback(userState?.user?.role)} replace />
|
||||
);
|
||||
@@ -1904,6 +1915,7 @@ function ScopedPartnerWorkspace({ scope, isCurrent }) {
|
||||
return (
|
||||
<div
|
||||
data-partner-scope={scope.key}
|
||||
style={themeStyle}
|
||||
className={
|
||||
scope.enterprise ? 'partner-portal-scope--embedded' : undefined
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ import { API } from '../../helpers';
|
||||
import RemoteIdentitySelect from './RemoteIdentitySelect';
|
||||
import { fetchAllLatestTiers } from './latestTiers';
|
||||
import './formSections.css';
|
||||
import { useCommissionThemeStyle } from './commissionTheme';
|
||||
|
||||
const time = (value) => (value ? new Date(value * 1000).toLocaleString() : '—');
|
||||
export function Field({ label, children, required = false }) {
|
||||
@@ -203,6 +204,7 @@ export function OperationsDialog({
|
||||
onClose,
|
||||
onSaved,
|
||||
}) {
|
||||
const themeStyle = useCommissionThemeStyle();
|
||||
const { t } = useTranslation();
|
||||
const [form, setForm] = useState({});
|
||||
const [error, setError] = useState('');
|
||||
@@ -474,6 +476,7 @@ export function OperationsDialog({
|
||||
};
|
||||
return (
|
||||
<Dialog
|
||||
style={themeStyle}
|
||||
className={partnerProfile ? 'commission-partner-sheet' : modalClassName}
|
||||
width={modalWidth}
|
||||
title={t(title || '详情')}
|
||||
@@ -1201,6 +1204,7 @@ export function SettlementDialog({
|
||||
onClose,
|
||||
onSaved,
|
||||
}) {
|
||||
const themeStyle = useCommissionThemeStyle();
|
||||
const { t } = useTranslation();
|
||||
const [form, setForm] = useState({});
|
||||
const [busy, setBusy] = useState(false);
|
||||
@@ -1298,6 +1302,7 @@ export function SettlementDialog({
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
style={themeStyle}
|
||||
className='commission-modal commission-modal--form commission-modal--settlement'
|
||||
width={720}
|
||||
title={t(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.partner-portal .commission-v2-sider {
|
||||
width: 220px !important;
|
||||
flex-basis: 220px !important;
|
||||
width: 220px;
|
||||
flex-basis: 220px;
|
||||
}
|
||||
|
||||
/* Organization owns the global header, sidebar and scroll container. */
|
||||
@@ -42,10 +42,23 @@
|
||||
}
|
||||
|
||||
.partner-portal--embedded .commission-v2-content {
|
||||
padding: 24px var(--uc-page-pad-x) var(--uc-page-pad-bottom);
|
||||
padding: var(--uc-page-pad-top) var(--uc-page-pad-x) var(--uc-page-pad-bottom);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.partner-portal--embedded .commission-workspace-bar[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.partner-portal--embedded .commission-page-header {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.partner-portal--embedded .commission-page-heading {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.partner-portal--embedded .commission-page-header {
|
||||
align-items: flex-end;
|
||||
margin-bottom: 18px;
|
||||
@@ -131,7 +144,7 @@
|
||||
padding: 10px 14px;
|
||||
border: 1px solid
|
||||
color-mix(in srgb, var(--commission-primary) 24%, transparent);
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--commission-primary-soft);
|
||||
color: var(--text-primary);
|
||||
font-size: 13px;
|
||||
@@ -145,8 +158,8 @@
|
||||
.partner-portal-metrics {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 12px;
|
||||
gap: 18px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.partner-portal-metrics-three {
|
||||
@@ -158,7 +171,7 @@
|
||||
min-height: 118px;
|
||||
padding: 16px 20px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--commission-surface-raised);
|
||||
}
|
||||
|
||||
@@ -249,7 +262,7 @@
|
||||
}
|
||||
|
||||
.partner-portal-chart-bar.is-negative {
|
||||
background: #f76560;
|
||||
background: var(--commission-danger);
|
||||
}
|
||||
|
||||
.partner-portal-chart-label {
|
||||
@@ -309,7 +322,7 @@ button.partner-portal-reminder:hover {
|
||||
flex-shrink: 0;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--commission-primary-soft);
|
||||
color: var(--commission-primary-readable);
|
||||
}
|
||||
@@ -351,7 +364,7 @@ button.partner-portal-reminder:hover {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
white-space: nowrap;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.partner-portal .partner-portal-row-actions .ant-btn-link {
|
||||
@@ -468,8 +481,8 @@ button.partner-portal-reminder:hover {
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.partner-portal .commission-v2-sider {
|
||||
width: 168px !important;
|
||||
flex-basis: 168px !important;
|
||||
width: 168px;
|
||||
flex-basis: 168px;
|
||||
}
|
||||
|
||||
.partner-portal .commission-brand {
|
||||
@@ -503,8 +516,8 @@ button.partner-portal-reminder:hover {
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.partner-portal .commission-v2-sider {
|
||||
width: 100% !important;
|
||||
flex-basis: auto !important;
|
||||
width: 100%;
|
||||
flex-basis: auto;
|
||||
}
|
||||
|
||||
.partner-portal .partner-portal-card.ant-card > .ant-card-body {
|
||||
|
||||
+132
-123
@@ -3,60 +3,17 @@
|
||||
.commission-modal,
|
||||
.commission-profile-drawer,
|
||||
.commission-partner-sheet {
|
||||
/* 新版分佣只消费全局主题 token,主题色和明暗模式由控制台统一驱动。 */
|
||||
--commission-primary: var(--brand-primary);
|
||||
--commission-primary-hover: var(--brand-primary-hover);
|
||||
--commission-primary-soft: var(--brand-primary-soft);
|
||||
/* Links on dark surfaces need a lighter reading color than the brand swatch. */
|
||||
--commission-primary-readable: color-mix(
|
||||
in srgb,
|
||||
var(--commission-primary) 58%,
|
||||
var(--text-primary)
|
||||
);
|
||||
/* White text on the default brand blue is below AA contrast; deepen solid fills. */
|
||||
--commission-primary-solid: color-mix(
|
||||
in srgb,
|
||||
var(--commission-primary) 78%,
|
||||
#000
|
||||
);
|
||||
--commission-success: color-mix(in srgb, #22c55e 78%, var(--text-primary));
|
||||
--commission-success-soft: color-mix(
|
||||
in srgb,
|
||||
#22c55e 12%,
|
||||
var(--surface-card)
|
||||
);
|
||||
--commission-warning: color-mix(in srgb, #f59e0b 82%, var(--text-primary));
|
||||
--commission-warning-soft: color-mix(
|
||||
in srgb,
|
||||
#f59e0b 12%,
|
||||
var(--surface-card)
|
||||
);
|
||||
--commission-danger: color-mix(in srgb, #f56c7a 82%, var(--text-primary));
|
||||
--commission-danger-soft: color-mix(
|
||||
in srgb,
|
||||
#f56c7a 12%,
|
||||
var(--surface-card)
|
||||
);
|
||||
--commission-info: color-mix(in srgb, #22d3ee 78%, var(--text-primary));
|
||||
--commission-info-soft: color-mix(in srgb, #22d3ee 12%, var(--surface-card));
|
||||
--commission-primary-readable: var(--commission-primary);
|
||||
--commission-primary-solid: var(--commission-primary);
|
||||
--text-tertiary: var(--text-secondary);
|
||||
--commission-radius: 4px;
|
||||
--commission-control-height: 32px;
|
||||
--commission-surface-raised: color-mix(
|
||||
in srgb,
|
||||
var(--surface-card) 94%,
|
||||
var(--text-primary)
|
||||
);
|
||||
--commission-surface-toolbar: color-mix(
|
||||
in srgb,
|
||||
var(--surface-card) 86%,
|
||||
var(--surface-bg-base)
|
||||
);
|
||||
--commission-surface-control: color-mix(
|
||||
in srgb,
|
||||
var(--surface-card) 78%,
|
||||
var(--surface-bg-base)
|
||||
);
|
||||
--commission-radius: 8px;
|
||||
--commission-control-height: 34px;
|
||||
--commission-surface-raised: var(--surface-card);
|
||||
--commission-surface-toolbar: var(--surface-card);
|
||||
--commission-surface-control: var(--surface-card);
|
||||
--commission-border-strong: color-mix(
|
||||
in srgb,
|
||||
var(--border-subtle) 78%,
|
||||
@@ -77,9 +34,7 @@
|
||||
transparent
|
||||
);
|
||||
color: var(--text-primary);
|
||||
font-family:
|
||||
-apple-system, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial,
|
||||
sans-serif;
|
||||
font-family: var(--commission-font, inherit);
|
||||
font-size: 14px;
|
||||
line-height: 1.5715;
|
||||
}
|
||||
@@ -175,7 +130,7 @@
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
flex-shrink: 0;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--commission-primary-solid);
|
||||
}
|
||||
.commission-navigation {
|
||||
@@ -195,7 +150,7 @@
|
||||
margin: 2px 0;
|
||||
padding: 0 12px;
|
||||
border: 0;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: transparent;
|
||||
color: var(--text-secondary);
|
||||
font: inherit;
|
||||
@@ -225,8 +180,8 @@
|
||||
margin-left: auto;
|
||||
padding: 0 6px;
|
||||
border-radius: 8px;
|
||||
color: #fff;
|
||||
background: #f53f3f;
|
||||
color: var(--commission-on-primary);
|
||||
background: var(--commission-danger);
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
}
|
||||
@@ -248,7 +203,7 @@
|
||||
}
|
||||
.commission-crumb-slash {
|
||||
padding: 0 8px;
|
||||
color: #c9cdd4;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
.commission-workspace-role {
|
||||
padding: 3px 12px;
|
||||
@@ -296,7 +251,7 @@
|
||||
width: 138px;
|
||||
}
|
||||
.commission-card {
|
||||
margin-top: 12px;
|
||||
margin-top: 18px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 10px;
|
||||
background: var(--commission-surface-raised);
|
||||
@@ -314,8 +269,7 @@
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: nowrap;
|
||||
white-space: nowrap;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.commission-row-actions .commission-more-actions {
|
||||
position: relative;
|
||||
@@ -347,7 +301,7 @@
|
||||
.commission-v2 .commission-status {
|
||||
height: 22px;
|
||||
padding: 0 8px;
|
||||
border-radius: 2px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -360,52 +314,13 @@
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.commission-list-tabs {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
gap: 4px;
|
||||
overflow-x: auto;
|
||||
border-bottom: 1px solid var(--commission-border-strong);
|
||||
padding: 0 4px;
|
||||
margin-bottom: 12px;
|
||||
.commission-list-tabs .ant-tabs-nav {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.commission-list-tabs > button {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
padding: 10px 16px;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
font: inherit;
|
||||
.commission-tab-count {
|
||||
margin-inline-start: 6px;
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
}
|
||||
.commission-list-tabs > button:hover {
|
||||
color: var(--commission-primary-readable);
|
||||
}
|
||||
.commission-list-tabs > button.is-active {
|
||||
color: var(--commission-primary-readable);
|
||||
font-weight: 500;
|
||||
}
|
||||
.commission-list-tabs > button.is-active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 12px;
|
||||
right: 12px;
|
||||
height: 2px;
|
||||
background: var(--commission-primary);
|
||||
}
|
||||
.commission-list-tabs > button > span {
|
||||
margin-left: 6px;
|
||||
padding: 0 6px;
|
||||
border-radius: 8px;
|
||||
background: var(--surface-bg-base);
|
||||
color: var(--text-tertiary);
|
||||
font-size: 12px;
|
||||
}
|
||||
.commission-list-tabs > button.is-active > span {
|
||||
color: var(--commission-primary-readable);
|
||||
background: var(--commission-primary-soft);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.commission-filter-bar {
|
||||
display: flex;
|
||||
@@ -414,7 +329,7 @@
|
||||
flex-wrap: wrap;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--commission-surface-toolbar);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
@@ -485,7 +400,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
gap: 6px;
|
||||
gap: 8px;
|
||||
color: var(--text-secondary);
|
||||
font-size: 14px;
|
||||
}
|
||||
@@ -500,7 +415,7 @@
|
||||
}
|
||||
.commission-tier-targets .ant-select {
|
||||
height: auto;
|
||||
min-height: 32px;
|
||||
min-height: var(--commission-control-height);
|
||||
}
|
||||
.commission-field-hint {
|
||||
color: var(--text-tertiary);
|
||||
@@ -513,7 +428,7 @@
|
||||
gap: 12px;
|
||||
padding: 12px 14px;
|
||||
grid-column: 1/-1;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--surface-bg-base);
|
||||
}
|
||||
.commission-checklist .ant-checkbox-wrapper {
|
||||
@@ -541,8 +456,7 @@
|
||||
}
|
||||
.commission-history-table .ant-table-thead > tr > th {
|
||||
padding: 10px 14px;
|
||||
background: var(--surface-bg-base);
|
||||
color: var(--text-primary);
|
||||
color: var(--text-secondary);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
@@ -564,7 +478,7 @@
|
||||
}
|
||||
.commission-exception-content .ant-descriptions {
|
||||
padding: 12px;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--surface-bg-base);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
@@ -586,11 +500,11 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 108px;
|
||||
height: 32px;
|
||||
height: var(--commission-control-height);
|
||||
gap: 7px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--surface-card);
|
||||
color: var(--commission-primary-readable);
|
||||
cursor: pointer;
|
||||
@@ -663,7 +577,7 @@
|
||||
gap: 6px;
|
||||
padding: 16px 20px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--surface-card);
|
||||
}
|
||||
.statement-summary-values > div:last-child {
|
||||
@@ -685,7 +599,7 @@
|
||||
.commission-detail-tabs {
|
||||
margin-top: 12px;
|
||||
padding: 0 20px 16px;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--surface-card);
|
||||
}
|
||||
.commission-tier-summary {
|
||||
@@ -740,7 +654,7 @@
|
||||
.commission-bill-step.is-current > span,
|
||||
.commission-bill-step.is-done > span {
|
||||
background: var(--commission-primary);
|
||||
color: #fff;
|
||||
color: var(--commission-on-primary);
|
||||
}
|
||||
.commission-bill-step.is-done::after {
|
||||
background: var(--commission-primary);
|
||||
@@ -758,12 +672,12 @@
|
||||
.commission-drawer-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 14px;
|
||||
gap: 8px;
|
||||
}
|
||||
.commission-profile-section {
|
||||
margin-bottom: 12px;
|
||||
padding: 16px 20px;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
background: var(--surface-card);
|
||||
}
|
||||
.commission-profile-section h3 {
|
||||
@@ -889,7 +803,7 @@
|
||||
min-width: 120px;
|
||||
}
|
||||
.commission-list > .ant-card-body {
|
||||
padding: 12px !important;
|
||||
padding: 16px;
|
||||
}
|
||||
.commission-list-tabs > button {
|
||||
padding: 10px 12px;
|
||||
@@ -904,7 +818,7 @@
|
||||
width: 100%;
|
||||
}
|
||||
.commission-modal {
|
||||
max-width: calc(100vw - 24px);
|
||||
max-width: calc(100vw - 32px);
|
||||
}
|
||||
.commission-detail-toolbar {
|
||||
align-items: flex-start;
|
||||
@@ -962,7 +876,7 @@
|
||||
margin: 12px 0 20px;
|
||||
padding: 16px;
|
||||
background: var(--surface-bg-base);
|
||||
border-radius: 4px;
|
||||
border-radius: var(--commission-radius);
|
||||
}
|
||||
.commission-deduction-summary > div {
|
||||
display: flex;
|
||||
@@ -976,3 +890,98 @@
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.commission-card > .ant-card-body {
|
||||
padding: 24px;
|
||||
}
|
||||
.commission-card > .ant-card-body > h5.ant-typography {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.commission-list {
|
||||
min-width: 0;
|
||||
}
|
||||
.commission-list-card.commission-card {
|
||||
margin-top: 18px;
|
||||
}
|
||||
.commission-filter-end {
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
.commission-search-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
color: var(--text-secondary);
|
||||
font-size: 13px;
|
||||
}
|
||||
.commission-search-field .ant-select {
|
||||
width: 100%;
|
||||
}
|
||||
.commission-filter-card .console-search-fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
.commission-filter-card .console-search-actions {
|
||||
margin-top: 16px;
|
||||
}
|
||||
.commission-filter-toggle.ant-btn {
|
||||
display: none;
|
||||
}
|
||||
.commission-detail-tabs {
|
||||
margin-top: 18px;
|
||||
padding: 8px 24px 24px;
|
||||
border: 1px solid var(--border-subtle);
|
||||
border-radius: 10px;
|
||||
}
|
||||
.commission-access-state {
|
||||
min-width: 0;
|
||||
}
|
||||
.commission-nav-item:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
.commission-evidence-upload-button:focus-within {
|
||||
outline: 2px solid var(--commission-primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.commission-filter-card .console-search-fields {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
.commission-card > .ant-card-body {
|
||||
padding: 16px;
|
||||
}
|
||||
.commission-filter-toggle.ant-btn {
|
||||
display: inline-flex;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.commission-filter-card:not(.is-open) {
|
||||
display: none;
|
||||
}
|
||||
.commission-page-header {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
.commission-actions {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.commission-detail-tabs {
|
||||
padding: 8px 16px 16px;
|
||||
}
|
||||
.commission-operation-form {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
.commission-bill-steps {
|
||||
overflow-x: auto;
|
||||
gap: 16px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
.commission-bill-step {
|
||||
min-width: 96px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,12 @@ const OrgLogin = () => {
|
||||
const [pendingLoginName, setPendingLoginName] = useState(loginParam);
|
||||
// 实际生效模式:系统未开直登则始终走企业标识
|
||||
const effectiveMode = directLoginEnabled ? loginMode : 'identifier';
|
||||
// Step1 受控输入的前端必填提示:失焦后仍为空时在框下提示(不改变按钮禁用与提交逻辑)
|
||||
const [blurred, setBlurred] = useState({});
|
||||
const markBlurred = (key) =>
|
||||
setBlurred((prev) => (prev[key] ? prev : { ...prev, [key]: true }));
|
||||
const emptyHelp = (key, empty, message) =>
|
||||
blurred[key] && empty ? { validateStatus: 'error', help: message } : {};
|
||||
|
||||
const logo = getLogo();
|
||||
const systemName = getSystemName();
|
||||
@@ -497,6 +503,11 @@ const OrgLogin = () => {
|
||||
label={t('登录名')}
|
||||
htmlFor='org-direct-login-name'
|
||||
required
|
||||
{...emptyHelp(
|
||||
'login_name',
|
||||
!directForm.login_name.trim(),
|
||||
t('请输入登录名'),
|
||||
)}
|
||||
>
|
||||
<Input
|
||||
id='org-direct-login-name'
|
||||
@@ -505,6 +516,7 @@ const OrgLogin = () => {
|
||||
onChange={(v) =>
|
||||
setDirectForm({ ...directForm, login_name: v })
|
||||
}
|
||||
onBlur={() => markBlurred('login_name')}
|
||||
placeholder={t('请输入登录名')}
|
||||
size='default'
|
||||
autoFocus
|
||||
@@ -514,6 +526,11 @@ const OrgLogin = () => {
|
||||
label={t('密码')}
|
||||
htmlFor='org-direct-password'
|
||||
required
|
||||
{...emptyHelp(
|
||||
'password',
|
||||
!directForm.password,
|
||||
t('请输入密码'),
|
||||
)}
|
||||
>
|
||||
<Input
|
||||
id='org-direct-password'
|
||||
@@ -522,6 +539,7 @@ const OrgLogin = () => {
|
||||
onChange={(v) =>
|
||||
setDirectForm({ ...directForm, password: v })
|
||||
}
|
||||
onBlur={() => markBlurred('password')}
|
||||
mode='password'
|
||||
placeholder={t('请输入密码')}
|
||||
size='default'
|
||||
@@ -563,6 +581,11 @@ const OrgLogin = () => {
|
||||
label={t('企业名称/代码')}
|
||||
htmlFor='org-login-identifier'
|
||||
required
|
||||
{...emptyHelp(
|
||||
'identifier',
|
||||
!identifier.trim(),
|
||||
t('请输入企业名称/代码'),
|
||||
)}
|
||||
>
|
||||
<AutoComplete
|
||||
id='org-login-identifier'
|
||||
@@ -572,6 +595,7 @@ const OrgLogin = () => {
|
||||
onChange={(v) =>
|
||||
setIdentifier(typeof v === 'string' ? v : '')
|
||||
}
|
||||
onBlur={() => markBlurred('identifier')}
|
||||
onSearch={handleSuggestSearch}
|
||||
onSelect={(code) => {
|
||||
setIdentifier(code);
|
||||
@@ -656,7 +680,9 @@ const OrgLogin = () => {
|
||||
size='default'
|
||||
autoFocus={!prefilledLoginName}
|
||||
autoComplete='username'
|
||||
rules={[{ required: true, message: t('请输入登录名') }]}
|
||||
rules={[
|
||||
{ required: true, message: t('请输入企业内登录名') },
|
||||
]}
|
||||
/>
|
||||
<Form.Input
|
||||
field='password'
|
||||
@@ -730,6 +756,7 @@ const OrgLogin = () => {
|
||||
placeholder={t('请输入新密码')}
|
||||
mode='password'
|
||||
size='default'
|
||||
required
|
||||
autoFocus
|
||||
autoComplete='new-password'
|
||||
onKeyDown={handleCapsLock}
|
||||
@@ -747,11 +774,12 @@ const OrgLogin = () => {
|
||||
placeholder={t('请再次输入新密码')}
|
||||
mode='password'
|
||||
size='default'
|
||||
required
|
||||
autoComplete='new-password'
|
||||
onKeyDown={handleCapsLock}
|
||||
onKeyUp={handleCapsLock}
|
||||
validate={(value, values) => {
|
||||
if (!value) return t('请再次输入新密码');
|
||||
if (!value) return t('请输入确认新密码');
|
||||
if (value !== values.new_password)
|
||||
return t('两次输入的新密码不一致');
|
||||
return '';
|
||||
|
||||
@@ -79,6 +79,12 @@ const OrgRegister = () => {
|
||||
};
|
||||
|
||||
const sendCode = async () => {
|
||||
// 先就地校验联系邮箱(必填 + 格式),未通过时由输入框下方提示
|
||||
try {
|
||||
await formApi.current?.validate(['contact_email']);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
const email = (values.contact_email || '').trim();
|
||||
if (!email) {
|
||||
Toast.warning(t('请先输入联系邮箱'));
|
||||
@@ -224,7 +230,7 @@ const OrgRegister = () => {
|
||||
'登录企业空间使用的管理员账号名,注册后不可修改;请勿使用 admin、root 等通用名',
|
||||
)}
|
||||
rules={[
|
||||
{ required: true, message: t('请设置管理员登录名') },
|
||||
{ required: true, message: t('请输入管理员登录名') },
|
||||
{
|
||||
pattern: LOGIN_NAME_PATTERN,
|
||||
message: t(
|
||||
@@ -251,11 +257,18 @@ const OrgRegister = () => {
|
||||
field='contact_email'
|
||||
label={t('联系邮箱')}
|
||||
placeholder={t('用于接收通知')}
|
||||
rules={
|
||||
emailVerifyEnabled
|
||||
rules={[
|
||||
...(emailVerifyEnabled
|
||||
? [{ required: true, message: t('请输入联系邮箱') }]
|
||||
: []
|
||||
}
|
||||
: []),
|
||||
// 格式校验:选填时为空不报错,有值时需为合法邮箱
|
||||
{
|
||||
type: 'email',
|
||||
transform: (v) => v?.trim(),
|
||||
message: t('邮箱格式不正确'),
|
||||
},
|
||||
]}
|
||||
trigger='blur'
|
||||
suffix={
|
||||
emailVerifyEnabled ? (
|
||||
<Button
|
||||
@@ -276,7 +289,7 @@ const OrgRegister = () => {
|
||||
field='verify_code'
|
||||
label={t('邮箱验证码')}
|
||||
placeholder={t('请输入验证码')}
|
||||
rules={[{ required: true, message: t('请输入验证码') }]}
|
||||
rules={[{ required: true, message: t('请输入邮箱验证码') }]}
|
||||
/>
|
||||
)}
|
||||
<Form.Input
|
||||
|
||||
@@ -46,6 +46,7 @@ const orgPageTitles = {
|
||||
audit: '审计日志',
|
||||
'personal-settings': '个人设置',
|
||||
settings: '企业设置',
|
||||
commission: '企业分佣',
|
||||
};
|
||||
|
||||
// 分组页显示“分组 / 当前页面”,其他页面保留“企业中心 / 当前页面”。
|
||||
@@ -63,6 +64,7 @@ const orgPageGroups = {
|
||||
recharge: '财务与日志',
|
||||
logs: '财务与日志',
|
||||
audit: '财务与日志',
|
||||
commission: '财务与日志',
|
||||
'agent-audit': '财务与日志',
|
||||
'personal-settings': '系统设置',
|
||||
settings: '系统设置',
|
||||
|
||||
@@ -344,9 +344,13 @@ export default function GeneralSettings(props) {
|
||||
/>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} md={8} lg={8} xl={8}>
|
||||
<Form.Slot label={t('站点额度展示类型及汇率')}>
|
||||
<Form.Slot
|
||||
label={t('站点额度展示类型及汇率')}
|
||||
htmlFor='settings-quota-display-rate'
|
||||
>
|
||||
<InputGroup style={{ width: '100%' }}>
|
||||
<Input
|
||||
id='settings-quota-display-rate'
|
||||
prefix={'1 USD = '}
|
||||
style={{ width: '50%' }}
|
||||
value={combinedRate}
|
||||
@@ -354,6 +358,7 @@ export default function GeneralSettings(props) {
|
||||
disabled={inputs.QuotaDisplayType === 'USD'}
|
||||
/>
|
||||
<Select
|
||||
aria-label={t('站点额度展示类型及汇率')}
|
||||
style={{ width: '50%' }}
|
||||
value={inputs.QuotaDisplayType}
|
||||
onChange={handleFieldChange('QuotaDisplayType')}
|
||||
|
||||
@@ -204,7 +204,7 @@ export default function SettingsOrgUserNavModules(props) {
|
||||
description={t(
|
||||
'仅对 org_only(仅企业资源)模式的员工账号生效。已默认隐藏 C 端入口(密钥/模型超市/用户中心/充值/推广等),开箱即生效;如需放开某项,打开对应开关并保存。',
|
||||
)}
|
||||
style={{ marginBottom: '16px' }}
|
||||
style={{ marginBlock: '16px' }}
|
||||
/>
|
||||
|
||||
<div style={{ fontWeight: 600, marginBottom: '12px' }}>
|
||||
|
||||
@@ -119,7 +119,7 @@ const SettingsPaymentAlipay = ({ options, refresh }) => {
|
||||
|
||||
<Form
|
||||
labelPosition='left'
|
||||
labelAlign='right'
|
||||
labelAlign='end'
|
||||
labelWidth={180}
|
||||
onSubmit={onSubmit}
|
||||
initValues={{
|
||||
|
||||
@@ -145,7 +145,7 @@ const SettingsPaymentWechat = ({ options, refresh }) => {
|
||||
|
||||
<Form
|
||||
labelPosition='left'
|
||||
labelAlign='right'
|
||||
labelAlign='end'
|
||||
labelWidth={180}
|
||||
onSubmit={onSubmit}
|
||||
initValues={{
|
||||
|
||||
@@ -486,6 +486,7 @@ export default function ModelSettingsVisualEditor(props) {
|
||||
</Checkbox>
|
||||
</Space>
|
||||
<Table
|
||||
rowKey='name'
|
||||
columns={columns}
|
||||
dataSource={pagedData}
|
||||
pagination={{
|
||||
|
||||
@@ -860,11 +860,14 @@ export default function SettingsWeyAi() {
|
||||
return (
|
||||
<Card>
|
||||
<Form.Section
|
||||
component='form'
|
||||
onSubmit={(event) => event.preventDefault()}
|
||||
autoComplete='off'
|
||||
text={t('WeyAi')}
|
||||
extraText={t('WeyAi 桌面端与网页端的账号接入配置,仅超级管理员可见')}
|
||||
>
|
||||
{/* 保存期间也盖住表单:三批串行提交加回读有一两秒,这期间的输入会被
|
||||
成功后的回读冲掉 */}
|
||||
成功后的回读冲掉 */}
|
||||
<Spin spinning={loading || saving}>
|
||||
<div className='weyai-settings flex flex-col gap-4'>
|
||||
{groupLoadFailed && (
|
||||
@@ -917,6 +920,7 @@ export default function SettingsWeyAi() {
|
||||
<Text className='block mb-1'>{t('网页端客户端密钥')}</Text>
|
||||
<Input
|
||||
mode='password'
|
||||
autoComplete='new-password'
|
||||
value={secretInput}
|
||||
onChange={setSecretInput}
|
||||
aria-label={t('网页端客户端密钥')}
|
||||
@@ -979,6 +983,7 @@ export default function SettingsWeyAi() {
|
||||
<Text className='block mb-1'>{t('公网访问客户端密钥')}</Text>
|
||||
<Input
|
||||
mode='password'
|
||||
autoComplete='new-password'
|
||||
value={remoteSecretInput}
|
||||
onChange={setRemoteSecretInput}
|
||||
aria-label={t('公网访问客户端密钥')}
|
||||
@@ -1052,15 +1057,15 @@ export default function SettingsWeyAi() {
|
||||
{t('黑名单优先于开放范围;收回权限只禁止访问,不删除数据')}
|
||||
</Text>
|
||||
{/* 后端只在登录、密钥刷新、密钥轮换时重算开放范围,普通请求
|
||||
走 60 秒的账号状态缓存但不重算范围,已登录会话要等访问
|
||||
密钥到期(2 小时)才被挡下。不写出来,管理员会以为收紧立刻生效 */}
|
||||
走 60 秒的账号状态缓存但不重算范围,已登录会话要等访问
|
||||
密钥到期(2 小时)才被挡下。不写出来,管理员会以为收紧立刻生效 */}
|
||||
<Text type='tertiary' size='small' className='block'>
|
||||
{t(
|
||||
'收紧范围或加入黑名单后,已登录的网页端会话最长到访问密钥到期(2 小时)或重新登录时才会重新校验',
|
||||
)}
|
||||
</Text>
|
||||
{/* 开放范围与黑名单只管网页端登录;登录时下发的 WeyAi 密钥是普通
|
||||
密钥,没有失效时点。管理员若靠黑名单止损会误以为用量已停 */}
|
||||
密钥,没有失效时点。管理员若靠黑名单止损会误以为用量已停 */}
|
||||
<Text type='tertiary' size='small' className='block'>
|
||||
{t(
|
||||
'已下发的 WeyAi 密钥不受开放范围和黑名单影响,仍可直接调用模型;要停用请到密钥管理或企业密钥页禁用该密钥,或禁用该用户。桌面端登录不受开放范围限制',
|
||||
@@ -1098,8 +1103,8 @@ export default function SettingsWeyAi() {
|
||||
placeholder={t('选择用户分组')}
|
||||
/>
|
||||
{/* 企业托管账号的用户分组一律是 default,与普通注册用户相同:
|
||||
这一项若对企业范围也生效,选了 default 就等于放开所有企业,
|
||||
企业卡的名单形同虚设。后端只在个人范围匹配它 */}
|
||||
这一项若对企业范围也生效,选了 default 就等于放开所有企业,
|
||||
企业卡的名单形同虚设。后端只在个人范围匹配它 */}
|
||||
<Text type='tertiary' size='small'>
|
||||
{t(
|
||||
'按用户所在分组判断,只对个人范围登录生效;以企业范围登录时不看这一项',
|
||||
@@ -1107,8 +1112,8 @@ export default function SettingsWeyAi() {
|
||||
</Text>
|
||||
</div>
|
||||
{/* ID 输入框开 addOnBlur:Semi TagInput 默认只在回车时把输入
|
||||
提交成标签,管理员输完直接点「保存」会先失焦,没提交的输入
|
||||
被丢掉,看起来就是"配置不生效、刷新后也不回显"。 */}
|
||||
提交成标签,管理员输完直接点「保存」会先失焦,没提交的输入
|
||||
被丢掉,看起来就是"配置不生效、刷新后也不回显"。 */}
|
||||
<div className='mb-4'>
|
||||
<Text className='block mb-1'>{t('开放用户 ID')}</Text>
|
||||
<TagInput
|
||||
@@ -1184,7 +1189,7 @@ export default function SettingsWeyAi() {
|
||||
)}
|
||||
</Text>
|
||||
{/* 自助注册(免激活时)出来的企业可用分组就是自助注册默认分组,
|
||||
把它选进来等于把"指定范围"变成人人可自助获得 */}
|
||||
把它选进来等于把"指定范围"变成人人可自助获得 */}
|
||||
<Text type='tertiary' size='small' className='block'>
|
||||
{t(
|
||||
'若包含企业自助注册的默认分组,自助注册且已激活的企业也会一并开放',
|
||||
|
||||
@@ -237,6 +237,9 @@ const SettingsWeyAiContentStorage = () => {
|
||||
return (
|
||||
<Card>
|
||||
<Form.Section
|
||||
component='form'
|
||||
onSubmit={(event) => event.preventDefault()}
|
||||
autoComplete='off'
|
||||
text={t('内容存储')}
|
||||
extraText={t(
|
||||
'WeyAi 展示内容(作品视频、封面、模板包)专用的腾讯云 COS 存储桶,和系统 COS 桶分开;没有配置时内容功能不可用,不会改用系统桶',
|
||||
@@ -305,6 +308,7 @@ const SettingsWeyAiContentStorage = () => {
|
||||
<Text className='block mb-1'>SecretKey</Text>
|
||||
<Input
|
||||
mode='password'
|
||||
autoComplete='new-password'
|
||||
value={secretKeyInput}
|
||||
onChange={setSecretKeyInput}
|
||||
aria-label='SecretKey'
|
||||
|
||||
@@ -75,6 +75,7 @@ const SkillPlatform = () => {
|
||||
const [total, setTotal] = useState(0);
|
||||
const pageSize = 50;
|
||||
const [selected, setSelected] = useState(null);
|
||||
const [detailTab, setDetailTab] = useState('review');
|
||||
const [detail, setDetail] = useState(null);
|
||||
const [importVisible, setImportVisible] = useState(false);
|
||||
const [importing, setImporting] = useState(false);
|
||||
@@ -269,6 +270,7 @@ const SkillPlatform = () => {
|
||||
|
||||
const loadDetail = useCallback(
|
||||
async (skill) => {
|
||||
setDetailTab('review');
|
||||
setSelected(skill);
|
||||
try {
|
||||
const response = await API.get(
|
||||
@@ -868,11 +870,81 @@ const SkillPlatform = () => {
|
||||
|
||||
<SkillDetailSideSheet
|
||||
visible={!!selected}
|
||||
className='skill-platform-review-drawer'
|
||||
onCancel={() => {
|
||||
setSelected(null);
|
||||
setDetail(null);
|
||||
}}
|
||||
title={detail?.definition?.canonical_id || t('Skill 详情')}
|
||||
footer={
|
||||
detail && currentVersion && detailTab === 'review' ? (
|
||||
<div className='skill-review-actions'>
|
||||
<Button
|
||||
onClick={() =>
|
||||
execute(
|
||||
`/api/skill-platform/versions/${currentVersion.id}/rescan`,
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('重新扫描')}
|
||||
</Button>
|
||||
<Button onClick={openModelTest}>{t('模型实测')}</Button>
|
||||
{currentVersion.reviews?.[0]?.status === 'pending' && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
execute(
|
||||
`/api/skill-platform/versions/${currentVersion.id}/review/start`,
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('开始审核')}
|
||||
</Button>
|
||||
)}
|
||||
{currentVersion.reviews?.[0]?.status === 'reviewing' && (
|
||||
<>
|
||||
<Button
|
||||
type='primary'
|
||||
onClick={() => {
|
||||
// 逐项勾选替代一键 hardcode:默认全不勾,
|
||||
// 强制审核人对四个维度逐项作出确认。
|
||||
setReviewChecklist({
|
||||
value: false,
|
||||
localization: false,
|
||||
safety: false,
|
||||
quality: false,
|
||||
});
|
||||
setReviewDecision({ approved: true });
|
||||
}}
|
||||
>
|
||||
{t('审核通过')}
|
||||
</Button>
|
||||
<Button
|
||||
type='danger'
|
||||
onClick={() => {
|
||||
setReviewReason('');
|
||||
setReviewDecision({ approved: false });
|
||||
}}
|
||||
>
|
||||
{t('驳回')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{currentVersion.reviews?.[0]?.status === 'approved' && (
|
||||
<Button
|
||||
theme='solid'
|
||||
type='primary'
|
||||
onClick={() =>
|
||||
execute(
|
||||
`/api/skill-platform/versions/${currentVersion.id}/publish`,
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('发布此版本')}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
>
|
||||
{detail && (
|
||||
<div className='skill-platform-detail'>
|
||||
@@ -900,7 +972,7 @@ const SkillPlatform = () => {
|
||||
{t('紧急停用')}
|
||||
</Button>
|
||||
</div>
|
||||
<Tabs type='line'>
|
||||
<Tabs type='line' activeKey={detailTab} onChange={setDetailTab}>
|
||||
<TabPane tab={t('审核工作台')} itemKey='review'>
|
||||
{currentVersion && (
|
||||
<div className='skill-review-workbench'>
|
||||
@@ -926,71 +998,6 @@ const SkillPlatform = () => {
|
||||
/>
|
||||
</section>
|
||||
<pre>{currentVersion.body}</pre>
|
||||
<div className='skill-review-actions'>
|
||||
<Button
|
||||
onClick={() =>
|
||||
execute(
|
||||
`/api/skill-platform/versions/${currentVersion.id}/rescan`,
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('重新扫描')}
|
||||
</Button>
|
||||
<Button onClick={openModelTest}>{t('模型实测')}</Button>
|
||||
{currentVersion.reviews?.[0]?.status === 'pending' && (
|
||||
<Button
|
||||
onClick={() =>
|
||||
execute(
|
||||
`/api/skill-platform/versions/${currentVersion.id}/review/start`,
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('开始审核')}
|
||||
</Button>
|
||||
)}
|
||||
{currentVersion.reviews?.[0]?.status === 'reviewing' && (
|
||||
<>
|
||||
<Button
|
||||
type='primary'
|
||||
onClick={() => {
|
||||
// 逐项勾选替代一键 hardcode:默认全不勾,
|
||||
// 强制审核人对四个维度逐项作出确认。
|
||||
setReviewChecklist({
|
||||
value: false,
|
||||
localization: false,
|
||||
safety: false,
|
||||
quality: false,
|
||||
});
|
||||
setReviewDecision({ approved: true });
|
||||
}}
|
||||
>
|
||||
{t('审核通过')}
|
||||
</Button>
|
||||
<Button
|
||||
type='danger'
|
||||
onClick={() => {
|
||||
setReviewReason('');
|
||||
setReviewDecision({ approved: false });
|
||||
}}
|
||||
>
|
||||
{t('驳回')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{currentVersion.reviews?.[0]?.status === 'approved' && (
|
||||
<Button
|
||||
theme='solid'
|
||||
type='primary'
|
||||
onClick={() =>
|
||||
execute(
|
||||
`/api/skill-platform/versions/${currentVersion.id}/publish`,
|
||||
)
|
||||
}
|
||||
>
|
||||
{t('发布此版本')}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</TabPane>
|
||||
|
||||
@@ -169,8 +169,8 @@
|
||||
}
|
||||
|
||||
.skill-review-workbench pre {
|
||||
max-height: 440px;
|
||||
overflow: auto;
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
padding: 16px;
|
||||
border-radius: 12px;
|
||||
background: var(--ui-color-fill-0);
|
||||
@@ -178,6 +178,15 @@
|
||||
font-family: 'IBM Plex Mono', 'Cascadia Code', monospace;
|
||||
}
|
||||
|
||||
.skill-review-actions {
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.skill-platform-review-drawer .ant-drawer-body {
|
||||
max-height: none;
|
||||
}
|
||||
|
||||
.skill-derive-grid {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import React, { useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
ConsoleCard,
|
||||
ConsoleAlert,
|
||||
ConsoleTabs,
|
||||
} from '../../components/console/ConsolePrimitives';
|
||||
import ProfileTable from '../../components/smart-router/ProfileTable';
|
||||
@@ -68,15 +69,12 @@ const SmartRouterPage = () => {
|
||||
|
||||
return (
|
||||
<div className='smart-router-page'>
|
||||
<div className='smart-router-hero'>
|
||||
<div className='smart-router-eyebrow'>{t('Smart Router')}</div>
|
||||
<h1>{t('智能路由')}</h1>
|
||||
<p>
|
||||
{t(
|
||||
'一个虚拟模型名背后挂多个候选模型,按请求自动选择合适的模型。调用时把模型名写成 router/短名 即可。',
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<ConsoleAlert
|
||||
className='smart-router-intro'
|
||||
title={t(
|
||||
'一个虚拟模型名背后挂多个候选模型,按请求自动选择合适的模型。调用时把模型名写成 router/短名 即可。',
|
||||
)}
|
||||
/>
|
||||
<ConsoleCard className='smart-router-tabs-card'>
|
||||
<ConsoleTabs
|
||||
activeKey={activeKey}
|
||||
|
||||
@@ -231,9 +231,6 @@ html.dark .usage-record-consume-card {
|
||||
.usage-logs-table.usage-record-table .usage-record-time span {
|
||||
color: var(--ur-time-date);
|
||||
}
|
||||
.usage-logs-table.usage-record-table .usage-record-use-time em {
|
||||
color: var(--ur-consume-first-time);
|
||||
}
|
||||
.usage-logs-table.usage-record-table .ant-tag {
|
||||
padding: 0 7px;
|
||||
border-radius: 6px;
|
||||
@@ -247,9 +244,12 @@ html.dark .usage-record-consume-card {
|
||||
color: var(--ur-text);
|
||||
}
|
||||
.usage-logs-table.usage-record-table .usage-record-use-time .ant-tag {
|
||||
margin-inline-end: 0;
|
||||
padding: 0 6px;
|
||||
font-size: 11px;
|
||||
line-height: 18px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
font-variant-numeric: tabular-nums;
|
||||
line-height: 22px;
|
||||
}
|
||||
.usage-logs-table.usage-record-table .usage-record-cost {
|
||||
color: var(--ur-cost);
|
||||
@@ -309,13 +309,9 @@ html.dark .usage-record-consume-card {
|
||||
.usage-record-use-time {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: 6px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.usage-record-use-time em {
|
||||
color: var(--ur-time-date);
|
||||
font-style: normal;
|
||||
}
|
||||
.usage-record-cost {
|
||||
color: var(--ur-cost);
|
||||
font-weight: 600;
|
||||
|
||||
Reference in New Issue
Block a user