Compare commits

...

2 Commits

  1. 3
      src/editor/Catalog/index.tsx
  2. 2
      src/editor/Catalog/style.less
  3. 1
      src/editor/Plot/Tools/MinimalTools.tsx
  4. 8
      src/editor/Property/FineInput.tsx
  5. 10
      src/editor/Property/index.tsx
  6. 6
      src/editor/index.less
  7. 1
      src/map/MapEditor.ts
  8. 7
      src/store/actions/index.ts

3
src/editor/Catalog/index.tsx

@ -63,6 +63,8 @@ const Catalog = () => {
}); });
return ( return (
<>
<div className="pane-title"></div>
<div className="catalog-wrapper"> <div className="catalog-wrapper">
<Collapse <Collapse
defaultActiveKey={["1", "2", "3", "4", "5"]} defaultActiveKey={["1", "2", "3", "4", "5"]}
@ -85,6 +87,7 @@ const Catalog = () => {
</Panel> </Panel>
</Collapse> </Collapse>
</div> </div>
</>
); );
}; };

2
src/editor/Catalog/style.less

@ -19,6 +19,6 @@
background-color: #e5e6e7; background-color: #e5e6e7;
} }
.catalog-wrapper{ .catalog-wrapper{
height: 100%; height: calc(100% - 36px);
overflow-y: scroll; overflow-y: scroll;
} }

1
src/editor/Plot/Tools/MinimalTools.tsx

@ -31,7 +31,6 @@ const MinimalButton = (props: MinimalButtonProps) => {
export const MinimalTools = () => { export const MinimalTools = () => {
const status = useSelector(statusSelector); const status = useSelector(statusSelector);
console.log(status);
if (status === Status.CreateOverlay || status === Status.EditOverlay) { if (status === Status.CreateOverlay || status === Status.EditOverlay) {
return ( return (
<> <>

8
src/editor/Property/FineInput.tsx

@ -1,5 +1,5 @@
import { Input } from "antd"; import { Input } from "antd";
import { useState } from "react"; import { useEffect, useState } from "react";
export type FineInputProps = { export type FineInputProps = {
value: string | number; value: string | number;
@ -7,7 +7,11 @@ export type FineInputProps = {
}; };
export const FineInput = (props: FineInputProps) => { export const FineInput = (props: FineInputProps) => {
const [value, setValue] = useState(props.value); const [value, setValue] = useState<string | number>("");
useEffect(() => {
setValue(props.value);
}, [props]);
return ( return (
<Input <Input

10
src/editor/Property/index.tsx

@ -18,7 +18,12 @@ const { Option } = Select;
const Property = () => { const Property = () => {
const selectedIds = useSelector(selectedIdsSelector); const selectedIds = useSelector(selectedIdsSelector);
const { overlays } = useSelector(mapOptionsSelector); const { overlays } = useSelector(mapOptionsSelector);
if (!selectedIds?.length) return <></>; if (!selectedIds?.length)
return (
<>
<div className="pane-title"></div>
</>
);
const [id] = selectedIds; const [id] = selectedIds;
const overlay = overlays.find((overlay) => overlay.id === id)!; const overlay = overlays.find((overlay) => overlay.id === id)!;
const { lngLat = [0, 0] } = overlay; const { lngLat = [0, 0] } = overlay;
@ -69,6 +74,8 @@ const Property = () => {
); );
return ( return (
<>
<div className="pane-title"></div>
<div className="property-area"> <div className="property-area">
<Form size="small"> <Form size="small">
<Form.Item label="名称"> <Form.Item label="名称">
@ -103,6 +110,7 @@ const Property = () => {
) : null} ) : null}
</Form> </Form>
</div> </div>
</>
); );
}; };

6
src/editor/index.less

@ -66,6 +66,12 @@ body ::-webkit-scrollbar-thumb {
body ::-webkit-scrollbar-corner { body ::-webkit-scrollbar-corner {
background-color: #eee; background-color: #eee;
} }
.pane-title{
line-height: 24px;
padding:6px 12px;
background-color: #dbd8d8;
// color: #fff;
}
/* stylelint-disable no-duplicate-selectors */ /* stylelint-disable no-duplicate-selectors */
/* stylelint-disable */ /* stylelint-disable */
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */ /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */

1
src/map/MapEditor.ts

@ -317,6 +317,7 @@ export class MapEditor extends Emitter implements IMapEditor {
} }
_onOverlayDragEnd(id: string) { _onOverlayDragEnd(id: string) {
if (this.editorStatus === "editing") return;
this._updateOverlay(id); this._updateOverlay(id);
} }

7
src/store/actions/index.ts

@ -115,12 +115,17 @@ export class EditorAction {
selectOverlay(id: string, reset = true) { selectOverlay(id: string, reset = true) {
const { selectedIds } = this.store.getState(); const { selectedIds } = this.store.getState();
if (selectedIds.indexOf(id) >= 0 && reset) { if (selectedIds.indexOf(id) >= 0 && reset) {
if (reset) {
this.mapEditor?.selectOverlays(); this.mapEditor?.selectOverlays();
this.dispatch(StoreAction.selectOverlay());
} else { } else {
this.mapEditor?.selectOverlays([id]); this.dispatch(StoreAction.selectOverlay(id));
} }
} else {
this.mapEditor?.selectOverlays([id]);
this.dispatch(StoreAction.selectOverlay(id)); this.dispatch(StoreAction.selectOverlay(id));
} }
}
updateOverlay(props: Partial<IOverlay>) { updateOverlay(props: Partial<IOverlay>) {
this.dispatch(StoreAction.updateOverlayProps(props)); this.dispatch(StoreAction.updateOverlayProps(props));

Loading…
Cancel
Save