Commit 4a6ce053 authored by Liu lu's avatar Liu lu

Vtiful\Kernel\Excel 优化

parent 959f5cbd
...@@ -81,18 +81,17 @@ class KernelExcelExportService ...@@ -81,18 +81,17 @@ class KernelExcelExportService
$fileHandle = $this->fileObject->getHandle(); $fileHandle = $this->fileObject->getHandle();
$alignStyle = (new \Vtiful\Kernel\Format($fileHandle)) $alignStyle = (new \Vtiful\Kernel\Format($fileHandle))
->align( \Vtiful\Kernel\Format::FORMAT_ALIGN_VERTICAL_CENTER); ->align( \Vtiful\Kernel\Format::FORMAT_ALIGN_CENTER)
->align( \Vtiful\Kernel\Format::FORMAT_ALIGN_VERTICAL_CENTER)
->wrap()->toResource();
if(is_null($definedWith)){ if(is_null($definedWith)){
$this->fileObject->setColumn( $this->fileObject->setColumn(
'A:'.Coordinate::stringFromColumnIndex(count($this->headers)), $autoWidth, 'A:'.Coordinate::stringFromColumnIndex(count($this->headers)), $autoWidth,$alignStyle
$alignStyle->align( \Vtiful\Kernel\Format::FORMAT_ALIGN_JUSTIFY)->toResource()
); );
}else{ }else{
$style = $alignStyle->align( \Vtiful\Kernel\Format::FORMAT_ALIGN_CENTER)->toResource();
foreach ($definedWith as $columnTag=>$width){ foreach ($definedWith as $columnTag=>$width){
$this->fileObject->setColumn( $this->fileObject->setColumn(
$columnTag.':'.$columnTag, $width, $style $columnTag.':'.$columnTag, $width, $alignStyle
); );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment