From 49f09cc6f8ff8c30a75ed1a9d6f510b69b73962a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 12 十二月 2023 21:05:37 +0800
Subject: [PATCH] 2023-12-12

---
 src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx |  151 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 99 insertions(+), 52 deletions(-)

diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
index e5e7e1f..e89781e 100644
--- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -67,7 +67,7 @@
       tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
       min: 1,
       max: 24,
-      decimal: 0,
+      precision: 0,
       required: true
     },
     {
@@ -240,10 +240,11 @@
     shapes = [
       { field: 'rect', label: 'rect锛堢煩褰級' },
       { field: 'hollow-rect', label: 'hollow-rect锛堢┖蹇冪煩褰級' },
-      { field: 'line', label: 'line锛堢嚎鏉★級' },
-      { field: 'tick', label: 'tick锛堟尝鍔級' },
-      // { field: 'funnel', label: 'funnel' },
-      { field: 'pyramid', label: 'pyramid锛堣閿ワ級' }
+      // { field: 'hollow', label: 'hollow锛堢┖蹇冪煩褰級' },
+      // { field: 'line', label: 'line锛堢嚎鏉★級' },
+      // { field: 'tick', label: 'tick锛堟尝鍔級' },
+      // { field: 'funnel', label: 'funnel锛堟紡鏂楀浘锛�' },
+      { field: 'pyramid', label: 'pyramid锛堥噾瀛楀锛�' }
     ]
   }
 
@@ -270,6 +271,28 @@
       value: 'bottom',
       label: '搴曢儴'
     }])
