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
9176b660
Commit
9176b660
authored
Nov 16, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成pick前端编写
parent
2230190d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
17 deletions
+76
-17
group.py
api/group.py
+3
-3
pick.py
api/pick.py
+36
-6
urls.py
api/urls.py
+8
-3
account.js
vu/src/api/account.js
+1
-2
pick.js
vu/src/api/pick.js
+26
-1
list.vue
vu/src/views/group/list.vue
+2
-2
PickDetail.vue
vu/src/views/pick/components/PickDetail.vue
+0
-0
No files found.
api/group.py
View file @
9176b660
...
...
@@ -18,17 +18,17 @@ class GroupListView(APIView):
return
data
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
group_
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
type
=
request
.
POST
.
get
(
'type'
)
filters
=
{}
if
type
==
'offline'
:
filters
[
'is_online'
]
=
False
elif
type
==
'recommend'
:
filters
[
'recommend'
]
=
True
filters
[
'
is_
recommend'
]
=
True
else
:
filters
[
'is_online'
]
=
True
try
:
self
.
rpc
[
'venus/community/group/batch/update'
](
filters
=
filters
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/community/group/batch/update'
](
filters
=
filters
,
group_ids
=
group_
ids
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
...
...
api/pick.py
View file @
9176b660
...
...
@@ -18,20 +18,49 @@ class PickListView(APIView):
return
data
def
post
(
self
,
request
):
pass
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
type
=
request
.
POST
.
get
(
'type'
,
''
)
try
:
self
.
rpc
[
'venus/community/pick/offline_pick'
](
type
=
type
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
"message"
:
"更新成功"
}
class
UpdateOrCreateView
(
APIView
):
def
get
(
self
,
request
):
pass
id
=
request
.
GET
.
get
(
'id'
)
try
:
data
=
self
.
rpc
[
'venus/community/pick/detail'
](
id
=
id
)
.
unwrap
()
except
Exception
as
e
:
# raise e
data
=
{
'name'
:
1
,
'desc'
:
'hahah'
,
'gender'
:
'哈哈'
,
'region'
:
'123124312423'
,
'pick_type'
:
'www.baid.com'
,
'position'
:
22
,
'is_online'
:
1
}
return
{
'data'
:
data
}
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
type
=
request
.
POST
.
get
(
'type'
,
''
)
data
=
{
'name'
:
request
.
POST
.
get
(
' name'
),
'desc'
:
request
.
POST
.
get
(
' desc'
),
'gender'
:
request
.
POST
.
get
(
' gender'
),
'region'
:
request
.
POST
.
get
(
' region'
),
'pick_type'
:
request
.
POST
.
get
(
' pick_type'
),
'position'
:
request
.
POST
.
get
(
' position'
),
'is_online'
:
request
.
POST
.
get
(
' is_online'
),
}
try
:
self
.
rpc
[
'venus/community/pick/
offline_pick'
](
type
=
type
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/community/pick/
create'
](
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
"message"
:
"更新成功"
'message'
:
'操作成功'
}
\ No newline at end of file
api/urls.py
View file @
9176b660
...
...
@@ -18,9 +18,10 @@ urlpatterns = [
# 登陆,注销相关
url
(
r'account/login$'
,
LoginView
.
as_view
()),
url
(
r'account/logout'
,
LogoutView
.
as_view
()),
url
(
r'account/list'
,
AccountList
.
as_view
()),
url
(
r'account/update'
,
AccountList
.
as_view
()),
url
(
r'account/get'
,
LoginView
.
as_view
()),
url
(
r'account/list'
,
AccountList
.
as_view
()),
url
(
r'account/list/update'
,
AccountList
.
as_view
()),
url
(
r'account/detail'
,
AccountUpdateOrCreateView
.
as_view
()),
url
(
r'account/create'
,
AccountUpdateOrCreateView
.
as_view
()),
# user相关
...
...
@@ -41,5 +42,8 @@ urlpatterns = [
# pick相关
url
(
r'pick/list$'
,
PickListView
.
as_view
()),
url
(
r'pick/update_or_create'
,
UpdateOrCreateView
.
as_view
()),
url
(
r'pick/list/update$'
,
PickListView
.
as_view
()),
url
(
r'pick/create'
,
UpdateOrCreateView
.
as_view
()),
url
(
r'pick/detail'
,
UpdateOrCreateView
.
as_view
()),
]
\ No newline at end of file
vu/src/api/account.js
View file @
9176b660
...
...
@@ -10,7 +10,7 @@ export function fetchList(query) {
export
function
OffLineOrOnLine
(
data
)
{
return
request
({
url
:
'/api/account/update'
,
url
:
'/api/account/
list/
update'
,
method
:
'post'
,
data
})
...
...
@@ -31,4 +31,3 @@ export function fetchAccountDetail(id) {
param
:
{
id
}
})
}
vu/src/api/pick.js
View file @
9176b660
...
...
@@ -11,8 +11,33 @@ export function fetchList(query) {
export
function
OffLineOrOnLine
(
data
)
{
console
.
log
(
data
)
return
request
({
url
:
'/api/pick/
update_or_cre
ate'
,
url
:
'/api/pick/
list/upd
ate'
,
method
:
'post'
,
data
})
}
export
function
fetchPickDetail
(
id
)
{
return
request
({
url
:
'/api/account/detail'
,
method
:
'get'
,
param
:
{
id
}
})
}
export
function
CreatePick
(
data
)
{
return
request
({
url
:
'/api/pick/create'
,
method
:
'post'
,
data
})
}
export
function
fetchPPickDetail
(
id
)
{
return
request
({
url
:
'/api/pick/detail'
,
method
:
'get'
,
param
:
{
id
}
})
}
vu/src/views/group/list.vue
View file @
9176b660
...
...
@@ -54,7 +54,7 @@
<el-table-column
width=
"80px"
align=
"center"
label=
"帖子数"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
topic_num
}}
</span>
<span>
{{
scope
.
row
.
topic_num
s
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -171,7 +171,7 @@ export default {
if
(
val
===
'offline'
){
this
.
multipleSelection
[
i
].
is_online
=
0
}
else
if
(
val
===
'recommend'
){
this
.
multipleSelection
[
i
].
is_recommend
=
0
this
.
multipleSelection
[
i
].
is_recommend
=
1
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
}
...
...
vu/src/views/pick/components/PickDetail.vue
View file @
9176b660
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