forked from ddrilling/asb_cloud_front
Удалены старые меню
This commit is contained in:
parent
411b79ee60
commit
9c2b0ecd26
@ -1,9 +1,7 @@
|
||||
import { Layout } from 'antd'
|
||||
import { memo, useMemo } from 'react'
|
||||
import { Navigate, Route, Routes } from 'react-router-dom'
|
||||
|
||||
import { RootPathContext, useRootPath } from '@asb/context'
|
||||
import { PrivateMenu } from '@components/Private'
|
||||
import { NoAccessComponent, wrapPrivateComponent } from '@utils'
|
||||
|
||||
import TelemetryViewer from './TelemetryViewer'
|
||||
@ -15,23 +13,12 @@ const Telemetry = memo(() => {
|
||||
|
||||
return (
|
||||
<RootPathContext.Provider value={rootPath}>
|
||||
<Layout>
|
||||
<PrivateMenu>
|
||||
<PrivateMenu.Link content={TelemetryViewer} />
|
||||
<PrivateMenu.Link content={TelemetryMerger} />
|
||||
</PrivateMenu>
|
||||
|
||||
<Layout>
|
||||
<Layout.Content className={'site-layout-background'}>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={TelemetryViewer.route} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
<Route path={TelemetryViewer.route} element={<TelemetryViewer />} />
|
||||
<Route path={TelemetryMerger.route} element={<TelemetryMerger />} />
|
||||
</Routes>
|
||||
</Layout.Content>
|
||||
</Layout>
|
||||
</Layout>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={TelemetryViewer.route} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
<Route path={TelemetryViewer.route} element={<TelemetryViewer />} />
|
||||
<Route path={TelemetryMerger.route} element={<TelemetryMerger />} />
|
||||
</Routes>
|
||||
</RootPathContext.Provider>
|
||||
)
|
||||
})
|
||||
|
@ -1,9 +1,8 @@
|
||||
import { useState, useEffect, memo, useMemo } from 'react'
|
||||
import { Navigate, Route, Routes } from 'react-router-dom'
|
||||
import { Col, Layout, Row } from 'antd'
|
||||
import { useState, useEffect, memo } from 'react'
|
||||
import { Row } from 'antd'
|
||||
|
||||
import { useWell, useRootPath } from '@asb/context'
|
||||
import { PrivateMenu } from '@components/Private'
|
||||
import { useWell } from '@asb/context'
|
||||
import LoaderPortal from '@components/LoaderPortal'
|
||||
import WellSelector from '@components/selectors/WellSelector'
|
||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||
@ -13,8 +12,6 @@ import { OperationStatService, WellCompositeService } from '@api'
|
||||
import ClusterWells from '@pages/Cluster/ClusterWells'
|
||||
import WellCompositeSections from './WellCompositeSections'
|
||||
|
||||
const { Content } = Layout
|
||||
|
||||
const properties = {
|
||||
requirements: ['OperationStat.get', 'WellComposite.get'],
|
||||
title: 'Композитная скважина',
|
||||
@ -24,12 +21,9 @@ const properties = {
|
||||
|
||||
const WellCompositeEditor = memo(() => {
|
||||
const [well] = useWell()
|
||||
const root = useRootPath()
|
||||
const rootPath = useMemo(() => `${root}/${properties.key}`, [root])
|
||||
|
||||
const [statsWells, setStatsWells] = useState([])
|
||||
const [showLoader, setShowLoader] = useState(false)
|
||||
const [showTabLoader, setShowTabLoader] = useState(false)
|
||||
const [selectedIdWells, setSelectedIdWells] = useState([])
|
||||
const [selectedSections, setSelectedSections] = useState([])
|
||||
|
||||
@ -61,7 +55,7 @@ const WellCompositeEditor = memo(() => {
|
||||
const stats = arrayOrDefault(await OperationStatService.getWellsStat(selectedIdWells))
|
||||
setStatsWells(stats)
|
||||
},
|
||||
setShowTabLoader,
|
||||
setShowLoader,
|
||||
'Не удалось загрузить статистику по скважинам/секциям',
|
||||
{ actionName: 'Получение статистики по скважинам/секциям' }
|
||||
)
|
||||
@ -70,29 +64,15 @@ const WellCompositeEditor = memo(() => {
|
||||
return (
|
||||
<LoaderPortal show={showLoader}>
|
||||
<Row align={'middle'} justify={'space-between'} wrap={false} style={{ backgroundColor: 'white' }}>
|
||||
<Col span={18}>
|
||||
<WellSelector onChange={setSelectedIdWells} value={selectedIdWells} />
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<PrivateMenu root={rootPath} className={'well_menu'}>
|
||||
<PrivateMenu.Link content={ClusterWells} />
|
||||
<PrivateMenu.Link content={WellCompositeSections} />
|
||||
</PrivateMenu>
|
||||
</Col>
|
||||
<WellSelector onChange={setSelectedIdWells} value={selectedIdWells} />
|
||||
</Row>
|
||||
<Layout>
|
||||
<Content className={'site-layout-background'}>
|
||||
<LoaderPortal show={showTabLoader}>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={ClusterWells.route} replace/>} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={ClusterWells.route} replace/>} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
|
||||
<Route path={ClusterWells.route} element={<ClusterWells statsWells={statsWells} />} />
|
||||
<Route path={WellCompositeSections.route} element={<WellCompositeSections statsWells={statsWells} selectedSections={selectedSections} />} />
|
||||
</Routes>
|
||||
</LoaderPortal>
|
||||
</Content>
|
||||
</Layout>
|
||||
<Route path={ClusterWells.route} element={<ClusterWells statsWells={statsWells} />} />
|
||||
<Route path={WellCompositeSections.route} element={<WellCompositeSections statsWells={statsWells} selectedSections={selectedSections} />} />
|
||||
</Routes>
|
||||
</LoaderPortal>
|
||||
)
|
||||
})
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { memo, useMemo } from 'react'
|
||||
import { Navigate, Route, Routes } from 'react-router-dom'
|
||||
import { Layout } from 'antd'
|
||||
|
||||
import { RootPathContext, useRootPath } from '@asb/context'
|
||||
import { PrivateMenu } from '@components/Private'
|
||||
import { NoAccessComponent, wrapPrivateComponent } from '@utils'
|
||||
|
||||
import Statistics from './Statistics'
|
||||
@ -15,23 +13,13 @@ const Analytics = memo(() => {
|
||||
|
||||
return (
|
||||
<RootPathContext.Provider value={rootPath}>
|
||||
<Layout>
|
||||
<PrivateMenu className={'well_menu'}>
|
||||
<PrivateMenu.Link content={WellCompositeEditor} />
|
||||
<PrivateMenu.Link key={'statistics'} title={'Оценка по ЦБ'} content={Statistics} />
|
||||
</PrivateMenu>
|
||||
<Layout>
|
||||
<Layout.Content className={'site-layout-background'}>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={WellCompositeEditor.getKey()} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={WellCompositeEditor.getKey()} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
|
||||
<Route path={WellCompositeEditor.route} element={<WellCompositeEditor />} />
|
||||
<Route path={Statistics.route} element={<Statistics />} />
|
||||
</Routes>
|
||||
</Layout.Content>
|
||||
</Layout>
|
||||
</Layout>
|
||||
<Route path={WellCompositeEditor.route} element={<WellCompositeEditor />} />
|
||||
<Route path={Statistics.route} element={<Statistics />} />
|
||||
</Routes>
|
||||
</RootPathContext.Provider>
|
||||
)
|
||||
})
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { memo, useMemo } from 'react'
|
||||
import { memo, useMemo } from 'react'
|
||||
import { BankOutlined } from '@ant-design/icons'
|
||||
|
||||
import { makeTextColumn, Table } from '@components/Table'
|
||||
@ -9,7 +9,7 @@ const columns = [
|
||||
makeTextColumn('Тип компании', 'companyTypeCaption'),
|
||||
]
|
||||
|
||||
const CompaniesTable = memo(({companies}) => {
|
||||
const CompaniesTable = memo(({ companies }) => {
|
||||
const dataCompanies = useMemo(() => companies?.map((company) => ({
|
||||
key: company.id,
|
||||
logo: company?.logo ? <img src={company.logo}/> : <BankOutlined/>,
|
||||
@ -30,4 +30,4 @@ const CompaniesTable = memo(({companies}) => {
|
||||
)
|
||||
})
|
||||
|
||||
export default CompaniesTable
|
||||
export default CompaniesTable
|
||||
|
@ -1,16 +1,11 @@
|
||||
import { Navigate, Route, Routes } from 'react-router-dom'
|
||||
import { memo, useMemo } from 'react'
|
||||
import { FolderOutlined } from '@ant-design/icons'
|
||||
import { Layout } from 'antd'
|
||||
|
||||
import { RootPathContext, useRootPath } from '@asb/context'
|
||||
import { PrivateMenu } from '@components/Private'
|
||||
import { getTabname, wrapPrivateComponent, NoAccessComponent, hasPermission } from '@utils'
|
||||
import { wrapPrivateComponent, NoAccessComponent, hasPermission } from '@utils'
|
||||
|
||||
import DocumentsTemplate from './DocumentsTemplate'
|
||||
|
||||
const { Content } = Layout
|
||||
|
||||
const makeDocCat = (id, key, title, permissions = ['File.get']) => ({ id, key, title, permissions })
|
||||
|
||||
export const documentCategories = [
|
||||
@ -27,7 +22,6 @@ export const documentCategories = [
|
||||
]
|
||||
|
||||
const MenuDocuments = memo(() => {
|
||||
const category = getTabname()
|
||||
const root = useRootPath()
|
||||
const rootPath = useMemo(() => `${root}/document`, [root])
|
||||
|
||||
@ -35,34 +29,21 @@ const MenuDocuments = memo(() => {
|
||||
|
||||
return (
|
||||
<RootPathContext.Provider value={rootPath}>
|
||||
<PrivateMenu mode={'horizontal'} selectable={true} className={'well_menu'} selectedKeys={[category]}>
|
||||
{categories.map(category => (
|
||||
<PrivateMenu.Link
|
||||
key={`${category.key}`}
|
||||
icon={<FolderOutlined/>}
|
||||
title={category.title}
|
||||
/>
|
||||
))}
|
||||
</PrivateMenu>
|
||||
<Layout>
|
||||
<Content className={'site-layout-background'}>
|
||||
<Routes>
|
||||
{categories.length > 0 && (
|
||||
<Route index element={<Navigate to={categories[0].key} replace />} />
|
||||
)}
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
<Routes>
|
||||
{categories.length > 0 && (
|
||||
<Route index element={<Navigate to={categories[0].key} replace />} />
|
||||
)}
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
|
||||
{categories.map(category => (
|
||||
<Route key={category.key} path={category.key} element={(
|
||||
<DocumentsTemplate
|
||||
idCategory={category.id}
|
||||
tableName={`documents_${category.key}`}
|
||||
/>
|
||||
)} />
|
||||
))}
|
||||
</Routes>
|
||||
</Content>
|
||||
</Layout>
|
||||
{categories.map(category => (
|
||||
<Route key={category.key} path={category.key} element={(
|
||||
<DocumentsTemplate
|
||||
idCategory={category.id}
|
||||
tableName={`documents_${category.key}`}
|
||||
/>
|
||||
)} />
|
||||
))}
|
||||
</Routes>
|
||||
</RootPathContext.Provider>
|
||||
)
|
||||
})
|
||||
|
@ -1,41 +1,25 @@
|
||||
import { Navigate, Route, Routes } from 'react-router-dom'
|
||||
import { memo, useMemo } from 'react'
|
||||
import { FilePdfOutlined } from '@ant-design/icons'
|
||||
import { Layout } from 'antd'
|
||||
|
||||
import { RootPathContext, useRootPath } from '@asb/context'
|
||||
import { PrivateMenu } from '@components/Private'
|
||||
import { NoAccessComponent, wrapPrivateComponent } from '@utils'
|
||||
|
||||
import DailyReport from './DailyReport'
|
||||
import DiagramReport from './DiagramReport'
|
||||
|
||||
const { Content } = Layout
|
||||
|
||||
const Reports = memo(() => {
|
||||
const root = useRootPath()
|
||||
const rootPath = useMemo(() => `${root}/reports`, [root])
|
||||
|
||||
return (
|
||||
<RootPathContext.Provider value={rootPath}>
|
||||
<Layout>
|
||||
<PrivateMenu className={'well_menu'}>
|
||||
<PrivateMenu.Link content={DiagramReport} icon={<FilePdfOutlined />} />
|
||||
<PrivateMenu.Link content={DailyReport} />
|
||||
</PrivateMenu>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={'diagram_report'} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
|
||||
<Layout>
|
||||
<Content className={'site-layout-background'}>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={'diagram_report'} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
|
||||
<Route path={DiagramReport.route} element={<DiagramReport />} />
|
||||
<Route path={DailyReport.route} element={<DailyReport />} />
|
||||
</Routes>
|
||||
</Content>
|
||||
</Layout>
|
||||
</Layout>
|
||||
<Route path={DiagramReport.route} element={<DiagramReport />} />
|
||||
<Route path={DailyReport.route} element={<DailyReport />} />
|
||||
</Routes>
|
||||
</RootPathContext.Provider>
|
||||
)
|
||||
})
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { Navigate, Route, Routes } from 'react-router-dom'
|
||||
import { memo, useMemo } from 'react'
|
||||
import { Layout } from 'antd'
|
||||
import { AlertOutlined, FundViewOutlined, DatabaseOutlined } from '@ant-design/icons'
|
||||
import { FundViewOutlined } from '@ant-design/icons'
|
||||
|
||||
import { RootPathContext, useRootPath } from '@asb/context'
|
||||
import { PrivateMenu } from '@components/Private'
|
||||
import { NoAccessComponent, wrapPrivateComponent } from '@utils'
|
||||
|
||||
import Archive from './Archive'
|
||||
@ -16,40 +14,23 @@ import OperationTime from './OperationTime'
|
||||
|
||||
import '@styles/index.css'
|
||||
|
||||
const { Content } = Layout
|
||||
|
||||
const Telemetry = memo(() => {
|
||||
const root = useRootPath()
|
||||
const rootPath = useMemo(() => `${root}/telemetry`, [root])
|
||||
|
||||
return (
|
||||
<RootPathContext.Provider value={rootPath}>
|
||||
<Layout>
|
||||
<PrivateMenu className={'well_menu'}>
|
||||
<PrivateMenu.Link content={TelemetryView} icon={<FundViewOutlined />} />
|
||||
<PrivateMenu.Link content={Messages} icon={<AlertOutlined/>} />
|
||||
<PrivateMenu.Link content={Archive} icon={<DatabaseOutlined />} />
|
||||
<PrivateMenu.Link content={DashboardNNB} />
|
||||
<PrivateMenu.Link content={Operations} />
|
||||
<PrivateMenu.Link content={OperationTime} />
|
||||
</PrivateMenu>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={TelemetryView.route} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
|
||||
<Layout>
|
||||
<Content className={'site-layout-background'}>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={TelemetryView.route} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
|
||||
<Route path={TelemetryView.route} element={<TelemetryView />} />
|
||||
<Route path={Messages.route} element={<Messages />} />
|
||||
<Route path={Archive.route} element={<Archive />} />
|
||||
<Route path={DashboardNNB.route} element={<DashboardNNB />} />
|
||||
<Route path={Operations.route} element={<Operations />} />
|
||||
<Route path={OperationTime.route} element={<OperationTime />} />
|
||||
</Routes>
|
||||
</Content>
|
||||
</Layout>
|
||||
</Layout>
|
||||
<Route path={TelemetryView.route} element={<TelemetryView />} />
|
||||
<Route path={Messages.route} element={<Messages />} />
|
||||
<Route path={Archive.route} element={<Archive />} />
|
||||
<Route path={DashboardNNB.route} element={<DashboardNNB />} />
|
||||
<Route path={Operations.route} element={<Operations />} />
|
||||
<Route path={OperationTime.route} element={<OperationTime />} />
|
||||
</Routes>
|
||||
</RootPathContext.Provider>
|
||||
)
|
||||
})
|
||||
|
@ -1,17 +1,8 @@
|
||||
import { useNavigate, useLocation, Route, Routes, Navigate } from 'react-router-dom'
|
||||
import { memo, useCallback, useMemo } from 'react'
|
||||
import { Layout } from 'antd'
|
||||
import {
|
||||
BarChartOutlined,
|
||||
BuildOutlined,
|
||||
ControlOutlined,
|
||||
LineChartOutlined,
|
||||
TableOutlined,
|
||||
} from '@ant-design/icons'
|
||||
|
||||
import { RootPathContext, useRootPath } from '@asb/context'
|
||||
import { Flex } from '@components/Grid'
|
||||
import { PrivateMenu } from '@components/Private'
|
||||
import { getTabname, NoAccessComponent, wrapPrivateComponent } from '@utils'
|
||||
|
||||
import Tvd from './Tvd'
|
||||
@ -21,8 +12,6 @@ import { DrillProcessFlow } from './DrillProcessFlow'
|
||||
import { WellSectionsStat } from './WellSectionsStat'
|
||||
import { WellOperationsEditorPlan, WellOperationsEditorFact } from './WellOperationsEditor'
|
||||
|
||||
const { Content } = Layout
|
||||
|
||||
const properties = {
|
||||
requirements: [],
|
||||
title: 'Операции по скважине',
|
||||
@ -46,31 +35,19 @@ const WellOperations = memo(() => {
|
||||
return(
|
||||
<RootPathContext.Provider value={rootPath}>
|
||||
<Flex style={{ width: '100%' }}>
|
||||
<PrivateMenu className={'well_menu'} style={{ flex: 1 }}>
|
||||
<PrivateMenu.Link content={Tvd} icon={<LineChartOutlined />} />
|
||||
<PrivateMenu.Link content={WellSectionsStat} icon={<BuildOutlined />} key={'sections'} title={'Секции'} />
|
||||
<PrivateMenu.Link content={WellOperationsEditorPlan} icon={<TableOutlined />} />
|
||||
<PrivateMenu.Link content={WellOperationsEditorFact} icon={<TableOutlined />} />
|
||||
<PrivateMenu.Link content={DrillProcessFlow} icon={<BarChartOutlined />} key={'drillProcessFlow'} title={'РТК'} />
|
||||
<PrivateMenu.Link content={WellDrillParams} icon={<ControlOutlined />} key={'params'} title={'Режимы'} />
|
||||
</PrivateMenu>
|
||||
<ImportExportBar disabled={isIEBarDisabled} onImported={onImported}/>
|
||||
</Flex>
|
||||
<Layout>
|
||||
<Content className={'site-layout-background'}>
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={Tvd.getKey()} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
<Routes>
|
||||
<Route index element={<Navigate to={Tvd.getKey()} replace />} />
|
||||
<Route path={'*'} element={<NoAccessComponent />} />
|
||||
|
||||
<Route path={Tvd.route} element={<Tvd />} />
|
||||
<Route path={'sections'} element={<WellSectionsStat />} />
|
||||
<Route path={WellOperationsEditorPlan.route} element={<WellOperationsEditorPlan />} />
|
||||
<Route path={WellOperationsEditorFact.route} element={<WellOperationsEditorFact />} />
|
||||
<Route path={'drillProcessFlow'} element={<DrillProcessFlow />} />
|
||||
<Route path={'params'} element={<WellDrillParams />} />
|
||||
</Routes>
|
||||
</Content>
|
||||
</Layout>
|
||||
<Route path={Tvd.route} element={<Tvd />} />
|
||||
<Route path={'sections'} element={<WellSectionsStat />} />
|
||||
<Route path={WellOperationsEditorPlan.route} element={<WellOperationsEditorPlan />} />
|
||||
<Route path={WellOperationsEditorFact.route} element={<WellOperationsEditorFact />} />
|
||||
<Route path={'drillProcessFlow'} element={<DrillProcessFlow />} />
|
||||
<Route path={'params'} element={<WellDrillParams />} />
|
||||
</Routes>
|
||||
</RootPathContext.Provider>
|
||||
)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user