From 5cfe6db94c1449810a44660b299dba8e7e98e5c5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 10 六月 2021 14:43:39 +0800
Subject: [PATCH] 2021-06-10

---
 src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx |   88 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 88 insertions(+), 0 deletions(-)

diff --git a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx
index 3449d39..335df94 100644
--- a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx
@@ -143,3 +143,91 @@
     }
   ]
 }
+
+/**
+ * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟
+ * @param {object} card       // 鍥捐〃瀵硅薄
+ * @param {Array}  columns    // 鏄剧ず鍒�
+ */
+export function getRadioOptionForm (card, columns) {
+  let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype))
+  let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
+
+  return [
+    {
+      type: 'select',
+      key: 'labelField',
+      label: '鎸囨爣',
+      initVal: card.labelField || '',
+      required: true,
+      options: xfields
+    },
+    {
+      type: 'select',
+      key: 'valueField',
+      label: '鍊�',
+      initVal: card.valueField || '',
+      required: true,
+      options: yfields
+    },
+    {
+      type: 'number',
+      key: 'maxValue',
+      label: '鏈�澶у��',
+      initVal: card.maxValue || 100,
+      min: 0,
+      max: 999999,
+      decimal: 1,
+      required: true
+    },
+    {
+      type: 'number',
+      key: 'radius',
+      label: '澶栫幆',
+      initVal: card.radius || 75,
+      tooltip: '鍥惧舰鎵�鍗犲尯鍩熺殑鐧惧垎鐜囥��',
+      min: 30,
+      max: 100,
+      decimal: 0,
+      required: true
+    },
+    {
+      type: 'number',
+      key: 'fontSize',
+      label: '瀛椾綋澶у皬',
+      initVal: card.fontSize || 28,
+      min: 12,
+      max: 200,
+      decimal: 0,
+      required: true
+    },
+    {
+      type: 'radio',
+      key: 'percent',
+      label: '鐧惧垎鐜�',
+      initVal: card.percent || 'true',
+      required: false,
+      options: [{
+        value: 'true',
+        text: '浣跨敤'
+      }, {
+        value: 'false',
+        text: '涓嶄娇鐢�'
+      }]
+    },
+    {
+      type: 'color',
+      key: 'backColor',
+      label: '鑳屾櫙鑹�',
+      initVal: card.backColor || '#ebedf0',
+      required: false
+    },
+    {
+      type: 'color',
+      key: 'labelColor',
+      label: '瀛椾綋棰滆壊',
+      initVal: card.labelColor || '#8c8c8c',
+      required: false
+    }
+  ]
+}

--
Gitblit v1.8.0