123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?php
- namespace catchAdmin\stations\excel;
- use catcher\base\CatchRequest as Request;
- use catchAdmin\stations\model\Station as stationModel;
- use catcher\library\excel\ExcelContract;
- use PhpOffice\PhpSpreadsheet\Style\Alignment;
- class SkExport implements ExcelContract
- {
- public $memory = '1024M';
- protected $stationModel;
- public function __construct(stationModel $stationModel)
- {
- $this->stationModel = $stationModel;
- }
-
- public function headers(): array
- {
-
- return [
- '学校', '建筑', '楼层', '房间', '基站名称', '基站Mac', '基站简码', '安装照片', '在线时间', '安装时间'
- ];
- }
-
- public function sheets()
- {
- $list = $this->stationModel->getExportList();
-
- foreach ($list as &$val) {
-
-
-
-
- }
- return $list;
- }
- public function keys(): array
- {
-
- return [
- 'school_name', 'building_name', 'floor_name', 'room_no', 'station_name', 'station_mac', 'station_code','install_photo','online_time','created_at'
- ];
- }
-
- public function setRow()
- {
- return 2;
- }
-
- public function setTitle()
- {
- return [
- 'A1:I1', '导出室内插座', Alignment::HORIZONTAL_CENTER
- ];
- }
-
- public function setWidth()
- {
- return [
- 'A' => 20,
- 'B' => 20,
- 'C' => 20,
- 'D' => 20,
- 'E' => 20,
- 'F' => 20,
- 'G' => 20,
- 'H' => 20,
- 'I' => 20,
- 'J' => 20,
- ];
- }
- public function getWorksheet($sheet)
- {
-
-
-
-
-
-
- return $sheet;
- }
- }
|