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-pie/chartcompile/formconfig.jsx |   78 +++++++++++++++++++++++++++++----------
 1 files changed, 58 insertions(+), 20 deletions(-)

diff --git a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
index 5379e71..7a79ef7 100644
--- a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
@@ -6,12 +6,29 @@
 /**
  * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟
  * @param {object} card       // 鍥捐〃瀵硅薄
- * @param {Array}  columns    // 鏄剧ず鍒�
  */
-export function getPieChartOptionForm (card, columns, sysRoles = [], MenuType) {
-  let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype))
-  let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
-  let _sysRoles = sysRoles.map(item => ({...item, field: item.value, label: item.text}))
+export function getBaseForm (card) {
+  let menulist = sessionStorage.getItem('fstMenuList')
+  if (menulist) {
+    try {
+      menulist = JSON.parse(menulist)
+    } catch {
+      menulist = []
+    }
+  } else {
+    menulist = []
+  }
+
+  let roleList = sessionStorage.getItem('sysRoles')
+  if (roleList) {
+    try {
+      roleList = JSON.parse(roleList)
+    } catch {
+      roleList = []
+    }
+  } else {
+    roleList = []
+  }
 
   return [
     {
@@ -50,6 +67,36 @@
       decimal: 0,
       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 xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype))
+  let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
+
+  return [
     {
       type: 'radio',
       key: 'shape',
@@ -126,7 +173,7 @@
     {
       type: 'radio',
       key: 'tooltip',
-      label: '鎻愮ず淇℃伅',
+      label: '鎮诞鎻愮ず',
       initVal: card.tooltip || 'true',
       required: false,
       options: [{
@@ -140,21 +187,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: [{
@@ -197,15 +244,6 @@
         value: 'white',
         text: '鐧借壊'
       }]
-    }, {
-      type: 'select',
-      key: 'blacklist',
-      label: '榛戝悕鍗�',
-      initVal: card.blacklist || [],
-      multi: true,
-      required: false,
-      forbid: MenuType === 'billPrint',
-      options: _sysRoles
     }
   ]
 }

--
Gitblit v1.8.0