This commit is contained in:
caozehui
2025-03-17 13:24:35 +08:00
parent 630eb48d28
commit eda7b516f6
2 changed files with 116 additions and 66 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>
@@ -1428,6 +1428,10 @@ onBeforeUnmount(() => {
clearInterval(timer)
}
})
defineExpose({
handlePause
})
</script>
<style scoped lang="scss">
@@ -1480,7 +1484,8 @@ onBeforeUnmount(() => {
display: flex;
align-items: center;
color: #67c23a;;
//color: #67c23a;
color: #91cc75;
width: 28%;
margin-right: 0px;
text-align: left;

View File

@@ -16,28 +16,30 @@
<timeTest v-if="showComponent&&timeTestSelected" v-show="timeTestSelected && stepsActiveView==2" v-model:testStatus="timeTestStatus"/>
<!-- <channelsTest v-if="stepsActiveIndex === 3" v-model:testStatus="channelsTestStatus"></channelsTest>-->
<factorTest v-if="showComponent&&channelsTestSelected" v-show="channelsTestSelected && stepsActiveView==3" v-model:testStatus="channelsTestStatus" :webMsgSend="webMsgSend"/>
<test v-if="showComponent&&testSelected" v-show="testSelected && stepsActiveView==4" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend"
<test v-if="showComponent&&testSelected" ref="testRef" v-show="testSelected && stepsActiveView==4" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend"
@update:webMsgSend="webMsgSend=$event" @sendPause="sendPause" @sendResume="sendResume" @sendReCheck="sendReCheck" :stepsActive="stepsActive"/>
<template #footer>
<div>
<!-- <el-button type="primary" :icon="DArrowRight" v-if="stepsActiveIndex < stepsTotalNum && ActiveStatue != 'success'" @click="nextStep">跳过</el-button>-->
<el-button type="primary" :icon="VideoPlay" v-if="ActiveStatue === 'waiting'" @click="handleSubmit">开始检测</el-button>
<el-button type="primary"
v-if="(stepsActiveIndex <= stepsTotalNum - 1) && (ActiveStatue !== 'success' &&ActiveStatue !== 'test_init' && ActiveStatue !=='paused_ing' && ActiveStatue !=='paused' && ActiveStatue !== 'waiting' && ActiveStatue !== 'error' && ActiveStatue !== 'test_init_fail' && ActiveStatue !== 'connect_timeout' && ActiveStatue!=='pause_timeout')"
disabled>
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
<component :is="Refresh"/>
</el-icon>
检测中
</el-button>
<!-- <el-button type="primary"-->
<!-- v-if="(stepsActiveIndex <= stepsTotalNum - 1) && (ActiveStatue !== 'success' &&ActiveStatue !== 'test_init' && ActiveStatue !=='paused_ing' && ActiveStatue !=='paused' && ActiveStatue !== 'waiting' && ActiveStatue !== 'error' && ActiveStatue !== 'test_init_fail' && ActiveStatue !== 'connect_timeout' && ActiveStatue!=='pause_timeout')"-->
<!-- disabled>-->
<!-- <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">-->
<!-- <component :is="Refresh"/>-->
<!-- </el-icon>-->
<!-- 检测中-->
<!-- </el-button>-->
<!-- <el-button type="primary" v-if="ActiveStatue === 'process'" disabled>-->
<!-- <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">-->
<!-- <component :is="Refresh"/>-->
<!-- </el-icon>-->
<!-- 检测中-->
<!-- </el-button>-->
<el-button type="warning" :icon="VideoPlay" v-if="TestStatus === '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 === 'recheck' || ActiveStatue ==='error' || ActiveStatue ==='test_init_fail' || ActiveStatue === 'pause_timeout' || ActiveStatue === 'connect_timeout'" @click="handleSubmit">重新检测</el-button>-->
<el-button type="primary" v-if="TestStatus === 'test_init'" disabled>
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
@@ -45,17 +47,34 @@
</el-icon>
初始化中
</el-button>
<el-button
type="primary"
v-if="TestStatus=='process'"
:icon="VideoPause"
@click="handlePause()">停止检测
</el-button>
<el-button type="warning" v-if="TestStatus === 'paused_ing'" disabled>
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
<component :is="Refresh"/>
</el-icon>
暂停中
</el-button>
<el-button
type="warning"
v-if="(TestStatus =='paused')"
:icon="VideoPlay"
@click="sendResume"
>继续检测
</el-button>
<el-button :type="ActiveStatue==='success'?'primary':'danger'" :icon="Right"
v-if="nextStepText !== '下一步' && (ActiveStatue === 'success'||ActiveStatue==='error'||ActiveStatue==='test_init_fail'||ActiveStatue==='connect_timeout'||ActiveStatue==='pause_timeout')"
@click="nextStep">
{{ nextStepText }}
</el-button>
<el-button type="primary" @click="handleQuit" v-else>
退出检测
</el-button>
</div>
</template>
</el-dialog>
@@ -66,7 +85,7 @@
<script lang="tsx" setup name="testPopup">
import {reactive, ref, watch} from 'vue';
import {ElMessage, ElMessageBox} from 'element-plus'
import {Coin, DArrowRight, Edit, Key, Odometer, Refresh, Right, SuccessFilled, UploadFilled, VideoPlay} from '@element-plus/icons-vue'
import {Coin, DArrowRight, Edit, Key, Odometer, Refresh, Right, SuccessFilled, UploadFilled, VideoPlay,VideoPause} from '@element-plus/icons-vue'
import preTest from './preTest.vue'
import timeTest from './timeTest.vue'
import factorTest from './factorTest.vue'
@@ -93,6 +112,7 @@ const webMsgSend = ref();//webSocket推送的数据
const dialogTitle = ref('')
const showComponent = ref(true)
const preTestRef = ref(null)
const testRef = ref(null)
const dataSocket = reactive({
socketServe: socketClient.Instance,
@@ -302,6 +322,20 @@ watch(ActiveStatue, function (newValue, oldValue) {
})
const handleQuit = () => {
console.log('handleQuit',ActiveStatue.value)
if (ActiveStatue.value !== 'success' && ActiveStatue.value !== 'waiting' && ActiveStatue.value !== 'paused' && ActiveStatue.value !== 'test_init_fail' && ActiveStatue.value !== 'connect_timeout' && ActiveStatue.value !== 'pause_timeout') {
beforeClose(() => {})
} else {
handleClose()
}
}
const handlePause=()=>{
sendPause()
testRef.value?.handlePause()
}
const sendPause = () => {
console.log('发起暂停请求')
@@ -440,6 +474,17 @@ defineExpose({open})
<style scoped lang="scss">
.test-head-steps {
::v-deep .el-step {
.el-step__head.is-success {
color: #91cc75;
}
.el-step__title.is-success{
color: #91cc75;
}
}
}
:deep(.dialog-big .el-dialog__body) {
max-height: 840px !important;
}