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
1
Merge Requests
1
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
alpha
sun
Commits
dc98b1f2
Commit
dc98b1f2
authored
Dec 12, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加face明星
parent
20f2f03a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
227 additions
and
17 deletions
+227
-17
face_star.py
api/face_star.py
+4
-3
face_image_upload.js
vu/src/api/face_image_upload.js
+2
-2
star.js
vu/src/router/modules/star.js
+15
-1
FaceStarDetail.vue
vu/src/views/face/components/FaceStarDetail.vue
+18
-3
create.vue
vu/src/views/face/create.vue
+4
-4
edit.vue
vu/src/views/face/edit.vue
+4
-4
list.vue
vu/src/views/face/list.vue
+180
-0
No files found.
api/face_star.py
View file @
dc98b1f2
...
...
@@ -22,17 +22,18 @@ class FaceStarEdit(APIView):
return
{
'data'
:
data
}
def
post
(
self
,
request
):
_id
=
request
.
POST
.
get
(
'id'
)
name
=
request
.
POST
.
get
(
'name'
)
sex
=
request
.
POST
.
get
(
'sex'
)
ordinary_image_url
=
request
.
POST
.
get
(
'ordinary_image_url'
)
modeling_obj_url
=
request
.
POST
.
get
(
'modeling_obj_url'
)
try
:
self
.
rpc
[
'mercury/face/create_star'
](
name
=
name
,
sex
=
sex
,
ordinary_image_url
=
ordinary_image_url
,
modeling_obj_url
=
modeling_obj_url
modeling_obj_url
=
modeling_obj_url
,
_id
=
_id
)
.
unwrap
()
except
Exception
as
e
:
raise
e
...
...
@@ -67,7 +68,7 @@ class StarListView(APIView):
else
:
updates
[
'is_online'
]
=
1
try
:
self
.
rpc
[
'mercury/face/star/
update'
](
ids
,
**
updates
)
.
unwrap
()
self
.
rpc
[
'mercury/face/star/
batch/update'
](
ids
=
ids
,
updates
=
updates
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'批量更新明星列表失败
%
s'
,
e
)
raise
...
...
vu/src/api/face_image_upload.js
View file @
dc98b1f2
...
...
@@ -19,13 +19,13 @@ export function fetchList(query) {
export
function
OffLineOrOnLine
(
data
)
{
console
.
log
(
data
)
return
request
({
url
:
'/api/face/list/update'
,
url
:
'/api/face/
star/
list/update'
,
method
:
'post'
,
data
})
}
export
function
f
etchPush
Detail
(
id
)
{
export
function
f
acestar
Detail
(
id
)
{
return
request
({
url
:
'/api/face/star/detail'
,
method
:
'get'
,
...
...
vu/src/router/modules/star.js
View file @
dc98b1f2
...
...
@@ -36,7 +36,21 @@ const StarRouter = {
path
:
'face/create'
,
component
:
()
=>
import
(
'@/views/face/create'
),
name
:
'CreateFaceStar'
,
meta
:
{
title
:
'Face明星'
,
icon
:
'edit'
},
meta
:
{
title
:
'创建Face明星'
,
icon
:
'edit'
},
hidden
:
true
},
{
path
:
'face/edit/:id(
\\
d+)'
,
component
:
()
=>
import
(
'@/views/face/edit'
),
name
:
'EditFaceStar'
,
meta
:
{
title
:
'编辑Face明星'
,
noCache
:
true
},
hidden
:
true
},
{
path
:
'face/list'
,
component
:
()
=>
import
(
'@/views/face/list'
),
name
:
'FaceStarList'
,
meta
:
{
title
:
'Face明星列表'
,
icon
:
'list'
},
hidden
:
true
},
]
...
...
vu/src/views/face/components/
Use
rDetail.vue
→
vu/src/views/face/components/
FaceSta
rDetail.vue
View file @
dc98b1f2
...
...
@@ -42,14 +42,14 @@
</el-row>
<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>
<FaceUpload
v-model=
"postForm.ordinary_image_url"
:uploadType=
"uploadType"
/>
</el-form-item>
</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>
<FaceUpload
v-model=
"postForm.modeling_obj_url"
:uploadType=
"uploadType"
/>
</el-form-item>
...
...
@@ -70,7 +70,7 @@
import
waves
from
'@/directive/waves'
import
Pagination
from
'@/components/Pagination'
import
{
validateURL
}
from
'@/utils/validate'
import
{
faceStarCreate
}
from
'@/api/face_image_upload'
import
{
faceStarCreate
,
facestarDetail
}
from
'@/api/face_image_upload'
const
defaultForm
=
{
...
...
@@ -131,8 +131,23 @@
}
},
created
()
{
if
(
this
.
isEdit
)
{
const
id
=
this
.
$route
.
params
&&
this
.
$route
.
params
.
id
this
.
fetchData
(
id
)
}
else
{
this
.
postForm
=
Object
.
assign
({},
defaultForm
)
}
this
.
tempRoute
=
Object
.
assign
({},
this
.
$route
)
},
methods
:
{
fetchData
(
id
)
{
facestarDetail
(
id
).
then
(
response
=>
{
this
.
postForm
=
response
.
data
.
data
.
data
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
submitForm
()
{
this
.
$refs
.
postForm
.
validate
(
valid
=>
{
...
...
vu/src/views/face/create.vue
View file @
dc98b1f2
<
template
>
<
use
r-detail
:is-edit=
"false"
/>
<
face-sta
r-detail
:is-edit=
"false"
/>
</
template
>
<
script
>
import
UserDetail
from
'./components/Use
rDetail'
import
FaceStarDetail
from
'./components/FaceSta
rDetail'
export
default
{
name
:
'Create
Use
r'
,
components
:
{
Use
rDetail
}
name
:
'Create
FaceSta
r'
,
components
:
{
FaceSta
rDetail
}
}
</
script
>
vu/src/views/face/edit.vue
View file @
dc98b1f2
<
template
>
<
use
r-detail
:is-edit=
"true"
/>
<
face-sta
r-detail
:is-edit=
"true"
/>
</
template
>
<
script
>
import
UserDetail
from
'./components/Use
rDetail'
import
FaceStarDetail
from
'./components/FaceSta
rDetail'
export
default
{
name
:
'Edit
Use
r'
,
components
:
{
Use
rDetail
}
name
:
'Edit
FaceSta
r'
,
components
:
{
FaceSta
rDetail
}
}
</
script
>
vu/src/views/face/list.vue
0 → 100644
View file @
dc98b1f2
<
template
>
<div
class=
"app-container"
>
<div
class=
"filter-container"
>
<el-input
:placeholder=
"'搜素'"
v-model=
"listQuery.filter.value"
style=
"width: 180px;"
class=
"filter-item"
@
keyup
.
enter
.
native=
"handleFilter"
/>
<el-select
v-model=
"listQuery.filter.key"
:placeholder=
"'搜索字段'"
clearable
class=
"filter-item"
style=
"width: 110px"
>
<el-option
v-for=
"item in SearchTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
<el-select
v-model=
"listQuery.filter.is_online"
:placeholder=
"'是否在线'"
clearable
class=
"filter-item"
style=
"width: 110px"
>
<el-option
v-for=
"item in BooleanTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
<el-select
v-model=
"listQuery.filter.sex"
:placeholder=
"'性别'"
clearable
class=
"filter-item"
style=
"width: 110px"
>
<el-option
v-for=
"item in SexTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
<el-button
v-waves
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleFilter"
>
搜索
</el-button>
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
创建
</el-button>
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleOfflineOrOnline('offline')"
>
下线
</el-button>
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleOfflineOrOnline('online')"
>
上线
</el-button>
</div>
<el-table
v-loading=
"listLoading"
:data=
"list"
border
fit
highlight-current-row
style=
"width: 100%"
ref=
"multipleTable"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
align=
"center"
></el-table-column>
<el-table-column
align=
"center"
label=
"账号ID"
>
<template
slot-scope=
"scope"
>
<router-link
:to=
"'/star/face/edit/'+scope.row.id"
class=
"link-type"
>
<span>
{{
scope
.
row
.
id
}}
</span>
</router-link>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"明星名"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
name
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"性别"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.sex"
>
{{
scope
.
row
.
sex
==
1
?
'男'
:
'女'
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"原图"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
ordinary_image_url
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"模型"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
modeling_obj_url
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"是否在线"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.is_online | isOnlineFilter"
>
{{
scope
.
row
.
is_online
==
1
?
'是'
:
'否'
}}
</el-tag>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"listQuery.page"
:limit
.
sync=
"listQuery.limit"
style=
"margin-left: 250px;"
@
pagination=
"getList"
/>
</div>
</template>
<
script
>
import
{
fetchList
,
OffLineOrOnLine
}
from
'@/api/face_image_upload'
import
Pagination
from
'@/components/Pagination'
// Secondary package based on el-pagination
import
waves
from
'@/directive/waves'
export
default
{
name
:
'FaceStarList'
,
components
:
{
Pagination
},
directives
:
{
waves
},
filters
:
{
isOnlineFilter
(
status
)
{
const
statusMap
=
{
1
:
'success'
,
0
:
'info'
,
}
return
statusMap
[
status
]
}
},
data
()
{
return
{
list
:
null
,
total
:
0
,
listLoading
:
true
,
multipleSelection
:
[],
del_list
:
[],
listQuery
:
{
page
:
0
,
limit
:
10
,
filter
:
{
sex
:
''
,
is_online
:
''
,
},
},
BooleanTypeOptions
:
[
{
'key'
:
1
,
'display_name'
:
'是'
},
{
'key'
:
0
,
'display_name'
:
'否'
}
],
SexTypeOptions
:
[
{
'key'
:
1
,
'display_name'
:
'男'
},
{
'key'
:
0
,
'display_name'
:
'女'
}
],
SearchTypeOptions
:
[
{
'key'
:
'name'
,
'display_name'
:
'明星名'
},
]
}
},
created
()
{
this
.
getList
()
},
methods
:
{
getList
()
{
this
.
listLoading
=
true
fetchList
(
this
.
listQuery
).
then
(
response
=>
{
console
.
log
(
response
.
data
.
data
.
data
)
this
.
list
=
response
.
data
.
data
.
data
this
.
total
=
response
.
data
.
data
.
total
this
.
listLoading
=
false
})
},
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
limit
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
getList
()
},
handleCreate
()
{
this
.
$router
.
push
(
'/star/face/create'
)
},
handleOfflineOrOnline
(
val
)
{
const
length
=
this
.
multipleSelection
.
length
;
let
str
=
''
;
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
)
{
this
.
multipleSelection
[
i
].
is_online
=
0
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$router
.
go
(
0
)
})
},
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
getList
()
},
}
}
</
script
>
<
style
scoped
>
</
style
>
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