Добавлены фильтры для сообщений. Убраны заголовки. Изменены стили.

This commit is contained in:
Alexey 2021-06-01 14:32:36 +05:00
parent 6931806372
commit e13eda5ed1
3 changed files with 32 additions and 31 deletions

View File

@ -17,7 +17,7 @@ export default function Well() {
<Layout> <Layout>
<Menu <Menu
mode="horizontal" mode="horizontal"
selectable={false} selectable={true}
className="well_menu" className="well_menu"
> >
<Menu.Item key="1" icon={<FundViewOutlined/>}> <Menu.Item key="1" icon={<FundViewOutlined/>}>

View File

@ -1,4 +1,4 @@
import {Button, Table, Select, DatePicker, ConfigProvider} from 'antd'; import {Table, Select, DatePicker, ConfigProvider} from 'antd';
import {MessageService} from '../services/api' import {MessageService} from '../services/api'
import {useState, useEffect} from 'react' import {useState, useEffect} from 'react'
import {useParams} from 'react-router-dom' import {useParams} from 'react-router-dom'
@ -70,12 +70,12 @@ export default function Messages() {
setRange(range) setRange(range)
} }
const GetMessages = async() => { const GetMessages = async () => {
setLoader(true) setLoader(true)
try { try {
let begin = null let begin = null
let end = null let end = null
if(range?.length>1){ if (range?.length > 1) {
begin = range[0].toISOString() begin = range[0].toISOString()
end = range[1].toISOString() end = range[1].toISOString()
} }
@ -110,16 +110,16 @@ export default function Messages() {
return ( return (
<> <>
<h2>Сообщения</h2>
<hr/> <div className='filter-group'>
<h3>Фильтр сообщений</h3> <h3 className='filter-group__heading'>Фильтр сообщений</h3>
<Select <Select
mode="multiple" mode="multiple"
allowClear allowClear
placeholder="Фильтр сообщений" placeholder="Фильтр сообщений"
className="filter-selector" className="filter-selector"
value={categories} value={categories}
onChange = {setCategories}> onChange={setCategories}>
{children} {children}
</Select> </Select>
<ConfigProvider locale={locale}> <ConfigProvider locale={locale}>
@ -128,7 +128,7 @@ export default function Messages() {
onChange={onChangeRange} onChange={onChangeRange}
/> />
</ConfigProvider> </ConfigProvider>
</div>
<Table <Table
columns={columns} columns={columns}
dataSource={messages} dataSource={messages}

View File

@ -1,11 +1,3 @@
/*.ant-table.ant-table-small .ant-table-tbody > tr > td {*/
/* padding: 0;*/
/*}*/
/*.ant-table-tbody > tr > td {*/
/* border-bottom: 0.5px;*/
/*}*/
.event_message > td { .event_message > td {
font-size: 14px; font-size: 14px;
padding: 1px !important; padding: 1px !important;
@ -37,6 +29,15 @@
background: #505060; background: #505060;
} }
.filter-group {
margin: 0 0 5px 0;
}
.filter-group__heading {
margin: 5px auto;
align-items: center;
}
td.ant-table-column-sort { td.ant-table-column-sort {
color: black; color: black;
background-color: rgb(221, 247, 221); background-color: rgb(221, 247, 221);