修改正式检测逻辑
This commit is contained in:
@@ -270,7 +270,6 @@ const checkResultView: ComputedRef<CheckData.ScriptChnViewItem[]> = computed(()
|
|||||||
})
|
})
|
||||||
|
|
||||||
watch(testStatus, function (newValue, oldValue) {
|
watch(testStatus, function (newValue, oldValue) {
|
||||||
console.log('🚀 ~ newValue:', newValue)
|
|
||||||
if (newValue == 'start' || newValue == 'waiting') {
|
if (newValue == 'start' || newValue == 'waiting') {
|
||||||
if (!checkStore.selectTestItems.preTest && !checkStore.selectTestItems.channelsTest) {
|
if (!checkStore.selectTestItems.preTest && !checkStore.selectTestItems.channelsTest) {
|
||||||
ElMessage.success('初始化开始!')
|
ElMessage.success('初始化开始!')
|
||||||
@@ -313,10 +312,8 @@ watch(
|
|||||||
scriptName: item.scriptName,
|
scriptName: item.scriptName,
|
||||||
devices: []
|
devices: []
|
||||||
}
|
}
|
||||||
let message=JSON.parse(newValue.data)
|
let message = JSON.parse(newValue.data)
|
||||||
|
|
||||||
for (let i = 0; i < message?.length; i++) {
|
for (let i = 0; i < message?.length; i++) {
|
||||||
|
|
||||||
temp.devices.push({
|
temp.devices.push({
|
||||||
deviceId: message[i].deviceId,
|
deviceId: message[i].deviceId,
|
||||||
deviceName: message[i].deviceName,
|
deviceName: message[i].deviceName,
|
||||||
@@ -325,10 +322,25 @@ watch(
|
|||||||
}
|
}
|
||||||
result.push(temp)
|
result.push(temp)
|
||||||
})
|
})
|
||||||
console.log("🚀 ~ result:", result)
|
|
||||||
|
|
||||||
Object.assign(checkResult, result)
|
Object.assign(checkResult, result)
|
||||||
|
testLogList.push({
|
||||||
|
type: 'info',
|
||||||
|
log: `${new Date().toLocaleString()}:` + '检测完成!'
|
||||||
|
})
|
||||||
|
if(testLogList[0].log === '正在检测,请稍等...'){
|
||||||
|
testLogList.shift()
|
||||||
|
}
|
||||||
|
stopTimeCount()
|
||||||
|
break
|
||||||
|
case 25003:
|
||||||
|
|
||||||
|
testLogList.push({
|
||||||
|
type: 'error',
|
||||||
|
log: `${new Date().toLocaleString()}:` + '检测失败!'
|
||||||
|
})
|
||||||
|
if(testLogList[0].log === '正在检测,请稍等...'){
|
||||||
|
testLogList.shift()
|
||||||
|
}
|
||||||
stopTimeCount()
|
stopTimeCount()
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
@@ -337,9 +349,7 @@ watch(
|
|||||||
type: newValue.code == 10200 ? 'info' : 'error',
|
type: newValue.code == 10200 ? 'info' : 'error',
|
||||||
log: `${new Date().toLocaleString()}:` + newValue.data
|
log: `${new Date().toLocaleString()}:` + newValue.data
|
||||||
})
|
})
|
||||||
if (newValue.code == 25003) {
|
|
||||||
stopTimeCount()
|
|
||||||
}
|
|
||||||
updatePercentage()
|
updatePercentage()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -485,7 +495,6 @@ const initCheckResult = () => {
|
|||||||
|
|
||||||
// 更新检测结果(详细到通道)
|
// 更新检测结果(详细到通道)
|
||||||
const updateCheckResult = (data: CheckData.ScriptChnItem) => {
|
const updateCheckResult = (data: CheckData.ScriptChnItem) => {
|
||||||
console.log('🚀 ~ updateCheckResult ~ data:', data)
|
|
||||||
const { scriptType } = { ...data }
|
const { scriptType } = { ...data }
|
||||||
|
|
||||||
checkResult.forEach(item => {
|
checkResult.forEach(item => {
|
||||||
@@ -651,7 +660,7 @@ const handlePause = () => {
|
|||||||
}
|
}
|
||||||
const initializeParameters = () => {
|
const initializeParameters = () => {
|
||||||
percentage.value = 0
|
percentage.value = 0
|
||||||
testLogList.splice(0, testLogList.length, { type: 'info', log: '暂无数据,等待检测开始' })
|
testLogList.splice(0, testLogList.length, { type: 'info', log: '正在检测,请稍等...' })
|
||||||
}
|
}
|
||||||
|
|
||||||
const pauseSuccessCallback = () => {
|
const pauseSuccessCallback = () => {
|
||||||
@@ -676,6 +685,8 @@ const handleResumeTest = () => {
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
console.log(123123);
|
||||||
|
|
||||||
initializeParameters()
|
initializeParameters()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -367,13 +367,10 @@ watch(TestStatus, function (newValue, oldValue) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
watch(stepsActiveIndex, function (newValue, oldValue) {
|
watch(stepsActiveIndex, function (newValue, oldValue) {
|
||||||
console.log(
|
|
||||||
'🚀 ~ checkStore.selectTestItems.test && checkStore.selectTestItems.preTest && newValue == 2:',
|
|
||||||
checkStore.selectTestItems.test && checkStore.selectTestItems.preTest && newValue == 2
|
|
||||||
)
|
|
||||||
|
|
||||||
if (checkStore.selectTestItems.test && checkStore.selectTestItems.preTest && newValue == 2) {
|
if (checkStore.selectTestItems.test && checkStore.selectTestItems.preTest && newValue == 2) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
console.log(1);
|
||||||
|
|
||||||
testRef.value.initializeParameters()
|
testRef.value.initializeParameters()
|
||||||
testRef.value.showTestLog()
|
testRef.value.showTestLog()
|
||||||
testRef.value.startTimeCount()
|
testRef.value.startTimeCount()
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
<!-- 手动检测-勾选检测项弹窗 -->
|
<!-- 手动检测-勾选检测项弹窗 -->
|
||||||
<SelectTestItemPopup ref="selectTestItemPopupRef" @openTestDialog="openTestDialog"></SelectTestItemPopup>
|
<SelectTestItemPopup ref="selectTestItemPopupRef" @openTestDialog="openTestDialog"></SelectTestItemPopup>
|
||||||
<CompareTestPopup ref="testPopup"></CompareTestPopup>
|
<CompareTestPopup ref="testPopup" v-if="CompareTestVisible"></CompareTestPopup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@@ -64,7 +64,7 @@ const testPopup = ref()
|
|||||||
const dialogTitle = ref('手动检测')
|
const dialogTitle = ref('手动检测')
|
||||||
// 计算对话框高度
|
// 计算对话框高度
|
||||||
const dialogHeight = ref(600)
|
const dialogHeight = ref(600)
|
||||||
|
const CompareTestVisible = ref(false)
|
||||||
// 初始化 VueFlow,注册自定义连线类型
|
// 初始化 VueFlow,注册自定义连线类型
|
||||||
const { edges, setViewport } = useVueFlow({
|
const { edges, setViewport } = useVueFlow({
|
||||||
edgeTypes: {
|
edgeTypes: {
|
||||||
@@ -225,14 +225,16 @@ const handleNext = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log('🚀 ~ handleNext ~ edges.value:', edges.value)
|
|
||||||
|
|
||||||
await checkStore.setChnNum(chnNumList)
|
await checkStore.setChnNum(chnNumList)
|
||||||
|
CompareTestVisible.value = false
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
|
||||||
selectTestItemPopupRef.value?.open()
|
selectTestItemPopupRef.value?.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
const openTestDialog = async () => {
|
const openTestDialog = async () => {
|
||||||
|
CompareTestVisible.value = true
|
||||||
// 转换连接信息,只保留设备ID和通道号
|
// 转换连接信息,只保留设备ID和通道号
|
||||||
const connections = edges.value.reduce(
|
const connections = edges.value.reduce(
|
||||||
(map, edge) => {
|
(map, edge) => {
|
||||||
@@ -250,15 +252,17 @@ const openTestDialog = async () => {
|
|||||||
|
|
||||||
generateChannelMapping()
|
generateChannelMapping()
|
||||||
|
|
||||||
testPopup.value?.open(
|
setTimeout(() => {
|
||||||
dialogTitle.value,
|
testPopup.value?.open(
|
||||||
channelMapping.value,
|
dialogTitle.value,
|
||||||
planId.value,
|
channelMapping.value,
|
||||||
jwtUtil.getLoginName(),
|
planId.value,
|
||||||
devIds.value,
|
jwtUtil.getLoginName(),
|
||||||
standardDevIds.value,
|
devIds.value,
|
||||||
connections
|
standardDevIds.value,
|
||||||
)
|
connections
|
||||||
|
)
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转换 edges.value 为 channelMapping 格式
|
// 转换 edges.value 为 channelMapping 格式
|
||||||
|
|||||||
Reference in New Issue
Block a user