mirror of
https://github.com/MrXujiang/h5-Dooring.git
synced 2026-01-07 04:08:10 +00:00
🐛 修复表单组件key值重复bug
This commit is contained in:
parent
ee08a2333f
commit
33619e75e0
@ -4,6 +4,7 @@ import EditorModal from './EditorModal';
|
||||
import { EditOutlined, MinusCircleOutlined } from '@ant-design/icons';
|
||||
import styles from './formItems.less';
|
||||
import { baseFormUnion, TFormItemsDefaultType } from '../FormEditor/types';
|
||||
import { uuid } from '@/utils/tool';
|
||||
|
||||
// import { Popconfirm } from 'antd';
|
||||
|
||||
@ -67,7 +68,7 @@ const FormItems = (props: FormItemsProps) => {
|
||||
|
||||
const handleAddItem = (item: baseFormUnion) => {
|
||||
let tpl = formTpl.find(v => v.type === item.type);
|
||||
let newData = [...formData, tpl!];
|
||||
let newData = [...formData, { ...tpl!, id: uuid(6, 10) }];
|
||||
setFormData(newData);
|
||||
onChange && onChange(newData);
|
||||
};
|
||||
|
||||
@ -26,6 +26,12 @@ body {
|
||||
border-color: #2F54EB !important;
|
||||
}
|
||||
|
||||
.ant-btn-link[disabled], .ant-btn-link[disabled]:active, .ant-btn-link[disabled]:focus, .ant-btn-link[disabled]:hover {
|
||||
color: rgba(0,0,0,.25) !important;
|
||||
background: transparent !important;
|
||||
border-color: transparent !important;
|
||||
}
|
||||
|
||||
@import '~react-grid-layout/css/styles.css';
|
||||
@import '~react-resizable/css/styles.css';
|
||||
@import '~zarm/dist/zarm.min.css';
|
||||
|
||||
@ -124,8 +124,7 @@ const Container = props => {
|
||||
message={
|
||||
<TextLoop mask>
|
||||
<div>Dooring升级啦!</div>
|
||||
<div>Dooring添加自动保存功能</div>
|
||||
<div>已有500+人使用</div>
|
||||
<div>已有1000+人使用</div>
|
||||
<div>持续迭代中...</div>
|
||||
</TextLoop>
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import { connect } from 'dva';
|
||||
import DynamicEngine from 'components/DynamicEngine';
|
||||
import styles from './index.less';
|
||||
import { uuid } from '@/utils/tool';
|
||||
|
||||
const SourceBox = memo(props => {
|
||||
const { pstate, scaleNum, canvasId, allType, dispatch } = props;
|
||||
|
||||
@ -123,7 +124,7 @@ const SourceBox = memo(props => {
|
||||
className={styles.layout}
|
||||
cols={24}
|
||||
rowHeight={2}
|
||||
width={canvasRect[0]}
|
||||
width={canvasRect[0] || 0}
|
||||
margin={[0, 0]}
|
||||
onDragStop={dragStop}
|
||||
onDragStart={onDragStart}
|
||||
|
||||
@ -193,13 +193,7 @@ const HeaderComponent = memo(props => {
|
||||
>
|
||||
<UndoOutlined />
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
style={{ marginRight: '9px' }}
|
||||
title="重做"
|
||||
onClick={redohandler}
|
||||
disabled={!pointData.length}
|
||||
>
|
||||
<Button type="link" style={{ marginRight: '9px' }} title="重做" onClick={redohandler}>
|
||||
<RedoOutlined />
|
||||
</Button>
|
||||
<Button type="link" onClick={toPreview} disabled={!pointData.length}>
|
||||
|
||||
@ -4,9 +4,6 @@ import DynamicEngine from 'components/DynamicEngine';
|
||||
import req from '@/utils/req';
|
||||
import styles from './index.less';
|
||||
|
||||
// 可视化组件类型
|
||||
// const componentTypes = ['Column', 'Pie']
|
||||
|
||||
const isMac = navigator.platform.indexOf('Mac') === 0;
|
||||
|
||||
const pcStyle = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user