微调
This commit is contained in:
@@ -40,8 +40,3 @@ export const resumeTest = (params) => {
|
||||
export const contrastTest = (params: any) => {
|
||||
return http.post(`/prepare/startContrastTest`,params)
|
||||
}
|
||||
|
||||
|
||||
export const getContrastTestNumInfo = (id: string) => {
|
||||
return http.get(`/prepare/getContrastTestNumInfo?planId=${id}`)
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ import ComparePreTest from './comparePreTest.vue'
|
||||
import CompareTest from './compareTest.vue'
|
||||
import socketClient from '@/utils/webSocketClient';
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
import {pauseTest, resumeTest, startPreTest,contrastTest,getContrastTestNumInfo} from '@/api/socket/socket'
|
||||
import {pauseTest, resumeTest, startPreTest,contrastTest} from '@/api/socket/socket'
|
||||
import {useUserStore} from "@/stores/modules/user";
|
||||
import {JwtUtil} from "@/utils/jwtUtil";
|
||||
|
||||
@@ -205,8 +205,6 @@ const handleSubmitAgain = async () => {
|
||||
ActiveStatue.value = 'waiting'
|
||||
preTestStatus.value = 'waiting'
|
||||
|
||||
const checkNum = await mapValue()
|
||||
|
||||
await contrastTest({
|
||||
planId: planId.value,
|
||||
loginName: loginName.value,
|
||||
@@ -214,7 +212,6 @@ const handleSubmitAgain = async () => {
|
||||
standardDevIds: standardDevIds.value,
|
||||
pairs:pairs.value,
|
||||
testItemList:[checkStore.selectTestItems.preTest,false,checkStore.selectTestItems.test],
|
||||
num: checkNum
|
||||
})
|
||||
|
||||
preTestStatus.value = 'start'
|
||||
@@ -227,8 +224,6 @@ const handleSubmitFast = async () => {
|
||||
return
|
||||
}
|
||||
|
||||
const checkNum = await mapValue()
|
||||
|
||||
switch (stepsActive.value) {
|
||||
case 1:
|
||||
if (preTestStatus.value == 'waiting') {
|
||||
@@ -240,7 +235,6 @@ const handleSubmitFast = async () => {
|
||||
standardDevIds: standardDevIds.value,
|
||||
pairs:pairs.value,
|
||||
testItemList:[checkStore.selectTestItems.preTest,false,checkStore.selectTestItems.test],
|
||||
num: checkNum
|
||||
})
|
||||
preTestStatus.value = 'start'
|
||||
}
|
||||
@@ -257,7 +251,6 @@ const handleSubmitFast = async () => {
|
||||
standardDevIds: standardDevIds.value,
|
||||
pairs:pairs.value,
|
||||
testItemList:[checkStore.selectTestItems.preTest,false,checkStore.selectTestItems.test],
|
||||
num: checkNum
|
||||
})
|
||||
}
|
||||
TestStatus.value = 'start'
|
||||
@@ -271,17 +264,6 @@ const handleSubmitFast = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const mapValue = (async () => {
|
||||
const data = await getContrastTestNumInfo(checkStore.plan.id)
|
||||
// 解析返回的数据,现在是 map 类型 {99: 1}
|
||||
const dataMap = data.data as Record<string, number>
|
||||
// 获取键值对
|
||||
const entries = Object.entries(dataMap)
|
||||
// 获取第一对键值
|
||||
const [key, value] = entries[0]
|
||||
|
||||
return value
|
||||
})
|
||||
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
||||
@@ -51,7 +51,6 @@ import SelectTestItemPopup from "@/views/home/components/selectTestItemPopup.vue
|
||||
import CompareTestPopup from './compareTestPopup.vue'
|
||||
import { ElMessage } from 'element-plus';
|
||||
import CustomEdge from './RemoveableEdge.vue' // 导入自定义连接线组件
|
||||
import {getContrastTestNumInfo} from '@/api/socket/socket'
|
||||
import { jwtUtil } from "@/utils/jwtUtil";
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
|
||||
@@ -215,25 +214,6 @@ const handleNext = () => {
|
||||
}
|
||||
|
||||
const openTestDialog = async () => {
|
||||
const data = await getContrastTestNumInfo(checkStore.plan.id)
|
||||
|
||||
// 解析返回的数据,现在是 map 类型 {99: 1}
|
||||
const dataMap = data.data as Record<string, number>
|
||||
// 获取键值对
|
||||
const entries = Object.entries(dataMap)
|
||||
|
||||
// 获取第一对键值
|
||||
const [key, value] = entries[0]
|
||||
const former = Number(key)
|
||||
const latter = value
|
||||
|
||||
// 判断后者是否大于等于前者
|
||||
if (latter >= former) {
|
||||
ElMessage.warning(`检测次数不足`)
|
||||
return // 阻止继续执行
|
||||
}
|
||||
|
||||
|
||||
// 转换连接信息,只保留设备ID和通道号
|
||||
const connections = edges.value.reduce((map, edge) => {
|
||||
// 从source中提取设备ID和通道号: 被检通道-{deviceId}-{channelNum} => {deviceId}-{channelNum}
|
||||
|
||||
Reference in New Issue
Block a user