1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
| /*
| * @Author: shuishen 1109946754@qq.com
| * @Date: 2024-10-28 18:24:16
| * @LastEditors: shuishen 1109946754@qq.com
| * @LastEditTime: 2025-09-07 19:31:33
| * @FilePath: \bigScreen\src\store\map.js
| * @Description:
| *
| * Copyright (c) 2024 by shuishen, All Rights Reserved.
| */
| // src/stores/useUserStore.js
| import { defineStore } from 'pinia'
|
| export const useMap = defineStore('map', {
| // 存储状态的地方,相当于 Vuex 的 state
| state: () => ({
| loadMap: false,
| pointHeight: 64,
| editPoint: false,
| startCustomWx: false,
|
| needSelectID: [],
|
| showPreLevel: false,
|
| rimPosition: {
| lng: '',
| lat: '',
| alt: ''
| }
| }),
|
| // 相当于 Vuex 的 getters,用于计算状态
| getters: {
|
| },
|
| // 相当于 Vuex 的 mutations 和 actions,用于同步或异步地修改状态
| actions: {
| setLoadMap (flag) {
| this.loadMap = flag
| },
|
| setEditPoint (flag) {
| this.editPoint = flag
| },
|
| setStartCustomWx (flag) {
| this.startCustomWx = flag
| },
|
| setNeedSelectID (data) {
| this.needSelectID = data
| },
|
|
| setShowPreLevel (flag) {
| this.showPreLevel = flag
| },
|
| setRimPosition (rimPosition) {
| this.rimPosition = rimPosition
| }
| },
|
| persist: {
| enabled: true,
| strategies: [
| {
| key: 'rimPosition',
| paths: ['rimPosition'],
| storage: localStorage,
| }
| ]
| }
| })
|
|