Browse Source

自动播放

citygis-lhh 3 months ago
parent
commit
8282144e07
2 changed files with 11 additions and 2 deletions
  1. 10 1
      src/stores/mapStore.js
  2. 1 1
      vite.config.js

+ 10 - 1
src/stores/mapStore.js

@@ -104,7 +104,7 @@ export const useMapStore = defineStore('mapStore', () => {
       if (autoNum.value >= timeArr.value.length) {
         autoNum.value = 0;
       }
-    }, 10000);
+    }, 1000);
   };
 
   // 地图地图类型
@@ -270,6 +270,11 @@ export const useMapStore = defineStore('mapStore', () => {
         }
         case '3dChange': {
           initChangeMap(true);
+          break;
+        }
+        case 'autoPlay': {
+          autoPlayFun();
+          break;
         }
       }
     } catch (error) {
@@ -303,6 +308,10 @@ export const useMapStore = defineStore('mapStore', () => {
     } else if (value == '3dChange') {
       change3DTheme(false);
       initChangeMap();
+    } else if (value == 'autoPlay') {
+      autoNum.value = 0;
+      clearInterval(timeInterval.value);
+      timeInterval.value = null;
     } else {
       closePoint(value);
     }

+ 1 - 1
vite.config.js

@@ -11,7 +11,7 @@ export default defineConfig({
     proxy: {
       '/api': {
         //apiTest是自行设置的请求前缀,按照这个来匹配请求,有这个字段的请求,就会进到代理来
-        target: 'http://10.1.161.183:7878/', // 需要代理的域名
+        target: 'http://10.1.163.187:7878/', // 需要代理的域名
         secure: false,
         changeOrigin: true,
         rewrite: (path) => path.replace(/^\/api/, '') //重写匹配的字段,如果不需要放在请求路径上,可以重写为""