From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 18 十一月 2021 20:47:04 +0800
Subject: [PATCH] 2021-11-18

---
 src/menu/components/card/cardcellcomponent/formconfig.jsx |  218 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 161 insertions(+), 57 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx
index 7d9a8f4..ac90789 100644
--- a/src/menu/components/card/cardcellcomponent/formconfig.jsx
+++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -20,11 +20,13 @@
     { value: 'barcode', text: '鏉″舰鐮�'},
     { value: 'qrcode', text: '浜岀淮鐮�'},
     { value: 'currentDate', text: '褰撳墠鏃堕棿'},
+    { value: 'formula', text: '鍏紡'},
   ]
 
   if (type === 'table' || (type === 'card' && subtype === 'datacard')) {
     _options.push({value: 'sequence', text: '搴忓彿'})
   }
+
   let appMenus = []
   const isApp = sessionStorage.getItem('appType') === 'pc'
 
@@ -33,8 +35,7 @@
     if (appMenus) {
       try {
         appMenus = JSON.parse(appMenus)
-        appMenus = appMenus.map(item => ({value: item.MenuID, text: item.MenuName}))
-      } catch {
+      } catch (e) {
         appMenus = []
       }
     } else {
@@ -63,45 +64,11 @@
       options: _options
     },
     {
-      type: 'select',
+      type: 'icon',
       key: 'icon',
       label: '鍥炬爣',
       initVal: card.icon,
-      required: true,
-      options: [
-        { value: 'question-circle', text: 'question-circle'},
-        { value: 'alert', text: 'alert'},
-        { value: 'cloud', text: 'cloud'},
-        { value: 'eye', text: 'eye'},
-        { value: 'eye-invisible', text: 'eye-invisible'},
-        { value: 'android', text: 'android'},
-        { value: 'apple', text: 'apple'},
-        { value: 'windows', text: 'windows'},
-        { value: 'ie', text: 'ie'},
-        { value: 'chrome', text: 'chrome'},
-        { value: 'github', text: 'github'},
-        { value: 'aliwangwang', text: 'aliwangwang'},
-        { value: 'dingding', text: 'dingding'},
-        { value: 'wechat', text: 'wechat'},
-        { value: 'alipay', text: 'alipay'},
-        { value: 'weibo-square', text: 'weibo-square'},
-        { value: 'weibo-circle', text: 'weibo-circle'},
-        { value: 'taobao-circle', text: 'taobao-circle'},
-        { value: 'weibo', text: 'weibo'},
-        { value: 'twitter', text: 'twitter'},
-        { value: 'youtube', text: 'youtube'},
-        { value: 'alipay-circle', text: 'alipay-circle'},
-        { value: 'taobao', text: 'taobao'},
-        { value: 'skype', text: 'skype'},
-        { value: 'qq', text: 'qq'},
-        { value: 'gitlab', text: 'gitlab'},
-        { value: 'zhihu', text: 'zhihu'},
-        { value: 'slack', text: 'slack'},
-        { value: 'sketch', text: 'sketch'},
-        { value: 'yahoo', text: 'yahoo'},
-        { value: 'reddit', text: 'reddit'},
-        { value: 'dribbble', text: 'dribbble'},
-      ]
+      required: true
     },
     {
       type: 'radio',
@@ -209,11 +176,92 @@
       required: false
     },
     {
+      type: 'radio',
+      key: 'showType',
+      label: '灞曠幇褰㈠紡',
+      initVal: card.showType || 'line',
+      required: false,
+      options: [
+        { value: 'line', text: '杩涘害鏉�' },
+        { value: 'circle', text: '杩涘害鍦�' },
+        { value: 'dashboard', text: '浠〃鐩�' },
+      ]
+    },
+    {
       type: 'color',
       key: 'color',
-      label: '棰滆壊',
-      initVal: card.color || 'rgba(0, 0, 0, 0.85)',
+      label: '杩涘害鏉¢鑹�',
+      initVal: card.color || '#1890ff',
       required: true
+    },
+    {
+      type: 'color',
+      key: 'trailColor',
+      label: '鏈畬鎴愰鑹�',
+      initVal: card.trailColor || '#f5f5f5',
+      required: false
+    },
+    {
+      type: 'radio',
+      key: 'showInfo',
+      label: '杩涘害鍊�',
+      initVal: card.showInfo || 'false',
+      required: false,
+      options: [
+        { value: 'true', text: '鏄剧ず' },
+        { value: 'false', text: '闅愯棌' }
+      ]
+    },
+    {
+      type: 'color',
+      key: 'infoColor',
+      label: '杩涘害鍊奸鑹�',
+      initVal: card.infoColor || 'rgba(0, 0, 0, 0.65)',
+      required: false
+    },
+    {
+      type: 'radio',
+      key: 'strokeLinecap',
+      label: '绾垮瀷',
+      initVal: card.strokeLinecap || 'round',
+      required: false,
+      options: [
+        { value: 'round', text: '鍦嗚' },
+        { value: 'square', text: '鐩磋' },
+      ]
+    },
+    {
+      type: 'radio',
+      key: 'textAlign',
+      label: '瀵归綈鏂瑰紡',
+      initVal: card.textAlign || 'left',
+      required: false,
+      options: [
+        { value: 'left', text: '宸�' },
+        { value: 'center', text: '涓�' },
+        { value: 'right', text: '鍙�' },
+      ]
+    },
+    {
+      type: 'number',
+      key: 'strokeWidth',
+      min: 1,
+      max: 200,
+      precision: 0,
+      label: '绾挎潯瀹藉害',
+      initVal: card.strokeWidth || 8,
+      required: true,
+    },
+    {
+      type: 'number',
+      key: 'outlineWidth',
+      min: 10,
+      max: 2000,
+      precision: 0,
+      label: '澶栧舰瀹藉害',
+      initVal: card.outlineWidth || '',
+      tooltip: '澶栧舰瀹藉害涓虹┖鏃讹紝瀹藉害涓哄厓绱犵殑瀹藉害銆傛敞锛氳秴鍑烘椂鎸夊厓绱犲搴﹁绠椼��',
+      required: false
     },
     {
       type: 'number',
@@ -249,7 +297,7 @@
       type: 'number',
       key: 'barHeight',
       min: 5,
-      max: 50,
+      max: 500,
       label: '楂樺害',
       initVal: card.barHeight || 25,
       required: true,
@@ -258,8 +306,8 @@
       type: 'number',
       key: 'qrWidth',
       min: 5,
-      max: 500,
-      label: '瀹藉害',
+      max: 1000,
+      label: '浜岀淮鐮佸昂瀵�',
       initVal: card.qrWidth || 50,
       required: true,
     },
