Compare commits
2 Commits
e9bf7e9e0e
...
38ac583fb7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38ac583fb7 | ||
|
|
64c05b629c |
@@ -37,6 +37,7 @@ import { jwtUtil } from '@/utils/jwtUtil'
|
|||||||
import { useCheckStore } from '@/stores/modules/check'
|
import { useCheckStore } from '@/stores/modules/check'
|
||||||
import { ipc } from '@/utils/ipcRenderer'
|
import { ipc } from '@/utils/ipcRenderer'
|
||||||
import { fa, tr } from 'element-plus/es/locale'
|
import { fa, tr } from 'element-plus/es/locale'
|
||||||
|
import { CheckData } from '@/api/check/interface'
|
||||||
const vueFlowElement = ref(442)
|
const vueFlowElement = ref(442)
|
||||||
const checkStore = useCheckStore()
|
const checkStore = useCheckStore()
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
@@ -427,7 +428,7 @@ const standardDevIds = ref<string[]>()
|
|||||||
const open = async () => {
|
const open = async () => {
|
||||||
edges.value = []
|
edges.value = []
|
||||||
|
|
||||||
devIds.value = prop.devIdList.map(d => d.id)
|
//devIds.value = prop.devIdList.map(d => d.id)
|
||||||
standardDevIds.value = prop.pqStandardDevList.map(d => d.id)
|
standardDevIds.value = prop.pqStandardDevList.map(d => d.id)
|
||||||
planId.value = prop.planIdKey
|
planId.value = prop.planIdKey
|
||||||
nodes.value = createNodes(prop.devIdList, prop.pqStandardDevList, prop.deviceMonitor)
|
nodes.value = createNodes(prop.devIdList, prop.pqStandardDevList, prop.deviceMonitor)
|
||||||
@@ -447,11 +448,33 @@ const handleNext = async () => {
|
|||||||
let chnNumList: string[] = []
|
let chnNumList: string[] = []
|
||||||
await edges.value.forEach(edge => {
|
await edges.value.forEach(edge => {
|
||||||
const match = edge.source.split('-')
|
const match = edge.source.split('-')
|
||||||
|
|
||||||
if (match) {
|
if (match) {
|
||||||
chnNumList.push(match[2])
|
chnNumList.push(match[1] + '-'+ match[2])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const connectedDeviceIds = [...new Set(chnNumList.map(item => item.split('-')[0]))]
|
||||||
|
devIds.value = connectedDeviceIds
|
||||||
|
//可能存在勾选的被检设备未连线的情况,需要过滤掉
|
||||||
|
let devices: CheckData.Device[] = prop.devIdList
|
||||||
|
.filter((item: any) => connectedDeviceIds.includes(item.id))
|
||||||
|
.map((item: any) => {
|
||||||
|
return {
|
||||||
|
deviceId: item.id,
|
||||||
|
deviceName: item.name,
|
||||||
|
chnNum: item.devChns,
|
||||||
|
planId: item.planId,
|
||||||
|
deviceType: item.devType,
|
||||||
|
devVolt: item.devVolt,
|
||||||
|
devCurr: item.devCurr,
|
||||||
|
factorFlag: item.factorFlag,
|
||||||
|
checkResult: item.checkResult
|
||||||
|
}
|
||||||
|
})
|
||||||
|
checkStore.clearDevices()
|
||||||
|
checkStore.addDevices(devices)
|
||||||
|
|
||||||
|
|
||||||
const connections = edges.value.reduce(
|
const connections = edges.value.reduce(
|
||||||
(map, edge) => {
|
(map, edge) => {
|
||||||
// 从source中提取设备ID和通道号: 被检通道-{deviceId}-{channelNum} => {deviceId}-{channelNum}
|
// 从source中提取设备ID和通道号: 被检通道-{deviceId}-{channelNum} => {deviceId}-{channelNum}
|
||||||
|
|||||||
@@ -37,9 +37,9 @@
|
|||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="(chnItem, index2) in checkStore.chnNumList"
|
v-for="(chnItem, index2) in checkStore.chnNumList.filter(c => c.startsWith(item.deviceId))"
|
||||||
:key="`${item.deviceId}${chnItem}`"
|
:key="`${item.deviceId}${chnItem}`"
|
||||||
:label="'通道' + chnItem"
|
:label="'通道' + chnItem.split('-')[1]"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
@@ -804,6 +804,7 @@ const initCheckResult = (defaultValue: CheckData.ChnCheckResultEnum) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
Object.assign(checkResult, result)
|
Object.assign(checkResult, result)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const scrollToBottom = () => {
|
const scrollToBottom = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user