通道配对
This commit is contained in:
@@ -201,8 +201,15 @@ function logConnections() {
|
|||||||
|
|
||||||
const nodes = ref([])
|
const nodes = ref([])
|
||||||
const sourceIdArray = ref<string[]>()
|
const sourceIdArray = ref<string[]>()
|
||||||
const open = async (device: Device.ResPqDev[], standardDev: StandardDevice.ResPqStandardDevice[],sourceIds: string[]) => {
|
const planId = ref('')
|
||||||
|
const devIds = ref<string[]>()
|
||||||
|
const standardDevIds = ref<string[]>()
|
||||||
|
|
||||||
|
const open = async (device: Device.ResPqDev[], standardDev: StandardDevice.ResPqStandardDevice[],sourceIds: string[],fatherPlanId: string) => {
|
||||||
edges.value = []
|
edges.value = []
|
||||||
|
devIds.value = device.map(d => d.id)
|
||||||
|
standardDevIds.value = standardDev.map(d => d.id)
|
||||||
|
planId.value = fatherPlanId
|
||||||
sourceIdArray.value = sourceIds
|
sourceIdArray.value = sourceIds
|
||||||
nodes.value = createNodes(device, standardDev)
|
nodes.value = createNodes(device, standardDev)
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
@@ -219,6 +226,27 @@ const handleNext = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openTestDialog = async () => {
|
const openTestDialog = async () => {
|
||||||
|
|
||||||
|
// 转换连接信息,只保留设备ID和通道号
|
||||||
|
const connections = edges.value.reduce((map, edge) => {
|
||||||
|
// 从source中提取设备ID和通道号: 被检通道-{deviceId}-{channelNum} => {deviceId}-{channelNum}
|
||||||
|
const sourceKey = edge.source.replace('被检通道-', '');
|
||||||
|
|
||||||
|
// 从target中提取设备ID和通道号: 标准通道-{deviceId}-{channelNum} => {deviceId}-{channelNum}
|
||||||
|
const targetValue = edge.target.replace('标准通道-', '');
|
||||||
|
|
||||||
|
map[sourceKey] = targetValue;
|
||||||
|
return map;
|
||||||
|
}, {} as Record<string, string>);
|
||||||
|
|
||||||
|
console.log('通道配对信息:', connections);
|
||||||
|
await contrastTest({
|
||||||
|
planId: planId.value,
|
||||||
|
loginName: jwtUtil.getLoginName(),
|
||||||
|
devIds: devIds.value,
|
||||||
|
standardDevIds: standardDevIds.value,
|
||||||
|
pairs:connections
|
||||||
|
})
|
||||||
testPopup.value?.open(dialogTitle.value,sourceIdArray.value)
|
testPopup.value?.open(dialogTitle.value,sourceIdArray.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -742,7 +742,7 @@ const handleTest2 = () => {
|
|||||||
if (matchedItem) {
|
if (matchedItem) {
|
||||||
dataSources.value = matchedItem.datasourceIds
|
dataSources.value = matchedItem.datasourceIds
|
||||||
}
|
}
|
||||||
deviceConnectionPopupRef.value?.open(channelsSelection.value, pqStandardDevList.value, dataSources.value)
|
deviceConnectionPopupRef.value?.open(channelsSelection.value, pqStandardDevList.value, dataSources.value,props.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user