mirror of
https://github.com/MrXujiang/h5-Dooring.git
synced 2025-12-13 11:02:52 +00:00
🎨 优化代码结构, 删除无用代码, console等注注释
This commit is contained in:
parent
3d4c627f06
commit
a918c90c14
@ -3,6 +3,7 @@ import { Carousel } from 'zarm';
|
|||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
import { ICarouselConfig } from './schema';
|
import { ICarouselConfig } from './schema';
|
||||||
import logo from '@/assets/01-轮播.png';
|
import logo from '@/assets/01-轮播.png';
|
||||||
|
|
||||||
const XCarousel = memo((props: ICarouselConfig) => {
|
const XCarousel = memo((props: ICarouselConfig) => {
|
||||||
const { direction, swipeable, autoPlay, isTpl, imgList } = props;
|
const { direction, swipeable, autoPlay, isTpl, imgList } = props;
|
||||||
const contentRender = () => {
|
const contentRender = () => {
|
||||||
|
|||||||
@ -9,6 +9,4 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
// font-size: 18px;
|
// font-size: 18px;
|
||||||
}
|
}
|
||||||
.formContent {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,13 +37,10 @@ interface FormEditorProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const FormEditor = (props: FormEditorProps) => {
|
const FormEditor = (props: FormEditorProps) => {
|
||||||
const { config, defaultValue, onSave, onDel, uid, rightPannelRef } = props;
|
const { config, defaultValue, onSave, uid, rightPannelRef } = props;
|
||||||
const onFinish = (values: Store) => {
|
const onFinish = (values: Store) => {
|
||||||
onSave && onSave(values);
|
onSave && onSave(values);
|
||||||
};
|
};
|
||||||
const handleDel = () => {
|
|
||||||
onDel && onDel(uid);
|
|
||||||
};
|
|
||||||
|
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
|||||||
@ -1,17 +1,8 @@
|
|||||||
import React, {
|
import React, { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
||||||
FC,
|
|
||||||
memo,
|
|
||||||
useCallback,
|
|
||||||
useContext,
|
|
||||||
useEffect,
|
|
||||||
useMemo,
|
|
||||||
useState,
|
|
||||||
createRef,
|
|
||||||
} from 'react';
|
|
||||||
import { useDrop } from 'react-dnd';
|
import { useDrop } from 'react-dnd';
|
||||||
import Draggable, { DraggableData, DraggableEvent } from 'react-draggable';
|
import Draggable, { DraggableData, DraggableEvent } from 'react-draggable';
|
||||||
import GridLayout, { ItemCallback } from 'react-grid-layout';
|
import GridLayout, { ItemCallback } from 'react-grid-layout';
|
||||||
import { Popover, Button, Tooltip } from 'antd';
|
import { Tooltip } from 'antd';
|
||||||
import { connect } from 'dva';
|
import { connect } from 'dva';
|
||||||
import DynamicEngine from 'components/DynamicEngine';
|
import DynamicEngine from 'components/DynamicEngine';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
@ -173,24 +164,7 @@ const SourceBox = memo((props: SourceBoxProps) => {
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
const opacity = isOver ? 0.7 : 1;
|
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(() => {
|
const render = useMemo(() => {
|
||||||
if (context.theme === 'h5') {
|
if (context.theme === 'h5') {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user