Browse Source

正压负压环境

master
maochaoying 2 years ago
parent
commit
753a3c3546
  1. 43
      src/components/Operator.vue
  2. 130
      src/components/dialogs/EnvirPicker.vue
  3. 3
      src/mock/command.js

43
src/components/Operator.vue

@ -445,6 +445,12 @@
:changeLogVal="changeLogVal"
:logVal="logVal"
/>
<EnvirPicker
v-if="envirVisible"
:hiddenLogVisible="hiddenEnvirVisible"
:changeLogVal="changeEnvirVal"
:logVal="envirVal"
/>
<PreInstallPicker
v-if="preVisible"
:hiddenPreVisible="hiddenPreVisible"
@ -477,6 +483,7 @@
<script setup>
import LogPicker from 'cpns/dialogs/LogPicker'
import EnvirPicker from 'cpns/dialogs/EnvirPicker'
import PreInstallPicker from 'cpns/dialogs/PreInstallPicker'
import DisinfectModal from 'cpns/dialogs/DisinfectModal'
import WarnModal from 'cpns/dialogs/WarnModal'
@ -537,6 +544,7 @@ const toDetail = () => {
}
const logVisible = ref(false)
const envirVisible = ref(false)
const logVal = ref(localStorage.getItem('logVal') || '6')
const roomSize = ref(0)
@ -553,6 +561,19 @@ const changeLogVal = val => {
localStorage.setItem('logVal', val)
logVisible.value = false
}
const envirVal = ref('1')
const changeEnvirVal = val => {
envirVal.value = val
envirVisible.value = false
//
operatorStore.updateShowStartReady(true)
//
setTimeout(() => {
operatorStore.updateShowStartReady(false)
}, 10000)
realStart()
}
const changePreVal = val => {
preVal.value = val
preVisible.value = false
@ -562,12 +583,13 @@ const startDisinfect = () => {
//
//
// preVisible.value = true
operatorStore.updateShowStartReady(true)
//
setTimeout(() => {
operatorStore.updateShowStartReady(false)
}, 10000)
realStart()
// operatorStore.updateShowStartReady(true)
// //
// setTimeout(() => {
// operatorStore.updateShowStartReady(false)
// }, 10000)
// realStart()
envirVisible.value = true
}
const realStart = () => {
@ -580,7 +602,11 @@ const realStart = () => {
localStorage.removeItem('envir1')
localStorage.removeItem('envir2')
webSocketStore.sendCommandMsg(
startDisinfectionJSON(parseInt(logVal.value), parseInt(roomSize.value)),
startDisinfectionJSON(
parseInt(logVal.value),
parseInt(roomSize.value),
parseInt(envirVal.value),
),
)
props.changeShowOperator(false)
}
@ -602,6 +628,9 @@ onMounted(() => {
const hiddenLogVisible = () => {
logVisible.value = false
}
const hiddenEnvirVisible = () => {
envirVisible.value = false
}
onUnmounted(() => {
timer.value = null
})

130
src/components/dialogs/EnvirPicker.vue

@ -0,0 +1,130 @@
<template>
<div class="log_picker_dialog_container">
<div class="modal_content">
<p class="title">选择消毒环境</p>
<div class="log_select">
<van-picker
:columns="columns"
:show-toolbar="false"
visible-option-num="2"
option-height="48"
v-model="selectedValues"
/>
</div>
<div class="ok_btn style-btn" @click="chooseLog">确定</div>
<svg
class="close"
@click="handleClickClose"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
fill="none"
version="1.1"
width="13.06049919128418"
height="13.062000274658203"
viewBox="0 0 13.06049919128418 13.062000274658203"
>
<g>
<path
d="M6.531,7.5915L12,13.062L13.0605,12.0015L7.5915,6.531L13.0605,1.062L12,3.57628e-7L6.531,5.4705L1.062,0L0,1.062L5.4705,6.531L0,12L1.062,13.062L6.531,7.5915Z"
fill="#323233"
fill-opacity="1"
/>
</g>
</svg>
</div>
</div>
</template>
<script setup>
import { ref, watch } from 'vue'
const props = defineProps({
changeLogVal: {
type: Function,
},
logVal: {
type: String,
},
hiddenLogVisible: {
type: Function,
},
})
const columns = ref([
{ text: '正压环境', value: '1' },
{ text: '负压环境', value: '2' },
])
const chooseLog = () => {
props.changeLogVal(selectedValues.value[0])
}
const handleClickClose = () => {
props.hiddenLogVisible()
}
const selectedValues = ref(['1'])
watch(() => {
selectedValues.value = [props.logVal]
})
</script>
<style lang="scss" scoped>
.log_picker_dialog_container {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
.modal_content {
width: 476px;
height: 407px;
border-radius: 16px;
background: #ffffff;
box-sizing: border-box;
padding: 45px 68px 62px 68px;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
.close {
position: absolute;
right: 24px;
top: 18px;
}
.title {
font-family: Source Han Sans CN;
font-size: 22px;
font-weight: normal;
letter-spacing: 0.04em;
color: #000000;
margin-bottom: 39px;
}
.log_select {
width: 340px;
height: 113px;
overflow: hidden;
margin-bottom: 48px;
}
.ok_btn {
width: 340px;
height: 68px;
border-radius: 8px;
background: #06518b;
display: flex;
align-items: center;
justify-content: center;
font-family: Source Han Sans CN;
font-size: 23px;
font-weight: 350;
letter-spacing: 0em;
color: #ffffff;
}
}
}
</style>

3
src/mock/command.js

@ -33,12 +33,13 @@ export const shutdownJSON = {
}
// 开始消毒
export const startDisinfectionJSON = (loglevel, roomVolume) => {
export const startDisinfectionJSON = (loglevel, roomVolume, envirVal) => {
return {
command: 'startDisinfection',
messageId: 'startDisinfection',
loglevel,
roomVolume,
envirVal,
}
}

Loading…
Cancel
Save