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
7c2f2970
Commit
7c2f2970
authored
Jan 07, 2019
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加用户是否在线和用户下线相关逻辑 以及统一上下线推荐逻辑
parent
ba55ba85
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
85 additions
and
111 deletions
+85
-111
account.py
api/account.py
+3
-7
face_star.py
api/face_star.py
+3
-8
group.py
api/group.py
+2
-9
pick.py
api/pick.py
+2
-9
star.py
api/star.py
+2
-8
tag.py
api/tag.py
+4
-13
topic.py
api/topic.py
+3
-7
user.py
api/user.py
+1
-8
list.vue
vu/src/views/account/list.vue
+6
-3
list.vue
vu/src/views/face/list.vue
+6
-3
list.vue
vu/src/views/group/list.vue
+8
-4
list.vue
vu/src/views/pick/list.vue
+5
-2
list.vue
vu/src/views/star/list.vue
+6
-3
list.vue
vu/src/views/tag/list.vue
+6
-3
list.vue
vu/src/views/tag_type/list.vue
+6
-6
list.vue
vu/src/views/topic/list.vue
+6
-3
list.vue
vu/src/views/user/list.vue
+16
-15
No files found.
api/account.py
View file @
7c2f2970
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# __author__ = "chenwei"
# __author__ = "chenwei"
# Date: 2018/11/16
# Date: 2018/11/16
import
json
from
django.conf
import
settings
from
django.conf
import
settings
from
utils.base
import
APIView
from
utils.base
import
APIView
from
utils.user_util
import
make_password_own
from
utils.user_util
import
make_password_own
...
@@ -21,13 +22,8 @@ class AccountList(APIView):
...
@@ -21,13 +22,8 @@ class AccountList(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
type
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
0
else
:
updates
[
'is_online'
]
=
1
try
:
try
:
self
.
rpc
[
'venus/sun/account/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/account/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
...
api/face_star.py
View file @
7c2f2970
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
# __author__ = "chenwei"
# __author__ = "chenwei"
# Date: 2018/12/11
# Date: 2018/12/11
import
json
from
utils.base
import
APIView
from
utils.base
import
APIView
from
utils.logger
import
error_logger
from
utils.logger
import
error_logger
...
@@ -60,15 +61,9 @@ class StarListView(APIView):
...
@@ -60,15 +61,9 @@ class StarListView(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
(
)
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
)
)
tp
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
)
)
updates
=
{}
if
tp
==
'offline'
:
updates
[
'is_online'
]
=
0
else
:
updates
[
'is_online'
]
=
1
try
:
try
:
self
.
rpc
[
'mercury/face/batch/update'
](
ids
=
ids
,
updates
=
updates
)
.
unwrap
()
self
.
rpc
[
'mercury/face/batch/update'
](
ids
=
ids
,
updates
=
updates
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
...
api/group.py
View file @
7c2f2970
...
@@ -27,15 +27,8 @@ class GroupListView(APIView):
...
@@ -27,15 +27,8 @@ class GroupListView(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
type
=
request
.
POST
.
get
(
'type'
)
updates
=
json
.
loads
(
request
.
POST
.
get
(
'updates'
,
'{}'
))
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
False
elif
type
==
'is_recommend'
:
updates
[
'is_recommend'
]
=
True
else
:
updates
[
'is_online'
]
=
True
try
:
try
:
self
.
rpc
[
'venus/sun/group/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/group/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
...
api/pick.py
View file @
7c2f2970
...
@@ -22,15 +22,8 @@ class PickListView(APIView):
...
@@ -22,15 +22,8 @@ class PickListView(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
type
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
0
else
:
updates
[
'is_online'
]
=
1
try
:
try
:
self
.
rpc
[
'venus/sun/pick/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/pick/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
...
api/star.py
View file @
7c2f2970
...
@@ -21,15 +21,9 @@ class CelebrityListView(APIView):
...
@@ -21,15 +21,9 @@ class CelebrityListView(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
(
)
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
)
)
type
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
)
)
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
0
else
:
updates
[
'is_online'
]
=
1
try
:
try
:
self
.
rpc
[
'venus/sun/celebrity/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/celebrity/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
...
api/tag.py
View file @
7c2f2970
...
@@ -21,13 +21,8 @@ class TagListView(APIView):
...
@@ -21,13 +21,8 @@ class TagListView(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
type
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
False
else
:
updates
[
'is_online'
]
=
True
try
:
try
:
self
.
rpc
[
'venus/sun/tag/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/tag/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -87,12 +82,8 @@ class TagTypeListView(APIView):
...
@@ -87,12 +82,8 @@ class TagTypeListView(APIView):
return
data
return
data
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
update
=
int
(
request
.
POST
.
get
(
'update'
,
''
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'updates'
,
'{}'
))
updates
=
{
'is_online'
:
bool
(
update
)
}
try
:
try
:
self
.
rpc
[
'venus/sun/tag/tagtype/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/tag/tagtype/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
...
...
api/topic.py
View file @
7c2f2970
...
@@ -117,13 +117,9 @@ class ReplyCreate(APIView):
...
@@ -117,13 +117,9 @@ class ReplyCreate(APIView):
class
TopicListBatchUpdate
(
APIView
):
class
TopicListBatchUpdate
(
APIView
):
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
type
=
request
.
POST
.
get
(
'type'
)
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
False
else
:
updates
[
'is_online'
]
=
True
try
:
try
:
self
.
rpc
[
'venus/sun/topic/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/topic/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
...
api/user.py
View file @
7c2f2970
...
@@ -27,14 +27,7 @@ class UserListView(APIView):
...
@@ -27,14 +27,7 @@ class UserListView(APIView):
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
type
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
json
.
loads
(
request
.
POST
.
get
(
'updates'
,
'{}'
))
updates
=
{}
if
type
==
'recommend'
:
updates
[
'is_recommend'
]
=
1
else
:
pass
try
:
try
:
self
.
rpc
[
'venus/sun/user/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/user/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
except
Exception
as
e
:
...
...
vu/src/views/account/list.vue
View file @
7c2f2970
...
@@ -138,17 +138,20 @@
...
@@ -138,17 +138,20 @@
},
},
handleOfflineOrOnline
(
val
)
{
handleOfflineOrOnline
(
val
)
{
const
length
=
this
.
multipleSelection
.
length
;
const
length
=
this
.
multipleSelection
.
length
;
let
str
=
''
;
var
ids
=
[]
var
updates
=
{}
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
)
{
if
(
val
===
'offline'
)
{
this
.
multipleSelection
[
i
].
is_online
=
0
this
.
multipleSelection
[
i
].
is_online
=
0
updates
[
'is_online'
]
=
0
}
else
{
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
updates
[
'is_online'
]
=
1
}
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
ids
.
push
(
this
.
multipleSelection
[
i
].
id
)
}
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
OffLineOrOnLine
({
updates
:
JSON
.
stringify
(
updates
),
ids
:
JSON
.
stringify
(
ids
)
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$router
.
go
(
0
)
this
.
$router
.
go
(
0
)
...
...
vu/src/views/face/list.vue
View file @
7c2f2970
...
@@ -198,17 +198,20 @@ export default {
...
@@ -198,17 +198,20 @@ export default {
},
},
handleOfflineOrOnline
(
val
)
{
handleOfflineOrOnline
(
val
)
{
const
length
=
this
.
multipleSelection
.
length
const
length
=
this
.
multipleSelection
.
length
let
str
=
''
var
ids
=
[]
var
updates
=
{}
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
)
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
)
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
)
{
if
(
val
===
'offline'
)
{
this
.
multipleSelection
[
i
].
is_online
=
0
this
.
multipleSelection
[
i
].
is_online
=
0
updates
[
'is_online'
]
=
0
}
else
{
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
updates
[
'is_online'
]
=
1
}
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
ids
.
push
(
this
.
multipleSelection
[
i
].
id
)
}
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
OffLineOrOnLine
({
updates
:
JSON
.
stringify
(
updates
),
ids
:
JSON
.
stringify
(
ids
)
}).
then
(
response
=>
{
this
.
multipleSelection
=
[]
this
.
multipleSelection
=
[]
this
.
$message
.
success
(
response
.
data
.
data
.
message
)
this
.
$message
.
success
(
response
.
data
.
data
.
message
)
this
.
$router
.
go
(
0
)
this
.
$router
.
go
(
0
)
...
...
vu/src/views/group/list.vue
View file @
7c2f2970
...
@@ -172,20 +172,24 @@ export default {
...
@@ -172,20 +172,24 @@ export default {
},
},
handleOfflineOrOnline
(
val
){
handleOfflineOrOnline
(
val
){
const
length
=
this
.
multipleSelection
.
length
;
const
length
=
this
.
multipleSelection
.
length
;
let
str
=
''
;
var
ids
=
[]
var
updates
=
{}
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
){
if
(
val
===
'offline'
){
this
.
multipleSelection
[
i
].
is_online
=
0
this
.
multipleSelection
[
i
].
is_online
=
0
updates
[
'is_online'
]
=
0
}
else
if
(
val
==
'is_recommend'
){
}
else
if
(
val
==
'is_recommend'
){
this
.
multipleSelection
[
i
].
is_recommend
=
1
this
.
multipleSelection
[
i
].
is_recommend
=
1
updates
[
'is_recommend'
]
=
1
}
}
else
{
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
updates
[
'is_online'
]
=
1
}
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
ids
.
push
(
this
.
multipleSelection
[
i
].
id
)
}
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
OffLineOrOnLine
({
updates
:
JSON
.
stringify
(
updates
),
ids
:
JSON
.
stringify
(
ids
)
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
...
...
vu/src/views/pick/list.vue
View file @
7c2f2970
...
@@ -149,17 +149,20 @@ export default {
...
@@ -149,17 +149,20 @@ export default {
},
},
handleOfflineOrOnline
(
val
){
handleOfflineOrOnline
(
val
){
const
length
=
this
.
multipleSelection
.
length
;
const
length
=
this
.
multipleSelection
.
length
;
let
str
=
''
;
var
ids
=
[]
var
updates
=
{}
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
){
if
(
val
===
'offline'
){
this
.
multipleSelection
[
i
].
is_online
=
0
this
.
multipleSelection
[
i
].
is_online
=
0
updates
[
'is_online'
]
=
0
}
else
{
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
updates
[
'is_online'
]
=
1
}
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
}
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
OffLineOrOnLine
({
updates
:
JSON
.
stringify
(
updates
),
ids
:
JSON
.
stringify
(
ids
)
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
})
})
...
...
vu/src/views/star/list.vue
View file @
7c2f2970
...
@@ -130,17 +130,20 @@ export default {
...
@@ -130,17 +130,20 @@ export default {
},
},
handleOfflineOrOnline
(
val
){
handleOfflineOrOnline
(
val
){
const
length
=
this
.
multipleSelection
.
length
;
const
length
=
this
.
multipleSelection
.
length
;
let
str
=
''
;
var
ids
=
[]
var
updates
=
{}
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
){
if
(
val
===
'offline'
){
this
.
multipleSelection
[
i
].
is_online
=
0
this
.
multipleSelection
[
i
].
is_online
=
0
updates
[
'is_online'
]
=
0
}
else
{
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
updates
[
'is_online'
]
=
1
}
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
ids
.
push
(
this
.
multipleSelection
[
i
].
id
)
}
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
OffLineOrOnLine
({
updates
:
JSON
.
stringify
(
updates
),
ids
:
JSON
.
stringify
(
ids
)
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
vu/src/views/tag/list.vue
View file @
7c2f2970
...
@@ -115,17 +115,20 @@ export default {
...
@@ -115,17 +115,20 @@ export default {
},
},
handleOfflineOrOnline
(
val
){
handleOfflineOrOnline
(
val
){
const
length
=
this
.
multipleSelection
.
length
;
const
length
=
this
.
multipleSelection
.
length
;
let
str
=
''
;
var
ids
=
[]
var
updates
=
{}
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
){
if
(
val
===
'offline'
){
this
.
multipleSelection
[
i
].
is_online
=
0
this
.
multipleSelection
[
i
].
is_online
=
0
updates
[
'is_online'
]
=
0
}
else
{
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
updates
[
'is_online'
]
=
1
}
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
ids
.
push
(
this
.
multipleSelection
[
i
].
id
)
}
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
OffLineOrOnLine
({
updates
:
JSON
.
stringify
(
updates
),
ids
:
JSON
.
stringify
(
ids
)
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
})
})
...
...
vu/src/views/tag_type/list.vue
View file @
7c2f2970
...
@@ -114,20 +114,20 @@ export default {
...
@@ -114,20 +114,20 @@ export default {
},
},
handleOfflineOrOnline
(
val
){
handleOfflineOrOnline
(
val
){
const
length
=
this
.
multipleSelection
.
length
;
const
length
=
this
.
multipleSelection
.
length
;
let
str
=
''
;
var
ids
=
[]
;
var
update
=
''
var
update
s
=
''
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
){
if
(
val
===
'offline'
){
this
.
multipleSelection
[
i
].
is_online
=
0
this
.
multipleSelection
[
i
].
is_online
=
0
update
=
0
;
update
s
[
'is_online'
]
=
0
}
else
{
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
update
=
1
;
update
s
[
'is_online'
]
=
0
}
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
ids
.
push
(
this
.
multipleSelection
[
i
].
id
)
}
}
OffLineOrOnLine
({
update
:
update
,
ids
:
str
}).
then
(
response
=>
{
OffLineOrOnLine
({
update
s
:
JSON
.
stringify
(
updates
),
ids
:
JSON
.
stringify
(
ids
)
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
})
})
...
...
vu/src/views/topic/list.vue
View file @
7c2f2970
...
@@ -187,17 +187,20 @@ export default {
...
@@ -187,17 +187,20 @@ export default {
},
},
handleOfflineOrOnline
(
val
){
handleOfflineOrOnline
(
val
){
const
length
=
this
.
multipleSelection
.
length
;
const
length
=
this
.
multipleSelection
.
length
;
let
str
=
''
;
var
ids
=
[]
var
updates
=
{}
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
){
if
(
val
===
'offline'
){
this
.
multipleSelection
[
i
].
is_online
=
0
this
.
multipleSelection
[
i
].
is_online
=
0
updates
[
'is_online'
]
=
0
}
else
{
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
updates
[
'is_online'
]
=
1
}
}
str
+=
this
.
multipleSelection
[
i
].
id
+
' '
;
ids
.
push
(
this
.
multipleSelection
[
i
].
id
)
}
}
OffLineOrOnLine
({
type
:
val
,
ids
:
str
}).
then
(
response
=>
{
OffLineOrOnLine
({
updates
:
JSON
.
stringify
(
updates
),
ids
:
JSON
.
stringify
(
ids
)
}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$router
.
go
(
0
)
this
.
$router
.
go
(
0
)
...
...
vu/src/views/user/list.vue
View file @
7c2f2970
...
@@ -11,9 +11,6 @@
...
@@ -11,9 +11,6 @@
style=
"width: 110px"
>
style=
"width: 110px"
>
<el-option
v-for=
"item in UserTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
<el-option
v-for=
"item in UserTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
</el-select>
<!--
<el-select
v-model=
"listQuery.filter.group_type"
:placeholder=
"'组内身份'"
clearable
class=
"filter-item"
style=
"width: 110px"
>
-->
<!--
<el-option
v-for=
"item in IdentifyTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
-->
<!--
</el-select>
-->
<el-select
v-model=
"listQuery.filter.is_recommend"
:placeholder=
"'推荐'"
clearable
class=
"filter-item"
<el-select
v-model=
"listQuery.filter.is_recommend"
:placeholder=
"'推荐'"
clearable
class=
"filter-item"
style=
"width: 100px"
>
style=
"width: 100px"
>
<el-option
v-for=
"item in ReBooleanTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
<el-option
v-for=
"item in ReBooleanTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
...
@@ -25,6 +22,12 @@
...
@@ -25,6 +22,12 @@
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleOfflineOrOnline('recommend')"
>
推荐
@
click=
"handleOfflineOrOnline('recommend')"
>
推荐
</el-button>
</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>
</div>
<el-table
v-loading=
"listLoading"
:data=
"list"
border
fit
highlight-current-row
style=
"width: 100%"
<el-table
v-loading=
"listLoading"
:data=
"list"
border
fit
highlight-current-row
style=
"width: 100%"
ref=
"multipleTable"
@
selection-change=
"handleSelectionChange"
>
ref=
"multipleTable"
@
selection-change=
"handleSelectionChange"
>
...
@@ -50,9 +53,9 @@
...
@@ -50,9 +53,9 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"
联系电话
"
>
<el-table-column
align=
"center"
label=
"
是否在线
"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<
span>
{{
scope
.
row
.
phone
}}
</span
>
<
el-tag
:type=
"scope.row.is_online | isOnlineFilter"
>
{{
scope
.
row
.
is_online
==
true
?
'是'
:
'否'
}}
</el-tag
>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -79,12 +82,6 @@
...
@@ -79,12 +82,6 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<!--<el-table-column width="150px" align="center" label="组内身份">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.group_identify }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column
align=
"center"
label=
"用户身份"
>
<el-table-column
align=
"center"
label=
"用户身份"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
user_identify
}}
</span>
<span>
{{
scope
.
row
.
user_identify
}}
</span>
...
@@ -93,7 +90,7 @@
...
@@ -93,7 +90,7 @@
<el-table-column
align=
"center"
label=
"是否推荐"
>
<el-table-column
align=
"center"
label=
"是否推荐"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.is_recommend | isOnlineFilter"
>
{{
scope
.
row
.
is_recommend
==
1
?
'是'
:
'否'
}}
</el-tag>
<el-tag
:type=
"scope.row.is_recommend | isOnlineFilter"
>
{{
scope
.
row
.
is_recommend
==
true
?
'是'
:
'否'
}}
</el-tag>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
is_recommend
is_recommend
...
@@ -118,8 +115,8 @@
...
@@ -118,8 +115,8 @@
filters
:
{
filters
:
{
isOnlineFilter
(
status
)
{
isOnlineFilter
(
status
)
{
const
statusMap
=
{
const
statusMap
=
{
1
:
'success'
,
true
:
'success'
,
0
:
'info'
,
false
:
'info'
,
}
}
return
statusMap
[
status
]
return
statusMap
[
status
]
},
},
...
@@ -205,18 +202,22 @@
...
@@ -205,18 +202,22 @@
handleOfflineOrOnline
(
val
)
{
handleOfflineOrOnline
(
val
)
{
const
length
=
this
.
multipleSelection
.
length
;
const
length
=
this
.
multipleSelection
.
length
;
var
ids
=
[];
var
ids
=
[];
var
updates
=
{};
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
if
(
val
===
'offline'
)
{
if
(
val
===
'offline'
)
{
this
.
multipleSelection
[
i
].
is_online
=
0
this
.
multipleSelection
[
i
].
is_online
=
0
updates
[
'is_online'
]
=
0
}
else
if
(
val
===
'recommend'
)
{
}
else
if
(
val
===
'recommend'
)
{
this
.
multipleSelection
[
i
].
is_recommend
=
0
this
.
multipleSelection
[
i
].
is_recommend
=
0
updates
[
'is_recommend'
]
=
0
}
else
{
}
else
{
this
.
multipleSelection
[
i
].
is_online
=
1
this
.
multipleSelection
[
i
].
is_online
=
1
updates
[
'is_online'
]
=
1
}
}
ids
.
push
(
this
.
multipleSelection
[
i
].
user_id
)
ids
.
push
(
this
.
multipleSelection
[
i
].
user_id
)
}
}
OffLineOrOnLine
({
type
:
val
,
ids
:
JSON
.
stringify
(
ids
)}).
then
(
response
=>
{
OffLineOrOnLine
({
updates
:
JSON
.
stringify
(
updates
)
,
ids
:
JSON
.
stringify
(
ids
)}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
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