From ddfbc66424f9004b2b7140d0b26f44f950be5d1b Mon Sep 17 00:00:00 2001 From: "lixinghua.vendor" Date: Mon, 14 Aug 2023 19:11:41 +0800 Subject: [PATCH] fix: Point cloud configuration display --- .../components/limitPopover/index.tsx | 16 +++++++--------- packages/lb-utils/src/types/base.ts | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/lb-components/src/components/attributeList/components/limitPopover/index.tsx b/packages/lb-components/src/components/attributeList/components/limitPopover/index.tsx index b60fd1f44..d5e860c15 100644 --- a/packages/lb-components/src/components/attributeList/components/limitPopover/index.tsx +++ b/packages/lb-components/src/components/attributeList/components/limitPopover/index.tsx @@ -16,9 +16,9 @@ const LimitPopover = ({ const sizeRange = limit?.sizeLimit?.sizeRange; const positionLimit = limit?.positionLimit; - const { heightDefault, depthDefault, widthDefault } = defaultSize; - const { heightMax, heightMin, depthMax, depthMin, widthMax, widthMin } = sizeRange; - const { XMin, XMax, YMin, YMax, ZMin, ZMax } = positionLimit; + const { heightDefault, depthDefault, widthDefault } = defaultSize || {}; + const { heightMax, heightMin, depthMax, depthMin, widthMax, widthMin } = sizeRange || {}; + const { XMin, XMax, YMin, YMax, ZMin, ZMax } = positionLimit || {}; return ( {defaultSize && (
-
- 【{t('DefaultSize')}】 -
+
【{t('DefaultSize')}】
{`${t('Length')}: ${depthDefault}m、`} {`${t('Width')}: ${widthDefault}m、`} {`${t('Height')}: ${heightDefault}m`} @@ -39,7 +37,7 @@ const LimitPopover = ({ {sizeRange && (
*{t('NormalSizeRange')}
- {`${t('Length')}:: ${depthMin}~${depthMax}m、`} + {`${t('Length')}: ${depthMin}~${depthMax}m、`} {`${t('Width')}: ${widthMin}~${widthMax}m、`} {`${t('Height')}: ${heightMin}~${heightMax}m`}
@@ -60,9 +58,9 @@ const LimitPopover = ({ src={defaultSizeSvg} style={{ margin: '0px 8px' }} onClick={(e) => { - e.preventDefault() + e.preventDefault(); if (defaultSize) { - updateSize?.(defaultSize) + updateSize?.(defaultSize); } }} /> diff --git a/packages/lb-utils/src/types/base.ts b/packages/lb-utils/src/types/base.ts index 42a80a48f..76bbb87f2 100644 --- a/packages/lb-utils/src/types/base.ts +++ b/packages/lb-utils/src/types/base.ts @@ -35,7 +35,7 @@ interface IPositionLimit { export interface ILimit { sizeLimit: { sizeRange: ISizeRange; - defaultSize: IDefaultSize; + defaultSize?: IDefaultSize; logicalCondition: ILogicalCondition[]; }; positionLimit: IPositionLimit;