|
|
@@ -58,6 +58,7 @@
|
|
|
:queryParams="queryParams"
|
|
|
@edit="openForm"
|
|
|
@detail="openDetail"
|
|
|
+ @sort-change="handleSortChange"
|
|
|
/>
|
|
|
|
|
|
<!-- 分页 -->
|
|
|
@@ -151,6 +152,8 @@ const loading = ref(true) // 列表的加载中
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
const list = ref([]) // 列表的数据
|
|
|
const queryParams = reactive({
|
|
|
+ prop: '',
|
|
|
+ order: '',
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
elderName: undefined,
|
|
|
@@ -276,6 +279,22 @@ const openDetail = (row: any = {}) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const handleSortChange = (val) => {
|
|
|
+ queryParams.prop = val.prop
|
|
|
+ if(val.order === 'ascending'){
|
|
|
+ queryParams.order = 'asc'
|
|
|
+ }else if(val.order === 'descending'){
|
|
|
+ queryParams.order = 'desc'
|
|
|
+ }else{
|
|
|
+ queryParams.order = ''
|
|
|
+ }
|
|
|
+ if (queryParams.pageNo === 1) {
|
|
|
+ getList()
|
|
|
+ } else {
|
|
|
+ queryParams.pageNo = 1
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const ids = ref([])
|
|
|
const handleSelection = (val) => {
|
|
|
ids.value = val.map(item => item.id)
|