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

--

parent 7b484780
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<title>烽火台</title> <title>烽火台</title>
<script src="//yun.duiba.com.cn/js-libs/psd.js/3.2.0/psd.min.js"></script> <script src="//yun.duiba.com.cn/js-libs/psd.js/3.2.0/psd.min.js"></script>
<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.a0a1c11664d9ed4ac76999a01ceb9a729e1b27c1.js"></script> <script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.c70c23ccac5955f9f2cd400fda1e6bba2fb413a3.js"></script>
</head> </head>
<body> <body>
......
...@@ -771,7 +771,7 @@ export const projectStore = { ...@@ -771,7 +771,7 @@ export const projectStore = {
// debugger; // debugger;
let getTopView = node => { let getTopView = node => {
console.log("node",node) // console.log("node",node)
if (node.parent && !node.parent.parent) { if (node.parent && !node.parent.parent) {
return node; return node;
} else { } else {
...@@ -816,12 +816,13 @@ export const projectStore = { ...@@ -816,12 +816,13 @@ export const projectStore = {
_props[key] = value; _props[key] = value;
}); });
console.log("props",props,state.activeComponent) console.log("props",commit,state,props,state.activeComponent)
// if(nodeUUidCatch==state.activeComponent.uuid){ if(nodeUUidCatch==state.activeComponent.uuid){
events.$emit('canvasKeyVupdate', {props,activeComponent:state.activeComponent}); events.$emit('canvasKeyVupdate', {props},"update");
// } }
nodeUUidCatch=state.activeComponent.uuid nodeUUidCatch=state.activeComponent.uuid
console.log("nodeUUidCatch",nodeUUidCatch) console.log("nodeUUidCatch",nodeUUidCatch)
/*if (hasAssetsDep) { /*if (hasAssetsDep) {
commit('updateAssetDep'); commit('updateAssetDep');
}*/ }*/
......
...@@ -131,6 +131,18 @@ ...@@ -131,6 +131,18 @@
let data=this.$refs.tree.getCurrentNode() let data=this.$refs.tree.getCurrentNode()
let nodeDom=this.$refs.tree.getNode(data) let nodeDom=this.$refs.tree.getNode(data)
this.$store.dispatch('activeComponent', {data, node:nodeDom}); this.$store.dispatch('activeComponent', {data, node:nodeDom});
let styleCatch={
x:parseInt(node.x),
y:parseInt(node.y),
anchorX:parseInt(node.anchorX),
anchorY:parseInt(node.anchorY),
imageWidth:parseInt(node.imageWidth),
imageHeight:parseInt(node.imageHeight),
width:parseInt(node.width),
height:parseInt(node.height),
}
this.$store.dispatch("modifyProperties", styleCatch);
} }
}, },
updateFilter() { updateFilter() {
......
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
modifyProps(nodePath, props, callback) { modifyProps(nodePath, props, callback) {
let result = engine.editorStage.modifyProps(nodePath, props); let result = engine.editorStage.modifyProps(nodePath, props);
if (result) { if (result) {
//callback() callback()
setTimeout(callback, 100); //setTimeout(callback, 0);
} }
return result; return result;
}, },
......
...@@ -78,31 +78,24 @@ ...@@ -78,31 +78,24 @@
console.log(url) console.log(url)
return url return url
}, },
getNode() { getNode(type) {
this.targetNode = this.$refs.runtimeLayer.getNode(this.nodePath); if(type=="end"){
console.log(this.targetNode.name,this.targetNode) this.targetNode = this.$refs.runtimeLayer.getNode(this.nodePath);
events.$emit('locate-view-node-active', this.targetNode); console.log("this.targetNode",this.targetNode)
events.$emit('locate-view-node-active', this.targetNode);
}else if(type=="update"){
this.targetNode = this.$refs.runtimeLayer.getNode(this.nodePath);
}
}, },
onModifyProp(key,value,data) { onModifyProp(key,value,type) {
console.log("修改 key v")
let activeComponent=data.activeComponent
console.log("activeComponent",activeComponent)
// if(activeComponent){
// return false;
// }
// if(activeComponent.uuid==this.targetNode.uuid){
console.log("修改 key v")
if(this.$refs.runtimeLayer){ if(this.$refs.runtimeLayer){
this.$refs.runtimeLayer.modifyProps(this.nodePath, { this.$refs.runtimeLayer.modifyProps(this.nodePath, {
[key]: value, [key]: value,
}, () => { }, () => {
this.getNode(); this.getNode(type);
}) })
} }
// }
// console.log(data.activeComponent.name,this.targetNode.name,this.nodePath)
}, },
onClickTouchLayer(e){ onClickTouchLayer(e){
const {x,y} = e; const {x,y} = e;
...@@ -110,19 +103,22 @@ ...@@ -110,19 +103,22 @@
return false; return false;
} }
console.log("sdsd",x/this.zoom,y/this.zoom) console.log("sdsd",x/this.zoom,y/this.zoom)
setTimeout(()=>{ // setTimeout(()=>{
if(this.$refs.runtimeLayer){ if(this.$refs.runtimeLayer){
this.nodePath = this.$refs.runtimeLayer.getNodePathWithPos({x:x/this.zoom, y:y/this.zoom}); this.nodePath = this.$refs.runtimeLayer.getNodePathWithPos({x:x/this.zoom, y:y/this.zoom});
} }
},100) // },100)
console.log(this.nodePath) console.log(this.nodePath)
}, },
canvasKeyVupdate(data){ canvasKeyVupdate(data,type){
console.log(10,data) console.log(10,data)
let _data=data; let _data=data;
for(let item in _data.props){ for(let item in _data.props){
console.log(item) console.log(item)
this.onModifyProp(item, _data.props[item],_data) if(_data.props.hasOwnProperty(item)){
console.log(_data.props[item])
this.onModifyProp(item, _data.props[item],type)
}
} }
}, },
canvasViewUpdate(){ canvasViewUpdate(){
...@@ -131,7 +127,7 @@ ...@@ -131,7 +127,7 @@
} }
,canvasActiveNodeByTree(nodePath){ ,canvasActiveNodeByTree(nodePath){
this.nodePath=nodePath this.nodePath=nodePath
this.getNode() this.getNode("end")
} }
}, },
computed: { computed: {
...@@ -159,7 +155,7 @@ ...@@ -159,7 +155,7 @@
}, },
watch: { watch: {
nodePath() { nodePath() {
this.getNode(); this.getNode("end");
}, },
views() { views() {
this.$refs.runtimeLayer.showView(this.views[0]); this.$refs.runtimeLayer.showView(this.views[0]);
......
This diff is collapsed.
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