From 3d4bc79a80eb9cff0f8ef7c53f9685c9ff9fbd2d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 02 九月 2021 23:17:36 +0800
Subject: [PATCH] 2021-09-02

---
 src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx |   90 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 89 insertions(+), 1 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..121440f 100644
--- a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx
@@ -12,7 +12,7 @@
   if (roleList) {
     try {
       roleList = JSON.parse(roleList)
-    } catch {
+    } catch (e) {
       roleList = []
     }
   } else {
@@ -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