Просмотр исходного кода

Merge branch '2.0' into gitee2

jqh 4 лет назад
Родитель
Сommit
9660811e6c

+ 6 - 2
resources/views/form/hasmany.blade.php

@@ -77,7 +77,11 @@
     });
 
     $(container).on('click', '.remove', function () {
-        $(this).closest('.has-many-{{ $columnClass  }}-form').hide();
-        $(this).closest('.has-many-{{ $columnClass  }}-form').find('.{{ Dcat\Admin\Form\NestedForm::REMOVE_FLAG_CLASS }}').val(1);
+        $(this).closest('form')[0].reset();
+
+        var $form = $(this).closest('.has-many-{{ $columnClass  }}-form');
+        $form.hide();
+        $form.find('.{{ Dcat\Admin\Form\NestedForm::REMOVE_FLAG_CLASS }}').val(1);
+        $form.find('[required]').prop('required', false);
     });
 </script>

+ 7 - 3
resources/views/form/hasmanytable.blade.php

@@ -98,9 +98,13 @@
     });
 
     $(container).on('click', '.remove', function () {
-        $(this).closest('.has-many-{{ $columnClass }}-form').hide();
-        $(this).closest('.has-many-{{ $columnClass }}-form').find('[required]').prop('required', false);
-        $(this).closest('.has-many-{{ $columnClass }}-form').find('.{{ Dcat\Admin\Form\NestedForm::REMOVE_FLAG_CLASS }}').val(1);
+        $(this).closest('form')[0].reset();
+
+        var $form = $(this).closest('.has-many-{{ $columnClass }}-form');
+
+        $form.hide();
+        $form.find('[required]').prop('required', false);
+        $form.find('.{{ Dcat\Admin\Form\NestedForm::REMOVE_FLAG_CLASS }}').val(1);
     });
 </script>
 

+ 1 - 1
src/Admin.php

@@ -30,7 +30,7 @@ class Admin
     use HasAssets;
     use HasHtml;
 
-    const VERSION = '2.0.20-beta';
+    const VERSION = '2.0.21-beta';
 
     const SECTION = [
         // 往 <head> 标签内输入内容

+ 1 - 0
src/AdminServiceProvider.php

@@ -46,6 +46,7 @@ class AdminServiceProvider extends ServiceProvider
         Console\ExtensionEnableCommand::class,
         Console\ExtensionDiableCommand::class,
         Console\ExtensionUpdateCommand::class,
+        Console\UpdateCommand::class,
     ];
 
     /**

+ 23 - 0
src/Console/UpdateCommand.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace Dcat\Admin\Console;
+
+use Illuminate\Console\Command;
+
+class UpdateCommand extends Command
+{
+    protected $signature = 'admin:update';
+
+    protected $description = 'Update the admin package';
+
+    public function handle()
+    {
+        $this->call('admin:publish', [
+            '--assets'     => true,
+            '--migrations' => true,
+            '--lang'       => true,
+            '--force'      => true,
+        ]);
+        $this->call('migrate');
+    }
+}

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

@@ -32,7 +32,7 @@ class QuickEdit extends RowAction
             ->success('Dcat.reload()');
 
         $this->setHtmlAttribute([
-            'data-url' => "{$this->resource()}/{$this->getKey()}/edit",
+            'data-url' => $this->parent->getEditUrl($this->getKey()),
         ]);
 
         return parent::render();