体系搜索-添加排序

This commit is contained in:
zyn
2023-11-16 11:25:05 +08:00
parent 3fd045a63b
commit bd8d55cca8
@@ -105,6 +105,7 @@
border
:height="300"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',fontWeight: 'bold', height: '48px'}"
@sort-change="sortChange"
@selection-change="selectionChange">
<el-table-column
type="selection"
@@ -137,11 +138,13 @@
<el-table-column
prop="releaseDate"
width="120"
sortable
label="发布日期">
</el-table-column>
<el-table-column
prop="implementDate"
width="120"
sortable="custom"
label="实施日期">
</el-table-column>
<el-table-column
@@ -228,6 +231,8 @@ export default {
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
total: 0,
sortField: '',
sortMode: '',
}
return {
visible: false,
@@ -304,6 +309,18 @@ export default {
selectionChange (row) {
this.selected = row
},
sortChange ({ column, prop, order }) {
this.searchForm.sortField = prop
this.searchForm.sortMode = 'asc'
if (order === 'descending') {
this.searchForm.sortMode = 'desc'
}
if (!order) {
this.searchForm.sortField = ''
this.searchForm.sortMode = ''
}
this.onSearch()
},
// 导出
exportData () {
this.$refs.exportDialogRef.openModel()