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