This commit is contained in:
GGJ
2025-01-15 08:42:59 +08:00
2 changed files with 15 additions and 11 deletions

View File

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

View File

@@ -28,21 +28,21 @@
@click="nextStep">跳过 @click="nextStep">跳过
</el-button> </el-button>
<el-button type="primary" :icon="VideoPlay" v-if="ActiveStatue === 'waiting'" @click="handleSubmit">开始检测</el-button> <el-button type="primary" :icon="VideoPlay" v-if="ActiveStatue === 'waiting'" @click="handleSubmit">开始检测</el-button>
<el-button type="primary" v-if="ActiveStatue === 'process'" @click="handleSubmit" disabled> <el-button type="primary" v-if="TestStatus === 'process'" @click="handleSubmit" disabled>
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;"> <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
<component :is="Refresh"/> <component :is="Refresh"/>
</el-icon> </el-icon>
检测中 检测中
</el-button> </el-button>
<el-button type="warning" :icon="VideoPlay" v-if="ActiveStatue === 'paused'" @click="handleSubmit">继续检测</el-button> <el-button type="warning" :icon="VideoPlay" v-if="TestStatus === 'paused'" @click="handleSubmit">继续检测</el-button>
<el-button type="primary" :icon="RefreshLeft" v-if="ActiveStatue === 'test_recheck'" @click="handleSubmit">重新检测</el-button> <el-button type="primary" :icon="RefreshLeft" v-if="TestStatus === 'test_recheck'" @click="handleSubmit">重新检测</el-button>
<el-button type="primary" v-if="ActiveStatue === 'test_init'" disabled> <el-button type="primary" v-if="TestStatus === 'test_init'" disabled>
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;"> <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
<component :is="Refresh"/> <component :is="Refresh"/>
</el-icon> </el-icon>
初始化中 初始化中
</el-button> </el-button>
<el-button type="warning" v-if="ActiveStatue === 'paused_ing'" disabled> <el-button type="warning" v-if="TestStatus === 'paused_ing'" disabled>
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;"> <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
<component :is="Refresh"/> <component :is="Refresh"/>
</el-icon> </el-icon>
@@ -377,7 +377,7 @@ watch(ActiveStatue, function (newValue, oldValue) {
const sendPause = () => { const sendPause = () => {
console.log('发起暂停请求') console.log('发起暂停请求')
ActiveStatue.value = 'paused_ing' TestStatus.value = 'paused_ing'
pauseTest() pauseTest()
} }
const sendResume = () => { const sendResume = () => {