暂停页面效果调整

This commit is contained in:
caozehui
2025-01-14 21:07:52 +08:00
parent cb4e4646bd
commit 15502d0107
2 changed files with 15 additions and 11 deletions

View File

@@ -10,10 +10,10 @@
type="primary"
v-if="testStatus=='process' && percentage < 100"
:icon="VideoPause"
@click="emit('sendPause')">停止检测
@click="handlePause()">停止检测
</el-button>
<el-button type="warning" v-if="testStatus === 'paused_ing'" disabled>
<el-icon class="loading-box" style="margin-right: 8px;">
<el-button type="warning" v-if="testStatus === 'paused_ing' && percentage < 100" disabled>
<el-icon class="loading-box">
<component :is="Refresh"/>
</el-icon>
暂停中
@@ -433,7 +433,7 @@ watch(webMsgSend, function (newValue, oldValue) {
if(newValue.operateCode == 'stop'){
ElMessage.success('暂停成功')
emit('update:testStatus', 'paused')
handlePauseTest()
pauseSuccessCallback()
}
break;
// case 'Pause_Fail':
@@ -1276,8 +1276,12 @@ const startTimer = () => {
break;
}
};
const handlePause = () => {
emit('sendPause')
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:当前测试小项正在执行中,将在该小项执行结束后暂停...`})
}
const handlePauseTest = () => {
const pauseSuccessCallback = () => {
endData.value = new Date();
let diffTime = endData.value.getTime() - startData.value.getTime();
timeDifference.value += diffTime