Browse Source

设备类型统一获取

master
王梦远 2 weeks ago
parent
commit
cb466e41ff
  1. 3
      src/app.vue
  2. 4
      src/components/common/SoftKeyboard/index.vue
  3. 3
      src/components/home/HomeSetting.vue
  4. 3
      src/components/setting/Device.vue
  5. 7
      src/views/debug/index.vue

3
src/app.vue

@ -82,8 +82,7 @@ const startProgress = () => {
// 1-9%
const randomStep = Math.floor(Math.random() * 9 + 1)
progress.value = Math.min(progress.value + randomStep, 100)
const deviceInfo: Device.DeviceInfo = await initDeviceInfo()
if (deviceInfo.deviceType === deviceType.LargeSpaceDM_B) {
if (__DEVICE_TYPE__ === deviceType.LargeSpaceDM_B) {
await initData() //
}
else {

4
src/components/common/SoftKeyboard/index.vue

@ -41,7 +41,7 @@ onMounted(() => {
const isOpen = ref(false)
watchEffect(() => {
// EventListener
if (deviceState.deviceInfo.deviceType !== deviceState.deviceTypeMap.LargeSpaceDM_B) { //
if (__DEVICE_TYPE__ !== deviceState.deviceTypeMap.LargeSpaceDM_B) { //
setTimeout(() => {
isOpen.value = props.isVisible
}, 100)
@ -52,7 +52,7 @@ watchEffect(() => {
watch(
() => props.isVisible,
(newVal) => {
if (deviceState.deviceInfo.deviceType !== deviceState.deviceTypeMap.LargeSpaceDM_B) {
if (__DEVICE_TYPE__ !== deviceState.deviceTypeMap.LargeSpaceDM_B) {
isOpen.value = newVal
}
},

3
src/components/home/HomeSetting.vue

@ -58,8 +58,7 @@ watchEffect(() => {
* @description 初始化压力配置
*/
onMounted(async () => {
const deviceInfo: Device.DeviceInfo = deviceStore.deviceInfo
if (deviceInfo.deviceType !== useDeviceStore().deviceTypeMap.LargeSpaceDM_B) {
if (__DEVICE_TYPE__ !== useDeviceStore().deviceTypeMap.LargeSpaceDM_B) {
await getPressureConfig() //
}
})

3
src/components/setting/Device.vue

@ -18,6 +18,7 @@ const deviceInfo = ref(deviceStore.deviceInfo)
// const screenHeight = ref(height)
const webVersion = computed(() => __APP_VERSION__)
const deviceType = computed(() => __DEVICE_TYPE__)
</script>
<template>
@ -26,7 +27,7 @@ const webVersion = computed(() => __APP_VERSION__)
<div>设备ID{{ deviceInfo.deviceId }}</div>
</div>
<div class="device-ul">
<div>设备类型{{ deviceInfo.deviceType }}</div>
<div>设备类型{{ deviceType }}</div>
</div>
<div class="device-ul">
<div>IP地址{{ deviceInfo.ip }}</div>

7
src/views/debug/index.vue

@ -4,7 +4,7 @@ import { roundNumber } from 'libs/utils'
import { useDebugStore } from 'stores/debugStore'
import { useDeviceStore } from 'stores/deviceStore'
import { useHomeStore } from 'stores/homeStore'
import { ref, watchEffect } from 'vue'
import { computed, ref, watchEffect } from 'vue'
const homeStore = useHomeStore()
const debugStore = useDebugStore()
@ -164,6 +164,7 @@ const printerDoTest = () => {
}
sendCmd(data)
}
const deviceType = computed(() => __DEVICE_TYPE__)
</script>
<template>
@ -223,7 +224,7 @@ const printerDoTest = () => {
<div class="debug-lower">
<section>
<div>
<div v-if="deviceState.deviceInfo.deviceType !== deviceState.deviceTypeMap.LargeSpaceDM_B" class="debug-left-lh">
<div v-if="deviceType !== deviceState.deviceTypeMap.LargeSpaceDM_B" class="debug-left-lh">
<div class="debug-label">
加液泵控制
</div>
@ -259,7 +260,7 @@ const printerDoTest = () => {
<bt-button button-text="关闭" @click="heatingDoClose" />
</div>
</div>
<div v-if="deviceState.deviceInfo.deviceType !== deviceState.deviceTypeMap.LargeSpaceDM_B" class="debug-left-lh">
<div v-if="deviceType !== deviceState.deviceTypeMap.LargeSpaceDM_B" class="debug-left-lh">
<div class="debug-label">
气密性阀门模式
</div>

Loading…
Cancel
Save