<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Auth\AdminPermission; use ModStart\Admin\Concern\HasAdminCRUD; use ModStart\Admin\Model\AdminLog; use ModStart\Admin\Type\AdminLogType; use ModStart\Detail\Detail; use ModStart\Form\Form; use ModStart\Grid\Grid; use ModStart\Grid\GridFilter; class AdminLogController extends Controller { use HasAdminCRUD; protected function grid() { goto NEyZf; lm7bf: return $fvhtX; goto FOE7V; NEyZf: $fvhtX = new Grid(AdminLog::class, function (Grid $fvhtX) { $fvhtX->display('id', L('ID'))->width(80); $fvhtX->select('adminUserId', L('Admin User'))->optionModel('admin_user', 'id', 'username'); $fvhtX->type('type', L('Type'))->type(AdminLogType::class)->width(100); $fvhtX->display('summary', L('Title')); $fvhtX->jsonKeyValue('data.content', L('Data')); $fvhtX->display('created_at', L('Created At'))->width(160); $fvhtX->gridFilter(function (GridFilter $CJNWc) { $CJNWc->eq('adminUserId', L('Admin User'))->selectModel('admin_user', 'id', 'username'); $CJNWc->like('summary', L('Title')); $CJNWc->eq('type', L('Type'))->radio(AdminLogType::class); }); }); goto enVCx; xvpp7: $fvhtX->canMultiSelectItem(true)->canBatchDelete(true); goto pyUau; pyUau: $fvhtX->title(L('Admin Log')); goto lm7bf; DW9ZF: $fvhtX->canDelete(AdminPermission::permit('AdminLogManage')); goto xvpp7; enVCx: $fvhtX->canAdd(false)->canEdit(false); goto DW9ZF; FOE7V: } protected function form() { $tzSkY = new Form(AdminLog::class, function (Form $tzSkY) { $tzSkY->display('id', L('ID'))->editable(true); }); return $tzSkY; } protected function detail() { goto maGW5; maGW5: $eLEQM = new Detail(AdminLog::class, function (Detail $eLEQM) { $eLEQM->display('id', L('ID')); $eLEQM->display('created_at', L('Created At')); $eLEQM->type('type', L('Type'))->type(AdminLogType::class); $eLEQM->display('summary', L('Title')); $eLEQM->jsonKeyValue('data.content', L('Data')); }); goto YKRi2; I6rEC: return $eLEQM; goto o45AV; YKRi2: $eLEQM->title(L('Admin Log')); goto I6rEC; o45AV: } }