feat(org): expose enterprise drawing and task logs

This commit is contained in:
qiubaishen
2026-11-06 18:52:10 +08:00
parent 903cbc946b
commit abf81fcabc
9 changed files with 234 additions and 90 deletions
+14
View File
@@ -47,6 +47,7 @@ import {
import OrgPageHeader from './components/OrgPageHeader';
import StatCard from './components/OrgStatCard';
import OrgModal from './components/OrgModal';
import TaskLogsTable from '../../components/table/task-logs';
import {
API,
showError,
@@ -240,6 +241,7 @@ const OrgLogs = ({ orgId, orgRole, isDeptManager = false }) => {
const [page, setPage] = useState(1);
const pageSize = 20;
const [activeTab, setActiveTab] = useState('logs');
const [taskFilterRevision, setTaskFilterRevision] = useState(0);
const isAdmin =
orgRole === 'owner' || orgRole === 'admin' || orgRole === 'super_admin';
const canViewTeamUsage = isAdmin || isDeptManager;
@@ -351,6 +353,7 @@ const OrgLogs = ({ orgId, orgRole, isDeptManager = false }) => {
);
}
setPage(1);
setTaskFilterRevision((revision) => revision + 1);
};
// 重置:回到默认状态(滚动最近 7 天、不限成员/模型)
@@ -371,6 +374,7 @@ const OrgLogs = ({ orgId, orgRole, isDeptManager = false }) => {
});
}
setPage(1);
setTaskFilterRevision((revision) => revision + 1);
};
// 导出弹窗状态(导出方式 + 字段勾选从 localStorage 恢复)
@@ -931,6 +935,16 @@ const OrgLogs = ({ orgId, orgRole, isDeptManager = false }) => {
/>
</TabPane>
<TabPane tab={t('绘图与视频')} itemKey='tasks'>
<TaskLogsTable
usageRecordMode
organizationMode
sharedStartTimestamp={appliedFilters.startTimestamp}
sharedEndTimestamp={appliedFilters.endTimestamp}
sharedFilterRevision={taskFilterRevision}
/>
</TabPane>
{canViewTeamUsage && (
<TabPane tab={t('成员排行')} itemKey='ranking'>
<Table