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
5ca11651
Commit
5ca11651
authored
Nov 15, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
相对布局的属性打开,但设计时不用生效
parent
83819722
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
106 additions
and
60 deletions
+106
-60
todo.md
docs/todo.md
+3
-1
index.html
public/index.html
+20
-14
common.js
src/api/common.js
+2
-2
config.js
src/config.js
+2
-2
en.json
src/locales/en.json
+2
-0
behavior.scss
src/themes/light/behavior.scss
+4
-1
properties.js
src/utils/properties.js
+32
-32
Editor.vue
src/views/Editor.vue
+4
-2
BehaviorTab.vue
src/views/Editor/Inspector/BehaviorTab.vue
+1
-1
MetaEditorDialog.vue
src/views/Editor/behavior-editor/MetaEditorDialog.vue
+34
-4
vue.config.js
vue.config.js
+2
-1
No files found.
docs/todo.md
View file @
5ca11651
...
...
@@ -10,3 +10,5 @@
5.
属性中增加alias为别名,用来呈现中文别名(
`{alias: '文本', type: 'string', default: '你好'}`
)
6.
属性中枚举的类型,type改为enum,增加以enum为名字的字符串存放枚举项(
`{alias: '类型', type: 'enum', enum: ['rotate', 'jump', 'breath'], default: 'rotate'}`
)
7.
编辑区需要能设置尺寸,默认
`750*1334`
,增加缩放功能,缩放可由按钮或者滚轮控制
8.
增加删除脚本功能
9.
增加删除行为功能
public/index.html
View file @
5ca11651
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<title>
zeroing-editor
</title>
</head>
<body>
<noscript>
<strong>
We're sorry but zeroing-editor doesn't work properly without JavaScript enabled. Please enable it to continue.
</strong>
</noscript>
<div
id=
"app"
></div>
<!-- built files will be auto injected -->
</body>
</head>
<body>
<noscript>
<strong>
We're sorry but zeroing-editor doesn't work properly without JavaScript enabled. Please enable it to
continue.
</strong>
</noscript>
<script>
window
.
__data
=
{
token
:
'eyJhbGciOiJIUzI1NiJ9.5Y2e6b6Z5Lqt.2fNMm0oJt0l0ZzsSYwo4ie8Bs7yLU9EmS2mtrmLPktY'
,
};
</script>
<div
id=
"app"
></div>
<!-- built files will be auto injected -->
</body>
</html>
src/api/common.js
View file @
5ca11651
...
...
@@ -6,7 +6,7 @@ import {API_HOST} from "../config";
import
cookie
from
"cookie"
;
import
{
stringify
}
from
"querystringify"
;
const
user_cookie
=
cookie
.
parse
(
document
.
cookie
).
user_cookie
;
const
user_cookie
=
window
.
__data
.
token
||
cookie
.
parse
(
document
.
cookie
).
user_cookie
;
class
ApiError
extends
Error
{
constructor
(
name
,
code
,
message
)
{
...
...
@@ -33,7 +33,7 @@ export async function fetchApi(uri, {params, method = 'get', contentType = 'json
const
options
=
{
method
,
headers
:
{
authorization
:
user_cookie
,
authorization
:
'Bearer '
+
user_cookie
,
},
};
if
(
params
)
{
...
...
src/config.js
View file @
5ca11651
...
...
@@ -2,8 +2,8 @@
* Created by rockyl on 2019-09-19.
*/
export
const
API_HOST
=
'http://beacon.duibadev.com.cn'
;
//
export const API_HOST = 'http://10.10.95.74:7777';
//
export const API_HOST = 'http://beacon.duibadev.com.cn';
export
const
API_HOST
=
'http://10.10.95.74:7777'
;
//export const API_HOST = 'http://localhost:3002';
export
const
UPLOAD_FILE_URL
=
API_HOST
+
'/api/uploadFile'
;
...
...
src/locales/en.json
View file @
5ca11651
...
...
@@ -41,6 +41,8 @@
"Custom"
:
"Custom"
,
"Entry"
:
"Entry"
,
"Packing"
:
"Packing"
,
"Type"
:
"Type"
,
"Group"
:
"Group"
,
"Open in new tab"
:
"Open in new tab"
,
"Pack project successfully"
:
"Pack project successfully"
,
"Pack project failed"
:
"Pack project failed"
,
...
...
src/themes/light/behavior.scss
View file @
5ca11651
...
...
@@ -17,8 +17,11 @@ $dock-pin-width: 9px;
}
.process-tree
{
display
:
flex
;
flex-direction
:
column
;
.scrollbar
{
height
:
100%
;
flex
:
1
;
.process-tree-node
{
flex
:
1
;
...
...
src/utils/properties.js
View file @
5ca11651
...
...
@@ -13,26 +13,26 @@ export default {
type
:
'inputNumber'
,
value
:
0
,
},
//
left: {
//
title: '左边距',
//
type: 'inputNumber',
//
value: undefined,
//
},
//
right: {
//
title: '右边距',
//
type: 'inputNumber',
//
value: undefined,
//
},
//
top: {
//
title: '上边距',
//
type: 'inputNumber',
//
value: undefined,
//
},
//
bottom: {
//
title: '下边距',
//
type: 'inputNumber',
//
value: undefined,
//
},
left
:
{
title
:
'左边距'
,
type
:
'inputNumber'
,
value
:
undefined
,
},
right
:
{
title
:
'右边距'
,
type
:
'inputNumber'
,
value
:
undefined
,
},
top
:
{
title
:
'上边距'
,
type
:
'inputNumber'
,
value
:
undefined
,
},
bottom
:
{
title
:
'下边距'
,
type
:
'inputNumber'
,
value
:
undefined
,
},
width
:
{
title
:
'宽度'
,
type
:
'inputNumber'
,
...
...
@@ -43,18 +43,18 @@ export default {
type
:
'inputNumber'
,
value
:
1
},
//
horizonCenter: {
//
title: '水平偏移',
//
type: 'inputNumber',
//
value: undefined,
//
desc: '相对于父元素中心点的水平偏移,0为正中心'
//
},
//
verticalCenter: {
//
title: '垂直偏移',
//
type: 'inputNumber',
//
value: undefined,
//
desc: '相对于父元素中心点的垂直偏移,0为正中心'
//
},
horizonCenter
:
{
title
:
'水平偏移'
,
type
:
'inputNumber'
,
value
:
undefined
,
desc
:
'相对于父元素中心点的水平偏移,0为正中心'
},
verticalCenter
:
{
title
:
'垂直偏移'
,
type
:
'inputNumber'
,
value
:
undefined
,
desc
:
'相对于父元素中心点的垂直偏移,0为正中心'
},
rotation
:
{
title
:
'旋转'
,
type
:
'inputNumber'
,
...
...
src/views/Editor.vue
View file @
5ca11651
...
...
@@ -4,7 +4,7 @@
<split-panes
class=
"pane-container"
@
resized=
"onPanesReSized(0, $event)"
>
<split-panes
splitpanes-min=
"40"
:splitpanes-size=
"getSize(0, 0)"
horizontal
@
resized=
"onPanesReSized(1, $event)"
>
<split-panes
splitpanes-min=
"20"
:splitpanes-size=
"getSize(1, 0)"
@
resized=
"onPanesReSized(2, $event)"
>
<views
splitpanes-min=
"
3
0"
:splitpanes-size=
"getSize(2, 0)"
></views>
<views
splitpanes-min=
"
2
0"
:splitpanes-size=
"getSize(2, 0)"
></views>
<playground
splitpanes-min=
"20"
:splitpanes-size=
"getSize(2, 1)"
></playground>
</split-panes>
<assets
splitpanes-min=
"20"
:splitpanes-size=
"getSize(1, 1)"
></assets>
...
...
@@ -176,7 +176,9 @@
}).
then
(()
=>
{
}).
catch
(()
=>
{
setTimeout
(()
=>
{
window
.
open
(
tplUrl
,
'blank'
);
},
500
);
});
}
catch
(
e
)
{
this
.
$message
({
...
...
src/views/Editor/Inspector/BehaviorTab.vue
View file @
5ca11651
...
...
@@ -54,7 +54,7 @@ export default {
showBehaviorEditor
(
evn
,
key
)
{
this
.
currentEvent
=
key
;
this
.
behaviors
=
evn
.
behaviors
||
[];
this
.
$refs
.
behaviorEditorDialog
.
show
(
this
.
behaviors
,
key
);
this
.
$refs
.
behaviorEditorDialog
.
show
(
this
.
behaviors
,
this
.
activeComponent
.
name
+
'_'
+
key
);
},
/**
* 当前选中组件发生变化时,更新eventsObj的数据
...
...
src/views/Editor/behavior-editor/MetaEditorDialog.vue
View file @
5ca11651
...
...
@@ -14,6 +14,12 @@
<el-form-item
prop=
"desc"
label=
"Desc"
>
<el-input
v-model=
"meta.desc"
:placeholder=
"$t('Description')"
:readonly=
"!editable"
/>
</el-form-item>
<el-form-item
prop=
"type"
label=
"Type"
>
<el-input
v-model=
"meta.type"
:placeholder=
"$t('Type')"
:readonly=
"!editable"
/>
</el-form-item>
<el-form-item
prop=
"group"
label=
"Group"
>
<el-input
v-model=
"meta.group"
:placeholder=
"$t('Group')"
:readonly=
"!editable"
/>
</el-form-item>
<el-form-item
label=
"Props"
>
<el-link
:underline=
"false"
@
click=
"onClickEditProps"
:disabled=
"!editable"
>
<template
v-if=
"Object.keys(meta.props).length"
>
...
...
@@ -35,7 +41,13 @@
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
class=
"button-bar"
>
<el-button
size=
"mini"
plain
@
click=
"printMeta"
>
PrintMeta
</el-button>
<el-button-group
style=
"margin-right: 20px;"
>
<el-button
size=
"mini"
plain
@
click=
"copyMeta"
>
CopyMeta
</el-button>
<el-popover>
<div
ref=
"pasteBoard"
@
paste=
"onPaste"
>
Click and Ctrl+V
</div>
<el-button
size=
"mini"
slot=
"reference"
plain
@
click=
"pasteMeta"
>
PasteMeta
</el-button>
</el-popover>
</el-button-group>
<el-button
size=
"mini"
plain
@
click=
"cancel"
>
Cancel
</el-button>
<el-button
size=
"mini"
plain
@
click=
"save"
>
Save
</el-button>
</div>
...
...
@@ -47,6 +59,7 @@
<
script
>
import
ElFormItem
from
"./editors/form-item"
;
import
PropsEditorDialog
from
"./PropsEditorDialog"
;
import
copy
from
'copy-to-clipboard'
export
default
{
name
:
"MetaEditorDialog"
,
...
...
@@ -69,7 +82,7 @@
},
computed
:
{
editable
()
{
return
this
.
meta
&&
this
.
meta
.
type
!==
'builtin'
;
return
this
.
meta
;
//
&& this.meta.type !== 'builtin';
},
props
()
{
return
Object
.
keys
(
this
.
meta
.
props
).
join
(
','
)
...
...
@@ -103,8 +116,25 @@
cancel
()
{
this
.
visible
=
false
;
},
printMeta
()
{
console
.
log
(
JSON
.
stringify
(
this
.
meta
));
copyMeta
()
{
copy
(
JSON
.
stringify
(
this
.
meta
));
},
pasteMeta
()
{
//setTimeout(this.focusPasteBoard, 1000, this);
},
onPaste
(
e
)
{
let
metaStr
=
e
.
clipboardData
.
getData
(
"Text"
);
if
(
metaStr
){
try
{
let
meta
=
JSON
.
parse
(
metaStr
);
this
.
meta
=
meta
;
}
catch
(
e
)
{
}
}
},
focusPasteBoard
(){
this
.
$refs
.
pasteBoard
.
focus
();
},
}
}
...
...
vue.config.js
View file @
5ca11651
module
.
exports
=
{
publicPath
:
''
,
pluginOptions
:
{
i18n
:
{
locale
:
'en'
,
...
...
@@ -7,4 +8,4 @@ module.exports = {
enableInSFC
:
true
}
}
}
}
;
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