| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Module\GameItems\AdminControllers\Actions;
- use App\Module\GameItems\Models\Item;
- use Dcat\Admin\Form;
- use Dcat\Admin\Widgets\Modal;
- use UCore\DcatAdmin\Form\AbstractTool;
- class CopyToAnotherChestAction extends AbstractTool
- {
- protected $title = '复制消耗配置到其他宝箱';
- public function render()
- {
- $form = new Form();
- // 源宝箱选择
- $form->select('source_chest_id', '源宝箱')
- ->options(Item::where('type', 3)->pluck('name', 'id'))
- ->required();
- // 目标宝箱选择
- $form->select('target_chest_id', '目标宝箱')
- ->options(Item::where('type', 3)->pluck('name', 'id'))
- ->required();
- $form->action(admin_url('game-items/chest-open-costs/copy'));
- return Modal::make()
- ->lg()
- ->title($this->title)
- ->body($form)
- ->button("<button class='btn btn-primary'>{$this->title}</button>");
- }
- }
|