This commit is contained in:
lhj
2024-11-17 17:29:03 +08:00
parent 2e1d590c89
commit 192ae66997
4 changed files with 45 additions and 27 deletions

View File

@ -137,7 +137,10 @@ onMounted(() => {
initScheme();
});
function clone(element: Record<'name' | 'id' | 'type' | 'props' | 'class' | 'text' | 'style' | 'slots' | 'visible' | 'disable' | 'children', IComponent>) {
function clone(element: Record<'name' | 'id' | 'type' | 'props' | 'class' | 'text' | 'style' | 'slots' | 'visible'
| 'disable'|'header'|'footer'|'dataSources'|'functions'|'variables'
|'orchestrations'|'events'
|'meta' | 'children'|'body'|'designer', IComponent>) {
// console.log("clone", element);
return {
id: `${element.type}-${uuid()}`,
@ -145,7 +148,6 @@ function clone(element: Record<'name' | 'id' | 'type' | 'props' | 'class' | 'tex
type: element.type,
props: element.props,
class: element.class,
designer: '',
text: element.text,
children: element.children || [],
style: element.style,
@ -154,6 +156,14 @@ function clone(element: Record<'name' | 'id' | 'type' | 'props' | 'class' | 'tex
disable: element.visible,
events: {},
loop: {},
body: element.body,
designer:element.designer||{},
dataSources:element.dataSources,
functions:element.functions,
variables:element.variables,
orchestrations:element.orchestrations,
footer:element.footer,
meta:element.meta,
};
}