jinlin
2024-10-28 79eab76ac1b4b77696c92d72cfbde1e122c4c28f
web/src/views/modules/taskReliability/RBD-edit-img.vue
@@ -1026,7 +1026,7 @@
          this.graph.createNode({
            shape: 'image',
            //imageUrl: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=${item.imgPath}`,
            width: 100,
            width: 60,
            height: 70,
            //id: item.dataId, // 手动设置节点的 ID
            data: {
@@ -1057,11 +1057,11 @@
            },
            attrs: {
              image: {
                'xlink:href': `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=${item.imgPath}`,
                'xlink:href': `${window.SITE_CONFIG['apiURL']}/basicInfo/XhProductModel/getImg?token=${Cookies.get('token')}&id=${item.dataId}&t=${new Date().getTime()}`,
                //'xlink:href': urlObject.createObjectURL(new Blob([item.svgContent])),
              },
              title: {
                text: item.basicUnitNum>=1?item.basicUnitNum:'',
                text: item.basicUnitNum>1?item.basicUnitNum:'',
                refX: 15,
                refY: 10,
                fill: '#748be7',
@@ -1739,7 +1739,7 @@
        let dragNodeType = dragNode.getData().nodeType
        let offHeight = 50
        if (dragNodeType === 'node') {
          offHeight = 60
          offHeight = 70
        } else if (dragNodeType === 'bridgeConnection') {
          offHeight = 175
        } else {
@@ -1797,13 +1797,13 @@
          this.getYRange(inEdges, graphNodeStartNode, pointXY)
          console.log(pointXY, 'new')
          let minX = graphNodeStartNode.position().x + graphNode.getBBox().width + 15
          let maxX = graphNode.position().x
          let minX = graphNodeStartNode.position().x + graphNode.getBBox().width
          let maxX = graphNode.position().x - dragNode.getBBox().width / 2
          let centerX = minX + (maxX - minX) / 2
          let centerY = graphNodeY + graphNode.getBBox().height / 2 - pointXY.minY > pointXY.maxY - (graphNodeY + graphNode.getBBox().height / 2) ?
            pointXY.maxY + offHeight / 2 + 30 : pointXY.minY - offHeight / 2 - 30
          let result = this.addNodeAndConnect(null, dragNode, minX, centerY)
          let result = this.addNodeAndConnect(null, dragNode, centerX, centerY)
          console.log(result, 'result111')
          this.graph.addEdge({
            source: {cell: graphNodeStartNode},
@@ -1844,8 +1844,8 @@
          leftTopY = centerY
        let dragNodeType = dragNode.getData().nodeType
        if (dragNodeType === 'node') {
          width = 60
          height = 60
          width = 100
          height = 70
        } else if (dragNodeType === 'dashedBox') {
          width = 60
          height = 40
@@ -1854,7 +1854,7 @@
          height = 175
        } else {
          width = 270
          height = 60
          height = 70
        }
        leftTopX = centerX - width / 2
        leftTopY = centerY - height / 2