From 4b18ab4bf4eff4383bd85beb76564dc6aeb1df86 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 26 一月 2021 19:11:26 +0800
Subject: [PATCH] 2021-01-26

---
 src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx |  197 ++++++++++++++++++++++++++++++------------------
 1 files changed, 123 insertions(+), 74 deletions(-)

diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
index e49d7a3..3a2ded3 100644
--- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -6,35 +6,29 @@
 /**
  * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟
  * @param {object} card       // 鍥捐〃瀵硅薄
- * @param {Array}  columns    // 鏄剧ず鍒�
  */
-export function getBarOrLineChartOptionForm (card, columns) {
-  let shapes = []
-
-  if (card.chartType === 'line') {
-    shapes = [
-      { field: 'smooth', label: 'smooth' },
-      { field: 'line', label: 'line' },
-      { field: 'dot', label: 'dot' },
-      { field: 'dash', label: 'dash' },
-      { field: 'hv', label: 'hv' },
-      { field: 'vh', label: 'vh' },
-      { field: 'hvh', label: 'hvh' },
-      { field: 'vhv', label: 'vhv' }
-    ]
-  } else if (card.chartType === 'bar') {
-    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' }
-    ]
+export function getBaseForm (card) {
+  let menulist = sessionStorage.getItem('fstMenuList')
+  if (menulist) {
+    try {
+      menulist = JSON.parse(menulist)
+    } catch {
+      menulist = []
+    }
+  } else {
+    menulist = []
   }
 
-  let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype))
-  let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
+  let roleList = sessionStorage.getItem('sysRoles')
+  if (roleList) {
+    try {
+      roleList = JSON.parse(roleList)
+    } catch {
+      roleList = []
+    }
+  } else {
+    roleList = []
+  }
 
   return [
     {
@@ -74,6 +68,61 @@
       required: true
     },
     {
+      type: 'select',
+      key: 'blacklist',
+      label: '榛戝悕鍗�',
+      initVal: card.blacklist || [],
+      multi: true,
+      required: false,
+      options: roleList
+    },
+    {
+      type: 'cascader',
+      key: 'linkmenu',
+      label: '鍏宠仈鑿滃崟',
+      initVal: card.linkmenu || [],
+      tooltip: '鍦ㄤ娇鐢ㄦ煴褰㈠浘涓旀湭鍚敤鑷畾涔夎缃椂鏈夋晥銆�',
+      required: false,
+      options: menulist
+    }
+  ]
+}
+
+/**
+ * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟
+ * @param {object} card       // 鍥捐〃瀵硅薄
+ * @param {Array}  columns    // 鏄剧ず鍒�
+ */
+export function getOptionForm (card, columns) {
+  let shapes = []
+
+  if (card.chartType === 'line') {
+    shapes = [
+      { field: 'smooth', label: 'smooth' },
+      { field: 'line', label: 'line' },
+      { field: 'dot', label: 'dot' },
+      { field: 'dash', label: 'dash' },
+      { field: 'hv', label: 'hv' },
+      { field: 'vh', label: 'vh' },
+      { field: 'hvh', label: 'hvh' },
+      { field: 'vhv', label: 'vhv' }
+    ]
+  } else if (card.chartType === 'bar') {
+    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' }
+    ]
+  }
+
+  let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype))
+  let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
+
+  return [
+    {
       type: 'radio',
       key: 'datatype',
       label: '鏁版嵁绫诲瀷',
@@ -92,16 +141,6 @@
       initVal: card.Xaxis || '',
       required: true,
       options: xfields
-    },
-    {
-      type: 'select',
-      key: 'Yaxis',
-      label: 'Y-杞�',
-      initVal: card.Yaxis || [],
-      multi: true, // 澶氶��
-      hidden: card.datatype === 'statistics',
-      required: true,
-      options: yfields
     },
     {
       type: 'select',
@@ -128,20 +167,30 @@
       initVal: card.legend || 'bottom',
       required: false,
       options: [
-        { field: 'top', label: 'top' },
-        { field: 'top-left', label: 'top-left' },
-        { field: 'top-right', label: 'top-right' },
-        { field: 'right', label: 'right' },
-        { field: 'right-top', label: 'right-top' },
-        { field: 'right-bottom', label: 'right-bottom' },
-        { field: 'left', label: 'left' },
-        { field: 'left-top', label: 'left-top' },
-        { field: 'left-bottom', label: 'left-bottom' },
-        { field: 'bottom', label: 'bottom' },
-        { field: 'bottom-left', label: 'bottom-left' },
-        { field: 'bottom-right', label: 'bottom-right' },
-        { field: 'hidden', label: 'hidden' }
+        { field: 'bottom', label: '涓�' },
+        { field: 'bottom-left', label: '涓嬪乏' },
+        { field: 'bottom-right', label: '涓嬪彸' },
+        { field: 'top', label: '涓�' },
+        { field: 'top-left', label: '涓婂乏' },
+        { field: 'top-right', label: '涓婂彸' },
+        { field: 'right', label: '鍙�' },
+        { field: 'right-top', label: '鍙充笂' },
+        { field: 'right-bottom', label: '鍙充笅' },
+        { field: 'left', label: '宸�' },
+        { field: 'left-top', label: '宸︿笂' },
+        { field: 'left-bottom', label: '宸︿笅' },
+        { field: 'hidden', label: '闅愯棌' }
       ]
+    },
+    {
+      type: 'select',
+      key: 'Yaxis',
+      label: 'Y-杞�',
+      initVal: card.Yaxis || [],
+      multi: true, // 澶氶��
+      hidden: card.datatype === 'statistics',
+      required: true,
+      options: yfields
     },
     {
       type: 'select',
@@ -154,7 +203,7 @@
     {
       type: 'radio',
       key: 'tooltip',
-      label: '鎻愮ず淇℃伅',
+      label: '鎮诞鎻愮ず',
       initVal: card.tooltip || 'true',
       required: false,
       options: [{
@@ -163,20 +212,6 @@
       }, {
         value: 'false',
         text: '闅愯棌'
-      }]
-    },
-    {
-      type: 'radio',
-      key: 'coordinate',
-      label: '鍧愭爣',
-      initVal: card.coordinate || 'angle',
-      required: false,
-      options: [{
-        value: 'angle',
-        text: '浜岀淮鍧愭爣'
-      }, {
-        value: 'polar',
-        text: '鏋佸潗鏍�'
       }]
     },
     {
@@ -199,6 +234,7 @@
       key: 'transpose',
       label: '鍙樻崲',
       initVal: card.transpose || 'false',
+      tooltip: '妯旱鍧愭爣杞翠氦鎹�',
       required: false,
       options: [{
         value: 'true',
@@ -211,21 +247,21 @@
     {
       type: 'radio',
       key: 'show',
-      label: '鏄剧ず鍊�',
+      label: '鏍煎紡鍖�',
       initVal: card.show || 'value',
       required: false,
       options: [{
+        value: 'value',
+        text: '鏃�'
+      }, {
         value: 'percent',
         text: '鐧惧垎姣�'
-      }, {
-        value: 'value',
-        text: '鏁板��'
       }]
     },
     {
       type: 'radio',
       key: 'label',
-      label: '鏍囨敞-鍊�',
+      label: '鏍囨敞鍊�',
       initVal: card.label || 'false',
       required: false,
       options: [{
@@ -266,6 +302,19 @@
         text: '绱姞'
       }]
     }, {
+      type: 'radio',
+      key: 'coordinate',
+      label: '鍧愭爣',
+      initVal: card.coordinate || 'angle',
+      required: false,
+      options: [{
+        value: 'angle',
+        text: '浜岀淮鍧愭爣'
+      }, {
+        value: 'polar',
+        text: '鏋佸潗鏍�'
+      }]
+    }, {
       type: 'number',
       key: 'InfoDefNumber',
       label: '灞曠ず鏁�',
@@ -278,13 +327,13 @@
       required: true
     }, {
       type: 'number',
-      key: 'correction',
-      label: '鏁版嵁淇',
-      tooltip: '褰撴暟鎹」灏戜簬璁剧疆鍊兼椂锛岀郴缁熶細鑷姩淇锛堥伩鍏嶆煴褰㈠浘杩囧锛�,鍦ㄨ嚜瀹氫箟涓紝璁剧疆涓烘姌绾垮浘鏃跺け鏁堛��',
+      key: 'barSize',
+      label: '鏌卞舰瀹藉害',
+      tooltip: '绌哄�兼椂锛屽搴﹁嚜閫傚簲銆�',
       min: 5,
-      max: 30,
+      max: 100,
       decimal: 0,
-      initVal: card.correction,
+      initVal: card.barSize,
       forbid: !['bar'].includes(card.chartType),
       required: false
     }, {

--
Gitblit v1.8.0