From a7813a33fc5f60ea995dfe0f09f52243e2ccfbb2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 22 二月 2024 16:28:11 +0800
Subject: [PATCH] 2024-02-22

---
 src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx |  209 +++++++++++++++++++++++++++++-----------------------
 1 files changed, 116 insertions(+), 93 deletions(-)

diff --git a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx
index 248a75b..748ad3f 100644
--- a/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-dashboard/chartcompile/formconfig.jsx
@@ -1,8 +1,3 @@
-// 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       // 鍥捐〃瀵硅薄
@@ -10,6 +5,8 @@
 export function getBaseForm (card) {
   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)
@@ -23,24 +20,24 @@
   return [
     {
       type: 'text',
-      key: 'title',
+      field: 'title',
       label: '鏍囬',
-      initVal: card.title,
+      initval: card.title,
       required: false
     },
     {
       type: 'text',
-      key: 'name',
+      field: 'name',
       label: '缁勪欢鍚嶇О',
-      initVal: card.name,
+      initval: card.name,
       tooltip: '鐢ㄤ簬缁勪欢闂寸殑鍖哄垎銆�',
       required: true
     },
     {
       type: 'number',
-      key: 'width',
+      field: 'width',
       label: '瀹藉害',
-      initVal: card.width,
+      initval: card.width,
       tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
       min: 1,
       max: 24,
@@ -48,24 +45,46 @@
       required: true
     },
     {
-      type: 'number',
-      key: 'height',
-      label: '楂樺害',
-      initVal: card.height,
-      min: 100,
-      max: 1000,
-      decimal: 0,
-      required: true
+      type: 'styleInput',
+      field: 'height',
+      label: '鍥捐〃楂樺害',
+      initval: card.height,
+      tooltip: '鍥捐〃缁樺浘鍖哄煙鐨勯珮搴︼紝涓嶅寘鎷爣棰樺強鍐呭杈硅窛銆�',
+      required: true,
+      options: ['px', 'vh', 'vw']
     },
     {
-      type: 'select',
-      key: 'blacklist',
+      type: 'radio',
+      field: 'permission',
+      label: '鏉冮檺楠岃瘉',
+      initval: card.permission || 'false',
+      required: false,
+      options: [
+        {value: 'true', label: '鍚敤'},
+        {value: 'false', label: '绂佺敤'},
+      ],
+      forbid: !appType || ispop || isprint
+    },
+    {
+      type: 'radio',
+      field: 'cacheLocal',
+      label: '鏈湴缂撳瓨',
+      initval: card.cacheLocal || 'true',
+      required: false,
+      options: [
+        {value: 'true', label: '缁ф壙鑿滃崟'},
+        {value: 'false', label: '绂佺敤'},
+      ],
+      forbid: ispop || isprint
+    },
+    {
+      type: 'multiselect',
+      field: 'blacklist',
       label: '榛戝悕鍗�',
-      initVal: card.blacklist || [],
-      multi: true,
+      initval: card.blacklist || [],
       required: false,
       options: roleList,
-      forbid: !!appType
+      forbid: !!appType || isprint
     }
   ]
 }
@@ -75,30 +94,30 @@
  * @param {Array}  columns    // 鏄剧ず鍒�
  */
 export function getOptionForm (card, columns) {
-  let appType = sessionStorage.getItem('appType')
+  // let appType = sessionStorage.getItem('appType')
   let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype))
 
   return [
     {
       type: 'text',
-      key: 'label',
+      field: 'label',
       label: '鎸囨爣鍚嶇О',
-      initVal: card.label || '',
+      initval: card.label || '',
       required: false
     },
     {
       type: 'select',
-      key: 'valueField',
+      field: 'valueField',
       label: '鏄剧ず鍊�',
-      initVal: card.valueField || '',
+      initval: card.valueField || '',
       required: true,
       options: yfields
     },
     {
       type: 'number',
-      key: 'maxValue',
+      field: 'maxValue',
       label: '鏈�澶у��',
-      initVal: card.maxValue || 100,
+      initval: card.maxValue || 100,
       tooltip: '浠〃鐩樻渶澶у埢搴﹀��',
       min: 0,
       max: 999999,
@@ -107,9 +126,9 @@
     },
     {
       type: 'number',
-      key: 'tickInterval',
+      field: 'tickInterval',
       label: '闂撮殧',
-      initVal: card.tickInterval || 10,
+      initval: card.tickInterval || 10,
       tooltip: '浠〃鐩樺埢搴﹂棿闅斿�笺��',
       min: 0,
       max: 999999,
@@ -118,56 +137,58 @@
     },
     {
       type: 'radio',
-      key: 'percent',
+      field: 'percent',
       label: '鐧惧垎鐜�',
-      initVal: card.percent || 'true',
+      initval: card.percent || 'true',
       required: false,
       options: [{
         value: 'true',
-        text: '浣跨敤'
+        label: '浣跨敤'
       }, {
         value: 'false',
-        text: '涓嶄娇鐢�'
+        label: '涓嶄娇鐢�'
       }]
-    }, {
-      type: 'radio',
-      key: 'download',
-      label: '瀵煎嚭鍥剧墖',
-      initVal: card.download || 'forbid',
-      required: false,
-      forbid: appType === 'mob',
-      options: [{
-        value: 'forbid',
-        text: '绂佺敤'
-      }, {
-        value: 'enable',
-        text: '鍚敤'
-      }]
+    // }, {
+    //   type: 'radio',
+    //   field: 'download',
+    //   label: '瀵煎嚭鍥剧墖',
+    //   initval: card.download || 'forbid',
+    //   required: false,
+    //   forbid: appType === 'mob',
+    //   options: [{
+    //     value: 'forbid',
+    //     label: '绂佺敤'
+    //   }, {
+    //     value: 'enable',
+    //     label: '鍚敤'
+    //   }]
     },
     // {
     //   type: 'radio',
-    //   key: 'empty',
+    //   field: 'empty',
     //   label: '绌哄�奸殣钘�',
-    //   initVal: card.empty || 'show',
+    //   initval: card.empty || 'show',
     //   tooltip: '褰撴煡璇㈡暟鎹负绌烘椂锛岄殣钘忚缁勪欢銆�',
     //   required: false,
     //   options: [
-    //     {value: 'show', text: '鍚�'},
-    //     {value: 'hidden', text: '鏄�'},
+    //     {value: 'show', label: '鍚�'},
+    //     {value: 'hidden', label: '鏄�'},
     //   ],
     // },
     {
       type: 'color',
-      key: 'tickColor',
+      field: 'tickColor',
       label: '鍒诲害绾�',
-      initVal: card.tickColor || '#CBCBCB',
+      initval: card.tickColor || '',
+      allowClear: true,
       required: false
     },
     {
       type: 'color',
-      key: 'labelColor',
+      field: 'labelColor',
       label: '鎸囨爣棰滆壊',
-      initVal: card.labelColor || '#545454',
+      initval: card.labelColor || '',
+      allowClear: true,
       required: false
     }
   ]
