Bläddra i källkod

优化加载中效果

songxy 1 månad sedan
förälder
incheckning
bc5025ec23

+ 8 - 1
web_ui/config/index.js

@@ -13,7 +13,14 @@ module.exports = {
     proxyTable: {
       '/landsiteai': {
         // target: 'http://lq.lianqiai.cn:23001',
-        target: 'https://ai.zrzyt.zj.gov.cn/landsiteai/',
+        target: 'https://ai.zrzyt.zj.gov.cn:10086/landsiteai',
+        // target: 'http://localhost:8511',
+        // ws: true,
+        // onProxyRes: function(proxyRes, req, res) {
+        //   proxyRes.headers['connection'] = 'keep-alive';
+        //   proxyRes.headers['cache-control'] = 'no-cache';
+        //   proxyRes.headers['content-type'] = 'text/event-stream';
+        // },
         // target: 'http://localhost:8511',
         changeOrigin: true,
         pathRewrite: {

+ 3 - 3
web_ui/src/components/ALoading.vue

@@ -15,12 +15,12 @@ export default {
 <style lang='scss' scoped>
 .dots {
   width: 100%;
-  text-align: center;
+  text-align: left;
   padding: 10px 0px;
   opacity: 0.6;
   .wave-dot {
-    width: 8px;
-    height: 8px;
+    width: 12px;
+    height: 12px;
     border-radius: 50%;
     display: inline-block;
     animation: wave 1.2s ease-in-out infinite;

+ 8 - 2
web_ui/src/views/industrial-land/AiIndustriaLandDetail.vue

@@ -1814,7 +1814,13 @@ export default {
       });
 
       // Setup request
-      this.loading = true;
+      let isMessage = false
+      const timer1 = setTimeout(() => {
+        if (!isMessage) {
+          this.loading = true
+        }
+        clearTimeout(timer1)
+      }, 1000)
       this.startTime = new Date().getTime();
       this.checkInterval = setInterval(() => {
         this.checkTimeOut();
@@ -1845,7 +1851,7 @@ export default {
           },
           onmessage(event) {
             try {
-              console.log(event.data);
+              isMessage = true
               const data = JSON.parse(event.data);
               let contentToAdd = "";
               switch (data.type) {

+ 3 - 3
web_ui/static/config.js

@@ -1,6 +1,6 @@
 (function (window) {
-  // const landsiteai_base_url = '/landsiteai'
-  const landsiteai_base_url = 'http://localhost:8521'
+  const landsiteai_base_url = '/landsiteai'
+  // const landsiteai_base_url = 'http://localhost:8521'
   window.ApplicationConfig = {
     serverURL: "/server",
     // ===================== 订阅与推送服务 (8511) =====================
@@ -13,7 +13,7 @@
     yjjbntQueryUrl: 'http://localhost:8511/yjjbntQuery', // 永久基本农田查询
 
     // ===================== 分析与AI服务 (8521) =====================
-    landAnalysisUrl: `${landsiteai_base_url}/land_analysis/stream`, // 土地分析流
+    landAnalysisUrl: `https://ai.zrzyt.zj.gov.cn:10086/landsiteai/land_analysis/stream`, // 土地分析流
     kgQueryUrl: `${landsiteai_base_url}/kg-query`, // 知识图谱查询
     klyzyQueryUrl: `${landsiteai_base_url}/klyzy-query`, // 耕地利用状况查询
     populationQueryUrl: `${landsiteai_base_url}/population`, // 人口查询