feige
2024-08-24 22f6c02cdae18e9501a2ce8911208218d271fd92
ruoyi-ui/src/views/components/superMindmap.vue
@@ -250,28 +250,39 @@
                                  return 'pointer'
                              }
                          })
              // 添加头像
                groups.append("image")
                  .attr("xlink:href", function (d) {
                    return d.data.url; // 头像图片的路径
                  })
                  .attr("x", 12) // 头像相对于节点的水平位置
                  .attr("y", 3) // 头像相对于节点的垂直位置
                  .attr("width", 24) // 头像的宽度
                  .attr("height", 24); // 头像的高度
                //绘制标注(节点前的矩形)
                groups.append("rect")
                  .attr("x", 37)
                  .attr("y", 3)
                  .attr("width",
                    function (d) {
                      return d.data.link ? (getPXwidth(d.data.link) + 30) : 0
                    }
                  )
                  .attr("height", 26)
                  .attr("fill", "#FFFFFF")
                  // 添加圆角
                  .attr("rx", 4)
           // 添加头像
           let pu = null
             let gp = groups.append("image")
               .attr("xlink:href", function (d) {
            // console.log(d.data.purl)
                  pu = d.data.purl
            // console.log(d.data.prop)
            // console.log(d.data.label==="")
             if(d.data.label==="")
               return ""
            else
                 return d.data.purl; // 头像图片的路径
               })
         if (pu!=null){
               gp.attr("x", 12) // 头像相对于节点的水平位置
               .attr("y", 3) // 头像相对于节点的垂直位置
               .attr("width", 24) // 头像的宽度
               .attr("height", 24); // 头像的高度
             //绘制标注(节点前的矩形)
             gp.append("rect")
               .attr("x", 37)
               .attr("y", 3)
               .attr("width",
                 function (d) {
                   return d.data.link ? (getPXwidth(d.data.link) + 30) : 0
                 }
               )
               .attr("height", 26)
               .attr("fill", "#FFFFFF")
               // 添加圆角
               .attr("rx", 4)
            }
                  //绘制文字
                groups.append("text")
                    .on("click", function (event, node) {
@@ -286,6 +297,7 @@
                            that.$router.push("/familymodel/jiagenwang/personInfo/" + data.id);
                            //that.$emit('activeChange', 'map')
                           // return
                        }
                        // 标准节点—— 传出 prop