From 54849757852f6ab40eb17afbd03d1d839b60a38d Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 13 Nov 2023 17:09:15 +0800
Subject: [PATCH] 重复定时和连续执行

---
 src/store/map.ts |   37 ++++++++++++++++++++++++++++++++++---
 1 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/src/store/map.ts b/src/store/map.ts
index cf6b163..e20f151 100644
--- a/src/store/map.ts
+++ b/src/store/map.ts
@@ -1,5 +1,36 @@
-const map = {
-  state: {
-
+import { MutationTree } from 'vuex'
+interface longitude {
+  longitude:number
+  latitude: number
+}
+const state = () => ({
+  // 项目中心点设置
+  centerConfig: {
+    // true为开启在地图中获取坐标
+    type: false,
+    latitude: null as number | null,
+    longitude: null as number | null,
+  },
+  // 项目列表中在地图中展示中心点
+  pointList: [] as longitude[] | [],
+})
+export type RootStateType = ReturnType<typeof state>
+const mutations: MutationTree<RootStateType> = {
+  // 开启设置地图坐标标识
+  SET_CENTER_CONFIG_TYPE (state, type: boolean) {
+    state.centerConfig.type = type
+  },
+  // 设置经纬度
+  SET_CENTER_CONFIG_LATITUDE (state, data:longitude) {
+    state.centerConfig.longitude = data.longitude
+    state.centerConfig.latitude = data.latitude
+  },
+  // 设置项目列表中的中心点
+  SET_POINT_LIST (state, data: longitude[]) {
+    state.pointList = data
   }
 }
+export default {
+  state,
+  mutations
+}

--
Gitblit v1.9.3