diff --git a/src/views/comment/components/CommentTab.vue b/src/views/comment/components/CommentTab.vue index ad028e46..66658950 100644 --- a/src/views/comment/components/CommentTab.vue +++ b/src/views/comment/components/CommentTab.vue @@ -234,6 +234,7 @@ v-else :rowKey="comment => comment.id" :rowSelection="{ + selectedRowKeys: selectedRowKeys, onChange: onSelectionChange, getCheckboxProps: getCheckboxProps }" @@ -571,6 +572,7 @@ export default { }) }, handleQuery() { + this.handleClearRowKeys() this.handlePaginationChange(1, this.pagination.size) }, handleEditStatusClick(commentId, status) { @@ -624,6 +626,7 @@ export default { handleResetParam() { this.queryParam.keyword = null this.queryParam.status = null + this.handleClearRowKeys() this.handlePaginationChange(1, this.pagination.size) }, handlePublishMore() { @@ -668,6 +671,9 @@ export default { }) } }, + handleClearRowKeys() { + this.selectedRowKeys = [] + }, onReplyClose() { this.replyComment = {} this.selectComment = {} @@ -680,7 +686,7 @@ export default { getCheckboxProps(comment) { return { props: { - disabled: comment.status === 'RECYCLE', + disabled: this.queryParam.status == null || this.queryParam.status === '', name: comment.author } } diff --git a/src/views/post/PostList.vue b/src/views/post/PostList.vue index 7d9b7267..fc049ed4 100644 --- a/src/views/post/PostList.vue +++ b/src/views/post/PostList.vue @@ -292,6 +292,7 @@ v-else :rowKey="post => post.id" :rowSelection="{ + selectedRowKeys: selectedRowKeys, onChange: onSelectionChange, getCheckboxProps: getCheckboxProps }" @@ -665,7 +666,7 @@ export default { getCheckboxProps(post) { return { props: { - disabled: post.status === 'RECYCLE', + disabled: this.queryParam.status == null || this.queryParam.status === '', name: post.title } } @@ -680,9 +681,11 @@ export default { this.queryParam.keyword = null this.queryParam.categoryId = null this.queryParam.status = null + this.handleClearRowKeys() this.handlePaginationChange(1, this.pagination.size) }, handleQuery() { + this.handleClearRowKeys() this.handlePaginationChange(1, this.pagination.size) }, handleEditStatusClick(postId, status) { @@ -758,6 +761,9 @@ export default { window.open(response.data, '_blank') }) }, + handleClearRowKeys() { + this.selectedRowKeys = [] + }, // 关闭文章设置抽屉 onPostSettingsClose() { this.postSettingVisible = false