新增 preview 组件 & table 的excel 操作设置默认值
This commit is contained in:
parent
c221f0fe4a
commit
174e9e39c0
@ -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']);
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user