diff --git a/src/components/liquid/LiquidLevel.vue b/src/components/liquid/LiquidLevel.vue index 389145d..6884f6e 100644 --- a/src/components/liquid/LiquidLevel.vue +++ b/src/components/liquid/LiquidLevel.vue @@ -62,9 +62,9 @@ const liquidHeight = computed(() => { display: flex; gap: 5px; } -.liquid-level-container{ +.liquid-level-container { position: relative; - height: 60vh;; /* 根据实际调整 */ + height: 60vh; /* 根据实际调整 */ } .liquid-level-img-l { height: 62.5vh; @@ -79,26 +79,27 @@ const liquidHeight = computed(() => { left: 0; width: 100%; background: linear-gradient(to top, #0099ff, #7fc8fa); /* 颜色渐变,可按需调整 */ - min-height: .8rem; + min-height: 0.8rem; border-radius: 0 0 20px 20px; } -.liquid-level-middle{ - background: linear-gradient(352deg, #0093f5, #effafe); - bottom: 0; - left: 0; - position: absolute; - width: 50%; - z-index: 1; - margin-left: 23% +.liquid-level-middle { + background: linear-gradient(352deg, #0093f5, #effafe); + bottom: 0; + left: 0; + position: absolute; + width: 50%; + z-index: 1; + margin-left: 23%; } .current-level { + width: 100%; + display: flex; + justify-content: center; position: absolute; top: 2rem; - left: 50%; - transform: translateX(-50%); font-size: 1.3rem; font-weight: bold; - .text{ + .text { color: #007bff; padding: 3px; } diff --git a/src/views/seal/index.vue b/src/views/seal/index.vue index 25bfb23..b25fe8b 100644 --- a/src/views/seal/index.vue +++ b/src/views/seal/index.vue @@ -23,9 +23,7 @@ const leakRemainingTime = computed(() => sealStore.leakRemainingTime) const currentPressure = computed(() => sealStore.currentPressure) const diffPressure = computed(() => { if (sealInfo.value.workState === 'leakTesting') { - return Math.abs( - Number(currentPressure.value) - Number(initialPressure.value), - ) + return Math.abs(Number(currentPressure.value) - Number(initialPressure.value)) } return 0 }) @@ -46,16 +44,16 @@ watch( ) onMounted(async () => { - const res = await sendCmd({ className: 'AirLeakDetectTest', fnName: 'getServiceConfig', params: { inflationTimeMs: 0.3 } }) + const res = await sendCmd({ + className: 'AirLeakDetectTest', + fnName: 'getServiceConfig', + params: { inflationTimeMs: 0.3 }, + }) inflationTime.value = res.inflationTimeMs }) -const stopText = computed(() => - sealInfo.value.workState === 'stopping' ? '停止中...' : '停止测试', -) -const stopDisabled = computed(() => - sealInfo.value.workState === 'stopping' || sealInfo.value.workState === 'idle', -) +const stopText = computed(() => (sealInfo.value.workState === 'stopping' ? '停止中...' : '停止测试')) +const stopDisabled = computed(() => sealInfo.value.workState === 'stopping' || sealInfo.value.workState === 'idle') function onStartTest() { const statusName = getDeviceStatus() @@ -74,7 +72,9 @@ function onStartTest() { FtMessage.error('指令发送失败,请稍候再试') } }) - .finally(() => { loading.value = false }) + .finally(() => { + loading.value = false + }) } function onFinishTest() { @@ -86,7 +86,9 @@ function onFinishTest() { FtMessage.success('测试已停止') } }) - .finally(() => { loading.value = false }) + .finally(() => { + loading.value = false + }) } function handleConfirm(value: string) { @@ -195,7 +197,7 @@ function handleConfirm(value: string) { v-model="inputValue" :is-visible="keyboardVisible" :keyboard-type="keyboardType" - @update-keyboard-visible="(visible: boolean) => keyboardVisible = visible" + @update-keyboard-visible="(visible: boolean) => (keyboardVisible = visible)" @confirm="handleConfirm" @close="keyboardVisible = false" /> @@ -203,48 +205,49 @@ function handleConfirm(value: string) {