@@ -179,32 +200,32 @@
  * @param {Array}  columns    // 鏄剧ず鍒�
  */
 export function getRadioOptionForm (card, columns) {
-  let appType = sessionStorage.getItem('appType')
+  // 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))
 
   return [
     {
       type: 'select',
-      key: 'labelField',
+      field: 'labelField',
       label: '鎸囨爣',
-      initVal: card.labelField || '',
+      initval: card.labelField || '',
       required: true,
       options: xfields
     },
     {
       type: 'select',
-      key: 'valueField',
+      field: 'valueField',
       label: '鍊�',
-      initVal: card.valueField || '',
+      initval: card.valueField || '',
       required: true,
       options: yfields
     },
     {
       type: 'number',
-      key: 'maxValue',
+      field: 'maxValue',
       label: '鏈�澶у��',
-      initVal: card.maxValue || 100,
+      initval: card.maxValue || 100,
       min: 0,
       max: 999999,
       decimal: 1,
@@ -212,9 +233,9 @@
     },
     {
       type: 'number',
-      key: 'radius',
+      field: 'radius',
       label: '澶栫幆',
-      initVal: card.radius || 75,
+      initval: card.radius || 75,
       tooltip: '鍥惧舰鎵�鍗犲尯鍩熺殑鐧惧垎鐜囥��',
       min: 30,
       max: 100,
@@ -223,54 +244,56 @@
     },
     {
       type: 'number',
-      key: 'fontSize',
+      field: 'fontSize',
       label: '瀛椾綋澶у皬',
-      initVal: card.fontSize || 28,
+      initval: card.fontSize || 28,
       min: 12,
-      max: 200,
+      max: 300,
       decimal: 0,
       required: true
     },
     {
       type: 'radio',
-      key: 'percent',
+      field: 'percent',
       label: '鐧惧垎鐜�',
-      initVal: card.percent || 'true',
+      initval: card.percent || 'true',
       required: false,
       options: [{
         value: 'true',
-        text: '浣跨敤'
+        label: '浣跨敤'
       }, {
         value: 'false',
-        text: '涓嶄娇鐢�'
+        label: '涓嶄娇鐢�'
       }]
-    }, {
-      type: 'radio',
-      key: 'download',
-      label: '瀵煎嚭鍥剧墖',
-      initVal: card.download || 'forbid',
-      required: false,
-      forbid: appType === 'mob',
-      options: [{
-        value: 'forbid',
-        text: '绂佺敤'
-      }, {
-        value: 'enable',
-        text: '鍚敤'
-      }]
+    // }, {
+    //   type: 'radio',
+    //   field: 'download',
+    //   label: '瀵煎嚭鍥剧墖',
+    //   initval: card.download || 'forbid',
+    //   required: false,
+    //   forbid: appType === 'mob',
+    //   options: [{
+    //     value: 'forbid',
+    //     label: '绂佺敤'
+    //   }, {
+    //     value: 'enable',
+    //     label: '鍚敤'
+    //   }]
     },
     {
       type: 'color',
-      key: 'backColor',
+      field: 'backColor',
       label: '鑳屾櫙鑹�',
-      initVal: card.backColor || '#ebedf0',
+      initval: card.backColor || '',
+      allowClear: true,
       required: false
     },
     {
       type: 'color',
-      key: 'labelColor',
+      field: 'labelColor',
       label: '瀛椾綋棰滆壊',
-      initVal: card.labelColor || '#8c8c8c',
+      initval: card.labelColor || '',
+      allowClear: true,
       required: false
     }
   ]

--
Gitblit v1.8.0