From aa53227bc006816a30258c6390084aa74defb4d1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 27 十一月 2023 18:05:55 +0800
Subject: [PATCH] 2023-11-27

---
 src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx |  338 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 173 insertions(+), 165 deletions(-)

diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
index c98849c..e5e7e1f 100644
--- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -46,24 +46,24 @@
   return [
     {
       type: 'text',
-      key: 'title',
+      field: 'title',
       label: '鏍囬',
-      initVal: card.title,
+      initval: card.title,
       required: false
     },
     {
       type: 'text',
-      key: 'name',
+      field: 'name',
       label: '缁勪欢鍚嶇О',
-      initVal: card.name,
+      initval: card.name,
       tooltip: '鐢ㄤ簬缁勪欢闂寸殑鍖哄垎銆�',
       required: true
     },
     {
       type: 'number',
-      key: 'width',
+      field: 'width',
       label: '瀹藉害',
-      initVal: card.width,
+      initval: card.width,
       tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
       min: 1,
       max: 24,
@@ -72,52 +72,51 @@
     },
     {
       type: 'styleInput',
-      key: 'height',
+      field: 'height',
       label: '鍥捐〃楂樺害',
-      initVal: card.height,
+      initval: card.height,
       tooltip: '鍥捐〃缁樺浘鍖哄煙鐨勯珮搴︼紝涓嶅寘鎷爣棰樺強鍐呭杈硅窛銆�',
       required: true,
       options: ['px', 'vh', 'vw']
     },
     {
       type: 'radio',
-      key: 'permission',
+      field: 'permission',
       label: '鏉冮檺楠岃瘉',
-      initVal: card.permission || 'false',
+      initval: card.permission || 'false',
       required: false,
       options: [
-        {value: 'true', text: '鍚敤'},
-        {value: 'false', text: '绂佺敤'},
+        {value: 'true', label: '鍚敤'},
+        {value: 'false', label: '绂佺敤'},
       ],
       forbid: !appType || ispop || isprint
     },
     {
       type: 'radio',
-      key: 'cacheLocal',
+      field: 'cacheLocal',
       label: '鏈湴缂撳瓨',
-      initVal: card.cacheLocal || 'true',
+      initval: card.cacheLocal || 'true',
       required: false,
       options: [
-        {value: 'true', text: '缁ф壙鑿滃崟'},
-        {value: 'false', text: '绂佺敤'},
+        {value: 'true', label: '缁ф壙鑿滃崟'},
+        {value: 'false', label: '绂佺敤'},
       ],
       forbid: ispop || isprint
     },
     {
-      type: 'select',
-      key: 'blacklist',
+      type: 'multiselect',
+      field: 'blacklist',
       label: '榛戝悕鍗�',
-      initVal: card.blacklist || [],
-      multi: true,
+      initval: card.blacklist || [],
       required: false,
       options: roleList,
       forbid: !!appType || isprint
     },
     {
       type: 'radio',
-      key: 'click',
+      field: 'click',
       label: '鐐瑰嚮浜嬩欢',
-      initVal: card.click || '',
+      initval: card.click || '',
       tooltip: '鐐瑰嚮鏌卞瓙鏃惰Е鍙戠殑浜嬩欢锛屽惎鐢ㄨ嚜瀹氫箟璁剧疆鏃舵棤鏁堛��',
       required: false,
       forbid: appType === 'mob' || card.chartType !== 'bar',
@@ -125,13 +124,20 @@
         {value: '', label: '鏁版嵁鍒囨崲'},
         {value: 'menu', label: '鑿滃崟'},
         {value: 'menus', label: '鑿滃崟缁�'}
+      ],
+      controlFields: [
+        {field: 'menu', values: ['menu']},
+        {field: 'open', values: ['menu', 'menus']},
+        {field: 'joint', values: ['menu', 'menus']},
+        {field: 'menuType', values: ['menus']},
+        {field: 'menus', values: ['menus']},
       ]
     },
     {
       type: appType === '' ? 'cascader' : 'select',
-      key: 'menu',
+      field: 'menu',
       label: '鍏宠仈鑿滃崟',
-      initVal: card.menu || (appType === '' ? [] : ''),
+      initval: card.menu || (appType === '' ? [] : ''),
       tooltip: '鍦ㄤ娇鐢ㄦ煴褰㈠浘涓旀湭鍚敤鑷畾涔夎缃椂鏈夋晥銆�',
       required: true,
       forbid: appType === 'mob' || card.chartType !== 'bar',
@@ -140,9 +146,9 @@
     },
     {
       type: 'select',
-      key: 'menuType',
+      field: 'menuType',
       label: '鑿滃崟绫诲瀷',
-      initVal: card.menuType || '',
+      initval: card.menuType || '',
       required: true,
       forbid: appType === 'mob' || card.chartType !== 'bar',
       hidden: card.click !== 'menus',
@@ -150,9 +156,9 @@
     },
     {
       type: 'radio',
-      key: 'open',
+      field: 'open',
       label: '鎵撳紑鏂瑰紡',
-      initVal: card.open || 'blank',
+      initval: card.open || 'blank',
       required: false,
       options: [
         {value: 'blank', label: '鏂扮獥鍙�'},
@@ -163,9 +169,9 @@
     },
     {
       type: 'radio',
-      key: 'joint',
+      field: 'joint',
       label: '鍙傛暟鎷兼帴',
-      initVal: card.joint || 'true',
+      initval: card.joint || 'true',
       required: false,
       options: [
         {value: 'true', label: '鏄�'},
@@ -176,9 +182,9 @@
     },
     {
       type: 'table',
-      key: 'menus',
+      field: 'menus',
       label: '鑿滃崟缁�',
-      initVal: card.menus || [],
+      initval: card.menus || [],
       required: true,
       span: 24,
       actions: ['view'],
@@ -246,68 +252,70 @@
 
   let labelOptions = [{
     value: 'false',
-    text: '闅愯棌'
+    label: '闅愯棌'
   }, {
     value: 'true',
-    text: '鏄剧ず'
+    label: '鏄剧ず'
   }]
 
   if (card.chartType === 'bar') {
-    labelOptions[1].text = '澶栭儴'
+    labelOptions[1].label = '澶栭儴'
     labelOptions.push(...[{
       value: 'top',
-      text: '椤堕儴'
+      label: '椤堕儴'
     }, {
       value: 'middle',
-      text: '涓棿'
+      label: '涓棿'
     }, {
       value: 'bottom',
-      text: '搴曢儴'
+      label: '搴曢儴'
     }])
   }
-
-  let _label = card.label || 'false'
 
   return [
     {
       type: 'radio',
-      key: 'datatype',
+      field: 'datatype',
       label: '鏁版嵁绫诲瀷',
-      initVal: card.datatype || 'query',
+      initval: card.datatype || 'query',
       tooltip: '缁熻鍥捐〃閫傜敤浜庡睍绀烘暟鎹被鍨嬩负鍔ㄦ�佸�笺��',
       required: false,
+      $trans: true,
       options: [
-        { value: 'query', text: '鏌ヨ' },
-        { value: 'statistics', text: '缁熻' }
+        { value: 'query', label: '鏌ヨ' },
+        { value: 'statistics', label: '缁熻' }
+      ],
+      controlFields: [
+        {field: 'InfoType', values: ['statistics']},
+        {field: 'InfoValue', values: ['statistics']},
+        {field: 'Yaxis', values: ['query']},
       ]
     }, {
       type: 'select',
-      key: 'Xaxis',
+      field: 'Xaxis',
       label: 'X-杞�',
-      initVal: card.Xaxis || '',
+      initval: card.Xaxis || '',
       required: true,
       options: xfields
     }, {
       type: 'select',
-      key: 'InfoType',
+      field: 'InfoType',
       label: '绫诲瀷',
-      initVal: card.InfoType || '',
-      hidden: card.datatype !== 'statistics',
+      initval: card.InfoType || '',
       required: true,
       options: xfields
     }, {
       type: 'select',
-      key: 'InfoValue',
+      field: 'InfoValue',
       label: '鍊�',
-      initVal: card.InfoValue || '',
-      hidden: card.datatype !== 'statistics',
+      initval: card.InfoValue || '',
       required: true,
       options: yfields
     }, {
       type: 'select',
-      key: 'legend',
+      field: 'legend',
       label: '鍥句緥浣嶇疆',
-      initVal: card.legend || 'bottom',
+      initval: card.legend || 'bottom',
       required: false,
       options: [
         { field: 'bottom', label: '涓�' },
@@ -325,313 +333,301 @@
         { field: 'hidden', label: '闅愯棌' }
       ]
     }, {
-      type: 'select',
-      key: 'Yaxis',
+      type: 'multiselect',
+      field: 'Yaxis',
       label: 'Y-杞�',
-      initVal: card.Yaxis || [],
-      multi: true, // 澶氶��
-      hidden: card.datatype === 'statistics',
+      initval: card.Yaxis || [],
       required: true,
       options: yfields
     }, {
       type: 'select',
-      key: 'shape',
+      field: 'shape',
       label: '褰㈢姸',
-      initVal: card.shape || (shapes[0] && shapes[0].field),
+      initval: card.shape || (shapes[0] && shapes[0].field),
       required: false,
       options: shapes
     }, {
       type: 'radio',
-      key: 'tooltip',
+      field: 'tooltip',
       label: '鎮诞鎻愮ず',
-      initVal: card.tooltip || 'true',
+      initval: card.tooltip || 'true',
       required: false,
       options: [{
         value: 'true',
-        text: '鏄剧ず'
+        label: '鏄剧ず'
       }, {
         value: 'false',
-        text: '闅愯棌'
+        label: '闅愯棌'
       }]
     }, {
       type: 'radio',
-      key: 'point',
+      field: 'point',
       label: '鐐瑰浘',
-      initVal: card.point || 'false',
+      initval: card.point || 'false',
       required: false,
       forbid: !['line'].includes(card.chartType),
       options: [{
         value: 'true',
-        text: '鏄剧ず'
+        label: '鏄剧ず'
       }, {
         value: 'false',
-        text: '闅愯棌'
+        label: '闅愯棌'
       }]
     }, {
       type: 'radio',
-      key: 'transpose',
+      field: 'transpose',
       label: '鍙樻崲',
-      initVal: card.transpose || 'false',
+      initval: card.transpose || 'false',
       tooltip: '妯旱鍧愭爣杞翠氦鎹�',
       required: false,
       options: [{
         value: 'true',
-        text: '鏄�'
+        label: '鏄�'
       }, {
         value: 'false',
-        text: '鍚�'
+        label: '鍚�'
       }]
     }, {
       type: 'radio',
-      key: 'show',
+      field: 'show',
       label: '鏄剧ず',
-      initVal: card.show || 'value',
+      initval: card.show || 'value',
       tooltip: '褰撲娇鐢ㄨ嚜瀹氫箟璁剧疆鏃讹紝鍙湪鏄剧ず锛堝��/%锛夊鍗曠嫭璁剧疆鏄剧ず绫诲瀷銆傛敞锛氳嚜瀹氫箟涓虹┖鏃朵娇鐢ㄦ澶勮缃��',
       required: false,
       options: [{
         value: 'value',
-        text: '鏁板��'
+        label: '鏁板��'
       }, {
         value: 'percent',
-        text: '鐧惧垎姣�'
+        label: '鐧惧垎姣�'
       }, {
         value: 'thdSeparator',
-        text: '鍗冨垎浣�'
+        label: '鍗冨垎浣�'
       }]
     }, {
-      type: labelOptions.length > 20 ? 'select' : 'radio',
-      key: 'label',
+      type: 'radio',
+      field: 'label',
       label: '鏍囨敞',
-      initVal: _label,
+      initval: card.label || 'false',
       tooltip: '鍥惧舰鑺傜偣澶勭殑鏁板�笺��',
       required: false,
-      options: labelOptions
+      options: labelOptions,
+      controlFields: [
+        {field: 'labelColor', values: ['true']}
+      ]
     }, {
       type: 'radio',
-      key: 'labelColor',
+      field: 'labelColor',
       label: '鏍囨敞棰滆壊',
-      initVal: card.labelColor || 'system',
+      initval: card.labelColor || 'system',
       tooltip: '浣跨敤绯荤粺鑹叉椂锛屼娇鐢ㄨ壊绯婚�夐」璁剧疆鐨勭郴缁熼鑹诧紝浣跨敤鑷畾涔変负棰滆壊璁剧疆涓畾涔夌殑鍥惧舰棰滆壊銆�',
       required: false,
-      hidden: _label !== 'true',
       options: [{
         value: 'system',
-        text: '绯荤粺'
+        label: '绯荤粺'
       }, {
         value: 'custom',
-        text: '鑷畾涔�'
+        label: '鑷畾涔�'
       }]
+    // }, {
+    //   type: 'radio',
+    //   field: 'labelValue',
+    //   label: '鏍囨敞鍊�',
+    //   initval: card.labelValue || 'default',
+    //   tooltip: '鏍囨敞鍊肩殑鏄剧ず瑙勫垯銆�',
+    //   required: false,
+    //   options: [{
+    //     value: 'default',
+    //     label: '榛樿'
+    //   }, {
+    //     value: 'zero',
+    //     label: '闅愯棌 0 鍊�'
+    //   }],
     }, {
       type: 'radio',
-      key: 'labelValue',
-      label: '鏍囨敞鍊�',
-      initVal: card.labelValue || 'default',
-      tooltip: '鏍囨敞鍊肩殑鏄剧ず瑙勫垯銆�',
-      required: false,
-      hidden: _label === 'false',
-      options: [{
-        value: 'default',
-        text: '榛樿'
-      }, {
-        value: 'zero',
-        text: '闅愯棌 0 鍊�'
-      }],
-    }, {
-      type: 'radio',
-      key: 'adjust',
+      field: 'adjust',
       label: '澶氭煴鎺掑垪',
-      initVal: card.adjust || 'dodge',
+      initval: card.adjust || 'dodge',
       required: false,
       forbid: !['bar'].includes(card.chartType),
       options: [{
         value: 'dodge',
-        text: '鍒嗙粍'
+        label: '鍒嗙粍'
       }, {
         value: 'stack',
-        text: '鍫嗗彔'
+        label: '鍫嗗彔'
       }]
     }, {
       type: 'radio',
-      key: 'area',
+      field: 'area',
       label: '闈㈢Н鍥�',
-      initVal: card.area || 'false',
-      // tooltip: '浠呭湪褰㈢姸涓簊mooth鏃舵湁鏁堛��',
+      initval: card.area || 'false',
       required: false,
       forbid: ['bar'].includes(card.chartType),
       options: [{
         value: 'true',
-        text: '鏄剧ず'
+        label: '鏄剧ず'
       }, {
         value: 'false',
-        text: '涓嶆樉绀�'
+        label: '涓嶆樉绀�'
       }]
     }, {
       type: 'radio',
-      key: 'repeat',
+      field: 'repeat',
       label: '閲嶅鏁版嵁',
-      initVal: card.repeat || 'unrepeat',
+      initval: card.repeat || 'unrepeat',
       required: false,
       options: [{
         value: 'unrepeat',
-        text: '鍘婚噸'
+        label: '鍘婚噸'
       }, {
         value: 'average',
-        text: '骞冲潎'
+        label: '骞冲潎'
       }, {
         value: 'cumsum',
-        text: '绱姞'
+        label: '绱姞'
       }]
     }, {
       type: 'radio',
-      key: 'coordinate',
+      field: 'coordinate',
       label: '鍧愭爣',
-      initVal: card.coordinate || 'angle',
+      initval: card.coordinate || 'angle',
       required: false,
       options: [{
         value: 'angle',
-        text: '浜岀淮鍧愭爣'
+        label: '浜岀淮鍧愭爣'
       }, {
         value: 'polar',
-        text: '鏋佸潗鏍�'
+        label: '鏋佸潗鏍�'
       }]
     }, {
       type: 'radio',
-      key: 'grid',
+      field: 'grid',
       label: '缃戞牸绾�',
-      initVal: card.grid || 'show',
+      initval: card.grid || 'show',
       required: false,
       options: [{
         value: 'show',
-        text: '鏄剧ず'
+        label: '鏄剧ず'
       }, {
         value: 'hidden',
-        text: '闅愯棌'
+        label: '闅愯棌'
       }]
     }, {
       type: 'radio',
-      key: 'y_line',
+      field: 'y_line',
       label: 'y杞磋竟绾�',
-      initVal: card.y_line || 'hidden',
+      initval: card.y_line || 'hidden',
       tooltip: '鍥惧舰宸︿晶鎴栧彸渚х殑杈圭嚎銆�',
       required: false,
       options: [{
         value: 'show',
-        text: '鏄剧ず'
+        label: '鏄剧ず'
       }, {
         value: 'hidden',
-        text: '闅愯棌'
+        label: '闅愯棌'
       }]
     }, {
       type: 'radio',
-      key: 'download',
+      field: 'download',
       label: '瀵煎嚭鍥剧墖',
-      initVal: card.download || 'forbid',
+      initval: card.download || 'forbid',
       required: false,
       forbid: appType === 'mob',
       options: [{
         value: 'forbid',
-        text: '绂佺敤'
+        label: '绂佺敤'
       }, {
         value: 'enable',
-        text: '鍚敤'
+        label: '鍚敤'
       }]
     }, {
       type: 'radio',
-      key: 'empty',
+      field: 'empty',
       label: '绌哄�奸殣钘�',
-      initVal: card.empty || 'show',
+      initval: card.empty || 'show',
       tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
       required: false,
       options: [
-        {value: 'show', text: '鍚�'},
-        {value: 'hidden', text: '鏄�'},
+        {value: 'show', label: '鍚�'},
+        {value: 'hidden', label: '鏄�'},
       ],
     }, {
       type: 'number',
-      key: 'barSize',
+      field: 'barSize',
       label: '鏌卞舰瀹藉害',
       tooltip: '绌哄�兼椂锛屽搴﹁嚜閫傚簲銆�',
       min: 5,
       max: 100,
       decimal: 0,
-      initVal: card.barSize,
+      initval: card.barSize,
       forbid: !['bar'].includes(card.chartType),
       required: false
     }, {
       type: 'number',
-      key: 'barRadius',
+      field: 'barRadius',
       label: '鏌卞舰鍦嗚',
       tooltip: '鏌卞舰鍥句笂绔渾瑙掋��',
       min: 0,
       max: 200,
       decimal: 0,
-      initVal: card.barRadius || 0,
+      initval: card.barRadius || 0,
       forbid: !['bar'].includes(card.chartType),
       required: false
     }, {
       type: 'number',
-      key: 'min',
+      field: 'min',
       label: '鏈�灏忓��',
       tooltip: 'y杞存渶灏忓�硷紝涓虹┖鏃惰嚜閫傚簲銆�',
-      initVal: card.min,
+      initval: card.min,
       required: false
     }, {
       type: 'number',
-      key: 'max',
+      field: 'max',
       label: '鏈�澶у��',
       tooltip: 'y杞存渶澶у�硷紝涓虹┖鏃惰嚜閫傚簲銆�',
-      initVal: card.max,
+      initval: card.max,
       required: false
     }, {
       type: 'number',
-      key: 'XLimit',
+      field: 'XLimit',
       min: 2,
       label: '瀛楃闄愬埗',
       tooltip: 'X杞存渶澶у瓧绗﹂檺鍒躲��',
-      initVal: card.XLimit || 11,
+      initval: card.XLimit || 11,
       forbid: appType === 'mob',
       required: false
     }, {
       type: 'color',
-      key: 'color',
+      field: 'color',
       label: '鑹茬郴',
-      initVal: card.color || 'rgba(0, 0, 0, 0.65)',
+      initval: card.color || 'rgba(0, 0, 0, 0.65)',
       tooltip: '鍧愭爣杞存彁绀烘枃瀛楀強绀轰緥鐨勯鑹层��',
       required: false
     }, {
       type: 'color',
-      key: 'lineColor',
+      field: 'lineColor',
       label: '杞寸嚎棰滆壊',
-      initVal: card.lineColor,
+      initval: card.lineColor,
       tooltip: '鍧愭爣杞寸嚎鐨勯鑹诧紝鍖呮嫭x杞淬�亂杞村強缃戞牸绾裤��',
       allowClear: true,
       required: false
     }, {
-      type: 'color',
-      key: 'selectColor',
-      label: '閫変腑棰滆壊',
-      initVal: card.selectColor || '',
-      tooltip: '閫変腑鏌卞舰鍥剧殑棰滆壊锛屽湪浜や簰鏁堟灉銆婂厓绱犻�変腑锛堝閫夛級銆嬪拰銆婂厓绱犻�変腑锛堝崟閫夛級銆嬩腑鏈夋晥锛屽惎鐢ㄨ嚜瀹氫箟璁剧疆鏃舵棤鏁堛��',
-      forbid: !['bar'].includes(card.chartType),
-      allowClear: true,
-      required: false
-    }, {
       type: 'number',
-      key: 'rotate',
+      field: 'rotate',
       label: '鏃嬭浆',
       tooltip: '鍧愭爣杞存爣娉ㄦ枃鏈殑鏃嬭浆瑙掑害銆�',
       min: 0,
       max: 360,
       decimal: 0,
-      initVal: card.rotate,
+      initval: card.rotate,
       forbid: appType !== 'mob',
       required: false
     }, {
-      type: 'select',
-      key: 'interaction',
+      type: 'multiselect',
+      field: 'interaction',
       label: '浜や簰鏁堟灉',
-      initVal: card.interaction || [],
-      multi: true,
+      initval: card.interaction || [],
       required: false,
       forbid: appType === 'mob',
       options: [
@@ -647,7 +643,19 @@
         { value: 'legend-active', label: '鍥句緥鑱氱劍' },
         { value: 'legend-highlight', label: '鍥句緥楂樹寒' },
         { value: 'brush', label: '閫夋杩囨护' },
+      ],
+      controlFields: [
+        {field: 'selectColor', values: ['element-selected', 'element-single-selected']},
       ]
+    }, {
+      type: 'color',
+      field: 'selectColor',
+      label: '閫変腑棰滆壊',
+      initval: card.selectColor || '',
+      tooltip: '閫変腑鏌卞舰鍥剧殑棰滆壊锛屽惎鐢ㄨ嚜瀹氫箟璁剧疆鏃舵棤鏁堛��',
+      forbid: !['bar'].includes(card.chartType),
+      allowClear: true,
+      required: false
     }
   ]
 }

--
Gitblit v1.8.0