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
9ce05c29
Commit
9ce05c29
authored
6 years ago
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量更新发帖时间
parent
7c2f2970
master
dev
like-pre/r01
quick-reply
refactor
test
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
83 additions
and
13 deletions
+83
-13
account.py
api/account.py
+1
-1
face_star.py
api/face_star.py
+1
-1
pick.py
api/pick.py
+1
-1
star.py
api/star.py
+1
-1
tag.py
api/tag.py
+1
-1
topic.py
api/topic.py
+3
-2
index.vue
vu/src/components/UploadExcel/index.vue
+2
-2
list.vue
vu/src/views/topic/list.vue
+65
-0
list.vue
vu/src/views/user/list.vue
+8
-4
No files found.
api/account.py
View file @
9ce05c29
...
...
@@ -23,7 +23,7 @@ class AccountList(APIView):
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update
s
'
,
'{}'
))
try
:
self
.
rpc
[
'venus/sun/account/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
...
...
This diff is collapsed.
Click to expand it.
api/face_star.py
View file @
9ce05c29
...
...
@@ -62,7 +62,7 @@ class StarListView(APIView):
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update
s
'
,
'{}'
))
try
:
self
.
rpc
[
'mercury/face/batch/update'
](
ids
=
ids
,
updates
=
updates
)
.
unwrap
()
...
...
This diff is collapsed.
Click to expand it.
api/pick.py
View file @
9ce05c29
...
...
@@ -23,7 +23,7 @@ class PickListView(APIView):
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update
s
'
,
'{}'
))
try
:
self
.
rpc
[
'venus/sun/pick/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
...
...
This diff is collapsed.
Click to expand it.
api/star.py
View file @
9ce05c29
...
...
@@ -22,7 +22,7 @@ class CelebrityListView(APIView):
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update
s
'
,
'{}'
))
try
:
self
.
rpc
[
'venus/sun/celebrity/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
...
...
This diff is collapsed.
Click to expand it.
api/tag.py
View file @
9ce05c29
...
...
@@ -22,7 +22,7 @@ class TagListView(APIView):
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update
s
'
,
'{}'
))
try
:
self
.
rpc
[
'venus/sun/tag/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
...
...
This diff is collapsed.
Click to expand it.
api/topic.py
View file @
9ce05c29
...
...
@@ -118,10 +118,11 @@ class ReplyCreate(APIView):
class
TopicListBatchUpdate
(
APIView
):
def
post
(
self
,
request
):
ids
=
json
.
loads
(
request
.
POST
.
get
(
'ids'
,
'[]'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'update'
,
'{}'
))
updates
=
json
.
loads
(
request
.
POST
.
get
(
'updates'
,
'{}'
))
extra
=
json
.
loads
(
request
.
POST
.
get
(
'extra'
,
'{}'
))
try
:
self
.
rpc
[
'venus/sun/topic/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/sun/topic/batch/update'
](
updates
=
updates
,
ids
=
ids
,
extra
=
extra
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'批量更新帖子失败
%
s'
,
e
)
raise
...
...
This diff is collapsed.
Click to expand it.
vu/src/components/UploadExcel/index.vue
View file @
9ce05c29
...
...
@@ -2,8 +2,8 @@
<div>
<input
ref=
"excel-upload-input"
class=
"excel-upload-input"
type=
"file"
accept=
".xlsx, .xls"
@
change=
"handleClick"
>
<div
class=
"drop"
@
drop=
"handleDrop"
@
dragover=
"handleDragover"
@
dragenter=
"handleDragover"
>
Drop excel file here or
<el-button
:loading=
"loading"
style=
"margin-left:16px;"
size=
"mini"
type=
"primary"
@
click=
"handleUpload"
>
Browse
</el-button>
文件拖至此处
<el-button
:loading=
"loading"
style=
"margin-left:16px;"
size=
"mini"
type=
"primary"
@
click=
"handleUpload"
>
点我上传
</el-button>
</div>
</div>
</
template
>
...
...
This diff is collapsed.
Click to expand it.
vu/src/views/topic/list.vue
View file @
9ce05c29
...
...
@@ -23,6 +23,7 @@
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
创建
</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>
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"batchUpdate"
>
批量上线
</el-button>
</div>
<el-table
v-loading=
"listLoading"
:data=
"list"
border
fit
highlight-current-row
style=
"width: 100%"
ref=
"multipleTable"
@
selection-change=
"handleSelectionChange"
@
sort-change=
"sortChange"
>
<el-table-column
type=
"selection"
align=
"center"
></el-table-column>
...
...
@@ -87,6 +88,27 @@
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"listQuery.page"
:pageSizes=
"pageSize"
:limit
.
sync=
"listQuery.limit"
style=
"margin-left: 150px;"
@
pagination=
"getList"
/>
<el-dialog
:visible
.
sync=
"dialogFormVisible"
>
<label>
发帖时间:
</label>
<el-date-picker
v-model=
"select_start_time "
type=
"datetime"
value-format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"起始时间"
style=
"width: 230px"
/>
----
<el-date-picker
v-model=
"select_end_time "
type=
"datetime"
value-format=
"yyyy-MM-dd HH:mm:ss"
placeholder=
"结束时间"
style=
"width: 230px"
/>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"updateData()"
:disabled=
"this.is_click"
>
确认
</el-button>
</div>
</el-dialog>
</div>
</template>
...
...
@@ -158,6 +180,11 @@ export default {
{
'key'
:
4
,
'display_name'
:
'星级四'
},
{
'key'
:
5
,
'display_name'
:
'星级五'
},
],
dialogFormVisible
:
false
,
is_click
:
false
,
dialogStatus
:
''
,
select_start_time
:
''
,
select_end_time
:
''
}
},
created
()
{
...
...
@@ -228,6 +255,44 @@ export default {
this
.
listQuery
.
sort
.
push
(...[
'-id'
])
}
this
.
handleFilter
()
},
batchUpdate
(){
this
.
dialogFormVisible
=
true
;
this
.
reset
()
},
updateData
(){
const
length
=
this
.
multipleSelection
.
length
;
var
ids
=
[]
var
updates
=
{}
var
extra_info
=
{}
this
.
del_list
=
this
.
del_list
.
concat
(
this
.
multipleSelection
);
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
this
.
multipleSelection
[
i
].
is_online
=
1
updates
[
'is_online'
]
=
1
ids
.
push
(
this
.
multipleSelection
[
i
].
id
)
}
if
(
!
length
){
this
.
$message
.
error
(
'请先勾选帖子ID,再进行后续操作.....'
)
}
if
(
!
this
.
select_start_time
||
!
this
.
select_end_time
){
this
.
$message
.
error
(
'起始时间或者结束时间不能为空.....'
)
}
if
(
this
.
select_start_time
>
this
.
select_end_time
){
this
.
$message
.
error
(
'起始时间不能小于结束时间.....'
)
}
extra_info
[
'start_time'
]
=
this
.
select_start_time
extra_info
[
'end_time'
]
=
this
.
select_end_time
OffLineOrOnLine
({
updates
:
JSON
.
stringify
(
updates
),
ids
:
JSON
.
stringify
(
ids
),
extra
:
JSON
.
stringify
(
extra_info
)}).
then
(
response
=>
{
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
this
.
$router
.
go
(
0
)
this
.
dialogFormVisible
=
false
;
})
},
reset
(){
this
.
select_start_time
=
''
this
.
select_end_time
=
''
}
}
}
...
...
This diff is collapsed.
Click to expand it.
vu/src/views/user/list.vue
View file @
9ce05c29
...
...
@@ -28,6 +28,9 @@
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleOfflineOrOnline('online')"
>
上线
</el-button>
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleOfflineOrOnline('online')"
>
上线
</el-button>
</div>
<el-table
v-loading=
"listLoading"
:data=
"list"
border
fit
highlight-current-row
style=
"width: 100%"
ref=
"multipleTable"
@
selection-change=
"handleSelectionChange"
>
...
...
@@ -90,7 +93,8 @@
<el-table-column
align=
"center"
label=
"是否推荐"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.is_recommend | isOnlineFilter"
>
{{
scope
.
row
.
is_recommend
==
true
?
'是'
:
'否'
}}
</el-tag>
<el-tag
:type=
"scope.row.is_recommend | isOnlineFilter"
>
{{
scope
.
row
.
is_recommend
==
true
?
'是'
:
'否'
}}
</el-tag>
</
template
>
</el-table-column>
is_recommend
...
...
@@ -107,7 +111,7 @@
import
{
fetchList
,
OffLineOrOnLine
}
from
'@/api/user'
import
Pagination
from
'@/components/Pagination'
// Secondary package based on el-pagination
import
waves
from
'@/directive/waves'
import
{
mapGetters
}
from
'vuex'
import
{
mapGetters
}
from
'vuex'
export
default
{
name
:
'UserList'
,
...
...
@@ -221,8 +225,8 @@
this
.
multipleSelection
=
[];
this
.
$message
.
success
(
response
.
data
.
data
.
message
);
setTimeout
(()
=>
{
this
.
$router
.
go
(
0
)
},
1500
)
this
.
$router
.
go
(
0
)
},
1500
)
})
},
handleFilter
()
{
...
...
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