Commit bc3ffc80 authored by 任建锋's avatar 任建锋

添加粘贴选项

parent ecdac185
...@@ -20,6 +20,7 @@ import {fetchApi} from "../../api/common" ...@@ -20,6 +20,7 @@ import {fetchApi} from "../../api/common"
import {toZeroing} from "psd-parse-web" import {toZeroing} from "psd-parse-web"
import {arrayFind} from "element-ui/src/utils/util"; import {arrayFind} from "element-ui/src/utils/util";
const storeName = 'project'; const storeName = 'project';
const psStoreName = 'pack-history'; const psStoreName = 'pack-history';
...@@ -387,38 +388,11 @@ export const projectStore = { ...@@ -387,38 +388,11 @@ export const projectStore = {
copyNodeCatch.events copyNodeCatch.events
}else if(copyState==2){ }else if(copyState==2){
//不复制行为 //不复制行为
copyNodeCatch.events=null delete copyNodeCatch.events
}
//重置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()
}
}
} }
//copy(JSON.stringify(copyNodeCatch))
console.log(copyNodeCatch)
//localStorage.copyNodeCatch=_node1;
// let _node=copyBaseRoot(_node1);
// setUUIDForAllChildren(_node)
// if (parentNode) {
// if (!parentNode.children) {
// Vue.set(parentNode, 'children', []);
// }
// parentNode.children.push(_node);
// } else {
// state.data.views.push(_node);
// }
}, },
pasteNode(state, {node, parentNode, pasteState}) { pasteNode(state, {node, parentNode, pasteState}) {
let _node1 = copyNodeCatch; let _node1 = copyNodeCatch;
console.log(copyNodeCatch); console.log(copyNodeCatch);
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
@node-drop="onNodeDrop" @node-drop="onNodeDrop"
> >
<div slot-scope="{ node, data }" class="tree-node"> <div slot-scope="{ node, data }" class="tree-node">
<div class="node-name"> <div class="node-name" >
{{data.name}} {{data.name}}
</div> </div>
...@@ -282,6 +282,7 @@ ...@@ -282,6 +282,7 @@
parentNode: node.parent.data, parentNode: node.parent.data,
copyState:1 copyState:1
}); });
}, },
() => { () => {
//copyState:1复制行为,2不复制行为 //copyState:1复制行为,2不复制行为
......
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