file('file')); } catch (\Exception $exception) { return $this->response()->swal()->error($exception->getMessage()); } return $this->response()->swal()->success('上传成功')->refresh(); } public function form() { $this->file('file', '请选择文件') ->options([ 'showPreview' => false, 'allowedFileExtensions' => ['xlsx', 'xls', 'csv'], 'showUpload' => true, ]) ->required(); } public function html(): string { return <<导入已结算数据 HTML; } /** * 上传等待 * * @return string */ public function handleActionPromise(): string { $resolve = <<