|
@@ -12,18 +12,22 @@ abstract class BatchAction extends GridAction
|
|
|
/**
|
|
|
* {@inheritdoc}
|
|
|
*/
|
|
|
- public function actionScript()
|
|
|
+ protected function actionScript()
|
|
|
{
|
|
|
$warning = __('No data selected!');
|
|
|
|
|
|
return <<<JS
|
|
|
+function (data, target, action) {
|
|
|
var key = {$this->getSelectedKeysScript()}
|
|
|
|
|
|
if (key.length === 0) {
|
|
|
Dcat.warning('{$warning}');
|
|
|
return ;
|
|
|
}
|
|
|
- Object.assign(data, {_key:key});
|
|
|
+
|
|
|
+ // 设置主键为复选框选中的行ID数组
|
|
|
+ action.options.key = key;
|
|
|
+}
|
|
|
JS;
|
|
|
}
|
|
|
|