generated from liutk/owl-admin-base
举报投诉
parent
c68fe05a28
commit
7446150844
|
|
@ -11,6 +11,7 @@ use Illuminate\Support\Facades\Validator;
|
||||||
use Slowlyo\OwlAdmin\Admin;
|
use Slowlyo\OwlAdmin\Admin;
|
||||||
use Slowlyo\OwlAdmin\Renderers\AjaxAction;
|
use Slowlyo\OwlAdmin\Renderers\AjaxAction;
|
||||||
use Slowlyo\OwlAdmin\Renderers\DrawerAction;
|
use Slowlyo\OwlAdmin\Renderers\DrawerAction;
|
||||||
|
use Slowlyo\OwlAdmin\Renderers\Form;
|
||||||
use Slowlyo\OwlAdmin\Renderers\Page;
|
use Slowlyo\OwlAdmin\Renderers\Page;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -43,7 +44,7 @@ class ComplaintController extends AdminController
|
||||||
]),
|
]),
|
||||||
]))
|
]))
|
||||||
->columns([
|
->columns([
|
||||||
amis()->TableColumn()->name('id')->label(__('complaint.complaint.id')),
|
amis()->TableColumn()->name('created_at')->label(__('complaint.complaint.created_at')),
|
||||||
amis()->TableColumn()
|
amis()->TableColumn()
|
||||||
->name('_employee')
|
->name('_employee')
|
||||||
->label(__('complaint.complaint.employee'))
|
->label(__('complaint.complaint.employee'))
|
||||||
|
|
@ -65,7 +66,6 @@ class ComplaintController extends AdminController
|
||||||
->label(__('complaint.complaint.complaint_status'))
|
->label(__('complaint.complaint.complaint_status'))
|
||||||
->type('mapping')
|
->type('mapping')
|
||||||
->map(ComplaintStatus::labelMap()),
|
->map(ComplaintStatus::labelMap()),
|
||||||
amis()->TableColumn()->name('created_at')->label(__('complaint.complaint.created_at')),
|
|
||||||
$this->rowActions([
|
$this->rowActions([
|
||||||
$this->rowProcessStartButton()
|
$this->rowProcessStartButton()
|
||||||
->visible(Admin::user()->can('complaint.complaints.start'))
|
->visible(Admin::user()->can('complaint.complaints.start'))
|
||||||
|
|
@ -73,12 +73,28 @@ class ComplaintController extends AdminController
|
||||||
$this->rowProcessCompleteButton()
|
$this->rowProcessCompleteButton()
|
||||||
->visible(Admin::user()->can('complaint.complaints.complete'))
|
->visible(Admin::user()->can('complaint.complaints.complete'))
|
||||||
->visibleOn('${complaint_status === '.ComplaintStatus::Processing->value.'}'),
|
->visibleOn('${complaint_status === '.ComplaintStatus::Processing->value.'}'),
|
||||||
|
$this->rowShowButton()
|
||||||
|
->visible(Admin::user()->can('admin.complaint.complaints.view')),
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->baseList($crud);
|
return $this->baseList($crud);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function detail(): Form
|
||||||
|
{
|
||||||
|
return $this->baseDetail()->title('')->body([
|
||||||
|
amis()->Property()->items([
|
||||||
|
['label' => __('complaint.complaint.employee'), 'content' => '${anonymous ? "匿名" : employee.name}'],
|
||||||
|
['label' => __('complaint.complaint.created_at'), 'content' => '${created_at}'],
|
||||||
|
['label' => __('complaint.complaint.complaint_status'), 'content' => amis()->Mapping()->name('complaint_status')->map(ComplaintStatus::labelMap())],
|
||||||
|
['label' => __('complaint.complaint.content'), 'content' => '${content}', 'span' => 3],
|
||||||
|
['label' => __('complaint.complaint.result'), 'content' => '${result}', 'span' => 3],
|
||||||
|
['label' => __('complaint.complaint.photos'), 'content' => amis()->Images()->enlargeAble()->source('${photos}')->enlargeWithGallary(), 'span' => 3],
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理开始
|
* 处理开始
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ Route::group([
|
||||||
'as' => 'complaint.',
|
'as' => 'complaint.',
|
||||||
], function (Router $router) {
|
], function (Router $router) {
|
||||||
// 举报投诉
|
// 举报投诉
|
||||||
$router->resource('complaints', ComplaintController::class)->only(['index']);
|
$router->resource('complaints', ComplaintController::class)->only(['index', 'show']);
|
||||||
$router->post('complaints/{complaint}/start', [ComplaintController::class, 'start'])->name('complaints.start');
|
$router->post('complaints/{complaint}/start', [ComplaintController::class, 'start'])->name('complaints.start');
|
||||||
$router->post('complaints/{complaint}/complete', [ComplaintController::class, 'complete'])->name('complaints.complete');
|
$router->post('complaints/{complaint}/complete', [ComplaintController::class, 'complete'])->name('complaints.complete');
|
||||||
// 意见箱
|
// 意见箱
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ class AdminPermissionSeeder extends Seeder
|
||||||
'name' => '举报投诉',
|
'name' => '举报投诉',
|
||||||
'icon' => 'pixelarticons:list-box',
|
'icon' => 'pixelarticons:list-box',
|
||||||
'uri' => '/complaint/complaints',
|
'uri' => '/complaint/complaints',
|
||||||
'resource' => ['list'],
|
'resource' => ['list', 'view'],
|
||||||
'children' => [
|
'children' => [
|
||||||
'start' => '开始',
|
'start' => '开始',
|
||||||
'complete' => '完成',
|
'complete' => '完成',
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ return [
|
||||||
'created_at' => '投诉时间',
|
'created_at' => '投诉时间',
|
||||||
'start' => '开始',
|
'start' => '开始',
|
||||||
'complete' => '完成',
|
'complete' => '完成',
|
||||||
|
'photos' => '证明材料',
|
||||||
],
|
],
|
||||||
|
|
||||||
'feedback' => [
|
'feedback' => [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue