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
3338d367
Commit
3338d367
authored
Nov 29, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改小组信息获取
parent
09a60479
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
25 deletions
+45
-25
group.py
api/group.py
+3
-2
search.py
api/search.py
+1
-1
star.js
vu/src/api/star.js
+2
-2
GroupDetail.vue
vu/src/views/group/components/GroupDetail.vue
+33
-16
StarDetail.vue
vu/src/views/star/components/StarDetail.vue
+6
-4
No files found.
api/group.py
View file @
3338d367
...
...
@@ -58,10 +58,11 @@ class GroupUpdateOrCreate(APIView):
'name'
:
request
.
POST
.
get
(
'name'
,
''
),
'description'
:
request
.
POST
.
get
(
'description'
,
''
),
'creator_id'
:
request
.
POST
.
get
(
'user_id'
,
''
),
'
star
_ids'
:
json
.
loads
(
request
.
POST
.
get
(
'star'
,
''
)),
'
celebrity
_ids'
:
json
.
loads
(
request
.
POST
.
get
(
'star'
,
''
)),
'is_online'
:
request
.
POST
.
get
(
'is_online'
,
''
),
'is_recommend'
:
request
.
POST
.
get
(
'is_recommend'
,
''
),
'user_ids'
:
json
.
loads
(
request
.
POST
.
get
(
'user_ids'
,
''
))
'group_user_ids'
:
json
.
loads
(
request
.
POST
.
get
(
'user_ids'
,
''
)),
'icon'
:
request
.
POST
.
get
(
'icon'
,
''
)[:
-
2
]
}
try
:
self
.
rpc
[
'venus/sun/group/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
...
...
api/search.py
View file @
3338d367
...
...
@@ -51,7 +51,7 @@ class StarSearchView(APIView):
def
get
(
self
,
request
):
name
=
request
.
GET
.
get
(
'name'
)
try
:
data
=
self
.
rpc
[
'venus/sun/
star
/search'
](
name
=
name
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/sun/
celebrity
/search'
](
name
=
name
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
'data'
:
data
}
...
...
vu/src/api/star.js
View file @
3338d367
...
...
@@ -32,10 +32,10 @@ export function OffLineOrOnLine(data) {
})
}
export
function
fetchStarRelatedGroup
(
id
)
{
export
function
fetchStarRelatedGroup
(
query
)
{
return
request
({
url
:
'/api/celebrity/celebrity_related_group_info'
,
method
:
'get'
,
params
:
{
id
}
params
:
query
})
}
vu/src/views/group/components/GroupDetail.vue
View file @
3338d367
...
...
@@ -89,6 +89,13 @@
</el-form-item>
<div
style=
"margin-bottom: 20px;"
>
<el-form-item
style=
"margin-bottom: 40px;"
label-width=
"75px"
label=
"小组头像:"
prop=
"icon"
>
<span
v-model=
"uploadType"
></span>
<Upload
v-model=
"postForm.icon"
:uploadType=
"uploadType"
/>
</el-form-item>
</div>
</el-card>
</el-row>
...
...
@@ -163,14 +170,15 @@
<
script
>
import
MDinput
from
'@/components/MDinput'
import
Upload
from
'@/components/Upload/singleImage3'
import
Sticky
from
'@/components/Sticky'
// 粘性header组件
import
waves
from
'@/directive/waves'
import
Pagination
from
'@/components/Pagination'
import
{
isInArray
,
removeByvale
}
from
"@/utils"
;
import
{
createGroup
,
GroupDetail
,
fetchGroupRelateduser
,
GroupUserDetail
}
from
'@/api/group'
import
{
starSearch
,
userSearch
}
from
'@/api/remoteSearch'
import
{
isInArray
,
removeByvale
}
from
"@/utils"
;
function
Assembledata
(
target
,
source
)
{
var
region_data
=
[]
...
...
@@ -193,6 +201,7 @@
user_nums
:
0
,
user_id
:
''
,
star
:
[],
icon
:
''
,
is_online
:
1
,
is_recommend
:
1
,
user_ids
:
[],
...
...
@@ -200,7 +209,7 @@
export
default
{
name
:
'GroupDetail'
,
components
:
{
MDinput
,
Sticky
,
Pagination
},
components
:
{
MDinput
,
Sticky
,
Pagination
,
Upload
},
directives
:
{
waves
},
props
:
{
isEdit
:
{
...
...
@@ -230,6 +239,7 @@
tempRoute
:
{},
temp_user_ids
:
''
,
user_ids
:
[],
uploadType
:
98
,
starListOptions
:
[],
userListOptions
:
[],
...
...
@@ -239,7 +249,6 @@
temp
:{
user_id
:
''
,
user_name
:
''
,
user_ids
:
[],
star_ids
:
[],
},
del_list
:
[],
...
...
@@ -314,15 +323,13 @@
if
(
this
.
postForm
.
user_id
===
this
.
temp
.
user_name
){
this
.
postForm
.
user_id
=
this
.
temp
.
user_id
}
let
user_ids
=
[]
for
(
let
i
=
0
;
i
<
this
.
tableData
.
length
;
i
++
){
user_ids
.
push
(
this
.
tableData
[
i
].
user_id
)
}
if
(
this
.
isEdit
){
this
.
postForm
.
star
=
Assembledata
(
this
.
temp
.
star_ids
,
this
.
postForm
.
star
)
}
else
{
this
.
postForm
.
star
=
JSON
.
stringify
(
this
.
postForm
.
star
)
}
this
.
postForm
.
star
=
JSON
.
stringify
(
this
.
postForm
.
star
)
this
.
postForm
.
user_ids
=
JSON
.
stringify
(
user_ids
);
this
.
postForm
.
user_ids
=
JSON
.
stringify
(
this
.
user_ids
);
createGroup
(
this
.
postForm
).
then
(
response
=>
{
this
.
$notify
({
title
:
'成功'
,
...
...
@@ -365,13 +372,6 @@
this
.
getList
()
},
appendUser
()
{
if
(
isInArray
(
this
.
user_ids
,
this
.
temp_user_ids
))
{
this
.
$message
({
message
:
'数据添加重复'
,
type
:
'error'
})
return
false
;
}
GroupUserDetail
(
this
.
temp_user_ids
).
then
(
response
=>
{
if
(
!
response
.
data
.
data
)
return
this
.
tableData
.
push
(...
response
.
data
.
data
)
...
...
@@ -381,7 +381,24 @@
this
.
temp_user_ids
=
''
},
delUser
()
{
let
origin_user_ids
=
[];
var
left_user_ids
=
[];
let
select_user_ids
=
[]
this
.
del_list
.
push
(...
this
.
multipleSelection
)
for
(
let
i
=
0
;
i
<
this
.
tableData
.
length
;
i
++
){
origin_user_ids
.
push
(
this
.
tableData
[
i
].
user_id
)
}
for
(
let
i
=
0
;
i
<
this
.
multipleSelection
.
length
;
i
++
){
select_user_ids
.
push
(
this
.
multipleSelection
[
i
].
user_id
)
}
for
(
let
i
=
0
;
i
<
origin_user_ids
.
length
;
i
++
){
if
(
!
isInArray
(
select_user_ids
,
origin_user_ids
[
i
])){
left_user_ids
.
push
(
origin_user_ids
[
i
])
}
}
this
.
user_ids
=
left_user_ids
;
},
getList
()
{
this
.
listLoading
=
true
...
...
vu/src/views/star/components/StarDetail.vue
View file @
3338d367
...
...
@@ -149,7 +149,7 @@
</el-table-column>
<el-table-column
align=
"center"
label=
"组长"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
creator
_
name
}}
</span>
<span>
{{
scope
.
row
.
creator
.
name
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -232,6 +232,7 @@
multipleSelection
:
[],
del_list
:
[],
listQuery
:
{
id
:
''
,
page
:
0
,
limit
:
10
,
},
...
...
@@ -265,7 +266,7 @@
if
(
this
.
isEdit
)
{
const
id
=
this
.
$route
.
params
&&
this
.
$route
.
params
.
id
this
.
fetchData
(
id
)
this
.
getList
(
id
)
this
.
getList
()
}
else
{
this
.
postForm
=
Object
.
assign
({},
defaultForm
)
}
...
...
@@ -365,9 +366,10 @@
this
.
listQuery
.
page
=
val
this
.
getList
()
},
getList
(
id
)
{
getList
()
{
this
.
listLoading
=
true
fetchStarRelatedGroup
(
id
).
then
(
response
=>
{
this
.
listQuery
.
id
=
this
.
$route
.
params
&&
this
.
$route
.
params
.
id
fetchStarRelatedGroup
(
this
.
listQuery
).
then
(
response
=>
{
let
rep
=
response
.
data
.
data
.
data
;
for
(
let
i
=
0
;
i
<
rep
.
length
;
i
++
){
this
.
group_ids
.
push
(
rep
[
i
].
id
)
...
...
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