feature/0423
fanfan 8 months ago
parent eb6ac52253
commit 39bdf44d4f
  1. 17
      src/views/goods/Index.vue

@ -203,7 +203,22 @@ export default {
selectedRowKeys: [],
// Promise
loadData: (param) => {
return GoodsApi.list({ ...param, ...this.queryParam }).then((response) => {
const data = { ...param, ...this.queryParam }
const orderEnum = {
ascend: 'asc',
descend: 'desc',
}
if (data.sortField && data.sortOrder && orderEnum[data.sortOrder]) {
data.sort = data.sortField
data.order = orderEnum[data.sortOrder]
delete data.sortField
delete data.sortOrder
} else {
delete data.sortField
delete data.sortOrder
}
return GoodsApi.list(data).then((response) => {
return response.data.list
})
}

Loading…
Cancel
Save