jqh 5 жил өмнө
parent
commit
75950a0e56

+ 13 - 0
resources/assets/dcat/js/Dcat.js

@@ -84,6 +84,19 @@ export default class Dcat {
         _window.Dcat.ready(proxy);
     }
 
+    /**
+     * 主动触发 ready 事件
+     */
+    triggerReady() {
+        if (! pjaxResponded) {
+            return;
+        }
+
+        $(() => {
+            $d.trigger('pjax:loaded');
+        });
+    }
+
     /**
      * 如果是 pjax 响应的页面,需要调用此方法
      *

+ 5 - 1
resources/assets/dcat/js/dcat-app.js

@@ -21,6 +21,8 @@ import Form from './extensions/Form'
 import DialogForm from './extensions/DialogForm'
 import Loading from './extensions/Loading'
 import PreviewImage from './extensions/PreviewImage'
+import AssetsLoader from './extensions/AssetsLoader'
+import Slider from './extensions/Slider'
 
 import Menu from './bootstrappers/Menu'
 import Footer from './bootstrappers/Footer'
@@ -46,6 +48,8 @@ function extend (Dcat) {
     new Loading(Dcat);
     // 图片预览功能
     new PreviewImage(Dcat);
+    // 静态资源加载器
+    new AssetsLoader(Dcat);
 
     // 加载进度条
     Dcat.NP = NProgress;
@@ -67,7 +71,7 @@ function extend (Dcat) {
 
     // 滑动面板
     Dcat.Slider = function (options) {
-
+        return new Slider(Dcat, options)
     };
 }
 

+ 98 - 0
resources/assets/dcat/js/extensions/AssetsLoader.js

@@ -0,0 +1,98 @@
+
+export default class AssetsLoader {
+    constructor(Dcat) {
+        let _this = this;
+
+        _this.dcat = Dcat;
+
+        Dcat.assets = {
+            // 加载js脚本,并触发 ready 事件
+            loadScripts: _this.load.bind(_this),
+
+            // 从给定的内容中过滤"<script>"标签内容,并自动加载其中的js脚本
+            filterScriptsAndLoad: _this.filterScriptsAndLoad.bind(_this)
+        };
+    }
+
+
+    // 按顺序加载静态资源
+    // 并在所有静态资源加载完毕后执行回调函数
+    load(urls, callback, args) {
+        let _this = this;
+        if (urls.length < 1) {
+            (! callback) || callback(args);
+
+            _this.fire();
+            return;
+        }
+
+        seajs.use([urls.shift()], function () {
+            _this.load(urls, callback, args);
+        });
+    }
+    
+    // 过滤 <script src> 标签
+    filterScripts(content) {
+        var obj = {};
+
+        if (typeof content == 'string') {
+            content = $(content);
+        }
+
+        obj.scripts = this.findAll(content, 'script[src]').remove();
+        obj.contents = content.not(obj.scripts);
+
+        obj.contents.render = this.toString;
+        obj.js = (function () {
+            var urls = [];
+            obj.scripts.each(function (k, v) {
+                if (v.src) {
+                    urls.push(v.src);
+                }
+            });
+
+            return urls;
+        })();
+
+        return obj;
+    }
+    
+    // 返回过滤 <script src> 标签后的内容,并在加载完 script 脚本后触发 "pjax:script" 事件
+    filterScriptsAndLoad(content, callback) {
+        var obj = this.filterScripts(content);
+
+        this.load(obj.js, function () {
+            (!callback) || callback(obj.contents);
+        });
+
+        return obj.contents;
+    }
+
+    findAll(elems, selector) {
+        if (typeof elems == 'string') {
+            elems = $(elems);
+        }
+
+        return elems.filter(selector).add(elems.find(selector));
+    }
+
+    fire() {
+        this.dcat.pjaxResponded();
+
+        // js加载完毕 触发 ready 事件
+        // setTimeout用于保证在所有js代码最后执行
+        setTimeout(this.dcat.triggerReady, 1);
+    }
+
+    toString(th) {
+        var html = '', out;
+
+        this.each(function (k, v) {
+            if ((out = v.outerHTML)) {
+                html += out;
+            }
+        });
+
+        return html;
+    }
+}

+ 3 - 2
resources/assets/dcat/js/extensions/DialogForm.js

@@ -122,9 +122,10 @@ export default class DialogForm {
     }
 
     _popup(tpl, counter) {
-        let _this = this, options = _this.options;
+        let _this = this,
+            options = _this.options;
 
-        tpl = LA.AssetsLoader.filterScriptAndAutoLoad(tpl).render();
+        tpl = Dcat.assets.filterScriptsAndLoad(tpl).render();
         
         let $template = $(tpl),
             btns = [options.lang.submit],

+ 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.38s;
-          animation-delay: 0.38s;
-  -webkit-animation-duration: 1.19s;
-          animation-duration: 1.19s;
+  -webkit-animation-delay: 0.54s;
+          animation-delay: 0.54s;
+  -webkit-animation-duration: 1.44s;
+          animation-duration: 1.44s;
 }
 
 .ball-grid-beat > div:nth-child(2) {
-  -webkit-animation-delay: 0s;
-          animation-delay: 0s;
-  -webkit-animation-duration: 0.71s;
-          animation-duration: 0.71s;
+  -webkit-animation-delay: 0.78s;
+          animation-delay: 0.78s;
+  -webkit-animation-duration: 0.67s;
+          animation-duration: 0.67s;
 }
 
 .ball-grid-beat > div:nth-child(3) {
-  -webkit-animation-delay: -0.17s;
-          animation-delay: -0.17s;
-  -webkit-animation-duration: 1.11s;
-          animation-duration: 1.11s;
+  -webkit-animation-delay: 0.21s;
+          animation-delay: 0.21s;
+  -webkit-animation-duration: 1.19s;
+          animation-duration: 1.19s;
 }
 
 .ball-grid-beat > div:nth-child(4) {
-  -webkit-animation-delay: 0.18s;
-          animation-delay: 0.18s;
-  -webkit-animation-duration: 1.15s;
-          animation-duration: 1.15s;
+  -webkit-animation-delay: 0.51s;
+          animation-delay: 0.51s;
+  -webkit-animation-duration: 0.84s;
+          animation-duration: 0.84s;
 }
 
 .ball-grid-beat > div:nth-child(5) {
-  -webkit-animation-delay: -0.04s;
-          animation-delay: -0.04s;
-  -webkit-animation-duration: 1.37s;
-          animation-duration: 1.37s;
+  -webkit-animation-delay: 0.5s;
+          animation-delay: 0.5s;
+  -webkit-animation-duration: 0.93s;
+          animation-duration: 0.93s;
 }
 
 .ball-grid-beat > div:nth-child(6) {
-  -webkit-animation-delay: 0.02s;
-          animation-delay: 0.02s;
-  -webkit-animation-duration: 1.12s;
-          animation-duration: 1.12s;
+  -webkit-animation-delay: 0.76s;
+          animation-delay: 0.76s;
+  -webkit-animation-duration: 1.45s;
+          animation-duration: 1.45s;
 }
 
 .ball-grid-beat > div:nth-child(7) {
-  -webkit-animation-delay: -0.01s;
-          animation-delay: -0.01s;
-  -webkit-animation-duration: 1.35s;
-          animation-duration: 1.35s;
+  -webkit-animation-delay: 0.06s;
+          animation-delay: 0.06s;
+  -webkit-animation-duration: 1.58s;
+          animation-duration: 1.58s;
 }
 
 .ball-grid-beat > div:nth-child(8) {
-  -webkit-animation-delay: 0.47s;
-          animation-delay: 0.47s;
-  -webkit-animation-duration: 1.6s;
-          animation-duration: 1.6s;
+  -webkit-animation-delay: 0s;
+          animation-delay: 0s;
+  -webkit-animation-duration: 0.78s;
+          animation-duration: 0.78s;
 }
 
 .ball-grid-beat > div:nth-child(9) {
-  -webkit-animation-delay: 0.33s;
-          animation-delay: 0.33s;
-  -webkit-animation-duration: 0.65s;
-          animation-duration: 0.65s;
+  -webkit-animation-delay: 0.77s;
+          animation-delay: 0.77s;
+  -webkit-animation-duration: 1.49s;
+          animation-duration: 1.49s;
 }
 
 .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.04s;
-          animation-delay: 0.04s;
-  -webkit-animation-duration: 1.41s;
-          animation-duration: 1.41s;
+  -webkit-animation-delay: 0.4s;
+          animation-delay: 0.4s;
+  -webkit-animation-duration: 0.91s;
+          animation-duration: 0.91s;
 }
 
 .ball-grid-pulse > div:nth-child(2) {
-  -webkit-animation-delay: 0.65s;
-          animation-delay: 0.65s;
-  -webkit-animation-duration: 0.92s;
-          animation-duration: 0.92s;
+  -webkit-animation-delay: -0.16s;
+          animation-delay: -0.16s;
+  -webkit-animation-duration: 1.6s;
+          animation-duration: 1.6s;
 }
 
 .ball-grid-pulse > div:nth-child(3) {
-  -webkit-animation-delay: 0.77s;
-          animation-delay: 0.77s;
-  -webkit-animation-duration: 0.93s;
-          animation-duration: 0.93s;
+  -webkit-animation-delay: 0.14s;
+          animation-delay: 0.14s;
+  -webkit-animation-duration: 1.08s;
+          animation-duration: 1.08s;
 }
 
 .ball-grid-pulse > div:nth-child(4) {
-  -webkit-animation-delay: -0.12s;
-          animation-delay: -0.12s;
-  -webkit-animation-duration: 1.06s;
-          animation-duration: 1.06s;
+  -webkit-animation-delay: 0.73s;
+          animation-delay: 0.73s;
+  -webkit-animation-duration: 0.71s;
+          animation-duration: 0.71s;
 }
 
 .ball-grid-pulse > div:nth-child(5) {
-  -webkit-animation-delay: 0.2s;
-          animation-delay: 0.2s;
-  -webkit-animation-duration: 1.5s;
-          animation-duration: 1.5s;
+  -webkit-animation-delay: 0.57s;
+          animation-delay: 0.57s;
+  -webkit-animation-duration: 1.46s;
+          animation-duration: 1.46s;
 }
 
 .ball-grid-pulse > div:nth-child(6) {
-  -webkit-animation-delay: 0.58s;
-          animation-delay: 0.58s;
-  -webkit-animation-duration: 0.81s;
-          animation-duration: 0.81s;
+  -webkit-animation-delay: 0.47s;
+          animation-delay: 0.47s;
+  -webkit-animation-duration: 0.89s;
+          animation-duration: 0.89s;
 }
 
 .ball-grid-pulse > div:nth-child(7) {
-  -webkit-animation-delay: 0.31s;
-          animation-delay: 0.31s;
-  -webkit-animation-duration: 1.08s;
-          animation-duration: 1.08s;
+  -webkit-animation-delay: -0.14s;
+          animation-delay: -0.14s;
+  -webkit-animation-duration: 1.31s;
+          animation-duration: 1.31s;
 }
 
 .ball-grid-pulse > div:nth-child(8) {
-  -webkit-animation-delay: -0.1s;
-          animation-delay: -0.1s;
-  -webkit-animation-duration: 0.73s;
-          animation-duration: 0.73s;
+  -webkit-animation-delay: -0.01s;
+          animation-delay: -0.01s;
+  -webkit-animation-duration: 1.21s;
+          animation-duration: 1.21s;
 }
 
 .ball-grid-pulse > div:nth-child(9) {
-  -webkit-animation-delay: -0.12s;
-          animation-delay: -0.12s;
-  -webkit-animation-duration: 1.19s;
-          animation-duration: 1.19s;
+  -webkit-animation-delay: 0.35s;
+          animation-delay: 0.35s;
+  -webkit-animation-duration: 1.12s;
+          animation-duration: 1.12s;
 }
 
 .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.7s;
-          animation-delay: 0.7s;
-  -webkit-animation-duration: 0.76s;
-          animation-duration: 0.76s;
+  -webkit-animation-delay: 0.11s;
+          animation-delay: 0.11s;
+  -webkit-animation-duration: 0.36s;
+          animation-duration: 0.36s;
 }
 
 .line-scale-party > div:nth-child(2) {
-  -webkit-animation-delay: -0.17s;
-          animation-delay: -0.17s;
-  -webkit-animation-duration: 0.43s;
-          animation-duration: 0.43s;
+  -webkit-animation-delay: -0.11s;
+          animation-delay: -0.11s;
+  -webkit-animation-duration: 1.14s;
+          animation-duration: 1.14s;
 }
 
 .line-scale-party > div:nth-child(3) {
-  -webkit-animation-delay: 0.07s;
-          animation-delay: 0.07s;
-  -webkit-animation-duration: 0.94s;
-          animation-duration: 0.94s;
+  -webkit-animation-delay: 0.67s;
+          animation-delay: 0.67s;
+  -webkit-animation-duration: 0.98s;
+          animation-duration: 0.98s;
 }
 
 .line-scale-party > div:nth-child(4) {
-  -webkit-animation-delay: -0.06s;
-          animation-delay: -0.06s;
-  -webkit-animation-duration: 0.54s;
-          animation-duration: 0.54s;
+  -webkit-animation-delay: 0.46s;
+          animation-delay: 0.46s;
+  -webkit-animation-duration: 0.32s;
+          animation-duration: 0.32s;
 }
 
 .line-scale-party > div {

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

@@ -1454,66 +1454,66 @@
 }
 
 .ball-grid-beat > div:nth-child(1) {
-  -webkit-animation-delay: 0.22s;
-          animation-delay: 0.22s;
-  -webkit-animation-duration: 0.79s;
-          animation-duration: 0.79s;
+  -webkit-animation-delay: -0.18s;
+          animation-delay: -0.18s;
+  -webkit-animation-duration: 1.43s;
+          animation-duration: 1.43s;
 }
 
 .ball-grid-beat > div:nth-child(2) {
-  -webkit-animation-delay: 0.05s;
-          animation-delay: 0.05s;
-  -webkit-animation-duration: 0.84s;
-          animation-duration: 0.84s;
+  -webkit-animation-delay: 0.35s;
+          animation-delay: 0.35s;
+  -webkit-animation-duration: 1.22s;
+          animation-duration: 1.22s;
 }
 
 .ball-grid-beat > div:nth-child(3) {
-  -webkit-animation-delay: 0.65s;
-          animation-delay: 0.65s;
-  -webkit-animation-duration: 0.8s;
-          animation-duration: 0.8s;
+  -webkit-animation-delay: 0.54s;
+          animation-delay: 0.54s;
+  -webkit-animation-duration: 1.39s;
+          animation-duration: 1.39s;
 }
 
 .ball-grid-beat > div:nth-child(4) {
-  -webkit-animation-delay: 0.22s;
-          animation-delay: 0.22s;
-  -webkit-animation-duration: 1.06s;
-          animation-duration: 1.06s;
+  -webkit-animation-delay: 0.73s;
+          animation-delay: 0.73s;
+  -webkit-animation-duration: 1.1s;
+          animation-duration: 1.1s;
 }
 
 .ball-grid-beat > div:nth-child(5) {
-  -webkit-animation-delay: 0.38s;
-          animation-delay: 0.38s;
-  -webkit-animation-duration: 1.19s;
-          animation-duration: 1.19s;
+  -webkit-animation-delay: 0.65s;
+          animation-delay: 0.65s;
+  -webkit-animation-duration: 0.77s;
+          animation-duration: 0.77s;
 }
 
 .ball-grid-beat > div:nth-child(6) {
-  -webkit-animation-delay: 0.56s;
-          animation-delay: 0.56s;
-  -webkit-animation-duration: 1.26s;
-          animation-duration: 1.26s;
+  -webkit-animation-delay: 0.62s;
+          animation-delay: 0.62s;
+  -webkit-animation-duration: 0.9s;
+          animation-duration: 0.9s;
 }
 
 .ball-grid-beat > div:nth-child(7) {
-  -webkit-animation-delay: -0.08s;
-          animation-delay: -0.08s;
-  -webkit-animation-duration: 0.68s;
-          animation-duration: 0.68s;
+  -webkit-animation-delay: 0.69s;
+          animation-delay: 0.69s;
+  -webkit-animation-duration: 1.53s;
+          animation-duration: 1.53s;
 }
 
 .ball-grid-beat > div:nth-child(8) {
-  -webkit-animation-delay: 0.14s;
-          animation-delay: 0.14s;
-  -webkit-animation-duration: 0.89s;
-          animation-duration: 0.89s;
+  -webkit-animation-delay: 0.63s;
+          animation-delay: 0.63s;
+  -webkit-animation-duration: 0.97s;
+          animation-duration: 0.97s;
 }
 
 .ball-grid-beat > div:nth-child(9) {
-  -webkit-animation-delay: -0.17s;
-          animation-delay: -0.17s;
-  -webkit-animation-duration: 1.47s;
-          animation-duration: 1.47s;
+  -webkit-animation-delay: 0.44s;
+          animation-delay: 0.44s;
+  -webkit-animation-duration: 0.92s;
+          animation-duration: 0.92s;
 }
 
 .ball-grid-beat > div {
@@ -1575,66 +1575,66 @@
 }
 
 .ball-grid-pulse > div:nth-child(1) {
-  -webkit-animation-delay: 0.14s;
-          animation-delay: 0.14s;
-  -webkit-animation-duration: 0.9s;
-          animation-duration: 0.9s;
+  -webkit-animation-delay: 0.4s;
+          animation-delay: 0.4s;
+  -webkit-animation-duration: 1s;
+          animation-duration: 1s;
 }
 
 .ball-grid-pulse > div:nth-child(2) {
-  -webkit-animation-delay: -0.16s;
-          animation-delay: -0.16s;
-  -webkit-animation-duration: 1.55s;
-          animation-duration: 1.55s;
+  -webkit-animation-delay: 0.72s;
+          animation-delay: 0.72s;
+  -webkit-animation-duration: 1.19s;
+          animation-duration: 1.19s;
 }
 
 .ball-grid-pulse > div:nth-child(3) {
-  -webkit-animation-delay: -0.04s;
-          animation-delay: -0.04s;
-  -webkit-animation-duration: 1.05s;
-          animation-duration: 1.05s;
+  -webkit-animation-delay: 0.14s;
+          animation-delay: 0.14s;
+  -webkit-animation-duration: 1.18s;
+          animation-duration: 1.18s;
 }
 
 .ball-grid-pulse > div:nth-child(4) {
-  -webkit-animation-delay: 0.04s;
-          animation-delay: 0.04s;
-  -webkit-animation-duration: 1.29s;
-          animation-duration: 1.29s;
+  -webkit-animation-delay: 0.44s;
+          animation-delay: 0.44s;
+  -webkit-animation-duration: 0.84s;
+          animation-duration: 0.84s;
 }
 
 .ball-grid-pulse > div:nth-child(5) {
-  -webkit-animation-delay: 0.6s;
-          animation-delay: 0.6s;
-  -webkit-animation-duration: 0.61s;
-          animation-duration: 0.61s;
+  -webkit-animation-delay: 0.08s;
+          animation-delay: 0.08s;
+  -webkit-animation-duration: 1.09s;
+          animation-duration: 1.09s;
 }
 
 .ball-grid-pulse > div:nth-child(6) {
-  -webkit-animation-delay: 0.06s;
-          animation-delay: 0.06s;
-  -webkit-animation-duration: 0.63s;
-          animation-duration: 0.63s;
+  -webkit-animation-delay: -0.13s;
+          animation-delay: -0.13s;
+  -webkit-animation-duration: 0.86s;
+          animation-duration: 0.86s;
 }
 
 .ball-grid-pulse > div:nth-child(7) {
-  -webkit-animation-delay: 0.41s;
-          animation-delay: 0.41s;
-  -webkit-animation-duration: 1.45s;
-          animation-duration: 1.45s;
+  -webkit-animation-delay: 0.05s;
+          animation-delay: 0.05s;
+  -webkit-animation-duration: 1.43s;
+          animation-duration: 1.43s;
 }
 
 .ball-grid-pulse > div:nth-child(8) {
-  -webkit-animation-delay: 0.76s;
-          animation-delay: 0.76s;
-  -webkit-animation-duration: 1.28s;
-          animation-duration: 1.28s;
+  -webkit-animation-delay: 0.44s;
+          animation-delay: 0.44s;
+  -webkit-animation-duration: 1.51s;
+          animation-duration: 1.51s;
 }
 
 .ball-grid-pulse > div:nth-child(9) {
-  -webkit-animation-delay: 0.66s;
-          animation-delay: 0.66s;
-  -webkit-animation-duration: 1.05s;
-          animation-duration: 1.05s;
+  -webkit-animation-delay: 0.52s;
+          animation-delay: 0.52s;
+  -webkit-animation-duration: 0.61s;
+          animation-duration: 0.61s;
 }
 
 .ball-grid-pulse > div {
@@ -2181,31 +2181,31 @@
 }
 
 .line-scale-party > div:nth-child(1) {
-  -webkit-animation-delay: -0.18s;
-          animation-delay: -0.18s;
-  -webkit-animation-duration: 0.53s;
-          animation-duration: 0.53s;
+  -webkit-animation-delay: 0.43s;
+          animation-delay: 0.43s;
+  -webkit-animation-duration: 0.58s;
+          animation-duration: 0.58s;
 }
 
 .line-scale-party > div:nth-child(2) {
-  -webkit-animation-delay: 0.73s;
-          animation-delay: 0.73s;
-  -webkit-animation-duration: 0.84s;
-          animation-duration: 0.84s;
+  -webkit-animation-delay: -0.14s;
+          animation-delay: -0.14s;
+  -webkit-animation-duration: 1.27s;
+          animation-duration: 1.27s;
 }
 
 .line-scale-party > div:nth-child(3) {
-  -webkit-animation-delay: 0.09s;
-          animation-delay: 0.09s;
-  -webkit-animation-duration: 0.92s;
-          animation-duration: 0.92s;
+  -webkit-animation-delay: 0.69s;
+          animation-delay: 0.69s;
+  -webkit-animation-duration: 1.23s;
+          animation-duration: 1.23s;
 }
 
 .line-scale-party > div:nth-child(4) {
-  -webkit-animation-delay: 0.79s;
-          animation-delay: 0.79s;
-  -webkit-animation-duration: 0.78s;
-          animation-duration: 0.78s;
+  -webkit-animation-delay: 0.23s;
+          animation-delay: 0.23s;
+  -webkit-animation-duration: 0.85s;
+          animation-duration: 0.85s;
 }
 
 .line-scale-party > div {

+ 0 - 0
resources/dist/dcat/css/app.css → resources/dist/dcat/css/dcat-app.css


+ 178 - 11
resources/dist/dcat/js/app.js → resources/dist/dcat/js/dcat-app.js

@@ -196,6 +196,21 @@ var Dcat = /*#__PURE__*/function () {
 
       _window.Dcat.ready(proxy);
     }
