diff --git a/src/pages/AdminPanel/AdminNavigationMenu.jsx b/src/pages/AdminPanel/AdminNavigationMenu.jsx index 7005099..1925703 100644 --- a/src/pages/AdminPanel/AdminNavigationMenu.jsx +++ b/src/pages/AdminPanel/AdminNavigationMenu.jsx @@ -13,6 +13,7 @@ import { } from '@ant-design/icons' import { makeItem, PrivateWellMenu } from '@components/PrivateWellMenu' +import { isDev } from '@asb/utils' const menuItems = [ makeItem('Месторождения', 'deposit', [], ), @@ -28,8 +29,8 @@ const menuItems = [ makeItem('Объединение', 'merger', [], ), ]), makeItem('Журнал посещений', 'visit_log', [], ), - makeItem('API', '/swagger/index.html', [], ), -] + isDev() && makeItem('API', '/swagger/index.html', [], ), +].filter(Boolean) export const AdminNavigationMenu = memo((props) => ( { onRowEdit={tableHandlers.edit} onRowDelete={tableHandlers.delete} tableName={'admin_cluster_controller'} + scroll={{ x: true }} /> > ) diff --git a/src/pages/AdminPanel/CompanyController.jsx b/src/pages/AdminPanel/CompanyController.jsx index 9a70d85..e7a31d8 100755 --- a/src/pages/AdminPanel/CompanyController.jsx +++ b/src/pages/AdminPanel/CompanyController.jsx @@ -97,6 +97,7 @@ const CompanyController = memo(() => { onRowEdit={tableHandlers.edit} onRowDelete={tableHandlers.delete} tableName={'admin_company_controller'} + scroll={{ x: true }} /> > ) diff --git a/src/pages/AdminPanel/CompanyTypeController.jsx b/src/pages/AdminPanel/CompanyTypeController.jsx index 1ce4932..eeab683 100755 --- a/src/pages/AdminPanel/CompanyTypeController.jsx +++ b/src/pages/AdminPanel/CompanyTypeController.jsx @@ -75,6 +75,7 @@ const CompanyTypeController = memo(() => { onRowEdit={tableHandlers.edit} onRowDelete={tableHandlers.delete} tableName={'admin_company_type_controller'} + scroll={{ x: true }} /> > ) diff --git a/src/pages/AdminPanel/DepositController.jsx b/src/pages/AdminPanel/DepositController.jsx index 3c17df4..edf3b46 100755 --- a/src/pages/AdminPanel/DepositController.jsx +++ b/src/pages/AdminPanel/DepositController.jsx @@ -75,6 +75,7 @@ const DepositController = memo(() => { onRowEdit={tableHandlers.edit} onRowDelete={tableHandlers.delete} tableName={'admin_deposit_controller'} + scroll={{ x: true }} /> > ) diff --git a/src/pages/AdminPanel/PermissionController.jsx b/src/pages/AdminPanel/PermissionController.jsx index 6add2ea..b4d1314 100755 --- a/src/pages/AdminPanel/PermissionController.jsx +++ b/src/pages/AdminPanel/PermissionController.jsx @@ -82,6 +82,7 @@ const PermissionController = memo(() => { onRowEdit={tableHandlers.edit} onRowDelete={tableHandlers.delete} tableName={'admin_permission_controller'} + scroll={{ x: true }} /> > ) diff --git a/src/pages/AdminPanel/RoleController.jsx b/src/pages/AdminPanel/RoleController.jsx index 8f80a9a..d87a586 100755 --- a/src/pages/AdminPanel/RoleController.jsx +++ b/src/pages/AdminPanel/RoleController.jsx @@ -89,6 +89,7 @@ const RoleController = memo(() => { onRowEdit={tableHandlers.edit} onRowDelete={tableHandlers.delete} tableName={'admin_role_controller'} + scroll={{ x: true }} /> > ) diff --git a/src/pages/AdminPanel/Telemetry/TelemetryViewer.jsx b/src/pages/AdminPanel/Telemetry/TelemetryViewer.jsx index 111d930..1f040a4 100755 --- a/src/pages/AdminPanel/Telemetry/TelemetryViewer.jsx +++ b/src/pages/AdminPanel/Telemetry/TelemetryViewer.jsx @@ -115,6 +115,7 @@ const TelemetryController = memo(() => { pagination={defaultPagination} dataSource={filteredTelemetryData} tableName={'admin_telemetry_controller'} + scroll={{ x: true }} /> > ) diff --git a/src/pages/AdminPanel/UserController/index.jsx b/src/pages/AdminPanel/UserController/index.jsx index fc22c7f..2581082 100755 --- a/src/pages/AdminPanel/UserController/index.jsx +++ b/src/pages/AdminPanel/UserController/index.jsx @@ -214,6 +214,7 @@ const UserController = memo(() => { buttonsWidth={120} pagination={defaultPagination} tableName={'admin_user_controller'} + scroll={{ x: true }} /> { dataSource={filteredLogData} pagination={defaultPagination} tableName={'visit_log'} + scroll={{ x: true }} /> > ) diff --git a/src/pages/Cluster/ClusterWells.jsx b/src/pages/Cluster/ClusterWells.jsx index 91f877c..7538ec4 100755 --- a/src/pages/Cluster/ClusterWells.jsx +++ b/src/pages/Cluster/ClusterWells.jsx @@ -174,6 +174,7 @@ const ClusterWells = memo(({ statsWells }) => { pagination={false} rowKey={(record) => record.caption} tableName={'cluster'} + scroll={{ x: true }} /> record.id} tableName={tableName ?? `file_${idCategory}`} + scroll={{ x: true }} /> ) diff --git a/src/pages/Well/Reports/DiagramReport/Reports.jsx b/src/pages/Well/Reports/DiagramReport/Reports.jsx index cacdf1d..91fa620 100644 --- a/src/pages/Well/Reports/DiagramReport/Reports.jsx +++ b/src/pages/Well/Reports/DiagramReport/Reports.jsx @@ -4,9 +4,9 @@ import { FilePdfOutlined, FileTextOutlined } from '@ant-design/icons' import { useWell } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' -import { Table, makeDateSorter, makeNumericSorter } from '@components/Table' +import { Table, makeNumericSorter, makeColumn, makeDateColumn } from '@components/Table' import { invokeWebApiWrapperAsync, downloadFile } from '@components/factory' -import { formatDate, periodToString } from '@utils' +import { periodToString } from '@utils' import { ReportService } from '@api' const imgPaths = { @@ -15,10 +15,7 @@ const imgPaths = { } const columns = [ - { - title: 'Название', - dataIndex: 'name', - key: 'name', + makeColumn('Название', 'name', { render: (name, report) => ( ), - }, { - title: Сформирован, - dataIndex: 'date', - key: 'date', - sorter: makeDateSorter('date'), - render: (date) => formatDate(date), - }, { - title: С, - dataIndex: 'begin', - key: 'begin', - sorter: makeDateSorter('begin'), - render: (date) => formatDate(date), - }, { - title: По, - dataIndex: 'end', - key: 'end', - sorter: makeDateSorter('end'), - render: (date) => formatDate(date), - }, { - title: шаг, сек, - dataIndex: 'step', - key: 'step', + }), + makeDateColumn(Сформирован, 'date'), + makeDateColumn(С, 'begin'), + makeDateColumn(По, 'end'), + makeColumn(шаг, сек, 'step', { sorter: makeNumericSorter('step'), render: step => periodToString(step), - }, + }), ] export const Reports = memo(() => { @@ -84,6 +64,7 @@ export const Reports = memo(() => { dataSource={reports} pagination={{ pageSize: 13 }} tableName={'reports'} + scroll={{ x: true }} /> ) diff --git a/src/pages/Well/Telemetry/Messages.jsx b/src/pages/Well/Telemetry/Messages.jsx index bc845d4..e029e49 100644 --- a/src/pages/Well/Telemetry/Messages.jsx +++ b/src/pages/Well/Telemetry/Messages.jsx @@ -31,13 +31,14 @@ export const makeMessageColumns = (idWell) => [ makeDateColumn('Дата', 'date', undefined, undefined, { width: '10rem' }), makeNumericColumn('Глубина, м', 'wellDepth', null, null, (depth, item) => ( - - - - {depth.toFixed(2)} - + + + + {depth.toFixed(2)} + ), '7rem'), makeColumn('Категория', 'categoryId', { @@ -139,6 +140,7 @@ const Messages = memo(() => { }} rowKey={(record) => record.id} tableName={'messages'} + scroll={{ x: true }} /> > diff --git a/src/pages/Well/Telemetry/Operations/OperationsTable.jsx b/src/pages/Well/Telemetry/Operations/OperationsTable.jsx index c94c88e..3f7a2b5 100644 --- a/src/pages/Well/Telemetry/Operations/OperationsTable.jsx +++ b/src/pages/Well/Telemetry/Operations/OperationsTable.jsx @@ -42,7 +42,7 @@ export const OperationsTable = memo(({ data, height, ...other }) => ( columns={columns} dataSource={data} tableName={'well_telemetry_detected_operations'} - scroll={{ y: height ?? '70vh', scrollToFirstRowOnChange: true }} + scroll={{ x: true, y: height ?? '70vh', scrollToFirstRowOnChange: true }} /> )) diff --git a/src/pages/Well/Telemetry/Operations/index.jsx b/src/pages/Well/Telemetry/Operations/index.jsx index af06d26..fd34730 100644 --- a/src/pages/Well/Telemetry/Operations/index.jsx +++ b/src/pages/Well/Telemetry/Operations/index.jsx @@ -1,11 +1,12 @@ import { memo, useCallback, useEffect, useMemo, useState } from 'react' -import { Empty, InputNumber, Select } from 'antd' +import { InputNumber, Select } from 'antd' import moment from 'moment' import { useWell } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { DateRangeWrapper } from '@components/Table' import { invokeWebApiWrapperAsync } from '@components/factory' +import { unique } from '@utils/filters' import { getPermissions, arrayOrDefault, range, wrapPrivateComponent, pretify } from '@utils' import { DetectedOperationService, DrillerService, TelemetryDataSaubService } from '@api' @@ -16,7 +17,6 @@ import OperationsChart from './OperationsChart' import OperationsTable from './OperationsTable' import '@styles/detected_operations.less' -import { unique } from '@asb/utils/filters' const Operations = memo(() => { const [isLoading, setIsLoading] = useState(false) @@ -161,11 +161,4 @@ const Operations = memo(() => { ) }) -export default wrapPrivateComponent(Operations, { - requirements: [ - 'DetectedOperation.get', - 'TelemetryDataSaub.get', - ], - title: 'Операции', - route: 'operations', -}) +export default wrapPrivateComponent(Operations, { requirements: ['DetectedOperation.get', 'TelemetryDataSaub.get'] }) diff --git a/src/pages/Well/WellCase/index.jsx b/src/pages/Well/WellCase/index.jsx index 14897b8..250d3c3 100644 --- a/src/pages/Well/WellCase/index.jsx +++ b/src/pages/Well/WellCase/index.jsx @@ -43,7 +43,7 @@ const WellCase = memo(() => { }, [well]) const columns = useMemo(() => [ - makeTextColumn('Категория', 'nameCategory'), + makeTextColumn('Категория', 'nameCategory', undefined, undefined, undefined, { width: 300 }), makeColumn('Файл', 'file', { render: (file, category) => ( @@ -59,10 +59,12 @@ const WellCase = memo(() => { )} ), + width: 300, }), - makeDateColumn('Дата загрузки', 'uploadDate'), + makeDateColumn('Дата загрузки', 'uploadDate', undefined, undefined, { width: 150 }), makeColumn('Ответственные', 'publishers', { render: (publishers) => publishers?.map((user, i) => ), + width: 200, }), ], [well, updateTable]) @@ -92,6 +94,7 @@ const WellCase = memo(() => { pagination={false} dataSource={categories} expandable={expandable} + scroll={{ x: true }} /> diff --git a/src/pages/Well/index.jsx b/src/pages/Well/index.jsx index c61a4ba..3e65e7d 100644 --- a/src/pages/Well/index.jsx +++ b/src/pages/Well/index.jsx @@ -87,7 +87,7 @@ const Well = memo(() => { } /> } /> } /> - } /> + } /> } /> } />