diff --git a/src/components/ChangePassword.tsx b/src/components/ChangePassword.tsx index e1ec41f..dc4c5bd 100755 --- a/src/components/ChangePassword.tsx +++ b/src/components/ChangePassword.tsx @@ -63,7 +63,7 @@ export const ChangePassword = memo(({ user, visible, onCanc {user && <> ()} )} - visible={visible} + open={visible} onCancel={onModalCancel} onOk={() => form.submit()} okText={'Сохранить'} diff --git a/src/components/ColorPicker.tsx b/src/components/ColorPicker.tsx index 8e4cbef..bd8fe1a 100644 --- a/src/components/ColorPicker.tsx +++ b/src/components/ColorPicker.tsx @@ -106,7 +106,7 @@ export const ColorPicker = memo(({ value = '#AA33BB', onChange return (
diff --git a/src/components/Table/TableSettingsChanger.tsx b/src/components/Table/TableSettingsChanger.tsx index d132f7a..4ca622f 100755 --- a/src/components/Table/TableSettingsChanger.tsx +++ b/src/components/Table/TableSettingsChanger.tsx @@ -84,7 +84,7 @@ const _TableSettingsChanger = ({ title, columns, settings, onC <> ({ (({ formProps, buttonProps, footer, c )} trigger={'click'} {...other} - visible={visible} - onVisibleChange={(visible) => setVisible(visible)} + open={visible} + onOpenChange={(visible) => setVisible(visible)} > diff --git a/src/components/widgets/WidgetSettingsWindow.tsx b/src/components/widgets/WidgetSettingsWindow.tsx index 16b70be..351267b 100644 --- a/src/components/widgets/WidgetSettingsWindow.tsx +++ b/src/components/widgets/WidgetSettingsWindow.tsx @@ -20,7 +20,7 @@ export const WidgetSettingsWindow = memo(({ settings, return ( Настройка виджета {settings?.label ? `"${settings?.label}"` : ''} diff --git a/src/pages/AdminPanel/AdminNavigationMenu.jsx b/src/pages/AdminPanel/AdminNavigationMenu.jsx index 522aa91..7005099 100644 --- a/src/pages/AdminPanel/AdminNavigationMenu.jsx +++ b/src/pages/AdminPanel/AdminNavigationMenu.jsx @@ -36,7 +36,6 @@ export const AdminNavigationMenu = memo((props) => ( {...props} items={menuItems} rootPath={'/admin'} - inlineCollapsed={true} selectable={false} mode={'inline'} theme={'dark'} diff --git a/src/pages/Cluster/ClusterWells.jsx b/src/pages/Cluster/ClusterWells.jsx index b76034b..91f877c 100755 --- a/src/pages/Cluster/ClusterWells.jsx +++ b/src/pages/Cluster/ClusterWells.jsx @@ -179,7 +179,7 @@ const ClusterWells = memo(({ statsWells }) => { setIsTVDModalVisible(false)} width={1500} footer={null} @@ -192,7 +192,7 @@ const ClusterWells = memo(({ statsWells }) => { setIsOpsModalVisible(false)} width={1500} footer={null} @@ -205,7 +205,7 @@ const ClusterWells = memo(({ statsWells }) => { setIsCompaniesModalVisible(false)} width={1500} footer={null} diff --git a/src/pages/Cluster/CompaniesTable.jsx b/src/pages/Cluster/CompaniesTable.jsx index 390e2bb..0b4a50c 100644 --- a/src/pages/Cluster/CompaniesTable.jsx +++ b/src/pages/Cluster/CompaniesTable.jsx @@ -1,10 +1,10 @@ import { memo, useMemo } from 'react' import { BankOutlined } from '@ant-design/icons' -import { makeTextColumn, Table } from '@components/Table' +import { makeColumn, makeTextColumn, Table } from '@components/Table' const columns = [ - makeTextColumn('', 'logo'), + makeColumn('', 'logo'), makeTextColumn('Название компании', 'caption'), makeTextColumn('Тип компании', 'companyTypeCaption'), ] @@ -12,7 +12,11 @@ const columns = [ const CompaniesTable = memo(({ companies }) => { const dataCompanies = useMemo(() => companies?.map((company) => ({ key: company.id, - logo: company?.logo ? : , + logo: ( +
+ {company?.logo ? : } +
+ ), caption: company.caption, companyTypeCaption: company.companyTypeCaption, })), [companies]) diff --git a/src/pages/Cluster/WellOperationsTable.jsx b/src/pages/Cluster/WellOperationsTable.jsx index b7f1692..1d2b094 100755 --- a/src/pages/Cluster/WellOperationsTable.jsx +++ b/src/pages/Cluster/WellOperationsTable.jsx @@ -7,8 +7,8 @@ import { getPrecision } from '@utils/functions' const columns = [ makeTextColumn('Конструкция секции', 'sectionType'), makeTextColumn('Операция', 'operationName'), - makeNumericColumnPlanFact('Глубина забоя', 'depth', null, null, getPrecision), - makeNumericColumnPlanFact('Часы', 'durationHours', null, null, getPrecision), + makeNumericColumnPlanFact('Глубина забоя', 'depth', null, null, (number) => getPrecision(number)), + makeNumericColumnPlanFact('Часы', 'durationHours', null, null, (number) => getPrecision(number)), makeNumericColumnPlanFact('Комментарий', 'comment', null, null, (text) => text ?? '-') ] diff --git a/src/pages/Well/Analytics/WellCompositeEditor/NewParamsTable.jsx b/src/pages/Well/Analytics/WellCompositeEditor/NewParamsTable.jsx index 0f0da5b..6e9d6ef 100644 --- a/src/pages/Well/Analytics/WellCompositeEditor/NewParamsTable.jsx +++ b/src/pages/Well/Analytics/WellCompositeEditor/NewParamsTable.jsx @@ -7,7 +7,7 @@ import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { DrillParamsService } from '@api' -import { getColumns } from '@asb/pages/Well/WellOperations/WellDrillParams' +import { getColumns } from '@pages/Well/WellOperations/WellDrillParams' export const NewParamsTable = memo(({ selectedWellsKeys }) => { const [params, setParams] = useState([]) @@ -54,7 +54,7 @@ export const NewParamsTable = memo(({ selectedWellsKeys }) => { setIsParamsModalVisible(false)} width={1700} footer={( diff --git a/src/pages/Well/Analytics/WellCompositeEditor/WellCompositeSections.jsx b/src/pages/Well/Analytics/WellCompositeEditor/WellCompositeSections.jsx index f9eaaaa..db9229a 100644 --- a/src/pages/Well/Analytics/WellCompositeEditor/WellCompositeSections.jsx +++ b/src/pages/Well/Analytics/WellCompositeEditor/WellCompositeSections.jsx @@ -1,7 +1,7 @@ import { Link, useLocation } from 'react-router-dom' -import { useState, useEffect, memo, useMemo } from 'react' +import { useState, useEffect, memo, useMemo, lazy, Suspense } from 'react' import { LineChartOutlined, ProfileOutlined, TeamOutlined } from '@ant-design/icons' -import { Table, Tag, Button, Badge, Divider, Modal, Row, Col } from 'antd' +import { Table, Button, Badge, Divider, Modal, Row, Col } from 'antd' import { useWell } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' @@ -16,10 +16,12 @@ import { getOperations } from '@utils' -import Tvd from '@asb/pages/Well/WellOperations/Tvd' -import WellOperationsTable from '@pages/Cluster/WellOperationsTable' import NewParamsTable from './NewParamsTable' -import CompaniesTable from '@pages/Cluster/CompaniesTable' +import SuspenseFallback from '@asb/components/SuspenseFallback' + +const Tvd = lazy(() => import('@pages/Well/WellOperations/Tvd')) +const CompaniesTable = lazy(() => import('@pages/Cluster/CompaniesTable')) +const WellOperationsTable = lazy(() => import('@pages/Cluster/WellOperationsTable')) const filtersMinMax = [ { text: 'min', value: 'min' }, @@ -222,38 +224,44 @@ const WellCompositeSections = memo(({ statsWells, selectedSections }) => { setIsTVDModalVisible(false)} width={1500} footer={null} > - + }> + + setIsOpsModalVisible(false)} width={1500} footer={null} > - - - + }> + + + + setIsCompaniesModalVisible(false)} width={1500} footer={null} > - - - + }> + + + + ) diff --git a/src/pages/Well/Analytics/WellCompositeEditor/index.jsx b/src/pages/Well/Analytics/WellCompositeEditor/index.jsx index f3a6c4b..c2341e1 100644 --- a/src/pages/Well/Analytics/WellCompositeEditor/index.jsx +++ b/src/pages/Well/Analytics/WellCompositeEditor/index.jsx @@ -1,17 +1,18 @@ import { Navigate, Route, Routes } from 'react-router-dom' -import { useState, useEffect, memo, Suspense } from 'react' +import { useState, useEffect, memo, Suspense, lazy } from 'react' import { Row } from 'antd' import { useWell } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' +import SuspenseFallback from '@components/SuspenseFallback' import WellSelector from '@components/selectors/WellSelector' import { invokeWebApiWrapperAsync } from '@components/factory' import { arrayOrDefault, NoAccessComponent, wrapPrivateComponent } from '@utils' import { OperationStatService, WellCompositeService } from '@api' -import ClusterWells from '@pages/Cluster/ClusterWells' import WellCompositeSections from './WellCompositeSections' -import SuspenseFallback from '@asb/components/SuspenseFallback' + +const ClusterWells = lazy(() => import('@pages/Cluster/ClusterWells')) const properties = { requirements: ['OperationStat.get', 'WellComposite.get'], @@ -64,16 +65,16 @@ const WellCompositeEditor = memo(() => { return ( - + }> - } /> + } /> } /> - } /> - } /> + } /> + } /> diff --git a/src/pages/Well/DrillingProgram/CategoryEditor.jsx b/src/pages/Well/DrillingProgram/CategoryEditor.jsx index b1066e1..cab4df1 100644 --- a/src/pages/Well/DrillingProgram/CategoryEditor.jsx +++ b/src/pages/Well/DrillingProgram/CategoryEditor.jsx @@ -159,7 +159,7 @@ export const CategoryEditor = memo(({ visible, category, onClosed }) => { { title={'История категории'} width={1200} centered - visible={!!visible} + open={!!visible} onCancel={onClose} footer={( diff --git a/src/pages/Well/Measure/InclinometryTable.jsx b/src/pages/Well/Measure/InclinometryTable.jsx index 18d1660..2725743 100644 --- a/src/pages/Well/Measure/InclinometryTable.jsx +++ b/src/pages/Well/Measure/InclinometryTable.jsx @@ -35,7 +35,7 @@ export const InclinometryTable = memo(({ group, visible, onClose }) => { ( {...props} items={menuItems} rootPath={'/well/{wellId}'} - inlineCollapsed={true} mode={'inline'} theme={'dark'} style={{ backgroundColor: 'transparent' }} diff --git a/src/pages/Well/Reports/DailyReport/ReportEditor.jsx b/src/pages/Well/Reports/DailyReport/ReportEditor.jsx index c39ef39..e77fc61 100644 --- a/src/pages/Well/Reports/DailyReport/ReportEditor.jsx +++ b/src/pages/Well/Reports/DailyReport/ReportEditor.jsx @@ -374,7 +374,7 @@ export const ReportEditor = memo(({ visible, data, onDone, onCancel, checkIsDate { centered width={500} footer={null} - visible={showModal} + open={showModal} onCancel={onModalCancel} title={'Список бурильщиков'} > diff --git a/src/pages/Well/Telemetry/Operations/DrillerSchedule.jsx b/src/pages/Well/Telemetry/Operations/DrillerSchedule.jsx index 437faff..2727274 100644 --- a/src/pages/Well/Telemetry/Operations/DrillerSchedule.jsx +++ b/src/pages/Well/Telemetry/Operations/DrillerSchedule.jsx @@ -100,7 +100,7 @@ export const DrillerSchedule = memo(({ drillers, loading, onChange }) => { centered width={1600} footer={null} - visible={modalVisible} + open={modalVisible} onCancel={onModalCancel} title={'Настройка бурильщиков и расписаний'} > diff --git a/src/pages/Well/Telemetry/Operations/TargetEditor.jsx b/src/pages/Well/Telemetry/Operations/TargetEditor.jsx index 1df0c9a..69f49cf 100644 --- a/src/pages/Well/Telemetry/Operations/TargetEditor.jsx +++ b/src/pages/Well/Telemetry/Operations/TargetEditor.jsx @@ -96,7 +96,7 @@ export const TargetEditor = memo(({ loading, onChange }) => { centered width={1000} footer={null} - visible={showModal} + open={showModal} onCancel={onModalCancel} title={'Цели бурения'} > diff --git a/src/pages/Well/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx b/src/pages/Well/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx index 0d7bcf4..537ed29 100644 --- a/src/pages/Well/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx +++ b/src/pages/Well/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx @@ -80,7 +80,7 @@ export const SetpointSender = memo(({ onClose, visible, setpointNames }) => { diff --git a/src/pages/Well/Telemetry/TelemetryView/Setpoints/index.jsx b/src/pages/Well/Telemetry/TelemetryView/Setpoints/index.jsx index 828f61c..a5822de 100644 --- a/src/pages/Well/Telemetry/TelemetryView/Setpoints/index.jsx +++ b/src/pages/Well/Telemetry/TelemetryView/Setpoints/index.jsx @@ -89,7 +89,7 @@ export const Setpoints = memo(({ ...other }) => { )} - visible={isModalVisible} + open={isModalVisible} onCancel={() => setIsModalVisible(false)} footer={null} > diff --git a/src/pages/Well/Telemetry/TelemetryView/WirelineRunOut.jsx b/src/pages/Well/Telemetry/TelemetryView/WirelineRunOut.jsx index d3ef138..fd98f71 100644 --- a/src/pages/Well/Telemetry/TelemetryView/WirelineRunOut.jsx +++ b/src/pages/Well/Telemetry/TelemetryView/WirelineRunOut.jsx @@ -33,7 +33,7 @@ export const WirelineRunOut = memo(() => { return ( ) diff --git a/src/pages/Well/WellCase/WellCaseEditor.jsx b/src/pages/Well/WellCase/WellCaseEditor.jsx index e8ef061..dcc287c 100644 --- a/src/pages/Well/WellCase/WellCaseEditor.jsx +++ b/src/pages/Well/WellCase/WellCaseEditor.jsx @@ -117,7 +117,7 @@ export const WellCaseEditor = memo(({ categories: currentCategories, show, onClo { }), makeDateColumn('Дата загрузки', 'uploadDate'), makeColumn('Ответственные', 'publishers', { - render: (publishers) => publishers?.map((user) => ), + render: (publishers) => publishers?.map((user, i) => ), }), ], [well, updateTable]) diff --git a/src/pages/Well/WellOperations/ImportExportBar.jsx b/src/pages/Well/WellOperations/ImportExportBar.jsx index 3776ffd..3cc574a 100644 --- a/src/pages/Well/WellOperations/ImportExportBar.jsx +++ b/src/pages/Well/WellOperations/ImportExportBar.jsx @@ -48,7 +48,7 @@ export const ImportExportBar = memo(({ well: givenWell, onImported, disabled }) setIsImportModalVisible(false)} footer={null} > diff --git a/src/pages/Well/index.jsx b/src/pages/Well/index.jsx index 4519f2b..c61a4ba 100644 --- a/src/pages/Well/index.jsx +++ b/src/pages/Well/index.jsx @@ -49,8 +49,6 @@ const Well = memo(() => { const setLayoutProps = useLayoutProps() - useEffect(() => console.log(well), [well]) - const updateWell = useCallback((data) => invokeWebApiWrapperAsync( async () => { const newWell = { ...well, ...data } diff --git a/src/styles/App.less b/src/styles/App.less index 0ddef5d..90db107 100755 --- a/src/styles/App.less +++ b/src/styles/App.less @@ -109,3 +109,11 @@ tr.table_row_size { display: none; } } + +.centered { + display: flex; + width: 100%; + height: 100%; + justify-content: center; + align-items: center; +}