From 70ceda9903d2f8f08067949f63b598430aff436a Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Thu, 27 Oct 2022 10:57:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?debugpanel=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../func/debugPanel/web.module.less | 4 - src/components/func/debugPanel/web.tsx | 208 ++++++++++-------- 2 files changed, 117 insertions(+), 95 deletions(-) diff --git a/src/components/func/debugPanel/web.module.less b/src/components/func/debugPanel/web.module.less index ab16b7613..e0ba4cdf1 100644 --- a/src/components/func/debugPanel/web.module.less +++ b/src/components/func/debugPanel/web.module.less @@ -1,9 +1,5 @@ .container { - height: 100vh; display: flex; - flex-direction: column; - justify-content: 'center'; - align-items: 'center'; } diff --git a/src/components/func/debugPanel/web.tsx b/src/components/func/debugPanel/web.tsx index 74c0714ba..a7b1ae9d7 100644 --- a/src/components/func/debugPanel/web.tsx +++ b/src/components/func/debugPanel/web.tsx @@ -1,7 +1,6 @@ import React from 'react'; -import { Button, Space, Drawer, DialogPlugin } from 'tdesign-react'; -import { ChevronUpIcon } from 'tdesign-icons-react'; -// import { saveAs } from 'file-saver'; +import { Button, Space, Drawer, Modal, Tooltip } from 'antd'; +import { UpOutlined } from '@ant-design/icons'; export default function render(this: any) { const { placement = 'bottom', style = {} } = this.props; @@ -9,14 +8,14 @@ export default function render(this: any) { return ( - - - + + + + + + + - - + + + + + + + + + + + + + From 2c09ea7d5eb24925923c503b6ea123b5308182eb Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Thu, 27 Oct 2022 12:15:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=20visible=20=E6=94=B9open?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/func/debugPanel/web.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/func/debugPanel/web.tsx b/src/components/func/debugPanel/web.tsx index a7b1ae9d7..c6913192a 100644 --- a/src/components/func/debugPanel/web.tsx +++ b/src/components/func/debugPanel/web.tsx @@ -25,7 +25,7 @@ export default function render(this: any) { { this.setVisible(false); }} From d7c1cf7536b2ac601dc655fd43d47c6bb334be18 Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Thu, 27 Oct 2022 15:09:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/amap/location/index.less | 15 +-- src/components/amap/location/index.tsx | 153 +++++++++++------------- 2 files changed, 75 insertions(+), 93 deletions(-) diff --git a/src/components/amap/location/index.less b/src/components/amap/location/index.less index 8661c5fbb..cd21cb5a6 100644 --- a/src/components/amap/location/index.less +++ b/src/components/amap/location/index.less @@ -7,6 +7,7 @@ &-list { height: 500px; + overflow: auto; &-header { display: flex; @@ -15,7 +16,8 @@ } &-checked { - color: var(--oak-brand-color); + color: var(--oak-primary-color); + font-size: 24px; } &-loadingBox { @@ -24,16 +26,5 @@ justify-content: center; min-height: 100px; } - - &-noData { - display: flex; - flex-direction: row; - justify-content: center; - min-height: 100px; - align-items: center; - color: var(--oak-text-color-placeholder); - align-self: center; - } - } } \ No newline at end of file diff --git a/src/components/amap/location/index.tsx b/src/components/amap/location/index.tsx index dafe6c1d8..0a8b2cfe2 100644 --- a/src/components/amap/location/index.tsx +++ b/src/components/amap/location/index.tsx @@ -1,23 +1,22 @@ import React, { useState, useEffect, useRef } from 'react'; import { - Dialog, + Modal, Row, Col, - List, - Input, - InputValue, + ModalProps, Button, - Loading, - DialogProps, -} from 'tdesign-react'; -import { SearchIcon, CheckCircleFilledIcon } from 'tdesign-icons-react'; + Input, + List, + Empty, + Spin, +} from 'antd'; +import { SearchOutlined, CheckCircleFilled } from '@ant-design/icons'; import { Geolocation, GeolocationProps } from '@uiw/react-amap'; import Map from './../map'; import PositionPicker from './PositionPicker' import './index.less'; -const { ListItem, ListItemMeta } = List; export type LocationProps = { akey: string; @@ -32,7 +31,7 @@ export type LocationProps = { ) => void; geolocationProps?: GeolocationProps; useGeolocation?: boolean; - dialogProps?: DialogProps; + dialogProps?: ModalProps; }; export type Poi = { @@ -72,8 +71,8 @@ const Location = (props: LocationProps) => { } = props; const prefixCls = 'oak'; - const searchRef = useRef(); - const [searchValue, setSearchValue] = useState(''); + const searchRef = useRef(); + const [searchValue, setSearchValue] = useState(''); const [refresh, setRefresh] = useState(true); // 点击poi不触发setPositionPickerResult const [mode, setMode] = useState('dragMap'); @@ -224,15 +223,18 @@ const Location = (props: LocationProps) => { return ( - { + open={visible} + onCancel={() => { onClose && onClose(); clearData(); }} - onConfirm={() => { + onOk={() => { if (!currentPoi) { return; } @@ -245,8 +247,8 @@ const Location = (props: LocationProps) => { }} >
- - + + { )} - +
{ ref={searchRef} placeholder="搜索地点" value={searchValue} - clearable - onChange={(value) => { - setSearchValue(value); + allowClear + onChange={(e) => { + setSearchValue(e.target.value); }} - onClear={() => { - setSearchValue(''); - }} - prefixIcon={} + prefix={} onFocus={() => { setMode('searchPoi'); setFocus(true); @@ -321,8 +320,7 @@ const Location = (props: LocationProps) => { {mode === 'searchPoi' && (
); })} @@ -382,15 +379,10 @@ const Location = (props: LocationProps) => {
-
)} @@ -406,26 +398,23 @@ const Location = (props: LocationProps) => { ); }} > - - ) : ( -
- ) - } + + {currentPoi?.id === + poi.id && ( + + )} +
, + ]} > - { poi.address }`} /> -
+
); }) - : show && ( -
- 无搜素结果 -
+ : show && + !searchLoading && ( + )} )} @@ -455,7 +446,7 @@ const Location = (props: LocationProps) => { -
+ ); };