+    /**
+     * 主动触发 ready 事件
+     */
+
+  }, {
+    key: "triggerReady",
+    value: function triggerReady() {
+      if (!_pjaxResponded) {
+        return;
+      }
+
+      $(function () {
+        $d.trigger('pjax:loaded');
+      });
+    }
     /**
      * 如果是 pjax 响应的页面,需要调用此方法
      *
@@ -637,10 +652,12 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var _extensions_DialogForm__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./extensions/DialogForm */ "./resources/assets/dcat/js/extensions/DialogForm.js");
 /* harmony import */ var _extensions_Loading__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extensions/Loading */ "./resources/assets/dcat/js/extensions/Loading.js");
 /* harmony import */ var _extensions_PreviewImage__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extensions/PreviewImage */ "./resources/assets/dcat/js/extensions/PreviewImage.js");
-/* harmony import */ var _bootstrappers_Menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./bootstrappers/Menu */ "./resources/assets/dcat/js/bootstrappers/Menu.js");
-/* harmony import */ var _bootstrappers_Footer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./bootstrappers/Footer */ "./resources/assets/dcat/js/bootstrappers/Footer.js");
-/* harmony import */ var _bootstrappers_Pjax__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./bootstrappers/Pjax */ "./resources/assets/dcat/js/bootstrappers/Pjax.js");
-/* harmony import */ var _bootstrappers_DataActions__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./bootstrappers/DataActions */ "./resources/assets/dcat/js/bootstrappers/DataActions.js");
+/* harmony import */ var _extensions_AssetsLoader__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./extensions/AssetsLoader */ "./resources/assets/dcat/js/extensions/AssetsLoader.js");
+/* harmony import */ var _extensions_Slider__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./extensions/Slider */ "./resources/assets/dcat/js/extensions/Slider.js");
+/* harmony import */ var _bootstrappers_Menu__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./bootstrappers/Menu */ "./resources/assets/dcat/js/bootstrappers/Menu.js");
+/* harmony import */ var _bootstrappers_Footer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./bootstrappers/Footer */ "./resources/assets/dcat/js/bootstrappers/Footer.js");
+/* harmony import */ var _bootstrappers_Pjax__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./bootstrappers/Pjax */ "./resources/assets/dcat/js/bootstrappers/Pjax.js");
+/* harmony import */ var _bootstrappers_DataActions__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./bootstrappers/DataActions */ "./resources/assets/dcat/js/bootstrappers/DataActions.js");
 /*=========================================================================================
   File Name: app.js
   Description: Dcat Admin JS脚本.
@@ -665,6 +682,8 @@ __webpack_require__.r(__webpack_exports__);
 
 
 
+
+
 var win = window,
     $ = jQuery; // 扩展Dcat对象
 
@@ -682,7 +701,9 @@ function extend(Dcat) {
 
   new _extensions_Loading__WEBPACK_IMPORTED_MODULE_10__["default"](Dcat); // 图片预览功能
 
-  new _extensions_PreviewImage__WEBPACK_IMPORTED_MODULE_11__["default"](Dcat); // 加载进度条
+  new _extensions_PreviewImage__WEBPACK_IMPORTED_MODULE_11__["default"](Dcat); // 静态资源加载器
+
+  new _extensions_AssetsLoader__WEBPACK_IMPORTED_MODULE_12__["default"](Dcat); // 加载进度条
 
   Dcat.NP = _nprogress_NProgress_min__WEBPACK_IMPORTED_MODULE_1___default.a; // 行选择器
 
@@ -701,7 +722,9 @@ function extend(Dcat) {
   }; // 滑动面板
 
 
-  Dcat.Slider = function (options) {};
+  Dcat.Slider = function (options) {
+    return new _extensions_Slider__WEBPACK_IMPORTED_MODULE_13__["default"](Dcat, options);
+  };
 } // 初始化
 
 
@@ -709,9 +732,9 @@ function listen(Dcat) {
   // 只初始化一次
   Dcat.booting(function () {
     // 菜单点击选中效果
-    new _bootstrappers_Menu__WEBPACK_IMPORTED_MODULE_12__["default"](Dcat); // 返回顶部按钮
+    new _bootstrappers_Menu__WEBPACK_IMPORTED_MODULE_14__["default"](Dcat); // 返回顶部按钮
 
-    new _bootstrappers_Footer__WEBPACK_IMPORTED_MODULE_13__["default"](Dcat); // layer弹窗设置
+    new _bootstrappers_Footer__WEBPACK_IMPORTED_MODULE_15__["default"](Dcat); // layer弹窗设置
 
     layer.config({
       maxmin: true,
@@ -730,9 +753,9 @@ function listen(Dcat) {
 
   Dcat.bootingEveryRequest(function () {
     // pjax初始化功能
-    new _bootstrappers_Pjax__WEBPACK_IMPORTED_MODULE_14__["default"](Dcat); // data-action 动作绑定(包括删除、批量删除等操作)
+    new _bootstrappers_Pjax__WEBPACK_IMPORTED_MODULE_16__["default"](Dcat); // data-action 动作绑定(包括删除、批量删除等操作)
 
-    new _bootstrappers_DataActions__WEBPACK_IMPORTED_MODULE_15__["default"](Dcat);
+    new _bootstrappers_DataActions__WEBPACK_IMPORTED_MODULE_17__["default"](Dcat);
   });
 } // 开始初始化
 
@@ -833,6 +856,130 @@ var Ajax = /*#__PURE__*/function () {
 
 
 
+/***/ }),
+
+/***/ "./resources/assets/dcat/js/extensions/AssetsLoader.js":
+/*!*************************************************************!*\
+  !*** ./resources/assets/dcat/js/extensions/AssetsLoader.js ***!
+  \*************************************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AssetsLoader; });
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
+
+function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
+
+var AssetsLoader = /*#__PURE__*/function () {
+  function AssetsLoader(Dcat) {
+    _classCallCheck(this, AssetsLoader);
+
+    var _this = this;
+
+    _this.dcat = Dcat;
+    Dcat.assets = {
+      // 加载js脚本,并触发 ready 事件
+      loadScripts: _this.load.bind(_this),
+      // 从给定的内容中过滤"<script>"标签内容,并自动加载其中的js脚本
+      filterScriptsAndLoad: _this.filterScriptsAndLoad.bind(_this)
+    };
+  } // 按顺序加载静态资源
+  // 并在所有静态资源加载完毕后执行回调函数
+
+
+  _createClass(AssetsLoader, [{
+    key: "load",
+    value: function load(urls, callback, args) {
+      var _this = this;
+
+      if (urls.length < 1) {
+        !callback || callback(args);
+
+        _this.fire();
+
+        return;
+      }
+
+      seajs.use([urls.shift()], function () {
+        _this.load(urls, callback, args);
+      });
+    } // 过滤 <script src> 标签
+
+  }, {
+    key: "filterScripts",
+    value: function filterScripts(content) {
+      var obj = {};
+
+      if (typeof content == 'string') {
+        content = $(content);
+      }
+
+      obj.scripts = this.findAll(content, 'script[src]').remove();
+      obj.contents = content.not(obj.scripts);
+      obj.contents.render = this.toString;
+
+      obj.js = function () {
+        var urls = [];
+        obj.scripts.each(function (k, v) {
+          if (v.src) {
+            urls.push(v.src);
+          }
+        });
+        return urls;
+      }();
+
+      return obj;
+    } // 返回过滤 <script src> 标签后的内容,并在加载完 script 脚本后触发 "pjax:script" 事件
+
+  }, {
+    key: "filterScriptsAndLoad",
+    value: function filterScriptsAndLoad(content, callback) {
+      var obj = this.filterScripts(content);
+      this.load(obj.js, function () {
+        !callback || callback(obj.contents);
+      });
+      return obj.contents;
+    }
+  }, {
+    key: "findAll",
+    value: function findAll(elems, selector) {
+      if (typeof elems == 'string') {
+        elems = $(elems);
+      }
+
+      return elems.filter(selector).add(elems.find(selector));
+    }
+  }, {
+    key: "fire",
+    value: function fire() {
+      this.dcat.pjaxResponded(); // js加载完毕 触发 ready 事件
+      // setTimeout用于保证在所有js代码最后执行
+
+      setTimeout(this.dcat.triggerReady, 1);
+    }
+  }, {
+    key: "toString",
+    value: function toString(th) {
+      var html = '',
+          out;
+      this.each(function (k, v) {
+        if (out = v.outerHTML) {
+          html += out;
+        }
+      });
+      return html;
+    }
+  }]);
+
+  return AssetsLoader;
+}();
+
+
+
 /***/ }),
 
 /***/ "./resources/assets/dcat/js/extensions/Debounce.js":
