From 72419e2f826031a158173f46d723a672064e37cd Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 31 八月 2021 22:42:51 +0800
Subject: [PATCH] 2021-08-31

---
 src/menu/components/card/cardcellcomponent/formconfig.jsx |  127 +++++++++++++++++++++++------------------
 1 files changed, 71 insertions(+), 56 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx
index 50b7ea0..92ccfc4 100644
--- a/src/menu/components/card/cardcellcomponent/formconfig.jsx
+++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -4,11 +4,11 @@
 const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
 
 /**
- * @description 鑾峰彇鎸夐挳琛ㄥ崟閰嶇疆淇℃伅
- * @param {*} card           缂栬緫鎸夐挳
- * @param {*} type           鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡
+ * @description 鑾峰彇鍏冪礌閰嶇疆淇℃伅
+ * @param {*} card
+ * @param {*} type
  */
-export function getCardCellForm (card, type, subtype) {
+export function getCardCellForm (card, type, subtype, cardCell) {
   let _options = [
     { value: 'text', text: '鏂囨湰'},
     { value: 'number', text: '鏁板��'},
@@ -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,13 +35,23 @@
     if (appMenus) {
       try {
         appMenus = JSON.parse(appMenus)
-        appMenus = appMenus.map(item => ({value: item.MenuID, text: item.MenuName}))
       } catch {
         appMenus = []
       }
     } else {
       appMenus = []
     }
+  }
+
+  let dataTypes = [
+    { value: 'dynamic', text: '鍔ㄦ��' },
+    { value: 'static', text: '闈欐��' }
+  ]
+  if (cardCell.$cardType === 'extendCard') {
+    card.datatype = 'static'
+    dataTypes = [
+      { value: 'static', text: '闈欐��' }
+    ]
   }
 
   let forms = [
@@ -52,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',
@@ -98,10 +76,7 @@
       label: '鏁版嵁绫诲瀷',
       initVal: card.datatype || 'static',
       required: true,
-      options: [
-        { value: 'dynamic', text: '鍔ㄦ��' },
-        { value: 'static', text: '闈欐��' }
-      ]
+      options: dataTypes
     },
     {
       type: 'select',
@@ -311,6 +286,16 @@
       ]
     },
     {
+      type: 'number',
+      key: 'maxWidth',
+      min: 10,
+      max: 2000,
+      label: '鏈�澶у搴�',
+      initVal: card.maxWidth || '',
+      tooltip: '鍥剧墖瀹藉害鐨勬渶澶у�笺��',
+      required: false,
+    },
+    {
       type: 'select',
       key: 'aspectRatio',
       label: '闀垮姣�',
@@ -319,6 +304,17 @@
       options: [
         { value: '4:3', text: '4:3' },
         { value: '16:9', text: '16:9' }
+      ]
+    },
+    {
+      type: 'radio',
+      key: 'noValue',
+      label: '绌哄��',
+      initVal: card.noValue || 'show',
+      required: false,
+      options: [
+        { value: 'show', text: '鏄剧ず' },
+        { value: 'hide', text: '闅愯棌' }
       ]
     },
     {
@@ -336,7 +332,7 @@
       ]
     },
     {
-      type: 'select',
+      type: 'radio',
       key: 'link',
       label: '閾炬帴',
       initVal: card.link || '',
@@ -344,9 +340,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: '鍙互' }
       ]
     },
     {
@@ -370,15 +376,15 @@
         { 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
+    // },
     {
       type: 'radio',
       key: 'joint',
@@ -401,6 +407,15 @@
       required: true,
       options: []
     },
+    {
+      type: 'textarea',
+      key: 'formula',
+      label: '鍏紡',
+      initVal: card.formula || '',
+      tooltip: '鎵ц鏃朵細浣跨敤鏌ヨ鍒扮殑鏁版嵁鏇挎崲鐩稿簲鐨勫瓧娈碉紝灞曠ず鑾峰緱鐨勭粨鏋溿��',
+      placeholder: '渚嬪锛欯price@ * @number@',
+      required: true
+    },
   ]
 
   return forms

--
Gitblit v1.8.0