jqh 5 سال پیش
والد
کامیت
bf467a8516

+ 2 - 2
resources/assets/adminlte/scss/_variables.scss

@@ -121,9 +121,9 @@ $sidebar-dark-header-color: $white !default;
 // Light sidebar
 $sidebar-light-bg: $white !default;
 $sidebar-light-hover-bg: #f7f7f7 !default;
-$sidebar-light-color: #565656 !default;
+$sidebar-light-color: $font-color !default;
 $sidebar-light-hover-color: $gray-900 !default;
-$sidebar-light-active-color: #565656 !default;
+$sidebar-light-active-color: $font-color !default;
 $sidebar-light-submenu-bg: transparent !default;
 $sidebar-light-submenu-color: $sidebar-light-color !default;
 $sidebar-light-submenu-hover-color: #000 !default;

+ 32 - 14
resources/assets/dcat/sass/components/_alert.scss

@@ -33,27 +33,45 @@
     padding-bottom: 8px;
   }
 
-  // For dark alert
-
   &.alert-dark {
     .alert-heading {
       box-shadow: rgba($dark, 0.4) 0px 6px 15px -7px;
     }
   }
-
-  // For light alert
-
-  &.alert-light {
-    .alert-heading {
-      box-shadow: rgba($light, 0.4) 0px 6px 15px -7px;
-    }
-  }
 }
-
+.alert-danger {
+  background: rgba($danger,.2);
+  color: $danger;
+}
+.alert-success {
+  background: rgba($success,.2);
+  color: $success;
+}
+.alert-info {
+  background: rgba($info,.2);
+  color: $info;
+}
+.alert-primary {
+  background: rgba($primary,.2);
+  color: $primary-darker;
+}
 .alert-warning {
-  color: $white
+  background: rgba($warning,.35);
+  color: darken($warning, 5%);
 }
 
