From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 07 四月 2021 23:25:29 +0800
Subject: [PATCH] 2021-04-07

---
 src/templates/zshare/formconfig.jsx |  120 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 95 insertions(+), 25 deletions(-)

diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index 828532c..759648c 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -2,7 +2,7 @@
 import enUS from '@/locales/en-US/model.js'
 import { formRule } from '@/utils/option.js'
 
-const Formdict = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
+const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
 
 /**
  * @description 鑾峰彇鏍戝舰椤甸潰璁剧疆琛ㄥ崟閰嶇疆淇℃伅
@@ -667,7 +667,11 @@
   }
 
   let refresh = []
+
   if (type === 'subtable') { // 瀛愯〃椤甸潰锛屽彲璁剧疆鍒锋柊涓昏〃鍙婂悓绾ф爣绛�
+    if (card.focus) {
+      card.popClose = 'maingrid'
+    }
     refresh.push({
       value: 'maingrid',
       text: Formdict['header.form.refresh.maingrid']
@@ -826,7 +830,7 @@
     {
       type: 'text',
       key: 'url',
-      label: Formdict['model.form.newpage.url'],
+      label: Formdict['model.pageUrl'],
       initVal: card.url || '',
       required: true
     },
@@ -884,10 +888,25 @@
     },
     {
       type: 'radio',
+      key: 'cross',
+      label: '璺ㄥ煙璇锋眰',
+      initVal: card.cross || 'true',
+      tooltip: '濡傛灉鑷畾涔夋帴鍙d笉鏀寔璺ㄥ煙璇锋眰锛屼細閫氳繃褰撳墠绯荤粺杞彂銆�',
+      required: false,
+      options: [{
+        value: 'true',
+        text: '鏀寔'
+      }, {
+        value: 'false',
+        text: '涓嶆敮鎸�'
+      }]
+    },
+    {
+      type: 'radio',
       key: 'callbackType',
       label: '鍥炶皟鏂瑰紡',
       initVal: card.callbackType || 'script',
-      tooltip: '浣跨敤榛樿鏂瑰紡鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��',
+      tooltip: '浣跨敤鍚庡彴鑴氭湰鎵ц鏃讹紝闇�瑕侀厤鍚堣鍒掍换鍔°��',
       required: true,
       options: [{
         value: 'script',
@@ -1116,7 +1135,7 @@
  * @param {object} card       // 鎼滅储鏉′欢瀵硅薄
  * @param {Array}  menulist   // 鑿滃崟鍒楄〃-鐢ㄤ簬瀛楁閫忚
  */
