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
0666b763
Commit
0666b763
authored
Nov 29, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复明星
parent
d9fc94d3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
56 deletions
+61
-56
star.py
api/star.py
+20
-3
urls.py
api/urls.py
+1
-0
star.js
vu/src/api/star.js
+1
-1
GroupDetail.vue
vu/src/views/group/components/GroupDetail.vue
+5
-0
StarDetail.vue
vu/src/views/star/components/StarDetail.vue
+31
-11
list.vue
vu/src/views/star/list.vue
+2
-19
UserDetail.vue
vu/src/views/user/components/UserDetail.vue
+1
-22
No files found.
api/star.py
View file @
0666b763
...
...
@@ -18,6 +18,24 @@ class CelebrityListView(APIView):
raise
e
return
data
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
type
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
0
else
:
updates
[
'is_online'
]
=
1
try
:
self
.
rpc
[
'venus/sun/celebrity/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
"message"
:
"更新成功"
}
class
CelebrityUpdateOrCreate
(
APIView
):
def
get
(
self
,
request
):
...
...
@@ -35,11 +53,10 @@ class CelebrityUpdateOrCreate(APIView):
'gender'
:
request
.
POST
.
get
(
'gender'
),
'city_id'
:
request
.
POST
.
get
(
'city'
),
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
)),
'desc
ription
'
:
request
.
POST
.
get
(
'description'
),
'
icon'
:
request
.
POST
.
get
(
'avatar'
)
,
'desc'
:
request
.
POST
.
get
(
'description'
),
'
portrait'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
]
,
'group_ids'
:
list
(
set
(
json
.
loads
(
request
.
POST
.
get
(
'group_ids'
,
[])))),
}
print
(
json
.
loads
(
request
.
POST
.
get
(
'group_ids'
,
[])))
try
:
self
.
rpc
[
'venus/sun/celebrity/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
...
...
api/urls.py
View file @
0666b763
...
...
@@ -52,6 +52,7 @@ urlpatterns = [
# star相关
url
(
r'^celebrity/list$'
,
CelebrityListView
.
as_view
()),
url
(
r'^celebrity/list/update$'
,
CelebrityListView
.
as_view
()),
url
(
r'^celebrity/create$'
,
CelebrityUpdateOrCreate
.
as_view
()),
url
(
r'^celebrity/detail$'
,
CelebrityUpdateOrCreate
.
as_view
()),
url
(
r'^celebrity/celebrity_related_group_info'
,
CelebrityRelatedGroup
.
as_view
()),
...
...
vu/src/api/star.js
View file @
0666b763
...
...
@@ -26,7 +26,7 @@ export function starDetail(id) {
export
function
OffLineOrOnLine
(
data
)
{
return
request
({
url
:
'/api/celebrity/
update_or_cre
ate'
,
url
:
'/api/celebrity/
/list/upd
ate'
,
method
:
'post'
,
data
})
...
...
vu/src/views/group/components/GroupDetail.vue
View file @
0666b763
...
...
@@ -372,6 +372,11 @@
this
.
getList
()
},
appendUser
()
{
if
(
this
.
temp_user_ids
){
this
.
$message
.
error
(
'还没输入小组呢~~'
)
this
.
temp_user_ids
=
''
return
false
}
GroupUserDetail
(
this
.
temp_user_ids
).
then
(
response
=>
{
if
(
!
response
.
data
.
data
)
return
this
.
tableData
.
push
(...
response
.
data
.
data
)
...
...
vu/src/views/star/components/StarDetail.vue
View file @
0666b763
...
...
@@ -63,7 +63,7 @@
</div>
</el-col>
</div>
<el-form-item
label-width=
"75px"
label=
"性别:"
style=
"margin-left: 10px"
>
<el-form-item
label-width=
"75px"
label=
"性别:"
style=
"margin-left: 10px"
prop=
"gender"
>
<el-select
v-model=
"postForm.gender"
:placeholder=
"'性别:'"
clearable
class=
"postInfo-container-item"
style=
"width: 220px"
>
...
...
@@ -71,7 +71,7 @@
:value=
"item.key"
/>
</el-select>
</el-form-item>
<el-form-item
label-width=
"75px"
label=
"城市:"
style=
"margin-left: 10px"
>
<el-form-item
label-width=
"75px"
label=
"城市:"
style=
"margin-left: 10px"
prop=
"city"
>
<el-select
v-model=
"postForm.city"
:remote-method=
"getRemoteCityList"
filterable
remote
value-key=
"id"
placeholder=
"搜索地区"
style=
"width: 220px"
>
...
...
@@ -216,7 +216,10 @@
temp_group_ids
:
''
,
group_ids
:
[],
rules
:
{
content
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}]
city
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
name
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
gender
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
avatar
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
},
GenderTypeOptions
:
[
{
'key'
:
0
,
'display_name'
:
'男'
},
...
...
@@ -289,11 +292,13 @@
if
(
valid
)
{
this
.
loading
=
true
this
.
postForm
.
group_ids
=
JSON
.
stringify
(
this
.
group_ids
);
console
.
log
(
this
.
postForm
.
group_ids
)
// 处理未修改标签
if
(
this
.
temp_city_name
===
this
.
postForm
.
city
){
this
.
postForm
.
city
=
this
.
temp_city_id
;
}
starCreate
(
this
.
postForm
).
then
(
response
=>
{
this
.
$notify
({
title
:
'成功'
,
...
...
@@ -336,16 +341,14 @@
})
},
appendUser
()
{
if
(
isInArray
(
this
.
group_ids
,
this
.
temp_group_ids
)){
this
.
$message
({
message
:
'数据添加重复'
,
type
:
'error'
})
return
false
;
if
(
!
this
.
temp_group_ids
){
this
.
$message
.
error
(
'还没输入小组呢~~'
)
this
.
temp_group_ids
=
''
return
false
}
GroupDetail
(
this
.
temp_group_ids
).
then
(
response
=>
{
if
(
!
response
.
data
.
data
)
return
this
.
tableData
.
push
(
...
response
.
data
.
data
)
this
.
tableData
.
push
(
response
.
data
.
data
)
this
.
total
=
this
.
tableData
.
length
})
this
.
group_ids
.
push
(
this
.
temp_group_ids
)
...
...
@@ -353,7 +356,24 @@
},
delUser
()
{
let
origin_group_ids
=
[];
var
left_group_ids
=
[];
let
select_group_ids
=
[]
this
.
del_list
.
push
(...
this
.
multipleSelection
)
for
(
let
i
=
0
;
i
<
this
.
tableData
.
length
;
i
++
){
origin_group_ids
.
push
(
this
.
tableData
[
i
].
id
)
}
for
(
let
i
=
0
;
i
<
this
.
multipleSelection
.
length
;
i
++
){
select_group_ids
.
push
(
this
.
multipleSelection
[
i
].
id
)
}
for
(
let
i
=
0
;
i
<
origin_group_ids
.
length
;
i
++
){
if
(
!
isInArray
(
select_group_ids
,
origin_group_ids
[
i
])){
left_group_ids
.
push
(
origin_group_ids
[
i
])
}
}
this
.
group_ids
=
left_group_ids
;
},
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
...
...
vu/src/views/star/list.vue
View file @
0666b763
...
...
@@ -34,7 +34,7 @@
<el-table-column
align=
"center"
label=
"性别"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.gender | genderFilter"
>
{{
scope
.
row
.
gender
==
0
?
'男'
:
'女'
}}
</el-tag>
<el-tag>
{{
scope
.
row
.
gender
==
0
?
'男'
:
'女'
}}
</el-tag>
</
template
>
</el-table-column>
...
...
@@ -54,7 +54,7 @@
<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>
<el-tag
>
{{
scope
.
row
.
is_online
==
1
?
'否'
:
'是
'
}}
</el-tag>
</
template
>
</el-table-column>
...
...
@@ -73,23 +73,6 @@ import waves from '@/directive/waves'
export
default
{
name
:
'StartList'
,
components
:
{
Pagination
},
filters
:
{
isOnlineFilter
(
status
)
{
const
statusMap
=
{
1
:
'success'
,
0
:
'info'
,
}
return
statusMap
[
status
]
},
genderFilter
(
status
)
{
const
statusMap
=
{
'男'
:
'success'
,
'女'
:
'info'
,
'全部'
:
'danger'
}
return
statusMap
[
status
]
},
},
directives
:
{
waves
},
data
()
{
return
{
...
...
vu/src/views/user/components/UserDetail.vue
View file @
0666b763
...
...
@@ -254,37 +254,16 @@
callback
()
}
}
const
validateSourceUri
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
)
{
if
(
validateURL
(
value
))
{
callback
()
}
else
{
this
.
$message
({
message
:
'外链url填写不正确'
,
type
:
'error'
})
callback
(
new
Error
(
'外链url填写不正确'
))
}
}
else
{
callback
()
}
}
return
{
postForm
:
Object
.
assign
({},
defaultForm
),
loading
:
false
,
group_ids
:
[],
groupListOptions
:
[],
rules
:
{
image_uri
:
[{
validator
:
validateRequire
}],
image_uri
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
title
:
[{
validator
:
validateRequire
}],
content
:
[{
validator
:
validateRequire
}],
source_uri
:
[{
validator
:
validateSourceUri
,
trigger
:
'blur'
}]
},
// expireTimeOption: {
// disabledDate(date){
// return date.getTime()
<=
Date
.
now
();
// }
// },
tempRoute
:
{},
listQuery
:
{
page
:
1
,
...
...
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