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
6e54520f
Commit
6e54520f
authored
Nov 12, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
meta编辑器一些字段必填
parent
c0681ad5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
23 deletions
+39
-23
en.json
src/locales/en.json
+4
-0
MetaEditorDialog.vue
src/views/Editor/behavior-editor/MetaEditorDialog.vue
+34
-22
AssetEditor.vue
src/views/Editor/behavior-editor/editors/AssetEditor.vue
+1
-1
No files found.
src/locales/en.json
View file @
6e54520f
...
...
@@ -13,8 +13,12 @@
"Export"
:
"Export"
,
"Upload"
:
"Upload"
,
"Edit"
:
"Edit"
,
"ID"
:
"ID"
,
"Name"
:
"Name"
,
"Output"
:
"Output"
,
"Code"
:
"Code"
,
"Desc"
:
"Desc"
,
"Empty"
:
"Empty"
,
"Event"
:
"Event"
,
"No desc"
:
"No desc"
,
"Description"
:
"Description"
,
...
...
src/views/Editor/behavior-editor/MetaEditorDialog.vue
View file @
6e54520f
...
...
@@ -3,37 +3,34 @@
:close-on-click-modal=
"false"
:append-to-body=
"true"
>
<div
class=
"meta-editor-wrapper"
>
<el-form
class=
"info-editor"
size=
"mini"
label-position=
"right"
label-width=
"70px"
>
<template
v-if=
"meta"
>
<el-form-item
label=
"ID"
>
<el-input
v-model=
"meta.id"
placeholder=
"ID
"
:readonly=
"!editable"
/>
<el-form
ref=
"form"
v-if=
"meta"
:model=
"meta"
:rules=
"rules"
:show-message=
"false"
class=
"info-editor"
size=
"mini"
label-position=
"right"
label-width=
"70px"
>
<template>
<el-form-item
prop=
"id"
label=
"ID"
>
<el-input
v-model=
"meta.id"
:placeholder=
"$t('ID')
"
:readonly=
"!editable"
/>
</el-form-item>
<el-form-item
label=
"Name"
>
<el-input
v-model=
"meta.name"
placeholder=
"Name
"
:readonly=
"!editable"
/>
<el-form-item
prop=
"name"
label=
"Name"
>
<el-input
v-model=
"meta.name"
:placeholder=
"$t('Name')
"
:readonly=
"!editable"
/>
</el-form-item>
</
template
>
<
template
v-if=
"meta"
>
<el-form-item
label=
"Desc"
>
<el-input
v-model=
"meta.desc"
placeholder=
"Description"
:readonly=
"!editable"
/>
<el-form-item
prop=
"desc"
label=
"Desc"
>
<el-input
v-model=
"meta.desc"
:placeholder=
"$t('Description')"
: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"
>
<el-tag
type=
"success"
size=
"mini"
v-for=
"(option, key) in meta.props"
:key=
"key"
>
{{
key
}}
</el-tag>
</
template
>
<
template
v-else
>
Nothing
</
template
>
<
template
v-else
>
{{
$t
(
'Empty'
)
}}
</
template
>
</el-link>
</el-form-item>
<el-form-item
label=
"Output"
>
<div
style=
"display: flex;flex: 1;"
>
<el-select
style=
"flex: 1;"
v-model=
"meta.output"
:disabled=
"!editable"
allow-create
filterable
multiple
placeholder=
"Output
"
/>
:placeholder=
"$t('Output')
"
/>
</div>
</el-form-item>
</template>
</el-form>
<el-input
v-if=
"meta"
class=
"script-editor"
:readonly=
" !editable"
type=
"textarea"
<el-input
v-if=
"meta"
class=
"script-editor"
:readonly=
" !editable"
type=
"textarea"
:placeholder=
"$t('Code')"
v-model=
"meta.script"
></el-input>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -58,6 +55,15 @@
visible
:
false
,
meta
:
null
,
propsEditorVisible
:
false
,
rules
:
{
id
:
[
{
required
:
true
,
message
:
''
,
trigger
:
'blur'
},
],
name
:
[
{
required
:
true
,
message
:
''
,
trigger
:
'blur'
}
],
},
}
},
computed
:
{
...
...
@@ -78,6 +84,8 @@
this
.
$refs
.
propsEditorDialog
.
edit
(
this
.
meta
.
props
);
},
save
()
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
this
.
oldMetaID
!==
this
.
meta
.
id
&&
this
.
$store
.
getters
.
metaIDExists
(
this
.
meta
.
id
))
{
this
.
$alert
(
this
.
$t
(
'This Meta ID is in use, can not save'
),
this
.
$t
(
'Alert'
))
.
catch
((
e
)
=>
{
...
...
@@ -86,6 +94,10 @@
this
.
$emit
(
'input'
,
this
.
meta
);
this
.
visible
=
false
;
}
}
else
{
return
false
;
}
});
},
cancel
()
{
this
.
visible
=
false
;
...
...
src/views/Editor/behavior-editor/editors/AssetEditor.vue
View file @
6e54520f
<
template
>
<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-select
:disabled=
"!editable"
:value=
"editValue"
filterable
@
input=
"onInput"
:placeholder=
"property.default"
class=
"el-select"
>
<el-option
v-for=
"(item, key) in assets"
:key=
"key"
...
...
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