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
07ecf566
Commit
07ecf566
authored
Nov 14, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善打包逻辑
parent
211b6208
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
176 additions
and
77 deletions
+176
-77
info-.json
mock/api/editor/info-.json
+0
-0
index.js
mock/api/editor/info/index.js
+65
-14
data-.json
mock/api/project/query/data-.json
+1
-1
data.json
mock/api/project/query/data.json
+0
-12
index.js
mock/api/project/query/data/index.js
+2
-0
project.js
src/api/project.js
+8
-0
config.js
src/config.js
+1
-1
en.json
src/locales/en.json
+13
-1
env.js
src/store/modules/env.js
+1
-1
project.js
src/store/modules/project.js
+41
-32
events.js
src/utils/events.js
+1
-1
Editor.vue
src/views/Editor.vue
+29
-1
BehaviorTab.vue
src/views/Editor/Inspector/BehaviorTab.vue
+2
-2
BehaviorEditorDialog.vue
src/views/Editor/dialogs/BehaviorEditorDialog.vue
+1
-0
ProjectDetailsDialog.vue
src/views/Editor/dialogs/ProjectDetailsDialog.vue
+11
-11
No files found.
mock/api/editor/info.json
→
mock/api/editor/info
-
.json
View file @
07ecf566
File moved
mock/api/editor/info/index.js
View file @
07ecf566
...
...
@@ -8,7 +8,7 @@ const data = {
custom
:
[]
},
processes
:
[
{
JSON
.
stringify
(
{
id
:
'entry'
,
name
:
'Entry'
,
desc
:
'入口'
,
...
...
@@ -16,8 +16,8 @@ const data = {
type
:
'builtin'
,
props
:
{},
output
:
[
'success'
],
},
{
}
)
,
JSON
.
stringify
(
{
id
:
'wait'
,
name
:
'Wait'
,
desc
:
'等待执行'
,
...
...
@@ -27,8 +27,8 @@ const data = {
duration
:
{
type
:
'number'
,
default
:
1000
},
},
output
:
[
'complete'
],
},
{
}
)
,
JSON
.
stringify
(
{
id
:
'hehe'
,
name
:
'Hehe'
,
desc
:
'呵呵'
,
...
...
@@ -52,8 +52,8 @@ const data = {
},
},
}
},
{
}
)
,
JSON
.
stringify
(
{
id
:
'prefab1'
,
name
:
'Prefab1'
,
desc
:
'转盘预设'
,
...
...
@@ -78,10 +78,10 @@ const data = {
},
},
}
},
}
)
,
],
scripts
:
[
{
JSON
.
stringify
(
{
id
:
'wave'
,
name
:
'Wave'
,
props
:
{
...
...
@@ -91,15 +91,63 @@ const data = {
type
:
{
type
:
[
'rotate'
,
'jump'
,
'breath'
],
default
:
'rotate'
},
ease
:
{
type
:
[
'linear'
,
'cubic'
,
'back'
],
default
:
'linear'
},
autoPlay
:
{
type
:
'boolean'
,
default
:
false
},
}
},
{
},
script
:
`"use strict";
exports.__esModule = true;
var Wave = (function () {
function Wave() {
}
Wave.prototype.mounted = function () {
console.log('mounted', this.duration);
this.host.anchorX = this.host.width / 2;
this.host.anchorY = this.host.height / 2;
};
Wave.prototype.destroy = function () {
console.log('destroy');
};
Wave.prototype.update = function (t) {
this.host.rotation = t * 0.1;
};
Wave.prototype.awake = function () {
console.log('awake');
};
Wave.prototype.sleep = function () {
console.log('sleep');
};
Wave.id = 'wave';
return Wave;
}());
exports["default"] = Wave;`
}),
JSON
.
stringify
({
id
:
'zoom-button'
,
name
:
'ZoomButton'
,
props
:
{
zoomTo
:
{
type
:
'number'
,
default
:
1.1
},
}
},
},
script
:
`"use strict";
exports.__esModule = true;
var ZoomButton = (function () {
function ZoomButton() {
this.zoomTo = 1.1;
}
ZoomButton.prototype.mounted = function () {
this.host.anchorX = this.host.width / 2;
this.host.anchorY = this.host.height / 2;
this.host.addEventListener(engine.MouseEvent.MOUSE_DOWN, this._onMouseDown, this);
this.host.addEventListener(engine.MouseEvent.MOUSE_UP, this._onMouseUp, this);
};
ZoomButton.prototype._onMouseDown = function (e) {
this.host.scaleX = this.host.scaleY = this.zoomTo;
};
ZoomButton.prototype._onMouseUp = function (e) {
this.host.scaleX = this.host.scaleY = 1;
};
ZoomButton.id = 'zoom-button';
return ZoomButton;
}());
exports["default"] = ZoomButton;`
}),
]
},
};
...
...
@@ -107,3 +155,6 @@ const data = {
module
.
exports
=
function
()
{
return
data
;
};
//console.log(JSON.stringify(data));
//console.log(data.data.scripts[1]);
mock/api/project/query/data-.json
View file @
07ecf566
...
...
@@ -7,6 +7,6 @@
"operator"
:
"卞龙亭"
,
"create_time"
:
"2019-09-19T06:56:01.000Z"
,
"update_time"
:
"2019-09-19T06:56:01.000Z"
,
"data"
:
"{
\"
views
\"
:[{
\"
name
\"
:
\"
view1
\"
,
\"
type
\"
:
\"
node
\"
,
\"
properties
\"
:{},
\"
uuid
\"
:
\"
3a357816-5581-41ba-aa6f-4a6cc40ae396
\"
,
\"
children
\"
:[{
\"
name
\"
:
\"
rect
\"
,
\"
type
\"
:
\"
rect
\"
,
\"
properties
\"
:{
\"
width
\"
:50,
\"
height
\"
:50,
\"
fillColor
\"
:
\"
rgba(105, 182, 255, 1)
\"
,
\"
strokeWidth
\"
:0,
\"
x
\"
:10,
\"
y
\"
:10},
\"
events
\"
:{
\"
click
\"
:{
\"
once
\"
:false,
\"
behaviors
\"
:[{
\"
uuid
\"
:
\"
aa1
\"
,
\"
alias
\"
:
\"
主过程
\"
,
\"
meta
\"
:
\"
main
\"
}]}},
\"
scripts
\"
:[{
\"
script
\"
:
\"
wave
\"
,
\"
props
\"
:{
\"
duration
\"
:500,
\"
autoPlay
\"
:true,
\"
type
\"
:
\"
cubicIn
\"
}}],
\"
uuid
\"
:
\"
f97bbf76-6923-4669-b5a3-e6382753e49a
\"
}]}],
\"
assets
\"
:[],
\"
dataMapping
\"
:[],
\"
processMap
\"
:{
\"
main
\"
:{
\"
id
\"
:
\"
main
\"
,
\"
name
\"
:
\"
Main
\"
,
\"
props
\"
:{},
\"
subEntry
\"
:
\"
1
\"
,
\"
sub
\"
:{
\"
a1
\"
:{
\"
uuid
\"
:
\"
a1
\"
,
\"
alias
\"
:
\"
入口
\"
,
\"
meta
\"
:
\"
entry
\"
,
\"
output
\"
:{
\"
success
\"
:[
\"
a2
\"
]},
\"
design
\"
:{
\"
x
\"
:10,
\"
y
\"
:10}},
\"
a2
\"
:{
\"
uuid
\"
:
\"
a2
\"
,
\"
alias
\"
:
\"
test
\"
,
\"
meta
\"
:
\"
test
\"
,
\"
props
\"
:{
\"
text
\"
:
\"
hello
\"
},
\"
output
\"
:{
\"
success
\"
:[],
\"
failed
\"
:[]},
\"
design
\"
:{
\"
x
\"
:20,
\"
y
\"
:100}}}},
\"
test
\"
:{
\"
id
\"
:
\"
test
\"
,
\"
name
\"
:
\"
Test
\"
,
\"
props
\"
:{
\"
text
\"
:{
\"
type
\"
:
\"
string
\"
,
\"
default
\"
:
\"\"
}},
\"
output
\"
:[
\"
success
\"
,
\"
failed
\"
]}}
}"
"data"
:
"{
\"
views
\"
:[{
\"
name
\"
:
\"
view1
\"
,
\"
type
\"
:
\"
node
\"
,
\"
properties
\"
:{},
\"
uuid
\"
:
\"
3a357816-5581-41ba-aa6f-4a6cc40ae396
\"
,
\"
children
\"
:[{
\"
name
\"
:
\"
rect
\"
,
\"
type
\"
:
\"
rect
\"
,
\"
properties
\"
:{
\"
width
\"
:50,
\"
height
\"
:50,
\"
fillColor
\"
:
\"
rgba(105, 182, 255, 1)
\"
,
\"
strokeWidth
\"
:0,
\"
x
\"
:10,
\"
y
\"
:10},
\"
uuid
\"
:
\"
f97bbf76-6923-4669-b5a3-e6382753e49a
\"
,
\"
events
\"
:{
\"
click
\"
:{
\"
once
\"
:false,
\"
behaviors
\"
:[{
\"
uuid
\"
:
\"
aa1
\"
,
\"
alias
\"
:
\"
主过程
\"
,
\"
meta
\"
:
\"
main
\"
}]}},
\"
scripts
\"
:[{
\"
script
\"
:
\"
wave
\"
,
\"
props
\"
:{
\"
duration
\"
:500,
\"
autoPlay
\"
:true,
\"
type
\"
:
\"
cubicIn
\"
}}]}]}],
\"
assets
\"
:[{
\"
name
\"
:
\"
face
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/58323a0469a7467c99b34f8933ea65b507a0c655.png
\"
,
\"
uuid
\"
:
\"
3e496939-5fe6-42f2-b8fa-42c7a742e880
\"
},{
\"
name
\"
:
\"
还以是bug
\"
,
\"
ext
\"
:
\"
.jpg
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/094832ace87c94bdb9e4a7821b3a3ebca0df2cd7.jpg
\"
,
\"
uuid
\"
:
\"
ec67a8a0-8708-43a4-888e-efb0fe7c2bd6
\"
},{
\"
name
\"
:
\"
嘿嘿
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/1ad10a4cf3488ef1400af1d6f353d9c577fe1049.gif
\"
,
\"
uuid
\"
:
\"
429803eb-0f68-4071-b68c-468980883ac4
\"
},{
\"
name
\"
:
\"
1643017
\"
,
\"
ext
\"
:
\"
.jpg
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/2e4adf3d8646ffbd027038cb2c6627a6bca44e44.jpg
\"
,
\"
uuid
\"
:
\"
cc1ad757-ff4c-4cb9-b629-be355119d018
\"
},{
\"
name
\"
:
\"
0
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/616a413facbd406b81daac809a52bd0b648a7f4c.gif
\"
,
\"
uuid
\"
:
\"
0a5f2064-f5b4-41a9-8a54-2085e208d20f
\"
},{
\"
name
\"
:
\"
3
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/e052cb4a88d63330c37ecaf55ae8e7eb2246c433.gif
\"
,
\"
uuid
\"
:
\"
e4dacdd2-064f-413e-a8f0-6425ce6dcf12
\"
},{
\"
name
\"
:
\"
5
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/881193ea1bd975c8a59f38f2d1f0d0094db6ec7a.gif
\"
,
\"
uuid
\"
:
\"
bf822d51-a1b1-4ab6-8f49-a821863731d0
\"
},{
\"
name
\"
:
\"
4
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/2df4a5c5238f86704388517d2ba0faa6782fea1e.gif
\"
,
\"
uuid
\"
:
\"
9c1d46b4-d2f1-4733-8b93-39b2bb4db9d1
\"
},{
\"
name
\"
:
\"
1
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/0bc24c7bb68e3691bad89c8ae096b253af874a73.gif
\"
,
\"
uuid
\"
:
\"
db076340-e1db-4e2d-8bb2-7cc32ccdee43
\"
},{
\"
name
\"
:
\"
7
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/3e218541244d1ed1192274ad49ea70588b6cd0dc.gif
\"
,
\"
uuid
\"
:
\"
02aa47c3-dbdf-43d2-8cdc-869cab544bcc
\"
},{
\"
name
\"
:
\"
2
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/1e1344fabf25cf2ea6f1407cd42afc1f1de0bb07.gif
\"
,
\"
uuid
\"
:
\"
264f7a8d-475e-4fd0-ac83-96e13a7702f3
\"
},{
\"
name
\"
:
\"
8
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/90080b186e0507b70f64c2020880dd1ddd3b7cd8.gif
\"
,
\"
uuid
\"
:
\"
ec63930b-8aff-4108-9ceb-ddf9353d4412
\"
},{
\"
name
\"
:
\"
0
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/616a413facbd406b81daac809a52bd0b648a7f4c.gif
\"
,
\"
uuid
\"
:
\"
7c475d4d-0ae2-4b9a-81ff-76fb8264721f
\"
},{
\"
name
\"
:
\"
9
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/f41b70c1003ff703386a5a80ed7092db5fdc11f4.gif
\"
,
\"
uuid
\"
:
\"
473b82ec-c9b9-43d7-b2e5-b5399a55d239
\"
},{
\"
name
\"
:
\"
12
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/99660ca0a9a578cd6c5eb38b1f35aee9a77849b3.gif
\"
,
\"
uuid
\"
:
\"
84f549d3-9bb1-4066-9668-3705e94b5891
\"
},{
\"
name
\"
:
\"
11
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/f88c5de6bb6ab80f24cc56978e92cedf4af201f0.gif
\"
,
\"
uuid
\"
:
\"
a4470420-60bd-4578-a2dc-100663ba6256
\"
},{
\"
name
\"
:
\"
13
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/c5c446eba840899d364bcdb010a2aea8d2ae02ab.gif
\"
,
\"
uuid
\"
:
\"
7383d2db-43dd-408a-aa69-261bd39865ac
\"
},{
\"
name
\"
:
\"
6
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/881193ea1bd975c8a59f38f2d1f0d0094db6ec7a.gif
\"
,
\"
uuid
\"
:
\"
894a28f8-a814-4c8c-a5d9-619194b3073d
\"
},{
\"
name
\"
:
\"
btn-join
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/e50e0fe70f4b2c96d2deee1d93a0a2444732be6a.png
\"
,
\"
uuid
\"
:
\"
e3301bc4-7b51-4868-a613-26298f87988b
\"
},{
\"
name
\"
:
\"
bg
\"
,
\"
ext
\"
:
\"
.jpg
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/7dbe10dba2a92d830f0f9ff72f3d82e07a4c4649.jpg
\"
,
\"
uuid
\"
:
\"
bab58ec1-24b1-4d5d-9c95-7014b9915cb3
\"
},{
\"
name
\"
:
\"
1643017
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
54f7916f-dc10-49f7-b3b1-0bda9d4f5bcd
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/4090d0acf7dbf29cd6ab0690795e0b00b715280c.png
\"
},{
\"
name
\"
:
\"
bg
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
5fe14ca0-5b86-405e-98a6-54ca733f2180
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/070159098034ae2cd8c8e4bf4f47b1d45b87024a.png
\"
},{
\"
name
\"
:
\"
rule_button
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
82a9d493-078a-4b7c-8352-616abc99f24a
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/d0c3ed2bf9abc5748c01eb88abb7e0830669b1c5.png
\"
},{
\"
name
\"
:
\"
wheel_items
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
b899e2f0-36da-42dc-a9ac-c8f4093e4457
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/897ee802eb89999c2019c683c084f4b7e2d7f554.png
\"
},{
\"
name
\"
:
\"
wheel_bg
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
8f531f60-b48e-4a7a-bd7a-9488a3c3dd2d
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/479cbb31bfdaee48893bf34f7d0c8fc702b1459a.png
\"
},{
\"
name
\"
:
\"
start_bg
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
62fe5f9b-47ec-4c1e-b508-f566501caa72
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/3191ba684512b9e9391ab4a9d2a2df31cad4825d.png
\"
},{
\"
name
\"
:
\"
0
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
562af6d0-6b73-4de8-bed0-ed3a4507962c
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/be2fa0d9e91b58d9aafcd18f7934784742069cb6.png
\"
},{
\"
name
\"
:
\"
1
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
6cf1bc08-bcc8-4cec-88d8-3e979b35dd0f
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/3f64f753e272d17a1f5807ddf1a8965a0e2de9d5.png
\"
},{
\"
name
\"
:
\"
0
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
378851d3-6664-4b0e-8407-342f4ffaf334
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/3c292a9c6c5b1a3dab684e95d1f7b7cb4f369a8a.png
\"
},{
\"
name
\"
:
\"
1
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
dee35c49-db44-4722-a412-a8b7123d20b7
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/b22420f2322326359e2b3e1dae66dc7e34ce6978.png
\"
},{
\"
name
\"
:
\"
bg
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
2b0cc6bd-fc10-43ee-a217-aaf1c40a0ad3
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/93fbb49529a3b4617f4cdc41dba7c297989baa5e.png
\"
}],
\"
dataMapping
\"
:[],
\"
processes
\"
:[{
\"
id
\"
:
\"
main
\"
,
\"
name
\"
:
\"
Main
\"
,
\"
props
\"
:{},
\"
subEntry
\"
:
\"
a1
\"
,
\"
sub
\"
:{
\"
a1
\"
:{
\"
uuid
\"
:
\"
a1
\"
,
\"
alias
\"
:
\"
入口
\"
,
\"
meta
\"
:
\"
entry
\"
,
\"
output
\"
:{
\"
success
\"
:[
\"
a2
\"
]},
\"
design
\"
:{
\"
x
\"
:10,
\"
y
\"
:10}},
\"
a2
\"
:{
\"
uuid
\"
:
\"
a2
\"
,
\"
alias
\"
:
\"
test
\"
,
\"
meta
\"
:
\"
test
\"
,
\"
props
\"
:{
\"
text
\"
:
\"
$_linked_$
\"
},
\"
output
\"
:{
\"
success
\"
:[],
\"
failed
\"
:[]},
\"
design
\"
:{
\"
x
\"
:20,
\"
y
\"
:100}}}},{
\"
id
\"
:
\"
test
\"
,
\"
name
\"
:
\"
Test
\"
,
\"
desc
\"
:
\"
测试过程
\"
,
\"
props
\"
:{
\"
text
\"
:{
\"
alias
\"
:
\"
文本
\"
,
\"
type
\"
:
\"
string
\"
,
\"
default
\"
:
\"
你好
\"
},
\"
num
\"
:{
\"
alias
\"
:
\"
数字
\"
,
\"
type
\"
:
\"
number
\"
,
\"
default
\"
:1},
\"
type
\"
:{
\"
alias
\"
:
\"
类型
\"
,
\"
type
\"
:
\"
enum
\"
,
\"
enum
\"
:[
\"
rotate
\"
,
\"
jump
\"
,
\"
breath
\"
],
\"
default
\"
:
\"
rotate
\"
},
\"
autoPlay
\"
:{
\"
alias
\"
:
\"
自动播放
\"
,
\"
type
\"
:
\"
boolean
\"
,
\"
default
\"
:false},
\"
color
\"
:{
\"
alias
\"
:
\"
颜色
\"
,
\"
type
\"
:
\"
color
\"
,
\"
default
\"
:
\"
#123456
\"
},
\"
asset
\"
:{
\"
alias
\"
:
\"
素材
\"
,
\"
type
\"
:
\"
asset
\"
},
\"
node
\"
:{
\"
alias
\"
:
\"
节点
\"
,
\"
type
\"
:
\"
node
\"
}},
\"
output
\"
:[
\"
success
\"
,
\"
failed
\"
],
\"
script
\"
:
\"
console.log('test');
\"
}]
}"
}
}
\ No newline at end of file
mock/api/project/query/data.json
deleted
100644 → 0
View file @
211b6208
{
"success"
:
true
,
"data"
:
{
"id"
:
"6566c4a3f237"
,
"name"
:
"测试"
,
"creator"
:
"卞龙亭"
,
"operator"
:
"卞龙亭"
,
"create_time"
:
"2019-09-19T06:56:01.000Z"
,
"update_time"
:
"2019-09-19T06:56:01.000Z"
,
"data"
:
"{
\"
views
\"
:[{
\"
name
\"
:
\"
view1
\"
,
\"
type
\"
:
\"
node
\"
,
\"
properties
\"
:{},
\"
uuid
\"
:
\"
3a357816-5581-41ba-aa6f-4a6cc40ae396
\"
,
\"
children
\"
:[{
\"
name
\"
:
\"
rect
\"
,
\"
type
\"
:
\"
rect
\"
,
\"
properties
\"
:{
\"
width
\"
:50,
\"
height
\"
:50,
\"
fillColor
\"
:
\"
rgba(105, 182, 255, 1)
\"
,
\"
strokeWidth
\"
:0,
\"
x
\"
:10,
\"
y
\"
:10},
\"
uuid
\"
:
\"
f97bbf76-6923-4669-b5a3-e6382753e49a
\"
,
\"
events
\"
:{
\"
click
\"
:{
\"
once
\"
:false,
\"
behaviors
\"
:[{
\"
uuid
\"
:
\"
aa1
\"
,
\"
alias
\"
:
\"
主过程
\"
,
\"
meta
\"
:
\"
main
\"
}]}},
\"
scripts
\"
:[{
\"
script
\"
:
\"
wave
\"
,
\"
props
\"
:{
\"
duration
\"
:500,
\"
autoPlay
\"
:true,
\"
type
\"
:
\"
cubicIn
\"
}}]}]}],
\"
assets
\"
:[{
\"
name
\"
:
\"
face
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/58323a0469a7467c99b34f8933ea65b507a0c655.png
\"
,
\"
uuid
\"
:
\"
3e496939-5fe6-42f2-b8fa-42c7a742e880
\"
},{
\"
name
\"
:
\"
还以是bug
\"
,
\"
ext
\"
:
\"
.jpg
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/094832ace87c94bdb9e4a7821b3a3ebca0df2cd7.jpg
\"
,
\"
uuid
\"
:
\"
ec67a8a0-8708-43a4-888e-efb0fe7c2bd6
\"
},{
\"
name
\"
:
\"
嘿嘿
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/1ad10a4cf3488ef1400af1d6f353d9c577fe1049.gif
\"
,
\"
uuid
\"
:
\"
429803eb-0f68-4071-b68c-468980883ac4
\"
},{
\"
name
\"
:
\"
1643017
\"
,
\"
ext
\"
:
\"
.jpg
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/2e4adf3d8646ffbd027038cb2c6627a6bca44e44.jpg
\"
,
\"
uuid
\"
:
\"
cc1ad757-ff4c-4cb9-b629-be355119d018
\"
},{
\"
name
\"
:
\"
0
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/616a413facbd406b81daac809a52bd0b648a7f4c.gif
\"
,
\"
uuid
\"
:
\"
0a5f2064-f5b4-41a9-8a54-2085e208d20f
\"
},{
\"
name
\"
:
\"
3
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/e052cb4a88d63330c37ecaf55ae8e7eb2246c433.gif
\"
,
\"
uuid
\"
:
\"
e4dacdd2-064f-413e-a8f0-6425ce6dcf12
\"
},{
\"
name
\"
:
\"
5
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/881193ea1bd975c8a59f38f2d1f0d0094db6ec7a.gif
\"
,
\"
uuid
\"
:
\"
bf822d51-a1b1-4ab6-8f49-a821863731d0
\"
},{
\"
name
\"
:
\"
4
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/2df4a5c5238f86704388517d2ba0faa6782fea1e.gif
\"
,
\"
uuid
\"
:
\"
9c1d46b4-d2f1-4733-8b93-39b2bb4db9d1
\"
},{
\"
name
\"
:
\"
1
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/0bc24c7bb68e3691bad89c8ae096b253af874a73.gif
\"
,
\"
uuid
\"
:
\"
db076340-e1db-4e2d-8bb2-7cc32ccdee43
\"
},{
\"
name
\"
:
\"
7
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/3e218541244d1ed1192274ad49ea70588b6cd0dc.gif
\"
,
\"
uuid
\"
:
\"
02aa47c3-dbdf-43d2-8cdc-869cab544bcc
\"
},{
\"
name
\"
:
\"
2
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/1e1344fabf25cf2ea6f1407cd42afc1f1de0bb07.gif
\"
,
\"
uuid
\"
:
\"
264f7a8d-475e-4fd0-ac83-96e13a7702f3
\"
},{
\"
name
\"
:
\"
8
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/90080b186e0507b70f64c2020880dd1ddd3b7cd8.gif
\"
,
\"
uuid
\"
:
\"
ec63930b-8aff-4108-9ceb-ddf9353d4412
\"
},{
\"
name
\"
:
\"
0
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/616a413facbd406b81daac809a52bd0b648a7f4c.gif
\"
,
\"
uuid
\"
:
\"
7c475d4d-0ae2-4b9a-81ff-76fb8264721f
\"
},{
\"
name
\"
:
\"
9
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/f41b70c1003ff703386a5a80ed7092db5fdc11f4.gif
\"
,
\"
uuid
\"
:
\"
473b82ec-c9b9-43d7-b2e5-b5399a55d239
\"
},{
\"
name
\"
:
\"
12
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/99660ca0a9a578cd6c5eb38b1f35aee9a77849b3.gif
\"
,
\"
uuid
\"
:
\"
84f549d3-9bb1-4066-9668-3705e94b5891
\"
},{
\"
name
\"
:
\"
11
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/f88c5de6bb6ab80f24cc56978e92cedf4af201f0.gif
\"
,
\"
uuid
\"
:
\"
a4470420-60bd-4578-a2dc-100663ba6256
\"
},{
\"
name
\"
:
\"
13
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/c5c446eba840899d364bcdb010a2aea8d2ae02ab.gif
\"
,
\"
uuid
\"
:
\"
7383d2db-43dd-408a-aa69-261bd39865ac
\"
},{
\"
name
\"
:
\"
6
\"
,
\"
ext
\"
:
\"
.gif
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/881193ea1bd975c8a59f38f2d1f0d0094db6ec7a.gif
\"
,
\"
uuid
\"
:
\"
894a28f8-a814-4c8c-a5d9-619194b3073d
\"
},{
\"
name
\"
:
\"
btn-join
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/e50e0fe70f4b2c96d2deee1d93a0a2444732be6a.png
\"
,
\"
uuid
\"
:
\"
e3301bc4-7b51-4868-a613-26298f87988b
\"
},{
\"
name
\"
:
\"
bg
\"
,
\"
ext
\"
:
\"
.jpg
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/7dbe10dba2a92d830f0f9ff72f3d82e07a4c4649.jpg
\"
,
\"
uuid
\"
:
\"
bab58ec1-24b1-4d5d-9c95-7014b9915cb3
\"
},{
\"
name
\"
:
\"
1643017
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
54f7916f-dc10-49f7-b3b1-0bda9d4f5bcd
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/4090d0acf7dbf29cd6ab0690795e0b00b715280c.png
\"
},{
\"
name
\"
:
\"
bg
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
5fe14ca0-5b86-405e-98a6-54ca733f2180
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/070159098034ae2cd8c8e4bf4f47b1d45b87024a.png
\"
},{
\"
name
\"
:
\"
rule_button
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
82a9d493-078a-4b7c-8352-616abc99f24a
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/d0c3ed2bf9abc5748c01eb88abb7e0830669b1c5.png
\"
},{
\"
name
\"
:
\"
wheel_items
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
b899e2f0-36da-42dc-a9ac-c8f4093e4457
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/897ee802eb89999c2019c683c084f4b7e2d7f554.png
\"
},{
\"
name
\"
:
\"
wheel_bg
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
8f531f60-b48e-4a7a-bd7a-9488a3c3dd2d
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/479cbb31bfdaee48893bf34f7d0c8fc702b1459a.png
\"
},{
\"
name
\"
:
\"
start_bg
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
62fe5f9b-47ec-4c1e-b508-f566501caa72
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/3191ba684512b9e9391ab4a9d2a2df31cad4825d.png
\"
},{
\"
name
\"
:
\"
0
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
562af6d0-6b73-4de8-bed0-ed3a4507962c
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/be2fa0d9e91b58d9aafcd18f7934784742069cb6.png
\"
},{
\"
name
\"
:
\"
1
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
6cf1bc08-bcc8-4cec-88d8-3e979b35dd0f
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/3f64f753e272d17a1f5807ddf1a8965a0e2de9d5.png
\"
},{
\"
name
\"
:
\"
0
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
378851d3-6664-4b0e-8407-342f4ffaf334
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/3c292a9c6c5b1a3dab684e95d1f7b7cb4f369a8a.png
\"
},{
\"
name
\"
:
\"
1
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
dee35c49-db44-4722-a412-a8b7123d20b7
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/b22420f2322326359e2b3e1dae66dc7e34ce6978.png
\"
},{
\"
name
\"
:
\"
bg
\"
,
\"
ext
\"
:
\"
.png
\"
,
\"
uuid
\"
:
\"
2b0cc6bd-fc10-43ee-a217-aaf1c40a0ad3
\"
,
\"
url
\"
:
\"
//yun.duiba.com.cn/aurora/93fbb49529a3b4617f4cdc41dba7c297989baa5e.png
\"
}],
\"
dataMapping
\"
:[],
\"
processes
\"
:[{
\"
id
\"
:
\"
main
\"
,
\"
name
\"
:
\"
Main
\"
,
\"
props
\"
:{},
\"
subEntry
\"
:
\"
a1
\"
,
\"
sub
\"
:{
\"
a1
\"
:{
\"
uuid
\"
:
\"
a1
\"
,
\"
alias
\"
:
\"
入口
\"
,
\"
meta
\"
:
\"
entry
\"
,
\"
output
\"
:{
\"
success
\"
:[
\"
a2
\"
]},
\"
design
\"
:{
\"
x
\"
:10,
\"
y
\"
:10}},
\"
a2
\"
:{
\"
uuid
\"
:
\"
a2
\"
,
\"
alias
\"
:
\"
test
\"
,
\"
meta
\"
:
\"
test
\"
,
\"
props
\"
:{
\"
text
\"
:
\"
$_linked_$
\"
},
\"
output
\"
:{
\"
success
\"
:[],
\"
failed
\"
:[]},
\"
design
\"
:{
\"
x
\"
:20,
\"
y
\"
:100}}}},{
\"
id
\"
:
\"
test
\"
,
\"
name
\"
:
\"
Test
\"
,
\"
desc
\"
:
\"
测试过程
\"
,
\"
props
\"
:{
\"
text
\"
:{
\"
alias
\"
:
\"
文本
\"
,
\"
type
\"
:
\"
string
\"
,
\"
default
\"
:
\"
你好
\"
},
\"
num
\"
:{
\"
alias
\"
:
\"
数字
\"
,
\"
type
\"
:
\"
number
\"
,
\"
default
\"
:1},
\"
type
\"
:{
\"
alias
\"
:
\"
类型
\"
,
\"
type
\"
:
\"
enum
\"
,
\"
enum
\"
:[
\"
rotate
\"
,
\"
jump
\"
,
\"
breath
\"
],
\"
default
\"
:
\"
rotate
\"
},
\"
autoPlay
\"
:{
\"
alias
\"
:
\"
自动播放
\"
,
\"
type
\"
:
\"
boolean
\"
,
\"
default
\"
:false},
\"
color
\"
:{
\"
alias
\"
:
\"
颜色
\"
,
\"
type
\"
:
\"
color
\"
,
\"
default
\"
:
\"
#123456
\"
},
\"
asset
\"
:{
\"
alias
\"
:
\"
素材
\"
,
\"
type
\"
:
\"
asset
\"
},
\"
node
\"
:{
\"
alias
\"
:
\"
节点
\"
,
\"
type
\"
:
\"
node
\"
}},
\"
output
\"
:[
\"
success
\"
,
\"
failed
\"
],
\"
script
\"
:
\"
console.log('test');
\"
}]}"
}
}
\ No newline at end of file
mock/api/project/query/data/index.js
View file @
07ecf566
...
...
@@ -612,3 +612,5 @@ const resp = {
module
.
exports
=
function
()
{
return
resp
;
};
//console.log(JSON.stringify(resp));
src/api/project.js
View file @
07ecf566
...
...
@@ -51,3 +51,11 @@ export async function saveOne(project) {
errMessage
:
'Failed to save project'
,
})
}
export
async
function
pack
(
id
)
{
return
await
fetchApi
(
'/api/project/pack'
,
{
params
:
{
id
},
method
:
'post'
,
errMessage
:
'Failed to pack project'
,
})
}
src/config.js
View file @
07ecf566
...
...
@@ -3,7 +3,7 @@
*/
export
const
API_HOST
=
'http://10.10.95.74:7777'
;
//
export const API_HOST = 'http://localhost:3002';
//export const API_HOST = 'http://localhost:3002';
export
const
UPLOAD_FILE_URL
=
API_HOST
+
'/api/uploadFile'
;
export
const
PARSE_BUNDLE_URL
=
API_HOST
+
'/api/parsePSD'
;
...
...
src/locales/en.json
View file @
07ecf566
...
...
@@ -40,8 +40,20 @@
"Divider"
:
"Divider"
,
"Custom"
:
"Custom"
,
"Entry"
:
"Entry"
,
"Packing"
:
"Packing"
,
"Open in new tab"
:
"Open in new tab"
,
"Pack project successfully"
:
"Pack project successfully"
,
"Pack project failed"
:
"Pack project failed"
,
"Create project"
:
"Create project"
,
"Rename project"
:
"Rename project"
,
"Entry scene view"
:
"Entry scene view"
,
"Page title"
:
"Page title"
,
"Container ID"
:
"Container ID"
,
"Design width"
:
"Design width"
,
"Design height"
:
"Design height"
,
"Frame Rate"
:
"Frame Rate"
,
"Scale Mode"
:
"Scale Mode"
,
"Renderer Type"
:
"Renderer Type"
,
"Props Editor"
:
"Props Editor"
,
"Edit Behavior"
:
"Edit Behavior"
,
"Trigger once"
:
"Trigger once"
,
...
...
@@ -90,7 +102,7 @@
"save"
:
"Save"
,
"details"
:
"Details"
,
"preview"
:
"Preview"
,
"
release"
:
"Release
"
,
"
pack"
:
"Pack
"
,
"data-mapping"
:
"DataMapping"
,
"exit"
:
"Exit"
,
"undo"
:
"Undo"
,
...
...
src/store/modules/env.js
View file @
07ecf566
...
...
@@ -91,6 +91,6 @@ function groupProcesses(processes, filterFunc) {
function
parseItem
(
list
)
{
for
(
let
i
=
0
,
li
=
list
.
length
;
i
<
li
;
i
++
)
{
list
[
i
]
=
JSON
.
parse
(
list
[
i
]);
list
[
i
]
=
JSON
.
parse
(
list
[
i
]
.
data
);
}
}
src/store/modules/project.js
View file @
07ecf566
...
...
@@ -3,17 +3,17 @@
*/
import
Vue
from
"vue"
;
import
JSZip
from
"jszip"
;
import
{
projectApi
}
from
"../../api"
;
import
{
projectApi
}
from
"../../api"
;
import
path
from
"path"
;
import
generateUUID
from
"uuid/v4"
;
import
{
getCmpProps
,
flattenViews
,
getCmpByUUID
}
from
'../../utils/common'
;
import
{
saveAs
}
from
"../../utils"
;
import
{
template
}
from
"../../template"
;
import
{
getCmpProps
,
flattenViews
,
getCmpByUUID
}
from
'../../utils/common'
;
import
{
saveAs
}
from
"../../utils"
;
import
{
template
}
from
"../../template"
;
const
defaultOptions
=
{
t
itle
:
'no title'
,
pageT
itle
:
'no title'
,
entrySceneView
:
''
,
containerI
D
:
'game-container'
,
containerI
d
:
'game-container'
,
designWidth
:
750
,
designHeight
:
1334
,
frameRate
:
60
,
...
...
@@ -22,7 +22,7 @@ const defaultOptions = {
tpl
:
template
,
};
function
getDefaultOptions
(){
function
getDefaultOptions
()
{
return
JSON
.
parse
(
JSON
.
stringify
(
defaultOptions
));
}
...
...
@@ -52,14 +52,17 @@ export const projectStore = {
state
.
dirty
=
dirty
;
},
updateProject
(
state
,
project
)
{
const
{
id
,
name
,
creator
,
data
}
=
project
;
const
{
id
,
name
,
creator
,
data
}
=
project
;
state
.
id
=
id
;
state
.
name
=
name
;
state
.
creator
=
creator
;
const
localData
=
state
.
data
;
if
(
data
)
{
const
{
views
,
assets
,
dataMapping
,
processes
,
options
,
}
=
JSON
.
parse
(
data
);
const
{
views
,
assets
,
dataMapping
,
processes
,
options
,}
=
JSON
.
parse
(
data
);
console
.
log
(
processes
);
Vue
.
set
(
localData
,
'options'
,
options
||
getDefaultOptions
());
Vue
.
set
(
localData
,
'views'
,
views
||
[]);
Vue
.
set
(
localData
,
'assets'
,
assets
||
[]);
...
...
@@ -117,7 +120,7 @@ export const projectStore = {
state
.
stackIndex
=
0
;
// 开始编辑的时候,重置操作栈的下标
_view
=
_
.
merge
(
_view
,
view
);
// 在操作栈中插入最新值
state
.
operateStack
.
unshift
(
_
.
cloneDeep
(
_
.
assign
({
uuid
:
_view
.
uuid
},
view
)));
state
.
operateStack
.
unshift
(
_
.
cloneDeep
(
_
.
assign
({
uuid
:
_view
.
uuid
},
view
)));
// 操作栈最大200
if
(
state
.
operateStack
.
length
>
200
)
{
state
.
operateStack
.
pop
();
...
...
@@ -166,8 +169,8 @@ export const projectStore = {
},
/**
* 重做/撤销
* @param {*} state
* @param {*} step
* @param {*} state
* @param {*} step
*/
undoRedo
(
state
,
step
)
{
let
_beforeStack
=
state
.
operateStack
[
state
.
stackIndex
];
...
...
@@ -191,7 +194,7 @@ export const projectStore = {
modifyProject
(
state
)
{
},
addNode
(
state
,
{
node
,
name
,
type
})
{
addNode
(
state
,
{
node
,
name
,
type
})
{
const
child
=
{
name
,
type
,
...
...
@@ -211,7 +214,7 @@ export const projectStore = {
importView
(
state
,
view
)
{
state
.
data
.
views
.
push
(
view
);
},
deleteNode
(
state
,
{
node
,
parentNode
})
{
deleteNode
(
state
,
{
node
,
parentNode
})
{
const
parentChildren
=
parentNode
.
children
||
parentNode
;
const
index
=
parentChildren
.
indexOf
(
node
);
parentChildren
.
splice
(
index
,
1
);
...
...
@@ -219,7 +222,7 @@ export const projectStore = {
importAssets
(
state
,
assets
)
{
state
.
data
.
assets
.
push
(...
assets
);
},
addAsset
(
state
,
{
url
,
file
})
{
addAsset
(
state
,
{
url
,
file
})
{
const
ext
=
path
.
extname
(
file
.
name
);
state
.
data
.
assets
.
push
({
name
:
path
.
basename
(
file
.
name
,
ext
),
...
...
@@ -229,7 +232,7 @@ export const projectStore = {
})
},
deleteAsset
(
state
,
uuid
)
{
const
{
assets
}
=
state
.
data
;
const
{
assets
}
=
state
.
data
;
for
(
let
i
=
0
,
li
=
assets
.
length
;
i
<
li
;
i
++
)
{
const
asset
=
state
.
data
.
assets
[
i
];
if
(
asset
.
uuid
===
uuid
)
{
...
...
@@ -263,7 +266,7 @@ export const projectStore = {
},
getters
:
{
project
(
state
)
{
const
{
id
,
name
,
creator
,
data
}
=
state
;
const
{
id
,
name
,
creator
,
data
}
=
state
;
return
{
id
,
name
,
creator
,
data
:
JSON
.
stringify
(
data
),
...
...
@@ -278,7 +281,7 @@ export const projectStore = {
}
return
result
;
},
options
(
state
){
options
(
state
)
{
return
state
.
data
.
options
;
},
/**
...
...
@@ -313,17 +316,17 @@ export const projectStore = {
},
},
actions
:
{
saveToLocal
({
getters
,
commit
})
{
const
{
project
}
=
getters
;
saveToLocal
({
getters
,
commit
})
{
const
{
project
}
=
getters
;
localStorage
.
setItem
(
'project-'
+
project
.
id
,
JSON
.
stringify
(
project
));
commit
(
'setDirty'
,
true
);
},
localVersionExist
({
commit
},
projectID
)
{
localVersionExist
({
commit
},
projectID
)
{
let
json
=
localStorage
.
getItem
(
'project-'
+
projectID
);
return
!!
json
;
},
loadFromLocal
({
commit
},
projectID
)
{
loadFromLocal
({
commit
},
projectID
)
{
let
json
=
localStorage
.
getItem
(
'project-'
+
projectID
);
if
(
json
)
{
const
project
=
JSON
.
parse
(
json
);
...
...
@@ -331,11 +334,11 @@ export const projectStore = {
commit
(
'setDirty'
,
true
);
}
},
deleteLocalVersion
({
state
,
commit
},
projectID
)
{
deleteLocalVersion
({
state
,
commit
},
projectID
)
{
localStorage
.
removeItem
(
'project-'
+
projectID
);
commit
(
'setDirty'
,
false
);
},
async
loadFromRemote
({
commit
,
dispatch
},
projectID
)
{
async
loadFromRemote
({
commit
,
dispatch
},
projectID
)
{
const
project
=
await
projectApi
.
fetchOne
(
projectID
);
if
(
project
)
{
dispatch
(
'deleteLocalVersion'
,
projectID
);
...
...
@@ -344,11 +347,11 @@ export const projectStore = {
throw
new
Error
(
'Project does not exist'
)
}
},
async
saveToRemote
({
state
,
dispatch
,
getters
})
{
async
saveToRemote
({
state
,
dispatch
,
getters
})
{
await
projectApi
.
saveOne
(
getters
.
project
);
dispatch
(
'deleteLocalVersion'
,
state
.
id
);
},
async
updateProject
({
commit
},
projectID
)
{
async
updateProject
({
commit
},
projectID
)
{
const
project
=
await
projectApi
.
getData
(
projectID
);
commit
(
'updateProject'
,
project
);
},
...
...
@@ -377,7 +380,7 @@ export const projectStore = {
/**
* 修改属性
*/
modifyProperties
({
commit
,
state
},
props
)
{
modifyProperties
({
commit
,
state
},
props
)
{
// debugger;
// 如果当前修改的是“来源”属性,节点又没有高度宽度,则取图片的高度宽度
let
_source
=
Object
.
keys
(
props
).
indexOf
(
'source'
)
>
-
1
;
...
...
@@ -412,13 +415,13 @@ export const projectStore = {
* @param {*} param0
* @param {*} props
*/
modifyCopyProperties
({
commit
},
props
)
{
modifyCopyProperties
({
commit
},
props
)
{
commit
(
'modifyCopyProperties'
,
props
)
},
/**
* 修改当前选中的节点
*/
modifyActiveView
({
commit
},
view
)
{
modifyActiveView
({
commit
},
view
)
{
commit
(
'modifyActiveView'
,
view
)
},
...
...
@@ -427,7 +430,7 @@ export const projectStore = {
* @param {*} param0
* @param {*} data
*/
addNodeScript
({
commit
,
state
},
script
)
{
addNodeScript
({
commit
,
state
},
script
)
{
let
_scripts
=
_
.
cloneDeep
(
state
.
activeComponent
.
scripts
||
[]);
_scripts
.
push
({
script
:
script
,
...
...
@@ -438,12 +441,18 @@ export const projectStore = {
})
},
exportView
({
state
},
view
)
{
exportView
({
state
},
view
)
{
let
zip
=
new
JSZip
();
zip
.
file
(
'view.json'
,
JSON
.
stringify
(
view
));
zip
.
generateAsync
({
type
:
"blob"
}).
then
(
function
(
content
)
{
zip
.
generateAsync
({
type
:
"blob"
}).
then
(
function
(
content
)
{
saveAs
(
content
,
`view-
${
view
.
name
}
.zrv`
);
});
},
async
packProject
({
state
})
{
const
result
=
await
projectApi
.
pack
(
state
.
id
);
console
.
log
(
result
)
return
result
;
}
},
};
src/utils/events.js
View file @
07ecf566
export
default
[
'init'
,
'click'
,
'dataevent'
,
'touchstart'
,
'touchend'
,
'touchmove'
]
\ No newline at end of file
export
default
[
'init'
,
'awake'
,
'sleep'
,
'dataevent'
,
'click'
,
'touchstart'
,
'touchend'
,
'touchmove'
]
\ No newline at end of file
src/views/Editor.vue
View file @
07ecf566
...
...
@@ -157,8 +157,35 @@
case
'details'
:
this
.
$refs
.
projectDialogsDialog
.
show
();
break
;
case
'release'
:
case
'pack'
:
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
this
.
$t
(
'Packing'
),
});
try
{
const
{
tplUrl
}
=
await
this
.
packProject
();
this
.
$message
({
message
:
this
.
$t
(
'Pack project successfully'
),
type
:
'success'
,
duration
:
1000
,
});
this
.
$confirm
(
this
.
$t
(
'Pack project successfully'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Close'
),
cancelButtonText
:
this
.
$t
(
'Open in new tab'
),
type
:
'warning'
}).
then
(()
=>
{
}).
catch
(()
=>
{
window
.
open
(
tplUrl
,
'blank'
);
});
}
catch
(
e
)
{
this
.
$message
({
message
:
this
.
$t
(
'Pack project failed'
),
type
:
'error'
,
duration
:
1000
,
});
}
loading
.
close
();
break
;
case
'undo'
:
this
.
$store
.
commit
(
'undoRedo'
,
1
);
...
...
@@ -201,6 +228,7 @@
"saveToLocal"
,
"saveToRemote"
,
'updateEnv'
,
'packProject'
,
])
}
}
...
...
src/views/Editor/Inspector/BehaviorTab.vue
View file @
07ecf566
...
...
@@ -90,10 +90,10 @@ export default {
* 行为发生变化,同步数据
*/
handleBehaviorsChange
(
v
)
{
if
(
this
.
currentEvent
&&
v
&&
v
.
length
)
{
if
(
this
.
currentEvent
/* && v && v.length*/
)
{
let
event
=
{};
let
currentEvent
=
this
.
eventsObj
[
this
.
currentEvent
];
event
[
this
.
currentEvent
]
=
Object
.
assign
(
currentEvent
,
{
behaviors
:
v
}
);
event
[
this
.
currentEvent
]
=
Object
.
assign
(
currentEvent
/*, { behaviors: v }*/
);
this
.
$store
.
dispatch
(
'modifyActiveView'
,
{
events
:
event
});
...
...
src/views/Editor/dialogs/BehaviorEditorDialog.vue
View file @
07ecf566
...
...
@@ -25,6 +25,7 @@
computed
:
{
...
mapState
({
data
:
state
=>
state
.
project
.
data
,
}),
},
methods
:
{
...
...
src/views/Editor/dialogs/ProjectDetailsDialog.vue
View file @
07ecf566
...
...
@@ -6,10 +6,10 @@
>
<div
class=
"project-details-dialog"
>
<el-form
@
submit
.
native
.
prevent
ref=
"form"
:model=
"options"
size=
"mini"
label-position=
"right"
label-width=
"150px"
>
<el-form-item
prop=
"
title"
label=
"Page title
"
>
<el-input
v-model=
"options.
t
itle"
/>
<el-form-item
prop=
"
pageTitle"
:label=
"$t('Page title')
"
>
<el-input
v-model=
"options.
pageT
itle"
/>
</el-form-item>
<el-form-item
prop=
"entrySceneView"
label=
"Entry scene view
"
>
<el-form-item
prop=
"entrySceneView"
:label=
"$t('Entry scene view')
"
>
<el-select
v-model=
"options.entrySceneView"
>
<el-option
v-for=
"(view, index) in project.data.views"
:key=
"index"
...
...
@@ -18,19 +18,19 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item
prop=
"containerI
D"
label=
"Container ID
"
>
<el-input
v-model=
"options.containerI
D
"
/>
<el-form-item
prop=
"containerI
d"
:label=
"$t('Container ID')
"
>
<el-input
v-model=
"options.containerI
d
"
/>
</el-form-item>
<el-form-item
prop=
"designWidth"
label=
"Design width
"
>
<el-form-item
prop=
"designWidth"
:label=
"$t('Design width')
"
>
<el-input-number
v-model=
"options.designWidth"
controls-position=
"right"
/>
</el-form-item>
<el-form-item
prop=
"designHeight"
label=
"Design height
"
>
<el-form-item
prop=
"designHeight"
:label=
"$t('Design height')
"
>
<el-input-number
v-model=
"options.designHeight"
controls-position=
"right"
/>
</el-form-item>
<el-form-item
prop=
"frameRate"
label=
"Frame Rate
"
>
<el-form-item
prop=
"frameRate"
:label=
"$t('Frame Rate')
"
>
<el-input-number
v-model=
"options.frameRate"
:max=
"60"
:min=
"0"
controls-position=
"right"
/>
</el-form-item>
<el-form-item
prop=
"scaleMode"
label=
"Scale Mode
"
>
<el-form-item
prop=
"scaleMode"
:label=
"$t('Scale Mode')
"
>
<el-select
v-model=
"options.scaleMode"
>
<el-option
v-for=
"(value, key) in SCALE_MODES"
:key=
"key"
...
...
@@ -39,7 +39,7 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item
prop=
"rendererType"
label=
"Renderer Type
"
>
<el-form-item
prop=
"rendererType"
:label=
"$t('Renderer Type')
"
>
<el-select
v-model=
"options.rendererType"
>
<el-option
v-for=
"(value, key) in RENDERER_TYPES"
:key=
"key"
...
...
@@ -48,7 +48,7 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item
prop=
"tpl"
label=
"Template
"
>
<el-form-item
prop=
"tpl"
:label=
"$t('Template')
"
>
<el-input
type=
"textarea"
v-model=
"options.tpl"
:rows=
"10"
/>
</el-form-item>
</el-form>
...
...
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