<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Res\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Form\Form; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; use Module\Res\Type\ResDocListMode; use Module\Res\Util\ResCategoryUtil; class ResCategoryController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $lZifj) { $lZifj->init('res_category')->field(function ($lZifj) { $lZifj->id('id', 'ID')->width(50); $lZifj->text('title', '名称'); $lZifj->image('cover', '图标'); $lZifj->text('desc', '描述'); $lZifj->switch('showHome', '首页显示')->gridEditable(true)->width(100); $lZifj->display('created_at', L('Created At'))->listable(false); $lZifj->display('updated_at', L('Updated At'))->listable(false); })->gridFilter(function (GridFilter $bu01d) { $bu01d->eq('id', L('ID')); $bu01d->like('title', L('Title')); })->title('资源分类')->asTree()->treeMaxLevel(4)->hookChanged(function (Form $yZTO2) { ResCategoryUtil::clearCache(); }); } }