feat: support copy after line
This commit is contained in:
parent
d64ff60674
commit
72f62d359e
@ -123,8 +123,15 @@ const useTableColumns = (props: { showDel?: boolean; isSubTable?: boolean }) =>
|
|||||||
style={{ cursor: 'pointer', marginRight: '10px' }}
|
style={{ cursor: 'pointer', marginRight: '10px' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
action(() => {
|
action(() => {
|
||||||
field.value = field.value || [];
|
if (!Array.isArray(field.value)) {
|
||||||
field.value.push(markRecordAsNew({ ...JSON.parse(JSON.stringify(record)) }));
|
field.value = [];
|
||||||
|
}
|
||||||
|
spliceArrayState(field as any, {
|
||||||
|
startIndex: index + 1,
|
||||||
|
insertCount: 1,
|
||||||
|
});
|
||||||
|
field.value.splice(index + 1, 0, markRecordAsNew(_.cloneDeep(record)));
|
||||||
|
return field.onInput(field.value);
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user