@extends('layouts.app') @section('title', '專案管理看板') @push('styles') @endpush @section('content')
{{-- 頂部工具列 --}}
返回專案清單

專案管理看板

{{-- 人員 --}}
{{-- 新增者 --}}
{{-- 專案 --}}
{{-- 排序 --}}
{{-- 泳道篩選 --}}
{{-- 第二行:統計 + 新增 --}} @php $today = now()->timezone('Asia/Taipei')->toDateString(); $totalCount = $issues->count(); $progressCount = $issues->whereIn('status', ['hold', 'in_progress'])->count(); $resolvedCount = $issues->whereIn('status', ['completed', 'watching', 'custom__1779266741', 'custom__1779266752'])->count(); @endphp
全部 {{ $totalCount }} 處理中 {{ $progressCount }} 已完成 {{ $resolvedCount }}
{{-- 新增議題 Modal --}} {{-- 編輯議題 Modal --}} {{-- Toast --}} {{-- 看板主體 --}} @if($issues->isEmpty())
目前沒有議題
@else
@foreach($statuses as $statusIdx => $status) @php $colIssues = $issuesByStatus->get($status->slug, collect()); $count = $colIssues->count(); $colColor = match($status->slug) { 'pending' => 'col-pending', 'in_progress'=> 'col-progress', 'hold' => 'col-hold', 'watching' => 'col-watching', 'completed' => 'col-completed', 'rejected' => 'col-rejected', default => 'col-default-' . ($statusIdx % 5), }; $statGroup = in_array($status->slug, ['hold', 'in_progress']) ? 'progress' : (str_contains($status->slug, 'completed') || str_contains($status->slug, 'watching') ? 'resolved' : 'other'); @endphp
{{ $status->label }} {{ $count }}
@foreach($colIssues as $issue) @php $isMine = $issue->assigned_to_id === $currentUser->id; $priClass = match($issue->priority) { 'urgent' => 'pri-urgent', 'high' => 'pri-high', 'low' => 'pri-low', default => 'pri-normal', }; $priData = $priorities[$issue->priority] ?? ['label' => $issue->priority, 'color' => 'secondary']; $overdue = $issue->due_date && $issue->due_date->isPast(); $trackerLabels = $trackers; @endphp
{{-- 卡片頂部 --}}
@if($isMine)@endif #{{ $issue->redmine_id }} @if($issue->project) {{ $issue->project->name }} @endif
{{ $priData['label'] }} @if($issue->tracker) {{ $trackers[$issue->tracker]['label'] ?? $issue->tracker }} @endif @if($issue->project) @endif @if($issue->user_id === $currentUser->id || $currentUser->isAdmin()) @endif
{{-- 標題(連到議題詳情,project 為 null 時不加連結) --}} @if($issue->project) {{ Str::limit($issue->title, 60) }} @else {{ Str::limit($issue->title, 60) }} @endif {{-- 母議題徽章 --}} @if($issue->parent_id)
#{{ $issue->parent_id }}
@endif {{-- 指派人 + 日期 --}}
{{ $issue->assignee?->name ?? '未指派' }}
{{-- 到期日(本地可編輯)--}}
{{ $issue->due_date?->format('Y-m-d H:i') ?? '到期日' }}
{{-- 完成日(可編輯,從 Redmine closed_on 帶入)--}}
{{ $issue->completed_on?->format('Y-m-d H:i') ?? '完成日' }}
{{-- 工時 --}} @php $estimated = $issue->estimated_hours; $spent = $issue->timeEntries->sum('hours'); @endphp @if($estimated || $spent)
@if($estimated) 預估 {{ number_format($estimated, 1) }}小時 @endif @if($spent) 已用 {{ number_format($spent, 1) }}小時 @endif
@endif {{-- 完成度 --}} @if(($issue->done_ratio ?? 0) > 0)
@endif
@endforeach
@endforeach
@endif
{{-- ── 一鍵填寫 Modal ──────────────────────────────────────── --}} @endsection @push('scripts') @endpush