diff --git a/src/pages/user/UserList.vue b/src/pages/user/UserList.vue
index 8a6a8e5..d81453e 100644
--- a/src/pages/user/UserList.vue
+++ b/src/pages/user/UserList.vue
@@ -34,11 +34,51 @@
-
- 新增用户
- 邀请注册
-
+
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+
@@ -47,6 +87,7 @@ import { Toast } from "tdesign-mobile-vue";
import { type Page, type PageResult, UserAPI, type User, useUserStore } from "timi-web";
import ManagedUserAPI from "@/api/ManagedUserAPI";
import { useCurrentStoreStore } from "@/store/currentStoreStore";
+import { useNavBarStore } from "@/store/navBarStore";
import type { ManagedUser } from "@/types/ManagedUser";
import { usePermissionSettingsStore } from "@/store/permissionSettingsStore";
import { buildFallbackAvatar } from "@/utils/avatar";
@@ -61,10 +102,13 @@ defineOptions({
const router = useRouter();
const userStore = useUserStore();
const currentStoreStore = useCurrentStoreStore();
+const navBarStore = useNavBarStore();
const permissionStore = usePermissionSettingsStore();
+const actionVisible = ref(false);
const inviteVisible = ref(false);
const isGlobalManager = computed(() => userStore.hasRoles(gaoRoleCodes.globalManager));
+const canCreateUser = computed(() => userStore.hasPermissions(permissionCodes.user.create));
const userListOptions = computed(() => ({ storeId: currentStoreStore.currentStoreId }));
@@ -158,12 +202,18 @@ async function fetch(): Promise {
// ---------- 导航 ----------
async function toCreate(): Promise {
+ actionVisible.value = false;
await router.push({
path: "/management/users/create",
query: currentStoreStore.currentStoreId ? { storeId: currentStoreStore.currentStoreId } : undefined
});
}
+function openInvite(): void {
+ actionVisible.value = false;
+ inviteVisible.value = true;
+}
+
async function toDetail(item: ManagedUser): Promise {
if (!item.id) {
return;
@@ -173,17 +223,20 @@ async function toDetail(item: ManagedUser): Promise {
}
onMounted(async () => {
+ navBarStore.setCustomRightVisible(canCreateUser.value);
try {
await loadData();
} catch {
Toast.error("用户列表加载失败");
}
});
+
+onUnmounted(() => navBarStore.clearRight());