Browse Source

fix: 板夹区温度显示

master
guoapeng 5 days ago
parent
commit
970c580b82
  1. 39
      src/pages/Index/Index.vue
  2. 15
      src/pages/Index/Settings/Device.vue
  3. 8
      src/pages/Index/components/Consumables/SpttingPlates.vue

39
src/pages/Index/Index.vue

@ -156,6 +156,12 @@
</el-dropdown-menu>
</template> -->
</el-dropdown>
<div style="width: 100px">
<el-tag effect="dark" type="danger" v-show="deviceStore.sensorState?.pboxTemperature > plateBoxTemperature">温度: </el-tag>
<el-tag effect="dark" type="danger" v-show="deviceStore.sensorState?.pboxTemperature < plateBoxTemperature">温度: </el-tag>
<el-tag effect="dark" type="success" v-show="deviceStore.sensorState?.pboxTemperature === plateBoxTemperature">温度: </el-tag>
</div>
<div class="equipment-status" @click="showRecentMsgDialog = true">
<div
@ -407,7 +413,7 @@ import {
getBloodTypes,
confirmPromptInfo,
openBuzzer,
disableDevice,
disableDevice, getSystemSettings
} from '../../services/index'
import {
@ -448,11 +454,29 @@ import LogoutSvg from '@/assets/user-logout.svg'
import CancelSvg from '@/assets/user-cancel.svg'
import Disable from '@/assets/disable.svg'
import { useSystemStore } from '@/store/modules/useSystemStore.ts' // systemStore
import { SystemInfo } from '@/types/Index/System.ts'
const systemStore = useSystemStore() // 使 systemStor
const systemStore = useSystemStore() // 使 systemStore
const router = useRouter()
const route = useRoute()
const plateBoxTemperature = computed(() => {
return systemStore.systemInfo?.plateBoxTemperature || 0
})
//
const fetchSettings = async () => {
try {
const res = await getSystemSettings()
if (res.success) {
systemStore.updateSystemInfo(res.data)
}
} catch (error) {
eMessage.error('获取系统设置失败')
}
}
//
const currentRoute = computed(() => router.currentRoute.value)
console.log(currentRoute.value)
@ -918,6 +942,7 @@ onMounted(() => {
getProjectList()
getBloodTypeList()
fetchSettings()
})
// onBeforeUnmount(() => {
@ -1286,17 +1311,13 @@ watchEffect(() => {
width: 100%;
height: 50px;
display: flex;
justify-content: end;
justify-content: space-between;
align-items: center;
position: relative;
bottom: 0;
margin-top: auto;
background: #f5f7fa;
> *:first-child {
margin-right: auto;
}
.user-logo,
.time-logo {
width: 36px;
@ -1520,5 +1541,7 @@ watchEffect(() => {
width: 11rem;
padding-top: 5px;
}
.el-tag {
font-size: 15px;
}
</style>

15
src/pages/Index/Settings/Device.vue

@ -316,6 +316,9 @@ const updateSetting = async (key: string, value: any) => {
return
}
res = await setAllTemperature(value)
systemStore.updateSystemInfo({
allTemperature: value
})
break
case 'incubateBoxTemperature':
if (!isIntegerInRange(value)) {
@ -323,6 +326,9 @@ const updateSetting = async (key: string, value: any) => {
return
}
res = await setIncubateBoxTemperature(value)
systemStore.updateSystemInfo({
incubateBoxTemperature: value
})
break
case 'plateBoxTemperature':
if (!isIntegerInRange(value)) {
@ -330,9 +336,15 @@ const updateSetting = async (key: string, value: any) => {
return
}
res = await setPlateBoxTemperature(value)
systemStore.updateSystemInfo({
plateBoxTemperature: value
})
break
case 'DHCP':
res = await setDHCP(value)
systemStore.updateSystemInfo({
DHCP: value
})
break
case 'localIP':
const addr = value.trim()
@ -342,6 +354,9 @@ const updateSetting = async (key: string, value: any) => {
}
hideKeyboard()
res = await setLocalIP(addr)
systemStore.updateSystemInfo({
localIP: addr
})
break
}

8
src/pages/Index/components/Consumables/SpttingPlates.vue

@ -6,10 +6,10 @@
<div class="line"></div>
<div class="area-text">反应板夹区</div>
</div>
<div class="real-time-temperature">
<div :class="['status-ball', { overheat: temperature > 40 }]"></div>
<div class="number">温度: {{ temperature }}°</div>
</div>
<!-- <div class="real-time-temperature">-->
<!-- <div :class="['status-ball', { overheat: temperature > 40 }]"></div>-->
<!-- <div class="number">温度: {{ temperature }}°</div>-->
<!-- </div>-->
</div>
<!--反应板显示区域-->
<div class="sptting-plates">

Loading…
Cancel
Save