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
53f4d763
Commit
53f4d763
authored
Dec 03, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复问题
parent
d379da40
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
14 deletions
+48
-14
pick.py
api/pick.py
+12
-7
topic.py
api/topic.py
+19
-1
urls.py
api/urls.py
+1
-0
topic.js
vu/src/api/topic.js
+1
-1
GroupDetail.vue
vu/src/views/group/components/GroupDetail.vue
+15
-4
list.vue
vu/src/views/topic/list.vue
+0
-1
No files found.
api/pick.py
View file @
53f4d763
...
...
@@ -55,24 +55,29 @@ class UpdateOrCreateView(APIView):
gender
=
request
.
POST
.
get
(
'gender'
)
pick_type
=
request
.
POST
.
get
(
'pick_type'
)
data_dict
=
{
'gender'
:
''
,
'gender_value'
:
''
,
}
if
gender
==
'全部'
:
gender_value
=
2
data_dict
[
'gender'
]
=
2
elif
gender
==
'男'
:
gender_value
=
0
data_dict
[
'gender'
]
=
0
elif
gender
==
'女'
:
gender_value
=
1
data_dict
[
'gender'
]
=
1
if
pick_type
==
'明星打榜'
:
pick_type_vale
=
1
data_dict
[
'pick_type'
]
=
1
elif
pick_type
==
'PICK帖子'
:
pick_type_vale
=
0
data_dict
[
'pick_type'
]
=
0
data
=
{
'name'
:
request
.
POST
.
get
(
'name'
),
'desc'
:
request
.
POST
.
get
(
'desc'
),
'gender'
:
gender_value
,
'gender'
:
data_dict
[
'gender'
]
if
id
else
gender
,
'region'
:
city_ids
,
'pick_type'
:
pick_type_val
e
,
'pick_type'
:
data_dict
[
'pick_type'
]
if
id
else
pick_typ
e
,
'pick_group'
:
pick_group_ids
,
'position'
:
request
.
POST
.
get
(
'position'
),
'is_online'
:
int
(
request
.
POST
.
get
(
'is_online'
)),
...
...
api/topic.py
View file @
53f4d763
...
...
@@ -89,7 +89,7 @@ class ReplyUpdateOrCreateView(APIView):
class
ReplyCreate
(
APIView
):
def
post
(
self
,
request
):
data
=
{
'user_id'
:
request
.
POST
.
get
(
'user_id'
),
'user_id'
:
request
.
POST
.
get
(
'user_id'
)
.
split
(
':'
)[
0
]
,
'replied_id'
:
request
.
POST
.
get
(
"replied_id"
,
None
),
'topic_id'
:
request
.
POST
.
get
(
"topic_id"
,
None
),
'content'
:
request
.
POST
.
get
(
'content'
),
...
...
@@ -100,3 +100,21 @@ class ReplyCreate(APIView):
raise
e
return
{
'data'
:
data
}
class
TopicListBatchUpdate
(
APIView
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
type
=
request
.
POST
.
get
(
'type'
)
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
False
else
:
updates
[
'is_online'
]
=
True
try
:
self
.
rpc
[
'venus/sun/topic/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
"message"
:
"更新成功"
}
api/urls.py
View file @
53f4d763
...
...
@@ -47,6 +47,7 @@ urlpatterns = [
url
(
r'^topic/list$'
,
TopicListView
.
as_view
()),
url
(
r'^topic/detail$'
,
TopicUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/create$'
,
TopicUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/batch_update$'
,
TopicListBatchUpdate
.
as_view
()),
url
(
r'^topic/reply/list$'
,
ReplyUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/reply/batch_delete$'
,
ReplyUpdateOrCreateView
.
as_view
()),
url
(
r'^topic/reply/create$'
,
ReplyCreate
.
as_view
()),
...
...
vu/src/api/topic.js
View file @
53f4d763
...
...
@@ -11,7 +11,7 @@ export function fetchList(query) {
export
function
OffLineOrOnLine
(
data
)
{
return
request
({
url
:
'/api/topic/
update_or_cre
ate'
,
url
:
'/api/topic/
batch_upd
ate'
,
method
:
'post'
,
data
})
...
...
vu/src/views/group/components/GroupDetail.vue
View file @
53f4d763
...
...
@@ -43,7 +43,7 @@
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label-width=
"75px"
label=
"小组组长:"
class=
"postInfo-container-item"
>
<el-form-item
label-width=
"75px"
label=
"小组组长:"
class=
"postInfo-container-item"
prop=
"user"
>
<el-select
v-model=
"user"
:remote-method=
"getRemoteUserList"
filterable
remote
clearable
value-key=
"id"
placeholder=
"搜索用户"
style=
"width: 100%"
>
...
...
@@ -123,7 +123,7 @@
<el-table-column
type=
"selection"
width=
"76"
align=
"center"
></el-table-column>
<el-table-column
align=
"center"
label=
"用户ID "
>
<template
slot-scope=
"scope"
>
<router-link
:to=
"'/
push
/edit/'+scope.row.user_id"
class=
"link-type"
>
<router-link
:to=
"'/
user
/edit/'+scope.row.user_id"
class=
"link-type"
>
<span>
{{
scope
.
row
.
user_id
}}
</span>
</router-link>
</
template
>
...
...
@@ -235,14 +235,16 @@
postForm
:
Object
.
assign
({},
defaultForm
),
loading
:
false
,
rules
:
{
title
:
[{
validator
:
validateRequire
}],
content
:
[{
validator
:
validateRequire
}],
name
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
user
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
icon
:
[{
validator
:
validateRequire
,
trigger
:
'blur'
}],
},
user
:
''
,
star
:
[],
temp_user_ids
:
''
,
group_users
:
[],
judge_user_ids
:
[],
tempRoute
:
{},
uploadType
:
98
,
...
...
@@ -365,12 +367,21 @@
this
.
temp_user_ids
=
''
return
false
}
let
append_user_id
=
parseInt
(
this
.
temp_user_ids
.
split
(
':'
)[
0
])
for
(
let
i
=
0
;
i
<
this
.
tableData
.
length
;
i
++
){
if
(
append_user_id
==
this
.
tableData
[
i
].
user_id
){
this
.
$message
.
error
(
'存在同样数据, 请勿重复操作'
)
this
.
temp_user_ids
=
''
return
false
;
}
}
GroupUserDetail
(
this
.
temp_user_ids
).
then
(
response
=>
{
if
(
!
response
.
data
.
data
)
return
if
(
!
response
.
data
.
data
[
0
].
user_id
){
this
.
$message
.
error
(
'这条数据错误, 请换条数据'
)
return
}
this
.
judge_user_ids
.
push
(
response
.
data
.
data
[
0
].
user_id
)
this
.
tableData
.
push
(...
response
.
data
.
data
)
this
.
total
=
this
.
tableData
.
length
this
.
group_users
.
push
(
this
.
temp_user_ids
)
...
...
vu/src/views/topic/list.vue
View file @
53f4d763
...
...
@@ -198,7 +198,6 @@ export default {
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
response
.
data
.
data
.
message
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$router
.
go
(
0
)
})
...
...
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