Commit 8fc7ba69 authored by 任建锋's avatar 任建锋

--

parent 420f7c0b
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
"Alert": "Alert", "Alert": "Alert",
"Confirm": "Confirm", "Confirm": "Confirm",
"Cancel": "Cancel", "Cancel": "Cancel",
"Yes":"Yes",
"No":"No",
"Close": "Close", "Close": "Close",
"Still Close": "Still Close", "Still Close": "Still Close",
"Save": "Save", "Save": "Save",
...@@ -116,6 +118,7 @@ ...@@ -116,6 +118,7 @@
"Duplicate project success": "Duplicate project success", "Duplicate project success": "Duplicate project success",
"Project name cannot be empty": "Project name cannot be empty", "Project name cannot be empty": "Project name cannot be empty",
"This action will permanently delete project": "This action will permanently delete project[{projectName}], continue?", "This action will permanently delete project": "This action will permanently delete project[{projectName}], continue?",
"Do you copy the behavior of this node": "Do you copy the behavior of this node?",
"Fetching projects": "Fetching projects…", "Fetching projects": "Fetching projects…",
"Failed to fetch env": "Failed to fetch env", "Failed to fetch env": "Failed to fetch env",
"Failed to fetch projects": "Failed to fetch projects", "Failed to fetch projects": "Failed to fetch projects",
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
"Alert": "提示", "Alert": "提示",
"Confirm": "确认", "Confirm": "确认",
"Cancel": "取消", "Cancel": "取消",
"Yes":"是",
"No":"否",
"Close": "关闭", "Close": "关闭",
"Refresh": "刷新", "Refresh": "刷新",
"Still Close": "直接关闭", "Still Close": "直接关闭",
...@@ -136,6 +138,7 @@ ...@@ -136,6 +138,7 @@
"Duplicate project success": "项目复制成功", "Duplicate project success": "项目复制成功",
"Project name cannot be empty": "项目名不能为空", "Project name cannot be empty": "项目名不能为空",
"This action will permanently delete project": "您将删除项目[{projectName}], 是否继续?", "This action will permanently delete project": "您将删除项目[{projectName}], 是否继续?",
"Do you copy the behavior of this node": "是否复制行为?",
"Fetching projects": "获取项目列表…", "Fetching projects": "获取项目列表…",
"Failed to fetch env": "获取环境失败", "Failed to fetch env": "获取环境失败",
"Failed to fetch projects": "获取项目列表失败", "Failed to fetch projects": "获取项目列表失败",
......
...@@ -378,9 +378,35 @@ export const projectStore = { ...@@ -378,9 +378,35 @@ export const projectStore = {
}, },
copyNode(state, {node, parentNode}) { copyNode(state, {node, parentNode,copyState}) {
let _node1 = node; let _node1 = node;
copyNodeCatch = _node1; console.log(_node1)
copyNodeCatch =clonePureObj(_node1)
if(copyState==1){
//复制行为
copyNodeCatch.events
}else if(copyState==2){
//不复制行为
copyNodeCatch.events=null
}
//重置uuid
let keys = Object.getOwnPropertyNames(copyNodeCatch.events)
for( let key of keys){
console.log("key",key)
console.log(copyNodeCatch.events[key])
console.log(copyNodeCatch.events[key].behaviors)
if(copyNodeCatch.events[key].behaviors){
for( let behavior of copyNodeCatch.events[key].behaviors){
// behavior.uuid=generateUUID()
// behavior.meta=generateUUID()
}
}
}
console.log(copyNodeCatch)
//localStorage.copyNodeCatch=_node1; //localStorage.copyNodeCatch=_node1;
// let _node=copyBaseRoot(_node1); // let _node=copyBaseRoot(_node1);
// setUUIDForAllChildren(_node) // setUUIDForAllChildren(_node)
......
...@@ -265,10 +265,30 @@ ...@@ -265,10 +265,30 @@
}); });
break; break;
case 'copy': case 'copy':
this.copyNode({
node: data, this.$confirm(this.$t('Do you copy the behavior of this node'), this.$t('Alert'), {
parentNode: node.parent.data confirmButtonText: this.$t('Yes'),
}); cancelButtonText: this.$t('No'),
type: 'warning'
}).then(
() => {
//copyState:1复制行为,2不复制行为
this.copyNode({
node: data,
parentNode: node.parent.data,
copyState:1
});
},
() => {
//copyState:1复制行为,2不复制行为
this.copyNode({
node: data,
parentNode: node.parent.data,
copyState:2
});
}
)
break; break;
case 'paste': case 'paste':
this.pasteNode({ this.pasteNode({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment