From 0eb129a9beddbb86ae74d7106a8e60823206b8d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 14 十二月 2023 11:29:15 +0800
Subject: [PATCH] 2023-12-14

---
 src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx |  213 +++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 165 insertions(+), 48 deletions(-)

diff --git a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
index 7a79ef7..d6bb257 100644
--- a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
@@ -1,18 +1,31 @@
-// 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
-
 /**
  * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟
  * @param {object} card       // 鍥捐〃瀵硅薄
  */
 export function getBaseForm (card) {
-  let menulist = sessionStorage.getItem('fstMenuList')
+  let appType = sessionStorage.getItem('appType')
+  let isApp = appType === 'pc' || appType === 'mob'
+  let menulist = null
+  let isprint = sessionStorage.getItem('MenuType') === 'billPrint'
+  let ispop = sessionStorage.getItem('editMenuType') === 'popview'
+
+  if (isApp) {
+    menulist = sessionStorage.getItem('appMenus')
+  } else {
+    menulist = sessionStorage.getItem('fstMenuList')
+  }
+
   if (menulist) {
     try {
       menulist = JSON.parse(menulist)
-    } catch {
+      if (isApp) {
+        menulist = menulist.map(item => {
+          item.value = item.MenuID
+          item.text = item.MenuName
+          return item
+        })
+      }
+    } catch (e) {
       menulist = []
     }
   } else {
@@ -23,7 +36,7 @@
   if (roleList) {
     try {
       roleList = JSON.parse(roleList)
-    } catch {
+    } catch (e) {
       roleList = []
     }
   } else {
@@ -58,23 +71,13 @@
       required: true
     },
     {
-      type: 'number',
+      type: 'styleInput',
       key: 'height',
-      label: '楂樺害',
+      label: '鍥捐〃楂樺害',
       initVal: card.height,
-      min: 100,
-      max: 1000,
-      decimal: 0,
-      required: true
-    },
-    {
-      type: 'select',
-      key: 'blacklist',
-      label: '榛戝悕鍗�',
-      initVal: card.blacklist || [],
-      multi: true,
-      required: false,
-      options: roleList
+      tooltip: '鍥捐〃缁樺浘鍖哄煙鐨勯珮搴︼紝涓嶅寘鎷爣棰樺強鍐呭杈硅窛銆�',
+      required: true,
+      options: ['px', 'vh', 'vw']
     },
     {
       type: 'cascader',
@@ -83,7 +86,64 @@
       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: '褰撳墠绐楀彛' }
+      ]
+    },
+    {
+      type: 'radio',
+      key: 'permission',
+      label: '鏉冮檺楠岃瘉',
+      initVal: card.permission || 'false',
+      required: false,
+      options: [
+        {value: 'true', text: '鍚敤'},
+        {value: 'false', text: '绂佺敤'},
+      ],
+      forbid: !appType || ispop || isprint
+    },
+    {
+      type: 'radio',
+      key: 'cacheLocal',
+      label: '鏈湴缂撳瓨',
+      initVal: card.cacheLocal || 'true',
+      required: false,
+      options: [
+        {value: 'true', text: '缁ф壙鑿滃崟'},
+        {value: 'false', text: '绂佺敤'},
+      ],
+      forbid: ispop || isprint
+    },
+    {
+      type: 'select',
+      key: 'blacklist',
+      label: '榛戝悕鍗�',
+      initVal: card.blacklist || [],
+      multi: true,
+      required: false,
+      options: roleList,
+      forbid: !!appType || isprint
     }
   ]
 }
@@ -93,6 +153,7 @@
  * @param {Array}  columns    // 鏄剧ず鍒�
  */
 export function getOptionForm (card, columns) {
+  let appType = sessionStorage.getItem('appType')
   let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype))
   let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
 
