|
|
<template> <div class="operator_main_content"> <div class="left_contaienr"> <div class="info_cards"> <div class="card"> <DisinfectantLiquidInfo /> </div> <div class="card"> <EnvironmentInfo :cardType="1" /> </div> <div class="card"> <EnvironmentInfo :cardType="2" /> </div> <div class="card"> <EnvironmentInfo :cardType="3" /> </div> </div> <div class="warn_wrap"> <p class="warn_text">警报信息</p> <svg v-if=" operatorStore.disinfectStatus != 0 && operatorStore.disinfectStatus != 3 " @click="toDetail" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="218" height="50" viewBox="0 0 218 50" > <g> <g> <rect x="0" y="0" width="218" height="50" rx="25" fill="#06518B" fill-opacity="1" /> </g> <g> <ellipse cx="26" cy="25" rx="19" ry="19" fill="#FFFFFF" fill-opacity="1" /> </g> <g> <path d="M65.16,27.84L72.68,27.84L72.68,29.24L65.16,29.24L65.16,27.84ZM65.16,25.22L72.68,25.22L72.68,26.58L65.16,26.58L65.16,25.22ZM63.28,23.939999999999998L63.28,30.52L74.64,30.52L74.64,23.939999999999998L63.28,23.939999999999998ZM60.36,31.62L60.36,33.3L77.7,33.3L77.7,31.62L60.36,31.62ZM68,15.3325L68,17.740000000000002L60.1,17.740000000000002L60.1,19.4L66.08,19.4C64.42,21.14,61.96,22.68,59.62,23.46C60.02,23.84,60.56,24.52,60.84,24.98C63.5,23.92,66.2,21.96,68,19.68L68,23.32L69.88,23.32L69.88,19.68C71.72,21.9,74.44,23.82,77.12,24.82C77.4,24.34,77.96000000000001,23.64,78.36,23.28C75.94,22.52,73.44,21.08,71.78,19.4L77.92,19.4L77.92,17.740000000000002L69.88,17.740000000000002L69.88,15.3325L68,15.3325ZM87.36,28.06L95.44,28.06L95.44,29.24L87.36,29.24L87.36,28.06ZM87.36,26.82L87.36,25.68L95.44,25.68L95.44,26.82L87.36,26.82ZM87.36,30.48L95.44,30.48L95.44,31.72L87.36,31.72L87.36,30.48ZM96.84,15.455C93.56,16.05844,87.62,16.34,82.72,16.36C82.88,16.740000000000002,83.06,17.380000000000003,83.08,17.8C84.74,17.8,86.52,17.759999999999998,88.32,17.7L87.98,18.86L82.96000000000001,18.86L82.96000000000001,20.32L87.44,20.32C87.28,20.72,87.1,21.119999999999997,86.92,21.52L81.53999999999999,21.52L81.53999999999999,23.060000000000002L86.08,23.060000000000002C84.84,25.08,83.18,26.86,80.98,28.08C81.36,28.46,81.9,29.14,82.16,29.58C83.44,28.82,84.56,27.9,85.53999999999999,26.86L85.53999999999999,33.965599999999995L87.36,33.965599999999995L87.36,33.18L95.44,33.18L95.44,33.965599999999995L97.32,33.965599999999995L97.32,24.22L87.56,24.22C87.8,23.84,88.02,23.46,88.24,23.060000000000002L99.25999999999999,23.060000000000002L99.25999999999999,21.52L89,21.52L89.5,20.32L98.14,20.32L98.14,18.86L90.02,18.86L90.4,17.6C93.22,17.439999999999998,95.92,17.2,98,16.82L96.84,15.455ZM109.14,26.74C110.78,27.08,112.86,27.8,114,28.36L114.78,27.14C113.62,26.6,111.56,25.96,109.92,25.64L109.14,26.74ZM107.22,29.3C110,29.62,113.46000000000001,30.42,115.38,31.12L116.22,29.76C114.22,29.08,110.8,28.34,108.1,28.04L107.22,29.3ZM103.38,16.16L103.38,33.9256L105.2,33.9256L105.2,33.120000000000005L118.36,33.120000000000005L118.36,33.9256L120.24000000000001,33.9256L120.24000000000001,16.16L103.38,16.16ZM105.2,31.44L105.2,17.880000000000003L118.36,17.880000000000003L118.36,31.44L105.2,31.44ZM110.02000000000001,18.08C109.02000000000001,19.64,107.32,21.16,105.64,22.119999999999997C106,22.4,106.64,22.96,106.92,23.259999999999998C107.44,22.92,107.96000000000001,22.52,108.47999999999999,22.08C109.02000000000001,22.619999999999997,109.64,23.119999999999997,110.34,23.58C108.74000000000001,24.28,106.97999999999999,24.82,105.3,25.14C105.62,25.48,106,26.22,106.18,26.68C108.08,26.22,110.12,25.5,111.94,24.54C113.56,25.38,115.38,26.04,117.2,26.42C117.42,26,117.9,25.34,118.25999999999999,25C116.62,24.72,114.97999999999999,24.240000000000002,113.5,23.619999999999997C114.94,22.66,116.16,21.52,117,20.22L115.94,19.58L115.66,19.66L110.82,19.66C111.1,19.32,111.36,18.96,111.58,18.6L110.02000000000001,18.08ZM109.53999999999999,21.08L114.32,21.1C113.66,21.72,112.82,22.3,111.88,22.82C110.96000000000001,22.3,110.18,21.72,109.53999999999999,21.08ZM128.1,33.909400000000005C128.6,33.5691,129.42000000000002,33.2887,135.07999999999998,31.5472C134.95999999999998,31.1466,134.8,30.3859,134.76,29.8653L130.12,31.2066L130.12,27.2228C131.2,26.4819,132.2,25.6412,133.01999999999998,24.7603C134.56,28.9444,137.22,31.9275,141.38,33.3287C141.66,32.8084,142.2,32.067499999999995,142.62,31.6672C140.7,31.1266,139.1,30.2056,137.78,28.9844C139,28.2638,140.38,27.3228,141.56,26.4019L139.98000000000002,25.2606C139.16,26.0616,137.86,27.0625,136.72,27.8434C135.94,26.9025,135.32,25.8212,134.86,24.66L141.94,24.66L141.94,23.04L134.1,23.04L134.1,21.54L140.45999999999998,21.54L140.45999999999998,20L134.1,20L134.1,18.6L141.3,18.6L141.3,16.96L134.1,16.96L134.1,15.333120000000001L132.2,15.333120000000001L132.2,16.96L125.26,16.96L125.26,18.6L132.2,18.6L132.2,20L126.26,20L126.26,21.54L132.2,21.54L132.2,23.04L124.42,23.04L124.42,24.66L130.64,24.66C128.8,26.2216,126.16,27.6431,123.78,28.3837C124.2,28.7644,124.76,29.465,125.04,29.9053C126.0 fill="#FFFFFF" fill-opacity="1" /> </g> <g> <path d="M18,17L18.964553,17L18.964553,19.60926C19.31313,18.12349,20.6479,17.0156627,22.2421,17.0156627C24.10176,17.0156627,25.60839,18.5212,25.60839,20.37952C25.60839,22.23783,24.10176,23.74337,22.2421,23.74337C20.6479,23.74337,19.31313,22.635550000000002,18.964553,21.14977L18.964553,26.86717C19.24149,26.62166,19.58398,26.33394,19.96769,26.04506C21.33735,25.01374,22.52761,24.491329999999998,23.505670000000002,24.491329999999998C24.16542,24.491329999999998,24.722929999999998,24.84602,25.162770000000002,25.543860000000002C25.502290000000002,26.08362,25.745359999999998,26.76603,25.980710000000002,27.4272C26.32795,28.4065,26.68869,29.4205,27.20569,29.426299999999998C27.23849,29.4147,27.560650000000003,29.2759,28.1104,27.8378C28.502000000000002,26.81229,28.893700000000003,25.4494,29.2718,24.13084C29.6614,22.77374,30.0627,21.37229,30.4717,20.3294C30.8594,19.33663,31.3629,18.32265,32.15,18.32265L34,18.32265L34,19.28651L32.1654,19.28651C32.140299999999996,19.29807,32.0265,19.3694,31.8413,19.6759C31.6774,19.94771,31.497999999999998,20.34096,31.3089,20.8441C30.938499999999998,21.82723,30.5643,23.13229,30.2016,24.39687C29.802300000000002,25.790599999999998,29.3875,27.2325,28.961199999999998,28.3159C28.5561,29.3414,28.0333,30.3901,27.21148,30.3901C26.650109999999998,30.3901,26.171689999999998,30.0701,25.79166,29.439799999999998C25.506149999999998,28.9655,25.28623,28.3467,25.07403,27.749200000000002C24.597540000000002,26.405540000000002,24.205930000000002,25.45518,23.5076,25.45518C22.757170000000002,25.45518,21.73668,25.92361,20.559919999999998,26.80843C19.74317,27.4227,19.10877,28.0474,18.964553,28.1922L18.964553,32.0229L34,32.0229L34,32.9867L18.964553,32.9867L18.964553,33L18,33L18,17ZM23.939709999999998,18.68313C23.48638,18.23012,22.88449,17.979518,22.2421,17.979518C21.59971,17.979518,20.99783,18.23012,20.54449,18.68313C20.09115,19.13614,19.84037,19.73952,19.84037,20.37952C19.84037,21.01952,20.09115,21.622889999999998,20.54449,22.0759C20.99783,22.52892,21.60164,22.779519999999998,22.2421,22.779519999999998C22.88257,22.779519999999998,23.48638,22.52892,23.939709999999998,22.0759C24.39305,21.622889999999998,24.64384,21.01952,24.64384,20.37952C24.64384,19.73952,24.39305,19.13614,23.939709999999998,18.68313ZM22.05305,19.22289L21.0885,19.22289L21.0885,20.57229L21.08464,20.57229L21.08464,21.53614L23.39956,21.53614L23.39956,20.57229L22.05305,20.57229L22.05305,19.22289Z" fill-rule="evenodd" fill="#06518B" fill-opacity="1" /> </g> </g> </svg> </div> </div> <div class="right_container"> <div class="setting_title"> <p>消毒设置</p> <p>SET</p> </div> <div class="set_form"> <input type="number" :disabled="[1, 2].includes(operatorStore.disinfectStatus)" v-model="roomSize" class="room_size" id="room_size" @focus="handleShowKeyBoard" /> <div class="log" @click="showLogPicker">{{ logVal }}</div> </div> <div :class=" [1, 2].includes(operatorStore.disinfectStatus) ? 'start cant' : 'start style-btn' " @click="startDisinfect" > 开始消毒 </div> <div class="progress"> <p class="title">预计剩余时间</p> <!-- <div class="tube"> <div class="pro" :style="{ '--width': '50px', }" ></div> </div> <div class="num">000/100</div> --> <div class="time"> {{ operatorStore.estimatedRemainingTimeS == 0 ? '已结束' : `${time_To_hhmmss(operatorStore.estimatedRemainingTimeS)}` }} </div> </div> </div> <!-- <WarnModal /> --> <LogPicker v-if="logVisible" :changeLogVal="changeLogVal" :logVal="logVal" /> </div> </template>
<script setup> import LogPicker from 'cpns/dialogs/LogPicker' import WarnModal from 'cpns/dialogs/WarnModal' import DisinfectantLiquidInfo from 'cpns/info/DisinfectantLiquidInfo' import EnvironmentInfo from 'cpns/info/EnvironmentInfo' import { ref, watch, onMounted, onUnmounted } from 'vue' import { useOperatorStore, useWebSocketStore } from '@/store' import { startDisinfectionJSON, getStateJSON } from '@/mock/command' import { showSuccessToast, showFailToast } from 'vant' import { time_To_hhmmss } from '@/utils'
const operatorStore = useOperatorStore() const webSocketStore = useWebSocketStore()
const props = defineProps({ changeShowOperator: { type: Function, }, handleShowKeyBoard: { type: Function, }, hideKeyBoard: { type: Function, }, input: { type: String, }, })
const toDetail = () => { // 判断当前消毒任务是否开始,如果开始时才生效 否则点击不生效
if (operatorStore.disinfectStatus != 0) { props.changeShowOperator(false) } }
const logVisible = ref(false) const logVal = ref('3') const roomSize = ref(0)
watch(() => { if (props.input) { roomSize.value = props.input?.match(/\d+/g)[0] } else { roomSize.value = 0 } })
const changeLogVal = val => { logVal.value = val logVisible.value = false }
const startDisinfect = () => { // 改变开始消毒状态 如果已经开始则不可点击
if (![1, 2].includes(operatorStore.disinfectStatus)) { if (roomSize.value == 0) { showFailToast('请调整房间大小设置,不能为0') } else { localStorage.removeItem('bin') localStorage.removeItem('envir1') localStorage.removeItem('envir2') localStorage.clear() webSocketStore.sendCommandMsg( startDisinfectionJSON(parseInt(logVal.value), parseInt(roomSize.value)), ) props.changeShowOperator(false) } } }
const showLogPicker = () => { if (![1, 2].includes(operatorStore.disinfectStatus)) { logVisible.value = true } }
const timer = ref(null) onMounted(() => { timer.value = setInterval(() => { webSocketStore.sendCommandMsg(getStateJSON) }, 1000) }) onUnmounted(() => { timer.value = null }) </script>
<style lang="scss" scoped> .operator_main_content { margin-bottom: 19px; height: 580px; box-sizing: border-box; display: flex; align-items: center; .left_contaienr { margin-right: 30px; width: 766px; height: 580px; box-sizing: border-box; border-radius: 16px; background: #ffffff; padding: 20px; .info_cards { width: 726px; height: 470px; box-sizing: border-box; display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); column-gap: 20px; row-gap: 20px; margin-bottom: 20px; .card { width: 353px; height: 225px; border-radius: 17.5px; background: #06518b; } } .warn_wrap { display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; width: 726px; height: 50px; border-radius: 6px; .warn_text { font-family: Source Han Sans CN; font-size: 12px; font-weight: 500; letter-spacing: 0.1em; color: #fa1c1c; background: #f6f6f6; width: 468px; height: 50px; border-radius: 6px; display: flex; align-items: center; padding-left: 22px; } .detail_btn { width: 105px; height: 40px; border-radius: 20px; background: #06518b; display: flex; align-items: center; justify-content: center; font-family: Source Han Sans CN; font-size: 18px; font-weight: normal; letter-spacing: 0.1em; color: #ffffff; } } } .right_container { height: 580px; box-sizing: border-box; border-radius: 16px; background: #ffffff; flex: 1; padding: 42px; padding-top: 32px; .setting_title { width: 340px; height: 45px; border-radius: 23px; background: #06518b; padding: 0 24px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; font-family: Source Han Sans CN; font-size: 14px; font-weight: normal; letter-spacing: 0.1em; color: #ffffff; margin-bottom: 41px; } .set_form { width: 340px; height: 190px; box-sizing: border-box; margin-bottom: 41px; overflow: hidden; background: url(../assets/img/operator/form.png) no-repeat; background-size: 100% 100%; position: relative; .room_size { position: absolute; top: 45px; left: 23px; width: 189px; height: 20px; text-align: center; border: none; outline: none; } .log { position: absolute; top: 145px; left: 0px; width: 240px; height: 42px; text-align: center; display: flex; align-items: center; justify-content: center; font-family: Source Han Sans CN; font-size: 14px; font-weight: 500; letter-spacing: 0.06em; color: #0e0e0e; } } .start { margin-bottom: 30px; width: 340px; height: 45px; border-radius: 23px; background: #06518b; display: flex; align-items: center; justify-content: center; font-family: Source Han Sans CN; font-size: 14px; font-weight: normal; letter-spacing: 0.1em; color: #ffffff; position: relative; overflow: hidden; } .cant { background: #f4f4f4; } .progress { width: 340px; height: 114px; border-radius: 16px; opacity: 1; background: #f6f6f6; box-sizing: border-box; padding: 27px 24px 18px 27px; .title { font-family: Source Han Sans CN; font-size: 12px; font-weight: 350; letter-spacing: 0.06em; color: #9e9e9e; margin-bottom: 13px; } .time { text-align: center; padding: 10px; } .tube { width: 292px; height: 14px; border-radius: 7px; background: #ffffff; margin-bottom: 11px; position: relative; overflow: hidden; .pro { position: absolute; left: 0; top: 0; height: 14px; width: var(--width); border-radius: 7px; background: #06518b; } } .num { display: flex; justify-content: flex-end; font-family: Source Han Sans CN; font-size: 10px; font-weight: normal; letter-spacing: 0.06em; color: #9e9e9e; } } } } </style>
|