Commit 0276125a authored by 任建锋's avatar 任建锋

--

parent 7de225e4
......@@ -430,9 +430,9 @@ export const projectStore = {
copyNode(state, {node, parentNode, copyState}) {
let _node1 = node;
console.log(_node1)
//console.log(_node1)
copyNodeCatch = clonePureObj(_node1)
console.log("copyNodeCatch", copyNodeCatch)
//console.log("copyNodeCatch", copyNodeCatch)
if (copyState == 1) {
//复制行为
copyNodeCatch.events
......@@ -444,7 +444,7 @@ export const projectStore = {
//copy(JSON.stringify(copyNodeCatch))
function deleteChildEvent(copyNodeCatch) {
console.log(123)
//console.log(123)
delete copyNodeCatch.events;
if (copyNodeCatch.children) {
for (let item of copyNodeCatch.children) {
......@@ -459,7 +459,7 @@ export const projectStore = {
pasteNode(state, {node, parentNode, pasteState}) {
let _node1 = copyNodeCatch;
console.log(copyNodeCatch);
//console.log(copyNodeCatch);
if (_node1) {
let _node = copyBaseRoot(_node1);
setUUIDForAllChildren(_node);
......@@ -807,6 +807,8 @@ export const projectStore = {
activeComponent({state, commit}, data) {
// debugger;
resetScrollType(data.data)
let getTopView = node => {
// console.log("node",node)
if (node.parent && !node.parent.parent) {
......@@ -837,6 +839,7 @@ export const projectStore = {
commit('activeComponent', data.data);
},
/**
* 修改属性
*/
......@@ -853,12 +856,12 @@ export const projectStore = {
_props[key] = value;
});
console.log("props",commit,state,props,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)
//console.log("nodeUUidCatch",nodeUUidCatch)
/*if (hasAssetsDep) {
commit('updateAssetDep');
......@@ -1066,6 +1069,21 @@ function setUUIDForAllChildren(node) {
}
}
//重置编辑视图数据为实际视图数据
function resetScrollType(data) {
if(data.type=="editScrollList"){
data.type="scrollList"
}
if(data.type=="editScrollView"){
data.type="scrollView"
}
if(data.children){
for(let itme of data.children){
resetScrollType(itme)
}
}
}
let copyNodeCatch = null;
function copyBaseRoot(node) {
......
......@@ -85,6 +85,9 @@
computed: {
...mapGetters(['activeComponent', 'activeComponentCopy', 'componentList']),
propsMeta() {
this.resetScrollType(this.activeComponent)
console.log(this.activeComponent.type)
return getCmpProps(this.activeComponent.type);
},
customCmdKeys() {
......@@ -109,6 +112,20 @@
}
},
methods: {
//重置编辑视图数据为实际视图数据
resetScrollType(data) {
if(data.type=="editScrollList"){
data.type="scrollList"
}
if(data.type=="editScrollView"){
data.type="scrollView"
}
if(data.children){
for(let itme of data.children){
this.resetScrollType(itme)
}
}
},
propsUpdate(val){
// console.log("propsUpdate",val)
this.makeProjectDirty()
......
......@@ -126,14 +126,42 @@
this.$refs.tree.setCurrentKey(node.uuid);
this.expandedKeys = [node.uuid];
},
//重置编辑视图数据为实际视图数据
resetScrollType(data) {
if(data.type=="editScrollList"){
data.type="scrollList"
}
if(data.type=="editScrollView"){
data.type="scrollView"
}
if(data.children){
for(let itme of data.children){
this.resetScrollType(itme)
}
}
//console.log("1122334")
},
locateViewNodeActive(node) {
if(this.$refs.tree){
console.log("选中")
//console.log("选中")
this.$refs.tree.setCurrentKey(node.uuid);
this.expandedKeys = [node.uuid];
let data=this.$refs.tree.getCurrentNode()
let nodeDom=this.$refs.tree.getNode(data)
//this.resetScrollType(this.activeComponent)
this.resetScrollType(data)
this.resetScrollType(nodeDom.data)
// if(data.type=="editScrollList"){
// data.type="scrollList"
// nodeDom.data.type="scrollList"
// }
// if(data.type=="editScrollView"){
// data.type="scrollView"
// nodeDom.data.type="scrollView"
// }
//console.log(data,nodeDom)
this.$store.dispatch('activeComponent', {data, node:nodeDom});
let styleCatch={
......@@ -252,8 +280,13 @@
* 点击左侧视图列表
*/
handleNodeClick(data, node) {
console.log('handleNodeClick',data,node);
console.log(this.getCurrentPath(node))
this.resetScrollType(data)
this.resetScrollType(node.data)
// console.log('handleNodeClick',data,node);
// console.log(this.getCurrentPath(node))
this.$store.dispatch('activeComponent', {data, node});
events.$emit('canvasActiveNodeByTree', this.getCurrentPath(node));
......@@ -282,6 +315,7 @@
}
}
path.shift();
//console.log(path.join("/"))
return path.join("/");
},
toAddView() {
......
......@@ -13,7 +13,7 @@
/>
<!-- <div class="touch-layer"></div> -->
</div>
<edit-control-view :targetNode="targetNode" :activeComponent="activeComponent"></edit-control-view>
<edit-control-view :targetNode="targetNode"></edit-control-view>
</div>
</div>
</template>
......@@ -58,10 +58,28 @@
RuntimeLayer,EditControlView},
methods: {
moveEdit(e,type){
events.$emit('setMoveEdit', {e,type});
let _type =type;
// console.log("_type",_type)
events.$emit('setMoveEdit', {e,_type});
},
//重置编辑视图数据为实际视图数据
resetScrollType(data) {
if(data.type=="editScrollList"){
data.type="scrollList"
}
if(data.type=="editScrollView"){
data.type="scrollView"
}
if(data.children){
for(let itme of data.children){
this.resetScrollType(itme)
}
}
},
onRuntimeLayerLaunched() {
events.$emit("viewReset")
// events.$emit("viewReset")
},
onSelectNode(nodePath) {
if (!nodePath) {
......@@ -77,7 +95,7 @@
getNode(type) {
if(type=="end"){
this.targetNode = this.$refs.runtimeLayer.getNode(this.nodePath);
console.log("this.targetNode",this.targetNode)
//console.log("this.targetNode",this.targetNode)
setTimeout(()=>{
this.targetNode = this.$refs.runtimeLayer.getNode(this.nodePath);
events.$emit('locate-view-node-active', this.targetNode);
......@@ -87,13 +105,13 @@
}
},
onModifyProp(key,value,type) {
console.log("修改 key v")
//console.log("修改 key v")
if(key=="source"||key=="autoPlay"){
events.$emit("viewReset")
}
if(key=="width"||key=="height"){
console.error("修改长宽")
}
// if(key=="width"||key=="height"){
// console.error("修改长宽")
// }
if(this.$refs.runtimeLayer){
this.$refs.runtimeLayer.modifyProps(this.nodePath, {
[key]: value,
......@@ -124,7 +142,7 @@
}
},
canvasViewUpdate(){
this.$refs.runtimeLayer.showView(this.views[0]);
this.$refs.runtimeLayer&&this.$refs.runtimeLayer.showView(this.views[0]);
}
,canvasActiveNodeByTree(nodePath){
this.nodePath=nodePath
......@@ -166,7 +184,7 @@
events.$on("viewReset",()=>{
this.$refs.runtimeLayer.showView(this.views[0]);
this.$refs.runtimeLayer&&this.$refs.runtimeLayer.showView(this.views[0]);
})
},
watch: {
......
......@@ -132,11 +132,11 @@ export default {
this.changeMoveOffsetY1=e.y;
this.changeMoveOffsetX=this.changeMoveOffsetX1-this.changeMoveOffsetX2
this.changeMoveOffsetY=this.changeMoveOffsetY1-this.changeMoveOffsetY2
console.log( "this.changeMoveOffsetX",)
//console.log( "this.changeMoveOffsetX",)
this.changeMoveOffsetX2=e.x;
this.changeMoveOffsetY2=e.y;
console.log(this.changeMoveOffsetX)
// console.log(this.changeMoveOffsetX)
this.modifyCopyPropertiesCon();
}
......@@ -300,6 +300,10 @@ export default {
this.moveEdit(e,`mousemove`)
})
events.$on("viewReset",()=>{
//this.canFouce=false
})
//this.styleCatch=JSON.parse(JSON.stringify(this.targetNode));
......@@ -332,7 +336,7 @@ export default {
},
computed: {
position() {
console.log("位置更新")
// console.log("位置更新")
let result = {};
result.x = this.styleCatch.x;
result.y = this.styleCatch.y;
......@@ -344,7 +348,7 @@ export default {
}
let {rotation,scaleX,scaleY,x,y}=this.matrixToGroup(this.styleCatch.worldMatrix)
console.log("测试矩阵",this.matrixToGroup(this.styleCatch.worldMatrix))
// console.log("测试矩阵",this.matrixToGroup(this.styleCatch.worldMatrix))
if(this.styleCatch.instanceType=="Sprite"&&!this.styleCatch.source){
scaleX=1;
......@@ -395,7 +399,7 @@ export default {
},
watch: {
views: function(newVal) {
console.log(newVal);
// console.log(newVal);
},
"activeComponent.properties":{
handler (newVal) {
......
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