This commit is contained in:
sjl
2025-03-17 16:03:53 +08:00
3 changed files with 145 additions and 77 deletions

View File

@@ -9,67 +9,67 @@
<span>检测用时{{ timeView }}</span>
</div>
<el-progress
style="width: 60%; margin-right: 4%;"
style="width: 82%; margin-right: 3%;"
:percentage="percentage"
:color="customColors"/>
<div style="width: 15%">
<el-button type="primary" v-if="testStatus=='test_init'" disabled @click="handlePause()">
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
<component :is="Refresh"/>
</el-icon>
初始化中
</el-button>
<!-- <div style="width: 15%">-->
<!-- <el-button type="primary" v-if="testStatus=='test_init'" disabled @click="handlePause()">-->
<!-- <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">-->
<!-- <component :is="Refresh"/>-->
<!-- </el-icon>-->
<!-- 初始化中-->
<!-- </el-button>-->
<el-button
type="primary"
v-if="testStatus=='process' && percentage < 100"
:icon="VideoPause"
@click="handlePause()">停止检测
</el-button>
<el-button type="warning" v-if="testStatus === 'paused_ing' && percentage < 100" disabled>
<el-icon class="loading-box" style="margin-right: 8px;">
<component :is="Refresh"/>
</el-icon>
暂停中
</el-button>
<!-- <el-button-->
<!-- type="primary"-->
<!-- v-if="testStatus=='test_init'"-->
<!-- :icon="VideoPause"-->
<!-- disabled>初始化中-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- v-if="testStatus=='test_init_fail'"-->
<!-- :icon="Failed"-->
<!-- disabled>初始化失败-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- v-if="testStatus=='connect_timeout'"-->
<!-- :icon="Failed"-->
<!-- disabled>连接超时-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- :icon="RefreshLeft"-->
<!-- v-if="testStatus === 'recheck'"-->
<!-- @click="emit('sendReCheck')">重新检测-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- v-if="testStatus=='process' && percentage < 100"-->
<!-- :icon="VideoPause"-->
<!-- @click="handlePause()">停止检测-->
<!-- </el-button>-->
<!-- <el-button type="warning" v-if="testStatus === 'paused_ing' && percentage < 100" disabled>-->
<!-- <el-icon class="loading-box" style="margin-right: 8px;">-->
<!-- <component :is="Refresh"/>-->
<!-- </el-icon>-->
<!-- 暂停中-->
<!-- </el-button>-->
<!-- &lt;!&ndash; <el-button&ndash;&gt;-->
<!-- &lt;!&ndash; type="primary"&ndash;&gt;-->
<!-- &lt;!&ndash; v-if="testStatus=='test_init'"&ndash;&gt;-->
<!-- &lt;!&ndash; :icon="VideoPause"&ndash;&gt;-->
<!-- &lt;!&ndash; disabled>初始化中&ndash;&gt;-->
<!-- &lt;!&ndash; </el-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-button&ndash;&gt;-->
<!-- &lt;!&ndash; type="danger"&ndash;&gt;-->
<!-- &lt;!&ndash; v-if="testStatus=='test_init_fail'"&ndash;&gt;-->
<!-- &lt;!&ndash; :icon="Failed"&ndash;&gt;-->
<!-- &lt;!&ndash; disabled>初始化失败&ndash;&gt;-->
<!-- &lt;!&ndash; </el-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-button&ndash;&gt;-->
<!-- &lt;!&ndash; type="danger"&ndash;&gt;-->
<!-- &lt;!&ndash; v-if="testStatus=='connect_timeout'"&ndash;&gt;-->
<!-- &lt;!&ndash; :icon="Failed"&ndash;&gt;-->
<!-- &lt;!&ndash; disabled>连接超时&ndash;&gt;-->
<!-- &lt;!&ndash; </el-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-button&ndash;&gt;-->
<!-- &lt;!&ndash; type="primary"&ndash;&gt;-->
<!-- &lt;!&ndash; :icon="RefreshLeft"&ndash;&gt;-->
<!-- &lt;!&ndash; v-if="testStatus === 'recheck'"&ndash;&gt;-->
<!-- &lt;!&ndash; @click="emit('sendReCheck')">重新检测&ndash;&gt;-->
<!-- &lt;!&ndash; </el-button>&ndash;&gt;-->
<el-button type="success" v-if="percentage >= 100" :icon="Check" disabled>检测完成</el-button>
<!-- <el-button type="success" v-if="percentage >= 100" :icon="Check" disabled>检测完成</el-button>-->
<el-button
type="warning"
v-if="(testStatus=='paused' || testStatus === 'pause_timeout') && percentage < 100"
:icon="VideoPlay"
:disabled="testStatus === 'pause_timeout'"
@click="emit('sendResume')"
>继续检测
</el-button>
</div>
<!-- <el-button-->
<!-- type="warning"-->
<!-- v-if="(testStatus=='paused' || testStatus === 'pause_timeout') && percentage < 100"-->
<!-- :icon="VideoPlay"-->
<!-- :disabled="testStatus === 'pause_timeout'"-->
<!-- @click="emit('sendResume')"-->
<!-- >继续检测-->
<!-- </el-button>-->
<!-- </div>-->
<el-button style="width: 10%" type="text" :icon="InfoFilled" @click="showTestLog">检测项进度</el-button>
</div>
@@ -1244,7 +1244,7 @@ const startTimer = () => {
}
};
const handlePause = () => {
emit('sendPause')
//emit('sendPause')
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:当前测试小项正在执行中,将在该小项执行结束后暂停...`})
}
@@ -1430,6 +1430,10 @@ onBeforeUnmount(() => {
clearInterval(timer)
}
})
defineExpose({
handlePause
})
</script>
<style scoped lang="scss">
@@ -1481,7 +1485,6 @@ onBeforeUnmount(() => {
.timeView {
display: flex;
align-items: center;
color: #91cc75;
width: 28%;
margin-right: 0px;
@@ -1517,7 +1520,6 @@ onBeforeUnmount(() => {
:deep(header.el-drawer__header) {
color: #fff !important;
background-color: var(--el-color-primary) !important;
.el-drawer__close-btn svg:hover {
color: #ccc !important;
}