update:重新渲染system页面
This commit is contained in:
parent
6ba18dfad2
commit
b79b226a74
@ -11,7 +11,6 @@ class OperateLog extends \think\Model
|
||||
use BaseOptionsTrait;
|
||||
use OperateLogSearch;
|
||||
|
||||
|
||||
protected $name = 'operate_log';
|
||||
|
||||
protected $field = [
|
||||
@ -42,4 +41,9 @@ class OperateLog extends \think\Model
|
||||
->order($this->aliasField('id'), 'desc')
|
||||
->paginate();
|
||||
}
|
||||
|
||||
protected function getCreatedAtAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
}
|
||||
|
46
catch/system/tables/Database.php
Normal file
46
catch/system/tables/Database.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace catchAdmin\system\tables;
|
||||
|
||||
use catcher\CatchTable;
|
||||
use catcher\library\table\Actions;
|
||||
use catcher\library\table\HeaderItem;
|
||||
use catcher\library\table\Search;
|
||||
|
||||
|
||||
class Database extends CatchTable
|
||||
{
|
||||
protected function form()
|
||||
{
|
||||
// TODO: Implement form() method.
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function table()
|
||||
{
|
||||
// TODO: Implement table() method.
|
||||
return $this->getTable('database')
|
||||
->header([
|
||||
HeaderItem::label('表名')->prop('name'),
|
||||
HeaderItem::label('引擎')->prop('engine'),
|
||||
HeaderItem::label('字符集')->prop('collation'),
|
||||
HeaderItem::label('数据行数')->prop('rows'),
|
||||
HeaderItem::label('数据大小')->prop('data_length'),
|
||||
|
||||
HeaderItem::label('索引大小')->prop('index_length'),
|
||||
HeaderItem::label('注释')->prop('comment'),
|
||||
HeaderItem::label('创建时间')->prop('create_time'),
|
||||
HeaderItem::label('操作')->actions([
|
||||
Actions::view()
|
||||
]),
|
||||
])
|
||||
->withApiRoute('tables')
|
||||
->withSearch([
|
||||
Search::text('tablename', '请输入表名'),
|
||||
Search::select('engine', '请选择引擎', [
|
||||
['label' => 'MyISAM', 'value' => 'MyISAM'],
|
||||
['label' => 'InnoDB', 'value' => 'InnoDB']
|
||||
])
|
||||
])
|
||||
->render();
|
||||
}
|
||||
}
|
40
catch/system/tables/LoginLog.php
Normal file
40
catch/system/tables/LoginLog.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace catchAdmin\system\tables;
|
||||
|
||||
use catchAdmin\system\tables\forms\Factory;
|
||||
use catcher\CatchTable;
|
||||
use catcher\library\table\HeaderItem;
|
||||
use catcher\library\table\Search;
|
||||
|
||||
|
||||
class LoginLog extends CatchTable
|
||||
{
|
||||
protected function form()
|
||||
{
|
||||
// TODO: Implement form() method.
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function table()
|
||||
{
|
||||
// TODO: Implement table() method.
|
||||
return $this->getTable('loginLog')
|
||||
->header([
|
||||
HeaderItem::label()->selection(),
|
||||
HeaderItem::label('登陆用户')->prop('login_name'),
|
||||
HeaderItem::label('登陆IP')->prop('login_ip'),
|
||||
HeaderItem::label('客户端')->prop('browser'),
|
||||
HeaderItem::label('系统')->prop('os'),
|
||||
HeaderItem::label('登陆状态')->prop('status')->component('status'),
|
||||
HeaderItem::label('登陆时间')->prop('login_at')->component('loginAt'),
|
||||
])
|
||||
->withApiRoute('log/login')
|
||||
->withSearch([
|
||||
Search::startAt(),
|
||||
Search::endAt()
|
||||
])
|
||||
->selectionChange()
|
||||
->render();
|
||||
|
||||
}
|
||||
}
|
47
catch/system/tables/OperateLog.php
Normal file
47
catch/system/tables/OperateLog.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
namespace catchAdmin\system\tables;
|
||||
|
||||
use catcher\CatchTable;
|
||||
use catcher\library\table\HeaderItem;
|
||||
use catcher\library\table\Search;
|
||||
|
||||
|
||||
class OperateLog extends CatchTable
|
||||
{
|
||||
protected function form()
|
||||
{
|
||||
// TODO: Implement form() method.
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function table()
|
||||
{
|
||||
// TODO: Implement table() method.
|
||||
return $this->getTable('operateLog')
|
||||
->header([
|
||||
HeaderItem::label()->selection(),
|
||||
HeaderItem::label('编号')->prop('id'),
|
||||
HeaderItem::label('操作人')->prop('creator'),
|
||||
HeaderItem::label('操作模块')->prop('module'),
|
||||
HeaderItem::label('操作菜单')->prop('operate'),
|
||||
HeaderItem::label('菜单')->prop('route'),
|
||||
HeaderItem::label('请求方式')->prop('method'),
|
||||
HeaderItem::label('参数')->prop('params')->component('params'),
|
||||
HeaderItem::label('参数')->prop('created_at'),
|
||||
])
|
||||
->withApiRoute('log/operate')
|
||||
->withSearch([
|
||||
Search::text('creator', '请输入操作人'),
|
||||
Search::text('module', '请输入模块'),
|
||||
Search::select('method', '请选择请求方法', [
|
||||
['label' => 'GET', 'value' => 'GET'],
|
||||
['label' => 'POST', 'value' => 'POST'],
|
||||
['label' => 'PUT', 'value' => 'PUT'],
|
||||
['label' => 'DELETE', 'value' => 'DELETE'],
|
||||
])
|
||||
])
|
||||
->selectionChange()
|
||||
->render();
|
||||
|
||||
}
|
||||
}
|
45
catch/system/tables/SensitiveWord.php
Normal file
45
catch/system/tables/SensitiveWord.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
namespace catchAdmin\system\tables;
|
||||
|
||||
use catchAdmin\system\tables\forms\Factory;
|
||||
use catcher\CatchTable;
|
||||
use catcher\library\table\Actions;
|
||||
use catcher\library\table\HeaderItem;
|
||||
use catcher\library\table\Search;
|
||||
|
||||
class SensitiveWord extends CatchTable
|
||||
{
|
||||
protected function form()
|
||||
{
|
||||
// TODO: Implement form() method.
|
||||
return Factory::create('SensitiveWord');
|
||||
}
|
||||
|
||||
protected function table()
|
||||
{
|
||||
// TODO: Implement table() method.
|
||||
return $this->getTable('SensitiveWord')
|
||||
->header([
|
||||
HeaderItem::label()->selection(),
|
||||
HeaderItem::label('编号')->prop('id'),
|
||||
HeaderItem::label('敏感词')->prop('word'),
|
||||
HeaderItem::label('创建人')->prop('creator'),
|
||||
HeaderItem::label('创建时间')->prop('created_at'),
|
||||
HeaderItem::label('更新时间')->prop('updated_at'),
|
||||
HeaderItem::label('操作')->actions([
|
||||
Actions::update(),
|
||||
Actions::delete()
|
||||
])
|
||||
])
|
||||
->withActions([
|
||||
Actions::create()
|
||||
])
|
||||
->withDialogWidth('35%')
|
||||
->withApiRoute('sensitive/word')
|
||||
->withSearch([
|
||||
Search::text('word', '输入敏感词')
|
||||
])
|
||||
->selectionChange()
|
||||
->render();
|
||||
}
|
||||
}
|
12
catch/system/tables/forms/Factory.php
Normal file
12
catch/system/tables/forms/Factory.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace catchAdmin\system\tables\forms;
|
||||
|
||||
use catcher\library\form\FormFactory;
|
||||
|
||||
class Factory extends FormFactory
|
||||
{
|
||||
public static function from(): string
|
||||
{
|
||||
return __NAMESPACE__;
|
||||
}
|
||||
}
|
15
catch/system/tables/forms/SensitiveWord.php
Normal file
15
catch/system/tables/forms/SensitiveWord.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace catchAdmin\system\tables\forms;
|
||||
|
||||
use catchAdmin\permissions\model\Department as DepartmentModel;
|
||||
use catcher\library\form\Form;
|
||||
|
||||
class SensitiveWord extends Form
|
||||
{
|
||||
public function fields(): array
|
||||
{
|
||||
return [
|
||||
Form::input('word', '敏感词')->required()->placeholder('请输入敏感词'),
|
||||
];
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user