微调
This commit is contained in:
@@ -206,7 +206,9 @@ const handleConnect = (params: any) => {
|
||||
|
||||
// 删除不合法连接
|
||||
const removeEdge = (params: any) => {
|
||||
console.log('删除不合法连接:', params);
|
||||
const edgeIndex = edges.value.findIndex(edge => edge.source === params.source && edge.target === params.target)
|
||||
console.log('删除连接信息:', edges.value);
|
||||
if (edgeIndex !== -1) {
|
||||
edges.value.splice(edgeIndex, 1)
|
||||
}
|
||||
@@ -350,21 +352,21 @@ const generateChannelMapping = () => {
|
||||
|
||||
|
||||
// 计算基于 dialogWidth 的位置参数 - 确保最小距离
|
||||
const deviceWidthVal = computed(() => {
|
||||
const standardWidthVal = computed(() => {
|
||||
return Math.max(0, 50)
|
||||
})
|
||||
|
||||
const inputChannelXVal = computed(() => {
|
||||
return Math.max(300, deviceWidthVal.value + 300)
|
||||
})
|
||||
|
||||
const outputChannelXVal = computed(() => {
|
||||
return Math.max(650, prop.dialogWidth - 470)
|
||||
})
|
||||
|
||||
const standardWidthVal = computed(() => {
|
||||
})
|
||||
|
||||
const inputChannelXVal = computed(() => {
|
||||
return Math.max(300, standardWidthVal.value + 300)
|
||||
})
|
||||
|
||||
const outputChannelXVal = computed(() => {
|
||||
return Math.max(600, prop.dialogWidth - 500)
|
||||
})
|
||||
|
||||
const deviceWidthVal = computed(() => {
|
||||
return Math.max(800, prop.dialogWidth - 350)
|
||||
})
|
||||
})
|
||||
|
||||
const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResPqStandardDevice[], deviceMonitor: Map<string, any[]>) => {
|
||||
const channelCounts: Record<string, number> = {}
|
||||
@@ -404,10 +406,10 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP
|
||||
// const inputChannelX = 350
|
||||
// const outputChannelX = 1050
|
||||
// const standardWidth = 1170
|
||||
const deviceWidth = deviceWidthVal.value
|
||||
const inputChannelX = inputChannelXVal.value
|
||||
const outputChannelX = outputChannelXVal.value
|
||||
const standardWidth = standardWidthVal.value
|
||||
const standardWidth = standardWidthVal.value
|
||||
const outputChannelX = inputChannelXVal.value
|
||||
const inputChannelX = outputChannelXVal.value
|
||||
const deviceWidth = deviceWidthVal.value
|
||||
|
||||
// 添加被检通道
|
||||
// let currentYPosition = 50; // 初始Y位置
|
||||
@@ -463,7 +465,7 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP
|
||||
type: 'input',
|
||||
data: { label: createLabel3(`被检通道${channelNum}`+ statusText) },
|
||||
position: { x: inputChannelX, y: yPosition + index * 50 },
|
||||
sourcePosition: 'right',
|
||||
sourcePosition: 'left',
|
||||
style: { width: '160px', border: 'none', boxShadow: 'none' }
|
||||
});
|
||||
|
||||
@@ -499,7 +501,7 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP
|
||||
type: 'output',
|
||||
data: { label: createLabel3(`标准通道${i}`) },
|
||||
position: { x: outputChannelX, y: yPosition2 + (i - 1) * 50 },
|
||||
targetPosition: 'left',
|
||||
targetPosition: 'right',
|
||||
style: { width: '120px', border: 'none', boxShadow: 'none' }
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user