54 lines
1.9 KiB
PHP
Raw Normal View History

2021-03-31 20:20:21 +08:00
<?php
namespace catchAdmin\permissions\tables;
use catcher\CatchTable;
use catchAdmin\permissions\tables\forms\Factory;
use catcher\library\table\Actions;
use catcher\library\table\HeaderItem;
use catcher\library\table\Search;
class User extends CatchTable
{
public function table()
{
// TODO: Implement table() method.
return $this->getTable('user')
->header([
HeaderItem::label('')->selection(),
HeaderItem::label('用户名')->prop('username'),
HeaderItem::label('邮箱')->prop('email'),
HeaderItem::label('状态')->prop('status')->component('status', 'status'),
HeaderItem::label('创建时间')->prop('created_at'),
2021-04-03 10:35:53 +08:00
HeaderItem::label('操作')->width(200)->actions([
Actions::update(), Actions::delete()
2021-03-31 20:20:21 +08:00
])
])
->withSearch([
2021-04-05 12:26:12 +08:00
Search::label('用户名')->text('username', '用户名'),
Search::label('邮箱')->text('email', '邮箱'),
Search::label('状态')->status(),
Search::hidden('department_id', '')
2021-03-31 20:20:21 +08:00
])
->withApiRoute('users')
->withActions([
2021-04-03 10:35:53 +08:00
Actions::create(),
2021-04-05 12:26:12 +08:00
Actions::export()
2021-03-31 20:20:21 +08:00
])
2021-04-03 10:35:53 +08:00
->withExportRoute('user/export')
2021-03-31 20:20:21 +08:00
->withFilterParams([
'username' => '',
'email' => '',
'status' => '',
'department_id' => ''
])
->selectionChange()
->render();
}
protected function form()
{
// TODO: Implement form() method.
return Factory::create('user');
}
}