From e543372cc70a19ff2630c79d8421c2c593e54e5f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 02 六月 2021 17:15:21 +0800
Subject: [PATCH] 2021-06-02

---
 src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx |  117 +++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 98 insertions(+), 19 deletions(-)

diff --git a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
index cd488d3..107b8b7 100644
--- a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
@@ -1,16 +1,49 @@
 // import zhCN from '@/locales/zh-CN/model.js'
 // import enUS from '@/locales/en-US/model.js'
 
-// const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
+// const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
 
 /**
  * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟
  * @param {object} card       // 鍥捐〃瀵硅薄
- * @param {Array}  columns    // 鏄剧ず鍒�
  */
-export function getPieChartOptionForm (card, columns) {
-  let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype))
-  let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
+export function getBaseForm (card) {
+  let isApp = sessionStorage.getItem('appType') === 'pc'
+  let menulist = null
+
+  if (isApp) {
+    menulist = sessionStorage.getItem('appMenus')
+  } else {
+    menulist = sessionStorage.getItem('fstMenuList')
+  }
+
+  if (menulist) {
+    try {
+      menulist = JSON.parse(menulist)
+      if (isApp) {
+        menulist = menulist.map(item => {
+          item.value = item.MenuID
+          item.text = item.MenuName
+          return item
+        })
+      }
+    } catch {
+      menulist = []
+    }
+  } else {
+    menulist = []
+  }
+
+  let roleList = sessionStorage.getItem('sysRoles')
+  if (roleList) {
+    try {
+      roleList = JSON.parse(roleList)
+    } catch {
+      roleList = []
+    }
+  } else {
+    roleList = []
+  }
 
   return [
     {
@@ -49,6 +82,59 @@
       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,
+      forbid: isApp,
+      options: menulist
+    },
+    {
+      type: 'select',
+      key: 'linkmenu',
+      label: '鍏宠仈鑿滃崟',
+      initVal: card.linkmenu || '',
+      tooltip: '鍙屽嚮楗煎浘锛屼細鎵撳紑鍏宠仈鐨勮彍鍗曘��',
+      required: false,
+      forbid: !isApp,
+      options: menulist
+    },
+    {
+      type: 'radio',
+      key: 'open',
+      label: '鎵撳紑鏂瑰紡',
+      initVal: card.open || 'blank',
+      required: false,
+      forbid: !isApp,
+      options: [
+        { value: 'blank', text: '鏂扮獥鍙�' },
+        { value: 'self', text: '褰撳墠绐楀彛' }
+      ]
+    }
+  ]
+}
+/**
+ * @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',
@@ -125,7 +211,7 @@
     {
       type: 'radio',
       key: 'tooltip',
-      label: '鎻愮ず淇℃伅',
+      label: '鎮诞鎻愮ず',
       initVal: card.tooltip || 'true',
       required: false,
       options: [{
@@ -139,21 +225,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: [{
@@ -188,14 +274,7 @@
       label: '鑹茬郴',
       initVal: card.color || 'rgba(0, 0, 0, 0.85)',
       tooltip: '鍧愭爣杞村強绀轰緥绛夋彁绀烘枃瀛椾娇鐢ㄧ殑棰滆壊銆�',
-      required: false,
-      options: [{
-        value: 'black',
-        text: '榛戣壊'
-      }, {
-        value: 'white',
-        text: '鐧借壊'
-      }]
+      required: false
     }
   ]
 }

--
Gitblit v1.8.0