|
|
@ -46,14 +46,18 @@ |
|
|
|
@focus="showKeyboard('number', 1)" |
|
|
|
readonly |
|
|
|
/> |
|
|
|
<button @click="updateSetting('allTemperature', settings.allTemperature)"> |
|
|
|
<button |
|
|
|
@click="updateSetting('allTemperature', settings.allTemperature)" |
|
|
|
> |
|
|
|
设置 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="setting-item setting-item-no-border"> |
|
|
|
<span class="label">孵育盘温度</span> |
|
|
|
<span class="label">孵育盘温度 <el-tag type="primary" class="option-tag"> {{ deviceStore.sensorState?.incubateBoxTemperature }}℃</el-tag></span> |
|
|
|
|
|
|
|
<div class="options"> |
|
|
|
|
|
|
|
<input |
|
|
|
style="width: 150px" |
|
|
|
v-model="settings.incubateBoxTemperature" |
|
|
@ -61,14 +65,23 @@ |
|
|
|
@focus="showKeyboard('number', 2)" |
|
|
|
readonly |
|
|
|
/> |
|
|
|
<button @click="updateSetting('incubateBoxTemperature', settings.incubateBoxTemperature)"> |
|
|
|
<button |
|
|
|
@click=" |
|
|
|
updateSetting( |
|
|
|
'incubateBoxTemperature', |
|
|
|
settings.incubateBoxTemperature, |
|
|
|
) |
|
|
|
" |
|
|
|
> |
|
|
|
设置 |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="setting-item setting-item-no-border"> |
|
|
|
<span class="label">板夹区温度</span> |
|
|
|
<span class="label">板夹区温度 <el-tag type="primary" class="option-tag"> {{ deviceStore.sensorState?.pboxTemperature }}℃</el-tag></span> |
|
|
|
<div class="options"> |
|
|
|
|
|
|
|
|
|
|
|
<input |
|
|
|
style="width: 150px" |
|
|
|
v-model="settings.plateBoxTemperature" |
|
|
@ -76,7 +89,11 @@ |
|
|
|
@focus="showKeyboard('number', 3)" |
|
|
|
readonly |
|
|
|
/> |
|
|
|
<button @click="updateSetting('plateBoxTemperature', settings.plateBoxTemperature)"> |
|
|
|
<button |
|
|
|
@click=" |
|
|
|
updateSetting('plateBoxTemperature', settings.plateBoxTemperature) |
|
|
|
" |
|
|
|
> |
|
|
|
设置 |
|
|
|
</button> |
|
|
|
</div> |
|
|
@ -191,9 +208,15 @@ import { |
|
|
|
getTemperatureRange, |
|
|
|
setDHCP, |
|
|
|
setLocalIP, |
|
|
|
setAutoLogoutTime, setAllTemperature, setIncubateBoxTemperature, setPlateBoxTemperature, setDateAndTime |
|
|
|
setAutoLogoutTime, |
|
|
|
setAllTemperature, |
|
|
|
setIncubateBoxTemperature, |
|
|
|
setPlateBoxTemperature, |
|
|
|
setDateAndTime, |
|
|
|
} from '@/services' |
|
|
|
import { eMessage, isValidIPv4 } from '../utils' |
|
|
|
import { useDeviceStore } from '@/store/index' |
|
|
|
const deviceStore = useDeviceStore() |
|
|
|
|
|
|
|
const layout = ref() |
|
|
|
|
|
|
@ -202,7 +225,7 @@ const numericLayout = { |
|
|
|
'1 2 3', |
|
|
|
'4 5 6', |
|
|
|
'7 8 9', |
|
|
|
'{bksp} 0 {enter}' // 包含删除和确认键 |
|
|
|
'{bksp} 0 {enter}', // 包含删除和确认键 |
|
|
|
], |
|
|
|
} |
|
|
|
|
|
|
@ -283,8 +306,8 @@ const fetchSettings = async () => { |
|
|
|
|
|
|
|
function isIntegerInRange(str: string): boolean { |
|
|
|
// 匹配 20-40 的整数 |
|
|
|
const regex = /^(2[0-9]|3[0-9]|40)$/; |
|
|
|
return regex.test(str); |
|
|
|
const regex = /^(2[0-9]|3[0-9]|40)$/ |
|
|
|
return regex.test(str) |
|
|
|
} |
|
|
|
|
|
|
|
// 更新设置 |
|
|
@ -352,9 +375,13 @@ const updateSetting = async (key: string, value: any) => { |
|
|
|
settings.value = { ...settings.value, [key]: value } |
|
|
|
|
|
|
|
if (key === 'allTemperature') { |
|
|
|
settings.value.incubateBoxTemperature = settings.value.plateBoxTemperature = value |
|
|
|
settings.value.incubateBoxTemperature = |
|
|
|
settings.value.plateBoxTemperature = value |
|
|
|
} |
|
|
|
if (settings.value.incubateBoxTemperature === settings.value.plateBoxTemperature) { |
|
|
|
if ( |
|
|
|
settings.value.incubateBoxTemperature === |
|
|
|
settings.value.plateBoxTemperature |
|
|
|
) { |
|
|
|
settings.value.allTemperature = settings.value.incubateBoxTemperature |
|
|
|
} else { |
|
|
|
settings.value.allTemperature = undefined |
|
|
@ -374,7 +401,7 @@ const startTimer = () => { |
|
|
|
intervalId.value = setInterval(() => { |
|
|
|
const now = new Date() |
|
|
|
currentDate.value = now |
|
|
|
time.value = format(now, 'yyyy.MM.dd HH:mm:ss'); |
|
|
|
time.value = format(now, 'yyyy.MM.dd HH:mm:ss') |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
|
|
|
@ -434,7 +461,6 @@ const inputType = { |
|
|
|
|
|
|
|
// 处理键盘输入 |
|
|
|
const handleKeyboardInput = (value: string) => { |
|
|
|
|
|
|
|
// 更新当前输入值 |
|
|
|
currentInputValue.value = value |
|
|
|
settings.value[inputType[inputNumberType.value]] = value |
|
|
@ -469,18 +495,17 @@ onUnmounted(() => { |
|
|
|
const pauseTimer = () => { |
|
|
|
if (intervalId.value) { |
|
|
|
console.log(111) |
|
|
|
clearInterval(intervalId.value); |
|
|
|
intervalId.value = null; |
|
|
|
clearInterval(intervalId.value) |
|
|
|
intervalId.value = null |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
// 恢复定时器 |
|
|
|
const resumeTimer = () => { |
|
|
|
if (!intervalId.value) { |
|
|
|
startTimer(); |
|
|
|
startTimer() |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="less"> |
|
|
@ -516,6 +541,13 @@ const resumeTimer = () => { |
|
|
|
font-size: 28px; |
|
|
|
font-weight: 500; |
|
|
|
color: #303133; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
.option-tag { |
|
|
|
font-size: 25px; |
|
|
|
padding: 20px 10px; |
|
|
|
margin: 0 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.value { |
|
|
@ -592,4 +624,5 @@ const resumeTimer = () => { |
|
|
|
font-size: 18px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</style> |