微调
This commit is contained in:
@@ -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'"-->
|
||||
<!-- v-if="testStatus=='process' && percentage < 100"-->
|
||||
<!-- :icon="VideoPause"-->
|
||||
<!-- disabled>初始化中-->
|
||||
<!-- @click="handlePause()">停止检测-->
|
||||
<!-- </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 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="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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -13,17 +13,23 @@
|
||||
<el-input v-model.trim="formContent.name" placeholder="请输入脚本名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="参照标准名称" prop="standardName">
|
||||
<el-input v-model.trim="formContent.standardName" placeholder="请输入参照标准名称" clearable />
|
||||
<!-- <el-input v-model.trim="formContent.standardName" placeholder="请输入参照标准名称" clearable />-->
|
||||
<el-select v-model="formContent.standardName" filterable placeholder="请选择参照标准名称" @change="setStandardTimeList">
|
||||
<el-option v-for="item in standardNameList" :key="item.label" :label="item.label" :value="item.label" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标准推行年份" prop="standardTime">
|
||||
<el-date-picker
|
||||
v-model="formContent.standardTime"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
format="YYYY"
|
||||
value-format="YYYY"
|
||||
placeholder="请选择标准推行年份"
|
||||
/>
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="formContent.standardTime"-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- type="year"-->
|
||||
<!-- format="YYYY"-->
|
||||
<!-- value-format="YYYY"-->
|
||||
<!-- placeholder="请选择标准推行年份"-->
|
||||
<!-- />-->
|
||||
<el-select v-model="formContent.standardTime" filterable placeholder="请选择标准推行年份">
|
||||
<el-option v-for="item in standardTimeList" :key="item" :value="item" :label="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="模版类型" prop="type">
|
||||
<el-select v-model="formContent.type" filterable clearable placeholder="请选择模版类型">
|
||||
@@ -100,6 +106,8 @@ const modeId = ref()
|
||||
const show = ref(false)
|
||||
const height = ref('125px')
|
||||
const router = useRouter()
|
||||
const standardNameList = reactive<{id:string,label: string, value: string}[]>([])
|
||||
const standardTimeList = reactive<Array<string>>([])
|
||||
|
||||
const secondLevelOptions: any[] = []
|
||||
// 定义弹出组件元信息
|
||||
@@ -166,6 +174,15 @@ const close = () => {
|
||||
// 关闭信息弹框
|
||||
const closeInformation = () => {}
|
||||
|
||||
const setStandardTimeList = ()=>{
|
||||
let checkStandard = standardNameList.find(item => item.label === formContent.value.standardName)
|
||||
if (checkStandard) {
|
||||
standardTimeList.push(...checkStandard.value.split(','))
|
||||
} else {
|
||||
standardTimeList.push('2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024', '2025')
|
||||
}
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
// dialogFormRef
|
||||
@@ -197,6 +214,10 @@ const save = () => {
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (title: string, row: any) => {
|
||||
dictStore.getDictData("Script_Standard_Name").forEach(item => {
|
||||
standardNameList.push({id: item.id, label: item.name, value: item.value})
|
||||
})
|
||||
|
||||
titleType.value = title
|
||||
if (title == '新增检测脚本') {
|
||||
show.value = false
|
||||
|
||||
Reference in New Issue
Block a user