预检测出错

This commit is contained in:
sjl
2025-10-16 09:36:43 +08:00
parent 321b6c5465
commit 7d6dc55a76
5 changed files with 133 additions and 91 deletions

View File

@@ -47,6 +47,7 @@
:pqStandardDevList="prop.pqStandardDevList"
:planIdKey="prop.planIdKey"
:deviceMonitor="deviceMonitor2"
:dialogWidth="computedDialogWidth"
/>
</keep-alive>
<keep-alive>
@@ -135,7 +136,7 @@
</template>
<script lang="tsx" setup name="testPopup">
import { nextTick, reactive, ref, watch } from 'vue'
import { nextTick, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Coin, Edit, Key, Refresh, Right, SuccessFilled, Switch, VideoPause, VideoPlay } from '@element-plus/icons-vue'
import ComparePreTest from './comparePreTest.vue'
@@ -167,6 +168,25 @@ const dialogTitle = ref('')
const showComponent = ref(true)
const preTestRef = ref<InstanceType<typeof ComparePreTest> | null>(null)
const testRef: any = ref(null)
const windowWidth = ref(window.innerWidth)
const computedDialogWidth = ref(0)
// 监听窗口大小变化
const handleResize = () => {
windowWidth.value = window.innerWidth
// 计算对话框实际宽度 (90vw但不超过1550px不小于800px)
computedDialogWidth.value = Math.min(Math.max(window.innerWidth * 0.9, 800), 1550)
}
onMounted(() => {
window.addEventListener('resize', handleResize)
handleResize() // 初始化
})
onUnmounted(() => {
window.removeEventListener('resize', handleResize)
})
const prop = defineProps({
devIdList: {
@@ -414,13 +434,10 @@ const emit = defineEmits<{
}>()
watch(preTestStatus, function (newValue, oldValue) {
ActiveStatue.value = newValue
})
watch(TestStatus, function (newValue, oldValue) {
ActiveStatue.value = newValue
})
@@ -438,7 +455,7 @@ watch(stepsActiveIndex, function (newValue, oldValue) {
watch(ActiveStatue, function (newValue, oldValue) {
if (newValue === 'error') {
stepsActiveIndex.value = stepsTotalNum.value + 1
stepsActiveIndex.value += 0
nextStepText.value = '检测失败'
}
if (newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 1) {
@@ -446,15 +463,15 @@ watch(ActiveStatue, function (newValue, oldValue) {
nextStepText.value = '检测完成'
}
if (newValue === 'test_init_fail') {
stepsActiveIndex.value += 2
stepsActiveIndex.value += 0
nextStepText.value = '初始化失败'
}
if (newValue === 'connect_timeout') {
stepsActiveIndex.value += 2
stepsActiveIndex.value += 0
nextStepText.value = '连接超时'
}
if (newValue === 'pause_timeout') {
stepsActiveIndex.value += 2
stepsActiveIndex.value += 0
// nextStepText.value = '结束测试'
nextStepText.value = '暂停超时'
}
@@ -462,6 +479,7 @@ watch(ActiveStatue, function (newValue, oldValue) {
nextStep() // 实现自动点击,进入下一个测试内容
//handleSubmitFast()
}
})
const handleQuit = () => {