修改排序

This commit is contained in:
qq787203167
2022-02-22 15:36:05 +08:00
parent 7de147f8df
commit b978db5409
2 changed files with 19 additions and 5 deletions
+14 -4
View File
@@ -3,12 +3,14 @@
<div class="box">
<a-table
class="table"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
:pagination="false"
:scroll="{x: 1600}"
:data-source="dataSource"
:loading="loading"
@change="tableOnChange"
>
<span slot="operation" slot-scope="record">
<a class="text" v-for="(ol,index) in OperationList"
@@ -70,7 +72,8 @@
pageSize: 10,
total: 0,
searchParmes: {},
loading: false
loading: false,
orderBy:'1',
}
},
mounted() {
@@ -98,7 +101,8 @@
title: res.db_field_txt,
dataIndex: res.db_field_name,
align: 'center',
ellipsis: true
ellipsis: true,
sorter: res.sort
})
})
let width
@@ -117,11 +121,16 @@
}
})
},
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
this.getTableList()
},
getTableList() {
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
let params = {
...this.searchParmes,
orderBy:this.orderBy,
pageNo: pageNo + '',
pageSize: pageSize + ''
}
@@ -142,8 +151,9 @@
this.pageSize = pageSize
this.getTableList()
},
onSelectChange() {
onSelectChange(value) {
this.selectedRowKeys = value;
this.$emit('onSelectChange',value)
},
OperationClick(ol, item) {
this.$emit(ol.ClickEvent, item)
@@ -22,6 +22,7 @@
showAction
@Collection="Collection"
@subscribe="subscribe"
@onSelectChange="onSelectChange"
/>
</div>
<addForm
@@ -147,7 +148,10 @@
//订阅按钮
subscribe(val) {
console.log('val222', val)
}
},
onSelectChange(value){
},
}
}
</script>