Commit c84353f9 by yuananting

fix:批量处理后页码置1

parent 193f1d3a
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-06-03 16:09:00 * @LastEditTime: 2021-06-03 17:13:30
* @Description: 助学工具-题库-试卷列表数据 * @Description: 助学工具-题库-试卷列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -439,7 +439,7 @@ class PaperList extends Component { ...@@ -439,7 +439,7 @@ class PaperList extends Component {
} }
batchMoveRemote = (categoryId) => { batchMoveRemote = (categoryId) => {
const { selectedPaperKeys } = this.state; const { selectedPaperKeys, query } = this.state;
const data = { const data = {
categoryId, categoryId,
paperId: selectedPaperKeys, paperId: selectedPaperKeys,
...@@ -450,7 +450,17 @@ class PaperList extends Component { ...@@ -450,7 +450,17 @@ class PaperList extends Component {
Service.Hades('public/hades/batchMovePaperCategory', data, { reject: true }).then((res) => { Service.Hades('public/hades/batchMovePaperCategory', data, { reject: true }).then((res) => {
if (res.success) { if (res.success) {
message.success('移动成功'); message.success('移动成功');
this.setState(
{
query: {
...query,
current: 1,
},
},
() => {
this.queryPaperPageList(); this.queryPaperPageList();
}
);
Bus.trigger("queryCategoryTree", "remain"); Bus.trigger("queryCategoryTree", "remain");
this.clearSelect(); this.clearSelect();
} else { } else {
...@@ -462,7 +472,7 @@ class PaperList extends Component { ...@@ -462,7 +472,7 @@ class PaperList extends Component {
} }
batchDelete = () => { batchDelete = () => {
const { selectedPaperKeys } = this.state; const { selectedPaperKeys, query } = this.state;
if (_.isEmpty(selectedPaperKeys)) { if (_.isEmpty(selectedPaperKeys)) {
message.warning('请先选择要删除的试卷'); message.warning('请先选择要删除的试卷');
return null; return null;
...@@ -485,7 +495,17 @@ class PaperList extends Component { ...@@ -485,7 +495,17 @@ class PaperList extends Component {
Service.Hades('public/hades/batchDeletePaper', data, { reject: true }).then((res) => { Service.Hades('public/hades/batchDeletePaper', data, { reject: true }).then((res) => {
if (res.success) { if (res.success) {
message.success('删除成功'); message.success('删除成功');
this.setState(
{
query: {
...query,
current: 1,
},
},
() => {
this.queryPaperPageList(); this.queryPaperPageList();
}
);
Bus.trigger("queryCategoryTree", "remain"); Bus.trigger("queryCategoryTree", "remain");
this.clearSelect(); this.clearSelect();
} else { } else {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-06-03 16:41:47 * @LastEditTime: 2021-06-03 17:12:01
* @Description: 助学工具-题库-题目列表数据 * @Description: 助学工具-题库-题目列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -524,7 +524,7 @@ class QuestionList extends Component { ...@@ -524,7 +524,7 @@ class QuestionList extends Component {
} }
batchMoveRemote = (categoryId) => { batchMoveRemote = (categoryId) => {
const { selectedRowKeys } = this.state; const { selectedRowKeys, query } = this.state;
const data = { const data = {
categoryId, categoryId,
id: selectedRowKeys, id: selectedRowKeys,
...@@ -536,8 +536,18 @@ class QuestionList extends Component { ...@@ -536,8 +536,18 @@ class QuestionList extends Component {
if (res.success) { if (res.success) {
message.success('移动成功'); message.success('移动成功');
Bus.trigger('queryCategoryTree', 'remain'); Bus.trigger('queryCategoryTree', 'remain');
this.queryQuestionPageList();
this.clearSelect(); this.clearSelect();
this.setState(
{
query: {
...query,
current: 1,
},
},
() => {
this.queryQuestionPageList();
}
);
} else { } else {
message.error('移动失败'); message.error('移动失败');
} }
...@@ -547,7 +557,7 @@ class QuestionList extends Component { ...@@ -547,7 +557,7 @@ class QuestionList extends Component {
} }
batchDelete = () => { batchDelete = () => {
const { selectedRowKeys } = this.state; const { selectedRowKeys, query } = this.state;
if (_.isEmpty(selectedRowKeys)) { if (_.isEmpty(selectedRowKeys)) {
message.warning('请先选择要删除的题目'); message.warning('请先选择要删除的题目');
return null; return null;
...@@ -571,8 +581,18 @@ class QuestionList extends Component { ...@@ -571,8 +581,18 @@ class QuestionList extends Component {
if (res.success) { if (res.success) {
message.success('删除成功'); message.success('删除成功');
Bus.trigger('queryCategoryTree', 'remain'); Bus.trigger('queryCategoryTree', 'remain');
this.queryQuestionPageList();
this.clearSelect(); this.clearSelect();
this.setState(
{
query: {
...query,
current: 1,
},
},
() => {
this.queryQuestionPageList();
}
);
} else { } else {
message.error('删除失败'); message.error('删除失败');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment