Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-editor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-editor
Commits
0276125a
Commit
0276125a
authored
May 27, 2020
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
7de225e4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
25 deletions
+116
-25
project.js
src/store/modules/project.js
+24
-6
PropsTab.vue
src/views/Editor/Inspector/PropsTab.vue
+17
-0
Views.vue
src/views/Editor/Views.vue
+37
-3
drawCanvasPanel.vue
src/views/Editor/components/drawCanvasPanel.vue
+29
-11
editControlView.vue
src/views/Editor/components/editControlView.vue
+9
-5
No files found.
src/store/modules/project.js
View file @
0276125a
...
...
@@ -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
);
...
...
@@ -806,6 +806,8 @@ export const projectStore = {
*/
activeComponent
({
state
,
commit
},
data
)
{
// debugger;
resetScrollType
(
data
.
data
)
let
getTopView
=
node
=>
{
// console.log("node",node)
...
...
@@ -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
)
{
...
...
src/views/Editor/Inspector/PropsTab.vue
View file @
0276125a
...
...
@@ -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
()
...
...
src/views/Editor/Views.vue
View file @
0276125a
...
...
@@ -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
()
{
...
...
src/views/Editor/components/drawCanvasPanel.vue
View file @
0276125a
...
...
@@ -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,8 +184,8 @@
events
.
$on
(
"viewReset"
,()
=>
{
this
.
$refs
.
runtimeLayer
.
showView
(
this
.
views
[
0
]);
})
this
.
$refs
.
runtimeLayer
&&
this
.
$refs
.
runtimeLayer
.
showView
(
this
.
views
[
0
]);
})
},
watch
:
{
nodePath
()
{
...
...
src/views/Editor/components/editControlView.vue
View file @
0276125a
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment