基本的管理页面以及功能
This commit is contained in:
parent
4b9d6213a3
commit
16ad46304d
@ -16,6 +16,7 @@ class HostController extends Controller
|
||||
*/
|
||||
public function index(Host $host)
|
||||
{
|
||||
$host->load('user');
|
||||
$hosts = $host->paginate(100);
|
||||
|
||||
return view('admin.hosts.index', compact('hosts'));
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\WorkOrder\Reply;
|
||||
use App\Models\WorkOrder\WorkOrder;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@ -48,10 +49,16 @@ public function store(Request $request)
|
||||
* @param \App\Models\WorkOrder\WorkOrder $workOrder
|
||||
* @return Response
|
||||
*/
|
||||
public function show(WorkOrder $workOrder)
|
||||
public function show(WorkOrder $workOrder): View
|
||||
{
|
||||
//
|
||||
|
||||
$workOrder->load(['user', 'module']);
|
||||
|
||||
$replies = Reply::where('work_order_id', $workOrder->id)->paginate(100);
|
||||
|
||||
return view('admin.work-orders.show', compact('workOrder', 'replies'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -10,6 +10,7 @@
|
||||
<th>ID</th>
|
||||
<th>模块</th>
|
||||
<th>名称</th>
|
||||
<th>用户</th>
|
||||
<th>创建时间</th>
|
||||
<th>更新时间</th>
|
||||
<th>操作</th>
|
||||
@ -24,11 +25,15 @@
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('admin.hosts.edit', $host) }}" class="module_name" module="{{ $host->module_id }}">{{ $host->module_id }}</a>
|
||||
<a href="{{ route('admin.hosts.edit', $host) }}" class="module_name"
|
||||
module="{{ $host->module_id }}">{{ $host->module_id }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ $host->name }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('admin.users.edit', $host->user_id) }}"> {{ $host->user->name }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ $host->created_at }}
|
||||
</td>
|
||||
|
@ -79,7 +79,7 @@
|
||||
<x-work-order-status :status="$workOrder->status"/>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('admin.work-orders.show', $host) }}" class="btn btn-primary btn-sm">编辑</a>
|
||||
<a href="{{ route('admin.work-orders.show', $workOrder) }}" class="btn btn-primary btn-sm">编辑</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
34
resources/views/admin/work-orders/show.blade.php
Normal file
34
resources/views/admin/work-orders/show.blade.php
Normal file
@ -0,0 +1,34 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', '工单: ' . $workOrder->title)
|
||||
|
||||
@section('content')
|
||||
<h3>{{ $workOrder->title }}</h3>
|
||||
<h5>{{ \Illuminate\Mail\Markdown::parse($workOrder->content) }}</h5>
|
||||
|
||||
<x-work-order-status :status="$workOrder->status"></x-work-order-status>
|
||||
|
||||
<p>在这里,您无法回复工单,只能够查看。</p>
|
||||
<div class="mt-3">
|
||||
<!-- replies -->
|
||||
<h4>对话记录</h4>
|
||||
|
||||
@foreach($replies as $reply)
|
||||
<div class="card border-light mb-3 shadow">
|
||||
<div class="card-header">
|
||||
@if ($reply->user_id)
|
||||
<a href="{{ route('admin.users.edit', $reply->user) }}">{{ $workOrder->user->name }}</a>
|
||||
@else
|
||||
<a href="{{ route('admin.modules.edit', $workOrder->module_id) }}">{{ $workOrder->module->name }}</a>
|
||||
@endif
|
||||
|
||||
<span class="text-end">{{ $reply->created_at }}</span>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ \Illuminate\Mail\Markdown::parse($reply->content) }}
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endsection
|
Loading…
Reference in New Issue
Block a user