From 874b48da44ea0f7ddca00fb865647fe5ea5f906f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 30 六月 2023 18:26:19 +0800
Subject: [PATCH] 2023-06-30

---
 src/tabviews/custom/components/chart/antv-X6/index.jsx |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/src/tabviews/custom/components/chart/antv-X6/index.jsx b/src/tabviews/custom/components/chart/antv-X6/index.jsx
index 6a8f37a..3090207 100644
--- a/src/tabviews/custom/components/chart/antv-X6/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-X6/index.jsx
@@ -1512,12 +1512,29 @@
     const { node } = this.state
 
     if (node.shape === 'edge') {
+      let labels = this.selectNode.prop('labels')
+      if (!labels || labels.length === 0) {
+        labels = [{
+          attrs: {label: { text: '' }}
+        }]
+      }
+
       if (key === 'title') {
-        this.selectNode.setLabels(value)
+        labels = JSON.parse(JSON.stringify(labels))
+        labels[0].attrs.label.text = value
+        this.selectNode.setLabels(labels)
       } else if (key === 'stroke') {
         this.selectNode.attr('line/stroke', value)
       } else if (key === 'strokeWidth') {
         this.selectNode.attr('line/strokeWidth', value)
+      } else if (key === 'fontSize') {
+        labels = JSON.parse(JSON.stringify(labels))
+        labels[0].attrs.label.fontSize = value
+        this.selectNode.setLabels(labels)
+      } else if (key === 'fontFill') {
+        labels = JSON.parse(JSON.stringify(labels))
+        labels[0].attrs.label.fill = value
+        this.selectNode.setLabels(labels)
       } else if (key === 'lineType') {
         if (value === 'dash') {
           this.selectNode.attr('line/strokeDasharray', 5)

--
Gitblit v1.8.0