feat: support copy after line

This commit is contained in:
sealday 2024-03-13 19:27:47 +08:00
parent d64ff60674
commit 72f62d359e

View File

@ -123,8 +123,15 @@ const useTableColumns = (props: { showDel?: boolean; isSubTable?: boolean }) =>
style={{ cursor: 'pointer', marginRight: '10px' }}
onClick={() => {
action(() => {
field.value = field.value || [];
field.value.push(markRecordAsNew({ ...JSON.parse(JSON.stringify(record)) }));
if (!Array.isArray(field.value)) {
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);
});
}}
/>