feat: 参考原型图 ui优化提交 企业端-企业中心 相关的页面

This commit is contained in:
zhanjunhao
2026-11-06 20:19:43 +08:00
parent d4495eb703
commit 84803192ba
147 changed files with 9816 additions and 8768 deletions
@@ -0,0 +1,91 @@
/*
Copyright (C) 2025 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
import { DatePicker, Form, Input, Modal, Select } from 'antd';
import dayjs from 'dayjs';
import './user-dashboard-filter.css';
const DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss';
const UserDashboardFilterModal = ({
searchModalVisible,
handleSearchConfirm,
handleCloseModal,
isAdminUser,
inputs,
dataExportDefaultTime,
timeOptions,
handleInputChange,
t,
}) => (
<Modal
open={searchModalVisible}
title={t('筛选数据')}
width={520}
className='uc-dashboard-filter-modal'
onCancel={handleCloseModal}
onOk={handleSearchConfirm}
okText={t('查询')}
cancelText={t('取消')}
maskClosable
>
<Form layout='vertical' requiredMark={false}>
<Form.Item label={t('时间范围')} htmlFor='dashboard-filter-range'>
<DatePicker.RangePicker
id='dashboard-filter-range'
aria-label={t('时间范围')}
showTime
format={DATE_FORMAT}
allowClear={false}
value={[dayjs(inputs.start_timestamp), dayjs(inputs.end_timestamp)]}
onChange={(_, dateStrings) => {
// Keep the existing query hook's local date-string contract.
handleInputChange(dateStrings[0], 'start_timestamp');
handleInputChange(dateStrings[1], 'end_timestamp');
}}
/>
</Form.Item>
<Form.Item label={t('时间粒度')} htmlFor='dashboard-filter-granularity'>
<Select
id='dashboard-filter-granularity'
value={dataExportDefaultTime}
options={timeOptions}
onChange={(value) =>
handleInputChange(value, 'data_export_default_time')
}
/>
</Form.Item>
{isAdminUser && (
<Form.Item label={t('用户名称')} htmlFor='dashboard-filter-username'>
<Input
id='dashboard-filter-username'
value={inputs.username}
placeholder={t('可选值')}
onChange={(event) =>
handleInputChange(event.target.value, 'username')
}
/>
</Form.Item>
)}
</Form>
</Modal>
);
export default UserDashboardFilterModal;
@@ -0,0 +1,15 @@
.uc-dashboard-filter-modal .ant-modal-body {
padding-top: 24px;
}
.uc-dashboard-filter-modal .ant-picker-range {
width: 100%;
}
.uc-dashboard-filter-modal .ant-form-item {
margin-bottom: 24px;
}
.uc-dashboard-filter-modal .ant-modal-footer {
margin-top: 0;
}