@@ -319,6 +367,16 @@
       ]
     },
     {
+      type: 'number',
+      key: 'maxWidth',
+      min: 10,
+      max: 2000,
+      label: '鏈�澶у搴�',
+      initVal: card.maxWidth || '',
+      tooltip: '鍥剧墖瀹藉害鐨勬渶澶у�笺��',
+      required: false,
+    },
+    {
       type: 'select',
       key: 'aspectRatio',
       label: '闀垮姣�',
@@ -344,7 +402,7 @@
       ]
     },
     {
-      type: 'select',
+      type: 'radio',
       key: 'link',
       label: '閾炬帴',
       initVal: card.link || '',
@@ -352,9 +410,19 @@
       forbid: !isApp,
       options: [
         { value: '', text: '鏃�' },
-        { value: 'page', text: '鑿滃崟' },
         { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
         { value: 'custom', text: '閾炬帴' }
+      ]
+    },
+    {
+      type: 'radio',
+      key: 'scale',
+      label: '鍥剧墖鏀惧ぇ',
+      initVal: card.scale || 'false',
+      required: false,
+      options: [
+        { value: 'false', text: '涓嶅彲浠�' },
+        { value: 'true', text: '鍙互' }
       ]
     },
     {
@@ -378,14 +446,22 @@
         { value: 'self', text: '褰撳墠椤甸潰' }
       ]
     },
+    // {
+    //   type: 'select',
+    //   key: 'copyMenuId',
+    //   label: '澶嶅埗鑿滃崟',
+    //   initVal: card.copyMenuId || '',
+    //   required: false,
+    //   forbid: !isApp,
+    //   options: appMenus
+    // },
     {
       type: 'select',
-      key: 'copyMenuId',
-      label: '澶嶅埗鑿滃崟',
-      initVal: card.copyMenuId || '',
-      required: false,
-      forbid: !isApp,
-      options: appMenus
+      key: 'linkurl',
+      label: '閾炬帴鍦板潃',
+      initVal: card.linkurl || '',
+      required: true,
+      options: []
     },
     {
       type: 'radio',
@@ -402,12 +478,40 @@
       }]
     },
     {
-      type: 'select',
-      key: 'linkurl',
-      label: '閾炬帴鍦板潃',
-      initVal: card.linkurl || '',
-      required: true,
-      options: []
+      type: 'radio',
+      key: 'eval',
+      label: '瑙f瀽',
+      initVal: card.eval || 'true',
+      tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��',
+      required: false,
+      options: [{
+        value: 'true',
+        text: Formdict['model.true']
+      }, {
+        value: 'false',
+        text: Formdict['model.false']
+      }]
+    },
+    {
+      type: 'textarea',
+      key: 'formula',
+      label: '鍏紡',
+      initVal: card.formula || '',
+      tooltip: '鎵ц鏃朵細浣跨敤鏌ヨ鍒扮殑鏁版嵁鏇挎崲鐩稿簲鐨勫瓧娈碉紝灞曠ず鑾峰緱鐨勭粨鏋溿�傚彲浣跨敤JS鐨勪竴浜涜娉曪紝濡傦細涓夊厓琛ㄨ揪寮� @field1@ > @field2@ ? 0 : 1锛汳ath瀵硅薄锛屽彇缁濆鍊� Math.abs(@field@)銆佸洓鑸嶄簲鍏� Math.round(@field@)绛�',
+      placeholder: '渚嬪锛欯price@ * @number@',
+      required: true
+    },
+    {
+      type: 'radio',
+      key: 'noValue',
+      label: '绌哄��',
+      initVal: card.noValue || 'show',
+      tooltip: '褰撳厓绱犲唴瀹逛负绌烘椂锛屾槸鍚︽樉绀哄綋鍓嶅厓绱犮��',
+      required: false,
+      options: [
+        { value: 'show', text: '鏄剧ず' },
+        { value: 'hide', text: '闅愯棌' }
+      ]
     },
   ]
 

--
Gitblit v1.8.0