@@ -1132,7 +1279,7 @@ var DialogForm = /*#__PURE__*/function () {
       var _this = this,
           options = _this.options;
 
-      tpl = LA.AssetsLoader.filterScriptAndAutoLoad(tpl).render();
+      tpl = Dcat.assets.filterScriptsAndLoad(tpl).render();
       var $template = $(tpl),
           btns = [options.lang.submit],
           dialogOpts = {
@@ -2218,6 +2365,26 @@ var RowSelector = /*#__PURE__*/function () {
 
 
 
+/***/ }),
+
+/***/ "./resources/assets/dcat/js/extensions/Slider.js":
+/*!*******************************************************!*\
+  !*** ./resources/assets/dcat/js/extensions/Slider.js ***!
+  \*******************************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+__webpack_require__.r(__webpack_exports__);
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Slider; });
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Slider = function Slider(options) {
+  _classCallCheck(this, Slider);
+};
+
+
+
 /***/ }),
 
 /***/ "./resources/assets/dcat/js/extensions/SweetAlert2.js":

+ 2 - 2
src/Controllers/MenuController.php

@@ -47,7 +47,7 @@ class MenuController extends AdminController
 
                     $form->select('parent_id', trans('admin.parent_id'))->options($menuModel::selectOptions());
                     $form->text('title', trans('admin.title'))->required();
