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
d15af854
Commit
d15af854
authored
May 25, 2020
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
d9bba829
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
70 deletions
+95
-70
index.html
public/index.html
+2
-1
project.js
src/store/modules/project.js
+11
-0
properties.js
src/utils/properties.js
+5
-0
RuntimeLayer.vue
src/views/Editor/components/RuntimeLayer.vue
+1
-1
drawCanvasPanel.vue
src/views/Editor/components/drawCanvasPanel.vue
+70
-66
editControlView.vue
src/views/Editor/components/editControlView.vue
+6
-2
No files found.
public/index.html
View file @
d15af854
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
<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.c70c23ccac5955f9f2cd400fda1e6bba2fb413a3.js"
></script>
<script
src=
"http://127.0.0.1:8081/debug/engine.js"
></script>
<script
src=
"http://127.0.0.1:8083/debug/engine-svga.js"
></script>
</head>
</head>
<body>
<body>
...
...
src/store/modules/project.js
View file @
d15af854
...
@@ -144,6 +144,7 @@ export const projectStore = {
...
@@ -144,6 +144,7 @@ export const projectStore = {
this
.
dispatch
(
'fillLastVersion'
);
this
.
dispatch
(
'fillLastVersion'
);
this
.
commit
(
'updateAssetDep'
);
this
.
commit
(
'updateAssetDep'
);
state
.
mockServeEnabled
=
getMockServeEnabled
(
id
);
state
.
mockServeEnabled
=
getMockServeEnabled
(
id
);
updateMock
(
localData
.
mock
);
updateMock
(
localData
.
mock
);
},
},
...
@@ -398,14 +399,20 @@ export const projectStore = {
...
@@ -398,14 +399,20 @@ export const projectStore = {
}
else
{
}
else
{
state
.
data
.
views
.
push
(
child
);
state
.
data
.
views
.
push
(
child
);
}
}
events
.
$emit
(
"viewReset"
)
},
},
importView
(
state
,
view
)
{
importView
(
state
,
view
)
{
state
.
data
.
views
.
push
(
view
);
state
.
data
.
views
.
push
(
view
);
events
.
$emit
(
"viewReset"
)
},
},
deleteNode
(
state
,
{
node
,
parentNode
})
{
deleteNode
(
state
,
{
node
,
parentNode
})
{
const
parentChildren
=
parentNode
.
children
||
parentNode
;
const
parentChildren
=
parentNode
.
children
||
parentNode
;
const
index
=
parentChildren
.
indexOf
(
node
);
const
index
=
parentChildren
.
indexOf
(
node
);
parentChildren
.
splice
(
index
,
1
);
parentChildren
.
splice
(
index
,
1
);
events
.
$emit
(
"viewReset"
)
},
},
copyNode
(
state
,
{
node
,
parentNode
,
copyState
})
{
copyNode
(
state
,
{
node
,
parentNode
,
copyState
})
{
...
@@ -432,6 +439,8 @@ export const projectStore = {
...
@@ -432,6 +439,8 @@ export const projectStore = {
}
}
}
}
}
}
events
.
$emit
(
"viewReset"
)
},
},
...
@@ -457,6 +466,8 @@ export const projectStore = {
...
@@ -457,6 +466,8 @@ export const projectStore = {
}
else
{
}
else
{
console
.
warn
(
"请先选择一个节点进行复制"
)
console
.
warn
(
"请先选择一个节点进行复制"
)
}
}
events
.
$emit
(
"viewReset"
)
},
},
importAssets
(
state
,
assets
)
{
importAssets
(
state
,
assets
)
{
state
.
data
.
assets
.
push
(...
assets
);
state
.
data
.
assets
.
push
(...
assets
);
...
...
src/utils/properties.js
View file @
d15af854
...
@@ -309,6 +309,11 @@ export default {
...
@@ -309,6 +309,11 @@ export default {
type
:
'boolean'
,
type
:
'boolean'
,
default
:
false
default
:
false
},
},
mouseChildren
:
{
alias
:
'子集交互'
,
type
:
'boolean'
,
default
:
false
},
}
}
},
},
shape
:
{
shape
:
{
...
...
src/views/Editor/components/RuntimeLayer.vue
View file @
d15af854
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
entrySceneView
:
'entry'
,
entrySceneView
:
'entry'
,
editorMode
:
true
,
editorMode
:
true
,
assetResolver
:
this
.
assetResolver
,
assetResolver
:
this
.
assetResolver
,
frameRate
:
1
0
,
frameRate
:
3
0
,
},
},
},
null
,
()
=>
{
},
null
,
()
=>
{
this
.
onLaunched
();
this
.
onLaunched
();
...
...
src/views/Editor/components/drawCanvasPanel.vue
View file @
d15af854
...
@@ -60,10 +60,7 @@
...
@@ -60,10 +60,7 @@
events
.
$emit
(
'setMoveEdit'
,
{
e
,
type
});
events
.
$emit
(
'setMoveEdit'
,
{
e
,
type
});
},
},
onRuntimeLayerLaunched
()
{
onRuntimeLayerLaunched
()
{
console
.
log
(
this
.
views
[
0
])
events
.
$emit
(
"viewReset"
)
console
.
log
(
this
.
project
)
// this.$refs.runtimeLayer.showView(viewConfig);
this
.
$refs
.
runtimeLayer
.
showView
(
this
.
views
[
0
]);
},
},
onSelectNode
(
nodePath
)
{
onSelectNode
(
nodePath
)
{
if
(
!
nodePath
)
{
if
(
!
nodePath
)
{
...
@@ -89,6 +86,9 @@
...
@@ -89,6 +86,9 @@
},
},
onModifyProp
(
key
,
value
,
type
)
{
onModifyProp
(
key
,
value
,
type
)
{
console
.
log
(
"修改 key v"
)
console
.
log
(
"修改 key v"
)
if
(
key
==
"source"
||
key
==
"autoPlay"
){
events
.
$emit
(
"viewReset"
)
}
if
(
this
.
$refs
.
runtimeLayer
){
if
(
this
.
$refs
.
runtimeLayer
){
this
.
$refs
.
runtimeLayer
.
modifyProps
(
this
.
nodePath
,
{
this
.
$refs
.
runtimeLayer
.
modifyProps
(
this
.
nodePath
,
{
[
key
]:
value
,
[
key
]:
value
,
...
@@ -102,7 +102,8 @@
...
@@ -102,7 +102,8 @@
if
(
!
this
.
autoSelectState
){
if
(
!
this
.
autoSelectState
){
return
false
;
return
false
;
}
}
console
.
log
(
"sdsd"
,
x
/
this
.
zoom
,
y
/
this
.
zoom
)
console
.
log
(
"sdsd"
,{
x
:
x
/
this
.
zoom
,
y
:
y
/
this
.
zoom
})
console
.
log
(
"sdsd"
,
x
,
y
)
// 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
});
...
@@ -152,6 +153,9 @@
...
@@ -152,6 +153,9 @@
events
.
$on
(
'autoSelectState'
,
(
data
)
=>
{
events
.
$on
(
'autoSelectState'
,
(
data
)
=>
{
this
.
autoSelectState
=
data
this
.
autoSelectState
=
data
});
});
events
.
$on
(
"viewReset"
,()
=>
{
this
.
$refs
.
runtimeLayer
.
showView
(
this
.
views
[
0
]);})
},
},
watch
:
{
watch
:
{
nodePath
()
{
nodePath
()
{
...
...
src/views/Editor/components/editControlView.vue
View file @
d15af854
...
@@ -67,9 +67,13 @@ export default {
...
@@ -67,9 +67,13 @@ export default {
if
(
!
this
.
canFouce
){
if
(
!
this
.
canFouce
){
return
false
;
return
false
;
}
}
// console.log(e,this.$refs.zeroPlayground.getBoundingClientRect())
// console.log(e.offsetX,this.$refs.zeroPlayground.getBoundingClientRect())
// console.log(e.pageX,this.$refs.zeroPlayground.getBoundingClientRect())
// console.log(e.pageX-(this.$refs.zeroPlayground.getBoundingClientRect().left/this.zoom))
events
.
$emit
(
"onClickTouchLayer"
,{
events
.
$emit
(
"onClickTouchLayer"
,{
x
:
e
.
pageX
-
this
.
$refs
.
zeroPlayground
.
getBoundingClientRect
().
left
/
2
,
x
:
e
.
pageX
-
this
.
$refs
.
zeroPlayground
.
getBoundingClientRect
().
left
/
this
.
zoom
,
y
:
e
.
pageY
-
this
.
$refs
.
zeroPlayground
.
getBoundingClientRect
().
top
/
2
y
:
e
.
pageY
-
this
.
$refs
.
zeroPlayground
.
getBoundingClientRect
().
top
/
this
.
zoom
});
});
},
},
matrixToGroup
(
matrix
)
{
matrixToGroup
(
matrix
)
{
...
...
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