From 57ad22259363a3e34de3c53583c3c4e227835fbf Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 15 五月 2022 21:01:35 +0800
Subject: [PATCH] 2022-05-15

---
 src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx |  159 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 124 insertions(+), 35 deletions(-)

diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
index 18a7d8c..784141f 100644
--- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -7,7 +7,7 @@
  * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟
  * @param {object} card       // 鍥捐〃瀵硅薄
  */
-export function getBaseForm (card) {
+export function getBaseForm (card, columns = []) {
   let appType = sessionStorage.getItem('appType')
   let roleList = sessionStorage.getItem('sysRoles')
   if (roleList) {
@@ -18,6 +18,32 @@
     }
   } else {
     roleList = []
+  }
+
+  let menulist = []
+
+  if (appType === 'pc') {
+    menulist = sessionStorage.getItem('appMenus')
+    if (menulist) {
+      try {
+        menulist = JSON.parse(menulist)
+      } catch (e) {
+        menulist = []
+      }
+    } else {
+      menulist = []
+    }
+  } else if (appType === '') {
+    menulist = sessionStorage.getItem('fstMenuList')
+    if (menulist) {
+      try {
+        menulist = JSON.parse(menulist)
+      } catch (e) {
+        menulist = []
+      }
+    } else {
+      menulist = []
+    }
   }
 
   return [
@@ -79,38 +105,100 @@
       options: roleList,
       forbid: !!appType
     },
-    // {
-    //   type: 'cascader',
-    //   key: 'linkmenu',
-    //   label: '鍏宠仈鑿滃崟',
-    //   initVal: card.linkmenu || [],
-    //   tooltip: '鍦ㄤ娇鐢ㄦ煴褰㈠浘涓旀湭鍚敤鑷畾涔夎缃椂鏈夋晥銆�',
-    //   required: false,
-    //   forbid: appType === 'pc' || appType === 'mob',
-    //   options: menulist
-    // },
-    // {
-    //   type: 'select',
-    //   key: 'linkmenu',
-    //   label: '鍏宠仈鑿滃崟',
-    //   initVal: card.linkmenu || '',
-    //   tooltip: '鍙屽嚮鏌辩姸鍥撅紝浼氭墦寮�鍏宠仈鐨勮彍鍗曘��',
-    //   required: false,
-    //   forbid: appType !== 'pc',
-    //   options: menulist
-    // },
-    // {
-    //   type: 'radio',
-    //   key: 'open',
-    //   label: '鎵撳紑鏂瑰紡',
-    //   initVal: card.open || 'blank',
-    //   required: false,
-    //   forbid: appType !== 'pc',
-    //   options: [
-    //     { value: 'blank', text: '鏂扮獥鍙�' },
-    //     { value: 'self', text: '褰撳墠绐楀彛' }
-    //   ]
-    // }
+    {
+      type: 'radio',
+      key: 'click',
+      label: '鐐瑰嚮浜嬩欢',
+      initVal: card.click || '',
+      tooltip: '褰撶粦瀹氱偣鍑讳簨浠舵椂锛屾煴褰㈠浘鐨勫垏鎹㈠姛鑳藉皢澶辨晥銆�',
+      required: false,
+      forbid: appType === 'mob' || card.chartType !== 'bar',
+      options: [
+        {value: '', label: '鏃�'},
+        {value: 'menu', label: '鑿滃崟'},
+        {value: 'menus', label: '鑿滃崟缁�'}
+      ]
+    },
+    {
+      type: appType === '' ? 'cascader' : 'select',
+      key: 'menu',
+      label: '鍏宠仈鑿滃崟',
+      initVal: card.menu || (appType === '' ? [] : ''),
+      tooltip: '鍦ㄤ娇鐢ㄦ煴褰㈠浘涓旀湭鍚敤鑷畾涔夎缃椂鏈夋晥銆�',
+      required: true,
+      forbid: appType === 'mob' || card.chartType !== 'bar',
+      hidden: card.click !== 'menu',
+      options: menulist
+    },
+    {
+      type: 'select',
+      key: 'menuType',
+      label: '鑿滃崟绫诲瀷',
+      initVal: card.menuType || '',
+      required: true,
+      forbid: appType === 'mob' || card.chartType !== 'bar',
+      hidden: card.click !== 'menus',
+      options: columns,
+    },
+    {
+      type: 'radio',
+      key: 'open',
+      label: '鎵撳紑鏂瑰紡',
+      initVal: card.open || 'blank',
+      required: false,
+      options: [
+        {value: 'blank', label: '鏂扮獥鍙�'},
+        {value: 'self', label: '褰撳墠绐楀彛'},
+      ],
+      forbid: appType !== 'pc' || card.chartType !== 'bar',
+      hidden: card.click !== 'menu' && card.click !== 'menus'
+    },
+    {
+      type: 'radio',
+      key: 'joint',
+      label: '鍙傛暟鎷兼帴',
+      initVal: card.joint || 'true',
+      required: false,
+      options: [
+        {value: 'true', label: '鏄�'},
+        {value: 'false', label: '鍚�'},
+      ],
+      forbid: appType === 'mob' || card.chartType !== 'bar',
+      hidden: card.click !== 'menu' && card.click !== 'menus'
+    },
+    {
+      type: 'table',
+      key: 'menus',
+      label: '鑿滃崟缁�',
+      initVal: card.menus || [],
+      required: true,
+      span: 24,
+      actions: ['view'],
+      forbid: appType === 'mob' || card.chartType !== 'bar',
+      hidden: card.click !== 'menus',
+      columns: [
+        {
+          title: '鏍囪瘑',
+          dataIndex: 'sign',
+          inputType: 'input',
+          editable: true,
+          unique: true,
+          required: false,
+          width: '35%'
+        },
+        {
+          title: '鑿滃崟',
+          dataIndex: 'menu',
+          inputType: !appType ? 'cascader' : 'select',
+          editable: true,
+          required: true,
+          extends: !appType ? 'Menu' : [{key: 'label', value: 'label'}],
+          width: '35%',
+          render: (text, record) => record.label,
+          options: menulist
+        }
+      ]
+    }
   ]
 }
 
@@ -300,14 +388,15 @@
     }, {
       type: labelOptions.length > 20 ? 'select' : 'radio',
       key: 'label',
-      label: '鏍囩',
+      label: '鏍囨敞',
       initVal: card.label || 'false',
+      tooltip: '鍥惧舰鑺傜偣澶勭殑鏁板�笺��',
       required: false,
       options: labelOptions
     }, {
       type: 'radio',
       key: 'labelColor',
-      label: '鏍囩棰滆壊',
+      label: '鏍囨敞棰滆壊',
       initVal: card.labelColor || 'system',
       tooltip: '浣跨敤绯荤粺鑹叉椂锛屼娇鐢ㄨ壊绯婚�夐」璁剧疆鐨勭郴缁熼鑹诧紝浣跨敤鑷畾涔変负棰滆壊璁剧疆涓畾涔夌殑鍥惧舰棰滆壊銆�',
       required: false,

--
Gitblit v1.8.0