jqh 5 rokov pred
rodič
commit
7f4d043755

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

@@ -36,14 +36,14 @@ export default class Pjax {
 
         $d.on('pjax:send', function (xhr) {
             if (xhr.relatedTarget && xhr.relatedTarget.tagName && xhr.relatedTarget.tagName.toLowerCase() === 'form') {
-                $(formContainer + ' :submit').button('loading');
+                $(formContainer + ' :submit').buttonLoading();
             }
             Dcat.NP.start();
         });
 
         $d.on('pjax:complete', function (xhr) {
             if (xhr.relatedTarget && xhr.relatedTarget.tagName && xhr.relatedTarget.tagName.toLowerCase() === 'form') {
-                $(formContainer + ' :submit').button('reset')
+                $(formContainer + ' :submit').buttonLoading(false)
             }
         });
 

+ 1 - 0
resources/assets/dcat/js/extensions/Ajax.js

@@ -11,6 +11,7 @@ export default class Ajax {
 
         Dcat.NP.done();
         Dcat.loading(false);// 关闭所有loading效果
+        $('.btn-loading').buttonLoading(false);
 
         var json = xhr.responseJSON || {}, _msg = json.message;
         switch (xhr.status) {

+ 9 - 5
resources/assets/dcat/js/extensions/DialogForm.js

@@ -109,14 +109,17 @@ export default class DialogForm {
 
         _this.isLoading = 1;
 
-        $btn && $btn.button('loading');
+        $btn && $btn.buttonLoading();
+
+        Dcat.NP.start();
 
         // 请求表单内容
         $.get(url, function (template) {
             _this.isLoading = 0;
+            Dcat.NP.done();
 
             if ($btn) {
-                $btn.button('reset');
+                $btn.buttonLoading(false);
 
                 setTimeout(function () {
                     $btn.find('.waves-ripple').remove();
@@ -193,7 +196,8 @@ export default class DialogForm {
     _submit() {
         let _this = this, 
             options = _this.options,
-            counter = _this.$target.attr('counter');
+            counter = _this.$target.attr('counter'),
+            $submitBtn = _this._dialogs[counter].find('.layui-layer-btn0');
 
         if (_this.isSubmitting) {
             return;
@@ -212,10 +216,10 @@ export default class DialogForm {
 
                 _this.isSubmitting = 1;
 
-                Dcat.NP.start();
+                $submitBtn.buttonLoading();
             },
             after: function (success, res) {
-                Dcat.NP.done();
+                $submitBtn.buttonLoading(false);
 
                 _this.isSubmitting = 0;
 

+ 0 - 8
resources/assets/dcat/js/extensions/Form.js

@@ -48,8 +48,6 @@ class Form {
 
         $form.ajaxSubmit({
             beforeSubmit: function (fields, $form, _opt) {
-                console.log(6666, fields);
-
                 if (options.before(fields, $form, _opt, _this) === false) {
                     return false;
                 }
@@ -57,12 +55,8 @@ class Form {
                 if (fire(formCallbacks.before, fields, $form, _opt, _this) === false) {
                     return false;
                 }
-
-                Dcat.NP.start();
             },
             success: function (response) {
-                Dcat.NP.done();
-
                 if (options.after(true, response, _this) === false) {
                     return;
                 }
@@ -91,8 +85,6 @@ class Form {
                 }
             },
             error: function (response) {
-                Dcat.NP.done();
-
                 if (options.after(false, response, _this) === false) {
                     return;
                 }

+ 38 - 0
resources/assets/dcat/js/extensions/Loading.js

@@ -98,6 +98,44 @@ function extend(Dcat) {
 
         return new Loading(Dcat, opt);
     };
+
+    $.fn.buttonLoading = function (start) {
+        let $this = $(this),
+            loadingId = $this.data('loading'),
+            content;
+
+        if (start === false) {
+            if (! loadingId) {
+                return $this;
+            }
+            return $this
+                .removeClass('disabled btn-loading')
+                .removeAttr('disabled')
+                .removeAttr('data-loading')
+                .html(
+                    $this.find('.' + loadingId).html()
+                );
+        }
+
+        if (loadingId) {
+            return $this;
+        }
+
+        content = $this.html();
+
+        loadingId = 'ld-'+Dcat.helpers.random();
+
+        return $this
+            .addClass('disabled btn-loading')
+            .attr('disabled', true)
+            .attr('data-loading', loadingId)
+            .html(`
+<div class="${loadingId}" style="display:none">${content}</div>
+<span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
+ LOADING ...
+`);
+    }
+
 }
 
 export default extend

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

@@ -1,6 +1,6 @@
 .box {
   position: relative;
-  border-radius: .5rem;
+  border-radius: .4rem;
   background: #ffffff;
   border-top: 2px solid transparent;
   margin-bottom: 10px;

+ 6 - 0
resources/assets/dcat/sass/components/_button.scss

@@ -85,3 +85,9 @@
 .input-group-sm > .form-control, .input-group-sm > .custom-select, .input-group-sm > .input-group-prepend > .input-group-text, .input-group-sm > .input-group-append > .input-group-text, .input-group-sm > .input-group-prepend > .btn, .input-group-sm > .input-group-append > .btn {
   padding: 0.5rem .7rem;
 }
+
+// loading
+.btn:not(.btn-sm) .spinner-grow, a:not(.btn) .spinner-grow {
+  margin-bottom: .15rem;
+}
+

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

@@ -135,3 +135,7 @@ pre {
   box-shadow: $shadow-200!important;
 }
 
+a.disabled {
+  opacity: 0.65;
+}
+

+ 36 - 36
resources/dist/css/plugins/loaders/animations/ball-grid-beat.css

@@ -27,66 +27,66 @@
 }
 
 .ball-grid-beat > div:nth-child(1) {
-  -webkit-animation-delay: 0.02s;
-          animation-delay: 0.02s;
-  -webkit-animation-duration: 1.03s;
-          animation-duration: 1.03s;
+  -webkit-animation-delay: -0.03s;
+          animation-delay: -0.03s;
+  -webkit-animation-duration: 1.39s;
+          animation-duration: 1.39s;
 }
 
 .ball-grid-beat > div:nth-child(2) {
-  -webkit-animation-delay: 0.51s;
-          animation-delay: 0.51s;
-  -webkit-animation-duration: 1.15s;
-          animation-duration: 1.15s;
+  -webkit-animation-delay: 0.24s;
+          animation-delay: 0.24s;
+  -webkit-animation-duration: 1.03s;
+          animation-duration: 1.03s;
 }
 
 .ball-grid-beat > div:nth-child(3) {
-  -webkit-animation-delay: 0.58s;
-          animation-delay: 0.58s;
-  -webkit-animation-duration: 1.57s;
-          animation-duration: 1.57s;
+  -webkit-animation-delay: 0.73s;
+          animation-delay: 0.73s;
+  -webkit-animation-duration: 1.39s;
+          animation-duration: 1.39s;
 }
 
 .ball-grid-beat > div:nth-child(4) {
-  -webkit-animation-delay: 0.41s;
-          animation-delay: 0.41s;
-  -webkit-animation-duration: 0.95s;
-          animation-duration: 0.95s;
+  -webkit-animation-delay: 0.71s;
+          animation-delay: 0.71s;
+  -webkit-animation-duration: 1.13s;
+          animation-duration: 1.13s;
 }
 
 .ball-grid-beat > div:nth-child(5) {
-  -webkit-animation-delay: 0.19s;
-          animation-delay: 0.19s;
-  -webkit-animation-duration: 1.02s;
-          animation-duration: 1.02s;
+  -webkit-animation-delay: -0.05s;
+          animation-delay: -0.05s;
+  -webkit-animation-duration: 1.4s;
+          animation-duration: 1.4s;
 }
 
 .ball-grid-beat > div:nth-child(6) {
-  -webkit-animation-delay: -0.01s;
-          animation-delay: -0.01s;
-  -webkit-animation-duration: 1.42s;
-          animation-duration: 1.42s;
+  -webkit-animation-delay: -0.04s;
+          animation-delay: -0.04s;
+  -webkit-animation-duration: 1.52s;
+          animation-duration: 1.52s;
 }
 
 .ball-grid-beat > div:nth-child(7) {
-  -webkit-animation-delay: 0.27s;
-          animation-delay: 0.27s;
-  -webkit-animation-duration: 1.21s;
-          animation-duration: 1.21s;
+  -webkit-animation-delay: 0.01s;
+          animation-delay: 0.01s;
+  -webkit-animation-duration: 1.26s;
+          animation-duration: 1.26s;
 }
 
 .ball-grid-beat > div:nth-child(8) {
-  -webkit-animation-delay: 0.57s;
-          animation-delay: 0.57s;
-  -webkit-animation-duration: 1.31s;
-          animation-duration: 1.31s;
+  -webkit-animation-delay: 0.15s;
+          animation-delay: 0.15s;
+  -webkit-animation-duration: 1.23s;
+          animation-duration: 1.23s;
 }
 
 .ball-grid-beat > div:nth-child(9) {
-  -webkit-animation-delay: -0.11s;
-          animation-delay: -0.11s;
-  -webkit-animation-duration: 1.5s;
-          animation-duration: 1.5s;
+  -webkit-animation-delay: 0.68s;
+          animation-delay: 0.68s;
+  -webkit-animation-duration: 1.03s;
+          animation-duration: 1.03s;
 }
 
 .ball-grid-beat > div {

+ 36 - 36
resources/dist/css/plugins/loaders/animations/ball-grid-pulse.css

@@ -39,66 +39,66 @@
 }
 
 .ball-grid-pulse > div:nth-child(1) {
-  -webkit-animation-delay: 0.45s;
-          animation-delay: 0.45s;
-  -webkit-animation-duration: 1.04s;
-          animation-duration: 1.04s;
+  -webkit-animation-delay: 0.74s;
+          animation-delay: 0.74s;
+  -webkit-animation-duration: 0.82s;
+          animation-duration: 0.82s;
 }
 
 .ball-grid-pulse > div:nth-child(2) {
-  -webkit-animation-delay: 0.13s;
-          animation-delay: 0.13s;
-  -webkit-animation-duration: 0.82s;
-          animation-duration: 0.82s;
+  -webkit-animation-delay: 0.4s;
+          animation-delay: 0.4s;
+  -webkit-animation-duration: 1.2s;
+          animation-duration: 1.2s;
 }
 
 .ball-grid-pulse > div:nth-child(3) {
-  -webkit-animation-delay: -0.17s;
-          animation-delay: -0.17s;
-  -webkit-animation-duration: 1.13s;
-          animation-duration: 1.13s;
+  -webkit-animation-delay: 0.12s;
+          animation-delay: 0.12s;
+  -webkit-animation-duration: 1.33s;
+          animation-duration: 1.33s;
 }
 
 .ball-grid-pulse > div:nth-child(4) {
-  -webkit-animation-delay: 0.61s;
-          animation-delay: 0.61s;
-  -webkit-animation-duration: 0.82s;
-          animation-duration: 0.82s;
+  -webkit-animation-delay: 0.35s;
+          animation-delay: 0.35s;
+  -webkit-animation-duration: 1.59s;
+          animation-duration: 1.59s;
 }
 
 .ball-grid-pulse > div:nth-child(5) {
-  -webkit-animation-delay: 0s;
-          animation-delay: 0s;
-  -webkit-animation-duration: 1.55s;
-          animation-duration: 1.55s;
+  -webkit-animation-delay: 0.66s;
+          animation-delay: 0.66s;
+  -webkit-animation-duration: 1.09s;
+          animation-duration: 1.09s;
 }
 
 .ball-grid-pulse > div:nth-child(6) {
-  -webkit-animation-delay: 0.69s;
-          animation-delay: 0.69s;
-  -webkit-animation-duration: 1.16s;
-          animation-duration: 1.16s;
+  -webkit-animation-delay: -0.17s;
+          animation-delay: -0.17s;
+  -webkit-animation-duration: 1.4s;
+          animation-duration: 1.4s;
 }
 
 .ball-grid-pulse > div:nth-child(7) {
-  -webkit-animation-delay: 0.23s;
-          animation-delay: 0.23s;
-  -webkit-animation-duration: 1.24s;
-          animation-duration: 1.24s;
+  -webkit-animation-delay: 0.75s;
+          animation-delay: 0.75s;
+  -webkit-animation-duration: 1.6s;
+          animation-duration: 1.6s;
 }
 
 .ball-grid-pulse > div:nth-child(8) {
-  -webkit-animation-delay: -0.01s;
-          animation-delay: -0.01s;
-  -webkit-animation-duration: 1.48s;
-          animation-duration: 1.48s;
+  -webkit-animation-delay: -0.18s;
+          animation-delay: -0.18s;
+  -webkit-animation-duration: 0.71s;
+          animation-duration: 0.71s;
 }
 
 .ball-grid-pulse > div:nth-child(9) {
-  -webkit-animation-delay: 0.38s;
-          animation-delay: 0.38s;
-  -webkit-animation-duration: 1.44s;
-          animation-duration: 1.44s;
+  -webkit-animation-delay: -0.16s;
+          animation-delay: -0.16s;
+  -webkit-animation-duration: 1.17s;
+          animation-duration: 1.17s;
 }
 
 .ball-grid-pulse > div {

+ 16 - 16
resources/dist/css/plugins/loaders/animations/line-scale-random.css

@@ -31,31 +31,31 @@
 }
 
 .line-scale-party > div:nth-child(1) {
-  -webkit-animation-delay: 0.63s;
-          animation-delay: 0.63s;
-  -webkit-animation-duration: 0.8s;
-          animation-duration: 0.8s;
+  -webkit-animation-delay: -0.19s;
+          animation-delay: -0.19s;
+  -webkit-animation-duration: 0.53s;
+          animation-duration: 0.53s;
 }
 
 .line-scale-party > div:nth-child(2) {
-  -webkit-animation-delay: -0.11s;
-          animation-delay: -0.11s;
-  -webkit-animation-duration: 0.73s;
-          animation-duration: 0.73s;
+  -webkit-animation-delay: -0.03s;
+          animation-delay: -0.03s;
+  -webkit-animation-duration: 0.6s;
+          animation-duration: 0.6s;
 }
 
 .line-scale-party > div:nth-child(3) {
-  -webkit-animation-delay: 0.16s;
-          animation-delay: 0.16s;
-  -webkit-animation-duration: 0.4s;
-          animation-duration: 0.4s;
+  -webkit-animation-delay: 0.74s;
+          animation-delay: 0.74s;
+  -webkit-animation-duration: 0.43s;
+          animation-duration: 0.43s;
 }
 
 .line-scale-party > div:nth-child(4) {
-  -webkit-animation-delay: 0.1s;
-          animation-delay: 0.1s;
-  -webkit-animation-duration: 1.06s;
-          animation-duration: 1.06s;
+  -webkit-animation-delay: 0s;
+          animation-delay: 0s;
+  -webkit-animation-duration: 0.56s;
+          animation-duration: 0.56s;
 }
 
 .line-scale-party > div {

+ 84 - 84
resources/dist/css/plugins/loaders/loaders.css

@@ -1454,66 +1454,66 @@
 }
 
 .ball-grid-beat > div:nth-child(1) {
-  -webkit-animation-delay: 0.44s;
-          animation-delay: 0.44s;
-  -webkit-animation-duration: 1.24s;
-          animation-duration: 1.24s;
+  -webkit-animation-delay: 0.65s;
+          animation-delay: 0.65s;
+  -webkit-animation-duration: 0.64s;
+          animation-duration: 0.64s;
 }
 
 .ball-grid-beat > div:nth-child(2) {
-  -webkit-animation-delay: 0.62s;
-          animation-delay: 0.62s;
-  -webkit-animation-duration: 1.28s;
-          animation-duration: 1.28s;
+  -webkit-animation-delay: -0.05s;
+          animation-delay: -0.05s;
+  -webkit-animation-duration: 1.03s;
+          animation-duration: 1.03s;
 }
 
 .ball-grid-beat > div:nth-child(3) {
-  -webkit-animation-delay: 0.32s;
-          animation-delay: 0.32s;
-  -webkit-animation-duration: 1.37s;
-          animation-duration: 1.37s;
+  -webkit-animation-delay: 0.78s;
+          animation-delay: 0.78s;
+  -webkit-animation-duration: 1.45s;
+          animation-duration: 1.45s;
 }
 
 .ball-grid-beat > div:nth-child(4) {
-  -webkit-animation-delay: -0.06s;
-          animation-delay: -0.06s;
-  -webkit-animation-duration: 0.7s;
-          animation-duration: 0.7s;
+  -webkit-animation-delay: 0.07s;
+          animation-delay: 0.07s;
+  -webkit-animation-duration: 0.73s;
+          animation-duration: 0.73s;
 }
 
 .ball-grid-beat > div:nth-child(5) {
-  -webkit-animation-delay: 0.11s;
-          animation-delay: 0.11s;
-  -webkit-animation-duration: 0.67s;
-          animation-duration: 0.67s;
+  -webkit-animation-delay: 0.56s;
+          animation-delay: 0.56s;
+  -webkit-animation-duration: 0.94s;
+          animation-duration: 0.94s;
 }
 
 .ball-grid-beat > div:nth-child(6) {
-  -webkit-animation-delay: 0.44s;
-          animation-delay: 0.44s;
-  -webkit-animation-duration: 0.9s;
-          animation-duration: 0.9s;
+  -webkit-animation-delay: 0.8s;
+          animation-delay: 0.8s;
+  -webkit-animation-duration: 1.26s;
+          animation-duration: 1.26s;
 }
 
 .ball-grid-beat > div:nth-child(7) {
   -webkit-animation-delay: 0.66s;
           animation-delay: 0.66s;
-  -webkit-animation-duration: 1.44s;
-          animation-duration: 1.44s;
+  -webkit-animation-duration: 0.93s;
+          animation-duration: 0.93s;
 }
 
 .ball-grid-beat > div:nth-child(8) {
-  -webkit-animation-delay: 0.16s;
-          animation-delay: 0.16s;
-  -webkit-animation-duration: 0.61s;
-          animation-duration: 0.61s;
+  -webkit-animation-delay: 0.69s;
+          animation-delay: 0.69s;
+  -webkit-animation-duration: 1.26s;
+          animation-duration: 1.26s;
 }
 
 .ball-grid-beat > div:nth-child(9) {
-  -webkit-animation-delay: 0.05s;
-          animation-delay: 0.05s;
-  -webkit-animation-duration: 1.13s;
-          animation-duration: 1.13s;
+  -webkit-animation-delay: 0.74s;
+          animation-delay: 0.74s;
+  -webkit-animation-duration: 1.08s;
+          animation-duration: 1.08s;
 }
 
 .ball-grid-beat > div {
@@ -1577,64 +1577,64 @@
 .ball-grid-pulse > div:nth-child(1) {
   -webkit-animation-delay: 0.25s;
           animation-delay: 0.25s;
-  -webkit-animation-duration: 1.26s;
-          animation-duration: 1.26s;
+  -webkit-animation-duration: 1.37s;
+          animation-duration: 1.37s;
 }
 
 .ball-grid-pulse > div:nth-child(2) {
-  -webkit-animation-delay: -0.1s;
-          animation-delay: -0.1s;
-  -webkit-animation-duration: 1.4s;
-          animation-duration: 1.4s;
+  -webkit-animation-delay: 0.59s;
+          animation-delay: 0.59s;
+  -webkit-animation-duration: 1.37s;
+          animation-duration: 1.37s;
 }
 
 .ball-grid-pulse > div:nth-child(3) {
-  -webkit-animation-delay: 0.17s;
-          animation-delay: 0.17s;
-  -webkit-animation-duration: 1.2s;
-          animation-duration: 1.2s;
+  -webkit-animation-delay: 0.32s;
+          animation-delay: 0.32s;
+  -webkit-animation-duration: 0.63s;
+          animation-duration: 0.63s;
 }
 
 .ball-grid-pulse > div:nth-child(4) {
-  -webkit-animation-delay: 0.42s;
-          animation-delay: 0.42s;
-  -webkit-animation-duration: 0.69s;
-          animation-duration: 0.69s;
+  -webkit-animation-delay: 0.3s;
+          animation-delay: 0.3s;
+  -webkit-animation-duration: 1.43s;
+          animation-duration: 1.43s;
 }
 
 .ball-grid-pulse > div:nth-child(5) {
-  -webkit-animation-delay: 0.22s;
-          animation-delay: 0.22s;
-  -webkit-animation-duration: 1.52s;
-          animation-duration: 1.52s;
+  -webkit-animation-delay: 0.79s;
+          animation-delay: 0.79s;
+  -webkit-animation-duration: 1.42s;
+          animation-duration: 1.42s;
 }
 
 .ball-grid-pulse > div:nth-child(6) {
-  -webkit-animation-delay: -0.13s;
-          animation-delay: -0.13s;
-  -webkit-animation-duration: 1.01s;
-          animation-duration: 1.01s;
+  -webkit-animation-delay: 0.52s;
+          animation-delay: 0.52s;
+  -webkit-animation-duration: 0.95s;
+          animation-duration: 0.95s;
 }
 
 .ball-grid-pulse > div:nth-child(7) {
-  -webkit-animation-delay: 0.62s;
-          animation-delay: 0.62s;
-  -webkit-animation-duration: 0.75s;
-          animation-duration: 0.75s;
+  -webkit-animation-delay: 0.17s;
+          animation-delay: 0.17s;
+  -webkit-animation-duration: 1.24s;
+          animation-duration: 1.24s;
 }
 
 .ball-grid-pulse > div:nth-child(8) {
-  -webkit-animation-delay: 0.64s;
-          animation-delay: 0.64s;
-  -webkit-animation-duration: 1.05s;
-          animation-duration: 1.05s;
+  -webkit-animation-delay: 0.06s;
+          animation-delay: 0.06s;
+  -webkit-animation-duration: 1.08s;
+          animation-duration: 1.08s;
 }
 
 .ball-grid-pulse > div:nth-child(9) {
-  -webkit-animation-delay: 0.19s;
-          animation-delay: 0.19s;
-  -webkit-animation-duration: 0.73s;
-          animation-duration: 0.73s;
+  -webkit-animation-delay: 0.01s;
+          animation-delay: 0.01s;
+  -webkit-animation-duration: 1.43s;
+          animation-duration: 1.43s;
 }
 
 .ball-grid-pulse > div {
@@ -2181,31 +2181,31 @@
 }
 
 .line-scale-party > div:nth-child(1) {
-  -webkit-animation-delay: 0.73s;
-          animation-delay: 0.73s;
-  -webkit-animation-duration: 0.63s;
-          animation-duration: 0.63s;
+  -webkit-animation-delay: 0.38s;
+          animation-delay: 0.38s;
+  -webkit-animation-duration: 0.88s;
+          animation-duration: 0.88s;
 }
 
 .line-scale-party > div:nth-child(2) {
-  -webkit-animation-delay: 0.73s;
-          animation-delay: 0.73s;
-  -webkit-animation-duration: 1.05s;
-          animation-duration: 1.05s;
+  -webkit-animation-delay: 0.53s;
+          animation-delay: 0.53s;
+  -webkit-animation-duration: 1.23s;
+          animation-duration: 1.23s;
 }
 
 .line-scale-party > div:nth-child(3) {
-  -webkit-animation-delay: 0.13s;
-          animation-delay: 0.13s;
-  -webkit-animation-duration: 0.7s;
-          animation-duration: 0.7s;
+  -webkit-animation-delay: 0.66s;
+          animation-delay: 0.66s;
+  -webkit-animation-duration: 0.98s;
+          animation-duration: 0.98s;
 }
 
 .line-scale-party > div:nth-child(4) {
-  -webkit-animation-delay: 0.7s;
-          animation-delay: 0.7s;
-  -webkit-animation-duration: 1.06s;
-          animation-duration: 1.06s;
+  -webkit-animation-delay: 0.2s;
+          animation-delay: 0.2s;
+  -webkit-animation-duration: 0.92s;
+          animation-duration: 0.92s;
 }
 
 .line-scale-party > div {

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

@@ -1864,6 +1864,11 @@ dl {
   padding: 0.5rem 0.7rem;
 }
 
+.btn:not(.btn-sm) .spinner-grow,
+a:not(.btn) .spinner-grow {
+  margin-bottom: 0.15rem;
+}
+
 .form-control-sm {
   padding: 0.5rem 1.5rem;
 }
@@ -2526,7 +2531,7 @@ table.dataTable.complex-headers tfoot td {
 
 .box {
   position: relative;
-  border-radius: 0.5rem;
+  border-radius: 0.4rem;
   background: #ffffff;
   border-top: 2px solid transparent;
   margin-bottom: 10px;
@@ -2850,3 +2855,7 @@ pre {
   box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.1), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 1px 5px 1px rgba(0, 0, 0, 0.1) !important;
 }
 
+a.disabled {
+  opacity: 0.65;
+}
+

+ 33 - 15
resources/dist/dcat/js/dcat-app.js

@@ -649,14 +649,14 @@ var Pjax = /*#__PURE__*/function () {
       });
       $d.on('pjax:send', function (xhr) {
         if (xhr.relatedTarget && xhr.relatedTarget.tagName && xhr.relatedTarget.tagName.toLowerCase() === 'form') {
-          $(formContainer + ' :submit').button('loading');
+          $(formContainer + ' :submit').buttonLoading();
         }
 
         Dcat.NP.start();
       });
       $d.on('pjax:complete', function (xhr) {
         if (xhr.relatedTarget && xhr.relatedTarget.tagName && xhr.relatedTarget.tagName.toLowerCase() === 'form') {
-          $(formContainer + ' :submit').button('reset');
+          $(formContainer + ' :submit').buttonLoading(false);
         }
       });
       $d.on('pjax:loaded', function () {
@@ -853,6 +853,7 @@ var Ajax = /*#__PURE__*/function () {
       Dcat.NP.done();
       Dcat.loading(false); // 关闭所有loading效果
 
+      $('.btn-loading').buttonLoading(false);
       var json = xhr.responseJSON || {},
           _msg = json.message;
 
@@ -1402,13 +1403,15 @@ var DialogForm = /*#__PURE__*/function () {
         _this._destroy(counter);
       });
       _this.isLoading = 1;
-      $btn && $btn.button('loading'); // 请求表单内容
+      $btn && $btn.buttonLoading();
+      Dcat.NP.start(); // 请求表单内容
 
       $.get(url, function (template) {
         _this.isLoading = 0;
+        Dcat.NP.done();
 
         if ($btn) {
-          $btn.button('reset');
+          $btn.buttonLoading(false);
           setTimeout(function () {
             $btn.find('.waves-ripple').remove();
           }, 50);
@@ -1487,7 +1490,8 @@ var DialogForm = /*#__PURE__*/function () {
     value: function _submit() {
       var _this = this,
           options = _this.options,
-          counter = _this.$target.attr('counter');
+          counter = _this.$target.attr('counter'),
+          $submitBtn = _this._dialogs[counter].find('.layui-layer-btn0');
 
       if (_this.isSubmitting) {
         return;
@@ -1505,10 +1509,10 @@ var DialogForm = /*#__PURE__*/function () {
           }
 
           _this.isSubmitting = 1;
-          Dcat.NP.start();
+          $submitBtn.buttonLoading();
         },
         after: function after(success, res) {
-          Dcat.NP.done();
+          $submitBtn.buttonLoading(false);
           _this.isSubmitting = 0;
           options.saved(success, res);
 
@@ -1608,8 +1612,6 @@ var Form = /*#__PURE__*/function () {
       removeFieldError(_this);
       $form.ajaxSubmit({
         beforeSubmit: function beforeSubmit(fields, $form, _opt) {
-          console.log(6666, fields);
-
           if (options.before(fields, $form, _opt, _this) === false) {
             return false;
           }
@@ -1617,12 +1619,8 @@ var Form = /*#__PURE__*/function () {
           if (fire(formCallbacks.before, fields, $form, _opt, _this) === false) {
             return false;
           }
-
-          Dcat.NP.start();
         },
         success: function success(response) {
-          Dcat.NP.done();
-
           if (options.after(true, response, _this) === false) {
             return;
           }
@@ -1651,8 +1649,6 @@ var Form = /*#__PURE__*/function () {
           }
         },
         error: function error(response) {
-          Dcat.NP.done();
-
           if (options.after(false, response, _this) === false) {
             return;
           }
@@ -2362,6 +2358,28 @@ function extend(Dcat) {
     opt.container = $(this);
     return new Loading(Dcat, opt);
   };
+
+  $.fn.buttonLoading = function (start) {
+    var $this = $(this),
+        loadingId = $this.data('loading'),
+        content;
+
+    if (start === false) {
+      if (!loadingId) {
+        return $this;
+      }
+
+      return $this.removeClass('disabled btn-loading').removeAttr('disabled').removeAttr('data-loading').html($this.find('.' + loadingId).html());
+    }
+
+    if (loadingId) {
+      return $this;
+    }
+
+    content = $this.html();
+    loadingId = 'ld-' + Dcat.helpers.random();
+    return $this.addClass('disabled btn-loading').attr('disabled', true).attr('data-loading', loadingId).html("\n<div class=\"".concat(loadingId, "\" style=\"display:none\">").concat(content, "</div>\n<span class=\"spinner-grow spinner-grow-sm\" role=\"status\" aria-hidden=\"true\"></span>\n LOADING ...\n"));
+  };
 }
 
 /* harmony default export */ __webpack_exports__["default"] = (extend);

+ 4 - 4
resources/views/form/steps.blade.php

@@ -86,12 +86,12 @@ Dcat.ready(function () {
 
             allStepInput.val("1");
             stepInput.val("");
-            $t.button('loading').removeClass('waves-effect');
+            $t.buttonLoading().removeClass('waves-effect');
             isSubmitting = 1;
 
             // 提交完整表单
             submit(function (state, data) {
-                $t.button('reset');
+                $t.buttonLoading(false);
                 isSubmitting = 0;
 
                 if (state) {
@@ -217,13 +217,13 @@ Dcat.ready(function () {
         }
 
         var self = this;
-        $(self).button('loading').removeClass('waves-effect');
+        $(self).buttonLoading().removeClass('waves-effect');
         isSubmitting = 1;
 
         // 发送表单到服务器进行验证
         stepInput.val(smartWizard.current_index);
         submit(function (state) {
-            $(self).button('reset');
+            $(self).buttonLoading(false);
             isSubmitting = 0;
 
             if (state) {

+ 2 - 2
src/Form/Builder.php

@@ -856,10 +856,10 @@ EOF;
                 if (f.find('.has-error').length > 0) {
                     return false;
                 }
-                t.button('loading').removeClass('waves-effect');
+                t.buttonLoading().removeClass('waves-effect');
             },
             after: function () {
-                t.button('reset');
+                t.buttonLoading(false);
             }
         });
     

+ 3 - 3
src/Grid/Displayers/Checkbox.php

@@ -69,7 +69,7 @@ EOT;
         if (f) return;
         f = 1;
         
-        btn.button('loading');
+        btn.buttonLoading();
     
         var data = {
             {$this->column->getName()}: values,
@@ -83,12 +83,12 @@ EOT;
             contentType: 'application/json;charset=utf-8',
             data: JSON.stringify(data),
             success: function (data) {
-                btn.button('reset');
+                btn.buttonLoading(false);
                 f = 0;
                 Dcat.success(data.message);
             },
             error: function (a, b, c) {
-                btn.button('reset');
+                btn.buttonLoading(false);
                 f = 0;
                 Dcat.ajaxError(a, b, c);
             },

+ 2 - 2
src/Grid/Displayers/DialogTree.php

@@ -201,10 +201,10 @@ $('.{$this->getSelectorPrefix()}-open-tree').off('click').click(function () {
         if (requesting) return;
         requesting = 1;
         
-        t.button('loading');
+        t.buttonLoading();
         $.getJSON(url, {_token: Dcat.token, value: val}, function (resp) {
              requesting = 0;
-             t.button('reset');
+             t.buttonLoading(false);
              
              if (!resp.status) {
                 return Dcat.error(resp.message || '系统繁忙,请稍后再试');

+ 3 - 3
src/Grid/Displayers/Radio.php

@@ -62,7 +62,7 @@ EOT;
         if (f) return;
         f = 1;
         
-        btn.button('loading');
+        btn.buttonLoading();
     
         $.ajax({
             url: "{$this->resource()}/" + $(this).data('key'),
@@ -73,12 +73,12 @@ EOT;
                 _method: 'PUT'
             },
             success: function (data) {
-                btn.button('reset');
+                btn.buttonLoading(false);
                 f = 0;
                 Dcat.success(data.message);
             },
             error: function (a, b, c) {
-                btn.button('reset');
+                btn.buttonLoading(false);
                 f = 0;
                 Dcat.ajaxError(a, b, c);
             },

+ 2 - 2
src/Widgets/Form.php

@@ -605,10 +605,10 @@ HTML;
                     return false;
                 }
                 
-                t.button('loading');
+                t.buttonLoading();
             },
             after: function () {
-                t.button('reset');
+                t.buttonLoading(false);
             }
         });