From 47b9baefdeeb41f50a9b7abc1abcf5e90931a89d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 31 八月 2023 11:17:48 +0800
Subject: [PATCH] 2023-08-31

---
 src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx |  269 ++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 190 insertions(+), 79 deletions(-)

diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
index e88e500..757c4e8 100644
--- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -1,15 +1,12 @@
-import zhCN from '@/locales/zh-CN/model.js'
-import enUS from '@/locales/en-US/model.js'
-
-const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
-
 /**
  * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟
  * @param {object} card       // 鍥捐〃瀵硅薄
  */
-export function getBaseForm (card) {
+export function getBaseForm (card, columns = []) {
   let appType = sessionStorage.getItem('appType')
   let roleList = sessionStorage.getItem('sysRoles')
+  let isprint = sessionStorage.getItem('MenuType') === 'billPrint'
+  let ispop = sessionStorage.getItem('editMenuType') === 'popview'
   if (roleList) {
     try {
       roleList = JSON.parse(roleList)
@@ -18,6 +15,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 [
@@ -48,14 +71,13 @@
       required: true
     },
     {
-      type: 'number',
+      type: 'styleInput',
       key: 'height',
-      label: '楂樺害',
+      label: '鍥捐〃楂樺害',
       initVal: card.height,
-      min: 100,
-      max: 1000,
-      decimal: 0,
-      required: true
+      tooltip: '鍥捐〃缁樺浘鍖哄煙鐨勯珮搴︼紝涓嶅寘鎷爣棰樺強鍐呭杈硅窛銆�',
+      required: true,
+      options: ['px', 'vh', 'vw']
     },
     {
       type: 'radio',
@@ -67,7 +89,19 @@
         {value: 'true', text: '鍚敤'},
         {value: 'false', text: '绂佺敤'},
       ],
-      forbid: !appType
+      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',
@@ -77,40 +111,102 @@
       multi: true,
       required: false,
       options: roleList,
-      forbid: !!appType
+      forbid: !!appType || isprint
     },
-    // {
-    //   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
+        }
+      ]
+    }
   ]
 }
 
@@ -125,23 +221,23 @@
 
   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' }
+      { 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' }
+      { 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锛堣閿ワ級' }
     ]
   }
 
@@ -169,6 +265,8 @@
       text: '搴曢儴'
     }])
   }
+
+  let _label = card.label || 'false'
 
   return [
     {
@@ -278,16 +376,17 @@
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     }, {
       type: 'radio',
       key: 'show',
       label: '鏄剧ず',
       initVal: card.show || 'value',
+      tooltip: '褰撲娇鐢ㄨ嚜瀹氫箟璁剧疆鏃讹紝鍙湪鏄剧ず锛堝��/%锛夊鍗曠嫭璁剧疆鏄剧ず绫诲瀷銆傛敞锛氳嚜瀹氫箟涓虹┖鏃朵娇鐢ㄦ澶勮缃��',
       required: false,
       options: [{
         value: 'value',
@@ -299,17 +398,19 @@
     }, {
       type: labelOptions.length > 20 ? 'select' : 'radio',
       key: 'label',
-      label: '鏍囩',
-      initVal: card.label || 'false',
+      label: '鏍囨敞',
+      initVal: _label,
+      tooltip: '鍥惧舰鑺傜偣澶勭殑鏁板�笺��',
       required: false,
       options: labelOptions
     }, {
       type: 'radio',
       key: 'labelColor',
-      label: '鏍囩棰滆壊',
+      label: '鏍囨敞棰滆壊',
       initVal: card.labelColor || 'system',
       tooltip: '浣跨敤绯荤粺鑹叉椂锛屼娇鐢ㄨ壊绯婚�夐」璁剧疆鐨勭郴缁熼鑹诧紝浣跨敤鑷畾涔変负棰滆壊璁剧疆涓畾涔夌殑鍥惧舰棰滆壊銆�',
       required: false,
+      hidden: _label !== 'true',
       options: [{
         value: 'system',
         text: '绯荤粺'
@@ -317,20 +418,21 @@
         value: 'custom',
         text: '鑷畾涔�'
       }]
-    // }, {
-    //   type: 'radio',
-    //   key: 'offset',
-    //   label: '鏍囨敞浣嶇疆',
-    //   initVal: card.offset || 'outer',
-    //   required: false,
-    //   options: [{
-    //     value: 'outer',
-    //     text: '澶栭儴'
-    //   }, {
-    //     value: 'inner',
-    //     text: '鍐呴儴'
-    //   }],
-    //   forbid: card.chartType !== 'bar'
+    }, {
+      type: 'radio',
+      key: 'labelValue',
+      label: '鏍囨敞鍊�',
+      initVal: card.labelValue || 'default',
+      tooltip: '鏍囨敞鍊肩殑鏄剧ず瑙勫垯銆�',
+      required: false,
+      hidden: _label === 'false',
+      options: [{
+        value: 'default',
+        text: '榛樿'
+      }, {
+        value: 'zero',
+        text: '闅愯棌 0 鍊�'
+      }],
     }, {
       type: 'radio',
       key: 'adjust',
@@ -478,6 +580,15 @@
       initVal: card.max,
       required: false
     }, {
+      type: 'number',
+      key: 'XLimit',
+      min: 2,
+      label: '瀛楃闄愬埗',
+      tooltip: 'X杞存渶澶у瓧绗﹂檺鍒躲��',
+      initVal: card.XLimit || 11,
+      forbid: appType === 'mob',
+      required: false
+    }, {
       type: 'color',
       key: 'color',
       label: '鑹茬郴',

--
Gitblit v1.8.0