更新若干功能
This commit is contained in:
@@ -32,4 +32,23 @@ class FactoryInfoController extends BaseController
|
||||
$params = $this->checkRequiredFields(request()->post());
|
||||
return jok($this->service->status($params['id'], $params['status']), '操作成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工厂表(结构化数据,前端 ExcelJS 画 xlsx)
|
||||
* @Method GET
|
||||
*/
|
||||
public function export(): JsonResponse
|
||||
{
|
||||
return jok($this->service->exportExcel());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入工厂表:前端已把 xlsx 拆成 rows
|
||||
* @Method POST
|
||||
*/
|
||||
public function import(): JsonResponse
|
||||
{
|
||||
$rows = request()->post('rows', []);
|
||||
return jok($this->service->importRows(is_array($rows) ? $rows : []), '导入完成');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user