瀏覽代碼

add loading

cnwangzd@gmail.com 3 年之前
父節點
當前提交
3b90a29108
共有 34 個文件被更改,包括 115 次插入379 次删除
  1. 2 2
      .env
  2. 0 1
      app/matrix/m3graph/css/app.2221e2fe.css
  3. 0 1
      app/matrix/m3graph/css/chunk-9c357886.f34c210c.css
  4. 5 1
      app/matrix/m3graph/index.html
  5. 0 1
      app/matrix/m3graph/js/app.4c485efc.js
  6. 二進制
      app/matrix/m3graph/js/app.4c485efc.js.gz
  7. 0 1
      app/matrix/m3graph/js/chunk-0177309a.2d82d6d3.js
  8. 0 1
      app/matrix/m3graph/js/chunk-03b92cd2.24e0256e.js
  9. 二進制
      app/matrix/m3graph/js/chunk-03b92cd2.24e0256e.js.gz
  10. 0 1
      app/matrix/m3graph/js/chunk-2138c456.96759e07.js
  11. 0 1
      app/matrix/m3graph/js/chunk-2d0ac5e8.48906a88.js
  12. 0 1
      app/matrix/m3graph/js/chunk-2d0c0887.8f21bd4e.js
  13. 0 1
      app/matrix/m3graph/js/chunk-2d22ce19.a6e6fba3.js
  14. 0 1
      app/matrix/m3graph/js/chunk-2dc3fc5a.52b32d60.js
  15. 0 16
      app/matrix/m3graph/js/chunk-48a6f8ec.c68ace52.js
  16. 二進制
      app/matrix/m3graph/js/chunk-48a6f8ec.c68ace52.js.gz
  17. 0 1
      app/matrix/m3graph/js/chunk-4cc4398c.28bb140f.js
  18. 二進制
      app/matrix/m3graph/js/chunk-4cc4398c.28bb140f.js.gz
  19. 0 1
      app/matrix/m3graph/js/chunk-56d2fb7a.3dacdd59.js
  20. 二進制
      app/matrix/m3graph/js/chunk-56d2fb7a.3dacdd59.js.gz
  21. 0 1
      app/matrix/m3graph/js/chunk-5fc0673c.dc5e0509.js
  22. 0 1
      app/matrix/m3graph/js/chunk-8485aeaa.dc613aa8.js
  23. 二進制
      app/matrix/m3graph/js/chunk-8485aeaa.dc613aa8.js.gz
  24. 0 1
      app/matrix/m3graph/js/chunk-8abc52c6.1ae94a51.js
  25. 0 7
      app/matrix/m3graph/js/chunk-9c357886.aa06c966.js
  26. 二進制
      app/matrix/m3graph/js/chunk-9c357886.aa06c966.js.gz
  27. 0 1
      app/matrix/m3graph/js/chunk-f70f7096.937f5905.js
  28. 0 320
      app/matrix/m3graph/js/chunk-vendors.a808be08.js
  29. 二進制
      app/matrix/m3graph/js/chunk-vendors.a808be08.js.gz
  30. 6 6
      package-lock.json
  31. 67 0
      public/assets/css/loading.css
  32. 16 1
      public/index.html
  33. 18 7
      src/App.vue
  34. 1 3
      src/main.js

+ 2 - 2
.env

@@ -1,6 +1,6 @@
 VUE_APP_M3_APP="m3graph"
 VUE_APP_M3_TITLE="图查询"
 VUE_APP_M3_HOST="47.92.151.165:8080"
-VUE_APP_M3_COMPANY="wecise"
+VUE_APP_M3_COMPANY="eventbus"
 VUE_APP_M3_USERNAME="admin"
-VUE_APP_M3_PASSWORD="admin1234)(*&"
+VUE_APP_M3_PASSWORD="admin"

文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/css/app.2221e2fe.css


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/css/chunk-9c357886.f34c210c.css


文件差異過大導致無法顯示
+ 5 - 1
app/matrix/m3graph/index.html


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/app.4c485efc.js


二進制
app/matrix/m3graph/js/app.4c485efc.js.gz


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-0177309a.2d82d6d3.js


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-03b92cd2.24e0256e.js


