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 Permission extends CatchTable
|
|
|
|
{
|
|
|
|
public function table()
|
|
|
|
{
|
|
|
|
return $this->getTable('permission')
|
|
|
|
->header([
|
|
|
|
HeaderItem::label('菜单名称')->prop('permission_name'),
|
|
|
|
HeaderItem::label('路由Path')->prop('route'),
|
|
|
|
HeaderItem::label('权限标识')->prop('actionList')->width(250)->component('actions', 'actionList'),
|
2021-03-31 20:44:40 +08:00
|
|
|
HeaderItem::label('状态')->prop('hidden')->component('status'),
|
2021-03-31 20:20:21 +08:00
|
|
|
HeaderItem::label('创建时间')->prop('created_at'),
|
|
|
|
HeaderItem::label('操作')->width(250)->actions([
|
2021-04-01 18:39:11 +08:00
|
|
|
Actions::update(''),
|
|
|
|
Actions::delete('')
|
2021-03-31 20:20:21 +08:00
|
|
|
])
|
|
|
|
])
|
|
|
|
->withActions([
|
|
|
|
Actions::create()
|
|
|
|
])
|
|
|
|
->withSearch([
|
|
|
|
Search::text('permission_name', '菜单名称')
|
|
|
|
])
|
|
|
|
->withFilterParams([
|
|
|
|
'permission_name' => '',
|
|
|
|
'actionList' => 'actionList'
|
|
|
|
])
|
|
|
|
->withDefaultQueryParams(['actionList'])
|
|
|
|
->withApiRoute('permissions')
|
|
|
|
->toTreeTable()
|
|
|
|
->render();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function form()
|
|
|
|
{
|
|
|
|
// TODO: Implement form() method.
|
|
|
|
return Factory::create('permission');
|
|
|
|
}
|
|
|
|
}
|