暂停页面效果调整

This commit is contained in:
caozehui
2025-01-15 08:53:45 +08:00
parent 0cace11975
commit 72eb3e189b

View File

@@ -13,7 +13,7 @@
@click="handlePause()">停止检测
</el-button>
<el-button type="warning" v-if="testStatus === 'paused_ing' && percentage < 100" disabled>
<el-icon class="loading-box">
<el-icon class="loading-box" style="margin-right: 8px;">
<component :is="Refresh"/>
</el-icon>
暂停中
@@ -303,7 +303,6 @@ watch(testStatus, function (newValue, oldValue) {
if (newValue == 'start') {
ElMessage.success('初始化开始!')
startData.value = new Date();
showTestLog()
if (oldValue == 'error') {
@@ -315,6 +314,8 @@ watch(testStatus, function (newValue, oldValue) {
}
emit('update:testStatus', 'test_init')
//startTimer() // todo 可移除
startData.value = new Date();
timeDifference.value = 0;
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`})
}
})
@@ -418,9 +419,11 @@ watch(webMsgSend, function (newValue, oldValue) {
if (newValue.code == 25001) {
ElMessage.success('初始化成功!')
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:协议校验成功!`})
timeDifference.value = + new Date().getTime() - startData.value.getTime();
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化成功!`})
percentage.value = 3
activeIndex = getNextActiveIndex() + 2
//startTimer()
@@ -716,16 +719,20 @@ const updateCheckResult = (data: CheckData.ScriptChnItem) => {
checkResult.forEach(item => {
if (item.scriptType == scriptType) {
item.devices.forEach((device, index) => {
let targetDevice = data.devices.find(dev => dev.deviceId === device.deviceId)
for (let i = 0; i < item.devices.length; i++) {
let targetDevice = data.devices.find(dev => dev.deviceId === item.devices[i].deviceId)
if (targetDevice !== undefined) {
device.chnResult = [...targetDevice.chnResult]
item.devices[i].chnResult = [...targetDevice.chnResult]
}
}
// item.devices.forEach((device, index) => {
// let targetDevice = data.devices.find(dev => dev.deviceId === device.deviceId)
// if (targetDevice !== undefined) {
// device.chnResult = [...targetDevice.chnResult]
// }
// })
}
})
}
})
}
const scrollToBottom = () => {
@@ -768,12 +775,13 @@ const updateLog = (isStart: boolean) => {
let timeDifferenceItem = 0
if (activeIndex === 1 && isStart) {
timeDifference.value = 0;
// timeDifference.value = 0;
//testLogList.length = 0; // 清空数组
}
// debugger
if (activeIndex <= checkTotal) {
if (isStart) {
startData.value = new Date();
testLogList.push({
type: 'info',
log: currentTime.value + ` ${scriptData[activeIndex - 1].scriptName}准确度检测:开始`,
@@ -891,8 +899,8 @@ const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: Ch
// }
// {
// chnResult: [1, 1, 1, 1],
// deviceId: "2957b271f39d4240a1c5e275c453676c",
// deviceName: "测试003"
// deviceId: "461813a4f30f4a34a1a273ecd0379458",
// deviceName: "25011407"
// }
// ]
let temp = null