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
@@ -20,24 +20,9 @@ For commercial licensing, please contact support@quantumnous.com
import React, { useState, useRef } from 'react';
import { API, showError, showSuccess } from '../../../../helpers';
import { useIsMobile } from '../../../../hooks/common/useIsMobile';
import {
Button,
SideSheet,
Space,
Spin,
Typography,
Card,
Tag,
Avatar,
Form,
Row,
Col,
} from '@/components/ui';
import { IconSave, IconClose, IconUserAdd } from '@/components/ui/icons';
import { Button, SideSheet, Spin, Form, Row, Col } from '@/components/ui';
import { useTranslation } from 'react-i18next';
const { Text, Title } = Typography;
const AddUserModal = (props) => {
const { t } = useTranslation();
const formApiRef = useRef(null);
@@ -73,43 +58,23 @@ const AddUserModal = (props) => {
return (
<>
<SideSheet
placement={'left'}
title={
<Space>
<Tag color='green' shape='circle'>
{t('新建')}
</Tag>
<Title heading={4} className='m-0'>
{t('添加用户')}
</Title>
</Space>
}
bodyStyle={{ padding: '0' }}
placement='right'
classNames={{ header: 'console-detail-header' }}
title={t('添加用户')}
visible={props.visible}
width={isMobile ? '100%' : 600}
width={isMobile ? '100%' : 560}
footer={
<div className='flex justify-end'>
<Space>
<Button
theme='solid'
onClick={() => formApiRef.current?.submitForm()}
icon={<IconSave />}
loading={loading}
>
{t('提交')}
</Button>
<Button
theme='light'
type='primary'
onClick={handleCancel}
icon={<IconClose />}
>
{t('取消')}
</Button>
</Space>
<div className='console-dialog-actions'>
<Button onClick={handleCancel}>{t('取消')}</Button>
<Button
theme='solid'
onClick={() => formApiRef.current?.submitForm()}
loading={loading}
>
{t('确定')}
</Button>
</div>
}
closeIcon={null}
onCancel={() => handleCancel()}
>
<Spin spinning={loading}>
@@ -123,59 +88,43 @@ const AddUserModal = (props) => {
formApiRef.current?.scrollToError();
}}
>
<div className='p-2'>
<Card className='!rounded-2xl shadow-sm border-0'>
<div className='flex items-center mb-2'>
<Avatar size='small' color='blue' className='mr-2 shadow-md'>
<IconUserAdd size={16} />
</Avatar>
<div>
<Text className='text-lg font-medium'>{t('用户信息')}</Text>
<div className='text-xs text-gray-600'>
{t('创建新用户账户')}
</div>
</div>
</div>
<Row gutter={12}>
<Col span={24}>
<Form.Input
field='username'
label={t('用户名')}
placeholder={t('请输入用户名')}
rules={[{ required: true, message: t('请输入用户名') }]}
showClear
/>
</Col>
<Col span={24}>
<Form.Input
field='display_name'
label={t('显示名称')}
placeholder={t('请输入显示名称')}
showClear
/>
</Col>
<Col span={24}>
<Form.Input
field='password'
label={t('密码')}
type='password'
placeholder={t('请输入密码')}
rules={[{ required: true, message: t('请输入密码') }]}
showClear
/>
</Col>
<Col span={24}>
<Form.Input
field='remark'
label={t('备注')}
placeholder={t('请输入备注(仅管理员可见)')}
showClear
/>
</Col>
</Row>
</Card>
</div>
<Row gutter={12}>
<Col span={24}>
<Form.Input
field='username'
label={t('用户名')}
placeholder={t('请输入用户名')}
rules={[{ required: true, message: t('请输入用户名') }]}
showClear
/>
</Col>
<Col span={24}>
<Form.Input
field='display_name'
label={t('显示名称')}
placeholder={t('请输入显示名称')}
showClear
/>
</Col>
<Col span={24}>
<Form.Input
field='password'
label={t('密码')}
type='password'
placeholder={t('请输入密码')}
rules={[{ required: true, message: t('请输入密码') }]}
showClear
/>
</Col>
<Col span={24}>
<Form.Input
field='remark'
label={t('备注')}
placeholder={t('请输入备注(仅管理员可见)')}
showClear
/>
</Col>
</Row>
</Form>
</Spin>
</SideSheet>
@@ -19,12 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
import React, { useEffect, useState, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import {
API,
showError,
showSuccess,
renderQuota,
} from '../../../../helpers';
import { API, showError, showSuccess, renderQuota } from '../../../../helpers';
import { useIsMobile } from '../../../../hooks/common/useIsMobile';
import {
Button,
@@ -34,25 +29,20 @@ import {
Spin,
Typography,
Card,
Tag,
Form,
Avatar,
Row,
Col,
} from '@/components/ui';
import QuotaInput, {
FormQuotaInput,
} from '../../../common/ui/QuotaInput';
import QuotaInput, { FormQuotaInput } from '../../../common/ui/QuotaInput';
import {
IconUser,
IconSave,
IconClose,
IconLink,
IconUserGroup,
IconPlus,
} from '@/components/ui/icons';
const { Text, Title } = Typography;
const { Text } = Typography;
const EditUserModal = (props) => {
const { t } = useTranslation();
@@ -176,42 +166,25 @@ const EditUserModal = (props) => {
<>
<SideSheet
placement='right'
title={
<Space>
<Tag color='blue' shape='circle'>
{t(isEdit ? '编辑' : '新建')}
</Tag>
<Title heading={4} className='m-0'>
{isEdit ? t('编辑用户') : t('创建用户')}
</Title>
</Space>
}
classNames={{ header: 'console-detail-header' }}
title={isEdit ? t('编辑用户') : t('创建用户')}
bodyStyle={{ padding: 0 }}
visible={props.visible}
width={isMobile ? '100%' : 600}
footer={
<div className='flex justify-end'>
<Space>
<Button onClick={handleCancel}>{t('取消')}</Button>
<Button
theme='solid'
onClick={() => formApiRef.current?.submitForm()}
icon={<IconSave />}
loading={loading}
>
{t('提交')}
</Button>
<Button
theme='light'
type='primary'
onClick={handleCancel}
icon={<IconClose />}
>
{t('取消')}
{t('确定')}
</Button>
</Space>
</div>
}
closeIcon={null}
onCancel={handleCancel}
>
<Spin spinning={loading}>
@@ -18,12 +18,9 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React, { useState, useEffect } from 'react';
import { Modal, Table, Tag, Empty, Spin } from '@/components/ui';
import { Modal, Table, Tag, Spin } from '@/components/ui';
import { API, renderQuota, renderNumber, showError } from '../../../../helpers';
import {
IllustrationNoResult,
IllustrationNoResultDark,
} from '../../../common/illustrations';
import TableEmpty from '../../../common/table/TableEmpty';
const InvitedUsersModal = ({ visible, onCancel, user, t }) => {
const [invitedUsers, setInvitedUsers] = useState([]);
@@ -162,18 +159,7 @@ const InvitedUsersModal = ({ visible, onCancel, user, t }) => {
dataSource={invitedUsers}
pagination={false}
size='small'
empty={
<Empty
image={
<IllustrationNoResult style={{ width: 150, height: 150 }} />
}
darkModeImage={
<IllustrationNoResultDark style={{ width: 150, height: 150 }} />
}
description={t('该用户暂未邀请任何用户')}
style={{ padding: 30 }}
/>
}
empty={<TableEmpty />}
style={{ maxHeight: '500px', overflowY: 'auto' }}
/>
</Spin>