1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 06:34:40 +00:00

feat: optimize code (#6272)

* feat: optimize code

* feat: optimize code

* feat: optimize code

---------

Co-authored-by: 杨国璇 <ygx@192.168.1.13>
This commit is contained in:
杨国璇
2024-06-29 20:02:36 +08:00
committed by GitHub
parent 19f15c944f
commit e2588debd3
2 changed files with 6 additions and 13 deletions

View File

@@ -11,9 +11,9 @@ const COLUMNS_ICON_CONFIG = {
const COLUMNS_ICON_NAME = { const COLUMNS_ICON_NAME = {
[CellType.CREATOR]: 'Creator', [CellType.CREATOR]: 'Creator',
[CellType.LAST_MODIFIER]: 'Last_modifier', [CellType.LAST_MODIFIER]: 'Last modifier',
[CellType.CTIME]: 'CTime', [CellType.CTIME]: 'CTime',
[CellType.MTIME]: 'Last_modified_time', [CellType.MTIME]: 'Last modified time',
[CellType.DEFAULT]: 'Text', [CellType.DEFAULT]: 'Text',
[CellType.TEXT]: 'Text', [CellType.TEXT]: 'Text',
}; };

View File

@@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { HEADER_HEIGHT_TYPE, isEmptyObject, Z_INDEX } from '../../_basic'; import { Z_INDEX } from '../../_basic';
import { GRID_HEADER_DEFAULT_HEIGHT, GRID_HEADER_DOUBLE_HEIGHT } from '../../constants';
const propTypes = { const propTypes = {
table: PropTypes.object.isRequired, table: PropTypes.object.isRequired,
@@ -46,13 +45,6 @@ class RightScrollbar extends React.Component {
return {}; return {};
}; };
getGridHeaderHeight = () => {
const headerSettings = this.props.table.header_settings || {};
const headerHeight = isEmptyObject(headerSettings) ? HEADER_HEIGHT_TYPE.DEFAULT : headerSettings.header_height;
const height = headerHeight === HEADER_HEIGHT_TYPE.DOUBLE ? GRID_HEADER_DOUBLE_HEIGHT : GRID_HEADER_DEFAULT_HEIGHT;
return height;
};
getContainerStyle = () => { getContainerStyle = () => {
const style = {}; const style = {};
const component = window.sfMetadataBody; const component = window.sfMetadataBody;
@@ -60,8 +52,9 @@ class RightScrollbar extends React.Component {
style.height = component.resultContentRef.clientHeight; style.height = component.resultContentRef.clientHeight;
style.zIndex = Z_INDEX.SCROLL_BAR; style.zIndex = Z_INDEX.SCROLL_BAR;
} }
/* page-header + seatable-app-header + table-header-top + first row(grid-header) */
style.top = 50 + 10 + 48 + this.getGridHeaderHeight(); /* sf-metadata-footer have 30px height */
style.bottom = 30;
/* sf-metadata-wrapper have 10px margin */ /* sf-metadata-wrapper have 10px margin */
style.right = '10px'; style.right = '10px';
return style; return style;