Browse Source

xiufu

master
maochaoying 2 years ago
parent
commit
e8728d65a9
  1. 20
      src/components/Progress.vue
  2. 28
      src/components/Setting/components/Device.vue

20
src/components/Progress.vue

@ -46,7 +46,7 @@
<div <div
class="echarts_box" class="echarts_box"
id="bin" id="bin"
v-if="operatorStore.disinfectStatus || localStorage.getItem('bin')"
v-if="operatorStore.disinfectStatus || binLocal"
></div> ></div>
</div> </div>
<div class="single_wrap"> <div class="single_wrap">
@ -54,7 +54,7 @@
<div <div
class="echarts_box" class="echarts_box"
id="envir1" id="envir1"
v-if="operatorStore.disinfectStatus || localStorage.getItem('envir1')"
v-if="operatorStore.disinfectStatus || envir1Local"
></div> ></div>
</div> </div>
<div class="single_wrap"> <div class="single_wrap">
@ -62,7 +62,7 @@
<div <div
class="echarts_box" class="echarts_box"
id="envir2" id="envir2"
v-if="operatorStore.disinfectStatus || localStorage.getItem('envir2')"
v-if="operatorStore.disinfectStatus || envir2Local"
></div> ></div>
</div> </div>
</div> </div>
@ -80,12 +80,24 @@ import {
continueDisinfectionJSON, continueDisinfectionJSON,
pauseDisinfectionJSON, pauseDisinfectionJSON,
} from '@/mock/command' } from '@/mock/command'
import { onMounted, onUnmounted, ref } from 'vue'
import { onMounted, onUnmounted, ref, computed } 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(() => {
return localStorage.getItem('bin')
})
const envir1Local = computed(() => {
return localStorage.getItem('envir1')
})
const envir2Local = computed(() => {
return localStorage.getItem('envir2')
})
const binOption = ref({ const binOption = ref({
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',

28
src/components/Setting/components/Device.vue

@ -7,6 +7,7 @@
type="number" type="number"
v-model="addLiquidConfigVal" v-model="addLiquidConfigVal"
:clickable="true" :clickable="true"
:formatter="formatter2"
:maxlength="3" :maxlength="3"
readonly readonly
@touchstart.stop="addLiquidConfigValShow = true" @touchstart.stop="addLiquidConfigValShow = true"
@ -21,6 +22,7 @@
type="number" type="number"
v-model="sprayLiquidConfigVal" v-model="sprayLiquidConfigVal"
:clickable="true" :clickable="true"
:formatter="formatter2"
:maxlength="3" :maxlength="3"
readonly readonly
@touchstart.stop="sprayLiquidConfigValShow = true" @touchstart.stop="sprayLiquidConfigValShow = true"
@ -35,6 +37,7 @@
type="number" type="number"
v-model="stoped_gs" v-model="stoped_gs"
:clickable="true" :clickable="true"
:formatter="formatter3"
:maxlength="4" :maxlength="4"
readonly readonly
@touchstart.stop="stoped_gsShow = true" @touchstart.stop="stoped_gsShow = true"
@ -50,6 +53,7 @@
v-model="continued_gs" v-model="continued_gs"
:clickable="true" :clickable="true"
:maxlength="4" :maxlength="4"
:formatter="formatter3"
readonly readonly
@touchstart.stop="continued_gsShow = true" @touchstart.stop="continued_gsShow = true"
/> />
@ -61,6 +65,7 @@
<p class="num"> <p class="num">
<van-field <van-field
type="number" type="number"
:formatter="formatter1"
v-model="stoped_satur" v-model="stoped_satur"
:clickable="true" :clickable="true"
:maxlength="3" :maxlength="3"
@ -75,6 +80,7 @@
<p class="num"> <p class="num">
<van-field <van-field
type="number" type="number"
:formatter="formatter1"
v-model="continued_satur" v-model="continued_satur"
:clickable="true" :clickable="true"
:maxlength="3" :maxlength="3"
@ -88,6 +94,7 @@
<p class="title">允许消毒最大湿度(%RH)</p> <p class="title">允许消毒最大湿度(%RH)</p>
<p class="num"> <p class="num">
<van-field <van-field
:formatter="formatter1"
type="number" type="number"
v-model="max_humidity" v-model="max_humidity"
:clickable="true" :clickable="true"
@ -170,6 +177,27 @@ const stoped_saturShow = ref(false)
const continued_saturShow = ref(false) const continued_saturShow = ref(false)
const max_humidityShow = ref(false) const max_humidityShow = ref(false)
const formatter1 = value => {
if (parseInt(value) > 100) {
return '100'
}
return value
}
const formatter2 = value => {
if (parseInt(value) > 500) {
return '500'
}
return value
}
const formatter3 = value => {
if (parseInt(value) > 1000) {
return '1000'
}
return value
}
const setAddliquidVal = () => { const setAddliquidVal = () => {
const val = parseInt(addLiquidConfigVal.value) const val = parseInt(addLiquidConfigVal.value)
settingStore.changeAddLiquidConfigVal(val) settingStore.changeAddLiquidConfigVal(val)

Loading…
Cancel
Save