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
1cc13b2d
Commit
1cc13b2d
authored
Dec 03, 2019
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--
parent
96011827
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
459 additions
and
0 deletions
+459
-0
BehaviorEditor_20191128104254.vue
.../Editor/behavior-editor/BehaviorEditor_20191128104254.vue
+153
-0
BehaviorEditor_20191203134213.vue
.../Editor/behavior-editor/BehaviorEditor_20191203134213.vue
+153
-0
BehaviorEditor_20191203134219.vue
.../Editor/behavior-editor/BehaviorEditor_20191203134219.vue
+153
-0
No files found.
.history/src/views/Editor/behavior-editor/BehaviorEditor_20191128104254.vue
0 → 100644
View file @
1cc13b2d
<
template
>
<div
class=
"behavior"
>
<split-panes>
<split-panes
splitpanes-min=
"10"
:splitpanes-size=
"10"
horizontal
>
<process-list
@
edit-meta=
"onEditMeta"
@
delete-meta=
"onDeleteMeta"
:data=
"prefabProcessTree"
class=
"background full-size"
splitpanes-min=
"20"
:splitpanes-size=
"30"
/>
<process-list
@
edit-meta=
"onEditMeta"
@
delete-meta=
"onDeleteMeta"
:data=
"normalProcessTree"
class=
"background full-size"
splitpanes-min=
"20"
:splitpanes-size=
"70"
/>
</split-panes>
<div
class=
"center full-size background"
splitpanes-min=
"20"
:splitpanes-size=
"70"
>
<edit-path
:processStack=
"processStack"
@
pop=
"onPop"
/>
<div
class=
"operate-bar"
>
<!--
<el-button-group>
<el-button
size=
"mini"
icon=
"el-icon-zoom-out"
@
click=
"setScale(-0.1)"
/>
<el-button
size=
"mini"
@
click=
"setScale(0)"
>
1:1
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-zoom-in"
@
click=
"setScale(0.1)"
/>
</el-button-group>
-->
</div>
<board
ref=
"board"
@
select-process-node=
"onSelectProcessNode"
@
edit-process=
"editProcess"
@
edit-meta=
"onEditMeta"
/>
</div>
<div
class=
"properties background full-size"
splitpanes-min=
"20"
:splitpanes-size=
"20"
>
<properties-editor
ref=
"properties"
/>
</div>
</split-panes>
<meta-editor-dialog
ref=
"metaEditorDialog"
@
input=
"onSaveMeta"
/>
</div>
</
template
>
<
script
>
import
{
mapState
,
mapMutations
,
mapGetters
,
mapActions
}
from
'vuex'
import
Board
from
"./Board"
;
import
SplitPanes
from
'splitpanes'
import
ProcessList
from
"./ProcessList"
;
import
PropertiesEditor
from
"./PropertiesEditor"
;
import
EditPath
from
"./Board/EditPath"
;
import
Process
from
"./Board/Process"
;
import
MetaEditorDialog
from
"./MetaEditorDialog"
;
export
default
{
name
:
"BehaviorEditor"
,
components
:
{
MetaEditorDialog
,
PropertiesEditor
,
EditPath
,
ProcessList
,
Board
,
SplitPanes
,},
props
:
[],
data
()
{
return
{
metaInEditing
:
null
,
}
},
computed
:
{
processContext
()
{
const
{
builtinsProcessMap
,
customProcessMap
}
=
this
.
$store
.
getters
;
return
[
builtinsProcessMap
,
customProcessMap
,
]
},
normalProcessTree
()
{
const
tree
=
this
.
builtinProcessTree
;
const
group
=
tree
.
find
(
item
=>
item
.
name
===
'custom'
);
group
.
children
=
this
.
$store
.
state
.
behavior
.
data
.
processes
;
return
tree
;
},
...
mapState
({
behavior
:
state
=>
state
.
behavior
.
currentBehavior
,
processStack
:
state
=>
state
.
behavior
.
processStack
,
}),
...
mapGetters
([
'prefabProcessTree'
,
'builtinProcessTree'
]),
},
methods
:
{
resolveProcess
(
id
)
{
for
(
let
context
of
this
.
processContext
)
{
if
(
context
[
id
])
{
return
context
[
id
];
}
}
},
edit
()
{
this
.
clearProcessStack
();
let
process
=
new
Process
(
null
,
this
.
behavior
,
this
.
resolveProcess
);
this
.
editProcess
(
process
);
},
onSelectProcessNode
(
process
)
{
this
.
$refs
.
properties
.
edit
(
process
);
},
editProcess
(
process
)
{
this
.
pushProcessStack
(
process
);
this
.
$refs
.
board
.
edit
(
process
,
this
.
resolveProcess
);
this
.
$refs
.
properties
.
edit
();
},
onPop
(
index
)
{
this
.
popProcessStack
(
index
+
1
);
let
process
=
this
.
processStack
[
this
.
processStack
.
length
-
1
];
this
.
$refs
.
board
.
edit
(
process
,
this
.
resolveProcess
);
this
.
$refs
.
properties
.
edit
();
},
onEditMeta
(
meta
)
{
this
.
metaInEditing
=
meta
;
this
.
$refs
.
metaEditorDialog
.
edit
(
meta
);
},
onDeleteMeta
(
meta
)
{
const
inUse
=
this
.
$store
.
getters
.
metaInUse
(
meta
.
id
);
if
(
inUse
)
{
this
.
$alert
(
this
.
$t
(
'Meta is in use, can not delete'
),
this
.
$t
(
'Alert'
))
.
catch
((
e
)
=>
{
});
}
else
{
this
.
$confirm
(
this
.
$t
(
'Are you sure to delete this meta'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Delete'
),
cancelButtonText
:
this
.
$t
(
'Cancel'
),
type
:
'warning'
}).
then
(()
=>
{
this
.
deleteProcessMeta
({
meta
});
}).
catch
((
e
)
=>
{
});
}
},
onSaveMeta
(
meta
)
{
let
oldMetaID
=
this
.
metaInEditing
.
id
;
for
(
let
key
in
meta
)
{
this
.
metaInEditing
[
key
]
=
meta
[
key
];
}
this
.
metaInEditing
=
null
;
if
(
oldMetaID
!==
meta
.
id
)
{
this
.
updateProcesses
({
targetMetaID
:
oldMetaID
,
replaceMetaID
:
meta
.
id
,
});
}
this
.
$refs
.
board
.
updateProcessNode
(
meta
.
id
);
},
...
mapMutations
([
'updateProcesses'
,
'deleteProcessMeta'
,
'updatePropsEditable'
,
'clearProcessStack'
,
'pushProcessStack'
,
'popProcessStack'
,
'setScale'
,
]),
...
mapGetters
([
'metaInUse'
,
]),
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
.history/src/views/Editor/behavior-editor/BehaviorEditor_20191203134213.vue
0 → 100644
View file @
1cc13b2d
<
template
>
<div
class=
"behavior"
>
<split-panes>
<split-panes
splitpanes-min=
"10"
:splitpanes-size=
"10"
horizontal
>
<process-list
@
edit-meta=
"onEditMeta"
@
delete-meta=
"onDeleteMeta"
:data=
"prefabProcessTree"
class=
"background full-size"
splitpanes-min=
"20"
:splitpanes-size=
"30"
/>
<process-list
@
edit-meta=
"onEditMeta"
@
delete-meta=
"onDeleteMeta"
:data=
"normalProcessTree"
class=
"background full-size"
splitpanes-min=
"20"
:splitpanes-size=
"70"
/>
</split-panes>
<div
class=
"center full-size background"
splitpanes-min=
"20"
:splitpanes-size=
"70"
>
<edit-path
:processStack=
"processStack"
@
pop=
"onPop"
/>
<div
class=
"operate-bar"
>
<!--
<el-button-group>
<el-button
size=
"mini"
icon=
"el-icon-zoom-out"
@
click=
"setScale(-0.1)"
/>
<el-button
size=
"mini"
@
click=
"setScale(0)"
>
1:1
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-zoom-in"
@
click=
"setScale(0.1)"
/>
</el-button-group>
-->
</div>
s
<board
ref=
"board"
@
select-proces-node=
"onSelectProcessNode"
@
edit-process=
"editProcess"
@
edit-meta=
"onEditMeta"
/>
</div>
<div
class=
"properties background full-size"
splitpanes-min=
"20"
:splitpanes-size=
"20"
>
<properties-editor
ref=
"properties"
/>
</div>
</split-panes>
<meta-editor-dialog
ref=
"metaEditorDialog"
@
input=
"onSaveMeta"
/>
</div>
</
template
>
<
script
>
import
{
mapState
,
mapMutations
,
mapGetters
,
mapActions
}
from
'vuex'
import
Board
from
"./Board"
;
import
SplitPanes
from
'splitpanes'
import
ProcessList
from
"./ProcessList"
;
import
PropertiesEditor
from
"./PropertiesEditor"
;
import
EditPath
from
"./Board/EditPath"
;
import
Process
from
"./Board/Process"
;
import
MetaEditorDialog
from
"./MetaEditorDialog"
;
export
default
{
name
:
"BehaviorEditor"
,
components
:
{
MetaEditorDialog
,
PropertiesEditor
,
EditPath
,
ProcessList
,
Board
,
SplitPanes
,},
props
:
[],
data
()
{
return
{
metaInEditing
:
null
,
}
},
computed
:
{
processContext
()
{
const
{
builtinsProcessMap
,
customProcessMap
}
=
this
.
$store
.
getters
;
return
[
builtinsProcessMap
,
customProcessMap
,
]
},
normalProcessTree
()
{
const
tree
=
this
.
builtinProcessTree
;
const
group
=
tree
.
find
(
item
=>
item
.
name
===
'custom'
);
group
.
children
=
this
.
$store
.
state
.
behavior
.
data
.
processes
;
return
tree
;
},
...
mapState
({
behavior
:
state
=>
state
.
behavior
.
currentBehavior
,
processStack
:
state
=>
state
.
behavior
.
processStack
,
}),
...
mapGetters
([
'prefabProcessTree'
,
'builtinProcessTree'
]),
},
methods
:
{
resolveProcess
(
id
)
{
for
(
let
context
of
this
.
processContext
)
{
if
(
context
[
id
])
{
return
context
[
id
];
}
}
},
edit
()
{
this
.
clearProcessStack
();
let
process
=
new
Process
(
null
,
this
.
behavior
,
this
.
resolveProcess
);
this
.
editProcess
(
process
);
},
onSelectProcessNode
(
process
)
{
this
.
$refs
.
properties
.
edit
(
process
);
},
editProcess
(
process
)
{
this
.
pushProcessStack
(
process
);
this
.
$refs
.
board
.
edit
(
process
,
this
.
resolveProcess
);
this
.
$refs
.
properties
.
edit
();
},
onPop
(
index
)
{
this
.
popProcessStack
(
index
+
1
);
let
process
=
this
.
processStack
[
this
.
processStack
.
length
-
1
];
this
.
$refs
.
board
.
edit
(
process
,
this
.
resolveProcess
);
this
.
$refs
.
properties
.
edit
();
},
onEditMeta
(
meta
)
{
this
.
metaInEditing
=
meta
;
this
.
$refs
.
metaEditorDialog
.
edit
(
meta
);
},
onDeleteMeta
(
meta
)
{
const
inUse
=
this
.
$store
.
getters
.
metaInUse
(
meta
.
id
);
if
(
inUse
)
{
this
.
$alert
(
this
.
$t
(
'Meta is in use, can not delete'
),
this
.
$t
(
'Alert'
))
.
catch
((
e
)
=>
{
});
}
else
{
this
.
$confirm
(
this
.
$t
(
'Are you sure to delete this meta'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Delete'
),
cancelButtonText
:
this
.
$t
(
'Cancel'
),
type
:
'warning'
}).
then
(()
=>
{
this
.
deleteProcessMeta
({
meta
});
}).
catch
((
e
)
=>
{
});
}
},
onSaveMeta
(
meta
)
{
let
oldMetaID
=
this
.
metaInEditing
.
id
;
for
(
let
key
in
meta
)
{
this
.
metaInEditing
[
key
]
=
meta
[
key
];
}
this
.
metaInEditing
=
null
;
if
(
oldMetaID
!==
meta
.
id
)
{
this
.
updateProcesses
({
targetMetaID
:
oldMetaID
,
replaceMetaID
:
meta
.
id
,
});
}
this
.
$refs
.
board
.
updateProcessNode
(
meta
.
id
);
},
...
mapMutations
([
'updateProcesses'
,
'deleteProcessMeta'
,
'updatePropsEditable'
,
'clearProcessStack'
,
'pushProcessStack'
,
'popProcessStack'
,
'setScale'
,
]),
...
mapGetters
([
'metaInUse'
,
]),
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
.history/src/views/Editor/behavior-editor/BehaviorEditor_20191203134219.vue
0 → 100644
View file @
1cc13b2d
<
template
>
<div
class=
"behavior"
>
<split-panes>
<split-panes
splitpanes-min=
"10"
:splitpanes-size=
"10"
horizontal
>
<process-list
@
edit-meta=
"onEditMeta"
@
delete-meta=
"onDeleteMeta"
:data=
"prefabProcessTree"
class=
"background full-size"
splitpanes-min=
"20"
:splitpanes-size=
"30"
/>
<process-list
@
edit-meta=
"onEditMeta"
@
delete-meta=
"onDeleteMeta"
:data=
"normalProcessTree"
class=
"background full-size"
splitpanes-min=
"20"
:splitpanes-size=
"70"
/>
</split-panes>
<div
class=
"center full-size background"
splitpanes-min=
"20"
:splitpanes-size=
"70"
>
<edit-path
:processStack=
"processStack"
@
pop=
"onPop"
/>
<div
class=
"operate-bar"
>
<!--
<el-button-group>
<el-button
size=
"mini"
icon=
"el-icon-zoom-out"
@
click=
"setScale(-0.1)"
/>
<el-button
size=
"mini"
@
click=
"setScale(0)"
>
1:1
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-zoom-in"
@
click=
"setScale(0.1)"
/>
</el-button-group>
-->
</div>
<board
ref=
"board"
@
select-process-node=
"onSelectProcessNode"
@
edit-process=
"editProcess"
@
edit-meta=
"onEditMeta"
/>
</div>
<div
class=
"properties background full-size"
splitpanes-min=
"20"
:splitpanes-size=
"20"
>
<properties-editor
ref=
"properties"
/>
</div>
</split-panes>
<meta-editor-dialog
ref=
"metaEditorDialog"
@
input=
"onSaveMeta"
/>
</div>
</
template
>
<
script
>
import
{
mapState
,
mapMutations
,
mapGetters
,
mapActions
}
from
'vuex'
import
Board
from
"./Board"
;
import
SplitPanes
from
'splitpanes'
import
ProcessList
from
"./ProcessList"
;
import
PropertiesEditor
from
"./PropertiesEditor"
;
import
EditPath
from
"./Board/EditPath"
;
import
Process
from
"./Board/Process"
;
import
MetaEditorDialog
from
"./MetaEditorDialog"
;
export
default
{
name
:
"BehaviorEditor"
,
components
:
{
MetaEditorDialog
,
PropertiesEditor
,
EditPath
,
ProcessList
,
Board
,
SplitPanes
,},
props
:
[],
data
()
{
return
{
metaInEditing
:
null
,
}
},
computed
:
{
processContext
()
{
const
{
builtinsProcessMap
,
customProcessMap
}
=
this
.
$store
.
getters
;
return
[
builtinsProcessMap
,
customProcessMap
,
]
},
normalProcessTree
()
{
const
tree
=
this
.
builtinProcessTree
;
const
group
=
tree
.
find
(
item
=>
item
.
name
===
'custom'
);
group
.
children
=
this
.
$store
.
state
.
behavior
.
data
.
processes
;
return
tree
;
},
...
mapState
({
behavior
:
state
=>
state
.
behavior
.
currentBehavior
,
processStack
:
state
=>
state
.
behavior
.
processStack
,
}),
...
mapGetters
([
'prefabProcessTree'
,
'builtinProcessTree'
]),
},
methods
:
{
resolveProcess
(
id
)
{
for
(
let
context
of
this
.
processContext
)
{
if
(
context
[
id
])
{
return
context
[
id
];
}
}
},
edit
()
{
this
.
clearProcessStack
();
let
process
=
new
Process
(
null
,
this
.
behavior
,
this
.
resolveProcess
);
this
.
editProcess
(
process
);
},
onSelectProcessNode
(
process
)
{
this
.
$refs
.
properties
.
edit
(
process
);
},
editProcess
(
process
)
{
this
.
pushProcessStack
(
process
);
this
.
$refs
.
board
.
edit
(
process
,
this
.
resolveProcess
);
this
.
$refs
.
properties
.
edit
();
},
onPop
(
index
)
{
this
.
popProcessStack
(
index
+
1
);
let
process
=
this
.
processStack
[
this
.
processStack
.
length
-
1
];
this
.
$refs
.
board
.
edit
(
process
,
this
.
resolveProcess
);
this
.
$refs
.
properties
.
edit
();
},
onEditMeta
(
meta
)
{
this
.
metaInEditing
=
meta
;
this
.
$refs
.
metaEditorDialog
.
edit
(
meta
);
},
onDeleteMeta
(
meta
)
{
const
inUse
=
this
.
$store
.
getters
.
metaInUse
(
meta
.
id
);
if
(
inUse
)
{
this
.
$alert
(
this
.
$t
(
'Meta is in use, can not delete'
),
this
.
$t
(
'Alert'
))
.
catch
((
e
)
=>
{
});
}
else
{
this
.
$confirm
(
this
.
$t
(
'Are you sure to delete this meta'
),
this
.
$t
(
'Alert'
),
{
confirmButtonText
:
this
.
$t
(
'Delete'
),
cancelButtonText
:
this
.
$t
(
'Cancel'
),
type
:
'warning'
}).
then
(()
=>
{
this
.
deleteProcessMeta
({
meta
});
}).
catch
((
e
)
=>
{
});
}
},
onSaveMeta
(
meta
)
{
let
oldMetaID
=
this
.
metaInEditing
.
id
;
for
(
let
key
in
meta
)
{
this
.
metaInEditing
[
key
]
=
meta
[
key
];
}
this
.
metaInEditing
=
null
;
if
(
oldMetaID
!==
meta
.
id
)
{
this
.
updateProcesses
({
targetMetaID
:
oldMetaID
,
replaceMetaID
:
meta
.
id
,
});
}
this
.
$refs
.
board
.
updateProcessNode
(
meta
.
id
);
},
...
mapMutations
([
'updateProcesses'
,
'deleteProcessMeta'
,
'updatePropsEditable'
,
'clearProcessStack'
,
'pushProcessStack'
,
'popProcessStack'
,
'setScale'
,
]),
...
mapGetters
([
'metaInUse'
,
]),
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
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