|
@@ -1,7 +1,7 @@
|
|
|
<?php
|
|
|
namespace App\Distributor\Actions\Extensions;
|
|
|
|
|
|
-use Dcat\Admin\Grid\Tools\AbstractTool;
|
|
|
+
|
|
|
use Dcat\Admin\Widgets\Modal;
|
|
|
use App\Distributor\Forms\ImportProduct;
|
|
|
use Dcat\Admin\Grid\BatchAction;
|
|
@@ -26,33 +26,19 @@ class DistProductImportForm extends BatchAction
|
|
|
->onShow($this->getModalScript())
|
|
|
->button($this->getButtonHTML());
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 填充选择的产品ID
|
|
|
- * @return string
|
|
|
- */
|
|
|
protected function getModalScript()
|
|
|
{
|
|
|
// 弹窗显示后往隐藏的id表单中写入批量选中的行ID
|
|
|
return <<<JS
|
|
|
// 获取选中的ID数组
|
|
|
var key = {$this->getSelectedKeysScript()}
|
|
|
- if (key.length > 0) {
|
|
|
- $('#product_ids').val(key.join(','));
|
|
|
- } else {
|
|
|
- $('#product_ids').val('');
|
|
|
- //return false;
|
|
|
- }
|
|
|
|
|
|
-JS;
|
|
|
+ $('#product_ids').val(key);
|
|
|
+ JS;
|
|
|
}
|
|
|
-//
|
|
|
-// protected function getSelectedKeysScript()
|
|
|
-// {
|
|
|
-// return '[]'; // 这里可以返回一个空数组,因为工具按钮不需要选择行
|
|
|
-// }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取按钮的 HTML
|
|
@@ -72,4 +58,5 @@ JS;
|
|
|
</button>
|
|
|
HTML;
|
|
|
}
|
|
|
+
|
|
|
}
|