sync: 同步 monkey-ai@weiyuan(ddc5b9443) 的 web/ 到 ui-optimization
- 合入 weiyuan 新功能前端:分佣 V2 / 伙伴工作台、智能路由、企业资金与分析、官网设置与预约演示等, semi-ui 已全部迁移到 antd 6 / @/components/ui,不重新引入 Semi - 分佣二级菜单与页头去重、伙伴入口探测(企业伙伴走企业中心「企业分佣」)、超管侧栏入口恢复 - 适配层 DatePicker / TimePicker 统一 onChange(Date|Date[]|null, 文本) 契约;生产构建剔除调试日志 - 图片链接刷新:同任务请求复用、后台刷新不弹全局错误、离页停止批量请求 - 恢复 bun.lock(与 package-lock.json 共存);docs 规范与 CHANGELOG 更新 - 停止跟踪 .env.playwright.local(本地登录凭据,已加入 .gitignore)
This commit is contained in:
@@ -41,7 +41,7 @@ import {
|
||||
Spin,
|
||||
Typography,
|
||||
} from '@/components/ui';
|
||||
import { Users, TrendingUp, FileClock } from 'lucide-react';
|
||||
import { Users, TrendingUp, FileClock, Wallet } from 'lucide-react';
|
||||
import { API } from '../../helpers/api';
|
||||
import { showError, collectPagedItems } from '../../helpers';
|
||||
import { renderQuota } from '../../helpers/render';
|
||||
@@ -51,6 +51,7 @@ import OrgPageHeader from './components/OrgPageHeader';
|
||||
import OrgPanel from './components/OrgPanel';
|
||||
import OrgModal from './components/OrgModal';
|
||||
import { orgStatusColor } from './components/orgStatus';
|
||||
import DeptFundsPanel from './fund/DeptFundsPanel';
|
||||
|
||||
const { Text } = Typography;
|
||||
const getOrgHeaders = (orgId) => ({ 'X-Org-Id': String(orgId) });
|
||||
@@ -83,6 +84,11 @@ const isFeatureEnabled = (flags, key) => {
|
||||
const OrgDeptManage = ({ orgId, featureFlags }) => {
|
||||
const { t } = useTranslation();
|
||||
const approvalEnabled = isFeatureEnabled(featureFlags, 'approval');
|
||||
// 部门资金(MaaS V2.1.0 P0):同时开通 dept 与 budget 才展示(M-08)
|
||||
const fundsEnabled =
|
||||
isFeatureEnabled(featureFlags, 'dept') &&
|
||||
isFeatureEnabled(featureFlags, 'budget');
|
||||
const [fundsRefreshKey, setFundsRefreshKey] = useState(0);
|
||||
const [departments, setDepartments] = useState([]);
|
||||
const [deptId, setDeptId] = useState(null);
|
||||
const [myMemberId, setMyMemberId] = useState(0);
|
||||
@@ -327,6 +333,7 @@ const OrgDeptManage = ({ orgId, featureFlags }) => {
|
||||
onClick={() => {
|
||||
if (tab === 'members') fetchMembers();
|
||||
else if (tab === 'usage') fetchUsage();
|
||||
else if (tab === 'funds') setFundsRefreshKey((k) => k + 1);
|
||||
else fetchRequests();
|
||||
}}
|
||||
>
|
||||
@@ -477,6 +484,28 @@ const OrgDeptManage = ({ orgId, featureFlags }) => {
|
||||
)}
|
||||
</TabPane>
|
||||
)}
|
||||
|
||||
{fundsEnabled && (
|
||||
<TabPane
|
||||
tab={
|
||||
<span className='inline-flex items-center gap-1.5'>
|
||||
<Wallet size={14} /> {t('部门资金')}
|
||||
</span>
|
||||
}
|
||||
itemKey='funds'
|
||||
>
|
||||
{tab === 'funds' && (
|
||||
<DeptFundsPanel
|
||||
orgId={orgId}
|
||||
deptId={deptId}
|
||||
deptName={
|
||||
departments.find((d) => d.id === deptId)?.name || ''
|
||||
}
|
||||
refreshKey={fundsRefreshKey}
|
||||
/>
|
||||
)}
|
||||
</TabPane>
|
||||
)}
|
||||
</Tabs>
|
||||
</OrgPanel>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user