generated from liutk/owl-admin-base
64 lines
2.6 KiB
PHP
64 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
use App\Models\PersonChange;
|
|
use Slowlyo\OwlAdmin\Admin;
|
|
use Slowlyo\OwlAdmin\Renderers\Page;
|
|
use Slowlyo\OwlAdmin\Renderers\Form;
|
|
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
|
use App\Admin\Components;
|
|
use App\Services\Admin\PersonChangeService;
|
|
use App\Models\Keyword;
|
|
|
|
/**
|
|
* 人口变动
|
|
*
|
|
*/
|
|
class PersonChangeController extends AdminController
|
|
{
|
|
protected string $serviceName = PersonChangeService::class;
|
|
|
|
public function list(): Page
|
|
{
|
|
$crud = $this->baseCRUD()->tableLayout('fixed')
|
|
->headerToolbar([
|
|
amis('reload')->align('right'),
|
|
amis('filter-toggler')->align('right'),
|
|
])
|
|
->filter($this->baseFilter()->labelWidth('80px')->body([
|
|
amis()->GroupControl()->mode('horizontal')->body([
|
|
amis()->YearControl('year', __('admin.year'))->valueFormat('YYYY')->columnRatio(3),
|
|
amis()->SelectControl('person.organized_body_id', __('admin.persons.organized_body'))->options(Keyword::where('parent_key', 'organized_body')->pluck('name', 'id')->toArray())->columnRatio(3)->clearable(true),
|
|
// amis()->TextControl('person.name', __('admin.persons.name'))->placeholder(__('admin.persons.name'))->columnRatio(3),
|
|
amis()->SelectControl('type', __('admin.person_changes.type'))->options(PersonChange::typeMap())->columnRatio(3)->clearable(true),
|
|
]),
|
|
]))
|
|
->columns([
|
|
amis()->TableColumn('person.organized_body.name', __('admin.persons.organized_body'))->width('100px'),
|
|
amis()->TableColumn('changed_at', __('admin.person_changes.changed_at'))->width('100px'),
|
|
amis()->TableColumn('type', __('admin.person_changes.type'))->type('mapping')->map(PersonChange::typeMap()),
|
|
amis()->TableColumn('person.name', __('admin.persons.name'))->width('100px')->copyable()->searchable(),
|
|
amis()->TableColumn('extends_mark', __('admin.person_changes.extends_mark')),
|
|
amis()->TableColumn('phone', __('admin.person_changes.phone')),
|
|
amis()->TableColumn('remark', __('admin.person_changes.remark')),
|
|
amis()->TableColumn('created_at', __('admin.person_changes.created_at'))->type('datetime')->sortable(true),
|
|
]);
|
|
|
|
return $this->baseList($crud);
|
|
}
|
|
|
|
public function form(): Form
|
|
{
|
|
return $this->baseForm()->body([
|
|
|
|
]);
|
|
}
|
|
|
|
public function detail(): Form
|
|
{
|
|
return $this->baseDetail()->body([
|
|
|
|
]);
|
|
}
|
|
} |