二進制
app/matrix/m3graph/js/chunk-03b92cd2.24e0256e.js.gz


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-2138c456.96759e07.js


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-2d0ac5e8.48906a88.js


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-2d0c0887.8f21bd4e.js


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-2d22ce19.a6e6fba3.js


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-2dc3fc5a.52b32d60.js


文件差異過大導致無法顯示
+ 0 - 16
app/matrix/m3graph/js/chunk-48a6f8ec.c68ace52.js


二進制
app/matrix/m3graph/js/chunk-48a6f8ec.c68ace52.js.gz


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-4cc4398c.28bb140f.js


二進制
app/matrix/m3graph/js/chunk-4cc4398c.28bb140f.js.gz


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-56d2fb7a.3dacdd59.js


二進制
app/matrix/m3graph/js/chunk-56d2fb7a.3dacdd59.js.gz


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-5fc0673c.dc5e0509.js


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-8485aeaa.dc613aa8.js


二進制
app/matrix/m3graph/js/chunk-8485aeaa.dc613aa8.js.gz


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-8abc52c6.1ae94a51.js


文件差異過大導致無法顯示
+ 0 - 7
app/matrix/m3graph/js/chunk-9c357886.aa06c966.js


二進制
app/matrix/m3graph/js/chunk-9c357886.aa06c966.js.gz


文件差異過大導致無法顯示
+ 0 - 1
app/matrix/m3graph/js/chunk-f70f7096.937f5905.js


文件差異過大導致無法顯示
+ 0 - 320
app/matrix/m3graph/js/chunk-vendors.a808be08.js


二進制
app/matrix/m3graph/js/chunk-vendors.a808be08.js.gz


+ 6 - 6
package-lock.json

@@ -2413,9 +2413,9 @@
       }
     },
     "node_modules/@wecise/m3js": {
-      "version": "1.0.40",
-      "resolved": "https://registry.npmjs.org/@wecise/m3js/-/m3js-1.0.40.tgz",
-      "integrity": "sha512-ftRMRZ83wtzz9Zx8NISEr9nBGaEWwNyoat9Sy4iG0tRADZQ9/OkRu5aEEjaNkT9UrhdOKZ2/tY7FNYhxep56LA==",
+      "version": "1.0.45",
+      "resolved": "https://registry.npmjs.org/@wecise/m3js/-/m3js-1.0.45.tgz",
+      "integrity": "sha512-532w4BFKJ2ObbkdOmjJjAo3Dlqo8cybHVNFXPT6vWFby/L0VTVze+JpNOBFZYnyrZVTIkjWB2ob2EcTXYNr+UQ==",
       "dependencies": {
         "@wecise/m3js": "^1.0.0"
       }
@@ -20647,9 +20647,9 @@
       }
     },
     "@wecise/m3js": {
-      "version": "1.0.40",
-      "resolved": "https://registry.npmjs.org/@wecise/m3js/-/m3js-1.0.40.tgz",
-      "integrity": "sha512-ftRMRZ83wtzz9Zx8NISEr9nBGaEWwNyoat9Sy4iG0tRADZQ9/OkRu5aEEjaNkT9UrhdOKZ2/tY7FNYhxep56LA==",
+      "version": "1.0.45",
+      "resolved": "https://registry.npmjs.org/@wecise/m3js/-/m3js-1.0.45.tgz",
+      "integrity": "sha512-532w4BFKJ2ObbkdOmjJjAo3Dlqo8cybHVNFXPT6vWFby/L0VTVze+JpNOBFZYnyrZVTIkjWB2ob2EcTXYNr+UQ==",
       "requires": {
         "@wecise/m3js": "^1.0.0"
       }

+ 67 - 0
public/assets/css/loading.css

@@ -0,0 +1,67 @@
+.lds-grid {
+    position: inherit;
+    width: 80px;
+    height: 80px;
+  }
+  .lds-grid div {
+    position: absolute;
+    width: 16px;
+    height: 16px;
+    border-radius: 50%;
+    background: #737374;
+    animation: lds-grid 1.2s linear infinite;
+  }
+  .lds-grid div:nth-child(1) {
+    top: 8px;
+    left: 8px;
+    animation-delay: 0s;
+  }
+  .lds-grid div:nth-child(2) {
+    top: 8px;
+    left: 32px;
+    animation-delay: -0.4s;
+  }
+  .lds-grid div:nth-child(3) {
+    top: 8px;
+    left: 56px;
+    animation-delay: -0.8s;
+  }
+  .lds-grid div:nth-child(4) {
+    top: 32px;
+    left: 8px;
+    animation-delay: -0.4s;
+  }
+  .lds-grid div:nth-child(5) {
+    top: 32px;
+    left: 32px;
+    animation-delay: -0.8s;
+  }
+  .lds-grid div:nth-child(6) {
+    top: 32px;
+    left: 56px;
+    animation-delay: -1.2s;
+  }
+  .lds-grid div:nth-child(7) {
+    top: 56px;
+    left: 8px;
+    animation-delay: -0.8s;
+  }
+  .lds-grid div:nth-child(8) {
+    top: 56px;
+    left: 32px;
+    animation-delay: -1.2s;
+  }
+  .lds-grid div:nth-child(9) {
+    top: 56px;
+    left: 56px;
+    animation-delay: -1.6s;
+  }
+  @keyframes lds-grid {
+    0%, 100% {
+      opacity: 1;
+    }
+    50% {
+      opacity: 0.5;
+    }
+  }
+  

+ 16 - 1
public/index.html

@@ -6,12 +6,27 @@
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= htmlWebpackPlugin.options.title %></title>
+    <link rel="stylesheet" type="text/css" href="/static/app/matrix/<%= process.env.VUE_APP_M3_APP %>/assets/css/loading.css" />
+    <script>
+        window.timeStart=window.timePhase=Date.now();
+        Date.prototype.format=function(f){var o={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"S":this.getMilliseconds()};if(/(y+)/.test(f))f=f.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length));for(var k in o)if(new RegExp("("+k+")").test(f))f=f.replace(RegExp.$1,RegExp.$1.length==1?o[k]:("00"+ o[k]).substr((""+ o[k]).length));return f}
+        console.odebug=console.debug;console.debug=function(){var t=Date.now();console.odebug.call(this,new Date().format("yyyy-MM-dd hh:mm:ss.S"),"("+(t-window.timePhase)+"/"+(t-window.timeStart)+")",...arguments)}
+        window.state=(s)=>{if(s){console.debug("[M3S]",s);e=document.getElementById("preload_message");if(e)e.innerHTML=s}window.timePhase=Date.now()}
+        window.state("正在加载页面...")
+    </script>
   </head>
   <body>
     <noscript>
       <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
     </noscript>
