input('_key'); if (is_array($keys) && count($keys) > 0) { $result = DistInquiry::distSetStatusProcessed($keys); if ($result === false) { return $this->response()->error('Failed to process!')->refresh(); } return $this->response()->success(admin_trans_label('update_success'))->refresh(); } else { return $this->response()->error('No data selected!')->refresh(); } // 你的代码逻辑 } public function actionScript(){ $warning = admin_trans_label('no_selected_data'); return <<getSelectedKeysScript()} if (key.length === 0) { Dcat.warning('{$warning}'); return false; } // 设置主键为复选框选中的行ID数组 action.options.key = key; } catch (e) { Dcat.warning('{$warning}'); return false; } } JS; } public function getSelectedKeysScript() { return "Dcat.grid.selected('{$this->parent->getName()}')"; } }