From 6afdec0062dacbded57e166230eb22cc55ced0c1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 08 五月 2021 14:30:21 +0800
Subject: [PATCH] 2021-05-08

---
 src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx |  161 ++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 115 insertions(+), 46 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 3d816a0..0b1f3a0 100644
--- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
+++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx
@@ -1,7 +1,7 @@
 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 = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
 
 /**
  * @description 鑾峰彇鏄剧ず鍒楄〃鍗曢厤缃俊鎭�
@@ -20,6 +20,43 @@
     roleList = []
   }
 
+  let options = [{
+    value: 'text',
+    text: Formdict['model.form.text']
+  }, {
+    value: 'number',
+    text: Formdict['model.form.number']
+  }, {
+    value: 'picture',
+    text: Formdict['model.form.picture']
+  }, {
+    value: 'link',
+    text: Formdict['model.form.href']
+  }, {
+    value: 'textarea',
+    text: Formdict['model.form.textarea']
+  }, {
+    value: 'custom',
+    text: '鑷畾涔夊垪'
+  }, {
+    value: 'colspan',
+    text: '鍚堝苟鍒�'
+  }, {
+    value: 'index',
+    text: '搴忓彿'
+  }]
+
+  if (!card.isSub) {
+    options.push({
+      value: 'action',
+      text: '鎿嶄綔'
+    })
+  }
+
+  if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
+    card.perspective = ''
+  }
+
   return [
     {
       type: 'text',
@@ -34,22 +71,7 @@
       label: Formdict['model.form.type'],
       initVal: card.type,
       required: true,
-      options: [{
-        value: 'text',
-        text: Formdict['model.form.text']
-      }, {
-        value: 'number',
-        text: Formdict['model.form.number']
-      }, {
-        value: 'picture',
-        text: Formdict['model.form.picture']
-      }, {
-        value: 'link',
-        text: Formdict['model.form.href']
-      }, {
-        value: 'textarea',
-        text: Formdict['model.form.textarea']
-      }]
+      options: options
     },
     {
       type: 'select',
@@ -60,13 +82,21 @@
       options: fields
     },
     {
+      type: 'select',
+      key: 'nameField',
+      label: Formdict['model.name'] + Formdict['model.form.field'],
+      initVal: card.nameField || '',
+      required: false,
+      options: [{uuid: 'empty', field: '', label: '绌�'}, ...fields]
+    },
+    {
       type: 'number',
       key: 'Width',
-      min: 1,
+      min: 20,
       max: 1000,
       decimal: 0,
       label: Formdict['model.form.columnWidth'],
-      initVal: card.Width,
+      initVal: card.Width || 120,
       required: true
     },
     {
@@ -103,6 +133,7 @@
       label: Formdict['model.sort'],
       initVal: card.IsSort || 'true',
       required: true,
+      forbidden: card.isSub,
       options: [{
         value: 'true',
         text: Formdict['model.true']
@@ -133,7 +164,7 @@
       key: 'rowspan',
       label: '琛屽悎骞�',
       initVal: card.rowspan || 'false',
-      tooltip: '鐩搁偦琛屼俊鎭浉鍚屾椂锛屽崟鍏冩牸鍚堝苟銆傛敞锛氫负闃叉琛ㄦ牸淇℃伅閿欎贡锛岃鍚堝苟鍙兘娣诲姞涓�涓瓧娈点��',
+      tooltip: '鐩搁偦琛屼俊鎭浉鍚屾椂锛屽崟鍏冩牸鍚堝苟銆�',
       required: false,
       options: [{
         value: 'true',
@@ -148,7 +179,7 @@
       key: 'sum',
       label: '鏄剧ず鍚堣',
       initVal: card.sum || 'false',
-      tooltip: '鍚堣淇℃伅鍙湪浣跨敤绯荤粺鏁版嵁婧愶紝涓斿綋鍓嶅垪鏈殣钘忔椂鏈夋晥銆�',
+      tooltip: '鍚堣淇℃伅鍙湪浣跨敤绯荤粺鏁版嵁婧愭椂鏈夋晥銆�',
       required: false,
       options: [{
         value: 'true',
@@ -169,19 +200,12 @@
       required: true
     },
     {
-      type: 'number',
-      key: 'fieldlength',
-      label: Formdict['model.form.field'] + Formdict['model.length'],
-      initVal: card.fieldlength || (card.type === 'text' ? 50 : 512),
-      required: true
-    },
-    {
       type: 'select',
       key: 'format',
       label: Formdict['header.form.format'],
-      initVal: card.format || '',
+      initVal: card.format || 'none',
       options: [{
-        value: '',
+        value: 'none',
         text: Formdict['model.empty']
       }, {
         value: 'thdSeparator',
@@ -196,9 +220,9 @@
       type: 'select',
       key: 'textFormat',
       label: Formdict['header.form.format'],
-      initVal: card.textFormat || '',
+      initVal: card.textFormat || 'none',
       options: [{
-        value: '',
+        value: 'none',
         text: Formdict['model.empty']
       }, {
         value: 'YYYY-MM-DD',
@@ -227,16 +251,50 @@
       readonly: false
     },
     {
-      type: 'number',
-      key: 'maxHeight',
-      min: 1,
-      max: 1000,
-      decimal: 0,
-      label: '鏈�澶ч珮搴�',
-      tooltip: '鍥剧墖鍦ㄨ〃鏍间腑鏄剧ず鐨勬渶澶ч珮搴�',
-      tooltipClass: 'middle',
-      initVal: card.maxHeight || 128,
-      required: true
+      type: 'radio',
+      key: 'lenWidRadio',
+      label: '闀垮姣�',
+      initVal: card.lenWidRadio || '1:1',
+      required: true,
+      options: [
+        { value: '1:1', text: '1:1' },
+        { value: '4:3', text: '4:3' },
+        { value: '3:2', text: '3:2' },
+        { value: '16:9', text: '16:9' },
+        { value: '2:1', text: '2:1' },
+        { value: '3:1', text: '3:1' },
+        { value: '4:1', text: '4:1' },
+        { value: '5:1', text: '5:1' },
+        { value: '6:1', text: '6:1' },
+        { value: '7:1', text: '7:1' },
+        { value: '8:1', text: '8:1' },
+        { value: '9:1', text: '9:1' },
+        { value: '10:1', text: '10:1' },
+        { value: '3:4', text: '3:4' },
+        { value: '2:3', text: '2:3' },
+        { value: '9:16', text: '9:16' },
+      ]
+    },
+    {
+      type: 'radio',
+      key: 'picSort',
+      label: '鍥剧墖鎺掑垪',
+      initVal: card.picSort || '1',
+      tooltip: '鍚屼竴鍗曞厓鏍煎唴锛屽惈鏈夊寮犲浘鐗囨椂鐨勫垪鏁般��',
+      required: false,
+      options: [{
+        value: '1',
+        text: '1'
+      }, {
+        value: '2',
+        text: '2'
+      }, {
+        value: '3',
+        text: '3'
+      }, {
+        value: '4',
+        text: '4'
+      }]
     },
     {
       type: 'radio',
@@ -256,8 +314,11 @@
       type: 'radio',
       key: 'perspective',
       label: '瀛楁閫忚',
-      initVal: card.perspective || 'linkmenu',
+      initVal: card.perspective || '',
       options: [{
+        value: '',
+        text: '鏃�'
+      }, {
         value: 'linkmenu',
         text: '鑿滃崟'
       }, {
@@ -270,15 +331,23 @@
       key: 'linkmenu',
       label: Formdict['model.menu'],
       initVal: card.linkmenu || [],
-      required: false,
+      required: true,
       options: menulist
     },
     {
-      type: 'text',
+      type: 'textarea',
       key: 'linkurl',
       label: '閾炬帴鍦板潃',
       initVal: card.linkurl || '',
-      required: false
+      required: true
+    },
+    {
+      type: 'multiselect',
+      key: 'linkfields',
+      label: '鍏宠仈瀛楁',
+      initVal: card.linkfields || [],
+      required: false,
+      options: fields
     },
     {
       type: 'multiselect',

--
Gitblit v1.8.0