Skip to content

Commit

Permalink
feat(footer): Support PointCloud PageNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin-L committed Feb 20, 2023
1 parent e9c22fb commit 794847c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { usePolygon } from './hooks/usePolygon';
const { EPolygonPattern } = cTool;

interface IProps extends IA2MapStateProps {
checkMode: boolean;
checkMode?: boolean;
}

const PointCloudListener: React.FC<IProps> = ({ currentData, config, checkMode }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const PointCloudView: React.FC<IProps> = ({ imgList, drawLayerSlot, checkMode })

return (
<>
<PointCloudListener checkMode={checkMode}/>
<PointCloudListener checkMode={checkMode}/>
<div className={getClassName('point-cloud-layout')} onContextMenu={(e) => e.preventDefault()}>
<div className={getClassName('point-cloud-wrapper')}>
<div className={getClassName('point-cloud-container', 'left')}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React, { useEffect, useState } from 'react';
import React, { useContext, useEffect, useState } from 'react';
import { AppState } from '@/store';
import { connect } from 'react-redux';
import { GraphToolInstance } from '@/store/annotation/types';
import { Divider } from 'antd/es';
import { useTranslation } from 'react-i18next';
import { LabelBeeContext } from '@/store/ctx';
import { PointCloudContext } from '@/components/pointCloudView/PointCloudContext';

interface IProps {
toolInstance: GraphToolInstance;
Expand All @@ -13,6 +14,7 @@ interface IProps {
const PageNumber = (props: IProps) => {
const { toolInstance } = props;
const [_, forceRender] = useState(0);
const { pointCloudBoxList } = useContext(PointCloudContext);
const { t } = useTranslation();
useEffect(() => {
if (toolInstance) {
Expand All @@ -26,7 +28,8 @@ const PageNumber = (props: IProps) => {
return null;
}

const count = toolInstance?.currentPageResult?.length;
const count = toolInstance?.currentPageResult?.length ?? pointCloudBoxList.length;

if (count >= 0) {
return (
<span>
Expand Down

0 comments on commit 794847c

Please sign in to comment.