Loading src/Tools/Exporter.php +7 −0 Original line number Original line Diff line number Diff line Loading @@ -111,6 +111,7 @@ class Exporter ->getProtection() ->getProtection() ->setLocked(Protection::PROTECTION_UNPROTECTED); ->setLocked(Protection::PROTECTION_UNPROTECTED); } } return $this; } } /** /** Loading @@ -137,6 +138,7 @@ class Exporter $this->sheet = $this->reader->setActiveSheetIndexByName($name); $this->sheet = $this->reader->setActiveSheetIndexByName($name); $this->sheetIndex = $this->reader->getActiveSheetIndex(); $this->sheetIndex = $this->reader->getActiveSheetIndex(); $this->resetRowIndex(); $this->resetRowIndex(); return $this; } } /** /** Loading @@ -145,6 +147,7 @@ class Exporter private function resetRowIndex() private function resetRowIndex() { { $this->beginRowIndex = 1; $this->beginRowIndex = 1; return $this; } } /** /** Loading @@ -162,6 +165,7 @@ class Exporter public function setBeginColumnChar($char = "A") public function setBeginColumnChar($char = "A") { { $this->beginColumnChar = $char; $this->beginColumnChar = $char; return $this; } } /**设置从哪一行开始填充数据 /**设置从哪一行开始填充数据 Loading @@ -170,6 +174,7 @@ class Exporter public function setBeginRowIndex($index = 1) public function setBeginRowIndex($index = 1) { { $this->beginRowIndex = $index; $this->beginRowIndex = $index; return $this; } } /** /** Loading @@ -182,6 +187,7 @@ class Exporter $this->sheet = $this->reader->setActiveSheetIndex($sheetIndex); $this->sheet = $this->reader->setActiveSheetIndex($sheetIndex); $this->sheetIndex = $sheetIndex; $this->sheetIndex = $sheetIndex; $this->resetRowIndex(); $this->resetRowIndex(); return $this; } } /** /** Loading Loading @@ -212,6 +218,7 @@ class Exporter //美化样式 //美化样式 $this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); $this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); $this->beginRowIndex += count($data); $this->beginRowIndex += count($data); return $this; } } /** /** Loading Loading
src/Tools/Exporter.php +7 −0 Original line number Original line Diff line number Diff line Loading @@ -111,6 +111,7 @@ class Exporter ->getProtection() ->getProtection() ->setLocked(Protection::PROTECTION_UNPROTECTED); ->setLocked(Protection::PROTECTION_UNPROTECTED); } } return $this; } } /** /** Loading @@ -137,6 +138,7 @@ class Exporter $this->sheet = $this->reader->setActiveSheetIndexByName($name); $this->sheet = $this->reader->setActiveSheetIndexByName($name); $this->sheetIndex = $this->reader->getActiveSheetIndex(); $this->sheetIndex = $this->reader->getActiveSheetIndex(); $this->resetRowIndex(); $this->resetRowIndex(); return $this; } } /** /** Loading @@ -145,6 +147,7 @@ class Exporter private function resetRowIndex() private function resetRowIndex() { { $this->beginRowIndex = 1; $this->beginRowIndex = 1; return $this; } } /** /** Loading @@ -162,6 +165,7 @@ class Exporter public function setBeginColumnChar($char = "A") public function setBeginColumnChar($char = "A") { { $this->beginColumnChar = $char; $this->beginColumnChar = $char; return $this; } } /**设置从哪一行开始填充数据 /**设置从哪一行开始填充数据 Loading @@ -170,6 +174,7 @@ class Exporter public function setBeginRowIndex($index = 1) public function setBeginRowIndex($index = 1) { { $this->beginRowIndex = $index; $this->beginRowIndex = $index; return $this; } } /** /** Loading @@ -182,6 +187,7 @@ class Exporter $this->sheet = $this->reader->setActiveSheetIndex($sheetIndex); $this->sheet = $this->reader->setActiveSheetIndex($sheetIndex); $this->sheetIndex = $sheetIndex; $this->sheetIndex = $sheetIndex; $this->resetRowIndex(); $this->resetRowIndex(); return $this; } } /** /** Loading Loading @@ -212,6 +218,7 @@ class Exporter //美化样式 //美化样式 $this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); $this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); $this->beginRowIndex += count($data); $this->beginRowIndex += count($data); return $this; } } /** /** Loading