Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
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
谢林臻
sun
Commits
76680cf8
Commit
76680cf8
authored
6 years ago
by
zhanglu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型可不传
parent
6264a024
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
44 deletions
+43
-44
FaceStarDetail.vue
vu/src/views/face/components/FaceStarDetail.vue
+43
-44
No files found.
vu/src/views/face/components/FaceStarDetail.vue
View file @
76680cf8
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<el-form
ref=
"postForm"
:model=
"postForm"
:rules=
"rules"
class=
"form-container"
>
<el-form
ref=
"postForm"
:model=
"postForm"
:rules=
"rules"
class=
"form-container"
>
<sticky
:class-name=
"'sub-navbar '+postForm.status"
>
<sticky
:class-name=
"'sub-navbar '+postForm.status"
>
<el-button
v-loading=
"loading"
style=
"margin-left: 10px;"
type=
"success"
@
click=
"submitForm"
:disabled=
"isdisabledFn
"
>
保存
<el-button
v-loading=
"loading"
:disabled=
"isdisabledFn"
style=
"margin-left: 10px;"
type=
"success"
@
click=
"submitForm
"
>
保存
</el-button>
</el-button>
</sticky>
</sticky>
...
@@ -27,10 +27,16 @@
...
@@ -27,10 +27,16 @@
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label-width=
"75px"
label=
"*性别:"
prop=
"gender"
>
<el-form-item
label-width=
"75px"
label=
"*性别:"
prop=
"gender"
>
<el-select
v-model=
"postForm.sex"
:placeholder=
"'性别:'"
clearable
<el-select
v-model=
"postForm.sex"
:placeholder=
"'性别:'"
clearable
class=
"postInfo-container-item"
class=
"postInfo-container-item"
style=
"width: 230px"
>
style=
"width: 230px"
>
<el-option
v-for=
"item in GenderTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
<el-option
v-for=
"item in GenderTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
:value=
"item.key"
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -43,15 +49,15 @@
...
@@ -43,15 +49,15 @@
<div>
<div>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"*原图:"
prop=
"avatar"
>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"*原图:"
prop=
"avatar"
>
<span
v-model=
"uploadType"
></span
>
<span
v-model=
"uploadType"
/
>
<FaceUpload
v-model=
"postForm.ordinary_image_url"
:upload
T
ype=
"uploadType"
/>
<FaceUpload
v-model=
"postForm.ordinary_image_url"
:upload
-t
ype=
"uploadType"
/>
</el-form-item>
</el-form-item>
</div>
</div>
<div>
<div>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"*模型:"
prop=
"avatar"
>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"*模型:"
prop=
"avatar"
>
<span
v-model=
"uploadType"
></span
>
<span
v-model=
"uploadType"
/
>
<FaceUpload
v-model=
"postForm.modeling_obj_url"
:upload
T
ype=
"uploadType"
/>
<FaceUpload
v-model=
"postForm.modeling_obj_url"
:upload
-t
ype=
"uploadType"
/>
</el-form-item>
</el-form-item>
</div>
</div>
</el-card>
</el-card>
...
@@ -63,44 +69,44 @@
...
@@ -63,44 +69,44 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
Tinymce
from
'@/components/Tinymce'
import
Tinymce
from
'@/components/Tinymce'
import
FaceUpload
from
'@/components/Upload/faceupload'
import
FaceUpload
from
'@/components/Upload/faceupload'
import
MDinput
from
'@/components/MDinput'
import
MDinput
from
'@/components/MDinput'
import
Sticky
from
'@/components/Sticky'
// 粘性header组件
import
Sticky
from
'@/components/Sticky'
// 粘性header组件
import
waves
from
'@/directive/waves'
import
waves
from
'@/directive/waves'
import
Pagination
from
'@/components/Pagination'
import
Pagination
from
'@/components/Pagination'
import
{
validateURL
}
from
'@/utils/validate'
import
{
validateURL
}
from
'@/utils/validate'
import
{
faceStarCreate
,
facestarDetail
}
from
'@/api/face_image_upload'
import
{
faceStarCreate
,
facestarDetail
}
from
'@/api/face_image_upload'
const
SexOptions
=
[
const
SexOptions
=
[
{
'key'
:
1
,
'display_name'
:
'男'
},
{
'key'
:
1
,
'display_name'
:
'男'
},
{
'key'
:
2
,
'display_name'
:
'女'
},
{
'key'
:
2
,
'display_name'
:
'女'
}
]
]
const
sexTypeKeyValue
=
SexOptions
.
reduce
((
acc
,
cur
)
=>
{
const
sexTypeKeyValue
=
SexOptions
.
reduce
((
acc
,
cur
)
=>
{
acc
[
cur
.
key
]
=
cur
.
display_name
acc
[
cur
.
key
]
=
cur
.
display_name
return
acc
return
acc
},
{})
},
{})
const
ValueToSexTypeKeyValue
=
SexOptions
.
reduce
((
acc
,
cur
)
=>
{
const
ValueToSexTypeKeyValue
=
SexOptions
.
reduce
((
acc
,
cur
)
=>
{
acc
[
cur
.
key
]
=
cur
.
display_name
acc
[
cur
.
key
]
=
cur
.
display_name
return
acc
return
acc
},
{})
},
{})
const
defaultForm
=
{
const
defaultForm
=
{
status
:
'draft'
,
status
:
'draft'
,
uploadType
:
''
,
uploadType
:
''
,
name
:
''
,
name
:
''
,
sex
:
''
,
sex
:
''
,
ordinary_image_url
:
''
,
ordinary_image_url
:
''
,
modeling_obj_url
:
''
,
modeling_obj_url
:
''
}
}
export
default
{
export
default
{
name
:
'FaceStarDetail'
,
name
:
'FaceStarDetail'
,
components
:
{
Tinymce
,
MDinput
,
FaceUpload
,
Sticky
,
Pagination
},
components
:
{
Tinymce
,
MDinput
,
FaceUpload
,
Sticky
,
Pagination
},
directives
:
{
waves
},
directives
:
{
waves
},
props
:
{
props
:
{
isEdit
:
{
isEdit
:
{
type
:
Boolean
,
type
:
Boolean
,
...
@@ -127,13 +133,13 @@
...
@@ -127,13 +133,13 @@
tags
:
[],
tags
:
[],
rules
:
{
rules
:
{
name
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
name
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
sex
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
sex
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}]
},
},
tempRoute
:
{},
tempRoute
:
{},
GenderTypeOptions
:
[
GenderTypeOptions
:
[
{
'key'
:
1
,
'display_name'
:
'男'
},
{
'key'
:
1
,
'display_name'
:
'男'
},
{
'key'
:
2
,
'display_name'
:
'女'
},
{
'key'
:
2
,
'display_name'
:
'女'
}
],
],
uploadType
:
-
99
,
uploadType
:
-
99
,
isdisabledFn
:
false
isdisabledFn
:
false
...
@@ -164,26 +170,20 @@
...
@@ -164,26 +170,20 @@
})
})
},
},
submitForm
()
{
submitForm
()
{
this
.
$refs
.
postForm
.
validate
(
valid
=>
{
this
.
$refs
.
postForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
this
.
loading
=
true
this
.
loading
=
true
if
(
this
.
postForm
.
ordinary_image_url
===
''
)
{
if
(
this
.
postForm
.
ordinary_image_url
===
''
)
{
this
.
$message
.
error
(
'头像一不能为空~'
)
this
.
$message
.
error
(
'头像一不能为空~'
)
this
.
loading
=
false
this
.
loading
=
false
return
false
return
false
}
}
if
(
this
.
postForm
.
modeling_obj_url
===
''
){
this
.
$message
.
error
(
'头像二不能为空~'
)
this
.
loading
=
false
return
false
}
const
gender
=
{
const
gender
=
{
'男'
:
1
,
'男'
:
1
,
'女'
:
2
'女'
:
2
}
}
this
.
isdisabledFn
=
true
this
.
isdisabledFn
=
true
if
(
gender
.
hasOwnProperty
(
this
.
postForm
.
sex
))
{
if
(
gender
.
hasOwnProperty
(
this
.
postForm
.
sex
))
{
this
.
postForm
.
sex
=
gender
[
this
.
postForm
.
sex
]
this
.
postForm
.
sex
=
gender
[
this
.
postForm
.
sex
]
}
}
this
.
isdisabledFn
=
true
this
.
isdisabledFn
=
true
...
@@ -202,8 +202,7 @@
...
@@ -202,8 +202,7 @@
type
:
'danger'
,
type
:
'danger'
,
duration
:
2000
duration
:
2000
})
})
});
})
this
.
postForm
.
status
=
'published'
this
.
postForm
.
status
=
'published'
this
.
loading
=
false
this
.
loading
=
false
...
@@ -224,9 +223,9 @@
...
@@ -224,9 +223,9 @@
if
(
!
response
.
data
.
data
.
data
)
return
if
(
!
response
.
data
.
data
.
data
)
return
this
.
tagListOptions
=
response
.
data
.
data
.
data
this
.
tagListOptions
=
response
.
data
.
data
.
data
})
})
},
}
}
}
}
}
</
script
>
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
...
...
This diff is collapsed.
Click to expand it.
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