AceRight.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Admin\Forms;
  3. use App\Admin\Renderable\DistDistributorTable;
  4. use App\Admin\Repositories\DistAppearance;
  5. use Dcat\Admin\Widgets\Form;
  6. use App\Admin\Repositories\DistAppearanceVariable;
  7. class AceRight extends Form
  8. {
  9. public $distId;
  10. public $appearanceId;
  11. public $templateId;
  12. public function __construct($distId,$appearanceId,$templateId)
  13. {
  14. $this->distId = empty($distId) ? 0 : $distId;
  15. $this->appearanceId = empty($appearanceId) ? 0 : $appearanceId;
  16. $this->templateId = empty($templateId) ? 0 : $templateId;
  17. parent::__construct();
  18. }
  19. /*
  20. * 表单设置
  21. */
  22. public function form()
  23. {
  24. $variableRow = DistAppearanceVariable::getVariableRow($this->distId,$this->appearanceId,$this->templateId);
  25. if ($variableRow) {
  26. } else {
  27. $this->disableSubmitButton();
  28. }
  29. $this->disableResetButton();
  30. }
  31. // 处理表单提交请求
  32. public function handle(array $input)
  33. {
  34. return $this->response()->success('Processed successfully.')->refresh();
  35. }
  36. /**
  37. * 返回表单数据,如不需要可以删除此方法
  38. *
  39. * @return array
  40. */
  41. public function default()
  42. {
  43. return [];
  44. }
  45. }