修改设计分析样式
This commit is contained in:
parent
32ac730b01
commit
e24ca3ef6a
@ -13,6 +13,7 @@ import {
|
|||||||
Stencil,
|
Stencil,
|
||||||
Transform
|
Transform
|
||||||
} from '@antv/x6'
|
} from '@antv/x6'
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import insertCss from 'insert-css'
|
import insertCss from 'insert-css'
|
||||||
import { updateProjects} from "@/api/business/project";
|
import { updateProjects} from "@/api/business/project";
|
||||||
@ -195,12 +196,44 @@ onMounted(() => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
layoutOptions: {
|
layoutOptions: {
|
||||||
columns: 2,
|
columns: 2,
|
||||||
columnWidth: 140,
|
columnWidth: 140,
|
||||||
rowHeight: 100,
|
rowHeight: 100,
|
||||||
},
|
},
|
||||||
|
getDragNode: (sourceNode:any) => {
|
||||||
|
let node:any = sourceNode
|
||||||
|
if (node.data && node.data.lineStyle) {
|
||||||
|
// 应用管线样式到连接线
|
||||||
|
const lineStyle = node.data.lineStyle
|
||||||
|
graph.options.connecting.createEdge = () => {
|
||||||
|
return new Shape.Edge({
|
||||||
|
attrs: {
|
||||||
|
line: {
|
||||||
|
stroke: '#A2B1C3',
|
||||||
|
strokeWidth: 2,
|
||||||
|
strokeDasharray: lineStyle.strokeDasharray,
|
||||||
|
targetMarker: lineStyle.targetMarker,
|
||||||
|
sourceMarker: lineStyle.sourceMarker
|
||||||
|
}
|
||||||
|
},
|
||||||
|
zIndex: 0
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
// 移除管线节点,因为它只是一个样式选择器
|
||||||
|
setTimeout(() => {
|
||||||
|
graph.removeNode(node)
|
||||||
|
}, 100)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return sourceNode.clone({ deep: true })
|
||||||
|
},
|
||||||
|
getDropNode: (draggingNode) => {
|
||||||
|
return draggingNode.clone({ deep: true })
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
graph.on('node:contextmenu', ({ e, node }) => {
|
graph.on('node:contextmenu', ({ e, node }) => {
|
||||||
selectedNode.value = node
|
selectedNode.value = node
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@ -1007,7 +1040,6 @@ function closeEditdevice(e:any){ // 关闭编辑设备弹窗
|
|||||||
selectedDevice.value = e
|
selectedDevice.value = e
|
||||||
let retrievedNode:any = graph.getCellById(nodeId.value)
|
let retrievedNode:any = graph.getCellById(nodeId.value)
|
||||||
retrievedNode.store.data.deviceInfo = e
|
retrievedNode.store.data.deviceInfo = e
|
||||||
retrievedNode.attr('label/refY', 160)
|
|
||||||
retrievedNode.attr('text/text', e.name)
|
retrievedNode.attr('text/text', e.name)
|
||||||
retrievedNode.attr('label/text', e.name)
|
retrievedNode.attr('label/text', e.name)
|
||||||
isEditdevice.value = false;
|
isEditdevice.value = false;
|
||||||
@ -1741,4 +1773,8 @@ function saveDesign() { // 保存设计
|
|||||||
color: #808080;
|
color: #808080;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.x6-widget-stencil .x6-node.x6-node-immovable{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user