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
c0681ad5
Commit
c0681ad5
authored
Nov 12, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
内建过程不可编辑props
parent
ff8abbd3
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
135 additions
and
74 deletions
+135
-74
index.js
mock/api/editor/info/index.js
+26
-1
en.json
src/locales/en.json
+3
-0
behavior.js
src/store/modules/behavior.js
+30
-5
env.js
src/store/modules/env.js
+2
-2
BehaviorEditor.vue
src/views/Editor/behavior-editor/BehaviorEditor.vue
+9
-8
Board.vue
src/views/Editor/behavior-editor/Board.vue
+18
-15
ProcessNode.vue
src/views/Editor/behavior-editor/Board/ProcessNode.vue
+9
-6
state.js
src/views/Editor/behavior-editor/Board/state.js
+0
-10
PropertiesEditor.vue
src/views/Editor/behavior-editor/PropertiesEditor.vue
+8
-1
AssetEditor.vue
src/views/Editor/behavior-editor/editors/AssetEditor.vue
+3
-3
BooleanEditor.vue
src/views/Editor/behavior-editor/editors/BooleanEditor.vue
+3
-3
ColorEditor.vue
src/views/Editor/behavior-editor/editors/ColorEditor.vue
+3
-2
EditorWrapper.vue
src/views/Editor/behavior-editor/editors/EditorWrapper.vue
+3
-1
EnumEditor.vue
src/views/Editor/behavior-editor/editors/EnumEditor.vue
+3
-3
NodeSelectEditor.vue
...views/Editor/behavior-editor/editors/NodeSelectEditor.vue
+5
-5
NumberEditor.vue
src/views/Editor/behavior-editor/editors/NumberEditor.vue
+3
-3
StringEditor.vue
src/views/Editor/behavior-editor/editors/StringEditor.vue
+6
-5
BehaviorEditorDialog.vue
src/views/Editor/dialogs/BehaviorEditorDialog.vue
+1
-1
No files found.
mock/api/editor/info/index.js
View file @
c0681ad5
...
...
@@ -28,6 +28,31 @@ const data = {
},
output
:
[
'complete'
],
},
{
id
:
'hehe'
,
name
:
'Hehe'
,
desc
:
'呵呵'
,
type
:
'builtin'
,
subEntry
:
'1'
,
sub
:
{
1
:
{
uuid
:
'1'
,
alias
:
'入口'
,
meta
:
'entry'
,
output
:
{
success
:
[
'2'
],
},
},
2
:
{
uuid
:
'2'
,
meta
:
'wait'
,
alias
:
'等待'
,
props
:
{
duration
:
500
,
},
},
}
},
{
id
:
'prefab1'
,
name
:
'Prefab1'
,
...
...
@@ -53,7 +78,7 @@ const data = {
},
},
}
}
}
,
],
scripts
:
[
{
...
...
src/locales/en.json
View file @
c0681ad5
...
...
@@ -33,6 +33,9 @@
"Preparing"
:
"Preparing…"
,
"Deleting"
:
"Deleting…"
,
"Saving"
:
"Saving…"
,
"Divider"
:
"Divider"
,
"Custom"
:
"Custom"
,
"Entry"
:
"Entry"
,
"Create project"
:
"Create project"
,
"Rename project"
:
"Rename project"
,
"Props Editor"
:
"Props Editor"
,
...
...
src/store/modules/behavior.js
View file @
c0681ad5
...
...
@@ -4,7 +4,7 @@
* 行为编辑
*/
import
Vue
from
'vue'
;
import
i18n
from
"../../i18n"
;
import
generateUUID
from
"uuid/v4"
;
import
{
metaInUse
,
updateProcesses
}
from
"../../utils"
;
...
...
@@ -16,6 +16,15 @@ export const behaviorStore = {
originData
:
null
,
originBehaviors
:
null
,
behaviors
:
null
,
processStack
:
[],
editable
:
false
,
drawState
:
{
drawing
:
false
,
targetUUID
:
''
,
lineID
:
0
,
boardOffset
:
{
x
:
0
,
y
:
0
},
},
},
mutations
:
{
behavior_startEdit
(
state
,
{
originData
,
behaviors
,
event
})
{
...
...
@@ -42,7 +51,7 @@ export const behaviorStore = {
sub
:
{
[
subEntryUUID
]:
{
uuid
:
subEntryUUID
,
alias
:
'Entry'
,
alias
:
i18n
.
t
(
'Entry'
)
,
meta
:
'entry'
,
design
:
{
x
:
10
,
...
...
@@ -76,6 +85,18 @@ export const behaviorStore = {
}
}
},
clearProcessStack
(
state
)
{
state
.
processStack
.
splice
(
0
);
updatePropsEditable
(
state
);
},
pushProcessStack
(
state
,
process
)
{
state
.
processStack
.
push
(
process
);
updatePropsEditable
(
state
);
},
popProcessStack
(
state
,
index
)
{
state
.
processStack
.
splice
(
index
);
updatePropsEditable
(
state
);
},
},
getters
:
{
customProcessMap
:
state
=>
{
...
...
@@ -108,7 +129,7 @@ export const behaviorStore = {
behavior_getAssetByUUID
:
state
=>
uuid
=>
{
return
state
.
data
.
assets
.
find
(
item
=>
item
.
uuid
===
uuid
);
},
behavior_views
:
state
=>
{
behavior_views
:
state
=>
{
return
state
.
data
.
views
;
}
},
...
...
@@ -116,7 +137,7 @@ export const behaviorStore = {
addCustomProcessMeta
({
commit
,
state
})
{
let
meta
=
{
id
:
generateUUID
(),
name
:
'Custom'
,
name
:
i18n
.
t
(
'Custom'
)
,
script
:
''
,
props
:
{},
output
:
[
'success'
,
'failed'
],
...
...
@@ -127,7 +148,7 @@ export const behaviorStore = {
addDividerProcessMeta
({
commit
,
state
})
{
let
meta
=
{
id
:
generateUUID
(),
name
:
'Divider'
,
name
:
i18n
.
t
(
'Divider'
)
,
isDivider
:
true
,
output
:
[
'p0'
],
};
...
...
@@ -136,3 +157,7 @@ export const behaviorStore = {
},
}
};
function
updatePropsEditable
(
state
)
{
state
.
editable
=
state
.
processStack
.
filter
(
item
=>
item
.
meta
.
type
===
'builtin'
)
<=
0
;
}
src/store/modules/env.js
View file @
c0681ad5
...
...
@@ -34,13 +34,13 @@ export const envStore = {
const
dividerProcess
=
{
id
:
'divider'
,
name
:
'Divider'
,
name
:
i18n
.
t
(
'Divider'
)
,
desc
:
i18n
.
t
(
'Divider node desc'
),
//'分流节点,出口会按顺序一次执行',
};
tree
.
unshift
(
dividerProcess
);
const
customProcess
=
{
id
:
'custom'
,
name
:
'Custom'
,
name
:
i18n
.
t
(
'Custom'
)
,
desc
:
i18n
.
t
(
'Custom node desc'
),
//'自定义节点',
};
tree
.
unshift
(
customProcess
);
...
...
src/views/Editor/behavior-editor/BehaviorEditor.vue
View file @
c0681ad5
...
...
@@ -37,7 +37,6 @@
props
:
[],
data
()
{
return
{
processStack
:
[],
metaInEditing
:
null
,
}
},
...
...
@@ -57,14 +56,12 @@
},
...
mapState
({
behavior
:
state
=>
state
.
behavior
.
currentBehavior
,
processStack
:
state
=>
state
.
behavior
.
processStack
,
}),
...
mapGetters
([
'prefabProcessTree'
,
'builtinProcessTree'
])
},
mounted
()
{
]),
},
methods
:
{
resolveProcess
(
id
)
{
...
...
@@ -75,7 +72,7 @@
}
},
edit
()
{
this
.
processStack
.
splice
(
0
);
this
.
clearProcessStack
(
);
let
process
=
new
Process
(
null
,
this
.
behavior
,
this
.
resolveProcess
);
this
.
editProcess
(
process
);
},
...
...
@@ -83,12 +80,12 @@
this
.
$refs
.
properties
.
edit
(
process
);
},
editProcess
(
process
)
{
this
.
p
rocessStack
.
push
(
process
);
this
.
p
ushProcessStack
(
process
);
this
.
$refs
.
board
.
edit
(
process
,
this
.
resolveProcess
);
this
.
$refs
.
properties
.
edit
();
},
onPop
(
index
)
{
this
.
p
rocessStack
.
splice
(
index
+
1
);
this
.
p
opProcessStack
(
index
+
1
);
let
process
=
this
.
processStack
[
this
.
processStack
.
length
-
1
];
this
.
$refs
.
board
.
edit
(
process
,
this
.
resolveProcess
);
this
.
$refs
.
properties
.
edit
();
...
...
@@ -131,6 +128,10 @@
...
mapMutations
([
'updateProcesses'
,
'deleteProcessMeta'
,
'updatePropsEditable'
,
'clearProcessStack'
,
'pushProcessStack'
,
'popProcessStack'
,
]),
...
mapGetters
([
'metaInUse'
,
...
...
src/views/Editor/behavior-editor/Board.vue
View file @
c0681ad5
...
...
@@ -29,7 +29,6 @@
import
LinkLine
from
"./Board/LinkLine"
;
import
ToolTip
from
"./Board/ToolTip"
;
import
{
DOCK_POINT_OFFSET
}
from
"../../../config"
;
import
{
state
}
from
"./Board/state"
;
import
events
from
"../../../global-events"
;
import
generateUUID
from
"uuid/v4"
;
//todo 缩放功能
...
...
@@ -53,7 +52,11 @@
mounted
()
{
},
computed
:
{},
computed
:
{
...
mapState
({
drawState
:
state
=>
state
.
behavior
.
drawState
})
},
methods
:
{
...
mapActions
([
'addCustomProcessMeta'
,
...
...
@@ -141,8 +144,8 @@
},
onResize
(){
const
{
x
,
y
}
=
this
.
$el
.
getBoundingClientRect
();
s
tate
.
boardOffset
.
x
=
x
;
s
tate
.
boardOffset
.
y
=
y
;
this
.
drawS
tate
.
boardOffset
.
x
=
x
;
this
.
drawS
tate
.
boardOffset
.
y
=
y
;
},
measure
()
{
this
.
onResize
();
...
...
@@ -170,14 +173,14 @@
addLine
(
process
,
outputID
,
outputType
,
outputIndex
)
{
const
nextProcess
=
this
.
subProcessMap
[
outputID
];
if
(
nextProcess
)
{
this
.
$set
(
this
.
lines
,
s
tate
.
lineID
,
{
id
:
s
tate
.
lineID
,
this
.
$set
(
this
.
lines
,
this
.
drawS
tate
.
lineID
,
{
id
:
this
.
drawS
tate
.
lineID
,
prev
:
process
,
next
:
nextProcess
.
data
,
outputType
,
outputIndex
,
});
s
tate
.
lineID
++
;
this
.
drawS
tate
.
lineID
++
;
}
},
onPinHover
(
x
,
y
,
pin
)
{
...
...
@@ -196,12 +199,12 @@
const
startPos
=
process
.
design
.
output
[
pin
][
0
];
this
.
drawingLineStart
=
`M
${
startPos
.
x
+
x
-
DOCK_POINT_OFFSET
}
,
${
startPos
.
y
+
y
+
DOCK_POINT_OFFSET
}
C
${
startPos
.
x
+
x
+
100
}
,
${
startPos
.
y
+
y
}
`
;
this
.
lineDrawing
.
visible
=
true
;
s
tate
.
drawing
=
true
;
this
.
drawS
tate
.
drawing
=
true
;
this
.
onMouseMove
(
e
);
},
onMouseMove
(
e
)
{
let
x
=
e
.
x
-
s
tate
.
boardOffset
.
x
;
let
y
=
e
.
y
-
s
tate
.
boardOffset
.
y
;
let
x
=
e
.
x
-
this
.
drawS
tate
.
boardOffset
.
x
;
let
y
=
e
.
y
-
this
.
drawS
tate
.
boardOffset
.
y
;
this
.
lineDrawing
.
path
=
this
.
drawingLineStart
+
`
${
x
}
,
${
y
}
${
x
}
,
${
y
}
`
;
},
onMouseUp
(
e
)
{
...
...
@@ -209,13 +212,13 @@
document
.
removeEventListener
(
"mouseup"
,
this
.
onMouseUp
);
this
.
lineDrawing
.
visible
=
false
;
s
tate
.
drawing
=
false
;
this
.
drawS
tate
.
drawing
=
false
;
if
(
state
.
targetUUID
&&
s
tate
.
targetUUID
!==
this
.
processDrawing
.
uuid
)
{
this
.
processDrawing
.
output
[
this
.
pointDrawing
]
=
[
s
tate
.
targetUUID
];
this
.
addLine
(
this
.
processDrawing
,
s
tate
.
targetUUID
,
this
.
pointDrawing
,
0
);
if
(
this
.
drawState
.
targetUUID
&&
this
.
drawS
tate
.
targetUUID
!==
this
.
processDrawing
.
uuid
)
{
this
.
processDrawing
.
output
[
this
.
pointDrawing
]
=
[
this
.
drawS
tate
.
targetUUID
];
this
.
addLine
(
this
.
processDrawing
,
this
.
drawS
tate
.
targetUUID
,
this
.
pointDrawing
,
0
);
s
tate
.
targetUUID
=
null
;
this
.
drawS
tate
.
targetUUID
=
null
;
}
},
onDeleteLine
(
line
)
{
...
...
src/views/Editor/behavior-editor/Board/ProcessNode.vue
View file @
c0681ad5
...
...
@@ -40,8 +40,8 @@
</template>
<
script
>
import
{
mapState
}
from
"vuex"
;
import
DockPin
from
"./DockPin"
;
import
{
state
}
from
"./state"
;
import
events
from
"../../../../global-events"
;
import
{
linkedFlag
}
from
"../../../../utils"
;
...
...
@@ -75,6 +75,9 @@
data
()
{
return
this
.
process
.
data
;
},
...
mapState
({
drawState
:
state
=>
state
.
behavior
.
drawState
}),
},
watch
:
{
process
(
v
)
{
...
...
@@ -125,13 +128,13 @@
this
.
active
=
active
;
},
onMouseEnter
(
e
)
{
if
(
s
tate
.
drawing
&&
this
.
meta
.
id
!==
'entry'
)
{
s
tate
.
targetUUID
=
this
.
data
.
uuid
;
if
(
this
.
drawS
tate
.
drawing
&&
this
.
meta
.
id
!==
'entry'
)
{
this
.
drawS
tate
.
targetUUID
=
this
.
data
.
uuid
;
}
},
onMouseLeave
(
e
)
{
if
(
s
tate
.
drawing
)
{
s
tate
.
targetUUID
=
null
;
if
(
this
.
drawS
tate
.
drawing
)
{
this
.
drawS
tate
.
targetUUID
=
null
;
}
},
onMouseDown
(
e
)
{
...
...
@@ -171,7 +174,7 @@
},
updateDockPointPos
()
{
const
{
x
:
dx
,
y
:
dy
}
=
this
.
process
.
data
.
design
;
const
{
x
:
offX
,
y
:
offY
}
=
s
tate
.
boardOffset
;
const
{
x
:
offX
,
y
:
offY
}
=
this
.
drawS
tate
.
boardOffset
;
for
(
let
side
of
[
'input'
,
'output'
])
{
let
container
=
this
.
$refs
[
side
+
'Dock'
];
let
sideMeta
=
side
===
'input'
?
this
.
inputMeta
:
this
.
meta
[
side
];
...
...
src/views/Editor/behavior-editor/Board/state.js
deleted
100644 → 0
View file @
ff8abbd3
/**
* Created by rockyl on 2019-10-08.
*/
export
const
state
=
{
drawing
:
false
,
targetUUID
:
''
,
lineID
:
0
,
boardOffset
:
{
x
:
0
,
y
:
0
},
};
src/views/Editor/behavior-editor/PropertiesEditor.vue
View file @
c0681ad5
<
template
>
<div
class=
"wrapper"
v-if=
"process"
>
<el-input
class=
"name-input"
v-model=
"process.data.alias"
clearable
:placeholder=
"process.meta.name"
size=
"mini"
>
<el-input
:readonly=
"!editable"
class=
"name-input"
v-model=
"process.data.alias"
clearable
:placeholder=
"process.meta.name"
size=
"mini"
>
<template
slot=
"prepend"
>
{{
$t
(
'Name'
)
}}
</
template
>
</el-input>
<el-scrollbar
class=
"scrollbar"
wrap-class=
"wrap-x-hidden"
...
...
@@ -13,6 +13,7 @@
:property=
"property"
:container=
"process"
:key=
"key"
:editable=
"editable"
/>
</el-form>
</el-scrollbar>
...
...
@@ -20,6 +21,7 @@
</template>
<
script
>
import
{
mapState
}
from
"vuex"
;
import
NumberEditor
from
"./editors/NumberEditor"
;
import
StringEditor
from
"./editors/StringEditor"
;
import
EnumEditor
from
"./editors/EnumEditor"
;
...
...
@@ -46,6 +48,11 @@
process
:
null
,
}
},
computed
:
{
...
mapState
({
editable
:
state
=>
state
.
behavior
.
editable
,
}),
},
methods
:
{
edit
(
process
)
{
this
.
process
=
process
;
...
...
src/views/Editor/behavior-editor/editors/AssetEditor.vue
View file @
c0681ad5
<
template
>
<editor-wrapper
:value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<el-select
:value=
"editValue"
@
input=
"onInput"
:placeholder=
"property.default"
class=
"el-select"
>
<editor-wrapper
:
editable=
"editable"
:
value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<el-select
:
disabled=
"!editable"
:
value=
"editValue"
@
input=
"onInput"
:placeholder=
"property.default"
class=
"el-select"
>
<el-option
v-for=
"(item, key) in assets"
:key=
"key"
...
...
@@ -19,7 +19,7 @@
export
default
{
name
:
"AssetEditor"
,
components
:
{
EditorWrapper
,},
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
],
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
,
'editable'
],
computed
:
{
editValue
()
{
return
this
.
value
===
undefined
?
this
.
property
.
default
:
this
.
value
;
...
...
src/views/Editor/behavior-editor/editors/BooleanEditor.vue
View file @
c0681ad5
<
template
>
<editor-wrapper
:value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<el-switch
:value=
"editValue"
@
input=
"onInput"
<editor-wrapper
:
editable=
"editable"
:
value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<el-switch
:
disabled=
"!editable"
:
value=
"editValue"
@
input=
"onInput"
class=
"picker"
></el-switch>
</editor-wrapper>
</
template
>
...
...
@@ -11,7 +11,7 @@
export
default
{
name
:
"BooleanEditor"
,
components
:
{
EditorWrapper
},
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
],
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
,
'editable'
],
data
()
{
return
{}
},
...
...
src/views/Editor/behavior-editor/editors/ColorEditor.vue
View file @
c0681ad5
<
template
>
<editor-wrapper
:value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
class=
"color-editor-container"
>
<editor-wrapper
:
editable=
"editable"
:
value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
class=
"color-editor-container"
>
<el-color-picker
:disabled=
"!editable"
class=
"picker"
:value=
"editValue"
@
input=
"onInput"
...
...
@@ -16,7 +17,7 @@
export
default
{
name
:
"ColorEditor"
,
components
:
{
EditorWrapper
,},
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
],
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
,
'editable'
],
data
()
{
return
{
predefineColors
:
[
...
...
src/views/Editor/behavior-editor/editors/EditorWrapper.vue
View file @
c0681ad5
...
...
@@ -9,13 +9,14 @@
</
template
>
<el-popover
trigger=
"click"
:disabled=
"!editable"
>
<div>
<span>
{{$t('Link to parent')}}:
</span>
<el-switch
:value=
"linked"
@
input=
"onChange"
/>
</div>
<el-link
style=
"padding: 3px;"
slot=
"reference"
icon=
"el-icon-link"
:underline=
"false"
:type=
"linked ? 'success' : 'default'"
/>
:type=
"linked ? 'success' : 'default'"
:disabled=
"!editable"
/>
</el-popover>
</el-form-item>
</template>
...
...
@@ -33,6 +34,7 @@
value
:
{},
container
:
{},
propertyName
:
String
,
editable
:
Boolean
,
contentWidth
:
{
type
:
String
,
default
:
'65%'
,
...
...
src/views/Editor/behavior-editor/editors/EnumEditor.vue
View file @
c0681ad5
<
template
>
<editor-wrapper
:value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<el-select
:value=
"editValue"
@
input=
"onInput"
:placeholder=
"property.default"
class=
"el-select"
>
<editor-wrapper
:
editable=
"editable"
:
value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<el-select
:
disabled=
"!editable"
:
value=
"editValue"
@
input=
"onInput"
:placeholder=
"property.default"
class=
"el-select"
>
<el-option
v-for=
"(item, key) in property.enum"
:key=
"item"
...
...
@@ -19,7 +19,7 @@
export
default
{
name
:
"EnumEditor"
,
components
:
{
EditorWrapper
,},
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
],
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
,
'editable'
],
computed
:
{
editValue
()
{
return
this
.
value
===
undefined
?
this
.
property
.
default
:
this
.
value
;
...
...
src/views/Editor/behavior-editor/editors/NodeSelectEditor.vue
View file @
c0681ad5
<
template
>
<editor-wrapper
:value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<editor-wrapper
:
editable=
"editable"
:
value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<div
style=
"display: flex;flex: 1;"
>
<el-popover
placement=
"top"
...
...
@@ -34,13 +34,13 @@
</el-button-group>
</div>
</div>
<el-input
clearable
slot=
"reference"
v-model=
"editValue"
@
change=
"onInput"
placeholder=
"unset"
>
<el-input
clearable
slot=
"reference"
v-model=
"editValue"
@
change=
"onInput"
placeholder=
"unset"
:readonly=
"!editable"
>
<template
slot=
"prepend"
>
node://
</
template
>
</el-input>
</el-popover>
<el-button-group>
<el-button
:icon=
"editButtonIcon"
@
click=
"onClickEdit"
></el-button>
<el-button
icon=
"el-icon-delete"
@
click=
"onClickClean"
></el-button>
<el-button
:icon=
"editButtonIcon"
@
click=
"onClickEdit"
:disabled=
"!editable"
></el-button>
<el-button
icon=
"el-icon-delete"
@
click=
"onClickClean"
:disabled=
"!editable"
></el-button>
</el-button-group>
</div>
</editor-wrapper>
...
...
@@ -55,7 +55,7 @@
export
default
{
name
:
"NodeSelectEditor"
,
components
:
{
EditorWrapper
,},
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
],
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
,
'editable'
],
data
()
{
return
{
editValueOrigin
:
this
.
value
,
...
...
src/views/Editor/behavior-editor/editors/NumberEditor.vue
View file @
c0681ad5
<
template
>
<editor-wrapper
:value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<el-input-number
:value=
"editValue"
@
input=
"onInput"
controls-position=
"right"
<editor-wrapper
:
editable=
"editable"
:
value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<el-input-number
:
disabled=
"!editable"
:
value=
"editValue"
@
input=
"onInput"
controls-position=
"right"
:placeholder=
"defaultValue"
></el-input-number>
</editor-wrapper>
</
template
>
...
...
@@ -12,7 +12,7 @@
export
default
{
name
:
"NumberEditor"
,
components
:
{
EditorWrapper
,},
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
],
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
,
'editable'
],
computed
:
{
editValue
()
{
return
this
.
value
===
undefined
?
this
.
property
.
default
:
this
.
value
;
...
...
src/views/Editor/behavior-editor/editors/StringEditor.vue
View file @
c0681ad5
<
template
>
<editor-wrapper
:value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<editor-wrapper
:
editable=
"editable"
:
value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<div
style=
"display: flex;flex: 1;"
>
<el-popover
placement=
"top"
...
...
@@ -8,6 +8,7 @@
trigger=
"manual"
width=
"400"
v-model=
"popoverVisible"
:disabled=
"!editable"
>
<div>
<el-input
...
...
@@ -25,12 +26,12 @@
</el-button-group>
</div>
</div>
<el-input
clearable
slot=
"reference"
:value=
"editValue"
@
input=
"onInput"
@
change=
"onChange"
<el-input
clearable
slot=
"reference"
:value=
"editValue"
@
input=
"onInput"
@
change=
"onChange"
:readonly=
"!editable"
:placeholder=
"defaultValue"
/>
</el-popover>
<el-button-group>
<el-button
:icon=
"editButtonIcon"
@
click=
"onClickEdit"
></el-button>
<el-button
icon=
"el-icon-delete"
@
click=
"onClickClean"
></el-button>
<el-button
:icon=
"editButtonIcon"
@
click=
"onClickEdit"
:disabled=
"!editable"
></el-button>
<el-button
icon=
"el-icon-delete"
@
click=
"onClickClean"
:disabled=
"!editable"
></el-button>
</el-button-group>
</div>
</editor-wrapper>
...
...
@@ -43,7 +44,7 @@
export
default
{
name
:
"StringEditor"
,
components
:
{
EditorWrapper
,},
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
],
props
:
[
'value'
,
'container'
,
'property'
,
'propertyName'
,
'editable'
],
data
()
{
return
{
editValueOrigin
:
this
.
value
,
...
...
src/views/Editor/dialogs/BehaviorEditorDialog.vue
View file @
c0681ad5
...
...
@@ -43,7 +43,7 @@
this
.
$emit
(
'change'
);
},
beforeClose
(
done
)
{
this
.
$confirm
(
this
.
$t
(
'Save this behavior before
?
'
),
this
.
$t
(
'Alert'
),
{
this
.
$confirm
(
this
.
$t
(
'Save this behavior before'
),
this
.
$t
(
'Alert'
),
{
showClose
:
false
,
closeOnClickModal
:
false
,
closeOnPressEscape
:
false
,
...
...
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