You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
2.2 KiB
103 lines
2.2 KiB
import { defineStore } from 'pinia'
|
|
export const useEchartsStore = defineStore({
|
|
id: 'echarts', // id必填,且需要唯一
|
|
// state
|
|
state: () => {
|
|
return {
|
|
binCharts: {},
|
|
envir1Charts: {},
|
|
envir2Charts: {},
|
|
}
|
|
},
|
|
// actions
|
|
actions: {
|
|
updateBinCharts(binCharts) {
|
|
this.binCharts = binCharts
|
|
},
|
|
updateEnvir1Charts(envir1Charts) {
|
|
this.envir1Charts = envir1Charts
|
|
},
|
|
updateEnvir2Charts(envir2Charts) {
|
|
this.envir2Charts = envir2Charts
|
|
},
|
|
},
|
|
getters: {
|
|
abscissaFormater(state) {
|
|
let arr = []
|
|
Object.keys(state.binCharts).map((item, index) => {
|
|
arr.push(`${index}-${item}`)
|
|
})
|
|
return arr
|
|
},
|
|
binTemp(state) {
|
|
let arr = []
|
|
Object.values(state.binCharts).map(item => {
|
|
arr.push(item[0])
|
|
})
|
|
return arr
|
|
},
|
|
binHumidity(state) {
|
|
let arr = []
|
|
Object.values(state.binCharts).map(item => {
|
|
arr.push(item[1])
|
|
})
|
|
return arr
|
|
},
|
|
binHP(state) {
|
|
let arr = []
|
|
Object.values(state.binCharts).map(item => {
|
|
arr.push(item[2])
|
|
})
|
|
return arr
|
|
},
|
|
binSaturation(state) {
|
|
let arr = []
|
|
Object.values(state.binCharts).map(item => {
|
|
arr.push(item[3])
|
|
})
|
|
return arr
|
|
},
|
|
envir1Temp(state) {
|
|
let arr = []
|
|
Object.values(state.envir1Charts).map(item => {
|
|
arr.push(item[0])
|
|
})
|
|
return arr
|
|
},
|
|
envir1Humidity(state) {
|
|
let arr = []
|
|
Object.values(state.envir1Charts).map(item => {
|
|
arr.push(item[1])
|
|
})
|
|
return arr
|
|
},
|
|
envir1HP(state) {
|
|
let arr = []
|
|
Object.values(state.envir1Charts).map(item => {
|
|
arr.push(item[2])
|
|
})
|
|
return arr
|
|
},
|
|
envir2Temp(state) {
|
|
let arr = []
|
|
Object.values(state.envir2Charts).map(item => {
|
|
arr.push(item[0])
|
|
})
|
|
return arr
|
|
},
|
|
envir2Humidity(state) {
|
|
let arr = []
|
|
Object.values(state.envir2Charts).map(item => {
|
|
arr.push(item[1])
|
|
})
|
|
return arr
|
|
},
|
|
envir2HP(state) {
|
|
let arr = []
|
|
Object.values(state.envir2Charts).map(item => {
|
|
arr.push(item[2])
|
|
})
|
|
return arr
|
|
},
|
|
},
|
|
})
|