payload(['id' => $this->getKey()]); // 实例化表单类 return Modal::make() ->lg() ->title($this->title) ->body($form) // 因为此处使用了表单异步加载功能,所以一定要用 onLoad 方法 ->button($this->title()); } public function confirm() { return [ "Are you sure you want to import?", $this->row->title, ]; } /* * 处理请求 */ /* public function handle(Request $request) { $appearanceId = $this->getKey(); $folder = $request->get('folder'); //导入模板 $path = resource_path().'/appearance/'.$folder; if (!is_dir($path)) { return $this->response()->error("The directory does not exist")->refresh(); } $this->sourcePath = $path; $this->appearanceId = $appearanceId; // 清空旧的 DistAppearanceTemplate::deleteTemplates($appearanceId, config('dictionary.base_dist_id')); // 导入模板 $this->readDirectory($path); // 更新状态 DistAppearance::setStatusToImported($appearanceId); // 返回响应结果并刷新页面 return $this->response()->success("Successfully imported")->refresh(); } */ /** * 设置要POST到接口的数据 * * @return array */ public function parameters() { return [ // 发送当前行 username 字段数据到接口 'title' => $this->row->title, 'folder' => $this->row->folder ]; } }