generated from liutk/owl-admin-base
63 lines
2.2 KiB
PHP
63 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
use Slowlyo\OwlAdmin\Admin;
|
|
use Slowlyo\OwlAdmin\Renderers\Page;
|
|
use Slowlyo\OwlAdmin\Renderers\Form;
|
|
use Slowlyo\OwlAdmin\Controllers\AdminController;
|
|
use App\Services\Admin\PersonService;
|
|
use App\Traits\CustomActionTrait;
|
|
|
|
/**
|
|
* 人口管理
|
|
*
|
|
* @property PersonService $service
|
|
*/
|
|
class PersonController extends AdminController
|
|
{
|
|
use CustomActionTrait;
|
|
|
|
protected string $serviceName = PersonService::class;
|
|
|
|
public function list(): Page
|
|
{
|
|
$crud = $this->baseCRUD()->tableLayout('fixed')
|
|
->headerToolbar([
|
|
$this->createTypeButton('drawer', 'xl'),
|
|
amis('reload')->align('right'),
|
|
amis('filter-toggler')->align('right'),
|
|
])
|
|
->filter($this->baseFilter()->labelWidth('80px')->body([
|
|
|
|
]))
|
|
->columns([
|
|
amis()->TableColumn('domicile_code', __('admin.persons.domicile_code'))->width('100px')->copyable(),
|
|
amis()->TableColumn('name', __('admin.persons.name'))->width('150px')->copyable(),
|
|
amis()->TableColumn('master_connect', __('admin.persons.master_connect'))->width('100px'),
|
|
amis()->TableColumn('master.name', __('admin.persons.master_name'))->width('150px')->copyable(),
|
|
amis()->TableColumn('idcard', __('admin.persons.idcard'))->copyable(),
|
|
amis()->TableColumn('gender', __('admin.persons.gender'))->type('mapping')->map([
|
|
"1"=>"<span class='label label-info'>男</span>",
|
|
"2"=>"<span class='label label-success'>女</span>",
|
|
"*"=> '其他:${gender}'
|
|
]),
|
|
amis()->TableColumn('birthday', __('admin.persons.birthday')),
|
|
amis()->TableColumn('age', __('admin.persons.age')),
|
|
amis()->TableColumn('now_address', __('admin.persons.now_address'))->copyable(),
|
|
|
|
amisMake()->Operation()->label(__('admin.actions'))->buttons([
|
|
$this->rowEditTypeButton('drawer', 'xl'),
|
|
])
|
|
]);
|
|
|
|
return $this->baseList($crud);
|
|
}
|
|
|
|
public function form(): Form
|
|
{
|
|
return $this->baseForm()->body([
|
|
|
|
]);
|
|
}
|
|
} |