+  }
+
+  let axis = []
+  if (card.grid !== 'hidden') {
+    axis.push('grid')
+  }
+  if (card.x_line !== 'hidden') {
+    axis.push('x_line')
+  }
+  if (card.y_line !== 'hidden') {
+    axis.push('y_line')
+  }
+  if (card.tick !== 'hidden') {
+    axis.push('tick')
+  }
+
+  let tickVals = []
+  if (card.x_label !== 'hidden') {
+    tickVals.push('x_label')
+  }
+  if (card.y_label !== 'hidden') {
+    tickVals.push('y_label')
   }
 
   return [
@@ -379,6 +402,7 @@
       label: '鍙樻崲',
       initval: card.transpose || 'false',
       tooltip: '妯旱鍧愭爣杞翠氦鎹�',
+      forbid: card.chartType === 'line',
       required: false,
       options: [{
         value: 'true',
@@ -473,26 +497,11 @@
       }]
     }, {
       type: 'radio',
-      field: 'repeat',
-      label: '閲嶅鏁版嵁',
-      initval: card.repeat || 'unrepeat',
-      required: false,
-      options: [{
-        value: 'unrepeat',
-        label: '鍘婚噸'
-      }, {
-        value: 'average',
-        label: '骞冲潎'
-      }, {
-        value: 'cumsum',
-        label: '绱姞'
-      }]
-    }, {
-      type: 'radio',
       field: 'coordinate',
       label: '鍧愭爣',
       initval: card.coordinate || 'angle',
       required: false,
+      forbid: card.chartType === 'line',
       options: [{
         value: 'angle',
         label: '浜岀淮鍧愭爣'
@@ -501,32 +510,70 @@
         label: '鏋佸潗鏍�'
       }]
     }, {
-      type: 'radio',
-      field: 'grid',
-      label: '缃戞牸绾�',
-      initval: card.grid || 'show',
+      type: 'checkbox',
+      field: 'axis',
+      label: '鍧愭爣杞�',
+      initval: axis,
       required: false,
       options: [{
-        value: 'show',
-        label: '鏄剧ず'
+        value: 'grid',
+        label: '缃戞牸绾�'
       }, {
-        value: 'hidden',
-        label: '闅愯棌'
-      }]
+        value: 'x_line',
+        label: 'X杞�'
+      }, {
+        value: 'y_line',
+        label: 'Y杞�'
+      }, {
+        value: 'tick',
+        label: '鍒诲害绾�'
+      }],
+      controlFields: [
+        {field: 'lineColor', notNull: true},
+      ]
     }, {
-      type: 'radio',
-      field: 'y_line',
-      label: 'y杞磋竟绾�',
-      initval: card.y_line || 'hidden',
-      tooltip: '鍥惧舰宸︿晶鎴栧彸渚х殑杈圭嚎銆�',
+      type: 'checkbox',
+      field: 'tickVals',
+      label: '鍒诲害鍊�',
+      initval: tickVals,
       required: false,
       options: [{
-        value: 'show',
-        label: '鏄剧ず'
+        value: 'x_label',
+        label: 'X杞�'
       }, {
-        value: 'hidden',
-        label: '闅愯棌'
-      }]
+        value: 'y_label',
+        label: 'Y杞�'
+      }],
+      controlFields: [
+        {field: 'color', notNull: true},
+      ]
+    // }, {
+    //   type: 'radio',
+    //   field: 'grid',
+    //   label: '缃戞牸绾�',
+    //   initval: card.grid || 'show',
+    //   required: false,
+    //   options: [{
+    //     value: 'show',
+    //     label: '鏄剧ず'
+    //   }, {
+    //     value: 'hidden',
+    //     label: '闅愯棌'
+    //   }]
+    // }, {
+    //   type: 'radio',
+    //   field: 'y_line',
+    //   label: 'y杞磋竟绾�',
+    //   initval: card.y_line || 'hidden',
+    //   tooltip: '鍥惧舰宸︿晶鎴栧彸渚х殑杈圭嚎銆�',
+    //   required: false,
+    //   options: [{
+    //     value: 'show',
+    //     label: '鏄剧ず'
+    //   }, {
+    //     value: 'hidden',
+    //     label: '闅愯棌'
+    //   }]
     }, {
       type: 'radio',
       field: 'download',
@@ -558,8 +605,8 @@
       label: '鏌卞舰瀹藉害',
       tooltip: '绌哄�兼椂锛屽搴﹁嚜閫傚簲銆�',
       min: 5,
-      max: 100,
-      decimal: 0,
+      max: 200,
+      precision: 0,
       initval: card.barSize,
       forbid: !['bar'].includes(card.chartType),
       required: false
@@ -570,7 +617,7 @@
       tooltip: '鏌卞舰鍥句笂绔渾瑙掋��',
       min: 0,
       max: 200,
-      decimal: 0,
+      precision: 0,
       initval: card.barRadius || 0,
       forbid: !['bar'].includes(card.chartType),
       required: false
@@ -599,17 +646,17 @@
       required: false
     }, {
       type: 'color',
-      field: 'color',
-      label: '鑹茬郴',
-      initval: card.color || 'rgba(0, 0, 0, 0.65)',
-      tooltip: '鍧愭爣杞存彁绀烘枃瀛楀強绀轰緥鐨勯鑹层��',
+      field: 'lineColor',
+      label: '鍧愭爣杞撮鑹�',
+      initval: card.lineColor || '',
+      tooltip: '鍧愭爣杞寸嚎鐨勯鑹诧紝鍖呮嫭x杞淬�亂杞淬�佺綉鏍肩嚎銆佸埢搴︾嚎銆�',
+      allowClear: true,
       required: false
     }, {
       type: 'color',
-      field: 'lineColor',
-      label: '杞寸嚎棰滆壊',
-      initval: card.lineColor,
-      tooltip: '鍧愭爣杞寸嚎鐨勯鑹诧紝鍖呮嫭x杞淬�亂杞村強缃戞牸绾裤��',
+      field: 'color',
+      label: '鍒诲害鍊奸鑹�',
+      initval: card.color || '',
       allowClear: true,
       required: false
     }, {
@@ -619,7 +666,7 @@
       tooltip: '鍧愭爣杞存爣娉ㄦ枃鏈殑鏃嬭浆瑙掑害銆�',
       min: 0,
       max: 360,
-      decimal: 0,
+      precision: 0,
       initval: card.rotate,
       forbid: appType !== 'mob',
       required: false

--
Gitblit v1.8.0