add:新增excel的导入导出组件

This commit is contained in:
JaguarJack
2021-04-24 20:30:28 +08:00
parent f67a4f33d5
commit 48c41f7948
4 changed files with 170 additions and 2 deletions

View File

@@ -98,6 +98,21 @@ class Table
*/
protected $forceUpdate = false;
/**
* @var array
*/
protected $excel = [];
/**
* 导出 excel 所使用 model
*
* @var string
*/
protected $usedModel;
/**
* Table constructor.
* @param string $ref
@@ -167,6 +182,25 @@ class Table
return $this;
}
/**
* excel 信息
*
* @time 2021年04月21日
* @param array $excel
* @param string $usedModel
* @return $this
*/
public function withUsedModelAndExcel(string $usedModel, array $excel): Table
{
foreach ($excel as $e) {
$this->excel[] = $e->render();
}
$this->usedModel = $usedModel;
return $this;
}
/**
* set
*