From 080412d2b3b1a408b7294a73442b26ace1af2fbc Mon Sep 17 00:00:00 2001 From: sky121113 Date: Sat, 16 May 2026 21:25:11 +0800 Subject: [PATCH] =?UTF-8?q?[FEAT]=20=E5=84=AA=E5=8C=96=E9=81=A0=E7=AB=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E8=88=87=E5=BA=AB=E5=AD=98=E6=AD=B7=E5=8F=B2?= =?UTF-8?q?=E7=B4=80=E9=8C=84=E4=B9=8B=E6=97=A5=E6=9C=9F=E7=AF=A9=E9=81=B8?= =?UTF-8?q?=E4=BB=8B=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 將單一日期區間選擇器拆分為獨立的「開始時間」與「結束時間」輸入框,提升手機版適應性。 2. 修正後端解析邏輯,移除強制 startOfDay() 以支援使用者選擇的精確分鐘數。 3. 修復庫存管理頁面中「截止日」欄位的 HTML 標籤閉合錯誤 (r">" 亂碼)。 4. 導入 Flatpickr defaultDate 與 position 參數,解決時間選擇器 UI 不對齊與邊緣裁切問題。 5. 更新標籤翻譯為「開始時間」與「結束時間」,並補齊庫存分頁的 Alpine.js 預設日期狀態。 --- .../Controllers/Admin/RemoteController.php | 6 ++ .../partials/tab-history-index.blade.php | 70 +++++++++-------- .../remote/partials/tab-history.blade.php | 78 ++++++++++--------- resources/views/admin/remote/stock.blade.php | 4 +- 4 files changed, 87 insertions(+), 71 deletions(-) diff --git a/app/Http/Controllers/Admin/RemoteController.php b/app/Http/Controllers/Admin/RemoteController.php index 7e52303..13b832c 100644 --- a/app/Http/Controllers/Admin/RemoteController.php +++ b/app/Http/Controllers/Admin/RemoteController.php @@ -72,6 +72,9 @@ class RemoteController extends Controller } catch (\Exception $e) { // 忽略解析錯誤 } + } else { + // 預設過濾當天紀錄 + $historyQuery->whereDate('created_at', now()->toDateString()); } // 指令類型過濾 @@ -259,6 +262,9 @@ class RemoteController extends Controller } catch (\Exception $e) { // 忽略解析錯誤 } + } else { + // 預設過濾當天紀錄 + $historyQuery->whereDate('created_at', now()->toDateString()); } // 狀態過濾 diff --git a/resources/views/admin/remote/partials/tab-history-index.blade.php b/resources/views/admin/remote/partials/tab-history-index.blade.php index a0a7b83..3d6931b 100644 --- a/resources/views/admin/remote/partials/tab-history-index.blade.php +++ b/resources/views/admin/remote/partials/tab-history-index.blade.php @@ -36,41 +36,47 @@ class="luxury-input py-2.5 pl-12 pr-6 block w-full sm:w-72 text-sm font-bold"> - {{-- 日期範圍 --}} -
+ {{-- 起始時間 --}} +
- - + + - - - + +
{{ __('Start Time') }}
+
+ + {{-- 結束時間 --}} +
+ + + + + + +
{{ __('End Time') }}
{{-- 指令類型 --}} diff --git a/resources/views/admin/remote/partials/tab-history.blade.php b/resources/views/admin/remote/partials/tab-history.blade.php index a46492a..2a2d559 100644 --- a/resources/views/admin/remote/partials/tab-history.blade.php +++ b/resources/views/admin/remote/partials/tab-history.blade.php @@ -17,45 +17,49 @@ placeholder="{{ __('Search machines...') }}" class="luxury-input py-2.5 pl-12 pr-6 block w-full">
- -
- - - + +
+ + + - - - + +
{{ __('Start Time') }}
+
+ + +
+ + + + + + +
{{ __('End Time') }}
diff --git a/resources/views/admin/remote/stock.blade.php b/resources/views/admin/remote/stock.blade.php index 2ab2ce6..869a27f 100644 --- a/resources/views/admin/remote/stock.blade.php +++ b/resources/views/admin/remote/stock.blade.php @@ -25,8 +25,8 @@ // 機器搜尋狀態 machineSearch: '{{ request('machine_search') }}', historySearch: '{{ request('search') }}', - historyStartDate: '{{ request('start_date') }}', - historyEndDate: '{{ request('end_date') }}', + historyStartDate: '{{ request('start_date', now()->startOfDay()->format('Y-m-d H:i')) }}', + historyEndDate: '{{ request('end_date', now()->endOfDay()->format('Y-m-d H:i')) }}', historyStatus: '{{ request('status') }}', async init() {