Commit 9d909537 by 无尘

fix: 修改加载

parent 3f402830
......@@ -12,7 +12,7 @@
@edit-role="onEditRole"
@change-role="onChangeRole"></role-list>
</div>
<div class="admin-list">
<div class="admin-list" v-loading="loading">
<h3 class="admin-list-title">管理员列表</h3>
<el-input
placeholder="请输入姓名/账号/手机号码"
......@@ -85,6 +85,7 @@ export default {
},
// 管理员列表数据
adminList: [],
loading: false
};
},
created() {
......@@ -137,6 +138,7 @@ export default {
*/
getAdminList() {
const { currentPage, pageSize } = this.pager;
this.loading = true;
const params = {
roleId: this.activeRoleId,
search: this.search,
......@@ -144,10 +146,14 @@ export default {
pageSize
};
roleAdminList(params).then(res => {
this.loading = false;
const { totalCount, result } = res.result || {};
this.pager.total = totalCount;
this.adminList = result || [];
});
})
.catch(function(error) {
this.loading = false;
});
},
/**
* @description: 搜索
......
......@@ -14,7 +14,7 @@
@change-role="onChangeRole"></role-list>
</div>
</div>
<div class="admin-list">
<div class="admin-list" v-loading="loading">
<h3 class="admin-list-title">门店成员列表</h3>
<el-input
style="width: 238px"
......@@ -71,7 +71,8 @@ export default {
pageSizes: [ 20, 40, 60, 80 ],
pageSize: 20,
currentPage: 1
}
},
loading: false
};
},
created() {
......@@ -121,6 +122,7 @@ export default {
* @author: 无尘
*/
getAdminList() {
this.loading = true;
const params = {
roleId: this.activeRoleId,
enterpriseId: this.enterpriseId,
......@@ -129,10 +131,14 @@ export default {
pageSize: this.pager.pageSize
};
roleAdminList(params).then(res => {
this.loading = false;
const { totalCount, result } = res.result || {};
this.pager.total = totalCount || 0;
this.adminList = result || [];
});
})
.catch(function(error) {
this.loading = false;
});
},
/**
* @description: 切换角色菜单
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment