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
c67c09a2
Commit
c67c09a2
authored
Nov 14, 2019
by
张晨辰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 属性编辑值为false时取值错误
parent
43ac21cb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
22 deletions
+37
-22
pane.scss
src/themes/light/pane.scss
+4
-0
common.js
src/utils/common.js
+3
-0
BehaviorTab.vue
src/views/Editor/Inspector/BehaviorTab.vue
+1
-1
PropsTab.vue
src/views/Editor/Inspector/PropsTab.vue
+27
-19
drawPanel.vue
src/views/Editor/components/drawPanel.vue
+1
-1
wrapper.vue
src/views/Editor/components/wrapper.vue
+1
-1
No files found.
src/themes/light/pane.scss
View file @
c67c09a2
...
@@ -28,6 +28,10 @@
...
@@ -28,6 +28,10 @@
flex
:
1
;
flex
:
1
;
border-radius
:
2px
;
border-radius
:
2px
;
position
:
relative
;
position
:
relative
;
&
.background
{
display
:
block
;
width
:
100%
;
}
}
}
.title-bar
{
.title-bar
{
...
...
src/utils/common.js
View file @
c67c09a2
...
@@ -86,6 +86,9 @@ const attrUnitMapper = {
...
@@ -86,6 +86,9 @@ const attrUnitMapper = {
*/
*/
function
getParentCmps
(
uuid
,
list
)
{
function
getParentCmps
(
uuid
,
list
)
{
let
_self
=
list
.
find
(
c
=>
c
.
uuid
===
uuid
);
let
_self
=
list
.
find
(
c
=>
c
.
uuid
===
uuid
);
if
(
!
_self
)
{
return
[];
}
let
parentLoop
=
(
uuid
,
list
)
=>
{
let
parentLoop
=
(
uuid
,
list
)
=>
{
let
_item
=
list
.
find
(
c
=>
c
.
uuid
===
uuid
);
let
_item
=
list
.
find
(
c
=>
c
.
uuid
===
uuid
);
...
...
src/views/Editor/Inspector/BehaviorTab.vue
View file @
c67c09a2
<
template
>
<
template
>
<div
class=
"zero-inspector-behavior-form"
v-if=
"activeComponent.uuid"
>
<div
class=
"zero-inspector-behavior-form"
v-if=
"activeComponent.uuid"
>
<el-scrollbar
class=
"scrollbar"
wrap-class=
"wrap-x-hidden"
>
<el-scrollbar
class=
"scrollbar"
wrap-class=
"wrap-x-hidden"
>
<el-form
ref=
"form"
size=
"mini"
label-width=
"60px"
v
>
<el-form
ref=
"form"
size=
"mini"
label-width=
"60px"
>
<div
v-for=
"(evn, key) in eventsObj"
:key=
"key"
>
<div
v-for=
"(evn, key) in eventsObj"
:key=
"key"
>
<el-form-item
:label=
"$t('Event') + ':'"
>
<el-form-item
:label=
"$t('Event') + ':'"
>
<div>
{{
key
}}
</div>
<div>
{{
key
}}
</div>
...
...
src/views/Editor/Inspector/PropsTab.vue
View file @
c67c09a2
...
@@ -4,25 +4,27 @@
...
@@ -4,25 +4,27 @@
<el-form
ref=
"form"
size=
"mini"
:model=
"form"
label-width=
"80px"
@
submit
.
native
.
prevent
>
<el-form
ref=
"form"
size=
"mini"
:model=
"form"
label-width=
"80px"
@
submit
.
native
.
prevent
>
<el-collapse
v-model=
"configColl"
>
<el-collapse
v-model=
"configColl"
>
<el-collapse-item
title=
"配置"
name=
"properties"
>
<el-collapse-item
title=
"配置"
name=
"properties"
>
<el-form-item
label=
"名称"
>
<div
class=
"zero-inspector-props-group"
>
<el-input
v-model=
"form.name"
@
input=
"v => handleChange('name', v)"
></el-input>
<el-form-item
label=
"名称"
>
</el-form-item>
<el-input
v-model=
"form.name"
@
input=
"v => handleChange('name', v)"
></el-input>
<el-form-item
label=
"类型"
>
<el-select
v-model=
"form.type"
@
change=
"v => handleChange('type', v)"
placeholder=
"请选择类型"
>
<el-option
v-for=
"cmp in componentsMap"
:key=
"cmp.value"
:label=
"cmp.label"
:value=
"cmp.value"
></el-option>
</el-select>
</el-form-item>
<template
v-for=
"(p, key) in cmpProps"
>
<el-form-item
v-if=
"key !== 'groupName'"
:id=
"activeComponent.uuid + '-' + key"
:key=
"activeComponent.uuid + key"
:label=
"p.title"
>
<!--
{{
key
}}
-->
<el-tooltip
:disabled=
"!p.desc"
placement=
"top-start"
>
<div
slot=
"content"
>
{{
p
.
desc
}}
</div>
<div>
<dynamic-component
:component-value=
"getPropValue(p, key)"
:component-props=
"getPropProps(p)"
:component-type=
"getPropCmpType(p)"
@
onChange=
"v => handlePropertiesChange(key, v)"
></dynamic-component>
</div>
</el-tooltip>
</el-form-item>
</el-form-item>
</
template
>
<el-form-item
label=
"类型"
>
<el-select
v-model=
"form.type"
@
change=
"v => handleChange('type', v)"
placeholder=
"请选择类型"
>
<el-option
v-for=
"cmp in componentsMap"
:key=
"cmp.value"
:label=
"cmp.label"
:value=
"cmp.value"
></el-option>
</el-select>
</el-form-item>
<template
v-for=
"(p, key) in cmpProps"
>
<el-form-item
v-if=
"key !== 'groupName'"
:id=
"activeComponent.uuid + '-' + key"
:key=
"activeComponent.uuid + key"
:label=
"p.title"
>
<!--
{{
key
}}
-->
<el-tooltip
:disabled=
"!p.desc"
placement=
"top-start"
>
<div
slot=
"content"
>
{{
p
.
desc
}}
</div>
<div>
<dynamic-component
:component-value=
"getPropValue(p, key)"
:component-props=
"getPropProps(p)"
:component-type=
"getPropCmpType(p)"
@
onChange=
"v => handlePropertiesChange(key, v)"
></dynamic-component>
</div>
</el-tooltip>
</el-form-item>
</
template
>
</div>
</el-collapse-item>
</el-collapse-item>
<el-collapse-item
title=
"脚本"
name=
"scripts"
>
<el-collapse-item
title=
"脚本"
name=
"scripts"
>
<el-collapse
accordion
v-if=
"activeComponent.scripts && activeComponent.scripts.length"
>
<el-collapse
accordion
v-if=
"activeComponent.scripts && activeComponent.scripts.length"
>
...
@@ -241,7 +243,7 @@ export default {
...
@@ -241,7 +243,7 @@ export default {
*/
*/
getPropValue
(
item
,
key
)
{
getPropValue
(
item
,
key
)
{
let
_properties
=
this
.
activeComponentCopy
.
properties
;
let
_properties
=
this
.
activeComponentCopy
.
properties
;
return
_properties
[
key
]
||
item
.
value
;
return
(
_properties
[
key
]
===
undefined
||
_properties
[
key
]
===
null
)
?
item
.
value
:
_properties
[
key
]
;
},
},
getScriptValue
(
item
,
key
,
index
)
{
getScriptValue
(
item
,
key
,
index
)
{
let
_script
=
this
.
activeComponent
.
scripts
[
index
];
let
_script
=
this
.
activeComponent
.
scripts
[
index
];
...
@@ -300,6 +302,12 @@ export default {
...
@@ -300,6 +302,12 @@ export default {
.el-divider__text
{
.el-divider__text
{
background-color
:
#e9e9e9
;
background-color
:
#e9e9e9
;
}
}
.zero-inspector-props-group
{
width
:
100%
;
max-height
:
600px
;
overflow-x
:
hidden
;
overflow-y
:
auto
;
}
}
}
.script-config-dialog
{
.script-config-dialog
{
height
:
350px
;
height
:
350px
;
...
...
src/views/Editor/components/drawPanel.vue
View file @
c67c09a2
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<
script
>
<
script
>
import
{
mapState
,
mapGetters
}
from
'vuex'
;
import
{
mapState
,
mapGetters
}
from
'vuex'
;
import
wrap
from
'./wrap'
;
import
wrap
from
'./wrap'
;
import
{
styles
,
getParentCmps
}
from
'../../../utils/common'
;
import
{
styles
}
from
'../../../utils/common'
;
import
properties
from
'../../../utils/properties'
;
import
properties
from
'../../../utils/properties'
;
import
VueDraggableResizable
from
'vue-draggable-resizable'
;
import
VueDraggableResizable
from
'vue-draggable-resizable'
;
...
...
src/views/Editor/components/wrapper.vue
View file @
c67c09a2
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<
script
>
<
script
>
import
{
mapState
,
mapGetters
}
from
'vuex'
;
import
{
mapState
,
mapGetters
}
from
'vuex'
;
import
{
styles
,
getParentCmps
}
from
'../../../utils/common'
;
import
{
styles
}
from
'../../../utils/common'
;
import
properties
from
'../../../utils/properties'
;
import
properties
from
'../../../utils/properties'
;
import
customNode
from
'../../../components/customElement/node/index.vue'
;
import
customNode
from
'../../../components/customElement/node/index.vue'
;
...
...
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