forked from ddrilling/asb_cloud_front
ConfigProvider перенесен в App.
This commit is contained in:
parent
2ae5e896ed
commit
73d59ae03d
10
src/App.js
10
src/App.js
@ -3,6 +3,8 @@ import {
|
|||||||
BrowserRouter as Router,
|
BrowserRouter as Router,
|
||||||
Switch,
|
Switch,
|
||||||
Route} from "react-router-dom"
|
Route} from "react-router-dom"
|
||||||
|
import {ConfigProvider} from 'antd'
|
||||||
|
import locale from "antd/lib/locale/ru_RU"
|
||||||
import Login from './pages/Login'
|
import Login from './pages/Login'
|
||||||
import Main from './pages/Main'
|
import Main from './pages/Main'
|
||||||
import { OpenAPI } from './services/api'
|
import { OpenAPI } from './services/api'
|
||||||
@ -13,7 +15,8 @@ OpenAPI.TOKEN = localStorage['token']
|
|||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
<Router>
|
<ConfigProvider locale={locale}>
|
||||||
|
<Router>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path="/login">
|
<Route path="/login">
|
||||||
<Login />
|
<Login />
|
||||||
@ -22,6 +25,7 @@ export default function App() {
|
|||||||
<Main />
|
<Main />
|
||||||
</PrivateRoute>
|
</PrivateRoute>
|
||||||
</Switch>
|
</Switch>
|
||||||
</Router>
|
</Router>
|
||||||
)
|
</ConfigProvider>
|
||||||
|
);
|
||||||
}
|
}
|
@ -1,10 +1,9 @@
|
|||||||
import { useParams } from "react-router-dom"
|
import { useParams } from "react-router-dom"
|
||||||
import { DatePicker, ConfigProvider } from 'antd';
|
import { DatePicker } from 'antd';
|
||||||
import notify from "../components/notify"
|
import notify from "../components/notify"
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import { TelemetryAnalyticsService } from '../services/api'
|
import { TelemetryAnalyticsService } from '../services/api'
|
||||||
import { ChartOperationTime } from './charts/ChartOperationTime'
|
import { ChartOperationTime } from './charts/ChartOperationTime'
|
||||||
import locale from "antd/lib/locale/ru_RU";
|
|
||||||
import LoaderPortal from '../components/LoaderPortal'
|
import LoaderPortal from '../components/LoaderPortal'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
|
||||||
@ -46,12 +45,10 @@ export function AnalysisOperationTime() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<LoaderPortal show={loader}>
|
<LoaderPortal show={loader}>
|
||||||
<ConfigProvider locale={locale}>
|
<RangePicker
|
||||||
<RangePicker
|
showTime
|
||||||
showTime
|
onChange={onChangeRange}
|
||||||
onChange={onChangeRange}
|
/>
|
||||||
/>
|
|
||||||
</ConfigProvider>
|
|
||||||
<ChartOperationTime
|
<ChartOperationTime
|
||||||
data={operationTimeData}
|
data={operationTimeData}
|
||||||
lines={lines}
|
lines={lines}
|
||||||
|
@ -3,7 +3,7 @@ import { UploadOutlined} from '@ant-design/icons'
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { upload } from './factory'
|
import { upload } from './factory'
|
||||||
|
|
||||||
export default function UploadFileForm({url, onUploadStart, onUploadComplete, onUploadError}) {
|
export default function UploadForm({url, onUploadStart, onUploadComplete, onUploadError}) {
|
||||||
const [isSubmitButtonEnabled, setSubmitButtonEnabled] = useState(false)
|
const [isSubmitButtonEnabled, setSubmitButtonEnabled] = useState(false)
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ export default function UploadFileForm({url, onUploadStart, onUploadComplete, on
|
|||||||
try {
|
try {
|
||||||
const values = await form.validateFields();
|
const values = await form.validateFields();
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
values.documentFile.fileList.forEach((val) => {
|
values.file.fileList.forEach((val) => {
|
||||||
formData.append("files", val.originFileObj);
|
formData.append("files", val.originFileObj);
|
||||||
});
|
});
|
||||||
await upload(url, formData)
|
await upload(url, formData)
|
@ -2,13 +2,11 @@ import { useRef, useLayoutEffect, useState, useEffect } from 'react'
|
|||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
DatePicker,
|
DatePicker,
|
||||||
ConfigProvider,
|
|
||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
Tooltip} from 'antd'
|
Tooltip} from 'antd'
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
import { DataService } from '../services/api'
|
import { DataService } from '../services/api'
|
||||||
import locale from 'antd/lib/locale/ru_RU'
|
|
||||||
import {generateUUID} from '../services/UidGenerator'
|
import {generateUUID} from '../services/UidGenerator'
|
||||||
import { ArchiveColumn } from '../components/ArchiveColumn'
|
import { ArchiveColumn } from '../components/ArchiveColumn'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
@ -133,14 +131,12 @@ export default function Archive() {
|
|||||||
+
|
+
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<ConfigProvider locale={locale}>
|
<RangePicker
|
||||||
<RangePicker
|
showTime
|
||||||
showTime
|
allowClear={false}
|
||||||
allowClear={false}
|
onChange = {onChangeRange}
|
||||||
onChange = {onChangeRange}
|
value = {rangeDate}
|
||||||
value = {rangeDate}
|
/>
|
||||||
/>
|
|
||||||
</ConfigProvider>
|
|
||||||
<LoaderPortal show={loader}>
|
<LoaderPortal show={loader}>
|
||||||
<Row ref={chartsContainerRef}>
|
<Row ref={chartsContainerRef}>
|
||||||
{charts}
|
{charts}
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import {useState, useEffect} from "react"
|
import {useState, useEffect} from "react"
|
||||||
import {Table, DatePicker, Button, ConfigProvider} from 'antd'
|
import {Table, DatePicker, Button, Form} from 'antd'
|
||||||
import locale from "antd/lib/locale/ru_RU"
|
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import { FileService } from '../../services/api'
|
import { FileService } from '../../services/api'
|
||||||
import { updateFromWebApiWrapperAsync, download, makePaginationObject} from '../../components/factory'
|
import { updateFromWebApiWrapperAsync, download, makePaginationObject} from '../../components/factory'
|
||||||
import UploadFileForm from '../../components/UploadFileForm'
|
import UploadForm from '../../components/UploadForm'
|
||||||
import LoaderPortal from '../../components/LoaderPortal'
|
import LoaderPortal from '../../components/LoaderPortal'
|
||||||
|
|
||||||
const pageSize = 12
|
const pageSize = 12
|
||||||
@ -17,7 +16,7 @@ export default function DocumentsTemplate({idCategory, idWell}) {
|
|||||||
const [files, setFiles] = useState([])
|
const [files, setFiles] = useState([])
|
||||||
const [showLoader, setShowLoader] = useState(false)
|
const [showLoader, setShowLoader] = useState(false)
|
||||||
|
|
||||||
const uploadUrl = `/api/well/${idWell}/files/`
|
const uploadUrl = `/api/well/${idWell}/files/?idCategory=${idCategory}`
|
||||||
|
|
||||||
const handleFileNameCLick = async (_, row) => {
|
const handleFileNameCLick = async (_, row) => {
|
||||||
updateFromWebApiWrapperAsync(async ()=>{
|
updateFromWebApiWrapperAsync(async ()=>{
|
||||||
@ -83,20 +82,25 @@ export default function DocumentsTemplate({idCategory, idWell}) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<LoaderPortal show={showLoader}>
|
<LoaderPortal show={showLoader}>
|
||||||
<UploadFileForm
|
<Form
|
||||||
url={uploadUrl}
|
layout="vertical">
|
||||||
onUploadStart={()=>setShowLoader(true)}
|
<div className='d-flex'>
|
||||||
onUploadComplete={()=>setShowLoader(false)}
|
<Form.Item
|
||||||
/>
|
label="Фильтр документов">
|
||||||
<div className='filter-group'>
|
<RangePicker
|
||||||
<h3 className='filter-group-heading'>Фильтр документов:</h3>
|
showTime
|
||||||
<ConfigProvider locale={locale}>
|
onChange={setRange}/>
|
||||||
<RangePicker
|
</Form.Item>
|
||||||
showTime
|
<Form.Item
|
||||||
onChange={setRange}
|
label="Загрузка документов">
|
||||||
/>
|
<UploadForm
|
||||||
</ConfigProvider>
|
url={uploadUrl}
|
||||||
</div>
|
onUploadStart={()=>setShowLoader(true)}
|
||||||
|
onUploadComplete={()=>setShowLoader(false)}/>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={files}
|
dataSource={files}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import {Table, Select, DatePicker, ConfigProvider, Input} from 'antd';
|
import {Table, Select, DatePicker, Input} from 'antd';
|
||||||
import locale from "antd/lib/locale/ru_RU";
|
|
||||||
import {useState, useEffect} from 'react'
|
import {useState, useEffect} from 'react'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
|
||||||
@ -137,12 +136,10 @@ export default function Messages({idWell}) {
|
|||||||
onChange={setCategories}>
|
onChange={setCategories}>
|
||||||
{children}
|
{children}
|
||||||
</Select>
|
</Select>
|
||||||
<ConfigProvider locale={locale}>
|
<RangePicker
|
||||||
<RangePicker
|
showTime
|
||||||
showTime
|
onChange={onChangeRange}
|
||||||
onChange={onChangeRange}
|
/>
|
||||||
/>
|
|
||||||
</ConfigProvider>
|
|
||||||
<Search
|
<Search
|
||||||
className="filter-selector"
|
className="filter-selector"
|
||||||
placeholder="Фильтр сообщений по тексту"
|
placeholder="Фильтр сообщений по тексту"
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import { Table, Select, DatePicker, ConfigProvider } from "antd";
|
import { Table, Select, DatePicker } from "antd";
|
||||||
import { TelemetryAnalyticsService } from "../services/api";
|
import { TelemetryAnalyticsService } 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";
|
||||||
import notify from "../components/notify";
|
import notify from "../components/notify";
|
||||||
import LoaderPortal from "../components/LoaderPortal";
|
import LoaderPortal from "../components/LoaderPortal";
|
||||||
import locale from "antd/lib/locale/ru_RU";
|
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import "../styles/message.css";
|
import "../styles/message.css";
|
||||||
|
|
||||||
@ -138,13 +137,11 @@ export default function WellAnalysis() {
|
|||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</Select>
|
</Select>
|
||||||
<ConfigProvider locale={locale}>
|
<RangePicker
|
||||||
<RangePicker
|
showTime
|
||||||
showTime
|
placeholder={["Дата начала операции", "Дата окончания операции"]}
|
||||||
placeholder={["Дата начала операции", "Дата окончания операции"]}
|
onChange={onChangeRange}
|
||||||
onChange={onChangeRange}
|
/>
|
||||||
/>
|
|
||||||
</ConfigProvider>
|
|
||||||
</div>
|
</div>
|
||||||
<LoaderPortal show={loader}>
|
<LoaderPortal show={loader}>
|
||||||
<Table
|
<Table
|
||||||
|
Loading…
Reference in New Issue
Block a user