修改OTA待办任务列表排序

This commit is contained in:
范强强
2023-09-18 16:08:49 +08:00
parent 04c0271d6b
commit f2f3a5b7df
@@ -94,6 +94,7 @@
:scroll="{x: '100%',y:'calc(100vh - 140px)'}" :scroll="{x: '100%',y:'calc(100vh - 140px)'}"
rowKey="id" rowKey="id"
:data-source="dataSource" :data-source="dataSource"
@change="tableOnChange"
:columns="columns" :columns="columns"
> >
<span slot="action" slot-scope="text,record"> <span slot="action" slot-scope="text,record">
@@ -138,12 +139,15 @@
url:{ url:{
list:'', list:'',
}, },
orderBy: '1',
orderByField: '',
columns: [ columns: [
{ {
title: this.$t('softwareversion'), title: this.$t('softwareversion'),
align: 'left', align: 'left',
dataIndex: 'releaseName', dataIndex: 'releaseName',
ellipsis: true, ellipsis: true,
sorter: true,
width: 170 width: 170
}, },
{ {
@@ -151,6 +155,7 @@
align: 'left', align: 'left',
dataIndex: 'releaseType', dataIndex: 'releaseType',
ellipsis: true, ellipsis: true,
sorter: true,
width: 170 width: 170
}, },
{ {
@@ -158,6 +163,7 @@
align: 'left', align: 'left',
dataIndex: 'vehicle', dataIndex: 'vehicle',
ellipsis: true, ellipsis: true,
sorter: true,
width: 600, width: 600,
}, },
{ {
@@ -165,6 +171,7 @@
align: 'left', align: 'left',
dataIndex: 'releaseDate', dataIndex: 'releaseDate',
ellipsis: true, ellipsis: true,
sorter: true,
width: 170, width: 170,
}, },
{ {
@@ -209,6 +216,11 @@
this.pageSize = pageSize this.pageSize = pageSize
this.getList() this.getList()
}, },
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
this.orderByField = sorter.columnKey
this.getList()
},
getList() { getList() {
let queryParam = JSON.parse(JSON.stringify(this.queryParam)) let queryParam = JSON.parse(JSON.stringify(this.queryParam))
Object.keys(queryParam).forEach(val => { Object.keys(queryParam).forEach(val => {
@@ -219,6 +231,8 @@
let query = { let query = {
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
orderBy: this.orderBy,
orderByField: this.orderByField,
...queryParam ...queryParam
} }
this.loading = true this.loading = true