-    <div id="app"></div>
+    <div id="app">
+      <div id="preload" style="width:100vw;height:100vh;display:block;font-size:10px;">
+        <div style="width:100vw;height:80vh;display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;position:relative;">
+            <div class="lds-grid"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
+            <label id="preload_message" style="flex:0 0 auto;">正在加载页面...</label>
+        </div>
+    </div>
+    </div>
     <!-- built files will be auto injected -->
   </body>
 </html>

+ 18 - 7
src/App.vue

@@ -1,11 +1,11 @@
 <template>
-  <div class="m3" v-if="auth && auth.signedUser">
+  <div class="m3" v-if="auth">
     <Header :auth="auth.signedUser" class="header"></Header>
     <div class="main">
       <SideBar class="sidebar" :auth="auth.signedUser" :global="global"></SideBar>
       <MainView :auth="auth" :global="global" class="content"></MainView>
     </div>
-    <Footer :auth="auth" v-if="auth && layout.footer.show"></Footer>
+    <Footer :auth="auth" v-if="layout.footer.show"></Footer>
   </div>
 </template>
 
@@ -42,11 +42,22 @@ export default {
     }
   },
   created(){
-    setTimeout(()=>{
-      this.global = this.m3.global;
-      this.auth = this.m3.auth;
-    },500)
-      
+    let init = ()=>{
+        let timer = setInterval(()=>{
+          try{
+            this.m3.init();
+            window.global = this.global = this.m3.global;
+            this.auth = this.m3.auth;
+            if(this.m3.auth && this.m3.global){
+              clearTimeout(timer);
+            }
+          }catch(err){
+            console.error(err);
+          }
+        },200);
+    };
+    
+    init();
   }
 }
 </script>

+ 1 - 3
src/main.js

@@ -53,7 +53,5 @@ if(process.env.NODE_ENV === "development"){
   
 } else {
   m3.init();
-  setTimeout(()=>{
-    init();
-  },1000)
+  init();
 }