<?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\Util\ResCategoryUtil; use Module\Res\Util\ResCatUtil; class ResCatGroupController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $lZifj) { $lZifj->init('res_cat_group')->field(function ($lZifj) { $lZifj->id('id', 'ID'); $lZifj->text('title', '名称'); $lZifj->icon('icon', '图标'); $lZifj->tree('categoryIds', '分类')->tree(ResCategoryUtil::categoryTree())->spread(false); $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')); })->hookChanged(function (Form $yZTO2) { ResCatUtil::clearCache(); })->canShow(false)->title('资源辅助分类组')->asTree()->treeMaxLevel(1); } }