monacoLeft.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Admin\Forms;
  3. use App\Admin\Renderable\DistDistributorTable;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Dcat\Admin\Widgets\Form;
  6. use App\Admin\Repositories\DistAppearance;
  7. class monacoLeft extends Form
  8. {
  9. public function form()
  10. {
  11. // 定义表单字段
  12. //$this->text('name', '姓名')->width(12,12)->setLabelClass('d-flex');
  13. //主题选择
  14. $this->select('appearance_id','Select Appearance')
  15. ->options(DistAppearance::selectOptions())
  16. ->width(12,12)
  17. ->setLabelClass('d-flex');
  18. //供应商选择
  19. $this->selectTable('dist_id', 'Select Distributor')
  20. ->width(12,12)
  21. ->setLabelClass('d-flex')
  22. ->title('Select Distributor')
  23. ->placeholder('Select Distributor')
  24. ->from(DistDistributorTable::make())
  25. ->help('If empty, use the original template.');
  26. $this->divider();
  27. $this->disableSubmitButton();
  28. $this->disableResetButton();
  29. $this->method('GET');
  30. }
  31. // 处理表单提交请求
  32. public function handle(array $input)
  33. {
  34. // dump($input);
  35. return $this->response()->success('Processed successfully.')->refresh();
  36. }
  37. /**
  38. * 返回表单数据,如不需要可以删除此方法
  39. *
  40. * @return array
  41. */
  42. public function default()
  43. {
  44. return [
  45. ];
  46. }
  47. }