From 2429b00c5ceb7aa087ca4e028c0a5544e9ad5d55 Mon Sep 17 00:00:00 2001 From: yehuozhili <673632758@qq.com> Date: Fri, 1 Apr 2022 14:34:10 +0800 Subject: [PATCH] complete custom animate --- .../plugin/formComponents/animateControl.tsx | 153 +++++++++++------- .../dooringx-lib/src/components/preview.tsx | 11 +- .../src/components/timeLine/timeline.tsx | 10 +- .../src/core/AnimateFactory/index.ts | 82 ++++++---- 4 files changed, 166 insertions(+), 90 deletions(-) diff --git a/packages/dooringx-example/src/plugin/formComponents/animateControl.tsx b/packages/dooringx-example/src/plugin/formComponents/animateControl.tsx index 5912079..fb65572 100644 --- a/packages/dooringx-example/src/plugin/formComponents/animateControl.tsx +++ b/packages/dooringx-example/src/plugin/formComponents/animateControl.tsx @@ -1,6 +1,18 @@ import React, { useMemo, useState } from 'react'; import { UserConfig, deepCopy, createUid } from 'dooringx-lib'; -import { Col, Row, Select, InputNumber, Button, Modal, Form, Space, Input } from 'antd'; +import { + Col, + Row, + Select, + InputNumber, + Button, + Modal, + Form, + Space, + Input, + Table, + Popconfirm, +} from 'antd'; import { FormMap, FormBaseType } from '../formTypes'; import { CreateOptionsRes } from 'dooringx-lib/dist/core/components/formTypes'; import { AnimateItem, IBlockType, IStoreData } from 'dooringx-lib/dist/core/store/storetype'; @@ -138,7 +150,46 @@ function AnimateControl(props: AnimateControlProps) { const [customModal, setCustomModal] = useState(false); const [form] = Form.useForm(); - const [positionEnable, setPositionEnable] = useState([]); + + const [deletModal, setDeletModal] = useState(false); + const customAnimate = props.config.animateFactory.getCustomAnimateName(); + + const columns = [ + { + title: '动画名称', + dataIndex: 'animateName', + width: 150, + }, + { + title: '显示名称', + dataIndex: 'displayName', + width: 150, + }, + { + title: '动画详情', + dataIndex: 'keyframe', + }, + { + title: '操作', + width: 120, + render: (_: any, record: any) => ( + + { + const name = record.animateName; + props.config.animateFactory.deleteCustomAnimate(name); + props.config.animateFactory.deleteKeyFrameAnimate(name); + props.config.animateFactory.syncToStore(props.config); + }} + title="确定删除吗?" + > + 删除 + + + ), + }, + ]; + return ( <>