feat: complete MVP administration tools

This commit is contained in:
selfrelease
2026-07-18 19:47:20 +08:00
parent d0a2f4f923
commit b311be6aa6
14 changed files with 615 additions and 8 deletions
@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:aioa_mobile/features/profile/application/device_controller.dart';
import 'package:intl/intl.dart';
import 'package:aioa_mobile/features/admin/application/admin_controller.dart';
import 'package:go_router/go_router.dart';
class ProfilePage extends ConsumerWidget {
const ProfilePage({super.key});
@@ -10,6 +12,8 @@ class ProfilePage extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final devices = ref.watch(deviceListProvider);
final permissions =
ref.watch(currentPermissionsProvider).value ?? const <String>{};
return ListView(
padding: const EdgeInsets.all(18),
children: [
@@ -21,6 +25,14 @@ class ProfilePage extends ConsumerWidget {
),
),
const SizedBox(height: 12),
if (permissions.contains('ORGANIZATION_MANAGE_TENANT')) ...[
FilledButton.icon(
onPressed: () => context.push('/admin'),
icon: const Icon(Icons.admin_panel_settings),
label: const Text('OA 管理中心'),
),
const SizedBox(height: 12),
],
Text('登录设备', style: Theme.of(context).textTheme.titleMedium),
const SizedBox(height: 8),
...devices.when(