feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -16,18 +16,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import TableEmpty from '../../components/common/table/TableEmpty';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { getQuotaPerUnit } from '../../helpers';
|
||||
import { timestamp2string } from '../../helpers/utils';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { RefreshCw, ScrollText, Search } from 'lucide-react';
|
||||
import { RefreshCw, Search } from 'lucide-react';
|
||||
import { Form as AntForm, Tabs as AntTabs } from 'antd';
|
||||
import { Table, Select, Button, Tag, Tooltip } from '@/components/ui';
|
||||
import { API } from '../../helpers/api';
|
||||
import { useOrgAuditLogs } from '../../hooks/org/useOrgData';
|
||||
import OrgPageHeader from './components/OrgPageHeader';
|
||||
import { OrgFilterCard, OrgListCard } from './components/OrgListCard';
|
||||
import OrgStateBlock from './components/OrgStateBlock';
|
||||
import OrgPromptRecords from './OrgPromptRecords';
|
||||
import {
|
||||
formatQuotaAsCNY,
|
||||
@@ -212,6 +212,7 @@ const OrgAudit = ({ orgId }) => {
|
||||
const quotaPerUnit = getQuotaPerUnit();
|
||||
const { logs, total, loading, fetch } = useOrgAuditLogs(orgId);
|
||||
const [page, setPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(20);
|
||||
const [actionFilter, setActionFilter] = useState('');
|
||||
const [activeTab, setActiveTab] = useState('operations');
|
||||
// 提示词记录 tab 由企业 feature flag(prompt_archive)控制显隐
|
||||
@@ -220,8 +221,8 @@ const OrgAudit = ({ orgId }) => {
|
||||
const [canViewPromptRecords, setCanViewPromptRecords] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
fetch(page, 20, actionFilter);
|
||||
}, [fetch, page, actionFilter]);
|
||||
fetch(page, pageSize, actionFilter);
|
||||
}, [fetch, page, pageSize, actionFilter]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!orgId) return;
|
||||
@@ -386,7 +387,7 @@ const OrgAudit = ({ orgId }) => {
|
||||
},
|
||||
];
|
||||
|
||||
const refresh = () => fetch(page, 20, actionFilter);
|
||||
const refresh = () => fetch(page, pageSize, actionFilter);
|
||||
// 选择即筛选(原交互):与原页头 Select 的 onChange 相同
|
||||
const applyAction = (v) => {
|
||||
setActionFilter(v ?? '');
|
||||
@@ -445,13 +446,17 @@ const OrgAudit = ({ orgId }) => {
|
||||
scroll={{ x: 1140 }}
|
||||
pagination={{
|
||||
currentPage: page,
|
||||
pageSize: 20,
|
||||
pageSize,
|
||||
showSizeChanger: false,
|
||||
total,
|
||||
onPageChange: setPage,
|
||||
onPageSizeChange: (size) => {
|
||||
setPage(1);
|
||||
setPageSize(size);
|
||||
},
|
||||
showTotal: (n) => t('共 {{total}} 条', { total: n }),
|
||||
}}
|
||||
empty={<OrgStateBlock icon={ScrollText} title={t('暂无审计日志')} />}
|
||||
empty={<TableEmpty />}
|
||||
/>
|
||||
</OrgListCard>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user