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