wip reset animate
This commit is contained in:
		| @@ -15,7 +15,7 @@ import { | ||||
| 	Control, | ||||
| } from 'dooringx-lib'; | ||||
| import { InsertRowBelowOutlined, UploadOutlined } from '@ant-design/icons'; | ||||
| import { useContext, useState } from 'react'; | ||||
| import { useContext, useEffect, useState } from 'react'; | ||||
| import { configContext, LocaleContext } from '@/layouts'; | ||||
| import { useCallback } from 'react'; | ||||
| import { PREVIEWSTATE } from '@/constant'; | ||||
|   | ||||
| @@ -243,20 +243,22 @@ function ActionButton(props: ActionButtonProps) { | ||||
| 		<div> | ||||
| 			<Row | ||||
| 				style={{ | ||||
| 					padding: 20, | ||||
| 					padding: 10, | ||||
| 					justifyContent: 'space-between', | ||||
| 					alignItems: 'center', | ||||
| 				}} | ||||
| 			> | ||||
| 				<Col span={8}>标识ID</Col> | ||||
| 				<Col span={16}>{props.current.id}</Col> | ||||
| 				<Col span={16} style={{ textAlign: 'right' }}> | ||||
| 					{props.current.id} | ||||
| 				</Col> | ||||
| 			</Row> | ||||
| 			{currentOption.map((j, i) => { | ||||
| 				return ( | ||||
| 					<Row | ||||
| 						key={i} | ||||
| 						style={{ | ||||
| 							padding: 20, | ||||
| 							padding: 10, | ||||
| 							justifyContent: 'space-between', | ||||
| 							alignItems: 'center', | ||||
| 						}} | ||||
|   | ||||
| @@ -123,6 +123,7 @@ const timeFunction: Record<string, string> = { | ||||
|  | ||||
| let lastAnimate: AnimateItem[] = []; | ||||
| let isOmit = false; | ||||
| const padding = 10; | ||||
|  | ||||
| function AnimateControl(props: AnimateControlProps) { | ||||
| 	const store = props.config.getStore(); | ||||
| @@ -137,8 +138,8 @@ function AnimateControl(props: AnimateControlProps) { | ||||
| 		<> | ||||
| 			{animate.map((v, i) => { | ||||
| 				return ( | ||||
| 					<div key={v.uid}> | ||||
| 						<Row style={{ padding: '20px', alignItems: 'center' }}> | ||||
| 					<div key={v.uid} style={{ borderBottom: '1px dotted #9e9e9e' }}> | ||||
| 						<Row style={{ padding: padding, alignItems: 'center' }}> | ||||
| 							<Col span={5}>动画名称:</Col> | ||||
| 							<Col span={7}> | ||||
| 								<Select | ||||
| @@ -193,7 +194,7 @@ function AnimateControl(props: AnimateControlProps) { | ||||
| 								/> | ||||
| 							</Col> | ||||
| 						</Row> | ||||
| 						<Row style={{ padding: '20px', alignItems: 'center' }}> | ||||
| 						<Row style={{ padding: padding, alignItems: 'center' }}> | ||||
| 							<Col span={5}>延迟时间:</Col> | ||||
| 							<Col span={7}> | ||||
| 								<InputNumber | ||||
| @@ -248,7 +249,7 @@ function AnimateControl(props: AnimateControlProps) { | ||||
| 								</Select> | ||||
| 							</Col> | ||||
| 						</Row> | ||||
| 						<Row style={{ padding: '20px', alignItems: 'center' }}> | ||||
| 						<Row style={{ padding: padding, alignItems: 'center' }}> | ||||
| 							<Col span={5}>运动函数:</Col> | ||||
| 							<Col span={7}> | ||||
| 								<Select | ||||
| @@ -298,7 +299,7 @@ function AnimateControl(props: AnimateControlProps) { | ||||
| 				); | ||||
| 			})} | ||||
|  | ||||
| 			<Row style={{ padding: '20px', justifyContent: 'space-around' }}> | ||||
| 			<Row style={{ padding: padding, justifyContent: 'space-around' }}> | ||||
| 				{animate.length > 0 && ( | ||||
| 					<Button | ||||
| 						onClick={() => { | ||||
| @@ -325,6 +326,7 @@ function AnimateControl(props: AnimateControlProps) { | ||||
| 									store.cleanLast(); | ||||
| 									store.setData(clone); | ||||
| 									store.cleanLast(); | ||||
| 									props.config.timelineNeedleConfig.resetFunc(); | ||||
| 								}); | ||||
| 							} | ||||
| 						}} | ||||
| @@ -349,6 +351,7 @@ function AnimateControl(props: AnimateControlProps) { | ||||
| 							} | ||||
| 						}); | ||||
| 						store.setData(cloneData); | ||||
| 						props.config.timelineNeedleConfig.resetFunc(); | ||||
| 					}} | ||||
| 				> | ||||
| 					添加动画 | ||||
|   | ||||
| @@ -25,7 +25,7 @@ function MInput(props: MInputProps) { | ||||
| 	}, [props.data]); | ||||
| 	const store = props.config.getStore(); | ||||
| 	return ( | ||||
| 		<Row style={{ padding: '10px 20px' }}> | ||||
| 		<Row style={{ padding: '10px' }}> | ||||
| 			<Col span={6} style={{ lineHeight: '30px' }}> | ||||
| 				{option.label || '文字'}: | ||||
| 			</Col> | ||||
|   | ||||
| @@ -24,11 +24,11 @@ const MSwitch = (props: MSwitchProps) => { | ||||
| 	}, [props.data]); | ||||
| 	const store = props.config.getStore(); | ||||
| 	return ( | ||||
| 		<Row style={{ padding: '10px 20px' }}> | ||||
| 		<Row style={{ padding: '10px' }}> | ||||
| 			<Col span={8} style={{ lineHeight: '30px' }}> | ||||
| 				{(option as any)?.label || '文字'}: | ||||
| 			</Col> | ||||
| 			<Col span={16}> | ||||
| 			<Col span={16} style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}> | ||||
| 				<Switch | ||||
| 					checked={props.current.props[(option as any).receive] || ''} | ||||
| 					onChange={(checked) => { | ||||
|   | ||||
| @@ -26,7 +26,7 @@ const LeftRegistMap: LeftRegistComponentMapItem[] = [ | ||||
| 	{ | ||||
| 		type: 'basic', | ||||
| 		component: 'input', | ||||
| 		img: 'icon-anniu', | ||||
| 		img: 'https://img.guguzhu.com/d/file/android/ico/2021/09/08/rytzi2w34tm.png', | ||||
| 		displayName: '输入框', | ||||
| 	}, | ||||
| ]; | ||||
| @@ -59,7 +59,7 @@ export const defaultConfig: Partial<InitConfig> = { | ||||
| 		{ | ||||
| 			type: 'style', | ||||
| 			icon: ( | ||||
| 				<div className='right-tab-item' style={{ width: 50, textAlign: 'center' }}> | ||||
| 				<div className="right-tab-item" style={{ width: 50, textAlign: 'center' }}> | ||||
| 					外观 | ||||
| 				</div> | ||||
| 			), | ||||
| @@ -67,7 +67,7 @@ export const defaultConfig: Partial<InitConfig> = { | ||||
| 		{ | ||||
| 			type: 'animate', | ||||
| 			icon: ( | ||||
| 				<div className='right-tab-item' style={{ width: 50, textAlign: 'center' }}> | ||||
| 				<div className="right-tab-item" style={{ width: 50, textAlign: 'center' }}> | ||||
| 					动画 | ||||
| 				</div> | ||||
| 			), | ||||
| @@ -75,7 +75,7 @@ export const defaultConfig: Partial<InitConfig> = { | ||||
| 		{ | ||||
| 			type: 'fn', | ||||
| 			icon: ( | ||||
| 				<div className='right-tab-item' style={{ width: 50, textAlign: 'center' }}> | ||||
| 				<div className="right-tab-item" style={{ width: 50, textAlign: 'center' }}> | ||||
| 					函数 | ||||
| 				</div> | ||||
| 			), | ||||
| @@ -83,7 +83,7 @@ export const defaultConfig: Partial<InitConfig> = { | ||||
| 		{ | ||||
| 			type: 'actions', | ||||
| 			icon: ( | ||||
| 				<div className='right-tab-item' style={{ width: 50, textAlign: 'center' }}> | ||||
| 				<div className="right-tab-item" style={{ width: 50, textAlign: 'center' }}> | ||||
| 					事件 | ||||
| 				</div> | ||||
| 			), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hufeixiong
					hufeixiong