Explorar o código

update

update
jqh %!s(int64=5) %!d(string=hai) anos
pai
achega
52351dd2c4

+ 2 - 2
resources/assets/dcat/js/bootstrappers/Footer.js

@@ -1,10 +1,10 @@
 
 
 export default class Footer {
 export default class Footer {
     constructor(Dcat) {
     constructor(Dcat) {
-        Dcat.booting(this.bootScrollTop)
+        this.boot(Dcat)
     }
     }
 
 
-    bootScrollTop() {
+    boot(Dcat) {
         $(window).scroll(function(){
         $(window).scroll(function(){
             if ($(this).scrollTop() > 400) {
             if ($(this).scrollTop() > 400) {
                 $('.scroll-top').fadeIn();
                 $('.scroll-top').fadeIn();

+ 1 - 5
resources/assets/dcat/js/bootstrappers/Pjax.js

@@ -3,11 +3,7 @@ let $d = $(document);
 
 
 export default class Pjax {
 export default class Pjax {
     constructor(Dcat) {
     constructor(Dcat) {
-        let _this = this;
-
-        Dcat.booting(function () {
-            _this.boot(Dcat)
-        })
+        this.boot(Dcat)
     }
     }
 
 
     boot(Dcat) {
     boot(Dcat) {

+ 11 - 11
resources/assets/dcat/js/dcat-app.js

@@ -13,9 +13,9 @@ import Dcat from './Dcat'
 import NProgress from './nprogress/NProgress.min'
 import NProgress from './nprogress/NProgress.min'
 import AjaxExtension from './extensions/Ajax'
 import AjaxExtension from './extensions/Ajax'
 import DialogExtension from './extensions/Dialog'
 import DialogExtension from './extensions/Dialog'
-import RowSelector from './extensions/RowSelector'
-import Grid from './extensions/Grid'
-import Debounce from './extensions/Debounce'
+import RowSelectorExtension from './extensions/RowSelector'
+import GridExtension from './extensions/Grid'
+import DebounceExtension from './extensions/Debounce'
 
 
 import Footer from './bootstrappers/Footer'
 import Footer from './bootstrappers/Footer'
 import Pjax from './bootstrappers/Pjax'
 import Pjax from './bootstrappers/Pjax'
@@ -29,21 +29,21 @@ win.NProgress = NProgress;
 function extend (Dcat) {
 function extend (Dcat) {
     new AjaxExtension(Dcat);
     new AjaxExtension(Dcat);
     new DialogExtension(Dcat);
     new DialogExtension(Dcat);
-    new Grid(Dcat);
+    new GridExtension(Dcat);
 
 
     Dcat.NP = NProgress;
     Dcat.NP = NProgress;
     Dcat.RowSelector = function (options) {
     Dcat.RowSelector = function (options) {
-        return new RowSelector(options)
+        return new RowSelectorExtension(options)
     };
     };
-    Dcat.debounce = Debounce;
+    Dcat.debounce = DebounceExtension;
 }
 }
 
 
 // 初始化事件监听
 // 初始化事件监听
-function on(Dcat) {
-    new Footer(Dcat);
-    new Pjax(Dcat);
-
+function listen(Dcat) {
     Dcat.booting(function () {
     Dcat.booting(function () {
+        new Footer(Dcat);
+        new Pjax(Dcat);
+
         Dcat.NP.configure({parent: '.app-content'});
         Dcat.NP.configure({parent: '.app-content'});
     });
     });
 }
 }
@@ -51,7 +51,7 @@ function on(Dcat) {
 // 初始化
 // 初始化
 function boot(Dcat) {
 function boot(Dcat) {
     extend(Dcat);
     extend(Dcat);
-    on(Dcat);
+    listen(Dcat);
 
 
     $(Dcat.boot);
     $(Dcat.boot);
 
 

+ 0 - 0
resources/assets/dcat/js/extensions/DialogForm.js


+ 1 - 1
resources/assets/dcat/sass/_variables.scss

@@ -1,4 +1,4 @@
 
 
 $primary-linear-gradient: linear-gradient(118deg, rgba($primary, 1), rgba($primary, 0.7));
 $primary-linear-gradient: linear-gradient(118deg, rgba($primary, 1), rgba($primary, 0.7));
 
 
-$body-background: ecf0f5;
+$body-background: #ecf0f5;

+ 27 - 0
resources/assets/dcat/sass/dcat-app.scss

@@ -15,3 +15,30 @@
 html body {
 html body {
   background-color: $body-background;
   background-color: $body-background;
 }
 }
+
+body, .header-navbar, .navigation, .breadcrumb, h1, h2, h3, h4, h5 {
+  font-family: Nunito,system-ui,BlinkMacSystemFont,-apple-system,sans-serif;
+}
+
+body.vertical-layout.vertical-menu-modern.menu-expanded .main-menu .navigation > li > a > i:before {
+   font-size: 1.3rem;
+}
+
+// 导航栏
+.breadcrumb {
+  border-left: 0;
+}
+
+// 页面标题
+.content-header h1 {
+  font-weight: 400;
+  font-size: 24px;
+  display: inline-block;
+
+  small {
+    font-size: 15px;
+    display: inline-block;
+    padding-left: 5px;
+    font-weight: 300;
+  }
+}

+ 34 - 1
resources/dist/dcat/css/app.css

@@ -78,6 +78,39 @@
 /*nprogress*/
 /*nprogress*/
 
 
 html body {
 html body {
-  background-color: ecf0f5;
+  background-color: #ecf0f5;
+}
+
+body,
+.header-navbar,
+.navigation,
+.breadcrumb,
+h1,
+h2,
+h3,
+h4,
+h5 {
+  font-family: Nunito, system-ui, BlinkMacSystemFont, -apple-system, sans-serif;
+}
+
+body.vertical-layout.vertical-menu-modern.menu-expanded .main-menu .navigation > li > a > i:before {
+  font-size: 1.3rem;
+}
+
+.breadcrumb {
+  border-left: 0;
+}
+
+.content-header h1 {
+  font-weight: 400;
+  font-size: 24px;
+  display: inline-block;
+}
+
+.content-header h1 small {
+  font-size: 15px;
+  display: inline-block;
+  padding-left: 5px;
+  font-weight: 300;
 }
 }
 
 

+ 8 - 12
resources/dist/dcat/js/app.js

@@ -236,12 +236,12 @@ var Footer = /*#__PURE__*/function () {
   function Footer(Dcat) {
   function Footer(Dcat) {
     _classCallCheck(this, Footer);
     _classCallCheck(this, Footer);
 
 
-    Dcat.booting(this.bootScrollTop);
+    this.boot(Dcat);
   }
   }
 
 
   _createClass(Footer, [{
   _createClass(Footer, [{
-    key: "bootScrollTop",
-    value: function bootScrollTop() {
+    key: "boot",
+    value: function boot(Dcat) {
       $(window).scroll(function () {
       $(window).scroll(function () {
         if ($(this).scrollTop() > 400) {
         if ($(this).scrollTop() > 400) {
           $('.scroll-top').fadeIn();
           $('.scroll-top').fadeIn();
@@ -287,11 +287,7 @@ var Pjax = /*#__PURE__*/function () {
   function Pjax(Dcat) {
   function Pjax(Dcat) {
     _classCallCheck(this, Pjax);
     _classCallCheck(this, Pjax);
 
 
-    var _this = this;
-
-    Dcat.booting(function () {
-      _this.boot(Dcat);
-    });
+    this.boot(Dcat);
   }
   }
 
 
   _createClass(Pjax, [{
   _createClass(Pjax, [{
@@ -404,10 +400,10 @@ function extend(Dcat) {
 } // 初始化事件监听
 } // 初始化事件监听
 
 
 
 
-function on(Dcat) {
-  new _bootstrappers_Footer__WEBPACK_IMPORTED_MODULE_7__["default"](Dcat);
-  new _bootstrappers_Pjax__WEBPACK_IMPORTED_MODULE_8__["default"](Dcat);
+function listen(Dcat) {
   Dcat.booting(function () {
   Dcat.booting(function () {
+    new _bootstrappers_Footer__WEBPACK_IMPORTED_MODULE_7__["default"](Dcat);
+    new _bootstrappers_Pjax__WEBPACK_IMPORTED_MODULE_8__["default"](Dcat);
     Dcat.NP.configure({
     Dcat.NP.configure({
       parent: '.app-content'
       parent: '.app-content'
     });
     });
@@ -417,7 +413,7 @@ function on(Dcat) {
 
 
 function boot(Dcat) {
 function boot(Dcat) {
   extend(Dcat);
   extend(Dcat);
-  on(Dcat);
+  listen(Dcat);
   $(Dcat.boot);
   $(Dcat.boot);
   return Dcat;
   return Dcat;
 }
 }

+ 12 - 19
resources/views/layouts/content.blade.php

@@ -1,7 +1,7 @@
-@section('content')
-    <section class="content-header">
+@section('content-header')
+    <section class="content-header breadcrumbs-top mb-1">
         @if($header || $description)
         @if($header || $description)
-            <h1 style="display:inline">
+            <h1 class=" float-left">
                 {!! $header !!}
                 {!! $header !!}
                 <small>{!! $description !!}</small>
                 <small>{!! $description !!}</small>
             </h1>
             </h1>
@@ -12,31 +12,24 @@
         @include('admin::partials.breadcrumb')
         @include('admin::partials.breadcrumb')
 
 
     </section>
     </section>
+@endsection
 
 
-    <section class="content">
-
-        @include('admin::partials.alerts')
-        @include('admin::partials.exception')
-
-        {!! $content !!}
+@section('content')
+    @include('admin::partials.alerts')
+    @include('admin::partials.exception')
 
 
-    </section>
+    {!! $content !!}
 
 
-    @if(Session::has('____'))
-        @php
-            $bag     = Session::get('layer-msg');
-            $type    = $bag->get('type')[0] ?? 'success';
-            $message = $bag->get('message')[0] ?? '';
-            $offset  = $bag->get('offset')[0] ?? '';
-        @endphp
-        <script>$(function () { Dcat.{{$type}}('{!!  $message  !!}', '{{ $offset }}'); })</script>
-    @endif
+    @include('admin::partials.toastr')
 @endsection
 @endsection
 
 
 @section('app')
 @section('app')
     {!! Dcat\Admin\Admin::assets()->renderStyle() !!}
     {!! Dcat\Admin\Admin::assets()->renderStyle() !!}
 
 
     {!! admin_section(AdminSection::APP_INNER_BEFORE) !!}
     {!! admin_section(AdminSection::APP_INNER_BEFORE) !!}
+    <div class="content-header">
+        @yield('content-header')
+    </div>
 
 
     <div class="content-body" id="app">
     <div class="content-body" id="app">
         @yield('content')
         @yield('content')

+ 0 - 4
resources/views/layouts/vertical.blade.php

@@ -8,10 +8,6 @@
         var Dcat = CreateDcat({!! Dcat\Admin\Admin::jsVariables() !!});
         var Dcat = CreateDcat({!! Dcat\Admin\Admin::jsVariables() !!});
 
 
         console.log(123, Dcat)
         console.log(123, Dcat)
-        $(function () {
-
-        });
-
     </script>
     </script>
 
 
     @include('admin::partials.sidebar')
     @include('admin::partials.sidebar')

+ 13 - 7
resources/views/partials/breadcrumb.blade.php

@@ -1,16 +1,17 @@
 @if ($breadcrumb)
 @if ($breadcrumb)
-    <ol class="breadcrumb" style="margin-right:30px;">
-        <li><a href="{{ admin_url('/') }}"><i class="fa fa-dashboard"></i> {{ucfirst(admin_trans('admin.home'))}}</a></li>
+    <div class="breadcrumb-wrapper col-12">
+    <ol class="breadcrumb float-right">
+        <li class="breadcrumb-item"><a href="{{ admin_url('/') }}"><i class="fa fa-dashboard"></i> {{ucfirst(admin_trans('admin.home'))}}</a></li>
         @foreach($breadcrumb as $item)
         @foreach($breadcrumb as $item)
             @if($loop->last)
             @if($loop->last)
-                <li class="active">
+                <li class="active breadcrumb-item">
                     @if (\Illuminate\Support\Arr::has($item, 'icon'))
                     @if (\Illuminate\Support\Arr::has($item, 'icon'))
                         <i class="fa {{ $item['icon'] }}"></i>
                         <i class="fa {{ $item['icon'] }}"></i>
                     @endif
                     @endif
                     {{ $item['text'] }}
                     {{ $item['text'] }}
                 </li>
                 </li>
             @else
             @else
-                <li>
+                <li class="breadcrumb-item">
                     <a href="{{ admin_url(\Illuminate\Support\Arr::get($item, 'url')) }}">
                     <a href="{{ admin_url(\Illuminate\Support\Arr::get($item, 'url')) }}">
                         @if (\Illuminate\Support\Arr::has($item, 'icon'))
                         @if (\Illuminate\Support\Arr::has($item, 'icon'))
                             <i class="fa {{ $item['icon'] }}"></i>
                             <i class="fa {{ $item['icon'] }}"></i>
@@ -21,15 +22,20 @@
             @endif
             @endif
         @endforeach
         @endforeach
     </ol>
     </ol>
+    </div>
 @elseif(config('admin.enable_default_breadcrumb'))
 @elseif(config('admin.enable_default_breadcrumb'))
-    <ol class="breadcrumb" style="margin-right:30px;">
-        <li><a href="{{ admin_url('/') }}"><i class="fa fa-dashboard"></i> {{ucfirst(admin_trans('admin.home'))}}</a></li>
+    <div class="breadcrumb-wrapper col-12">
+    <ol class="breadcrumb float-right">
+        <li class="breadcrumb-item"><a href="{{ admin_url('/') }}"><i class="fa fa-dashboard"></i> {{ucfirst(admin_trans('admin.home'))}}</a></li>
         @for($i = 2; $i <= ($len = count(Request::segments())); $i++)
         @for($i = 2; $i <= ($len = count(Request::segments())); $i++)
-            <li>
+            <li class="breadcrumb-item">
                 @if($i == $len) <a href=""> @endif
                 @if($i == $len) <a href=""> @endif
                 {{ucfirst(admin_trans_label(Request::segment($i)))}}
                 {{ucfirst(admin_trans_label(Request::segment($i)))}}
                 @if($i == $len) </a> @endif
                 @if($i == $len) </a> @endif
             </li>
             </li>
         @endfor
         @endfor
     </ol>
     </ol>
+    </div>
 @endif
 @endif
+
+<div class="clearfix"></div>

+ 9 - 0
resources/views/partials/toastr.blade.php

@@ -0,0 +1,9 @@
+@if(Session::has('dcat-admin-toastr'))
+    @php
+        $toastr  = Session::get('dcat-admin-toastr');
+        $type    = \Illuminate\Support\Arr::get($toastr->get('type'), 0, 'success');
+        $message = \Illuminate\Support\Arr::get($toastr->get('message'), 0, '');
+        $options = json_encode($toastr->get('options', []));
+    @endphp
+    <script>$(function () { toastr.{{$type}}('{!!  $message  !!}', null, {!! $options !!}); })</script>
+@endif

+ 1 - 1
src/Controllers/AuthController.php

@@ -243,7 +243,7 @@ class AuthController extends Controller
      */
      */
     protected function sendLoginResponse(Request $request)
     protected function sendLoginResponse(Request $request)
     {
     {
-        admin_alert(trans('admin.login_successful'));
+        admin_toastr(trans('admin.login_successful'));
 
 
         $request->session()->regenerate();
         $request->session()->regenerate();
 
 

+ 4 - 4
src/Support/helpers.php

@@ -294,19 +294,19 @@ if (! function_exists('admin_base_path')) {
     }
     }
 }
 }
 
 
-if (! function_exists('admin_alert')) {
+if (! function_exists('admin_toastr')) {
     /**
     /**
-     * Flash a layer message bag to session.
+     * Flash a toastr message bag to session.
      *
      *
      * @param string $message
      * @param string $message
      * @param string $type
      * @param string $type
      * @param string $offset
      * @param string $offset
      */
      */
-    function admin_alert($message = '', $type = 'success', $offset = '')
+    function admin_toastr($message = '', $type = 'success', $offset = '')
     {
     {
         $toastr = new MessageBag(get_defined_vars());
         $toastr = new MessageBag(get_defined_vars());
 
 
-        session()->flash('layer-msg', $toastr);
+        session()->flash('dcat-admin-toastr', $toastr);
     }
     }
 }
 }
 
 

+ 1 - 1
src/Traits/HasFormResponse.php

@@ -130,7 +130,7 @@ trait HasFormResponse
         $status = (int) ($options['status_code'] ?? 302);
         $status = (int) ($options['status_code'] ?? 302);
 
 
         if ($message) {
         if ($message) {
-            admin_alert($message);
+            admin_toastr($message);
         }
         }
 
 
         return redirect(admin_url($url), $status);
         return redirect(admin_url($url), $status);