🎨 优化代码结构, 删除无用代码, console等注注释

This commit is contained in:
xujiang 2020-10-25 15:11:18 +08:00
parent 3d4c627f06
commit a918c90c14
4 changed files with 5 additions and 35 deletions

View File

@ -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 = () => {

View File

@ -9,6 +9,4 @@
text-align: center;
// font-size: 18px;
}
.formContent {
}
}

View File

@ -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();

View File

@ -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 (