Commit 9d909537 by 无尘

fix: 修改加载

parent 3f402830
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
@edit-role="onEditRole" @edit-role="onEditRole"
@change-role="onChangeRole"></role-list> @change-role="onChangeRole"></role-list>
</div> </div>
<div class="admin-list"> <div class="admin-list" v-loading="loading">
<h3 class="admin-list-title">管理员列表</h3> <h3 class="admin-list-title">管理员列表</h3>
<el-input <el-input
placeholder="请输入姓名/账号/手机号码" placeholder="请输入姓名/账号/手机号码"
...@@ -85,6 +85,7 @@ export default { ...@@ -85,6 +85,7 @@ export default {
}, },
// 管理员列表数据 // 管理员列表数据
adminList: [], adminList: [],
loading: false
}; };
}, },
created() { created() {
...@@ -137,6 +138,7 @@ export default { ...@@ -137,6 +138,7 @@ export default {
*/ */
getAdminList() { getAdminList() {
const { currentPage, pageSize } = this.pager; const { currentPage, pageSize } = this.pager;
this.loading = true;
const params = { const params = {
roleId: this.activeRoleId, roleId: this.activeRoleId,
search: this.search, search: this.search,
...@@ -144,9 +146,13 @@ export default { ...@@ -144,9 +146,13 @@ export default {
pageSize pageSize
}; };
roleAdminList(params).then(res => { roleAdminList(params).then(res => {
this.loading = false;
const { totalCount, result } = res.result || {}; const { totalCount, result } = res.result || {};
this.pager.total = totalCount; this.pager.total = totalCount;
this.adminList = result || []; this.adminList = result || [];
})
.catch(function(error) {
this.loading = false;
}); });
}, },
/** /**
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
@change-role="onChangeRole"></role-list> @change-role="onChangeRole"></role-list>
</div> </div>
</div> </div>
<div class="admin-list"> <div class="admin-list" v-loading="loading">
<h3 class="admin-list-title">门店成员列表</h3> <h3 class="admin-list-title">门店成员列表</h3>
<el-input <el-input
style="width: 238px" style="width: 238px"
...@@ -71,7 +71,8 @@ export default { ...@@ -71,7 +71,8 @@ export default {
pageSizes: [ 20, 40, 60, 80 ], pageSizes: [ 20, 40, 60, 80 ],
pageSize: 20, pageSize: 20,
currentPage: 1 currentPage: 1
} },
loading: false
}; };
}, },
created() { created() {
...@@ -121,6 +122,7 @@ export default { ...@@ -121,6 +122,7 @@ export default {
* @author: 无尘 * @author: 无尘
*/ */
getAdminList() { getAdminList() {
this.loading = true;
const params = { const params = {
roleId: this.activeRoleId, roleId: this.activeRoleId,
enterpriseId: this.enterpriseId, enterpriseId: this.enterpriseId,
...@@ -129,9 +131,13 @@ export default { ...@@ -129,9 +131,13 @@ export default {
pageSize: this.pager.pageSize pageSize: this.pager.pageSize
}; };
roleAdminList(params).then(res => { roleAdminList(params).then(res => {
this.loading = false;
const { totalCount, result } = res.result || {}; const { totalCount, result } = res.result || {};
this.pager.total = totalCount || 0; this.pager.total = totalCount || 0;
this.adminList = result || []; this.adminList = result || [];
})
.catch(function(error) {
this.loading = false;
}); });
}, },
/** /**
......
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