update:更新权限系统
This commit is contained in:
51
catch/permissions/tables/User.php
Normal file
51
catch/permissions/tables/User.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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'),
|
||||
HeaderItem::label('操作')->width(150)->actions([
|
||||
Actions::update(''), Actions::delete('')
|
||||
])
|
||||
])
|
||||
->withSearch([
|
||||
Search::text('username', '用户名'),
|
||||
Search::text('email', '邮箱'),
|
||||
Search::status()
|
||||
])
|
||||
->withApiRoute('users')
|
||||
->withActions([
|
||||
Actions::create()
|
||||
])
|
||||
->withFilterParams([
|
||||
'username' => '',
|
||||
'email' => '',
|
||||
'status' => '',
|
||||
'department_id' => ''
|
||||
])
|
||||
->selectionChange()
|
||||
->render();
|
||||
}
|
||||
|
||||
protected function form()
|
||||
{
|
||||
// TODO: Implement form() method.
|
||||
return Factory::create('user');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user