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

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

Loading…
Cancel
Save