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