用户列表获取数据修改
This commit is contained in:
parent
6508a93726
commit
d42af2e2dc
|
|
@ -123,10 +123,7 @@ export default {
|
|||
onLoad() {
|
||||
this.fetchUserList()
|
||||
},
|
||||
onShow() {
|
||||
// 页面显示时刷新数据
|
||||
this.fetchUserList()
|
||||
},
|
||||
|
||||
computed: {
|
||||
filteredUsers() {
|
||||
if (!this.searchKeyword) {
|
||||
|
|
@ -140,7 +137,6 @@ export default {
|
|||
methods: {
|
||||
// 获取用户列表
|
||||
async fetchUserList() {
|
||||
this.loading = true
|
||||
try {
|
||||
// 构建查询参数
|
||||
const params = {}
|
||||
|
|
@ -155,9 +151,9 @@ export default {
|
|||
}
|
||||
|
||||
const response = await getUserList(params)
|
||||
if (response.code === 200 && response.data && Array.isArray(response.data)) {
|
||||
if (response.code === 200 && response.rows && Array.isArray(response.rows)) {
|
||||
// 转换API数据格式为页面需要的格式
|
||||
this.users = response.data.map(user => ({
|
||||
this.users = response.rows.map(user => ({
|
||||
...user,
|
||||
isExpanded: false, // 默认收起
|
||||
// 将orders转换为devices格式
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user