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
Hide 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 @@
...
@@ -13,8 +13,12 @@
"Export"
:
"Export"
,
"Export"
:
"Export"
,
"Upload"
:
"Upload"
,
"Upload"
:
"Upload"
,
"Edit"
:
"Edit"
,
"Edit"
:
"Edit"
,
"ID"
:
"ID"
,
"Name"
:
"Name"
,
"Name"
:
"Name"
,
"Output"
:
"Output"
,
"Code"
:
"Code"
,
"Desc"
:
"Desc"
,
"Desc"
:
"Desc"
,
"Empty"
:
"Empty"
,
"Event"
:
"Event"
,
"Event"
:
"Event"
,
"No desc"
:
"No desc"
,
"No desc"
:
"No desc"
,
"Description"
:
"Description"
,
"Description"
:
"Description"
,
...
...
src/views/Editor/behavior-editor/MetaEditorDialog.vue
View file @
6e54520f
...
@@ -3,37 +3,34 @@
...
@@ -3,37 +3,34 @@
:close-on-click-modal=
"false"
:close-on-click-modal=
"false"
:append-to-body=
"true"
>
:append-to-body=
"true"
>
<div
class=
"meta-editor-wrapper"
>
<div
class=
"meta-editor-wrapper"
>
<el-form
class=
"info-editor"
size=
"mini"
label-position=
"right"
label-width=
"70px"
>
<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
v-if=
"meta"
>
<template>
<el-form-item
label=
"ID"
>
<el-form-item
prop=
"id"
label=
"ID"
>
<el-input
v-model=
"meta.id"
placeholder=
"ID
"
:readonly=
"!editable"
/>
<el-input
v-model=
"meta.id"
:placeholder=
"$t('ID')
"
:readonly=
"!editable"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"Name"
>
<el-form-item
prop=
"name"
label=
"Name"
>
<el-input
v-model=
"meta.name"
placeholder=
"Name
"
:readonly=
"!editable"
/>
<el-input
v-model=
"meta.name"
:placeholder=
"$t('Name')
"
:readonly=
"!editable"
/>
</el-form-item>
</el-form-item>
</
template
>
<el-form-item
prop=
"desc"
label=
"Desc"
>
<el-input
v-model=
"meta.desc"
:placeholder=
"$t('Description')"
:readonly=
"!editable"
/>
<
template
v-if=
"meta"
>
<el-form-item
label=
"Desc"
>
<el-input
v-model=
"meta.desc"
placeholder=
"Description"
:readonly=
"!editable"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"Props"
>
<el-form-item
label=
"Props"
>
<el-link
:underline=
"false"
@
click=
"onClickEditProps"
:disabled=
"!editable"
>
<el-link
:underline=
"false"
@
click=
"onClickEditProps"
:disabled=
"!editable"
>
<template
v-if=
"Object.keys(meta.props).length"
>
<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>
<el-tag
type=
"success"
size=
"mini"
v-for=
"(option, key) in meta.props"
:key=
"key"
>
{{
key
}}
</el-tag>
</
template
>
</
template
>
<
template
v-else
>
Nothing
</
template
>
<
template
v-else
>
{{
$t
(
'Empty'
)
}}
</
template
>
</el-link>
</el-link>
</el-form-item>
</el-form-item>
<el-form-item
label=
"Output"
>
<el-form-item
label=
"Output"
>
<div
style=
"display: flex;flex: 1;"
>
<div
style=
"display: flex;flex: 1;"
>
<el-select
style=
"flex: 1;"
v-model=
"meta.output"
:disabled=
"!editable"
allow-create
filterable
multiple
<el-select
style=
"flex: 1;"
v-model=
"meta.output"
:disabled=
"!editable"
allow-create
filterable
multiple
placeholder=
"Output
"
/>
:placeholder=
"$t('Output')
"
/>
</div>
</div>
</el-form-item>
</el-form-item>
</template>
</template>
</el-form>
</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>
v-model=
"meta.script"
></el-input>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
@@ -58,6 +55,15 @@
...
@@ -58,6 +55,15 @@
visible
:
false
,
visible
:
false
,
meta
:
null
,
meta
:
null
,
propsEditorVisible
:
false
,
propsEditorVisible
:
false
,
rules
:
{
id
:
[
{
required
:
true
,
message
:
''
,
trigger
:
'blur'
},
],
name
:
[
{
required
:
true
,
message
:
''
,
trigger
:
'blur'
}
],
},
}
}
},
},
computed
:
{
computed
:
{
...
@@ -78,14 +84,20 @@
...
@@ -78,14 +84,20 @@
this
.
$refs
.
propsEditorDialog
.
edit
(
this
.
meta
.
props
);
this
.
$refs
.
propsEditorDialog
.
edit
(
this
.
meta
.
props
);
},
},
save
()
{
save
()
{
if
(
this
.
oldMetaID
!==
this
.
meta
.
id
&&
this
.
$store
.
getters
.
metaIDExists
(
this
.
meta
.
id
))
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
this
.
$alert
(
this
.
$t
(
'This Meta ID is in use, can not save'
),
this
.
$t
(
'Alert'
))
if
(
valid
)
{
.
catch
((
e
)
=>
{
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'
))
}
else
{
.
catch
((
e
)
=>
{
this
.
$emit
(
'input'
,
this
.
meta
);
});
this
.
visible
=
false
;
}
else
{
}
this
.
$emit
(
'input'
,
this
.
meta
);
this
.
visible
=
false
;
}
}
else
{
return
false
;
}
});
},
},
cancel
()
{
cancel
()
{
this
.
visible
=
false
;
this
.
visible
=
false
;
...
...
src/views/Editor/behavior-editor/editors/AssetEditor.vue
View file @
6e54520f
<
template
>
<
template
>
<editor-wrapper
:editable=
"editable"
:value=
"value"
:container=
"container"
:property=
"property"
:propertyName=
"propertyName"
>
<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
<el-option
v-for=
"(item, key) in assets"
v-for=
"(item, key) in assets"
:key=
"key"
: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