feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面

This commit is contained in:
zhanjunhao
2026-11-09 21:45:37 +08:00
parent 54b3e0cc21
commit 5c0849e82b
242 changed files with 9242 additions and 5043 deletions
+62 -34
View File
@@ -17,17 +17,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React, { useMemo } from 'react';
import { Empty } from '@/components/ui';
import TableEmpty from '../../common/table/TableEmpty';
import React, { useMemo, useState } from 'react';
import { Descriptions } from 'antd';
import { Modal } from '@/components/ui';
import CardTable from '../../common/ui/CardTable';
import {
IllustrationNoResult,
IllustrationNoResultDark,
} from '../../common/illustrations';
import { getModelsColumns } from './ModelsColumnDefs';
import { useModelCategories } from '../../../hooks/models/useModelCategories';
import './models-vendor-tabs.css';
const ModelsTable = (modelsData) => {
const [detailModel, setDetailModel] = useState(null);
const {
models,
loading,
@@ -44,6 +45,7 @@ const ModelsTable = (modelsData) => {
setShowEdit,
refresh,
vendorMap,
copyText,
t,
} = modelsData;
@@ -60,6 +62,8 @@ const ModelsTable = (modelsData) => {
refresh,
vendorMap,
categoryNames,
setDetailModel,
copyText,
});
}, [
t,
@@ -69,6 +73,7 @@ const ModelsTable = (modelsData) => {
refresh,
vendorMap,
categoryNames,
copyText,
]);
// Handle compact mode by removing fixed positioning
@@ -85,36 +90,59 @@ const ModelsTable = (modelsData) => {
}, [compactMode, columns]);
return (
<CardTable
columns={tableColumns}
dataSource={models}
scroll={compactMode ? undefined : { x: 'max-content' }}
pagination={{
currentPage: activePage,
pageSize: pageSize,
total: modelCount,
showSizeChanger: true,
pageSizeOptions: [10, 20, 50, 100],
onPageSizeChange: handlePageSizeChange,
onPageChange: handlePageChange,
}}
hidePagination={true}
loading={loading}
rowSelection={rowSelection}
onRow={handleRow}
empty={
<Empty
image={<IllustrationNoResult style={{ width: 150, height: 150 }} />}
darkModeImage={
<IllustrationNoResultDark style={{ width: 150, height: 150 }} />
<>
<Modal
title={t('详情')}
visible={Boolean(detailModel)}
onCancel={() => setDetailModel(null)}
maskClosable
footer={null}
width={720}
>
<Descriptions
className='models-detail-descriptions'
bordered
column={1}
items={
detailModel
? columns
.filter((column) => column.dataIndex !== 'operate')
.map((column, key) => ({
key,
label: column.title,
children: column.render
? column.render(
detailModel[column.dataIndex],
detailModel,
)
: (detailModel[column.dataIndex] ?? '-'),
}))
: []
}
description={t('搜索无结果')}
style={{ padding: 30 }}
/>
}
className='rounded-xl overflow-hidden'
size='middle'
/>
</Modal>
<CardTable
columns={tableColumns}
dataSource={models}
scroll={compactMode ? undefined : { x: 'max-content' }}
pagination={{
currentPage: activePage,
pageSize: pageSize,
total: modelCount,
showSizeChanger: true,
pageSizeOptions: [10, 20, 50, 100],
onPageSizeChange: handlePageSizeChange,
onPageChange: handlePageChange,
}}
hidePagination={true}
loading={loading}
rowSelection={rowSelection}
onRow={handleRow}
empty={<TableEmpty />}
className='rounded-xl overflow-hidden'
size='middle'
/>
</>
);
};