diff --git a/src/components/Table/Columns/index.ts b/src/components/Table/Columns/index.ts index b6ebf7d..fd0b327 100644 --- a/src/components/Table/Columns/index.ts +++ b/src/components/Table/Columns/index.ts @@ -17,7 +17,6 @@ export { makeSelectColumn } from './select' export { makeTagColumn, makeTagInput } from './tag' export { makeFilterTextMatch, makeTextColumn } from './text' export { - rawTimezones, timezoneOptions, TimezoneSelect, makeTimezoneColumn, diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index 550b3e8..d6af60e 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -17,10 +17,10 @@ export type TableContainer = TableProps & { dataSource: any[] children?: ReactNode tableName?: string - showSettingsChanger?: boolean + hideSettingsChanger?: boolean } -export const Table = memo(({ columns, dataSource, children, tableName, showSettingsChanger, ...other }) => { +export const Table = memo(({ columns, dataSource, children, tableName, hideSettingsChanger, ...other }) => { const [newColumns, setNewColumns] = useState([]) const [settings, setSettings] = useState({}) @@ -33,7 +33,7 @@ export const Table = memo(({ columns, dataSource, children, tabl useEffect(() => setSettings(tableName ? getTableSettings(tableName) : {}), [tableName]) useEffect(() => setNewColumns(() => { const newColumns = applySettings(columns, settings) - if (tableName && showSettingsChanger) { + if (tableName && !hideSettingsChanger) { const oldTitle = newColumns[0].title newColumns[0].title = (props) => (
@@ -45,12 +45,15 @@ export const Table = memo(({ columns, dataSource, children, tabl ) } return newColumns - }), [settings, columns, onSettingsChanged, showSettingsChanger, tableName]) + }), [settings, columns, onSettingsChanged, hideSettingsChanger, tableName]) return ( - <> - {children} - + ) }) diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index 34e67c2..095c825 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -4,7 +4,6 @@ export { DatePickerWrapper } from './DatePickerWrapper' export { Table } from './Table' export { RegExpIsFloat, - rawTimezones, timezoneOptions, TimezoneSelect, makeGroupColumn, diff --git a/src/pages/AdminPanel/ClusterController.jsx b/src/pages/AdminPanel/ClusterController.jsx index 0d5553b..d513d9d 100644 --- a/src/pages/AdminPanel/ClusterController.jsx +++ b/src/pages/AdminPanel/ClusterController.jsx @@ -81,6 +81,7 @@ export const ClusterController = memo(() => { onRowAdd={hasPermission('AdminCluster.edit') && makeActionHandler('insert', handlerProps, null, 'Добавление куста')} onRowEdit={hasPermission('AdminCluster.edit') && makeActionHandler('update', handlerProps, null, 'Редактирование куста')} onRowDelete={hasPermission('AdminCluster.delete') && makeActionHandler('delete', handlerProps, null, 'Удаление куста')} + tableName={'admin_cluster_controller'} /> ) diff --git a/src/pages/AdminPanel/CompanyController.jsx b/src/pages/AdminPanel/CompanyController.jsx index 2381bda..9973496 100644 --- a/src/pages/AdminPanel/CompanyController.jsx +++ b/src/pages/AdminPanel/CompanyController.jsx @@ -76,6 +76,7 @@ export const CompanyController = memo(() => { onRowAdd={hasPermission('AdminCompany.edit') && makeActionHandler('insert', handlerProps, null, 'Добавлениее компаний')} onRowEdit={hasPermission('AdminCompany.edit') && makeActionHandler('update', handlerProps, null, 'Редактирование команий')} onRowDelete={hasPermission('AdminCompany.delete') && makeActionHandler('delete', handlerProps, null, 'Удаление компаний')} + tableName={'admin_company_controller'} /> ) diff --git a/src/pages/AdminPanel/CompanyTypeController.jsx b/src/pages/AdminPanel/CompanyTypeController.jsx index 7c87d90..af55a6a 100644 --- a/src/pages/AdminPanel/CompanyTypeController.jsx +++ b/src/pages/AdminPanel/CompanyTypeController.jsx @@ -57,6 +57,7 @@ export const CompanyTypeController = memo(() => { onRowAdd={hasPermission('AdminCompanyType.edit') && makeActionHandler('insert', handlerProps, null, 'Добавление типа компаний')} onRowEdit={hasPermission('AdminCompanyType.edit') && makeActionHandler('update', handlerProps, null, 'Редактирование типа компаний')} onRowDelete={hasPermission('AdminCompanyType.delete') && makeActionHandler('delete', handlerProps, null, 'Удаление типа компаний')} + tableName={'admin_company_type_controller'} /> ) diff --git a/src/pages/AdminPanel/DepositController.jsx b/src/pages/AdminPanel/DepositController.jsx index c472c30..d033753 100644 --- a/src/pages/AdminPanel/DepositController.jsx +++ b/src/pages/AdminPanel/DepositController.jsx @@ -51,6 +51,7 @@ export const DepositController = memo(() => { onRowAdd={hasPermission('AdminDeposit.edit') && makeActionHandler('insert', handlerProps, null, 'Добавление месторождения')} onRowEdit={hasPermission('AdminDeposit.edit') && makeActionHandler('update', handlerProps, null, 'Редактирование месторождения')} onRowDelete={hasPermission('AdminDeposit.delete') && makeActionHandler('delete', handlerProps, null, 'Удаление месторождения')} + tableName={'admin_deposit_controller'} /> ) diff --git a/src/pages/AdminPanel/PermissionController.jsx b/src/pages/AdminPanel/PermissionController.jsx index 5bbf24e..a094e60 100644 --- a/src/pages/AdminPanel/PermissionController.jsx +++ b/src/pages/AdminPanel/PermissionController.jsx @@ -60,6 +60,7 @@ export const PermissionController = memo(() => { onRowAdd={hasPermission('AdminPermission.edit') && makeActionHandler('insert', handlerProps, null, 'Добавление права')} onRowEdit={hasPermission('AdminPermission.edit') && makeActionHandler('update', handlerProps, null, 'Редактирование права')} onRowDelete={hasPermission('AdminPermission.delete') && makeActionHandler('delete', handlerProps, null, 'Удаление права')} + tableName={'admin_permission_controller'} /> ) diff --git a/src/pages/AdminPanel/RoleController.jsx b/src/pages/AdminPanel/RoleController.jsx index dbfb0b2..63e2d5b 100644 --- a/src/pages/AdminPanel/RoleController.jsx +++ b/src/pages/AdminPanel/RoleController.jsx @@ -69,6 +69,7 @@ export const RoleController = memo(() => { onRowAdd={hasPermission('AdminUserRole.edit') && makeActionHandler('insert', handlerProps, null, 'Добавление роли')} onRowEdit={hasPermission('AdminUserRole.edit') && makeActionHandler('update', handlerProps, null, 'Редактирование роли')} onRowDelete={hasPermission('AdminUserRole.delete') && makeActionHandler('delete', handlerProps, null, 'Удаление роли')} + tableName={'admin_role_controller'} /> ) diff --git a/src/pages/AdminPanel/TelemetryController.jsx b/src/pages/AdminPanel/TelemetryController.jsx index dc65664..7621ce9 100644 --- a/src/pages/AdminPanel/TelemetryController.jsx +++ b/src/pages/AdminPanel/TelemetryController.jsx @@ -56,6 +56,7 @@ export const TelemetryController = memo(() => { columns={columns} dataSource={telemetryData} pagination={defaultPagination} + tableName={'admin_telemetry_controller'} /> ) diff --git a/src/pages/AdminPanel/UserController/index.jsx b/src/pages/AdminPanel/UserController/index.jsx index 8fc4ccc..c0ea90d 100644 --- a/src/pages/AdminPanel/UserController/index.jsx +++ b/src/pages/AdminPanel/UserController/index.jsx @@ -216,6 +216,7 @@ export const UserController = memo(() => { additionalButtons={additionalButtons} buttonsWidth={120} pagination={defaultPagination} + tableName={'admin_user_controller'} /> { columns={columns} dataSource={logData} pagination={defaultPagination} + tableName={'visit_log'} /> ) diff --git a/src/pages/AdminPanel/WellController/index.jsx b/src/pages/AdminPanel/WellController/index.jsx index 0a5d8d6..97eda0c 100644 --- a/src/pages/AdminPanel/WellController/index.jsx +++ b/src/pages/AdminPanel/WellController/index.jsx @@ -134,6 +134,7 @@ export const WellController = memo(() => { onRowDelete={hasPermission('AdminWell.delete') && makeActionHandler('delete', handlerProps, null, 'Удаление скважины')} //additionalButtons={addititonalButtons} buttonsWidth={95} + tableName={'admin_well_controller'} /> ) diff --git a/src/pages/Cluster/ClusterWells.jsx b/src/pages/Cluster/ClusterWells.jsx index c11dd59..224b44d 100644 --- a/src/pages/Cluster/ClusterWells.jsx +++ b/src/pages/Cluster/ClusterWells.jsx @@ -170,6 +170,7 @@ export const ClusterWells = memo(({ statsWells }) => { bordered pagination={false} rowKey={(record) => record.caption} + tableName={'cluster'} /> { @@ -34,6 +33,7 @@ export const WellOperationsTable = ({ wellOperations }) => { dataSource={operations} rowKey={(record) => record.key} pagination={{ defaultPageSize: 10 }} + tableName={'well_operations'} /> ) } diff --git a/src/pages/Deposit.jsx b/src/pages/Deposit.jsx index 0218aca..e147b93 100644 --- a/src/pages/Deposit.jsx +++ b/src/pages/Deposit.jsx @@ -8,6 +8,8 @@ import { PointerIcon } from '@components/icons' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' +import '@styles/index.css' + const defaultViewParams = { center: [60.81226, 70.0562], zoom: 5 } const calcViewParams = (clusters) => { diff --git a/src/pages/Documents/DocumentsTemplate.jsx b/src/pages/Documents/DocumentsTemplate.jsx index 674c066..d25ee42 100644 --- a/src/pages/Documents/DocumentsTemplate.jsx +++ b/src/pages/Documents/DocumentsTemplate.jsx @@ -46,7 +46,7 @@ const columns = [ } ] -export const DocumentsTemplate = ({ idCategory, idWell, accept, headerChild, customColumns, beforeTable, onChange}) => { +export const DocumentsTemplate = ({ idCategory, idWell, accept, headerChild, customColumns, beforeTable, onChange, tableName }) => { const [page, setPage] = useState(1) const [filterDataRange, setFilterDataRange] = useState([]) const [filterCompanyName, setFilterCompanyName] = useState([]) @@ -173,6 +173,7 @@ export const DocumentsTemplate = ({ idCategory, idWell, accept, headerChild, cus }} onRowDelete={hasPermission(`File.edit${idCategory}`) && handleFileDelete} rowKey={(record) => record.id} + tableName={tableName ?? `file_${idCategory}`} /> ) diff --git a/src/pages/Documents/index.jsx b/src/pages/Documents/index.jsx index b7eacc1..1d79c0e 100644 --- a/src/pages/Documents/index.jsx +++ b/src/pages/Documents/index.jsx @@ -46,7 +46,7 @@ export const MenuDocuments = memo(({ idWell }) => { {documentCategories.map(category => ( - + ))} join(root, cat.key))}/> diff --git a/src/pages/DrillingProgram/CategoryEditor.jsx b/src/pages/DrillingProgram/CategoryEditor.jsx index 08720e2..15300a5 100644 --- a/src/pages/DrillingProgram/CategoryEditor.jsx +++ b/src/pages/DrillingProgram/CategoryEditor.jsx @@ -160,6 +160,7 @@ export const CategoryEditor = memo(({ idWell, visible, category, onClosed }) => bordered columns={userColumns} dataSource={filteredUsers} + tableName={`drilling_program_category_editor`} />
diff --git a/src/pages/DrillingProgram/CategoryHistory.jsx b/src/pages/DrillingProgram/CategoryHistory.jsx index bfd1047..2be6695 100644 --- a/src/pages/DrillingProgram/CategoryHistory.jsx +++ b/src/pages/DrillingProgram/CategoryHistory.jsx @@ -118,6 +118,7 @@ export const CategoryHistory = ({ idWell, idCategory, visible, onClose }) => { showSizeChanger: true, onChange: onPaginationChange }} + tableName={'drilling_program_history'} /> diff --git a/src/pages/Measure/InclinometryTable.jsx b/src/pages/Measure/InclinometryTable.jsx index 5fc0837..7772cfc 100644 --- a/src/pages/Measure/InclinometryTable.jsx +++ b/src/pages/Measure/InclinometryTable.jsx @@ -48,6 +48,7 @@ export const InclinometryTable = memo(({ group, visible, onClose }) => { columns={tableColumns} scroll={tableScroll} bordered + tableName={'measure_inclinometry'} /> ) diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Measure/MeasureTable.jsx index af0be5d..6a056cd 100644 --- a/src/pages/Measure/MeasureTable.jsx +++ b/src/pages/Measure/MeasureTable.jsx @@ -11,14 +11,14 @@ import { import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' -import { MeasureService } from '@api' +import { hasPermission } from '@utils/permissions' import { formatDate } from '@utils' +import { MeasureService } from '@api' import { View } from './View' import '@styles/index.css' import '@styles/measure.css' -import { hasPermission } from '@asb/utils/permissions' const createEditingColumns = (cols, renderDelegate) => cols.map(col => ({ render: renderDelegate, ...col })) diff --git a/src/pages/Messages.jsx b/src/pages/Messages.jsx index 99d7983..e4bd773 100644 --- a/src/pages/Messages.jsx +++ b/src/pages/Messages.jsx @@ -136,6 +136,7 @@ export const Messages = memo(({ idWell }) => { onChange: (page) => setPage(page) }} rowKey={(record) => record.id} + tableName={'messages'} /> diff --git a/src/pages/Report/Reports.jsx b/src/pages/Report/Reports.jsx index 1ccbd88..cf44431 100644 --- a/src/pages/Report/Reports.jsx +++ b/src/pages/Report/Reports.jsx @@ -78,6 +78,7 @@ export const Reports = memo(({ idWell }) => { columns={columns} dataSource={reports} pagination={{ pageSize: 13 }} + tableName={'reports'} /> ) diff --git a/src/pages/Well.jsx b/src/pages/Well.jsx index e4b4442..28bfddf 100644 --- a/src/pages/Well.jsx +++ b/src/pages/Well.jsx @@ -24,6 +24,8 @@ import DrillingProgram from './DrillingProgram' import TelemetryAnalysis from './TelemetryAnalysis' import WellCompositeEditor from './WellCompositeEditor' +import '@styles/index.css' + const { Content } = Layout export const Well = memo(() => { diff --git a/src/pages/WellOperations/DrillProcessFlow.jsx b/src/pages/WellOperations/DrillProcessFlow.jsx index 736f1b4..878d410 100644 --- a/src/pages/WellOperations/DrillProcessFlow.jsx +++ b/src/pages/WellOperations/DrillProcessFlow.jsx @@ -62,6 +62,7 @@ export const DrillProcessFlow = memo(({ idWell }) => { bordered columns={columns} dataSource={flows} + tableName={'well_operations_flow'} onRowAdd={hasPermission('DrillFlowChart.edit') && onAdd} onRowEdit={hasPermission('DrillFlowChart.edit') && onEdit} onRowDelete={hasPermission('DrillFlowChart.delete') && onDelete} diff --git a/src/pages/WellOperations/WellDrillParams.jsx b/src/pages/WellOperations/WellDrillParams.jsx index d31df5d..87c8407 100644 --- a/src/pages/WellOperations/WellDrillParams.jsx +++ b/src/pages/WellOperations/WellDrillParams.jsx @@ -71,6 +71,7 @@ export const WellDrillParams = memo(({ idWell }) => { bordered columns={columns} dataSource={params} + tableName={'well_drill_params'} onRowAdd={hasPermission('DrillParams.edit') && makeActionHandler('insert', handlerProps, recordParser, 'Добавление режима бурения')} onRowEdit={hasPermission('DrillParams.edit') && makeActionHandler('update', handlerProps, recordParser, 'Редактирование режима бурения')} onRowDelete={hasPermission('DrillParams.delete') && makeActionHandler('delete', handlerProps, recordParser, 'Удаление режима бурения')} diff --git a/src/pages/WellOperations/WellOperationsEditor.jsx b/src/pages/WellOperations/WellOperationsEditor.jsx index 8a7c64b..1266d49 100644 --- a/src/pages/WellOperations/WellOperationsEditor.jsx +++ b/src/pages/WellOperations/WellOperationsEditor.jsx @@ -132,6 +132,7 @@ export const WellOperationsEditor = memo(({ idWell, idType, ...other }) => { total: paginationTotal, onChange: (page, pageSize) => setPageNumAndPageSize({ current: page, pageSize }) }} + tableName={'well_operationse_editor'} /> ) diff --git a/src/pages/WellOperations/WellSectionsStat.jsx b/src/pages/WellOperations/WellSectionsStat.jsx index 038d5cc..5355698 100644 --- a/src/pages/WellOperations/WellSectionsStat.jsx +++ b/src/pages/WellOperations/WellSectionsStat.jsx @@ -63,6 +63,7 @@ export const WellSectionsStat = memo(({ idWell }) => { size={'small'} columns={columns} dataSource={sections} + tableName={'well_operations_sections'} /> ) diff --git a/src/pages/WellOperations/index.jsx b/src/pages/WellOperations/index.jsx index de57dd1..5da927e 100644 --- a/src/pages/WellOperations/index.jsx +++ b/src/pages/WellOperations/index.jsx @@ -56,7 +56,7 @@ export const WellOperations = memo(({ idWell }) => { - + diff --git a/src/styles/App.less b/src/styles/App.less index fb1874b..600ca7a 100644 --- a/src/styles/App.less +++ b/src/styles/App.less @@ -14,7 +14,20 @@ //@layout-header-background: rgb(195, 40,40); @layout-header-background: rgb(65, 63, 61); -#root, .app{min-height:100%;} +@header-height: 64px; +@layout-min-height: calc(100vh - @header-height); + +#root, .app{ + min-height:100%; +} + +.ant-layout{ + flex: 1; + + > .ant-menu { + flex: 0; + } +} html { display: flex; @@ -49,6 +62,7 @@ html { align-items: center; justify-content: space-around; gap: 50px; + height: @header-height; } .header .logo { @@ -98,9 +112,15 @@ html { margin-right: 2px; } +.ant-layout-content { + display: flex; + flex-direction: column; + align-items: stretch; +} + .sheet{ padding: 5px 24px; - min-height: 280px; + min-height: calc(@layout-min-height - 15px); // 280px; margin: 0 15px 15px 15px; } diff --git a/src/styles/index.css b/src/styles/index.css index 4103d37..fe08c79 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -72,7 +72,7 @@ body { } .h-100vh { - height: 100vh; + height: calc(100vh - 64px); } .vertical-align-center { @@ -84,7 +84,7 @@ body { } .text-align-r-container { - width: 100%; + width: 100%; text-align: right; }