新增 preview 组件 & table 的excel 操作设置默认值

This commit is contained in:
JaguarJack 2021-05-04 01:25:40 +08:00
parent c221f0fe4a
commit 174e9e39c0
2 changed files with 22 additions and 2 deletions

View File

@ -60,8 +60,28 @@ trait ComponentsTrait
}
/**
* 多选组件
*
* @time 2021年05月03日
* @param array $options
* @param null $updateFields
* @return HeaderItem
*/
public function withSelectComponent(array $options, $updateFields = null): HeaderItem
{
return $this->component('select_', $updateFields ? : $this->attributes['prop'], $options);
}
}
/**
* 预览组件
*
* @time 2021年05月03日
* @param null $field
* @return ComponentsTrait|HeaderItem
*/
public function withPreviewComponent($field = null)
{
return $this->component('preview', $field ? : $this->attributes['prop']);
}
}

View File

@ -211,7 +211,7 @@ class Table
* @param string $usedModel
* @return $this
*/
public function withUsedModelAndExcel(string $usedModel, array $excel): Table
public function withUsedModelAndExcel(string $usedModel, array $excel = []): Table
{
foreach ($excel as $e) {
$this->excel[] = $e->render();