Browse Source

Merge branch '2.0' into gitee2

Jiang qinghua 4 years ago
parent
commit
aa2d48a113

+ 1 - 5
README.md

@@ -20,6 +20,7 @@
 <p align=""><code>Dcat Admin</code>是一个基于<a href="https://www.laravel-admin.org/" target="_blank">laravel-admin</a>二次开发而成的后台系统构建工具,只需很少的代码即可快速构建出一个功能完善的高颜值后台系统。内置丰富的后台常用组件,开箱即用,让开发者告别冗杂的HTML代码,对后端开发者非常友好。</p>
 
 
+- [官方网站](http://www.dcatadmin.com)
 - [中文文档](https://learnku.com/docs/dcat-admin)
 - [English documentions](http://www.dcatadmin.com/docs/en-2.x/quick-start.html)
 - [Demo / 在线演示](http://103.39.211.179:8080/admin)
@@ -31,11 +32,6 @@
 ![](https://cdn.learnku.com/uploads/images/202101/28/38389/YLmL7PLqH7.png!large)
 
 
-### 关于官网备案暂停访问的公告
-
-大家好,[Dcat Admin官网](http://www.dcatadmin.com)正在进行备案中,在备案期间会关闭网站访问,直至备案完成。在此期间大家可以通过[Learnku中文文档](https://learnku.com/docs/dcat-admin/2.x)查看文档,给大家带来的不便之处敬请谅解,谢谢支持!
-
-
 ### 功能特性
 
 - [x] 简洁优雅、灵活可扩展的API

+ 1 - 1
resources/assets/dcat/extra/upload.js

@@ -353,7 +353,7 @@ import AddUploadedFile from './Upload/AddUploadedFile'
                 $li.find('[data-file-act="order"]').removeClass('d-none').show();
             }
             if (options.downloadable) {
-                let $download = $li.find('[data-file-act="downloadable"]');
+                let $download = $li.find('[data-file-act="download"]');
                 $download.removeClass('d-none').show();
                 $download.attr('data-id', obj.file.serverUrl);
             }

File diff suppressed because it is too large
+ 0 - 0
resources/dist/adminlte/adminlte.css


File diff suppressed because it is too large
+ 0 - 0
resources/dist/adminlte/adminlte.js


File diff suppressed because it is too large
+ 0 - 0
resources/dist/adminlte/adminlte.js.map


File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/extra/action.js.map


File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/extra/grid-extend.js


File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/extra/grid-extend.js.map


File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/extra/select-table.js.map


File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/extra/upload.js


File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/extra/upload.js.map


File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/js/dcat-app.js


File diff suppressed because it is too large
+ 0 - 0
resources/dist/dcat/js/dcat-app.js.map


+ 2 - 2
resources/views/form/display.blade.php

@@ -3,11 +3,11 @@
     <div class="{{$viewClass['field']}}">
         <div class="box box-solid box-default no-margin">
             <div class="box-body">
-                {!! $value !!}&nbsp;
+                <div class="{{$class}}">{!! $value !!}&nbsp;</div>
             </div>
         </div>
 
         @include('admin::form.help-block')
 
     </div>
-</div>
+</div>

+ 5 - 2
resources/views/form/map.blade.php

@@ -211,13 +211,16 @@
     @if($type === 'amap')
     function initAmap(){
         var map = new AMap.Map(container[0], {
-            resizeEnable: true
+            resizeEnable: true,
+            center: lng.val() && lat.val() ? [lng.val(), lat.val()] : null,
+            zoom: 14
         });
         var marker = new AMap.Marker({
             position: new AMap.LngLat(lng.val(), lat.val()),
             draggable: true,
             map:map,
-            icon:'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png'
+            icon:'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png',
+            zoom:15
         });
         if (!lng.val() || !lat.val()){
             var geolocation = new AMap.Geolocation({

+ 1 - 1
resources/views/grid/quick-search.blade.php

@@ -1,6 +1,6 @@
 <style>::-ms-clear,::-ms-reveal{display: none;}</style>
 
-<form action="{!! $action !!}" class="input-no-border quick-search-form d-md-inline-block" style="display:none;margin-right: 16px">
+<form pjax-container action="{!! $action !!}" class="input-no-border quick-search-form d-md-inline-block" style="display:none;margin-right: 16px">
     <div class="table-filter">
         <label style="width: {{ $width }}rem">
             <input

+ 4 - 4
resources/views/partials/menu.blade.php

@@ -9,24 +9,24 @@
 @if($builder->visible($item))
     @if(empty($item['children']))
         <li class="nav-item">
-            <a @if(mb_strpos($item['uri'], '://') !== false) target="_blank" @endif
+            <a data-id="{{ $item['id'] ?? '' }}" @if(mb_strpos($item['uri'], '://') !== false) target="_blank" @endif
                href="{{ $builder->getUrl($item['uri']) }}"
                class="nav-link {!! $builder->isActive($item) ? 'active' : '' !!}">
                 {!! str_repeat('&nbsp;', $depth) !!}<i class="fa fa-fw {{ $item['icon'] ?: $defaultIcon }}"></i>
                 <p>
-                    {{ $builder->translate($item['title']) }}
+                    {!! $builder->translate($item['title']) !!}
                 </p>
             </a>
         </li>
     @else
 
         <li class="{{ $horizontal ? 'dropdown' : 'has-treeview' }} {{ $depth > 0 ? 'dropdown-submenu' : '' }} nav-item {{ $builder->isActive($item) ? 'menu-open' : '' }}">
-            <a href="#"
+            <a href="#"  data-id="{{ $item['id'] ?? '' }}"
                class="nav-link {{ $builder->isActive($item) ? ($horizontal ? 'active' : '') : '' }}
                     {{ $horizontal ? 'dropdown-toggle' : '' }}">
                 {!! str_repeat('&nbsp;', $depth) !!}<i class="fa fa-fw {{ $item['icon'] ?: $defaultIcon }}"></i>
                 <p>
-                    {{ $builder->translate($item['title']) }}
+                    {!! $builder->translate($item['title']) !!}
 
                     @if(! $horizontal)
                         <i class="right fa fa-angle-left"></i>

+ 1 - 1
src/Admin.php

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

+ 1 - 1
src/Form/Field/Html.php

@@ -71,7 +71,7 @@ class Html extends Field
 <div class="{$viewClass['form-group']}">
     <label  class="{$viewClass['label']} control-label">{$this->label}</label>
     <div class="{$viewClass['field']}">
-        {$this->html}
+        <div class="{$this->getElementClassString()}">{$this->html}</div>
     </div>
 </div>
 EOT;

+ 11 - 3
src/Grid/Model.php

@@ -484,6 +484,14 @@ class Model
     {
         $this->paginator = $paginator;
 
+        if ($this->simple) {
+            if (method_exists($paginator, 'withQueryString')) {
+                $paginator->withQueryString();
+            } else {
+                $paginator->appends(request()->all());
+            }
+        }
+
         $paginator->setPageName($this->getPageName());
     }
 
@@ -663,13 +671,13 @@ class Model
     }
 
     /**
-     * @param \Illuminate\Database\Query\Builder $query
+     * @param Builder $query
      * @param bool $fetch
      * @param string[] $columns
      *
-     * @return mixed
+     * @return Builder|Paginator|Collection
      */
-    public function apply($query, bool $fetch = true, $columns = null)
+    public function apply($query, bool $fetch = false, $columns = null)
     {
         $this->getQueries()->unique()->each(function ($value) use (&$query, $fetch, $columns) {
             if (! $fetch && in_array($value['method'], ['paginate', 'simplePaginate', 'get'], true)) {

+ 2 - 2
src/Grid/Tools/BatchActions.php

@@ -101,9 +101,9 @@ class BatchActions extends AbstractTool
         $action->selectorPrefix = '.grid-batch-action-'.$this->actions->count();
 
         if ($key) {
-            $this->actions->push($action);
-        } else {
             $this->actions->put($key, $action);
+        } else {
+            $this->actions->push($action);
         }
 
         return $this;

+ 2 - 0
src/Http/Controllers/ScaffoldController.php

@@ -229,6 +229,8 @@ class ScaffoldController extends Controller
                     $sql .= " AND TABLE_NAME = '{$p}{$tb}'";
                 }
 
+                $sql .= ' ORDER BY `ORDINAL_POSITION` ASC';
+
                 $tmp = DB::connection($connectName)->select($sql);
 
                 $collection = collect($tmp)->map(function ($v) use ($value) {

+ 1 - 1
src/Layout/Menu.php

@@ -4,7 +4,7 @@ namespace Dcat\Admin\Layout;
 
 use Dcat\Admin\Admin;
 use Dcat\Admin\Support\Helper;
-use Lang;
+use Illuminate\Support\Facades\Lang;
 
 class Menu
 {

+ 1 - 1
src/Support/Helper.php

@@ -153,7 +153,7 @@ class Helper
             $element = '';
 
             if ($value !== null) {
-                $element = $key.'="'.htmlentities($value, ENT_QUOTES, 'UTF-8').'"';
+                $element = $key.'="'.htmlentities($value, ENT_QUOTES, 'UTF-8').'" ';
             }
 
             $html .= $element;

+ 1 - 1
src/Widgets/Form.php

@@ -71,7 +71,7 @@ use Illuminate\Validation\Validator;
  * @method Field\MultipleFile        multipleFile($column, $label = '')
  * @method Field\MultipleImage       multipleImage($column, $label = '')
  * @method Field\Tree                tree($column, $label = '')
- * @method Field\Table               table($column, $callback)
+ * @method Field\Table               table($column, $labelOrCallback, $callback = null)
  * @method Field\ListField           list($column, $label = '')
  * @method Field\Timezone            timezone($column, $label = '')
  * @method Field\KeyValue            keyValue($column, $label = '')

+ 1 - 1
src/Widgets/Table.php

@@ -83,7 +83,7 @@ class Table extends Widget
      */
     public function setRows($rows = [])
     {
-        if ($rows && ! Arr::isAssoc(Helper::array($rows))) {
+        if ($rows && ! Arr::isAssoc(Helper::array($rows, false))) {
             $this->rows = $rows;
 
             return $this;

Some files were not shown because too many files changed in this diff