|
@ -21,19 +21,25 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div class="right_btns"> |
|
|
<div class="right_btns"> |
|
|
<div |
|
|
<div |
|
|
:class="operatorStore.disinfectStatus ? 'btn active' : 'btn'" |
|
|
|
|
|
|
|
|
:class=" |
|
|
|
|
|
[1, 2].includes(operatorStore.disinfectStatus) |
|
|
|
|
|
? 'btn active' |
|
|
|
|
|
: 'btn' |
|
|
|
|
|
" |
|
|
@click="stopDisinfect" |
|
|
@click="stopDisinfect" |
|
|
> |
|
|
> |
|
|
停止消毒 |
|
|
停止消毒 |
|
|
</div> |
|
|
</div> |
|
|
<div |
|
|
<div |
|
|
:class="operatorStore.disinfectStatus ? 'btn active ml' : 'btn ml'" |
|
|
|
|
|
|
|
|
:class=" |
|
|
|
|
|
operatorStore.disinfectStatus == 1 ? 'btn active ml' : 'btn ml' |
|
|
|
|
|
" |
|
|
@click="pauseDisinfect" |
|
|
@click="pauseDisinfect" |
|
|
> |
|
|
> |
|
|
暂停消毒 |
|
|
暂停消毒 |
|
|
</div> |
|
|
</div> |
|
|
<div |
|
|
<div |
|
|
:class="operatorStore.disinfectStatus ? 'btn' : 'btn active'" |
|
|
|
|
|
|
|
|
:class="operatorStore.disinfectStatus == 2 ? 'btn active' : 'btn'" |
|
|
@click="continueDisinfect" |
|
|
@click="continueDisinfect" |
|
|
> |
|
|
> |
|
|
继续消毒 |
|
|
继续消毒 |
|
@ -46,7 +52,7 @@ |
|
|
<div |
|
|
<div |
|
|
class="echarts_box" |
|
|
class="echarts_box" |
|
|
id="bin" |
|
|
id="bin" |
|
|
v-if="operatorStore.disinfectStatus || binLocal" |
|
|
|
|
|
|
|
|
v-if="operatorStore.disinfectStatus != 0 || binLocal" |
|
|
></div> |
|
|
></div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="single_wrap"> |
|
|
<div class="single_wrap"> |
|
@ -54,7 +60,7 @@ |
|
|
<div |
|
|
<div |
|
|
class="echarts_box" |
|
|
class="echarts_box" |
|
|
id="envir1" |
|
|
id="envir1" |
|
|
v-if="operatorStore.disinfectStatus || envir1Local" |
|
|
|
|
|
|
|
|
v-if="operatorStore.disinfectStatus != 0 || envir1Local" |
|
|
></div> |
|
|
></div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="single_wrap"> |
|
|
<div class="single_wrap"> |
|
@ -62,7 +68,7 @@ |
|
|
<div |
|
|
<div |
|
|
class="echarts_box" |
|
|
class="echarts_box" |
|
|
id="envir2" |
|
|
id="envir2" |
|
|
v-if="operatorStore.disinfectStatus || envir2Local" |
|
|
|
|
|
|
|
|
v-if="operatorStore.disinfectStatus != 0 || envir2Local" |
|
|
></div> |
|
|
></div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -80,41 +86,28 @@ import { |
|
|
continueDisinfectionJSON, |
|
|
continueDisinfectionJSON, |
|
|
pauseDisinfectionJSON, |
|
|
pauseDisinfectionJSON, |
|
|
} from '@/mock/command' |
|
|
} from '@/mock/command' |
|
|
import { onMounted, onUnmounted, ref, computed } from 'vue' |
|
|
|
|
|
|
|
|
import { onMounted, onUnmounted, ref, computed, watch } from 'vue' |
|
|
import * as echarts from 'echarts' |
|
|
import * as echarts from 'echarts' |
|
|
import { storeToRefs } from 'pinia' |
|
|
import { storeToRefs } from 'pinia' |
|
|
|
|
|
|
|
|
const echartsStore = useEchartsStore() |
|
|
const echartsStore = useEchartsStore() |
|
|
|
|
|
|
|
|
const binLocal = computed(() => { |
|
|
const binLocal = computed(() => { |
|
|
return localStorage.getItem('bin') |
|
|
|
|
|
|
|
|
return echartsStore?.binCharts || localStorage.getItem('bin') |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const envir1Local = computed(() => { |
|
|
const envir1Local = computed(() => { |
|
|
return localStorage.getItem('envir1') |
|
|
|
|
|
|
|
|
return echartsStore?.envir1Charts || localStorage.getItem('envir1') |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const envir2Local = computed(() => { |
|
|
const envir2Local = computed(() => { |
|
|
return localStorage.getItem('envir2') |
|
|
|
|
|
|
|
|
return echartsStore?.envir2Charts || localStorage.getItem('envir2') |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const binOption = ref({ |
|
|
const binOption = ref({ |
|
|
tooltip: { |
|
|
tooltip: { |
|
|
trigger: 'axis', |
|
|
trigger: 'axis', |
|
|
}, |
|
|
}, |
|
|
dataZoom: { |
|
|
|
|
|
show: true, // 为true 滚动条出现 |
|
|
|
|
|
realtime: true, |
|
|
|
|
|
type: 'slider', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 |
|
|
|
|
|
height: 10, // 表示滚动条的高度,也就是粗细 |
|
|
|
|
|
start: 40, // 表示默认展示0%~80%这一段。 |
|
|
|
|
|
end: 100, |
|
|
|
|
|
backgroundColor: 'transparent', |
|
|
|
|
|
bottom: 10, |
|
|
|
|
|
textStyle: { |
|
|
|
|
|
color: 'transparent', |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
legend: { |
|
|
legend: { |
|
|
data: ['温度', '湿度', '过氧化氢浓度'], |
|
|
data: ['温度', '湿度', '过氧化氢浓度'], |
|
|
}, |
|
|
}, |
|
@ -157,19 +150,6 @@ const envir1Option = ref({ |
|
|
tooltip: { |
|
|
tooltip: { |
|
|
trigger: 'axis', |
|
|
trigger: 'axis', |
|
|
}, |
|
|
}, |
|
|
dataZoom: { |
|
|
|
|
|
show: true, // 为true 滚动条出现 |
|
|
|
|
|
realtime: true, |
|
|
|
|
|
type: 'slider', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 |
|
|
|
|
|
height: 10, // 表示滚动条的高度,也就是粗细 |
|
|
|
|
|
start: 40, // 表示默认展示0%~80%这一段。 |
|
|
|
|
|
end: 100, |
|
|
|
|
|
backgroundColor: 'transparent', |
|
|
|
|
|
bottom: 10, |
|
|
|
|
|
textStyle: { |
|
|
|
|
|
color: 'transparent', |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
legend: { |
|
|
legend: { |
|
|
data: ['温度', '湿度', '过氧化氢浓度'], |
|
|
data: ['温度', '湿度', '过氧化氢浓度'], |
|
|
}, |
|
|
}, |
|
@ -212,19 +192,6 @@ const envir2Option = ref({ |
|
|
tooltip: { |
|
|
tooltip: { |
|
|
trigger: 'axis', |
|
|
trigger: 'axis', |
|
|
}, |
|
|
}, |
|
|
dataZoom: { |
|
|
|
|
|
show: true, // 为true 滚动条出现 |
|
|
|
|
|
realtime: true, |
|
|
|
|
|
type: 'slider', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 |
|
|
|
|
|
height: 10, // 表示滚动条的高度,也就是粗细 |
|
|
|
|
|
start: 40, // 表示默认展示0%~80%这一段。 |
|
|
|
|
|
end: 100, |
|
|
|
|
|
backgroundColor: 'transparent', |
|
|
|
|
|
bottom: 10, |
|
|
|
|
|
textStyle: { |
|
|
|
|
|
color: 'transparent', |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
legend: { |
|
|
legend: { |
|
|
data: ['温度', '湿度', '过氧化氢浓度'], |
|
|
data: ['温度', '湿度', '过氧化氢浓度'], |
|
|
}, |
|
|
}, |
|
@ -276,48 +243,180 @@ const showDetail = () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const timer = ref(null) |
|
|
const timer = ref(null) |
|
|
|
|
|
|
|
|
|
|
|
const binCharts = ref(null) |
|
|
|
|
|
const envir1Charts = ref(null) |
|
|
|
|
|
const envir2Charts = ref(null) |
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
timer.value = setInterval(() => { |
|
|
timer.value = setInterval(() => { |
|
|
webSocketStore.sendCommandMsg(getStateJSON) |
|
|
webSocketStore.sendCommandMsg(getStateJSON) |
|
|
}, 1000) |
|
|
}, 1000) |
|
|
let a = echarts.getInstanceByDom(document.getElementById('bin')) |
|
|
let a = echarts.getInstanceByDom(document.getElementById('bin')) |
|
|
if (a == undefined) { |
|
|
if (a == undefined) { |
|
|
var binCharts = echarts.init(document.getElementById('bin')) |
|
|
|
|
|
binCharts.setOption(binOption.value) |
|
|
|
|
|
|
|
|
binCharts.value = echarts.init(document.getElementById('bin')) |
|
|
|
|
|
binCharts.value.setOption(binOption.value) |
|
|
} |
|
|
} |
|
|
let b = echarts.getInstanceByDom(document.getElementById('envir1')) |
|
|
let b = echarts.getInstanceByDom(document.getElementById('envir1')) |
|
|
if (b == undefined) { |
|
|
if (b == undefined) { |
|
|
var envir1Charts = echarts.init(document.getElementById('envir1')) |
|
|
|
|
|
envir1Charts.setOption(envir1Option.value) |
|
|
|
|
|
|
|
|
envir1Charts.value = echarts.init(document.getElementById('envir1')) |
|
|
|
|
|
envir1Charts.value.setOption(envir1Option.value) |
|
|
} |
|
|
} |
|
|
let c = echarts.getInstanceByDom(document.getElementById('envir2')) |
|
|
let c = echarts.getInstanceByDom(document.getElementById('envir2')) |
|
|
if (c == undefined) { |
|
|
if (c == undefined) { |
|
|
var envir2Charts = echarts.init(document.getElementById('envir2')) |
|
|
|
|
|
envir2Charts.setOption(envir2Option.value) |
|
|
|
|
|
|
|
|
envir2Charts.value = echarts.init(document.getElementById('envir2')) |
|
|
|
|
|
envir2Charts.value.setOption(envir2Option.value) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setInterval(() => { |
|
|
|
|
|
binCharts.value?.setOption({ |
|
|
|
|
|
tooltip: { |
|
|
|
|
|
trigger: 'axis', |
|
|
|
|
|
}, |
|
|
|
|
|
legend: { |
|
|
|
|
|
data: ['温度', '湿度', '过氧化氢浓度'], |
|
|
|
|
|
}, |
|
|
|
|
|
grid: { |
|
|
|
|
|
left: '3%', |
|
|
|
|
|
right: '4%', |
|
|
|
|
|
bottom: '3%', |
|
|
|
|
|
containLabel: true, |
|
|
|
|
|
}, |
|
|
|
|
|
xAxis: { |
|
|
|
|
|
type: 'category', |
|
|
|
|
|
boundaryGap: false, |
|
|
|
|
|
data: Object.keys(echartsStore.binCharts), |
|
|
|
|
|
}, |
|
|
|
|
|
yAxis: { |
|
|
|
|
|
type: 'value', |
|
|
|
|
|
}, |
|
|
|
|
|
series: [ |
|
|
|
|
|
{ |
|
|
|
|
|
name: '温度', |
|
|
|
|
|
type: 'line', |
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
data: echartsStore.binTemp, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: '湿度', |
|
|
|
|
|
type: 'line', |
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
data: echartsStore.binHumidity, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: '过氧化氢浓度', |
|
|
|
|
|
type: 'line', |
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
data: echartsStore.binHP, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
}) |
|
|
|
|
|
envir1Charts.value?.setOption({ |
|
|
|
|
|
tooltip: { |
|
|
|
|
|
trigger: 'axis', |
|
|
|
|
|
}, |
|
|
|
|
|
legend: { |
|
|
|
|
|
data: ['温度', '湿度', '过氧化氢浓度'], |
|
|
|
|
|
}, |
|
|
|
|
|
grid: { |
|
|
|
|
|
left: '3%', |
|
|
|
|
|
right: '4%', |
|
|
|
|
|
bottom: '3%', |
|
|
|
|
|
containLabel: true, |
|
|
|
|
|
}, |
|
|
|
|
|
xAxis: { |
|
|
|
|
|
type: 'category', |
|
|
|
|
|
boundaryGap: false, |
|
|
|
|
|
data: Object.keys(echartsStore.envir1Charts), |
|
|
|
|
|
}, |
|
|
|
|
|
yAxis: { |
|
|
|
|
|
type: 'value', |
|
|
|
|
|
}, |
|
|
|
|
|
series: [ |
|
|
|
|
|
{ |
|
|
|
|
|
name: '温度', |
|
|
|
|
|
type: 'line', |
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
data: echartsStore.envir1Temp, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: '湿度', |
|
|
|
|
|
type: 'line', |
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
data: echartsStore.envir1Humidity, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: '过氧化氢浓度', |
|
|
|
|
|
type: 'line', |
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
data: echartsStore.envir1HP, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
}) |
|
|
|
|
|
envir2Charts.value?.setOption({ |
|
|
|
|
|
tooltip: { |
|
|
|
|
|
trigger: 'axis', |
|
|
|
|
|
}, |
|
|
|
|
|
legend: { |
|
|
|
|
|
data: ['温度', '湿度', '过氧化氢浓度'], |
|
|
|
|
|
}, |
|
|
|
|
|
grid: { |
|
|
|
|
|
left: '3%', |
|
|
|
|
|
right: '4%', |
|
|
|
|
|
bottom: '3%', |
|
|
|
|
|
containLabel: true, |
|
|
|
|
|
}, |
|
|
|
|
|
xAxis: { |
|
|
|
|
|
type: 'category', |
|
|
|
|
|
boundaryGap: false, |
|
|
|
|
|
data: Object.keys(echartsStore.envir2Charts), |
|
|
|
|
|
}, |
|
|
|
|
|
yAxis: { |
|
|
|
|
|
type: 'value', |
|
|
|
|
|
}, |
|
|
|
|
|
series: [ |
|
|
|
|
|
{ |
|
|
|
|
|
name: '温度', |
|
|
|
|
|
type: 'line', |
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
data: echartsStore.envir2Temp, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: '湿度', |
|
|
|
|
|
type: 'line', |
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
data: echartsStore.envir2Humidity, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: '过氧化氢浓度', |
|
|
|
|
|
type: 'line', |
|
|
|
|
|
stack: 'Total', |
|
|
|
|
|
data: echartsStore.envir2HP, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
}) |
|
|
}) |
|
|
|
|
|
}, 1000 * 30) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 监听到store中的数据变化动态更改options |
|
|
onUnmounted(() => { |
|
|
onUnmounted(() => { |
|
|
timer.value = null |
|
|
timer.value = null |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
const pauseDisinfect = () => { |
|
|
const pauseDisinfect = () => { |
|
|
if (operatorStore.disinfectStatus) { |
|
|
|
|
|
|
|
|
if (operatorStore.disinfectStatus == 1) { |
|
|
webSocketStore.sendCommandMsg(pauseDisinfectionJSON) |
|
|
webSocketStore.sendCommandMsg(pauseDisinfectionJSON) |
|
|
operatorStore.updateDisinfectStatus(false) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const stopDisinfect = () => { |
|
|
const stopDisinfect = () => { |
|
|
if (operatorStore.disinfectStatus) { |
|
|
|
|
|
|
|
|
if ([1, 2].includes(operatorStore.disinfectStatus)) { |
|
|
webSocketStore.sendCommandMsg(stopDisinfectionJSON) |
|
|
webSocketStore.sendCommandMsg(stopDisinfectionJSON) |
|
|
operatorStore.updateDisinfectStatus(false) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const continueDisinfect = () => { |
|
|
const continueDisinfect = () => { |
|
|
if (!operatorStore.disinfectStatus) { |
|
|
|
|
|
|
|
|
if (operatorStore.disinfectStatus == 2) { |
|
|
webSocketStore.sendCommandMsg(continueDisinfectionJSON) |
|
|
webSocketStore.sendCommandMsg(continueDisinfectionJSON) |
|
|
operatorStore.updateDisinfectStatus(true) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|