citygis-lhh 5 months ago
parent
commit
4c077fa3af

+ 4 - 0
public/config.js

@@ -6,3 +6,7 @@ window.CityGisHtml =
   '/vmap/GIS.html?appKey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBsaWNhdGlvbl9pZCI6MzMsImFwcGxpY2F0aW9uX25hbWUiOiLmjZ_ogJciLCJleHAiOjE3NTIyMTgwNDZ9.3ZomslkPrbBJ2xmI0QFyaRPuL21cjuFoijDrkPazb8s&debug=false&maptype=25d&code=city&devicetype=lg&themeid=Gis&mapthemeid=undefined';
 window.VITE_BASE_API = '/api';
 window.VITE_CityGIS_API = '/cityGIsApi';
+//浅色底图name
+window.lightTheme = 'yaogantheme';
+//深色底图name
+window.darkTheme = 'basetheme';

+ 1 - 1
src/components/map/GisMap.vue

@@ -85,7 +85,7 @@ onMounted(() => {
                 addTrajectory(res.data || [], id);
                 mapStore.pushFlowCarList('car_layer' + id);
                 setTimeout(() => {
-                  playTrajectory(id);
+                  playTrajectory(id, 60, mapStore.mapTheme == 'light' ? 'green' : 'red');
                 }, 2000);
               }
             } catch (error) {

+ 3 - 1
src/stores/drawPointManage.js

@@ -1,7 +1,9 @@
 import { ref, watch } from 'vue';
 import { defineStore } from 'pinia';
 import { addPoint, addPolyLine, addTrajectory, playTrajectory } from '@/utils/map/mapOperation.js';
+import { useMapStore } from './mapStore';
 export const useDrawPointStore = defineStore('drawPointStore', () => {
+  const mapStore = useMapStore();
   //当前患者绘制点位列表
   const currentDrawPointList = ref([]);
 
@@ -50,7 +52,7 @@ export const useDrawPointStore = defineStore('drawPointStore', () => {
         addPoint(pointList, 'drawPoint');
         addTrajectory(pointList, 'drawLine');
         setTimeout(() => {
-          playTrajectory('drawLine', 160);
+          playTrajectory('drawLine', 160, mapStore.mapTheme == 'light' ? 'green' : 'red');
         }, 1000);
       }
     },

+ 1 - 6
src/stores/mapStore.js

@@ -18,7 +18,7 @@ export const useMapStore = defineStore('mapStore', () => {
   //当前病例点位列表
   const currentToolSelectArray = ref(['newAdress', 'touch']);
 
-  const mapTheme = ref('base');
+  const mapTheme = ref('dark');
 
   //区选择
   const selectPartKey = ref('松江区');
@@ -148,11 +148,6 @@ export const useMapStore = defineStore('mapStore', () => {
             });
           }
           initChangeMap(true);
-          //流调会商车图标
-          // addTrajectory();
-          // setTimeout(() => {
-          //   playTrajectory();
-          // }, 2000);
           break;
         }
         case 'Bidding': {

+ 4 - 2
src/views/DataCenterGis/DataCenterGis.vue

@@ -39,6 +39,7 @@ import { ArrowDown, Setting } from '@element-plus/icons-vue';
 import { ThemeChange } from '@/utils/map/mapOperation';
 import { useMapStore } from '@/stores/mapStore';
 console.log(1);
+const mapStore = useMapStore();
 const sizeType = ref('default');
 const step = ref(0);
 const drawerVisible = ref(false);
@@ -47,9 +48,10 @@ const marks = reactive({
   50: '大',
   100: '超大'
 });
-
+//'basetheme','yaogantheme'
 const changeTheme = (val) => {
-  ThemeChange(val == '浅色' ? 'basetheme' : 'yaogantheme');
+  ThemeChange(val == '浅色' ? window.lightTheme : window.darkTheme);
+  mapStore.mapTheme = val == '浅色' ? 'light' : 'dark';
 };
 
 watch(