-.alert-light {
-  color: #666!important;
+.callout {
+  border-radius: .1rem;
+  border: 0;
+  border-left: 3.5px solid lighten(#8e9aac, 5%);
+  background-color: #fff;
+  margin-bottom: 1rem;
+  box-shadow: $shadow;
+}
+.callout.callout-primary {
+  border-left: 3.5px solid lighten($primary, 2%);
+}
+.callout.callout-light {
+  background-color: #f7f7f9;
+  box-shadow: none;
 }

+ 1 - 1
resources/assets/dcat/sass/components/_box.scss

@@ -1,6 +1,6 @@
 .box {
   position: relative;
-  border-radius: .25rem;
+  border-radius: .45rem;
   background: #ffffff;
   margin-bottom: 10px;
   width: 100%;

+ 1 - 1
resources/assets/dcat/sass/components/_card.scss

@@ -1,7 +1,7 @@
 .card {
   box-shadow: $shadow;
   margin-bottom: 2rem;
-  border-radius: .25rem;
+  border-radius: .45rem;
 }
 
 .card.dcat-box {

+ 6 - 6
resources/assets/dcat/sass/components/_custom-data-table.scss

@@ -12,7 +12,7 @@
 
 .custom-data-table-header .table-responsive .top .action-btns .actions-dropodown {
   box-shadow: 0 2px 8px 0 rgba(0, 0, 0, .14);
-  border-radius:.4rem;
+  border-radius:.45rem;
   margin-right: .75rem
 }
 
@@ -257,7 +257,7 @@ table.custom-data-table.dataTable tbody tr, table.data-thumb-view.dataTable tbod
   box-shadow: $shadow;
   cursor: pointer;
   transition: all .3s ease;
-  border-radius:.4rem
+  border-radius:.45rem
 }
 
 table.custom-data-table.dataTable tbody tr:hover, table.data-thumb-view.dataTable tbody tr:hover {
@@ -269,13 +269,13 @@ table.custom-data-table.dataTable tbody tr:hover, table.data-thumb-view.dataTabl
 
 table.custom-data-table.dataTable tbody tr td:first-child, table.data-thumb-view.dataTable tbody tr td:first-child {
   padding-left: 1rem;
-  border-top-left-radius:.4rem;
-  border-bottom-left-radius:.4rem
+  border-top-left-radius:.45rem;
+  border-bottom-left-radius:.45rem
 }
 
 table.custom-data-table.dataTable tbody tr td:last-child, table.data-thumb-view.dataTable tbody tr td:last-child {
-  border-top-right-radius:.4rem;
-  border-bottom-right-radius:.4rem
+  border-top-right-radius:.45rem;
+  border-bottom-right-radius:.45rem
 }
 
 table.custom-data-table.dataTable tbody tr.selected td, table.data-thumb-view.dataTable tbody tr.selected td {

+ 7 - 0
resources/assets/dcat/sass/components/_icon-picker.scss

@@ -0,0 +1,7 @@
+.iconpicker-popover.popover .popover-title {
+  background: #fff!important;
+}
+
+.iconpicker-popover.popover.bottom>.arrow, .iconpicker-popover.popover.bottomRight>.arrow, .iconpicker-popover.popover.bottomLeft>.arrow {
+  border-bottom-color: #dfdfdf!important;
+}

+ 3 - 1
resources/assets/dcat/sass/dcat-app.scss

@@ -92,4 +92,6 @@ body, .header-navbar, .navigation, .breadcrumb, h1, h2, h3, h4, h5, h6, .h1, .h2
 // 菜单
 @import "./components/sidebar";
 // 模态窗
-@import "./components/modal";
+@import "./components/modal";
+// icon picker
+@import "./components/icon-picker";

+ 22 - 0
resources/views/helpers/feather.blade.php

@@ -1,3 +1,25 @@
+<style>
+    .fonticon-container>.fonticon-wrap {
+        float: left;
+        width: 60px;
+        height: 60px;
+        line-height: 4.8rem;
+        text-align: center;
+        border-radius: .1875rem;
+        margin-right: 1rem;
+        margin-bottom: 1.5rem;
+    }
+    .fonticon-container>.fonticon-wrap>i {
+        font-size: 2.28rem;
+        transition: all .2s ease-in-out;
+    }
+    .fonticon-container>.fonticon-classname, .fonticon-container>.fonticon-unit {
+        display: block;
+        font-size: 1.5rem;
+        line-height: 1.2;
+    }
+</style>
+
 <div>
     <div class="feather-icons overflow-hidden row">
         <div class="col-md-4 col-sm-6 col-12 fonticon-container">

+ 1 - 1
resources/views/partials/sidebar.blade.php

@@ -13,7 +13,7 @@
             </div>
 
             <div class="sidebar mt-1">
-                <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
+                <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="true">
                     {!! admin_section(AdminSection::LEFT_SIDEBAR_MENU_TOP) !!}
 
                     {!! admin_section(AdminSection::LEFT_SIDEBAR_MENU) !!}

+ 1 - 1
resources/views/widgets/alert.blade.php

@@ -3,7 +3,7 @@
     <button type="button" class="close" data-dismiss="alert">×</button>
     @endif
     @if($title)
-    <h4>@if($icon)<i class="{{ $icon }}"></i>&nbsp;@endif {!! $title !!}</h4>
+    <h4>@if(! empty($icon))<i class="{{ $icon }}"></i>&nbsp;@endif {!! $title !!}</h4>
     @endif
     {!! $content !!}
 </div>

+ 3 - 4
src/Grid/Column/Filter.php

@@ -155,10 +155,9 @@ abstract class Filter implements Renderable
      */
     protected function urlWithoutFilter()
     {
-        $query = request()->query();
-        unset($query[$this->getQueryName()]);
-
-        return Helper::urlWithQuery(url()->current(), $query);
+        return Helper::fullUrlWithoutQuery([
+            $this->getQueryName()
+        ]);
     }
 
     /**

+ 16 - 14
src/Grid/Column/Filter/Between.php

@@ -127,15 +127,16 @@ class Between extends Filter
         $options = json_encode($options);
 
         Admin::script(<<<JS
-        $('.{$this->class['start']},.{$this->class['end']}').datetimepicker({$options});
-        $(".{$this->class['start']}").on("dp.change", function (e) {
-            $('.{$this->class['end']}').data("DateTimePicker").minDate(e.date);
-        });
-        $(".{$this->class['end']}").on("dp.change", function (e) {
-            $('.{$this->class['start']}').data("DateTimePicker").maxDate(e.date);
-        });
+        $('.{$this->class['start']}').datetimepicker($options);
+        $('.{$this->class['end']}').datetimepicker($options);
 JS
         );
+//        $('.{$this->class['start']}').on("dp.change", function (e) {
+//            $('.{$this->class['end']}').data("DateTimePicker").minDate(e.date);
+//        });
+//        $('.{$this->class['end']}').on("dp.change", function (e) {
+//            $('.{$this->class['start']}').data("DateTimePicker").maxDate(e.date);
+//        });
     }
 
     /**
@@ -165,11 +166,11 @@ JS;
         return <<<EOT
 &nbsp;<span class="dropdown" style="position:absolute">
 <form action="{$this->formAction()}" pjax-container style="display: inline-block;">
-    <a href="javascript:void(0);" class="dropdown-toggle {$active}" data-toggle="dropdown">
+    <a href="javascript:void(0);" class="{$active}" data-toggle="dropdown">
         <i class="feather icon-filter"></i>
     </a>
-    <ul class="dropdown-menu" role="menu" style="padding: 10px;left: -70px;border-radius: 0;font-weight:normal;background:#fff">
-        <li>
+    <ul class="dropdown-menu" role="menu" style="min-width: 180px;padding: 10px;left: -70px;border-radius: 0;font-weight:normal;background:#fff">
+        <li class="dropdown-item">
             <input type="text" 
                 class="form-control input-sm {$this->class['start']}" 
                 name="{$this->getQueryName()}[start]" 
@@ -178,16 +179,16 @@ JS;
                 autocomplete="off" />
         </li>
         <li style="margin: 5px;"></li>
-        <li>
+        <li class="dropdown-item">
             <input type="text" 
-                class="form-control input-sm {$this->class['start']}" 
+                class="form-control input-sm {$this->class['end']}" 
                 name="{$this->getQueryName()}[end]"  
                 placeholder="{$this->trans('between_end')}" 
                 value="{$value['end']}" 
                 autocomplete="off"/>
         </li>
-        <li class="divider"></li>
-        <li class="">
+        <li class="dropdown-divider"></li>
+        <li class="dropdown-item">
             <button class="btn btn-sm btn-primary column-filter-submit "><i class="feather icon-search"></i></button>
         </li>
     </ul>
@@ -198,6 +199,7 @@ EOT;
 
     protected function collectAssets()
     {
+        Admin::collectAssets('moment');
         Admin::collectAssets('bootstrap-datetimepicker');
     }
 }

+ 2 - 12
src/Widgets/Alert.php

@@ -12,7 +12,7 @@ class Alert extends Widget
     protected $view = 'admin::widgets.alert';
 
     /**
-     * @var string|\Symfony\Component\Translation\TranslatorInterface
+     * @var string
      */
     protected $title;
 
@@ -24,7 +24,7 @@ class Alert extends Widget
     /**
      * @var string
      */
-    protected $style = 'light';
+    protected $style;
 
     /**
      * @var string
@@ -120,16 +120,6 @@ class Alert extends Widget
         return $this->style('danger')->icon('fa fa-ban');
     }
 
-    /**
-     * Set light style.
-     *
-     * @return $this
-     */
-    public function light()
-    {
-        return $this->style('light');
-    }
-
     /**
      * Show close button.
      *

+ 180 - 0
src/Widgets/Callout.php

@@ -0,0 +1,180 @@
+<?php
+
+namespace Dcat\Admin\Widgets;
+
+use Illuminate\Contracts\Support\Renderable;
+
+class Callout extends Widget
+{
+    /**
+     * @var string
+     */
+    protected $view = 'admin::widgets.alert';
+
+    /**
+     * @var string
+     */
+    protected $title;
+
+    /**
+     * @var string
+     */
+    protected $content;
+
+    /**
+     * @var string
+     */
+    protected $style = 'default';
+
+    /**
+     * @var bool
+     */
+    protected $showCloseBtn = false;
+
+    /**
+     * Alert constructor.
+     *
+     * @param mixed  $content
+     * @param string $title
+     * @param string $style
+     */
+    public function __construct($content = '', ?string $title = null, ?string $style = null)
+    {
+        $this->content($content);
+
+        $this->title($title);
+
+        $this->style($style);
+    }
+
+    /**
+     * Set title.
+     *
+     * @param string $title
+     *
+     * @return $this
+     */
+    public function title(?string $title)
+    {
+        $this->title = $title;
+
+        return $this;
+    }
+
+    /**
+     * Set contents.
+     *
+     * @param string|\Closure|Renderable $content
+     *
+     * @return $this
+     */
+    public function content($content)
+    {
+        $this->content = $this->toString($content);
+
+        return $this;
+    }
+
+    /**
+     * Set light style.
+     *
+     * @return $this
+     */
+    public function light()
+    {
+        return $this->style('light');
+    }
+
+    /**
+     * Set primary style.
+     *
+     * @return $this
+     */
+    public function primary()
+    {
+        return $this->style('primary');
+    }
+
+    /**
+     * Set info style.
+     *
+     * @return $this
+     */
+    public function info()
+    {
+        return $this->style('info');
+    }
+
+    /**
+     * Set success style.
+     *
+     * @return $this
+     */
+    public function success()
+    {
+        return $this->style('success');
+    }
+
+    /**
+     * Set warning style.
+     *
+     * @return $this
+     */
+    public function warning()
+    {
+        return $this->style('warning');
+    }
+
+    /**
+     * Set warning style.
+     *
+     * @return $this
+     */
+    public function danger()
+    {
+        return $this->style('danger');
+    }
+
+    /**
+     * Show close button.
+     *
+     * @param bool $value
+     *
+     * @return $this
+     */
+    public function removable(bool $value = true)
+    {
+        $this->showCloseBtn = $value;
+
+        return $this;
+    }
+
+    /**
+     * Add style.
+     *
+     * @param string $style
+     *
+     * @return $this
+     */
+    public function style(?string $style = 'info')
+    {
+        $this->style = $style;
+
+        return $this;
+    }
+
+    /**
+     * @return array
+     */
+    public function variables()
+    {
+        $this->class("callout callout-{$this->style} alert alert-dismissable");
+
+        return [
+            'title'        => $this->title,
+            'content'      => $this->content,
+            'attributes'   => $this->formatHtmlAttributes(),
+            'showCloseBtn' => $this->showCloseBtn,
+        ];
+    }
+}