123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <?php
- namespace catchAdmin\device\excel;
- use catcher\base\CatchRequest as Request;
- use catchAdmin\device\model\Station as stationModel;
- use catcher\library\excel\ExcelContract;
- use PhpOffice\PhpSpreadsheet\Style\Alignment;
- class StationExport implements ExcelContract
- {
- public $memory = '1024M';
- protected $badgeModel;
- public function __construct(stationModel $stationModel)
- {
- $this->stationModel = $stationModel;
- }
-
- public function headers(): array
- {
-
- return [
- '部门','名称','Mac','简码','基站状态','在线时间', '开局时间','入库时间','开局员工','安装地址','备注'
- ];
- }
-
- public function sheets()
- {
- $list = $this->stationModel->getStationExportList();
- foreach ($list as &$val) {
- $val->mac ="\t".$val->mac."\t";
- $val->shortmac ="\t".$val->shortmac."\t";
- if($val->open_status){
- $val->use_state = '已开局';
- }else{
- $val->use_state = '未开局';
- }
- }
- return $list;
- }
- public function keys(): array
- {
-
- return [
- 'depart_name','name','mac','shortcode','use_state','online_time','open_time','created_at','open_user_name','address','remark'
- ];
- }
-
- 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' => 30,
- 'K' => 20,
- ];
- }
- public function getWorksheet($sheet)
- {
-
-
-
-
-
-
- return $sheet;
- }
- }
|