[FEAT] 實作維修管理模組與 RBAC 權限整合、多語系支援及 UI 優化
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 1m3s

This commit is contained in:
2026-03-25 14:25:42 +08:00
parent 3d24ddff5a
commit 37ef6f1c10
23 changed files with 1446 additions and 460 deletions

View File

@@ -34,6 +34,7 @@
'admin.special-permission' => __('Special Permission'),
'admin.permission' => __('Permission Settings'),
'admin.basic-settings' => __('Basic Settings'),
'admin.maintenance' => __('Machine Management'),
];
// 1. 找出所屬大模組
@@ -67,18 +68,32 @@
'payment-configs' => __('Customer Payment Config'),
'warehouses' => __('Warehouse List'),
'sales' => __('Sales Records'),
'maintenance' => __('Maintenance Records'),
default => null,
};
if ($midLabel) {
$links[] = [
'label' => $midLabel,
'url' => '#', // 如果有需要可以導向 index 路由
'url' => match($midSegment) {
'maintenance' => route('admin.maintenance.index'),
'machines' => str_contains($routeName, 'basic-settings') ? route('admin.basic-settings.machines.index') : '#',
default => '#',
},
'active' => $lastSegment === 'index'
];
}
}
// 特殊處理:當只有三段且第二段是 maintenance 時,增加中間層級
if (count($segments) === 3 && $segments[1] === 'maintenance' && $lastSegment !== 'index') {
$links[] = [
'label' => __('Maintenance Records'),
'url' => route('admin.maintenance.index'),
'active' => false
];
}
// 3. 處理最後一個動作/頁面
$pageLabel = match($lastSegment) {
'index' => match($segments[1] ?? '') {
@@ -88,6 +103,7 @@
'sales' => __('Sales Records'),
'analysis' => __('Analysis Management'),
'audit' => __('Audit Management'),
'maintenance' => __('Maintenance Records'),
default => null,
},
'edit' => str_starts_with($routeName, 'profile') ? null : __('Edit'),

View File

@@ -1,6 +1,8 @@
<div x-data="{
loading: true
}"
x-on:show-global-loading.window="loading = true"
x-on:hide-global-loading.window="loading = false"
x-init="
const urlParams = new URLSearchParams(window.location.search);
const simulateDelay = urlParams.get('simulate_loading');