jqh 4 years ago
parent
commit
63150a00c6

+ 1 - 1
src/Admin.php

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

+ 6 - 6
src/Console/MinifyCommand.php

@@ -31,7 +31,7 @@ class MinifyCommand extends Command
     /**
      * @var array
      */
-    protected $themes = [
+    protected $colors = [
         self::DEFAULT => '',
         'blue'        => '#6d8be6',
         'blue-light'  => '#62a8ea',
@@ -60,7 +60,7 @@ class MinifyCommand extends Command
 
         if ($name === static::ALL) {
             // 编译所有内置主题色
-            return $this->compileAllDefaultThemes();
+            return $this->compileAllColors();
         }
 
         $publish = $this->option('publish');
@@ -89,9 +89,9 @@ class MinifyCommand extends Command
     /**
      * 编译所有内置主题.
      */
-    protected function compileAllDefaultThemes()
+    protected function compileAllColors()
     {
-        foreach ($this->themes as $name => $_) {
+        foreach ($this->colors as $name => $_) {
             $this->call('admin:minify', ['name' => $name]);
         }
     }
@@ -230,8 +230,8 @@ class MinifyCommand extends Command
 
         $color = $this->option('color');
 
-        if (! $color && isset($this->themes[$name])) {
-            return $this->themes[$name];
+        if (! $color && isset($this->colors[$name])) {
+            return $this->colors[$name];
         }
 
         if (! $color) {

+ 3 - 1
src/Form/Field/Text.php

@@ -148,7 +148,9 @@ JS
 
         $options = admin_javascript_json($options);
 
-        $this->script = "$('{$this->getElementClassSelector()}').inputmask($options);";
+        $this->script = "Dcat.init('{$this->getElementClassSelector()}', function (self) {
+            self.inputmask($options);
+        });";
 
         return $this;
     }

+ 2 - 2
src/Grid/Column.php

@@ -564,11 +564,11 @@ class Column
     /**
      * 把模型转化为数组.
      *
-     * @param $row
+     * @param array|Model $row
      *
      * @return mixed
      */
-    protected function convertModelToArray($row)
+    protected function convertModelToArray(&$row)
     {
         if (is_array($row)) {
             return $row;

+ 3 - 0
tests/Controllers/PainterController.php

@@ -81,6 +81,9 @@ class PainterController extends AdminController
                     $form->text('title');
                     $form->textarea('body');
                     $form->datetime('completed_at');
+
+                    $form->currency('cr');
+                    $form->image('av');
                 });
 
                 $form->display('created_at', 'Created At');