You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
969 B
51 lines
969 B
<script setup lang="ts">
|
|
|
|
/**
|
|
* 页面主入口
|
|
*/
|
|
|
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
import { columns } from './data';
|
|
import { {{entity}}Api } from '#/api/{{entity}}';
|
|
|
|
const gridOptions = {
|
|
columns,
|
|
proxyConfig: {
|
|
ajax: {
|
|
query: async ({ page }) => {
|
|
try {
|
|
const res = await userApi.page({
|
|
pageNum: page?.currentPage || 1,
|
|
pageSize: page?.pageSize || 10,
|
|
})
|
|
|
|
const data = res.error?.result || res.result || res
|
|
|
|
return {
|
|
items: data.records || [],
|
|
total: data.total || 0
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('查询用户列表失败:', error)
|
|
throw error
|
|
}
|
|
}
|
|
},
|
|
response: {
|
|
result: 'items',
|
|
total: 'total'
|
|
}
|
|
},
|
|
pagerConfig: {
|
|
enabled: true,
|
|
},
|
|
}
|
|
|
|
const [Grid, gridApi] = useVbenVxeGrid({ gridOptions })
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<Grid/>
|
|
</template>
|