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

--

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