From 20185ab64a165df51515d9fa1c9b12a7a8c55f59 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 07 四月 2023 23:11:04 +0800
Subject: [PATCH] 2023-04-07

---
 src/menu/components/table/base-table/columns/editColumn/formconfig.jsx |  176 +++++++++++++++++++++++++++++++---------------------------
 1 files changed, 93 insertions(+), 83 deletions(-)

diff --git a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx
index 547c1c6..fb51dad 100644
--- a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx
+++ b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx
@@ -1,14 +1,8 @@
-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       // 鎼滅储鏉′欢瀵硅薄
  */
 export function getColumnForm (card, fields = []) {
-  let appType = sessionStorage.getItem('appType')
   let roleList = sessionStorage.getItem('sysRoles')
   if (roleList) {
     try {
@@ -20,13 +14,7 @@
     roleList = []
   }
 
-  let menulist = []
-
-  if (appType === 'pc') {
-    menulist = sessionStorage.getItem('appMenus')
-  } else if (!appType) {
-    menulist = sessionStorage.getItem('fstMenuList')
-  }
+  let menulist = sessionStorage.getItem('fstMenuList')
 
   if (menulist) {
     try {
@@ -40,19 +28,22 @@
 
   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: '鑷畾涔夊垪'
@@ -74,10 +65,6 @@
     })
   }
 
-  if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
-    card.perspective = ''
-  }
-
   return [
     {
       type: 'text',
@@ -89,26 +76,25 @@
     {
       type: 'select',
       key: 'type',
-      label: Formdict['model.form.type'],
+      label: '绫诲瀷',
       initVal: card.type,
       required: true,
       options: options
     },
     {
-      type: 'select',
+      type: card.isSub ? 'select' : 'text',
       key: 'field',
-      label: Formdict['model.form.field'],
+      label: '瀛楁',
       initVal: card.field,
       required: true,
-      options: fields
+      options: card.isSub ? fields : []
     },
     {
-      type: 'select',
+      type: 'text',
       key: 'nameField',
-      label: Formdict['model.name'] + Formdict['model.form.field'],
+      label: '鍚嶇О瀛楁',
       initVal: card.nameField || '',
-      required: false,
-      options: [{uuid: 'empty', field: '', label: '绌�'}, ...fields]
+      required: false
     },
     {
       type: 'number',
@@ -116,68 +102,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'],
+      label: '鎺掑簭',
       initVal: card.IsSort || (card.isSub ? 'false' : 'true'),
       required: true,
       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',
@@ -188,10 +194,10 @@
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
@@ -203,11 +209,20 @@
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
-      }]
+        text: '鍚�'
+      }],
+      forbid: card.isSub
+    },
+    {
+      type: 'number',
+      key: 'fieldlength',
+      label: '瀛楁闀垮害',
+      initVal: card.fieldlength || 50,
+      required: true,
+      forbid: card.isSub
     },
     {
       type: 'number',
@@ -215,14 +230,14 @@
       min: 0,
       max: 18,
       decimal: 0,
-      label: Formdict['header.form.decimal'],
-      initVal: card.decimal || 0,
-      required: true
+      label: '灏忔暟浣�',
+      initVal: card.decimal === undefined ? 0 : card.decimal,
+      required: !card.isSub
     },
     {
       type: 'select',
       key: 'format',
-      label: Formdict['header.form.format'],
+      label: '鏍煎紡鍖�',
       initVal: card.format || 'none',
       options: [{
         value: 'none',
@@ -242,7 +257,7 @@
     {
       type: 'select',
       key: 'textFormat',
-      label: Formdict['header.form.format'],
+      label: '鏍煎紡鍖�',
       initVal: card.textFormat || 'none',
       options: [{
         value: 'none',
@@ -262,7 +277,7 @@
     {
       type: 'text',
       key: 'prefix',
-      label: Formdict['header.form.prefix'],
+      label: '鍓嶇紑',
       initVal: card.prefix || '',
       required: false,
       readonly: false
@@ -270,7 +285,7 @@
     {
       type: 'text',
       key: 'postfix',
-      label: Formdict['header.form.postfix'],
+      label: '鍚庣紑',
       initVal: card.postfix || '',
       required: false,
       readonly: false
@@ -313,16 +328,28 @@
     },
     {
       type: 'radio',
+      key: 'backgroundSize',
+      label: '鍥惧儚澶у皬',
+      initVal: card.backgroundSize || 'cover',
+      required: false,
+      options: [
+        { value: 'cover', text: '瑕嗙洊' },
+        { value: 'contain', text: '鍖呭惈' },
+        { value: 'auto', text: '鑷�傚簲' },
+      ]
+    },
+    {
+      type: 'radio',
       key: 'scale',
       label: '鐐瑰嚮缂╂斁',
       initVal: card.scale || 'true',
       required: false,
       options: [{
         value: 'true',
-        text: Formdict['model.true']
+        text: '鏄�'
       }, {
         value: 'false',
-        text: Formdict['model.false']
+        text: '鍚�'
       }]
     },
     {
@@ -340,24 +367,21 @@
         value: 'linkurl',
         text: '閾炬帴'
       }],
-      forbidden: appType === 'mob'
     },
     {
-      type: appType === 'pc' ? 'select' : 'cascader',
+      type: 'cascader',
       key: 'linkmenu',
-      label: Formdict['model.menu'],
-      initVal: card.linkmenu || (appType === 'pc' ? '' : []),
+      label: '鑿滃崟',
+      initVal: card.linkmenu || [],
       required: true,
-      options: menulist,
-      forbidden: appType === 'mob'
+      options: menulist
     },
     {
       type: 'textarea',
       key: 'linkurl',
       label: '閾炬帴鍦板潃',
       initVal: card.linkurl || '',
-      required: true,
-      forbidden: appType === 'mob'
+      required: true
     },
     {
       type: 'multiselect',
@@ -366,25 +390,12 @@
       initVal: card.linkfields || [],
       required: false,
       options: fields,
-      forbidden: appType === 'mob'
-    },
-    {
-      type: 'radio',
-      key: 'open',
-      label: '鎵撳紑鏂瑰紡',
-      initVal: card.open || 'blank',
-      required: false,
-      forbid: appType !== 'pc',
-      options: [
-        { value: 'blank', text: '鏂扮獥鍙�' },
-        { value: 'self', text: '褰撳墠绐楀彛' }
-      ]
     },
     {
       type: 'radio',
       key: 'eval',
       label: '瑙f瀽',
-      initVal: card.eval || 'true',
+      initVal: card.eval || 'false',
       tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��',
       required: false,
       options: [
@@ -404,11 +415,10 @@
     {
       type: 'multiselect',
       key: 'blacklist',
-      label: Formdict['header.form.blacklist'],
+      label: '榛戝悕鍗�',
       initVal: card.blacklist || [],
       required: false,
-      options: roleList,
-      forbidden: appType === 'mob'
+      options: roleList
     }
   ]
 }

--
Gitblit v1.8.0