node-admin / data-transform-for-excel
description
Installs: 47
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Vue
README
说明
此库为 node-admin 扩展库
用法
安装
composer require node-admin/data-transform-for-excel
表格Action导出
/** @var \NodeAdmin\Lib\NodeContent\Table $table */ $table->actions(function (Table\ActionsContainer $container){ $export = new DataExport(); $export->setDataUrl(route('admin.test.export')); $container->addAction($export); }); // export action public function export(){ return Test::query()->paginate(); }
更新日志
1.1.0
增加配置导出模式
use NodeAdmin\DataTransformForExcel\NodeContent\Table\Actions\DataExport; $table->actions(function (Table\ActionsContainer $container){ $export = new DataExport(); $export->setConfigUrl(route('admin.test.export.config')); $container->addAction($export); }); // export config public function exportConfig() { return new DataExportConfigResponse( route('admin.test.export'), // 导出数据url // 字段列表 key为字段名,header为表头 [ ['key' => 'title', 'header' => '标题'], ] ); } // export action public function export(){ return Test::query()->paginate(); }