فهرست منبع

reactor:用户管理优化;

zhangchong 1 سال پیش
والد
کامیت
d4981da7f7
1فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 7 2
      src/views/system/roles/component/Role-user-list.vue

+ 7 - 2
src/views/system/roles/component/Role-user-list.vue

@@ -7,7 +7,7 @@
 		append-to-body
 		destroy-on-close
 	>
-		<ProTable ref="proTableRef" :columns="columns" :data="state.tableData" :pagination="false" :tool-button="['setting']" max-height="500px">
+		<ProTable ref="proTableRef" :columns="columns" :data="state.tableData" :pagination="false" :loading="loading" :tool-button="['setting']" max-height="500px">
 		</ProTable>
 	</el-dialog>
 </template>
@@ -47,6 +47,7 @@ const columns = ref<any[]>([
 	},
 	{ prop: 'state', label: '状态', width: 80 },
 ]);
+const loading = ref<boolean>(false); // 是否显示加载
 // 定义变量内容
 const state = reactive<StateRoles>({
 	dialogVisible: false, // 弹窗显示隐藏
@@ -55,13 +56,17 @@ const state = reactive<StateRoles>({
 });
 // 打开弹窗
 const openDialog = (row: any) => {
+  loading.value = true;
 	state.currentRow = row;
 	let req: string;
 	if (row.accountIds.length >= 1) req = '?' + qs.stringify({ ids: row.accountIds }, { indices: false });
 	else req = '?' + 'ids=';
 	getUserListByIds(req).then((res: any) => {
 		state.tableData = res?.result ?? [];
-	});
+    loading.value = false;
+	}).catch(() => {
+    loading.value = false;
+  })
 	state.dialogVisible = true;
 	emit('openDialog');
 };