@@ -106,13 +167,14 @@
       options: [
         { value: 'pie', text: '楗煎浘' },
         { value: 'ring', text: '鐜浘' },
+        { value: 'nest', text: '宓屽' },
         { value: 'nightingale', text: '鍗椾竵鏍煎皵鍥�' }
       ]
     },
     {
       type: 'select',
       key: 'Xaxis',
-      label: 'X-杞�',
+      label: '鍚嶇О',
       initVal: card.Xaxis || '',
       required: true,
       options: xfields
@@ -120,10 +182,20 @@
     {
       type: 'select',
       key: 'Yaxis',
-      label: 'Y-杞�',
+      label: '鍊�',
       initVal: card.Yaxis || '',
       required: true,
       options: yfields
+    },
+    {
+      type: 'select',
+      key: 'type',
+      label: '绫诲瀷',
+      initVal: card.type || '',
+      tooltip: '鍐呯幆鐨勫垎绫诲瓧娈点��',
+      required: true,
+      options: xfields,
+      hidden: card.shape !== 'nest',
     },
     {
       type: 'select',
@@ -145,7 +217,8 @@
         { field: 'left-top', label: '宸︿笂' },
         { field: 'left-bottom', label: '宸︿笅' },
         { field: 'hidden', label: '闅愯棌' }
-      ]
+      ],
+      hidden: card.shape === 'nest',
     },
     {
       type: 'number',
@@ -201,7 +274,7 @@
     {
       type: 'radio',
       key: 'label',
-      label: '鏍囨敞鍊�',
+      label: '鏍囨敞',
       initVal: card.label || 'false',
       required: false,
       options: [{
@@ -212,38 +285,82 @@
         text: '鍐呬晶'
       }, {
         value: 'outer',
-        text: '澶栦晶'
+        text: '铚樿洓'
+      }, {
+        value: 'normal',
+        text: '甯歌'
+      }],
+    }, {
+      type: 'radio',
+      key: 'download',
+      label: '瀵煎嚭鍥剧墖',
+      initVal: card.download || 'forbid',
+      required: false,
+      forbid: appType === 'mob',
+      options: [{
+        value: 'forbid',
+        text: '绂佺敤'
+      }, {
+        value: 'enable',
+        text: '鍚敤'
       }]
     }, {
       type: 'radio',
-      key: 'repeat',
-      label: '閲嶅鏁版嵁',
-      initVal: card.repeat || 'unrepeat',
+      key: 'empty',
+      label: '绌哄�奸殣钘�',
+      initVal: card.empty || 'show',
+      tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
       required: false,
-      options: [{
-        value: 'unrepeat',
-        text: '鍘婚噸'
-      }, {
-        value: 'average',
-        text: '骞冲潎'
-      }, {
-        value: 'cumsum',
-        text: '绱姞'
-      }]
+      options: [
+        {value: 'show', text: '鍚�'},
+        {value: 'hidden', text: '鏄�'},
+      ],
+    }, {
+      type: 'number',
+      key: 'splitLine',
+      label: '鍒嗛殧绾�',
+      initVal: card.splitLine || '',
+      tooltip: '鍒嗛殧绾跨殑瀹藉害銆�',
+      min: 0,
+      max: 20,
+      decimal: 0,
+      required: false
+    }, {
+      type: 'color',
+      key: 'splitColor',
+      label: '鍒嗛殧鑹�',
+      initVal: card.splitColor || '#ffffff',
+      tooltip: '鍒嗛殧绾跨殑棰滆壊锛屽瓨鍦ㄥ垎闅旂嚎鏃舵湁鏁堛��',
+      required: false
     }, {
       type: 'color',
       key: 'color',
       label: '鑹茬郴',
       initVal: card.color || 'rgba(0, 0, 0, 0.85)',
       tooltip: '鍧愭爣杞村強绀轰緥绛夋彁绀烘枃瀛椾娇鐢ㄧ殑棰滆壊銆�',
+      required: false
+    }, {
+      type: 'select',
+      key: 'interaction',
+      label: '浜や簰鏁堟灉',
+      initVal: card.interaction || [],
+      multi: true,
       required: false,
-      options: [{
-        value: 'black',
-        text: '榛戣壊'
-      }, {
-        value: 'white',
-        text: '鐧借壊'
-      }]
+      forbid: appType === 'mob',
+      options: [
+        { value: 'element-active', label: '鍏冪礌鑱氱劍' },
+        { value: 'element-selected', label: '鍏冪礌閫変腑锛堝閫夛級' },
+        { value: 'element-single-selected', label: '鍏冪礌閫変腑锛堝崟閫夛級' },
+        // { value: 'active-region', label: '鑳屾櫙妗�' },
+        // { value: 'view-zoom', label: '瑙嗗浘缂╂斁' },
+        { value: 'element-highlight', label: '鍏冪礌楂樹寒' },
+        // { value: 'element-highlight-by-color', label: '鍚岃壊鍏冪礌楂樹寒' },
+        // { value: 'element-highlight-by-x', label: '鍚孹杞村厓绱犻珮浜�' },
+        { value: 'legend-filter', label: '鍥句緥杩囨护' },
+        { value: 'legend-active', label: '鍥句緥鑱氱劍' },
+        { value: 'legend-highlight', label: '鍥句緥楂樹寒' },
+        // { value: 'brush', label: '閫夋杩囨护' },
+      ]
     }
   ]
 }

--
Gitblit v1.8.0