From f98d059bc3710e0e51e1db5881fe8b1a52bc665a Mon Sep 17 00:00:00 2001 From: sky121113 Date: Tue, 24 Mar 2026 16:57:15 +0800 Subject: [PATCH] =?UTF-8?q?[FIX]=20=E9=87=8D=E6=96=B0=E5=B0=8E=E5=90=91?= =?UTF-8?q?=E6=A9=9F=E5=8F=B0=E5=88=97=E8=A1=A8=E9=BA=B5=E5=8C=85=E5=B1=91?= =?UTF-8?q?=E8=87=B3=E6=AD=A3=E7=A2=BA=E5=B1=A4=E7=B4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/components/breadcrumbs.blade.php | 157 +++++++++--------- 1 file changed, 82 insertions(+), 75 deletions(-) diff --git a/resources/views/components/breadcrumbs.blade.php b/resources/views/components/breadcrumbs.blade.php index a7465d2..15ad795 100644 --- a/resources/views/components/breadcrumbs.blade.php +++ b/resources/views/components/breadcrumbs.blade.php @@ -80,83 +80,90 @@ } // 3. 處理最後一個動作/頁面 - if ($lastSegment !== 'index') { - $pageLabel = match($lastSegment) { - 'edit' => str_starts_with($routeName, 'profile') ? null : __('Edit'), - 'create' => __('Create'), - 'show' => __('Detail'), - 'logs' => __('Machine Logs'), - 'permissions' => __('Machine Permissions'), - 'utilization' => __('Utilization Rate'), - 'expiry' => __('Expiry Management'), - 'maintenance' => __('Maintenance Records'), - 'ui-elements' => __('UI Elements'), - 'helper' => __('Helper'), - 'questionnaire' => __('Questionnaire'), - 'games' => __('Games'), - 'timer' => __('Timer'), - 'personal' => __('Warehouse List (Individual)'), - 'stock-management' => __('Stock Management'), - 'transfers' => __('Transfers'), - 'purchases' => __('Purchases'), - 'replenishments' => __('Replenishments'), - 'replenishment-records' => __('Replenishment Records'), - 'machine-stock' => __('Machine Stock'), - 'staff-stock' => __('Staff Stock'), - 'returns' => __('Returns'), - 'pickup-codes' => __('Pickup Codes'), - 'orders' => __('Orders'), - 'promotions' => __('Promotions'), - 'pass-codes' => __('Pass Codes'), - 'store-gifts' => __('Store Gifts'), - 'change-stock' => __('Change Stock'), - 'machine-reports' => __('Machine Reports'), - 'product-reports' => __('Product Reports'), - 'survey-analysis' => __('Survey Analysis'), - 'products' => __('Product Management'), - 'advertisements' => __('Advertisement Management'), - 'admin-products' => __('Admin Sellable Products'), - 'accounts' => __('Account Management'), - 'sub-accounts' => __('Sub Accounts'), - 'sub-account-roles' => __('Sub Account Roles'), - 'points' => __('Point Settings'), - 'badges' => __('Badge Settings'), - 'restart' => __('Machine Restart'), - 'restart-card-reader' => __('Card Reader Restart'), - 'checkout' => __('Remote Checkout'), - 'lock' => __('Remote Lock'), - 'change' => __('Remote Change'), - 'dispense' => __('Remote Dispense'), - 'official-account' => __('Line Official Account'), - 'coupons' => __('Line Coupons'), - 'stores' => __('Store Management'), - 'time-slots' => __('Time Slots'), - 'venues' => __('Venue Management'), - 'reservations' => __('Reservations'), - 'clear-stock' => __('Clear Stock'), - 'apk-versions' => __('APK Versions'), - 'discord-notifications' => __('Discord Notifications'), - 'app-features' => __('APP Features'), - 'roles' => __('Roles'), - 'others' => __('Others'), - 'ai-prediction' => __('AI Prediction'), - 'data-config' => __('Data Configuration Permissions'), - 'sales' => __('Sales Permissions'), - 'machines' => __('Machine Management Permissions'), - 'warehouses' => __('Warehouse Permissions'), - 'analysis' => __('Analysis Permissions'), - 'audit' => __('Audit Permissions'), - 'remote' => __('Remote Permissions'), - 'line' => __('Line Permissions'), + $pageLabel = match($lastSegment) { + 'index' => match($segments[1] ?? '') { + 'members' => __('Member List'), + 'machines' => __('Machine List'), + 'warehouses' => __('Warehouse List (All)'), + 'sales' => __('Sales Records'), + 'analysis' => __('Analysis Management'), + 'audit' => __('Audit Management'), default => null, - }; + }, + 'edit' => str_starts_with($routeName, 'profile') ? null : __('Edit'), + 'create' => __('Create'), + 'show' => __('Detail'), + 'logs' => __('Machine Logs'), + 'permissions' => __('Machine Permissions'), + 'utilization' => __('Utilization Rate'), + 'expiry' => __('Expiry Management'), + 'maintenance' => __('Maintenance Records'), + 'ui-elements' => __('UI Elements'), + 'helper' => __('Helper'), + 'questionnaire' => __('Questionnaire'), + 'games' => __('Games'), + 'timer' => __('Timer'), + 'personal' => __('Warehouse List (Individual)'), + 'stock-management' => __('Stock Management'), + 'transfers' => __('Transfers'), + 'purchases' => __('Purchases'), + 'replenishments' => __('Replenishments'), + 'replenishment-records' => __('Replenishment Records'), + 'machine-stock' => __('Machine Stock'), + 'staff-stock' => __('Staff Stock'), + 'returns' => __('Returns'), + 'pickup-codes' => __('Pickup Codes'), + 'orders' => __('Orders'), + 'promotions' => __('Promotions'), + 'pass-codes' => __('Pass Codes'), + 'store-gifts' => __('Store Gifts'), + 'change-stock' => __('Change Stock'), + 'machine-reports' => __('Machine Reports'), + 'product-reports' => __('Product Reports'), + 'survey-analysis' => __('Survey Analysis'), + 'products' => __('Product Management'), + 'advertisements' => __('Advertisement Management'), + 'admin-products' => __('Admin Sellable Products'), + 'accounts' => __('Account Management'), + 'sub-accounts' => __('Sub Accounts'), + 'sub-account-roles' => __('Sub Account Roles'), + 'points' => __('Point Settings'), + 'badges' => __('Badge Settings'), + 'restart' => __('Machine Restart'), + 'restart-card-reader' => __('Card Reader Restart'), + 'checkout' => __('Remote Checkout'), + 'lock' => __('Remote Lock'), + 'change' => __('Remote Change'), + 'dispense' => __('Remote Dispense'), + 'official-account' => __('Line Official Account'), + 'coupons' => __('Line Coupons'), + 'stores' => __('Store Management'), + 'time-slots' => __('Time Slots'), + 'venues' => __('Venue Management'), + 'reservations' => __('Reservations'), + 'clear-stock' => __('Clear Stock'), + 'apk-versions' => __('APK Versions'), + 'discord-notifications' => __('Discord Notifications'), + 'app-features' => __('APP Features'), + 'roles' => __('Roles'), + 'others' => __('Others'), + 'ai-prediction' => __('AI Prediction'), + 'data-config' => __('Data Configuration Permissions'), + 'sales' => __('Sales Permissions'), + 'machines' => __('Machine Management Permissions'), + 'warehouses' => __('Warehouse Permissions'), + 'analysis' => __('Analysis Permissions'), + 'audit' => __('Audit Permissions'), + 'remote' => __('Remote Permissions'), + 'line' => __('Line Permissions'), + default => null, + }; - if ($pageLabel) { - $links[] = [ - 'label' => $pageLabel, - 'active' => true - ]; - } + if ($pageLabel) { + $links[] = [ + 'label' => $pageLabel, + 'active' => true + ]; } // 確保最後一個 link 是 active 的