处理正式检测bug
This commit is contained in:
@@ -52,8 +52,8 @@ export namespace CheckData {
|
|||||||
export enum ChnCheckResultEnum {
|
export enum ChnCheckResultEnum {
|
||||||
UNKNOWN = -1,
|
UNKNOWN = -1,
|
||||||
LOADING = 0,
|
LOADING = 0,
|
||||||
FAIL = 1,
|
SUCCESS = 1,
|
||||||
SUCCESS = 2,
|
FAIL = 2,
|
||||||
UNCONNECTED=3,
|
UNCONNECTED=3,
|
||||||
ERRORDATA = 4
|
ERRORDATA = 4
|
||||||
}
|
}
|
||||||
@@ -71,12 +71,20 @@ export namespace CheckData {
|
|||||||
}>
|
}>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum ButtonColorEnum {
|
||||||
|
INFO = '#909399',
|
||||||
|
LOADING = '#607eab',
|
||||||
|
SUCCESS = '#67c23a',
|
||||||
|
WARNING ='#e6a23c',
|
||||||
|
DANGER = '#f56c6c',
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于描述 (设备)通道检测结果展示的按钮类型
|
* 用于描述 (设备)通道检测结果展示的按钮类型
|
||||||
*/
|
*/
|
||||||
export interface ButtonResult {
|
export interface ButtonResult {
|
||||||
resultType: 'info' | 'info' | 'danger' | 'success' | 'warning'
|
color: ButtonColorEnum
|
||||||
resultIcon: 'Minus' | 'Loading' | 'Close' | 'CircleCheckFilled' | 'WarnTriangleFilled'
|
icon: 'Minus' | 'Loading' | 'Close' | 'CircleCheckFilled' | 'Link' | 'WarnTriangleFilled'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,7 +107,7 @@ export namespace CheckData {
|
|||||||
* 定义检测日志类型
|
* 定义检测日志类型
|
||||||
*/
|
*/
|
||||||
export interface LogItem {
|
export interface LogItem {
|
||||||
type: 'info' | 'error'
|
type: 'info' | 'warning' | 'error'
|
||||||
log: string
|
log: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dialog-content">
|
<div class="dialog-content">
|
||||||
<el-table :data="checkResultView" :cell-class-name="tableCell" row-key="scriptId" height="450px"
|
<el-table :data="checkResultView" row-key="scriptId" height="450px"
|
||||||
:header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%"
|
:header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%"
|
||||||
border>
|
border>
|
||||||
<el-table-column fixed prop="scriptName" label="检测项目" width="140px" align="center">
|
<el-table-column fixed prop="scriptName" label="检测项目" width="140px" align="center">
|
||||||
@@ -51,16 +51,24 @@
|
|||||||
:label="'通道'+chnItem" align="center">
|
:label="'通道'+chnItem" align="center">
|
||||||
<template #default="{row}">
|
<template #default="{row}">
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
:content="row.devices[index1].chnResult[index2].resultType==='info' ? '暂无数据' : '点击查看详情'"
|
:content="row.devices[index1].chnResult[index2].color===CheckData.ButtonColorEnum.INFO ? '暂无数据' : '点击查看详情'"
|
||||||
placement="top">
|
placement="top">
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="row.devices[index1].chnResult[index2].resultType=='info'"
|
:disabled="row.devices[index1].chnResult[index2].color==CheckData.ButtonColorEnum.INFO"
|
||||||
:type="row.devices[index1].chnResult[index2].resultType"
|
:color="row.devices[index1].chnResult[index2].color"
|
||||||
size="small"
|
size="small"
|
||||||
@click="handleClick(row.scriptId,item.deviceId,chnItem)"
|
@click="handleClick(row.scriptId,item.deviceId,chnItem)"
|
||||||
style="align-self: center;"
|
style="align-self: center;"
|
||||||
:icon="row.devices[index1].chnResult[index2].resultIcon"
|
>
|
||||||
/>
|
<el-icon v-if="row.devices[index1].chnResult[index2].icon==='Loading'" class="loading-box"
|
||||||
|
style="color: #fff">
|
||||||
|
<component :is="Loading"/>
|
||||||
|
</el-icon>
|
||||||
|
<el-icon v-else style="color: #fff">
|
||||||
|
<component :is="row.devices[index1].chnResult[index2].icon"/>
|
||||||
|
</el-icon>
|
||||||
|
</el-button>
|
||||||
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -68,18 +76,26 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-table-column v-for="(item,index) in deviceList" :key="item.deviceId" :label="item.deviceName"
|
<el-table-column v-for="(item,index1) in deviceList" :key="item.deviceId" :label="item.deviceName"
|
||||||
:min-width="110" align="center">
|
:min-width="110" align="center">
|
||||||
<template #default="{row}">
|
<template #default="{row}">
|
||||||
<el-tooltip :content="row.devices[index].chnResult[0].resultType==='info' ? '暂无数据' : '点击查看详情'"
|
<el-tooltip
|
||||||
|
:content="row.devices[index1].chnResult[0].color===CheckData.ButtonColorEnum.INFO ? '暂无数据' : '点击查看详情'"
|
||||||
placement="top">
|
placement="top">
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="row.devices[index].chnResult[0].resultType=='info'"
|
:disabled="row.devices[index1].chnResult[0].color===CheckData.ButtonColorEnum.INFO"
|
||||||
:type="row.devices[index].chnResult[0].resultType"
|
:color="row.devices[index1].chnResult[0].color"
|
||||||
size="small"
|
size="small"
|
||||||
@click="handleClick(row.scriptId,item.deviceId,-1)"
|
@click="handleClick(row.scriptId,item.deviceId,-1)"
|
||||||
:icon="row.devices[index1].chnResult[index2].resultIcon"
|
>
|
||||||
/>
|
<el-icon v-if="row.devices[index1].chnResult[0].icon==='Loading'" class="loading-box"
|
||||||
|
style="color: #fff">
|
||||||
|
<component :is="Loading"/>
|
||||||
|
</el-icon>
|
||||||
|
<el-icon v-else style="color: #fff">
|
||||||
|
<component :is="row.devices[index1].chnResult[0].icon"/>
|
||||||
|
</el-icon>
|
||||||
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -97,7 +113,7 @@
|
|||||||
<div ref="scrollContainer">
|
<div ref="scrollContainer">
|
||||||
<p v-for="(item, index) in testLogList"
|
<p v-for="(item, index) in testLogList"
|
||||||
:key="index"
|
:key="index"
|
||||||
:style="{color:item.type==='error'?'#F56C6C':'var(--el-text-color-regular)'}">
|
:style="{color:item.type==='error'?'#F56C6C': item.type==='warning'?'#e6a23c':'var(--el-text-color-regular)'}">
|
||||||
{{ item.log }}<br/>
|
{{ item.log }}<br/>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -111,7 +127,18 @@
|
|||||||
<dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
|
<dataCheckSingleChannelSingleTestPopup ref="dataCheckSingleChannelSingleTestPopupRef"/>
|
||||||
</template>
|
</template>
|
||||||
<script lang="tsx" setup name="test">
|
<script lang="tsx" setup name="test">
|
||||||
import {Check, InfoFilled, Refresh, VideoPause} from '@element-plus/icons-vue'
|
import {
|
||||||
|
Check,
|
||||||
|
InfoFilled,
|
||||||
|
Refresh,
|
||||||
|
VideoPause,
|
||||||
|
Minus,
|
||||||
|
Close,
|
||||||
|
CircleCheckFilled,
|
||||||
|
WarnTriangleFilled,
|
||||||
|
Loading,
|
||||||
|
Link
|
||||||
|
} from '@element-plus/icons-vue'
|
||||||
import resultPopup from './resultPopup.vue'
|
import resultPopup from './resultPopup.vue'
|
||||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||||
import {reactive, ref, watch} from "vue";
|
import {reactive, ref, watch} from "vue";
|
||||||
@@ -122,10 +149,10 @@ import {useCheckStore} from "@/stores/modules/check";
|
|||||||
const checkStore = useCheckStore()
|
const checkStore = useCheckStore()
|
||||||
|
|
||||||
// 最大通道数
|
// 最大通道数
|
||||||
const MAX_CHN_SUM = 10
|
const MAX_CHN_SUM = 8
|
||||||
|
|
||||||
// 总测试项数
|
// 总测试项数
|
||||||
const checkTotal = ref(0)
|
let checkTotal = 0
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
testStatus: {
|
testStatus: {
|
||||||
@@ -149,7 +176,7 @@ const scriptData = reactive<CheckData.ScriptItem[]>([])
|
|||||||
// 用来保存被检设备
|
// 用来保存被检设备
|
||||||
const deviceList = reactive<CheckData.Device[]>([])
|
const deviceList = reactive<CheckData.Device[]>([])
|
||||||
// 当前进行的测试项索引
|
// 当前进行的测试项索引
|
||||||
const activeIndex = ref(0)
|
let activeIndex = 1
|
||||||
// 百分比
|
// 百分比
|
||||||
const percentage = ref(0);
|
const percentage = ref(0);
|
||||||
//测试项开始检测时间(或继续检测时间)
|
//测试项开始检测时间(或继续检测时间)
|
||||||
@@ -160,9 +187,9 @@ const timeDifference = ref(0)
|
|||||||
// 真正的检测结果(详细到通道)
|
// 真正的检测结果(详细到通道)
|
||||||
const checkResult = reactive<CheckData.ScriptChnItem[]>([])
|
const checkResult = reactive<CheckData.ScriptChnItem[]>([])
|
||||||
// 用来存放检测出现失败的测试项id。只要有一个通道检测不合格,则该检测项的id会被加入该数组。
|
// 用来存放检测出现失败的测试项id。只要有一个通道检测不合格,则该检测项的id会被加入该数组。
|
||||||
const errorCheckItem = reactive<string[]>([]);
|
let errorCheckItem:Array<{ scriptId: string, type: 'info' | 'warning' | 'error' }> = []
|
||||||
// 用来存放检测日志
|
// 用来存放检测日志
|
||||||
const testLogList = ref<CheckData.LogItem[]>([{type: 'info', log: '暂无数据,等待检测开始'}])
|
const testLogList = reactive<CheckData.LogItem[]>([{type: 'info', log: '暂无数据,等待检测开始'}])
|
||||||
|
|
||||||
const testStatus = toRef(props, 'testStatus')
|
const testStatus = toRef(props, 'testStatus')
|
||||||
const webMsgSend = toRef(props, 'webMsgSend')
|
const webMsgSend = toRef(props, 'webMsgSend')
|
||||||
@@ -198,19 +225,22 @@ const checkResultView = computed(() => {
|
|||||||
for (let j = 0; j < device.chnResult.length; j++) {
|
for (let j = 0; j < device.chnResult.length; j++) {
|
||||||
switch (device.chnResult[j]) {
|
switch (device.chnResult[j]) {
|
||||||
case CheckData.ChnCheckResultEnum.UNKNOWN:
|
case CheckData.ChnCheckResultEnum.UNKNOWN:
|
||||||
tempChnBtnResult.push({resultType: 'info', resultIcon: 'Minus'})
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Minus'})
|
||||||
break;
|
break;
|
||||||
case CheckData.ChnCheckResultEnum.LOADING:
|
case CheckData.ChnCheckResultEnum.LOADING:
|
||||||
tempChnBtnResult.push({resultType: 'info', resultIcon: 'Loading'})
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Loading'})
|
||||||
break;
|
|
||||||
case CheckData.ChnCheckResultEnum.FAIL:
|
|
||||||
tempChnBtnResult.push({resultType: 'danger', resultIcon: 'Close'})
|
|
||||||
break;
|
break;
|
||||||
case CheckData.ChnCheckResultEnum.SUCCESS:
|
case CheckData.ChnCheckResultEnum.SUCCESS:
|
||||||
tempChnBtnResult.push({resultType: 'success', resultIcon: 'CircleCheckFilled'})
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.SUCCESS, icon: 'CircleCheckFilled'})
|
||||||
|
break;
|
||||||
|
case CheckData.ChnCheckResultEnum.FAIL:
|
||||||
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.DANGER, icon: 'Close'})
|
||||||
break;
|
break;
|
||||||
case CheckData.ChnCheckResultEnum.UNCONNECTED:
|
case CheckData.ChnCheckResultEnum.UNCONNECTED:
|
||||||
tempChnBtnResult.push({resultType: 'warning', resultIcon: 'WarnTriangleFilled'})
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.WARNING, icon: 'Link'})
|
||||||
|
break;
|
||||||
|
case CheckData.ChnCheckResultEnum.ERRORDATA:
|
||||||
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.WARNING, icon: 'WarnTriangleFilled'})
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -223,19 +253,22 @@ const checkResultView = computed(() => {
|
|||||||
}
|
}
|
||||||
switch (tempChnResult) {
|
switch (tempChnResult) {
|
||||||
case CheckData.ChnCheckResultEnum.UNKNOWN:
|
case CheckData.ChnCheckResultEnum.UNKNOWN:
|
||||||
tempChnBtnResult.push({resultType: 'info', resultIcon: 'Minus'})
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Minus'})
|
||||||
break;
|
break;
|
||||||
case CheckData.ChnCheckResultEnum.LOADING:
|
case CheckData.ChnCheckResultEnum.LOADING:
|
||||||
tempChnBtnResult.push({resultType: 'info', resultIcon: 'Loading'})
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.INFO, icon: 'Loading'})
|
||||||
break;
|
|
||||||
case CheckData.ChnCheckResultEnum.FAIL:
|
|
||||||
tempChnBtnResult.push({resultType: 'danger', resultIcon: 'Close'})
|
|
||||||
break;
|
break;
|
||||||
case CheckData.ChnCheckResultEnum.SUCCESS:
|
case CheckData.ChnCheckResultEnum.SUCCESS:
|
||||||
tempChnBtnResult.push({resultType: 'success', resultIcon: 'CircleCheckFilled'})
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.SUCCESS, icon: 'CircleCheckFilled'})
|
||||||
|
break;
|
||||||
|
case CheckData.ChnCheckResultEnum.FAIL:
|
||||||
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.DANGER, icon: 'Close'})
|
||||||
break;
|
break;
|
||||||
case CheckData.ChnCheckResultEnum.UNCONNECTED:
|
case CheckData.ChnCheckResultEnum.UNCONNECTED:
|
||||||
tempChnBtnResult.push({resultType: 'warning', resultIcon: 'WarnTriangleFilled'})
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.WARNING, icon: 'Link'})
|
||||||
|
break;
|
||||||
|
case CheckData.ChnCheckResultEnum.ERRORDATA:
|
||||||
|
tempChnBtnResult.push({color: CheckData.ButtonColorEnum.WARNING, icon: 'WarnTriangleFilled'})
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -250,7 +283,6 @@ const checkResultView = computed(() => {
|
|||||||
})
|
})
|
||||||
return temp
|
return temp
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -263,142 +295,184 @@ watch(testStatus, function (newValue, oldValue) {
|
|||||||
handlePauseOrContinue()
|
handlePauseOrContinue()
|
||||||
}
|
}
|
||||||
if (newValue === 'process' && oldValue == 'paused') {
|
if (newValue === 'process' && oldValue == 'paused') {
|
||||||
|
activeIndex++
|
||||||
handlePauseOrContinue()
|
handlePauseOrContinue()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(webMsgSend, function (newValue, oldValue) {
|
watch(webMsgSend, function (newValue, oldValue) {
|
||||||
if (activeIndex.value <= checkTotal.value) {
|
if (activeIndex <= checkTotal) {
|
||||||
switch (newValue.requestId) {
|
switch (newValue.requestId) {
|
||||||
case 'Test_Freq_Start':
|
case 'Test_Freq_Start':
|
||||||
updateCheckResultView("Freq", true)
|
updateCheckResultView("Freq", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_Freq_End':
|
case 'Test_Freq_End':
|
||||||
updateCheckResultView("Freq", false)
|
updateCheckResultView("Freq", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_VOL_Start':
|
case 'Test_VOL_Start':
|
||||||
updateCheckResultView("VOL", true)
|
updateCheckResultView("VOL", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_VOL_End':
|
case 'Test_VOL_End':
|
||||||
updateCheckResultView("VOL", false)
|
updateCheckResultView("VOL", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_Harm_V_Start':
|
case 'Test_Harm_V_Start':
|
||||||
updateCheckResultView("Harm_V", true)
|
updateCheckResultView("Harm_V", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_Harm_V_End':
|
case 'Test_Harm_V_End':
|
||||||
updateCheckResultView("Harm_V", false)
|
updateCheckResultView("Harm_V", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_Harm_I_Start':
|
case 'Test_Harm_I_Start':
|
||||||
updateCheckResultView("Harm_I", true)
|
updateCheckResultView("Harm_I", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_Harm_I_End':
|
case 'Test_Harm_I_End':
|
||||||
updateCheckResultView("Harm_I", false)
|
updateCheckResultView("Harm_I", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_Harm_P_Start':
|
case 'Test_Harm_P_Start':
|
||||||
updateCheckResultView("Harm_P", true)
|
updateCheckResultView("Harm_P", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_Harm_P_End':
|
case 'Test_Harm_P_End':
|
||||||
updateCheckResultView("Harm_P", false)
|
updateCheckResultView("Harm_P", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_InHarm_V_Start':
|
case 'Test_InHarm_V_Start':
|
||||||
updateCheckResultView("InHarm_V", true)
|
updateCheckResultView("InHarm_V", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_InHarm_V_End':
|
case 'Test_InHarm_V_End':
|
||||||
updateCheckResultView("InHarm_V", false)
|
updateCheckResultView("InHarm_V", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_InHarm_I_Start':
|
case 'Test_InHarm_I_Start':
|
||||||
updateCheckResultView("InHarm_I", true)
|
updateCheckResultView("InHarm_I", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_InHarm_I_End':
|
case 'Test_InHarm_I_End':
|
||||||
updateCheckResultView("InHarm_I", false)
|
updateCheckResultView("InHarm_I", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_Dip_Start':
|
case 'Test_Dip_Start':
|
||||||
updateCheckResultView("Dip", true)
|
updateCheckResultView("Dip", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_Dip_End':
|
case 'Test_Dip_End':
|
||||||
updateCheckResultView("Dip", false)
|
updateCheckResultView("Dip", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_CUR_Start':
|
case 'Test_CUR_Start':
|
||||||
updateCheckResultView("CUR", true)
|
updateCheckResultView("CUR", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_CUR_End':
|
case 'Test_CUR_End':
|
||||||
updateCheckResultView("CUR", false)
|
updateCheckResultView("CUR", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_MSQI_U_Start':
|
case 'Test_MSQI_U_Start':
|
||||||
updateCheckResultView("MSQI_U", true)
|
updateCheckResultView("MSQI_U", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_MSQI_U_End':
|
case 'Test_MSQI_U_End':
|
||||||
updateCheckResultView("MSQI_U", false)
|
updateCheckResultView("MSQI_U", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_MSQI_I_Start':
|
case 'Test_MSQI_I_Start':
|
||||||
updateCheckResultView("MSQI_I", true)
|
updateCheckResultView("MSQI_I", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_MSQI_I_End':
|
case 'Test_MSQI_I_End':
|
||||||
updateCheckResultView("MSQI_I", false)
|
updateCheckResultView("MSQI_I", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_Flicker_Start':
|
case 'Test_Flicker_Start':
|
||||||
updateCheckResultView("Flicker", true)
|
updateCheckResultView("Flicker", true)
|
||||||
|
updateLog(true)
|
||||||
break;
|
break;
|
||||||
case 'Test_Flicker_End':
|
case 'Test_Flicker_End':
|
||||||
updateCheckResultView("Flicker", false)
|
updateCheckResultView("Flicker", false)
|
||||||
activeIndex.value++;
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
if (testStatus.value != 'paused') {
|
if (testStatus.value != 'paused') {
|
||||||
|
activeIndex++;
|
||||||
startTimer()
|
startTimer()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Test_Quit':
|
case 'Test_Quit':
|
||||||
|
updateLog(false)
|
||||||
|
updatePercentage()
|
||||||
console.log('检测结束')
|
console.log('检测结束')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}, {deep: true})
|
||||||
|
|
||||||
updateLog()
|
// 更新进度条
|
||||||
|
const updatePercentage = () => {
|
||||||
if (percentage.value < 100) {
|
console.log('updatePercentage',activeIndex, checkTotal)
|
||||||
percentage.value = Math.trunc(activeIndex.value / checkTotal.value * 100);
|
if (activeIndex < checkTotal) {
|
||||||
|
percentage.value = Math.trunc(activeIndex / checkTotal * 100);
|
||||||
} else {
|
} else {
|
||||||
percentage.value = 100;
|
percentage.value = 100;
|
||||||
emit('update:testStatus', 'success')
|
emit('update:testStatus', 'success')
|
||||||
@@ -410,16 +484,27 @@ watch(webMsgSend, function (newValue, oldValue) {
|
|||||||
})
|
})
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
emit('update:testStatus', 'success')
|
|
||||||
scrollToBottom();
|
|
||||||
}
|
}
|
||||||
}, {deep: true})
|
|
||||||
|
// todo 可移除start
|
||||||
|
let randomUnConnectedRaw = -1
|
||||||
|
let randomUnConnectedDeviceId = -1
|
||||||
|
let randomErrorDataRaw = -1
|
||||||
|
// todo 可移除end
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
initScriptData()
|
initScriptData()
|
||||||
initDeviceList()
|
initDeviceList()
|
||||||
initCheckResult()
|
initCheckResult()
|
||||||
|
|
||||||
|
// todo 可移除start
|
||||||
|
randomUnConnectedRaw = getRandomInt(scriptData.length) + 1
|
||||||
|
randomUnConnectedDeviceId = deviceList[getRandomInt(deviceList.length)].deviceId
|
||||||
|
randomErrorDataRaw = getRandomInt(scriptData.length) + 1
|
||||||
|
while (randomErrorDataRaw === randomUnConnectedRaw) {
|
||||||
|
randomErrorDataRaw = getRandomInt(scriptData.length) + 1
|
||||||
|
}
|
||||||
|
// todo 可移除end
|
||||||
})
|
})
|
||||||
|
|
||||||
const showTestLog = () => {
|
const showTestLog = () => {
|
||||||
@@ -465,7 +550,7 @@ const initScriptData = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
scriptData.push(...temp)
|
scriptData.push(...temp)
|
||||||
checkTotal.value = scriptData.length + 1
|
checkTotal = scriptData.length + 1
|
||||||
}
|
}
|
||||||
// 初始化设备列表
|
// 初始化设备列表
|
||||||
const initDeviceList = () => {
|
const initDeviceList = () => {
|
||||||
@@ -526,11 +611,11 @@ function getRandomInt(max: number): number {
|
|||||||
|
|
||||||
//判断该检测项(例如 频率准确度检测)是否全部合格(所有设备所有通道所有子检测项目全部合格为合格,否则为不合格)
|
//判断该检测项(例如 频率准确度检测)是否全部合格(所有设备所有通道所有子检测项目全部合格为合格,否则为不合格)
|
||||||
function getItemCheckResult(scriptId: string): boolean {
|
function getItemCheckResult(scriptId: string): boolean {
|
||||||
let items = errorCheckItem.filter((item) => item === scriptId)
|
let items = errorCheckItem.filter((item) => item.scriptId === scriptId)
|
||||||
if (items.length > 0) {
|
if (items.length > 0) {
|
||||||
return false
|
|
||||||
} else {
|
|
||||||
return true
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,245 +640,63 @@ function getTimeDifference(timeDifference: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新日志
|
// 更新日志
|
||||||
const updateLog = () => {
|
const updateLog = (isStart: boolean) => {
|
||||||
const currentTime = ref(new Date().toLocaleString());
|
const currentTime = ref(new Date().toLocaleString());
|
||||||
let timeDifferenceItem = 0
|
let timeDifferenceItem = 0
|
||||||
|
|
||||||
switch (activeIndex.value) {
|
if (activeIndex === 1 && isStart) {
|
||||||
case 1:
|
|
||||||
timeDifference.value = 0;
|
timeDifference.value = 0;
|
||||||
testLogList.value.length = 0; // 清空数组
|
testLogList.length = 0; // 清空数组
|
||||||
testLogList.value.push({
|
}
|
||||||
type: 'info',
|
// debugger
|
||||||
log: currentTime.value + ':检测开始',
|
if (activeIndex < checkTotal) {
|
||||||
})
|
if (isStart) {
|
||||||
startData.value = new Date();
|
startData.value = new Date();
|
||||||
break;
|
testLogList.push({
|
||||||
case 2:
|
type: 'info',
|
||||||
|
log: currentTime.value + ` :${scriptData[activeIndex - 1].scriptName}准确度检测:开始`,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
endData.value = new Date();
|
endData.value = new Date();
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
||||||
timeDifference.value += timeDifferenceItem
|
timeDifference.value += timeDifferenceItem
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':频率准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':频率准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':电压准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':电压准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':谐波电压准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':谐波电压准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':谐波电流准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':谐波电流准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':谐波有功功率准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':谐波有功功率准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':间谐波电压准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':间谐波电压准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':间谐波电流准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':间谐波电流准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':暂态准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':暂态准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':电流准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':电流准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':电压不平衡度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':电压不平衡度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':电流不平衡度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':电流不平衡度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
startData.value = new Date();
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
endData.value = new Date();
|
|
||||||
timeDifferenceItem = endData.value.getTime() - startData.value.getTime();
|
|
||||||
timeDifference.value += timeDifferenceItem
|
|
||||||
if (getItemCheckResult(scriptData[activeIndex.value - 2].id)) {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'info',
|
|
||||||
log: currentTime.value + ':闪变准确度检测合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
testLogList.value.push({
|
|
||||||
type: 'error',
|
|
||||||
log: currentTime.value + ':闪变准确度检测不合格,用时' + getTimeDifference(timeDifferenceItem),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
testLogList.value.push({
|
if (getItemCheckResult(scriptData[activeIndex - 1].id)) {
|
||||||
|
testLogList.push({
|
||||||
|
type: 'error',
|
||||||
|
log: currentTime.value + ` :${scriptData[activeIndex - 1].scriptName}准确度检测结束:不符合,用时` + getTimeDifference(timeDifferenceItem),
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
testLogList.push({
|
||||||
|
type: 'info',
|
||||||
|
log: currentTime.value + ` :${scriptData[activeIndex - 1].scriptName}准确度检测结束:符合,用时` + getTimeDifference(timeDifferenceItem),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
testLogList.push({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
log: currentTime.value + ' :检测结束,总用时' + getTimeDifference(timeDifference.value),
|
log: currentTime.value + ' :检测结束,总用时' + getTimeDifference(timeDifference.value),
|
||||||
})
|
})
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 动态获取表格单元格样式
|
// 动态获取表格单元格样式
|
||||||
function tableCell({row, columnIndex}) {
|
// function tableCell({row, columnIndex}) {
|
||||||
let items = errorCheckItem.filter((item) => item === row.scriptId)
|
// let items = errorCheckItem.filter((item) => item === row.scriptId)
|
||||||
|
//
|
||||||
if (columnIndex === 0 && items.length > 0) {
|
// if (columnIndex === 0 && items.length > 0) {
|
||||||
return 'warning-row'
|
// return 'warning-row'
|
||||||
}
|
// }
|
||||||
if (columnIndex === 0) {
|
// if (columnIndex === 0) {
|
||||||
return 'header-row'
|
// return 'header-row'
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
const updateCheckResultView = (scriptCode: string, isStart: boolean) => {
|
const updateCheckResultView = (scriptCode: string, isStart: boolean) => {
|
||||||
|
// debugger
|
||||||
let scriptId = scriptData.filter(item => item.code === scriptCode)[0]?.id
|
let scriptId = scriptData.filter(item => item.code === scriptCode)[0]?.id
|
||||||
let temp = null
|
let temp = null
|
||||||
if (isStart) {
|
if (isStart) {
|
||||||
@@ -829,23 +732,25 @@ const getLoadingResult = (scriptId: string) => {
|
|||||||
|
|
||||||
return tempScriptChnItem
|
return tempScriptChnItem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 模拟检测 todo 可移除
|
// 模拟检测 todo 可移除
|
||||||
const getCheckResult = (scriptId: string) => {
|
const getCheckResult = (scriptId: string) => {
|
||||||
|
// debugger
|
||||||
let devices = []
|
let devices = []
|
||||||
|
|
||||||
|
if (activeIndex === randomErrorDataRaw) {
|
||||||
devices = deviceList.map(item => {
|
devices = deviceList.map(item => {
|
||||||
|
|
||||||
let tempChnResult: CheckData.ChnCheckResultEnum[] = []
|
let tempChnResult: CheckData.ChnCheckResultEnum[] = []
|
||||||
|
if (item.deviceId === randomUnConnectedDeviceId && activeIndex >= randomUnConnectedRaw) {
|
||||||
for (let i = 0; i < item.chnNum; i++) {
|
for (let i = 0; i < item.chnNum; i++) {
|
||||||
tempChnResult.push(CheckData.ChnCheckResultEnum.SUCCESS)
|
tempChnResult.push(CheckData.ChnCheckResultEnum.UNCONNECTED)
|
||||||
|
//errorCheckItem.push({scriptId,type:'warning'})
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
let randomNum = getRandomInt(item.chnNum * 2)
|
for (let i = 0; i < item.chnNum; i++) {
|
||||||
if (activeIndex.value >= 2 && activeIndex.value <= 8) {
|
tempChnResult.push(CheckData.ChnCheckResultEnum.ERRORDATA)
|
||||||
if (randomNum < item.chnNum) {
|
//errorCheckItem.push({scriptId,type:'warning'})
|
||||||
tempChnResult[randomNum] = (randomNum % 2 === 0 ? 1 : 3)
|
|
||||||
|
|
||||||
errorCheckItem.push(scriptId)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -855,6 +760,61 @@ const getCheckResult = (scriptId: string) => {
|
|||||||
chnResult: tempChnResult,
|
chnResult: tempChnResult,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
devices = deviceList.map(item => {
|
||||||
|
let tempChnResult: CheckData.ChnCheckResultEnum[] = []
|
||||||
|
if (item.deviceId === randomUnConnectedDeviceId && activeIndex >= randomUnConnectedRaw) {
|
||||||
|
for (let i = 0; i < item.chnNum; i++) {
|
||||||
|
tempChnResult.push(CheckData.ChnCheckResultEnum.UNCONNECTED)
|
||||||
|
//errorCheckItem.push({scriptId,type:'warning'})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i < item.chnNum; i++) {
|
||||||
|
tempChnResult.push(CheckData.ChnCheckResultEnum.SUCCESS)
|
||||||
|
}
|
||||||
|
let randomNum = getRandomInt(item.chnNum * 2)
|
||||||
|
if (randomNum < item.chnNum) {
|
||||||
|
tempChnResult[randomNum] = CheckData.ChnCheckResultEnum.FAIL
|
||||||
|
errorCheckItem.push({scriptId, type: 'error'})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
deviceId: item.deviceId,
|
||||||
|
deviceName: item.deviceName,
|
||||||
|
chnResult: tempChnResult,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// devices = deviceList.map(item => {
|
||||||
|
//
|
||||||
|
// let tempChnResult: CheckData.ChnCheckResultEnum[] = []
|
||||||
|
// for (let i = 0; i < item.chnNum; i++) {
|
||||||
|
// tempChnResult.push(CheckData.ChnCheckResultEnum.SUCCESS)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// let randomNum = getRandomInt(item.chnNum * 2)
|
||||||
|
// if (activeIndex >= 2 && activeIndex <= 8) {
|
||||||
|
// if (randomNum % 3 === 0) {
|
||||||
|
// let a = getRandomInt(2) === 1 ? CheckData.ChnCheckResultEnum.ERRORDATA : CheckData.ChnCheckResultEnum.UNCONNECTED
|
||||||
|
// tempChnResult.splice(tempChnResult.length - 1 - item.chnNum, item.chnNum, CheckData.ChnCheckResultEnum.ERRORDATA)
|
||||||
|
// }else{
|
||||||
|
// if (randomNum < item.chnNum) {
|
||||||
|
// tempChnResult[randomNum] = (randomNum % 2) + 1
|
||||||
|
//
|
||||||
|
// errorCheckItem.push(scriptId)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return {
|
||||||
|
// deviceId: item.deviceId,
|
||||||
|
// deviceName: item.deviceName,
|
||||||
|
// chnResult: tempChnResult,
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
let tempScriptChnItem: CheckData.ScriptChnItem = {
|
let tempScriptChnItem: CheckData.ScriptChnItem = {
|
||||||
scriptId,
|
scriptId,
|
||||||
@@ -873,7 +833,7 @@ const handlePauseOrContinue = () => {
|
|||||||
const Pausetime = endData.value.getTime() - startData.value.getTime();
|
const Pausetime = endData.value.getTime() - startData.value.getTime();
|
||||||
timeDifference.value += Pausetime
|
timeDifference.value += Pausetime
|
||||||
|
|
||||||
testLogList.value.push({
|
testLogList.push({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
log: currentTime.value + ':暂停检测',
|
log: currentTime.value + ':暂停检测',
|
||||||
})
|
})
|
||||||
@@ -882,7 +842,7 @@ const handlePauseOrContinue = () => {
|
|||||||
}
|
}
|
||||||
if (testStatus.value == "process") {
|
if (testStatus.value == "process") {
|
||||||
startData.value = new Date();
|
startData.value = new Date();
|
||||||
testLogList.value.push({
|
testLogList.push({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
log: currentTime.value + ':继续检测',
|
log: currentTime.value + ':继续检测',
|
||||||
})
|
})
|
||||||
@@ -899,12 +859,8 @@ const handleClick = (scriptId: string, deviceId: any, chnNum: number) => {
|
|||||||
|
|
||||||
// todo 可移除
|
// todo 可移除
|
||||||
const startTimer = () => {
|
const startTimer = () => {
|
||||||
if (activeIndex.value === 0) {
|
console.log('开始检测第' + activeIndex + '项')
|
||||||
console.log('检测开始')
|
switch (activeIndex) {
|
||||||
activeIndex.value++;
|
|
||||||
}
|
|
||||||
console.log('开始检测第' + activeIndex.value + '项')
|
|
||||||
switch (activeIndex.value) {
|
|
||||||
case 1:
|
case 1:
|
||||||
emit('update:webMsgSend', {
|
emit('update:webMsgSend', {
|
||||||
requestId: 'Test_Freq_Start',
|
requestId: 'Test_Freq_Start',
|
||||||
@@ -1080,15 +1036,20 @@ const handleFinishTest = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleReCheck = () => {
|
const handleReCheck = () => {
|
||||||
activeIndex.value = 0;
|
activeIndex = 1;
|
||||||
percentage.value = 0;
|
percentage.value = 0;
|
||||||
testLogList.value.length = 0;
|
testLogList.length = 0;
|
||||||
errorCheckItem.length = 0;
|
errorCheckItem.length = 0;
|
||||||
// resumeTimer()
|
// resumeTimer()
|
||||||
};
|
};
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
|
errorCheckItem.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
clear,
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@@ -1174,12 +1135,20 @@ function clear() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-icon {
|
.loading-box {
|
||||||
width: 16px; /* 调整宽度 */
|
animation: loading 1.5s linear infinite;
|
||||||
height: 16px; /* 调整高度 */
|
|
||||||
color: #409EFF; /* 调整颜色 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes loading {
|
||||||
|
from {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//:deep(.el-drawer .el-drawer__title){
|
//:deep(.el-drawer .el-drawer__title){
|
||||||
// background-color: #003078 !important;
|
// background-color: #003078 !important;
|
||||||
//}
|
//}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<preTest ref="preTestRef" v-if="stepsActiveIndex === 0" v-model:testStatus="preTestStatus" :webMsgSend="webMsgSend"></preTest>
|
<preTest ref="preTestRef" v-if="stepsActiveIndex === 0" v-model:testStatus="preTestStatus" :webMsgSend="webMsgSend"></preTest>
|
||||||
<timeTest v-if="stepsActiveIndex === 1 && isTimeCheck" v-model:testStatus="timeTestStatus"></timeTest>
|
<timeTest v-if="stepsActiveIndex === 1 && isTimeCheck" v-model:testStatus="timeTestStatus"></timeTest>
|
||||||
<!-- <channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest> -->
|
<!-- <channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest> -->
|
||||||
<test v-if="stepsActiveIndex >= 2" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend" @update:webMsgSend="webMsgSend=$event"></test>
|
<test ref="testRef" v-if="stepsActiveIndex >= 2" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend" @update:webMsgSend="webMsgSend=$event"></test>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div>
|
<div>
|
||||||
@@ -146,6 +146,7 @@ const detectionOptions = ref([
|
|||||||
const dialogTitle = ref('');
|
const dialogTitle = ref('');
|
||||||
const isTimeCheck = ref(false)
|
const isTimeCheck = ref(false)
|
||||||
const preTestRef = ref(null);
|
const preTestRef = ref(null);
|
||||||
|
const testRef = ref(null);
|
||||||
|
|
||||||
const devIdArr = ref([])
|
const devIdArr = ref([])
|
||||||
const planId = ref('')
|
const planId = ref('')
|
||||||
@@ -396,7 +397,7 @@ const getIcon = (index: number) => {
|
|||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
// clearData()
|
// clearData()
|
||||||
// emit('update:visible', false); // 关闭对话框
|
// emit('update:visible', false); // 关闭对话框
|
||||||
|
testRef.value?.clear()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user