From 55af39e58f75cfb601a1572694f124dfd4ef2520 Mon Sep 17 00:00:00 2001 From: yunji Date: Fri, 15 Sep 2023 22:46:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E6=97=A0=E6=95=88=E6=95=B0=E6=8D=AE=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + .../widgets/PropertiesPanel/ComponenStyle.ts | 6 ----- .../src/widgets/PropertiesPanel/Component.tsx | 25 +++++++------------ scripts/package-link.sh | 23 +++++++++++++++++ 4 files changed, 33 insertions(+), 22 deletions(-) create mode 100755 scripts/package-link.sh diff --git a/package.json b/package.json index 776bfae9..ed24337f 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ ], "scripts": { "prepare": "husky install", + "dev": "lerna run dev --stream --no-bail", "start:sdk": "lerna run start --stream --scope=@antv/li-sdk", "start:editor": "lerna run start --stream --scope=@antv/li-editor", "start:core-assets": "lerna run start --stream --scope=@antv/li-core-assets", diff --git a/packages/li-analysis-assets/src/widgets/PropertiesPanel/ComponenStyle.ts b/packages/li-analysis-assets/src/widgets/PropertiesPanel/ComponenStyle.ts index 94fb47da..62121d45 100644 --- a/packages/li-analysis-assets/src/widgets/PropertiesPanel/ComponenStyle.ts +++ b/packages/li-analysis-assets/src/widgets/PropertiesPanel/ComponenStyle.ts @@ -34,12 +34,6 @@ const useStyle = () => { background-color: ${colorBgContainer}; `, - panelTooltip: css` - max-height: 300px !important; - overflow-y: auto !important; - font-size: 6px !important; - `, - panelContent: css` padding: 14px; `, diff --git a/packages/li-analysis-assets/src/widgets/PropertiesPanel/Component.tsx b/packages/li-analysis-assets/src/widgets/PropertiesPanel/Component.tsx index a820b44f..ec9c8238 100644 --- a/packages/li-analysis-assets/src/widgets/PropertiesPanel/Component.tsx +++ b/packages/li-analysis-assets/src/widgets/PropertiesPanel/Component.tsx @@ -1,8 +1,9 @@ import { CloseOutlined } from '@ant-design/icons'; import type { ImplementWidgetProps } from '@antv/li-sdk'; import { useDatasetList, useLayerList } from '@antv/li-sdk'; -import { Col, Image, Row, Tooltip, Typography } from 'antd'; +import { Col, Image, Row, Typography } from 'antd'; import cls from 'classnames'; +import { isObject, isString } from 'lodash-es'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import useStyle from './ComponenStyle'; import { CLS_PREFIX } from './constant'; @@ -63,8 +64,8 @@ const PropertiesPanel: React.FC = ({ items = [], isOpen }) }; }, [datasetList, formatLayerList]); - const getContent = (val: string) => { - if (isImageUrl(val)) { + const getContent = (val: any) => { + if (isString(val) && isImageUrl(val)) { return (
@@ -72,18 +73,16 @@ const PropertiesPanel: React.FC = ({ items = [], isOpen }) ); } + const text = isObject(val) ? JSON.stringify(val) : val; + return ( 100 ? (typeof val === 'object' ? JSON.stringify(val) : val) : null, - zIndex: 99999, - overlayClassName: styles.panelTooltip, - }, + expandable: true, }} > - {typeof val === 'object' ? JSON.stringify(val) : val} + {text} ); }; @@ -94,13 +93,7 @@ const PropertiesPanel: React.FC = ({ items = [], isOpen })
- -
{title}
-
+
{title}
setCollapsed(0)} />
diff --git a/scripts/package-link.sh b/scripts/package-link.sh new file mode 100755 index 00000000..9c2fe07d --- /dev/null +++ b/scripts/package-link.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +cd ./packages/ + +cd ./li-sdk/ +yarn link +cd .. + +cd ./li-p2/ +yarn link +cd .. + +cd ./li-editor/ +yarn link +cd .. + +cd ./li-core-assets/ +yarn link +cd .. + +cd ./li-analysis-assets/ +yarn link +cd ..