1、解决前端排序BUG
This commit is contained in:
parent
d388634a23
commit
7268d7dbfc
|
|
@ -327,6 +327,9 @@ export default {
|
|||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
|
||||
//标记排序重置(修复点击重置请求两次接口BUG)
|
||||
sortStatus: true,
|
||||
|
||||
// 表单校验
|
||||
rulesEdit: {
|
||||
englishWord: [
|
||||
|
|
@ -413,9 +416,6 @@ export default {
|
|||
this.queryParams.endCreateTime = this.daterangeCreateTime[1];
|
||||
}
|
||||
|
||||
// this.queryParams.orderByColumn=this.defaultSort.prop
|
||||
// this.queryParams.isAsc=this.defaultSort.order
|
||||
|
||||
listWord(this.queryParams).then(response => {
|
||||
this.loading = false;
|
||||
this.wordList = response.data.records;
|
||||
|
|
@ -453,6 +453,11 @@ export default {
|
|||
this.daterangeCreateTime = [];
|
||||
this.queryParams.createTime = null
|
||||
this.queryParams.endCreateTime = null
|
||||
|
||||
this.sortStatus=false
|
||||
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
|
||||
this.sortStatus=true
|
||||
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
|
@ -474,9 +479,16 @@ export default {
|
|||
},
|
||||
|
||||
/** 排序触发事件 */
|
||||
handleSortChange(column, prop, order) {
|
||||
handleSortChange(column) {
|
||||
this.queryParams.isAsc = column.order;
|
||||
this.getList();
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
|
||||
console.log(column)
|
||||
|
||||
//点击重置的时候不再次请求接口
|
||||
if (this.sortStatus) {
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
|
||||
/** 修改按钮操作 */
|
||||
|
|
|
|||
|
|
@ -195,7 +195,10 @@ export default {
|
|||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
rules: {},
|
||||
|
||||
//标记排序重置(修复点击重置请求两次接口BUG)
|
||||
sortStatus: true,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -222,7 +225,10 @@ export default {
|
|||
/** 排序触发事件 */
|
||||
handleSortChange(column, prop, order) {
|
||||
this.queryParams.isAsc = column.order;
|
||||
this.getList();
|
||||
//点击重置的时候不再次请求接口
|
||||
if (this.sortStatus) {
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
|
||||
//重置排序
|
||||
|
|
@ -242,6 +248,11 @@ export default {
|
|||
this.daterangeCreateTime = [];
|
||||
this.queryParams.createTime = null
|
||||
this.queryParams.endCreateTime = null
|
||||
|
||||
this.sortStatus=false
|
||||
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
|
||||
this.sortStatus=true
|
||||
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ public class MyBaseController<T> extends BaseController {
|
|||
}
|
||||
String orderByColumn = pageDomain.getOrderByColumn();
|
||||
if (StringUtils.isNotNull(orderByColumn)) {
|
||||
|
||||
//获取排序字段
|
||||
String orderBy = SqlUtil.escapeOrderBySql(StringUtils.toUnderScoreCase(orderByColumn));
|
||||
|
||||
if (pageDomain.getIsAsc().equals("asc")) {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
SELECT
|
||||
t.min_id
|
||||
FROM
|
||||
( SELECT min( id ) AS min_id FROM webmagic_weixin_sougou GROUP BY url ) AS t
|
||||
( SELECT min( id ) AS min_id FROM webmagic_weixin_sougou GROUP BY content ) AS t
|
||||
)
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue