diff --git a/src/views/basicData/shiftManagement.vue b/src/views/basicData/shiftManagement.vue index b4b36a75..85184008 100644 --- a/src/views/basicData/shiftManagement.vue +++ b/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;