diff --git a/extend/catcher/library/table/ComponentsTrait.php b/extend/catcher/library/table/ComponentsTrait.php index 4a0bc1c..afb5ee4 100644 --- a/extend/catcher/library/table/ComponentsTrait.php +++ b/extend/catcher/library/table/ComponentsTrait.php @@ -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); } -} \ No newline at end of file + + /** + * 预览组件 + * + * @time 2021年05月03日 + * @param null $field + * @return ComponentsTrait|HeaderItem + */ + public function withPreviewComponent($field = null) + { + return $this->component('preview', $field ? : $this->attributes['prop']); + } +} diff --git a/extend/catcher/library/table/Table.php b/extend/catcher/library/table/Table.php index e5d4c80..0cbc733 100644 --- a/extend/catcher/library/table/Table.php +++ b/extend/catcher/library/table/Table.php @@ -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();