Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-editor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-editor
Commits
fe222d42
Commit
fe222d42
authored
Dec 04, 2019
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加复制节点功能
parent
c0c6b795
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
index.js
src/store/index.js
+1
-0
project.js
src/store/modules/project.js
+21
-0
Views.vue
src/views/Editor/Views.vue
+8
-1
No files found.
src/store/index.js
View file @
fe222d42
...
@@ -32,6 +32,7 @@ export default new Vuex.Store({
...
@@ -32,6 +32,7 @@ export default new Vuex.Store({
'modifyProject'
,
'modifyProject'
,
'addNode'
,
'addNode'
,
'deleteNode'
,
'deleteNode'
,
'copyNode'
,
'addAsset'
,
'addAsset'
,
'deleteAsset'
,
'deleteAsset'
,
'deleteAllAssets'
,
'deleteAllAssets'
,
...
...
src/store/modules/project.js
View file @
fe222d42
...
@@ -280,6 +280,27 @@ export const projectStore = {
...
@@ -280,6 +280,27 @@ export const projectStore = {
const
index
=
parentChildren
.
indexOf
(
node
);
const
index
=
parentChildren
.
indexOf
(
node
);
parentChildren
.
splice
(
index
,
1
);
parentChildren
.
splice
(
index
,
1
);
},
},
copyNode
(
state
,
{
node
,
parentNode
})
{
// const parentChildren = parentNode.children || parentNode;
// const index = parentChildren.indexOf(node);
//parentNode.children.push(node);
// parentChildren.push(parentChildren[index]);
const
child
=
{
name
:
node
.
name
,
type
:
node
.
type
,
properties
:
node
.
properties
,
events
:
node
.
events
,
uuid
:
generateUUID
(),
};
if
(
parentNode
)
{
if
(
!
parentNode
.
children
)
{
Vue
.
set
(
parentNode
,
'children'
,
[]);
}
parentNode
.
children
.
push
(
child
);
}
else
{
state
.
data
.
views
.
push
(
child
);
}
},
importAssets
(
state
,
assets
)
{
importAssets
(
state
,
assets
)
{
state
.
data
.
assets
.
push
(...
assets
);
state
.
data
.
assets
.
push
(...
assets
);
},
},
...
...
src/views/Editor/Views.vue
View file @
fe222d42
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
<el-link
icon=
"el-icon-more"
:underline=
"false"
@
click
.
stop
/>
<el-link
icon=
"el-icon-more"
:underline=
"false"
@
click
.
stop
/>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"delete"
>
{{
$t
(
'Delete'
)
}}
</el-dropdown-item>
<el-dropdown-item
command=
"delete"
>
{{
$t
(
'Delete'
)
}}
</el-dropdown-item>
<el-dropdown-item
command=
"copy"
>
{{
$t
(
'Copy'
)
}}
</el-dropdown-item>
<el-dropdown-item
command=
"export"
divided
v-if=
"!node.parent.parent"
>
{{
$t
(
'Export'
)
}}
<el-dropdown-item
command=
"export"
divided
v-if=
"!node.parent.parent"
>
{{
$t
(
'Export'
)
}}
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
v-for=
"(type, key, index) in $t('view_node_menu')"
<el-dropdown-item
v-for=
"(type, key, index) in $t('view_node_menu')"
...
@@ -140,6 +141,12 @@
...
@@ -140,6 +141,12 @@
parentNode
:
node
.
parent
.
data
parentNode
:
node
.
parent
.
data
});
});
break
;
break
;
case
'copy'
:
this
.
copyNode
({
node
:
data
,
parentNode
:
node
.
parent
.
data
});
break
;
case
'export'
:
case
'export'
:
this
.
exportView
(
data
);
this
.
exportView
(
data
);
break
;
break
;
...
@@ -155,7 +162,7 @@
...
@@ -155,7 +162,7 @@
break
;
break
;
}
}
},
},
...
mapMutations
([
'deleteNode'
,
'addNode'
]),
...
mapMutations
([
'
copyNode'
,
'
deleteNode'
,
'addNode'
]),
...
mapActions
([
'exportView'
,
'importView'
])
...
mapActions
([
'exportView'
,
'importView'
])
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment