From c5b4c7fe5579ac6a43f3febab8c36f1d80b5d45b Mon Sep 17 00:00:00 2001 From: guoapeng Date: Thu, 3 Jul 2025 16:11:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96;ui?= =?UTF-8?q?=E4=BC=98=E5=8C=96;=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/element.scss | 2 +- src/components/common/SoftKeyboard/index.vue | 80 ++++++++++++++++++---------- src/components/home/Environment.vue | 8 +-- src/components/setting/Device.vue | 6 +-- src/components/setting/User.vue | 9 ++-- src/layouts/default.vue | 12 +++-- src/views/audit/index.vue | 25 ++++----- src/views/setting/index.vue | 5 +- 8 files changed, 84 insertions(+), 63 deletions(-) diff --git a/src/assets/styles/element.scss b/src/assets/styles/element.scss index 2203280..77c1469 100644 --- a/src/assets/styles/element.scss +++ b/src/assets/styles/element.scss @@ -1,5 +1,5 @@ :root { - --el-font-size-base: 18px; + --el-font-size-base: 16px; // --el-button-size: 80px; --el-color-primary: #1989fa; //--el-button-active-bg-color: linear-gradient(90deg, #0657C0 24%, #096AE0 101%); diff --git a/src/components/common/SoftKeyboard/index.vue b/src/components/common/SoftKeyboard/index.vue index 427762e..60449b6 100644 --- a/src/components/common/SoftKeyboard/index.vue +++ b/src/components/common/SoftKeyboard/index.vue @@ -2,7 +2,7 @@ import pinyinDict from 'libs/pinyinDict.json' import { useDeviceStore } from 'stores/deviceStore' import type { Ref } from 'vue' -import { computed, defineEmits, defineProps, onMounted, ref, watch, watchEffect } from 'vue' +import { computed, onMounted, ref, watch, watchEffect } from 'vue' const props = defineProps<{ modelValue: string @@ -22,11 +22,11 @@ const cnList = ref([]) const pinyinMap: Record = pinyinDict const pinyinValue = ref('') // 拖动相关状态 -const isDragging = ref(false)// 是否正在拖动 -const startX = ref(0)// 触摸起始 X -const startY = ref(0)// 触摸起始 Y -const x = ref(0)// 容器偏移 X -const y = ref(-50)// 容器偏移 Y +const isDragging = ref(false) // 是否正在拖动 +const startX = ref(0) // 触摸起始 X +const startY = ref(0) // 触摸起始 Y +const x = ref(0) // 容器偏移 X +const y = ref(-50) // 容器偏移 Y const keyboardRef = ref() as Ref // 软键盘容器 DOM onMounted(() => { @@ -50,12 +50,15 @@ watchEffect(() => { inputValue.value = props.modelValue }) -watch(() => props.isVisible, (newVal) => { - console.log('deviceStete.deviceType--2-', deviceStete.isLowCost) - if (!deviceStete.isLowCost) { - isOpen.value = newVal - } -}) +watch( + () => props.isVisible, + (newVal) => { + console.log('deviceStete.deviceType--2-', deviceStete.isLowCost) + if (!deviceStete.isLowCost) { + isOpen.value = newVal + } + }, +) const activeKey = ref('') const keyboardLayout = computed(() => { @@ -201,13 +204,18 @@ const handleTouchEnd = () => { >
- 拼音:{{ pinyinValue }} + 拼音:{{ pinyinValue }}
{{ cnName }}
@@ -225,12 +233,28 @@ const handleTouchEnd = () => { 'key-text': key !== ' ' && keyboardType === 'text', }" :style="keyboardType === 'number' ? 'height: 10vh' : 'height:3rem;'" - @click="(e) => { - e.stopPropagation() - handleKeyPress(key) - }" + @click=" + e => { + e.stopPropagation(); + handleKeyPress(key); + } + " > - {{ key === ' ' ? '空格' : key === 'del' ? '删除' : key === 'enter' ? '确认' : key === 'close' ? '关闭' : key === 'cn' ? '英文' : key === 'en' ? '拼音' : key }} + {{ + key === ' ' + ? '空格' + : key === 'del' + ? '删除' + : key === 'enter' + ? '确认' + : key === 'close' + ? '关闭' + : key === 'cn' + ? '英文' + : key === 'en' + ? '拼音' + : key + }}
@@ -258,7 +282,7 @@ const handleTouchEnd = () => { .keyboard-header { margin-bottom: 10px; position: absolute; - float:right; + float: right; } .keyboard-header button { @@ -273,20 +297,20 @@ const handleTouchEnd = () => { display: flex; flex-direction: column; gap: 8px; - .pinyin-container{ + .pinyin-container { display: flex; width: 80%; height: 4rem; padding-left: 2rem; - .pinyin-cn{ + .pinyin-cn { color: #1890ff; padding-left: 1rem; display: flex; width: 1rem; position: relative; - gap:5px; + gap: 5px; //font-family: fangsong; - .cn-name{ + .cn-name { font-size: 2.5rem; } } @@ -321,7 +345,7 @@ const handleTouchEnd = () => { .key-space { margin-top: 3.5px; - width: 75vw;; + width: 75vw; } .key-special { @@ -333,7 +357,7 @@ const handleTouchEnd = () => { transform: scale(0.95); } -.key-number{ +.key-number { width: 30vw; height: 6vh; margin: 5px; @@ -344,7 +368,7 @@ const handleTouchEnd = () => { height: 5vh; margin: 5px; } -.input-w{ +.input-w { width: 20%; height: 4rem; font-size: 2rem; @@ -357,7 +381,7 @@ const handleTouchEnd = () => { left: 0; width: 90%; border-radius: 16px; - box-shadow: 0 -4px 12px rgba(0,0,0,0.1); + box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1); overflow: hidden; z-index: 9999; /* 让拖动更顺滑 */ diff --git a/src/components/home/Environment.vue b/src/components/home/Environment.vue index 0b89a3c..0c5b88f 100644 --- a/src/components/home/Environment.vue +++ b/src/components/home/Environment.vue @@ -60,7 +60,7 @@ onMounted(() => { 温度
- {{ envParams.temp === -1 ? '--' : roundNumber(envParams.temp, 2) }}°C + {{ !envParams.temp || envParams.temp === -1 ? '--' : roundNumber(envParams.temp, 2) }}°C
@@ -68,7 +68,7 @@ onMounted(() => { 相对湿度
- {{ envParams.rh === -1 ? '--' : roundNumber(envParams.rh, 2) }}%RH + {{ !envParams.rh || envParams.rh === -1 ? '--' : roundNumber(envParams.rh, 2) }}%RH
@@ -76,7 +76,7 @@ onMounted(() => { 相对饱和度
- {{ envParams.rs === -1 ? '--' : roundNumber(envParams.rs, 2) }}%RS + {{ !envParams.rs || envParams.rs === -1 ? '--' : roundNumber(envParams.rs, 2) }}%RS
@@ -84,7 +84,7 @@ onMounted(() => { 汽化过氧化氢
- {{ envParams.h2o2 === -1 ? '--' : roundNumber(envParams.h2o2, 2) }}ppm + {{ !envParams.h2o2 || envParams.h2o2 === -1 ? '--' : roundNumber(envParams.h2o2, 2) }}ppm
diff --git a/src/components/setting/Device.vue b/src/components/setting/Device.vue index 1ca9c2a..b8d7dff 100644 --- a/src/components/setting/Device.vue +++ b/src/components/setting/Device.vue @@ -39,8 +39,8 @@ const screenHeight = ref(height) diff --git a/src/components/setting/User.vue b/src/components/setting/User.vue index 5dcee65..73b99d6 100644 --- a/src/components/setting/User.vue +++ b/src/components/setting/User.vue @@ -111,19 +111,16 @@ const handleSelectionChange = (users: User.UserItem[]) => {