LinkCountExport.php 876 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2019/9/24 0024
  6. * Time: 13:38
  7. */
  8. namespace App\Exports;
  9. use Maatwebsite\Excel\Concerns\FromArray;
  10. use Maatwebsite\Excel\Concerns\Exportable;
  11. use Maatwebsite\Excel\Events\AfterSheet;
  12. use Maatwebsite\Excel\Concerns\ShouldAutoSize;
  13. use Maatwebsite\Excel\Concerns\WithEvents;
  14. class LinkCountExport implements FromArray,ShouldAutoSize,WithEvents
  15. {
  16. use Exportable;
  17. public $dataList;
  18. public function __construct(array $dataList)
  19. {
  20. $this->dataList = $dataList;
  21. }
  22. public function array(): array
  23. {
  24. return $this->dataList;
  25. }
  26. //
  27. public function registerEvents(): array
  28. {
  29. return [
  30. // AfterSheet::class => function (AfterSheet $event) {
  31. // $event->sheet->getDelegate()->mergeCells('A1:B1');
  32. // }
  33. ];
  34. }
  35. }