This commit is contained in:
caozehui
2025-01-03 18:57:35 +08:00
parent 938b9054d3
commit d10a7a4884
4 changed files with 179 additions and 248 deletions

View File

@@ -44,9 +44,18 @@ export namespace CheckData {
// 用来描述检测脚本类型 // 用来描述检测脚本类型
export interface ScriptItem{ export interface ScriptItem{
id: string,
code: string,
scriptName: string, scriptName: string,
scriptType?: string, }
children?: ScriptItem[]
// 用来描述 检测数据-左侧树结构
export interface TreeItem{
scriptTypeName: string|null,
sourceDesc: string|null,
index:number|null,
fly:number|null,
children?: TreeItem[]
} }
// 用来描述 通道检测结果 // 用来描述 通道检测结果
export enum ChnCheckResultEnum { export enum ChnCheckResultEnum {

View File

@@ -29,7 +29,7 @@ export const getTreeData = (params: {
scriptType: string | null, scriptType: string | null,
code: string code: string
}) => { }) => {
return http.post<CheckData.ScriptItem[]>("/result/treeData/", params, {loading: true}); return http.post<CheckData.TreeItem[]>("/result/treeData/", params, {loading: true});
} }
/** /**

View File

@@ -34,17 +34,17 @@
</el-radio-group> </el-radio-group>
</div> </div>
<div class="content-tree"> <div class="content-tree">
<el-tree v-if="switchItem === 0" :default-expanded-keys="defaultExpandedKeys" node-key="scriptType" <el-tree v-if="switchItem === 0" :default-expanded-keys="defaultExpandedKeys" node-key="index"
:data="treeDataUnqualified" :props="defaultProps" @node-click="handleNodeClick" :data="treeDataUnqualified" :props="defaultProps" @node-click="handleNodeClick"
class="custom-tree"> class="custom-tree">
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node">{{ data.scriptName }}</span> <span class="custom-tree-node">{{ data.scriptTypeName }}</span>
</template> </template>
</el-tree> </el-tree>
<el-tree v-if="switchItem === 1" :default-expanded-keys="defaultExpandedKeys" node-key="scriptType" <el-tree v-if="switchItem === 1" :default-expanded-keys="defaultExpandedKeys" node-key="index"
:data="treeDataAll" :props="defaultProps" @node-click="handleNodeClick" class="custom-tree"> :data="treeDataAll" :props="defaultProps" @node-click="handleNodeClick" class="custom-tree">
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node">{{ data.scriptName }}</span> <span class="custom-tree-node">{{ data.scriptTypeName }}</span>
</template> </template>
</el-tree> </el-tree>
</div> </div>
@@ -53,15 +53,15 @@
<div class="content-right"> <div class="content-right">
<div class="content-right-title"> <div class="content-right-title">
<el-divider>当前检测项目</el-divider> <el-divider>当前检测项目</el-divider>
<span>{{ currentScriptDsc }}</span> <span>{{ currentDesc }}</span>
</div> </div>
<div class="content-right-Tabs"> <div class="content-right-Tabs">
<el-tabs type="border-card" v-model="activeTab"> <el-tabs type="border-card" v-model="activeTab">
<el-tab-pane label="检测结果" name="resultTab"> <el-tab-pane label="检测结果" name="resultTab">
<DataCheckResultTable :tableData="checkResultTableData" ref="resultTableRef"/> <DataCheckResultTable :tableData="checkResultTableData"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="原始数据" name="rawDataTab"> <el-tab-pane label="原始数据" name="rawDataTab">
<DataCheckRawDataTable :tableData="rawTableData" ref="rawDataTableRef"/> <DataCheckRawDataTable :tableData="rawTableData"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
@@ -86,7 +86,7 @@ const {appendToBody} = withDefaults(defineProps<{
}>(), {appendToBody: true}) }>(), {appendToBody: true})
const defaultProps = { const defaultProps = {
label: "scriptName", label: "scriptTypeName",
children: "children", children: "children",
}; };
@@ -112,23 +112,21 @@ let chnList: any[] = []
// 不符合测试项、全部测试项切换 // 不符合测试项、全部测试项切换
const switchItem = ref<number>(0) const switchItem = ref<number>(0)
// 左侧树数据 // 左侧树数据
let treeDataUnqualified: CheckData.ScriptItem[] = [] let treeDataUnqualified: CheckData.TreeItem[] = []
let treeDataAll: CheckData.ScriptItem[] = [] let treeDataAll: CheckData.TreeItem[] = []
// 左侧树被选中的叶子节点id // 左侧树被选中的叶子节点id
const checkedScriptType = ref<string>('') const checkIndex = ref<string>('')
const currentScriptDsc = ref(''); const currentDesc = ref('');
// 右侧Tab选中项 // 右侧Tab选中项
const activeTab = ref<string>('resultTab') const activeTab = ref<string>('resultTab')
// 检测结果表格数据 // 检测结果表格数据
let checkResultTableData: CheckData.CheckResult[] = [] const checkResultTableData = reactive<CheckData.CheckResult[]>([])
// 原始数据表格数据 // 原始数据表格数据
let rawTableData: CheckData.RawDataItem[] = [] const rawTableData = reactive<CheckData.RawDataItem[]>([])
const resultTableRef = ref()
const rawDataTableRef = ref()
// 左侧树默认展开节点id // 左侧树默认展开节点id
let defaultExpandedKeys: string[] = [] let defaultExpandedKeys: string[] = []
@@ -136,10 +134,10 @@ let defaultExpandedKeys: string[] = []
// 点击左侧树节点触发事件 // 点击左侧树节点触发事件
const handleNodeClick = async (data: any) => { const handleNodeClick = async (data: any) => {
if (!data.children) { if (!data.children) {
checkedScriptType.value = data.scriptType checkIndex.value = data.index
currentScriptDsc.value = data.scriptName currentDesc.value = data.sourceDesc
if (checkedScriptType.value) { if (checkIndex.value) {
await updateTableData() await updateTableData()
} }
} }
@@ -150,7 +148,7 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
if (newVal) { if (newVal) {
// 发起请求,查询该测试项的检测结果 // 发起请求,查询该测试项的检测结果
const {data: resTreeDataTemp}: { data: CheckData.ScriptItem[] } = await getTreeData({ const {data: resTreeDataTemp}: { data: CheckData.TreeItem[] } = await getTreeData({
scriptId: checkStore.scriptId, scriptId: checkStore.scriptId,
deviceId, deviceId,
devNum: formContent.chnNum + '', devNum: formContent.chnNum + '',
@@ -159,92 +157,89 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
}) })
treeDataAll = resTreeDataTemp treeDataAll = resTreeDataTemp
treeDataAll = [
{
scriptTypeName: "频率准确度检测",
sourceDesc: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "额定条件下频率准确度测试",
sourceDesc: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "频率=42.5Hz",
sourceDesc: "频率=42.5Hz",
index: 11,
fly: 1,
},
{
scriptTypeName: "频率=50Hz",
sourceDesc: "频率=50Hz",
index: 12,
fly: 2,
},
{
scriptTypeName: "频率=50.05Hz",
sourceDesc: "频率=50.05Hz",
index: 13,
fly: 1,
},
{
scriptTypeName: "频率=57.5Hz",
sourceDesc: "频率=57.5Hz",
index: 14,
fly: 2,
}
]
},
{
scriptTypeName: "单影响量下频率准确度测试",
sourceDesc: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "电压幅值对频率测量的影响",
sourceDesc: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "10%Un对频率=50.05Hz的影响",
sourceDesc: "10%Un对频率=50.05Hz的影响",
index: null,
fly: 1,
}
]
},
{
scriptTypeName: "谐波对频率测量的影响",
sourceDesc: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "叠加多次谐波对频率=50.05Hz的影响",
sourceDesc: "叠加多次谐波对频率=50.05Hz的影响",
index: null,
fly: 2,
}
]
}
]
},
]
}
]
let treeDataTemp = JSON.parse(JSON.stringify(treeDataAll)) let treeDataTemp = JSON.parse(JSON.stringify(treeDataAll))
filterTree(treeDataTemp, 2) filterTree(treeDataTemp, 2)
treeDataUnqualified = treeDataTemp treeDataUnqualified = treeDataTemp
// treeDataAll = [
// {
// "scriptName": "频率准确度检测",
// "children": [
// {
// "scriptName": "额定工作条件下的检测",
// "children": [
// {
// "scriptName": "输入:频率 42.5Hz...",
// "scriptType": '2246ada2fdf'
// },
// {
// "scriptName": "输入:频率 50.0Hz...",
// "scriptType": '2246a3dafdf'
// },
// {
// "scriptName": "输入:频率 50.05Hz....",
// "scriptType": '22246adafdf'
// }
// ]
// },
// {
// "scriptName": "电压对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =10%Un...",
// "scriptType": '224a6adafdf'
// },
// {
// "scriptName": "输入:频率 51.05Hz Ua =10%Un...",
// "scriptType": '2246aadafdf'
// },
// {
// "scriptName": "输入:频率 52.05Hz Ua =10%Un...",
// "scriptType": '2246adaffdf'
// }
// ]
// },
// {
// "scriptName": "谐波对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =100%Un...",
// "scriptType": '2246aadafdf'
// }
// ]
// }
// ]
// }
// ]
// treeDataUnqualified = [{
// "scriptName": "频率准确度检测",
// "children": [
// {
// "scriptName": "电压对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =10%Un...",
// "scriptType": '2346adafdf'
// },
// {
// "scriptName": "输入:频率 51.05Hz Ua =10%Un...",
// "scriptType": '1246adaafdf'
// },
// {
// "scriptName": "输入:频率 52.05Hz Ua =10%Un...",
// "scriptType": '2136ada3fdf'
// }
// ]
// },
// {
// "scriptName": "谐波对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =100%Un...",
// "scriptType": '234246adafdf'
// }
// ]
// }
// ]
// }]
switchItem.value = 0 switchItem.value = 0
await handleSwitchChange(0) await handleSwitchChange(0)
} }
@@ -253,100 +248,6 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
const handleSwitchChange = async (data: any) => { const handleSwitchChange = async (data: any) => {
console.log("切换不合格测试项、全部测试项", data); console.log("切换不合格测试项、全部测试项", data);
// let treeDataTemp = JSON.parse(JSON.stringify(treeDataAll))
// if (data === 0) {
// filterTree(treeDataTemp, 2)
// treeDataUnqualified = treeDataTemp
// treeDataUnqualified=[]
//treeDataUnqualified=treeDataTemp
// treeDataUnqualified = [{
// "scriptName": "频率准确度检测",
// "children": [
// {
// "scriptName": "电压对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =10%Un...",
// "scriptType": '2346adafdf'
// },
// {
// "scriptName": "输入:频率 51.05Hz Ua =10%Un...",
// "scriptType": '1246adaafdf'
// },
// {
// "scriptName": "输入:频率 52.05Hz Ua =10%Un...",
// "scriptType": '2136ada3fdf'
// }
// ]
// },
// {
// "scriptName": "谐波对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =100%Un...",
// "scriptType": '234246adafdf'
// }
// ]
// }
// ]
// }]
// }
// else {
// treeDataAll = treeDataTemp
// treeDataAll = []
// treeDataAll = [
// {
// "scriptName": "频率准确度检测",
// "children": [
// {
// "scriptName": "额定工作条件下的检测",
// "children": [
// {
// "scriptName": "输入:频率 42.5Hz...",
// "scriptType": '2246ada2fdf'
// },
// {
// "scriptName": "输入:频率 50.0Hz...",
// "scriptType": '2246a3dafdf'
// },
// {
// "scriptName": "输入:频率 50.05Hz....",
// "scriptType": '22246adafdf'
// }
// ]
// },
// {
// "scriptName": "电压对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =10%Un...",
// "scriptType": '224a6adafdf'
// },
// {
// "scriptName": "输入:频率 51.05Hz Ua =10%Un...",
// "scriptType": '2246aadafdf'
// },
// {
// "scriptName": "输入:频率 52.05Hz Ua =10%Un...",
// "scriptType": '2246adaffdf'
// }
// ]
// },
// {
// "scriptName": "谐波对频率测量的影响",
// "children": [
// {
// "scriptName": "输入:频率 50.05Hz Ua =100%Un...",
// "scriptType": '2246aadafdf'
// }
// ]
// }
// ]
// }
// ]
// }
defaultOperate() defaultOperate()
await updateTableData() await updateTableData()
} }
@@ -360,23 +261,23 @@ const defaultOperate = () => {
node = getDefaultNode(treeDataAll) node = getDefaultNode(treeDataAll)
} }
if (node) { if (node) {
currentScriptDsc.value = node.scriptName currentDesc.value = node.sourceDesc
checkedScriptType.value = node.scriptType checkIndex.value = node.index
defaultExpandedKeys = [node.scriptType] defaultExpandedKeys = [node.index]
} else { } else {
currentScriptDsc.value = '' currentDesc.value = ''
checkedScriptType.value = '' checkIndex.value = ''
defaultExpandedKeys = [] defaultExpandedKeys = []
} }
} }
const updateTableData = async () => { const updateTableData = async () => {
console.log("左侧树被选中的叶子节点scriptType", checkedScriptType.value); console.log("左侧树被选中的叶子节点checkIndex", checkIndex.value);
if (checkedScriptType.value) { if (checkIndex.value) {
// 发起请求,查询该测试项的检测结果 // 发起请求,查询该测试项的检测结果
// const result = await getTableData({checkStore.scriptId,deviceId, formContent.chnNum, scriptType}) // const result = await getTableData({checkStore.scriptId,deviceId, formContent.chnNum, scriptType,checkIndex})
checkResultTableData = [{ Object.assign(checkResultTableData, [{
chnNum: '1', chnNum: '1',
standardValue: 57.74, standardValue: 57.74,
A: 57.73, A: 57.73,
@@ -387,9 +288,8 @@ const updateTableData = async () => {
C_errValue: 0.01, C_errValue: 0.01,
maxErrVaule: 0.05774, maxErrVaule: 0.05774,
result: '合格', result: '合格',
}] }])
Object.assign(rawTableData, [
rawTableData = [
{ {
updateTime: "2024-10-10 09:30:00", updateTime: "2024-10-10 09:30:00",
A: 57.73, A: 57.73,
@@ -510,7 +410,7 @@ const updateTableData = async () => {
B: 57.73, B: 57.73,
C: 57.73, C: 57.73,
} }
] ])
} }
} }
@@ -568,9 +468,9 @@ const close = () => {
}) })
treeDataUnqualified = [] treeDataUnqualified = []
treeDataAll = [] treeDataAll = []
checkedScriptType.value = '' checkIndex.value = ''
activeTab.value = 'rawDataTab' activeTab.value = 'resultTab'
currentScriptDsc.value = '' currentDesc.value = ''
switchItem.value = 0 switchItem.value = 0
visible.value = false; visible.value = false;
@@ -654,6 +554,10 @@ const filter = (treeData: any[], fly: number) => {
if (node && node.fly !== fly) { if (node && node.fly !== fly) {
if (node.children && node.children.length > 0) { if (node.children && node.children.length > 0) {
filter(node.children, fly) filter(node.children, fly)
// 检查 children 是否被全部移除
if (node.children.length === 0) {
treeData.splice(i, 1);
}
} else { } else {
treeData.splice(i, 1) treeData.splice(i, 1)
} }

View File

@@ -9,7 +9,6 @@
<el-button <el-button
type="primary" type="primary"
v-if="testStatus=='process' && activeIndex < checkTotal" v-if="testStatus=='process' && activeIndex < checkTotal"
:disabled="activeIndex===0"
:icon="VideoPause" :icon="VideoPause"
@click="emit('sendPause')">停止检测 @click="emit('sendPause')">停止检测
</el-button> </el-button>
@@ -180,7 +179,7 @@ let scriptData: CheckData.ScriptItem[] = []
// 用来保存被检设备 // 用来保存被检设备
const deviceList = reactive<CheckData.Device[]>([]) const deviceList = reactive<CheckData.Device[]>([])
// 当前进行的测试项索引 // 当前进行的测试项索引
let activeIndex = 1 let activeIndex = 0
// 百分比 // 百分比
const percentage = ref(0); const percentage = ref(0);
//测试项开始检测时间(或继续检测时间) //测试项开始检测时间(或继续检测时间)
@@ -213,7 +212,7 @@ const chnSum = computed(() => {
}) })
// 用来展示的检测结果 // 用来展示的检测结果
const checkResultView: any[] = computed(() => { const checkResultView: ComputedRef<CheckData.ScriptChnViewItem[]> = computed(() => {
let result: CheckData.ScriptChnViewItem[] = checkResult.map(item => { let result: CheckData.ScriptChnViewItem[] = checkResult.map(item => {
let temp: CheckData.ScriptChnViewItem = { let temp: CheckData.ScriptChnViewItem = {
@@ -381,6 +380,10 @@ watch(webMsgSend, function (newValue, oldValue) {
case 'DATA_REQUEST$02': case 'DATA_REQUEST$02':
ElMessage.success('预检测成功!') ElMessage.success('预检测成功!')
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:预检测成功!`}) testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:预检测成功!`})
activeIndex = getNextActiveIndex()+2
startTimer()
emit('update:testStatus', 'process') emit('update:testStatus', 'process')
break break
} }
@@ -406,11 +409,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'FREQ_End': case 'FREQ_End':
updatePercentage()
updateCheckResultView("FREQ", false) updateCheckResultView("FREQ", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('FREQ')
startTimer() startTimer()
} }
break; break;
@@ -419,11 +422,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'V_End': case 'V_End':
updatePercentage()
updateCheckResultView("V", false) updateCheckResultView("V", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++ activeIndex = getNextActiveIndex('V')
startTimer() startTimer()
} }
break; break;
@@ -432,11 +435,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'HV_End': case 'HV_End':
updatePercentage()
updateCheckResultView("HV", false) updateCheckResultView("HV", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('HV')
startTimer() startTimer()
} }
break; break;
@@ -445,11 +448,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'HI_End': case 'HI_End':
updatePercentage()
updateCheckResultView("HI", false) updateCheckResultView("HI", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('HI')
startTimer() startTimer()
} }
break; break;
@@ -458,11 +461,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'HP_End': case 'HP_End':
updatePercentage()
updateCheckResultView("HP", false) updateCheckResultView("HP", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('HP')
startTimer() startTimer()
} }
break; break;
@@ -471,11 +474,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'HSV_End': case 'HSV_End':
updatePercentage()
updateCheckResultView("HSV", false) updateCheckResultView("HSV", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('HSV')
startTimer() startTimer()
} }
break; break;
@@ -484,11 +487,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'HSI_End': case 'HSI_End':
updatePercentage()
updateCheckResultView("HSI", false) updateCheckResultView("HSI", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('HSI')
startTimer() startTimer()
} }
break; break;
@@ -497,11 +500,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'VOLTAGE_End': case 'VOLTAGE_End':
updatePercentage()
updateCheckResultView("VOLTAGE", false) updateCheckResultView("VOLTAGE", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('VOLTAGE')
startTimer() startTimer()
} }
break; break;
@@ -510,11 +513,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'I_End': case 'I_End':
updatePercentage()
updateCheckResultView("I", false) updateCheckResultView("I", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('I')
startTimer() startTimer()
} }
break; break;
@@ -523,11 +526,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'IMBV_End': case 'IMBV_End':
updatePercentage()
updateCheckResultView("IMBV", false) updateCheckResultView("IMBV", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('IMBV')
startTimer() startTimer()
} }
break; break;
@@ -536,11 +539,11 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'IMBA_End': case 'IMBA_End':
updatePercentage()
updateCheckResultView("IMBA", false) updateCheckResultView("IMBA", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('IMBA')
startTimer() startTimer()
} }
break; break;
@@ -549,17 +552,17 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(true) updateLog(true)
break; break;
case 'F_End': case 'F_End':
updatePercentage()
updateCheckResultView("F", false) updateCheckResultView("F", false)
updateLog(false) updateLog(false)
updatePercentage()
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex++; activeIndex = getNextActiveIndex('F')
startTimer() startTimer()
} }
break; break;
case 'Quit': case 'Quit':
updateLog(false)
updatePercentage() updatePercentage()
updateLog(false)
console.log('检测结束') console.log('检测结束')
break; break;
} }
@@ -905,7 +908,7 @@ const handleClick = (item: any, chnNum: string, scriptType: string) => {
const startTimer = () => { const startTimer = () => {
console.log('开始检测第' + activeIndex + '项') console.log('开始检测第' + activeIndex + '项')
switch (activeIndex) { switch (activeIndex) {
case 1: case 0:
setTimeout(() => { setTimeout(() => {
emit('update:webMsgSend', { emit('update:webMsgSend', {
requestId: 'yjc_ytxjy', requestId: 'yjc_ytxjy',
@@ -927,18 +930,20 @@ const startTimer = () => {
operateCode: "DATA_REQUEST$02" operateCode: "DATA_REQUEST$02"
}) })
}, 6000) }, 6000)
break;
case 1:
setTimeout(() => { setTimeout(() => {
emit('update:webMsgSend', { emit('update:webMsgSend', {
requestId: 'FREQ_Start', requestId: 'FREQ_Start',
params: {} params: {}
}) })
}, 9000) }, 1000)
setTimeout(() => { setTimeout(() => {
emit('update:webMsgSend', { emit('update:webMsgSend', {
requestId: 'FREQ_End', requestId: 'FREQ_End',
params: {} params: {}
}) })
}, 12000); }, 2000);
break; break;
case 2: case 2:
emit('update:webMsgSend', { emit('update:webMsgSend', {
@@ -1057,7 +1062,7 @@ const startTimer = () => {
emit('update:webMsgSend', { emit('update:webMsgSend', {
requestId: 'IMBA_End', requestId: 'IMBA_End',
params: {} params: {}
}, 2000) }, 4000)
}) })
break; break;
case 12: case 12:
@@ -1111,13 +1116,26 @@ const handleFinishTest = () => {
}; };
const handleReCheck = () => { const handleReCheck = () => {
activeIndex = 1; activeIndex = 0;
percentage.value = 0; percentage.value = 0;
testLogList.length = 0; testLogList.length = 0;
errorCheckItem.length = 0; errorCheckItem.length = 0;
// resumeTimer() // resumeTimer()
}; };
// 获取当前执行的大测试项序 的 下一个大测试项序号
const getNextActiveIndex = (code: string = ''): number => {
if (code === '') {
return -1
}
for (let i = 0; i < scriptData.length; i++) {
if (scriptData[i].code === code) {
return i + 2
}
}
return -1
}
function clear() { function clear() {
errorCheckItem.length = 0; errorCheckItem.length = 0;
} }