From a918c90c14f877920c2abc00c43da5bc007a44b5 Mon Sep 17 00:00:00 2001 From: xujiang Date: Sun, 25 Oct 2020 15:11:18 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BB=93=E6=9E=84,=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81,=20console=E7=AD=89=E6=B3=A8=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicComponents/Carousel/index.tsx | 1 + .../BasicShop/BasicComponents/Form/index.less | 2 -- .../PanelComponents/FormEditor/index.tsx | 5 +-- src/pages/editor/SourceBox.tsx | 32 ++----------------- 4 files changed, 5 insertions(+), 35 deletions(-) diff --git a/src/components/BasicShop/BasicComponents/Carousel/index.tsx b/src/components/BasicShop/BasicComponents/Carousel/index.tsx index 5a81231..fd009d6 100644 --- a/src/components/BasicShop/BasicComponents/Carousel/index.tsx +++ b/src/components/BasicShop/BasicComponents/Carousel/index.tsx @@ -3,6 +3,7 @@ import { Carousel } from 'zarm'; import styles from './index.less'; import { ICarouselConfig } from './schema'; import logo from '@/assets/01-轮播.png'; + const XCarousel = memo((props: ICarouselConfig) => { const { direction, swipeable, autoPlay, isTpl, imgList } = props; const contentRender = () => { diff --git a/src/components/BasicShop/BasicComponents/Form/index.less b/src/components/BasicShop/BasicComponents/Form/index.less index 6f5f33a..eee1d76 100644 --- a/src/components/BasicShop/BasicComponents/Form/index.less +++ b/src/components/BasicShop/BasicComponents/Form/index.less @@ -9,6 +9,4 @@ text-align: center; // font-size: 18px; } - .formContent { - } } diff --git a/src/components/PanelComponents/FormEditor/index.tsx b/src/components/PanelComponents/FormEditor/index.tsx index 290eb40..26c7da1 100644 --- a/src/components/PanelComponents/FormEditor/index.tsx +++ b/src/components/PanelComponents/FormEditor/index.tsx @@ -37,13 +37,10 @@ interface FormEditorProps { } const FormEditor = (props: FormEditorProps) => { - const { config, defaultValue, onSave, onDel, uid, rightPannelRef } = props; + const { config, defaultValue, onSave, uid, rightPannelRef } = props; const onFinish = (values: Store) => { onSave && onSave(values); }; - const handleDel = () => { - onDel && onDel(uid); - }; const [form] = Form.useForm(); diff --git a/src/pages/editor/SourceBox.tsx b/src/pages/editor/SourceBox.tsx index 1958418..ac2478d 100644 --- a/src/pages/editor/SourceBox.tsx +++ b/src/pages/editor/SourceBox.tsx @@ -1,17 +1,8 @@ -import React, { - FC, - memo, - useCallback, - useContext, - useEffect, - useMemo, - useState, - createRef, -} from 'react'; +import React, { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { useDrop } from 'react-dnd'; import Draggable, { DraggableData, DraggableEvent } from 'react-draggable'; import GridLayout, { ItemCallback } from 'react-grid-layout'; -import { Popover, Button, Tooltip } from 'antd'; +import { Tooltip } from 'antd'; import { connect } from 'dva'; import DynamicEngine from 'components/DynamicEngine'; import styles from './index.less'; @@ -173,24 +164,7 @@ const SourceBox = memo((props: SourceBoxProps) => { }; }, []); const opacity = isOver ? 0.7 : 1; - const handleCurrentCard: Function = useCallback( - (e: Event, status: boolean, index: number) => { - e.preventDefault(); - setIsMenu(false); - if (status) { - setIsMenu(true); - } else { - setIsMenu(false); - } - (pointData = initSelect(pointData)) && - Object.keys(pointData).map(keyId => { - (+pointData[+keyId].id === +index && (pointData[+keyId].isMenu = status)) || - (pointData[+keyId].isMenu = false); - }); - setPointData(pointData); - }, - [status, pointData], - ); + const render = useMemo(() => { if (context.theme === 'h5') { return (