基础数据-班次管理-新增排序

dev-scheduling
ysn 1 month ago
parent a6aca55373
commit 06a6e937a6
  1. 23
      src/views/basicData/shiftManagement.vue

@ -56,8 +56,8 @@ export default {
selection: false,
viewBtn: false,
delBtn: false,
editBtn: true,
editBtnText: '修改',
editBtnIcon: ' ',
viewBtnText: '详情',
labelWidth: 120,
menuWidth: 120,
@ -85,7 +85,7 @@ export default {
label: '班次',
prop: 'name',
search: true,
sortable: true,
sortable: 'custom',
filter: true,
addDisplay: true,
editDisplay: true,
@ -196,17 +196,14 @@ export default {
},
//
sortChange({ prop, order }) {
if (!prop) {
//
this.query.orderByField = undefined;
this.query.isAsc = undefined;
} else {
const orderByField = prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase();
this.query.orderByField = orderByField;
this.query.isAsc = order === 'ascending' ? true : false;
}
//
this.onLoad();
this.query.descs = undefined;
this.query.ascs = undefined;
let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs';
this.query[orderByFieldKey] = !prop
? undefined
: prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase();
// //
this.onLoad(this.page, this.query);
},
onLoad() {
this.loading = true;

Loading…
Cancel
Save