From 42fae277ae5ebe794fc070bf38482a919eb661fc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 25 十一月 2020 14:36:02 +0800
Subject: [PATCH] 2020-11-25

---
 src/menu/components/card/cardcellcomponent/formconfig.jsx |  166 +++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 119 insertions(+), 47 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx
index 7a33eda..b0fc153 100644
--- a/src/menu/components/card/cardcellcomponent/formconfig.jsx
+++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -1,16 +1,31 @@
-// import zhCN from '@/locales/zh-CN/model.js'
-// import enUS from '@/locales/en-US/model.js'
+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
+const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
 
 /**
  * @description 鑾峰彇鎸夐挳琛ㄥ崟閰嶇疆淇℃伅
  * @param {*} card           缂栬緫鎸夐挳
- * @param {*} setting        缁勪欢閰嶇疆
- * @param {*} permFuncField  瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈�
  * @param {*} type           鎸夐挳绫诲瀷锛岀敤浜庡尯鍒嗗彲閫夌殑鎵撳紑鏂瑰紡
  */
-export function getCardCellForm (card) {
+export function getCardCellForm (card, type) {
+  let _options = [
+    { value: 'text', text: '鏂囨湰'},
+    { value: 'number', text: '鏁板��'},
+    { value: 'picture', text: '鍥剧墖'},
+    { value: 'icon', text: '鍥炬爣'},
+    { value: 'link', text: '閾炬帴'},
+    { value: 'slider', text: '杩涘害鏉�'},
+    { value: 'splitline', text: '鍒嗗壊绾�'},
+    { value: 'barcode', text: '鏉″舰鐮�'},
+    { value: 'qrcode', text: '浜岀淮鐮�'},
+    { value: 'currentDate', text: '褰撳墠鏃堕棿'},
+  ]
+
+  if (type === 'table') {
+    _options.push({value: 'sequence', text: '搴忓彿'})
+  }
+
   let forms = [
     {
       type: 'select',
@@ -18,15 +33,7 @@
       label: '鍏冪礌绫诲瀷',
       initVal: card.eleType,
       required: true,
-      options: [
-        { value: 'text', text: '鏂囨湰'},
-        { value: 'number', text: '鏁板��'},
-        { value: 'picture', text: '鍥剧墖'},
-        { value: 'icon', text: '鍥炬爣'},
-        { value: 'link', text: '閾炬帴'},
-        { value: 'slider', text: '杩涘害鏉�'},
-        { value: 'splitline', text: '鍒嗗壊绾�'},
-      ]
+      options: _options
     },
     {
       type: 'select',
@@ -89,6 +96,14 @@
       options: []
     },
     {
+      type: 'text',
+      key: 'value',
+      min: 0,
+      label: '鍐呭',
+      initVal: card.value || '',
+      required: true
+    },
+    {
       type: 'file',
       key: 'url',
       label: '鍥剧墖',
@@ -98,18 +113,38 @@
     },
     {
       type: 'text',
-      key: 'value',
-      label: '鍐呭',
-      initVal: card.value || '',
-      required: true
+      key: 'label',
+      label: '鏄剧ず淇℃伅',
+      initVal: card.label || '',
+      required: false
     },
     {
       type: 'select',
-      key: 'labelfield',
-      label: '鎻愮ず瀛楁',
-      initVal: card.labelfield || '',
+      key: 'format',
+      label: '鏍煎紡鍖�',
+      initVal: card.format || '',
+      tooltip: '娉細鐧惧垎鏁般�佸崈鍒嗕綅瀵逛簬鏁板�肩被鍨嬫湁鏁堬紝YYYY-MM-DD瀵逛簬鏃堕棿绫诲瀷鐨勬枃鏈湁鏁堛��',
       required: false,
-      options: []
+      options: [
+        { value: '', text: '鏃�' },
+        { value: 'percent', text: '鐧惧垎鏁�' },
+        { value: 'thdSeparator', text: '鍗冨垎浣�' },
+        { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' }
+      ]
+    },
+    {
+      type: 'select',
+      key: 'dateFormat',
+      label: '鏍煎紡鍖�',
+      initVal: card.dateFormat || 'YYYY-MM-DD',
+      required: true,
+      options: [
+        { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' },
+        { value: 'YYYY', text: 'YYYY' },
+        { value: 'YYYY-MM', text: 'YYYY-MM' },
+        { value: 'YYYY-MM-DD HH:mm', text: 'YYYY-MM-DD HH:mm' },
+        { value: 'YYYY-MM-DD HH:mm:ss', text: 'YYYY-MM-DD HH:mm:ss' },
+      ]
     },
     {
       type: 'text',
@@ -134,24 +169,10 @@
       required: false
     },
     {
-      type: 'select',
-      key: 'format',
-      label: '鏍煎紡鍖�',
-      initVal: card.format || '',
-      tooltip: '娉細鐧惧垎鏁般�佸崈鍒嗕綅瀵逛簬鏁板�肩被鍨嬫湁鏁堬紝YYYY-MM-DD瀵逛簬鏃堕棿绫诲瀷鐨勬枃鏈湁鏁堛��',
-      required: false,
-      options: [
-        { value: '', text: '鏃�' },
-        { value: 'percent', text: '鐧惧垎鏁�' },
-        { value: 'thdSeparator', text: '鍗冨垎浣�' },
-        { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' }
-      ]
-    },
-    {
       type: 'color',
       key: 'color',
       label: '棰滆壊',
-      initVal: card.color,
+      initVal: card.color || 'rgba(0, 0, 0, 0.85)',
       required: true
     },
     {
@@ -169,9 +190,9 @@
       min: 1,
       max: 24,
       precision: 0,
-      label: '瀹藉害',
+      label: '鍏冪礌瀹藉害',
       initVal: card.width || 12,
-      tooltip: '姣忚绛夊垎涓�24浠姐��',
+      tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
       required: true
     },
     {
@@ -182,6 +203,54 @@
       label: '楂樺害(琛�)',
       initVal: card.height || 1,
       required: true,
+    },
+    {
+      type: 'number',
+      key: 'barHeight',
+      min: 5,
+      max: 50,
+      label: '楂樺害',
+      initVal: card.barHeight || 25,
+      required: true,
+    },
+    {
+      type: 'number',
+      key: 'qrWidth',
+      min: 5,
+      max: 500,
+      label: '瀹藉害',
+      initVal: card.qrWidth || 50,
+      required: true,
+    },
+    {
+      type: 'number',
+      key: 'interval',
+      min: 0.1,
+      max: 10,
+      precision: 1,
+      label: '绾挎潯闂撮殧',
+      initVal: card.interval || 1,
+      required: true,
+    },
+    {
+      type: 'radio',
+      key: 'displayValue',
+      label: '鏄剧ず鍊�',
+      initVal: card.displayValue || 'false',
+      required: false,
+      options: [
+        { value: 'true', text: '鏄�' },
+        { value: 'false', text: '鍚�' }
+      ]
+    },
+    {
+      type: 'number',
+      key: 'borderWidth',
+      min: 0,
+      max: 50,
+      label: '绾垮',
+      initVal: card.borderWidth || 1,
+      required: true
     },
     {
       type: 'select',
@@ -198,14 +267,17 @@
     },
     {
       type: 'radio',
-      key: 'radius',
-      label: '鍦嗚',
-      initVal: card.radius || 'false',
+      key: 'joint',
+      label: Formdict['model.form.paramJoint'],
+      initVal: card.joint || 'true',
       required: false,
-      options: [
-        { value: 'true', text: '鏈�' },
-        { value: 'false', text: '鏃�' }
-      ]
+      options: [{
+        value: 'true',
+        text: Formdict['model.true']
+      }, {
+        value: 'false',
+        text: Formdict['model.false']
+      }]
     },
   ]
 

--
Gitblit v1.8.0