-                    $form->icon('icon', trans('admin.icon'))->help($this->iconHelp());
+                    $form->text('icon', trans('admin.icon'))->help($this->iconHelp());
                     $form->text('uri', trans('admin.uri'));
                     $form->multipleSelect('roles', trans('admin.roles'))
                         ->options($roleModel::all()->pluck('name', 'id'));
@@ -117,7 +117,7 @@ class MenuController extends AdminController
             return $menuModel::selectOptions();
         });
         $form->text('title', trans('admin.title'))->required();
-        $form->icon('icon', trans('admin.icon'))->help($this->iconHelp());
+        $form->text('icon', trans('admin.icon'))->help($this->iconHelp());
         $form->text('uri', trans('admin.uri'));
         $form->multipleSelect('roles', trans('admin.roles'))
             ->options(function () use ($roleModel) {

+ 0 - 1
src/Form/Field/Tree.php

@@ -283,7 +283,6 @@ class Tree extends Field
 
     public static function collectAssets()
     {
-        Admin::css('vendor/dcat-admin/jstree-theme/themes/proton/style.min.css');
         Admin::collectAssets('jstree');
     }
 }

+ 0 - 1
src/Grid/Displayers/DialogTree.php

@@ -269,7 +269,6 @@ JS
 
     protected function collectAssets()
     {
-        Admin::css('vendor/dcat-admin/jstree-theme/themes/proton/style.min.css');
         Admin::collectAssets('jstree');
     }
 }