-export function getColumnForm (card, menulist = []) {
+export function getColumnForm (card, menulist = [], fields = []) {
   let roleList = sessionStorage.getItem('sysRoles')
   if (roleList) {
     try {
@@ -1126,6 +1145,10 @@
     }
   } else {
     roleList = []
+  }
+
+  if (!card.linkurl && (!card.linkmenu || card.linkmenu.length === 0)) {
+    card.perspective = ''
   }
 
   return [
@@ -1375,8 +1398,11 @@
       type: 'radio',
       key: 'perspective',
       label: '瀛楁閫忚',
-      initVal: card.perspective || 'linkmenu',
+      initVal: card.perspective || '',
       options: [{
+        value: '',
+        text: '鏃�'
+      }, {
         value: 'linkmenu',
         text: '鑿滃崟'
       }, {
@@ -1389,15 +1415,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',
@@ -1900,8 +1934,10 @@
     })
   }
 
-  if (['textarea', 'fileupload', 'multiselect', 'checkbox', 'brafteditor'].includes(card.type)) {
+  if (['fileupload', 'multiselect', 'checkbox'].includes(card.type)) {
     _fieldlength = 512
+  } else if (['textarea', 'brafteditor'].includes(card.type)) {
+    _fieldlength = 8000
   }
 
   return [
@@ -1970,9 +2006,6 @@
         value: 'textarea',
         text: Formdict['model.form.textarea']
       }, {
-        value: 'hint',
-        text: '鎻愮ず'
-      }, {
         value: 'color',
         text: Formdict['model.form.color']
       }, {
@@ -1981,6 +2014,12 @@
       }, {
         value: 'funcvar',
         text: Formdict['header.form.funcvar']
+      }, {
+        value: 'hint',
+        text: '鎻愮ず'
+      }, {
+        value: 'split',
+        text: '鍒嗛殧绾�'
       },
       ..._openType]
     },
@@ -2059,6 +2098,9 @@
     {
       type: 'number',
       key: 'width',
+      min: 1,
+      max: 24,
+      precision: 0,
       label: '鍗$墖瀹藉害',
       initVal: card.width || 4,
       tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��',
@@ -2200,6 +2242,9 @@
     {
       type: 'number',
       key: 'decimal',
+      min: 0,
+      max: 18,
+      precision: 0,
       label: Formdict['header.form.decimal'],
       initVal: card.decimal || 0,
       required: true
@@ -2221,6 +2266,9 @@
     {
       type: 'number',
       key: 'fieldlength',
+      min: 1,
+      max: 1000000,
+      precision: 0,
       label: Formdict['model.form.field'] + Formdict['model.length'],
       tooltip: '鏂囨湰銆佷笅鎷夋銆佹棩鏈熺瓑瀛楁榛樿闀垮害涓�50锛屽琛屾枃鏈笌鏂囦欢涓婁紶瀛楁榛樿闀垮害涓�512',
       initVal: card.fieldlength || _fieldlength,
@@ -2229,6 +2277,9 @@
     {
       type: 'number',
       key: 'maxRows',
+      min: 2,
+      max: 100,
+      precision: 0,
       label: Formdict['header.form.maxRows'],
       initVal: card.maxRows || 6,
       required: false
@@ -2271,6 +2322,9 @@
     {
       type: 'number',
       key: 'maxfile',
+      min: 1,
+      max: 1000000,
+      precision: 0,
       label: '鏈�澶ф枃浠舵暟',
       initVal: card.maxfile || '',
       required: false
@@ -2369,18 +2423,26 @@
       }]
     },
     {
-      type: 'radio',
-      key: 'entireLine',
-      label: '鍗犳嵁鏁磋',
-      initVal: card.entireLine || 'false',
-      required: false,
-      options: [{
-        value: 'true',
-        text: '鏄�'
-      }, {
-        value: 'false',
-        text: '鍚�'
-      }]
+      type: 'number',
+      key: 'span',
+      min: 1,
+      max: 24,
+      precision: 0,
+      label: '琛ㄥ崟瀹藉害',
+      initVal: card.span || (['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type) ? 24 : 12),
+      tooltip: '鏍呮牸甯冨眬鏁磋24绛夊垎銆�',
+      required: true
+    },
+    {
+      type: 'number',
+      key: 'labelwidth',
+      min: 1,
+      max: 100,
+      precision: 1,
+      label: '鍚嶇О瀹藉害',
+      initVal: card.labelwidth || 33.3,
+      tooltip: '鍚嶇О鍗犳嵁琛ㄥ崟瀹藉害鐨勭櫨鍒嗘瘮銆傛敞锛氬瓨鍦ㄥ鍒楄〃鍗曟椂锛屽綋鍓嶈〃鍗曞鏋滄兂瑕佸崰鎹暣琛屽彲鍙傜収浠ヤ笅姣斾緥锛屼袱鍒楋紙16.2锛夈�佷笁鍒楋紙10.5锛夈�佸洓鍒楋紙7.7锛�',
+      required: true
     },
     {
       type: 'text',
@@ -2407,7 +2469,7 @@
     {
       type: 'radio',
       key: 'interception',
-      label: '鎴彇',
+      label: '鎴彇绌烘牸',
       initVal: card.interception || 'false',
       tooltip: '鎻愪氦鏃讹紝鏄惁鎴彇棣栧熬鐨勭┖鐧藉瓧绗︺��',
       options: [{
@@ -2447,6 +2509,14 @@
     },
     {
       type: 'text',
+      key: 'extra',
+      label: '搴曢儴鎻愮ず',
+      tooltip: '鏄剧ず浜庤〃鍗曞簳閮ㄣ��',
+      initVal: card.extra || '',
+      required: false
+    },
+    {
+      type: 'text',
       key: 'emptyText',
       label: '绌哄�兼枃鏈�',
       tooltip: '绌哄�肩殑鎻愮ず鏂囨湰锛岄�夋嫨璁剧疆绌哄�兼椂鏈夋晥锛岄粯璁ゅ�间负銆婄┖銆嬨��',

--
Gitblit v1.8.0