浏览代码

调整删除确认弹窗提示信息

jqh 5 年之前
父节点
当前提交
185ab0680f

+ 5 - 4
resources/assets/dcat/js/bootstrappers/DataActions.js

@@ -12,9 +12,10 @@ let defaultActions = {
 
         return function() {
             let url = $(this).data('url'),
-                redirect = $(this).data('redirect');
+                redirect = $(this).data('redirect'),
+                msg = $(this).data('message');
 
-            Dcat.confirm(lang.delete_confirm, url, function () {
+            Dcat.confirm(lang.delete_confirm, msg, function () {
                 Dcat.NP.start();
                 $.ajax({
                     method: 'post',
@@ -27,9 +28,9 @@ let defaultActions = {
                         Dcat.NP.done();
                         if (data.status) {
                             Dcat.reload(redirect);
-                            Dcat.swal.success(data.message, url);
+                            Dcat.swal.success(data.message, msg);
                         } else {
-                            Dcat.swal.error(data.message, url);
+                            Dcat.swal.error(data.message, msg);
                         }
                     }
                 });

文件差异内容过多而无法显示
+ 0 - 0
resources/dist/dcat/js/dcat-app.js


文件差异内容过多而无法显示
+ 0 - 0
resources/dist/dcat/js/dcat-app.js.map


+ 3 - 2
src/Grid/Actions/Delete.php

@@ -17,8 +17,9 @@ class Delete extends RowAction
     public function render()
     {
         $this->setHtmlAttribute([
-            'data-url'    => $this->url(),
-            'data-action' => 'delete',
+            'data-url'     => $this->url(),
+            'data-message' => "ID - {$this->getKey()}",
+            'data-action'  => 'delete',
         ]);
 
         return parent::render(); // TODO: Change the autogenerated stub

+ 1 - 1
src/Grid/Displayers/Actions.php

@@ -279,7 +279,7 @@ EOF;
     protected function renderDelete()
     {
         return <<<EOT
-<a href="javascript:void(0);" data-url="{$this->resource()}/{$this->getKey()}" data-action="delete">
+<a href="javascript:void(0);" data-message="ID - {$this->getKey()}" data-url="{$this->resource()}/{$this->getKey()}" data-action="delete">
     <i class="feather icon-trash grid-action-icon"></i>
 </a>&nbsp;
 EOT;

部分文件因为文件数量过多而无法显示