From a898abd9e42a4b428d6daf1d34fa400ed18e8689 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 23 十一月 2022 17:35:34 +0800
Subject: [PATCH] 2022-11-23

---
 src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx |  201 +++++++++++++++++++++++++++++++------------------
 1 files changed, 126 insertions(+), 75 deletions(-)

diff --git a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
index 4398460..f1ff2b1 100644
--- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
+++ b/src/menu/components/table/normal-table/columns/editColumn/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       // 鎼滅储鏉′欢瀵硅薄
@@ -13,7 +8,7 @@
   if (roleList) {
     try {
       roleList = JSON.parse(roleList)
-    } catch {
+    } catch (e) {
       roleList = []
     }
   } else {
@@ -31,7 +26,7 @@
   if (menulist) {
     try {
       menulist = JSON.parse(menulist)
-    } catch {
+    } catch (e) {
       menulist = []
     }
   } else {
@@ -40,25 +35,31 @@
 
   let options = [{
     value: 'text',
-    text: Formdict['model.form.text']
+    text: '鏂囨湰'
   }, {
     value: 'number',
-    text: Formdict['model.form.number']
+    text: '鏁板瓧'
   }, {
     value: 'picture',
-    text: Formdict['model.form.picture']
+    text: '鍥剧墖'
+  }, {
+    value: 'video',
+    text: '瑙嗛'
   }, {
     value: 'link',
-    text: Formdict['model.form.href']
+    text: '閾炬帴'
   }, {
     value: 'textarea',
-    text: Formdict['model.form.textarea']
+    text: '澶氳鏂囨湰'
   }, {
     value: 'custom',
     text: '鑷畾涔夊垪'
   }, {
     value: 'colspan',
     text: '鍚堝苟鍒�'
+  }, {
+    value: 'formula',
+    text: '鍏紡'
   }, {
     value: 'index',
     text: '搴忓彿'
@@ -86,7 +87,7 @@
     {
       type: 'select',
       key: 'type',
-      label: Formdict['model.form.type'],
+      label: '绫诲瀷',
       initVal: card.type,
       required: true,
       options: options
@@ -94,7 +95,7 @@
     {
       type: 'select',
       key: 'field',
-      label: Formdict['model.form.field'],
+      label: '瀛楁',
       initVal: card.field,
       required: true,
       options: fields
@@ -102,7 +103,7 @@
     {
       type: 'select',
       key: 'nameField',
-      label: Formdict['model.name'] + Formdict['model.form.field'],
+      label: '鍚嶇О瀛楁',
       initVal: card.nameField || '',
       required: false,
       options: [{uuid: 'empty', field: '', label: '绌�'}, ...fields]
@@ -113,69 +114,88 @@
       min: 20,
       max: 1000,
       decimal: 0,
-      label: Formdict['model.form.columnWidth'],
+      label: '鍒楀',
       initVal: card.Width || 120,
       required: true
     },
     {
       type: 'radio',
       key: 'joint',
-      label: Formdict['model.form.paramJoint'],
+      label: '鎷兼帴鍙傛暟',
       initVal: card.joint || 'true',
       required: true,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
       type: 'radio',
       key: 'Hide',
-      label: Formdict['model.hidden'],
+      label: '闅愯棌',
       initVal: card.Hide || 'false',
       required: true,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
       type: 'radio',
       key: 'IsSort',
-      label: Formdict['model.sort'],
-      initVal: card.IsSort || 'true',
+      label: '鎺掑簭',
+      initVal: card.IsSort || (card.isSub ? 'false' : 'true'),
       required: true,
-      forbidden: card.isSub,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
       type: 'radio',
       key: 'Align',
-      label: Formdict['model.form.align'],
+      label: '瀵归綈鏂瑰紡',
       initVal: card.Align || 'left',
       required: true,
       options: [{
         value: 'left',
-        text: Formdict['model.form.alignLeft']
+        text: '宸﹀榻�'
       }, {
         value: 'center',
-        text: Formdict['model.form.alignCenter']
+        text: '灞呬腑'
       }, {
         value: 'right',
-        text: Formdict['model.form.alignRight']
+        text: '鍙冲榻�'
       }]
+    },
+    {
+      type: 'number',
+      key: 'startTime',
+      precision: 0,
+      label: '寮�濮嬫椂闂�',
+      initVal: card.startTime || 0,
+      tooltip: '瑙嗛寮�濮嬫挱鏀剧殑鏃堕棿锛岀敤浜庤皟鏁磋棰戝垵濮嬪寲灞曠ず鐨勭晫闈€��',
+      required: false
+    },
+    {
+      type: 'select',
+      key: 'aspectRatio',
+      label: '闀垮姣�',
+      initVal: card.aspectRatio || '16:9',
+      required: true,
+      options: [
+        { value: '4:3', text: '4:3' },
+        { value: '16:9', text: '16:9' }
+      ]
     },
     {
       type: 'radio',
@@ -186,10 +206,10 @@
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
@@ -201,11 +221,12 @@
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
-      }]
+        text: '鍚�'
+      }],
+      forbid: card.isSub
     },
     {
       type: 'number',
@@ -213,35 +234,41 @@
       min: 0,
       max: 18,
       decimal: 0,
-      label: Formdict['header.form.decimal'],
-      initVal: card.decimal || 0,
-      required: true
+      label: '灏忔暟浣�',
+      initVal: card.decimal,
+      required: false
     },
     {
       type: 'select',
       key: 'format',
-      label: Formdict['header.form.format'],
+      label: '鏍煎紡鍖�',
       initVal: card.format || 'none',
       options: [{
         value: 'none',
-        text: Formdict['model.empty']
+        text: '鏃�'
       }, {
         value: 'thdSeparator',
-        text: Formdict['header.form.thdSeparator']
+        text: '鍗冨垎浣�'
       }, {
         value: 'percent',
         text: '鐧惧垎姣�'
+      }, {
+        value: 'abs',
+        text: '缁濆鍊�'
       }],
       required: false
     },
     {
       type: 'select',
       key: 'textFormat',
-      label: Formdict['header.form.format'],
+      label: '鏍煎紡鍖�',
       initVal: card.textFormat || 'none',
       options: [{
         value: 'none',
-        text: Formdict['model.empty']
+        text: '鏃�'
+      }, {
+        value: 'encryption',
+        text: '鍔犲瘑'
       }, {
         value: 'YYYY-MM-DD',
         text: 'YYYY-MM-DD'
@@ -254,7 +281,7 @@
     {
       type: 'text',
       key: 'prefix',
-      label: Formdict['header.form.prefix'],
+      label: '鍓嶇紑',
       initVal: card.prefix || '',
       required: false,
       readonly: false
@@ -262,13 +289,24 @@
     {
       type: 'text',
       key: 'postfix',
-      label: Formdict['header.form.postfix'],
+      label: '鍚庣紑',
       initVal: card.postfix || '',
       required: false,
       readonly: false
     },
     {
-      type: 'radio',
+      type: 'number',
+      key: 'span',
+      min: 1,
+      max: 24,
+      precision: 0,
+      label: '鍥剧墖瀹藉害',
+      initVal: card.span || 24,
+      tooltip: '鏍呮牸甯冨眬锛岀瓑鍒嗕负24浠姐��',
+      required: true
+    },
+    {
+      type: 'select',
       key: 'lenWidRadio',
       label: '闀垮姣�',
       initVal: card.lenWidRadio || '1:1',
@@ -294,37 +332,28 @@
     },
     {
       type: 'radio',
-      key: 'picSort',
-      label: '鍥剧墖鎺掑垪',
-      initVal: card.picSort || '1',
-      tooltip: '鍚屼竴鍗曞厓鏍煎唴锛屽惈鏈夊寮犲浘鐗囨椂鐨勫垪鏁般��',
+      key: 'backgroundSize',
+      label: '鍥惧儚澶у皬',
+      initVal: card.backgroundSize || 'cover',
       required: false,
-      options: [{
-        value: '1',
-        text: '1'
-      }, {
-        value: '2',
-        text: '2'
-      }, {
-        value: '3',
-        text: '3'
-      }, {
-        value: '4',
-        text: '4'
-      }]
+      options: [
+        { value: 'cover', text: '瑕嗙洊' },
+        { value: 'contain', text: '鍖呭惈' },
+        { value: 'auto', text: '鑷�傚簲' },
+      ]
     },
     {
       type: 'radio',
       key: 'scale',
-      label: Formdict['header.form.clickscale'],
-      initVal: card.scale || 'false',
+      label: '鐐瑰嚮缂╂斁',
+      initVal: card.scale || 'true',
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
@@ -342,16 +371,16 @@
         value: 'linkurl',
         text: '閾炬帴'
       }],
-      forbidden: appType === 'mob'
+      forbid: appType === 'mob'
     },
     {
       type: appType === 'pc' ? 'select' : 'cascader',
       key: 'linkmenu',
-      label: Formdict['model.menu'],
+      label: '鑿滃崟',
       initVal: card.linkmenu || (appType === 'pc' ? '' : []),
       required: true,
       options: menulist,
-      forbidden: appType === 'mob'
+      forbid: appType === 'mob'
     },
     {
       type: 'textarea',
@@ -359,7 +388,7 @@
       label: '閾炬帴鍦板潃',
       initVal: card.linkurl || '',
       required: true,
-      forbidden: appType === 'mob'
+      forbid: appType === 'mob'
     },
     {
       type: 'multiselect',
@@ -368,7 +397,7 @@
       initVal: card.linkfields || [],
       required: false,
       options: fields,
-      forbidden: appType === 'mob'
+      forbid: appType === 'mob'
     },
     {
       type: 'radio',
@@ -383,12 +412,34 @@
       ]
     },
     {
+      type: 'radio',
+      key: 'eval',
+      label: '瑙f瀽',
+      initVal: card.eval || 'true',
+      tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��',
+      required: false,
+      options: [
+        { value: 'true', text: '鏄�' },
+        { value: 'false', text: '鍚�' }
+      ]
+    },
+    {
+      type: 'textarea',
+      key: 'formula',
+      label: '鍏紡',
+      initVal: card.formula || '',
+      tooltip: '鎵ц鏃朵細浣跨敤鏌ヨ鍒扮殑鏁版嵁鏇挎崲鐩稿簲鐨勫瓧娈碉紝灞曠ず鑾峰緱鐨勭粨鏋滐紝鍦ㄤ笉浣跨敤瑙f瀽鏃舵崲琛岀鎴栫┖鏍间細鏇挎崲涓洪〉闈㈠厓绱犮�傚彲浣跨敤JS鐨勪竴浜涜娉曪紝濡傦細涓夊厓琛ㄨ揪寮� @field1@ > @field2@ ? 0 : 1锛汳ath瀵硅薄锛屽彇缁濆鍊� Math.abs(@field@)銆佸洓鑸嶄簲鍏� Math.round(@field@)绛�',
+      placeholder: '渚嬪锛欯price@ * @number@',
+      required: true
+    },
+    {
       type: 'multiselect',
       key: 'blacklist',
-      label: Formdict['header.form.blacklist'],
+      label: '榛戝悕鍗�',
       initVal: card.blacklist || [],
       required: false,
-      options: roleList
+      options: roleList,
+      forbid: appType === 'mob'
     }
   ]
 }

--
Gitblit v1.8.0