多监测点修改

This commit is contained in:
仲么了
2024-02-29 10:31:32 +08:00
parent 0557e71dcb
commit 8175de04bb
4 changed files with 19 additions and 16 deletions

View File

@@ -1,6 +1,5 @@
import { reactive } from 'vue'
import { defineStore } from 'pinia'
interface MonitoringPoint {
lineId: string
lineName: string
@@ -21,9 +20,7 @@ export const useMonitoringPoint = defineStore(
state[key] = val
}
const setShowCheckBox = (val: boolean) => {
if (!val) {
state.lineIds = []
} else {
if (val && state.lineIds.length === 0) {
state.lineIds = [state.lineId]
}
state.showCheckBox = val
@@ -31,6 +28,8 @@ export const useMonitoringPoint = defineStore(
return { state, setValue, setShowCheckBox }
},
{
persist: true
persist: {
paths: ['state.lineId', 'state.lineName']
}
}
)