diff --git a/extend/catcher/library/table/ComponentsTrait.php b/extend/catcher/library/table/ComponentsTrait.php index afb5ee4..7600543 100644 --- a/extend/catcher/library/table/ComponentsTrait.php +++ b/extend/catcher/library/table/ComponentsTrait.php @@ -84,4 +84,16 @@ trait ComponentsTrait { return $this->component('preview', $field ? : $this->attributes['prop']); } + + /** + * download 组件 + * + * @time 2021年05月05日 + * @param null $field + * @return ComponentsTrait|HeaderItem + */ + public function withDownloadComponent($field = null) + { + return $this->component('download', $field ? : $this->attributes['prop']); + } } diff --git a/extend/catcher/library/table/HeaderItem.php b/extend/catcher/library/table/HeaderItem.php index b0d84b8..7c5d4c6 100644 --- a/extend/catcher/library/table/HeaderItem.php +++ b/extend/catcher/library/table/HeaderItem.php @@ -73,6 +73,29 @@ class HeaderItem return $this->width(50)->type('selection'); } + /** + * 展开行 + * + * @time 2021年05月07日 + * @return mixed + */ + public function expand() + { + return $this->type('expand'); + } + + /** + * 固定列 + * + * @time 2021年05月07日 + * @param bool|string $fixed + * @return bool|mixed + */ + public function fixed($fixed = true) + { + return $this->attributes['fixed'] = $fixed; + } + /** * dont export * diff --git a/extend/catcher/library/table/Table.php b/extend/catcher/library/table/Table.php index 0cbc733..cb05184 100644 --- a/extend/catcher/library/table/Table.php +++ b/extend/catcher/library/table/Table.php @@ -104,6 +104,12 @@ class Table */ protected $excel = []; + /** + * 斑马纹 + * + * @var bool + */ + protected $stripe = false; /** * 导出 excel 所使用 model @@ -112,6 +118,12 @@ class Table */ protected $usedModel; + /** + * 固定表头 + * + * @var int + */ + protected $height; /** * 树状展开 @@ -333,6 +345,33 @@ class Table return $this; } + /** + * 开启斑马纹 + * + * @time 2021年05月07日 + * @return $this + */ + public function withStripe(): Table + { + $this->stripe = true; + + return $this; + } + + /** + * 固定表头 + * + * @time 2021年05月07日 + * @param int $height + * @return $this + */ + public function withHeight(int $height): Table + { + $this->height = $height; + + return $this; + } + /** * 导出路由 *