+ 6 - 2
src/Layout/Assets.php

@@ -29,7 +29,7 @@ class Assets
      */
     protected $headerJs = [
         'vendors' => 'dcat-admin/vendors/js/vendors.min.js',
-        'dcat'    => 'dcat-admin/dcat/js/app.js',
+        'dcat'    => 'dcat-admin/dcat/js/dcat-app.js',
     ];
 
     /**
@@ -48,7 +48,7 @@ class Assets
         'datatables' => 'dcat-admin/vendors/css/tables/datatable/datatables.min.css',
         'data-list-view' => 'dcat-admin/css/pages/data-list-view.css',
 
-        'dcat'               => 'dcat-admin/dcat/css/app.css',
+        'dcat'               => 'dcat-admin/dcat/css/dcat-app.css',
     ];
 
     /**
@@ -82,6 +82,10 @@ class Assets
             'js'  => 'dcat-admin/dcat/plugins/RWD-Table-Patterns/dist/js/rwd-table.min.js',
             'css' => 'dcat-admin/dcat/plugins/RWD-Table-Patterns/dist/css/rwd-table.min.css',
         ],
+        'jstree' => [
+            'js'  => 'dcat-admin/dcat/plugins/jstree-theme/jstree.min.js',
+            'css' => 'dcat-admin/dcat/plugins/jstree-theme/themes/proton/style.min.css',
+        ],
     ];
 
     /**

+ 0 - 1
src/Widgets/Tree.php

@@ -172,7 +172,6 @@ class Tree extends Widget
 
     protected function collectAssets()
     {
-        Admin::css('vendor/dcat-admin/jstree-theme/themes/proton/style.min.css');
         Admin::collectAssets('jstree');
     }
 }

+ 2 - 2
webpack.mix.js

@@ -75,9 +75,9 @@ function dcat_dist_path(path) {
 // 复制第三方插件文件夹
 mix.copyDirectory(dcat_path('plugins'), dcat_dist_path('plugins'));
 // 打包app.js
-mix.js(dcat_path('js/dcat-app.js'), dcat_dist_path('js/app.js'));
+mix.js(dcat_path('js/dcat-app.js'), dcat_dist_path('js/dcat-app.js'));
 // 打包app.scss
-mix.sass(dcat_path('sass/dcat-app.scss'), dcat_dist_path('css/app.css'));
+mix.sass(dcat_path('sass/dcat-app.scss'), dcat_dist_path('css/dcat-app.css'));
 
 // 打包所有 extra 里面的所有js
 mixAssetsDir('dcat/extra/*.js', (src, dest) => mix.scripts(src, dest));