From 174e9e39c08d5b63c15e5e6c90f33b1b3120cde0 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Tue, 4 May 2021 01:25:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20preview=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=20&=20table=20=E7=9A=84excel=20=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catcher/library/table/ComponentsTrait.php | 22 ++++++++++++++++++- extend/catcher/library/table/Table.php | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) 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();