From b223552a0c4bc787ad251add025a93d77527ffbe Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 18 十二月 2021 23:36:28 +0800
Subject: [PATCH] 2021-12-18

---
 src/menu/components/share/actioncomponent/formconfig.jsx |  198 ++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 154 insertions(+), 44 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index 04804f3..1cd8396 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -13,6 +13,7 @@
  */
 export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) {
   let appType = sessionStorage.getItem('appType')
+  let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview
   let setting = config.setting || {}
   let columns = config.columns || []
   let appMenus = []
@@ -59,6 +60,18 @@
     })
   }
 
+  if (type === 'editable') {
+    opentypes = [
+      {
+        value: 'excelIn',
+        text: Formdict['model.form.excelIn']
+      }, {
+        value: 'excelOut',
+        text: Formdict['model.form.excelOut']
+      }
+    ]
+  }
+
   let tabs = getTabs(JSON.parse(JSON.stringify(modules)))
 
   let pageTemps = [
@@ -69,7 +82,7 @@
   const isApp = ['pc', 'mob'].includes(appType)
 
   let funTypes = [
-    { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
+    { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
     { value: 'print', text: '鏍囩鎵撳嵃' },
     { value: 'closetab', text: '鏍囩鍏抽棴' },
   ]
@@ -89,9 +102,11 @@
     if (appType === 'mob') {
       opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'].includes(item.value))
       funTypes = [
+        { value: 'scan', text: '鎵爜' },
+        { value: 'logout', text: '閫�鍑�' },
         { value: 'mkBinding', text: '寮�閫氭壂鐮佺櫥褰�' },
         { value: 'mkUnBinding', text: '鐢ㄦ埛瑙g粦' },
-        { value: 'reAuth', text: '閲嶆柊鎺堟潈' },
+        { value: 'reAuth', text: '鍒囨崲绯荤粺锛堟竻绌虹紦瀛�-灏忕▼搴忥級' },
         { value: 'goBack', text: '杩斿洖' },
       ]
       pageTemps = [
@@ -107,7 +122,7 @@
         { value: 'custom', text: '閾炬帴' }
       ]
       funTypes = [
-        { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
+        { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' },
       ]
       opentypes = opentypes.filter(item => item.value !== 'tab')
     }
@@ -118,12 +133,20 @@
   }
 
   let refresh = []
-  if (sessionStorage.getItem('editMenuType') === 'popview') { // 寮圭獥鏍囩
+  if (viewType === 'popview') { // 寮圭獥鏍囩
     opentypes = opentypes.filter(item => item.value !== 'popview' && item.value !== 'funcbutton')
     refresh.push({
-      value: 'popclose',
-      text: '鏍囩鍒锋柊'
+      value: 'closepoptab', // 鍏抽棴寮圭獥鏍囩
+      text: '鍏抽棴寮圭獥'
     })
+    refresh.push({
+      value: 'popclose',  // 鎵ц寮圭獥鍏抽棴鏃剁殑鍒锋柊
+      text: '鍒锋柊婧愮粍浠�'
+    })
+  }
+
+  if (!card.control && card.controlField) {
+    card.control = 'disabled'
   }
 
   let forms = [
@@ -138,7 +161,7 @@
     {
       type: 'select',
       key: 'funcType',
-      label: Formdict['header.form.funcType'],
+      label: '鍔熻兘绫诲瀷',
       initVal: card.funcType || '',
       required: true,
       options: funTypes
@@ -341,9 +364,8 @@
       type: 'select',
       key: 'Ot',
       label: Formdict['header.form.isRequired'],
-      initVal: card.Ot || 'requiredSgl',
+      initVal: card.Ot || (card.sqlType === 'insert' ? 'notRequired' : 'requiredSgl'),
       required: true,
-      forbid: card.$type === 'tableButton',
       options: []
     },
     {
@@ -360,7 +382,7 @@
       key: 'execSuccess',
       label: Formdict['model.form.afterSuccess'],
       initVal: card.execSuccess || 'never',
-      tooltip: refresh.length ? '鎵ц鏍囩鍒锋柊鏃讹紝浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻��' : '鍒锋柊涓婄骇缁勪欢-琛屾椂锛屼細鍚屾鍒锋柊褰撳墠缁勪欢锛屾敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆�',
+      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻��' : '鍒锋柊涓婄骇缁勪欢-琛屾椂锛屼細鍚屾鍒锋柊褰撳墠缁勪欢锛屾敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆�',
       required: true,
       options: [{
         value: 'never',
@@ -369,11 +391,14 @@
         value: 'grid',
         text: '鍒锋柊褰撳墠缁勪欢'
       }, {
+        value: 'line',
+        text: '鍒锋柊琛�'
+      }, {
         value: 'mainline',
         text: '鍒锋柊涓婄骇缁勪欢 - 琛�'
       }, {
-        value: 'closetab',
-        text: '鍏抽棴鏍囩'
+        value: !appType ? 'closetab' : 'goback',
+        text: !appType ? '鍏抽棴鏍囩' : '杩斿洖锛堜笂涓�涓〉闈級'
       },
       ...refresh]
     },
@@ -382,7 +407,7 @@
       key: 'execError',
       label: Formdict['model.form.afterError'],
       initVal: card.execError || 'never',
-      tooltip: refresh.length ? '鎵ц鏍囩鍏抽棴鍒锋柊鏃讹紝浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻��' : '鍒锋柊涓婄骇缁勪欢-琛屾椂锛屼細鍚屾鍒锋柊褰撳墠缁勪欢锛屾敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆�',
+      tooltip: refresh.length ? '鎵ц鍒锋柊婧愮粍浠舵椂锛岃鍦ㄦ簮鎸夐挳涓缃叧闂悗鍒锋柊閭d竴椤癸紝娉細姝ゆ椂浼氬悓姝ュ埛鏂板綋鍓嶇粍浠跺拰涓婄骇缁勪欢-琛屻��' : '鍒锋柊涓婄骇缁勪欢-琛屾椂锛屼細鍚屾鍒锋柊褰撳墠缁勪欢锛屾敞锛氫笂绾х粍浠跺湪鏁版嵁婧愪腑娣诲姞銆�',
       required: true,
       options: [{
         value: 'never',
@@ -390,6 +415,9 @@
       }, {
         value: 'grid',
         text: '鍒锋柊褰撳墠缁勪欢'
+      }, {
+        value: 'line',
+        text: '鍒锋柊琛�'
       }, {
         value: 'mainline',
         text: '鍒锋柊涓婄骇缁勪欢 - 琛�'
@@ -445,6 +473,7 @@
       label: '鏄剧ず涓�',
       initVal: card.show || 'button',
       required: true,
+      forbid: type === 'datacard' && appType === 'mob', // 绉诲姩绔紝婊戝姩鏄剧ず鐨勬寜閽彧鏄剧ず鏂囧瓧
       options: [{
         value: 'icon',
         text: '鍥炬爣'
@@ -460,13 +489,13 @@
       type: 'radio',
       key: 'swipe',
       label: "婊戝姩鏄剧ず",
-      initVal: card.swipe || 'false',
+      initVal: card.swipe === 'false' ? 'left' : (card.swipe || 'left'), // 绉诲姩绔粎淇濈暀婊戝姩鏄剧ず鎸夐挳
       required: false,
       forbid: (type !== 'datacard' || appType !== 'mob'),
       options: [{
-        value: 'false',
-        text: '鍚�'
-      }, {
+      //   value: 'false',
+      //   text: '鍚�'
+      // }, {
         value: 'left',
         text: '宸︽粦'
       }, {
@@ -480,6 +509,7 @@
       label: Formdict['model.icon'],
       initVal: card.icon,
       required: false,
+      forbid: type === 'datacard' && appType === 'mob', // 绉诲姩绔紝婊戝姩鏄剧ず鐨勬寜閽彧鏄剧ず鏂囧瓧
       options: []
     },
     {
@@ -489,7 +519,32 @@
       initVal: card.class,
       tooltip: '姝ら鑹蹭负鎸夐挳鍒濆鍖栭鑹诧紝鍙湪鏍峰紡璋冩暣涓慨鏀广��',
       required: false,
+      forbid: type === 'datacard' && appType === 'mob', // 绉诲姩绔紝婊戝姩鏄剧ず鐨勬寜閽笉璁剧疆閫氱敤棰滆壊
       options: []
+    },
+    {
+      type: 'radio',
+      key: 'color',
+      label: Formdict['model.form.color'],
+      initVal: card.color || 'primary',
+      required: false,
+      forbid: (type !== 'datacard' || appType !== 'mob'), // 绉诲姩绔紝婊戝姩鏄剧ず鐨勬寜閽彧鍙缃浐瀹氶鑹�
+      options: [{
+        value: 'primary',
+        text: '钃�'
+      }, {
+        value: 'danger',
+        text: '绾�'
+      }, {
+        value: 'warning',
+        text: '姗�'
+      }, {
+        value: 'success',
+        text: '缁�'
+      }, {
+        value: 'light',
+        text: '鐏�'
+      }]
     },
     {
       type: 'radio',
@@ -515,7 +570,7 @@
     {
       type: 'radio',
       key: 'pagination',
-      label: Formdict['header.form.pagination'],
+      label: '鍒嗛〉',
       initVal: card.pagination || 'false',
       required: false,
       options: [{
@@ -545,7 +600,7 @@
       key: 'syncComponent',
       label: '鍒锋柊缁勪欢',
       initVal: card.syncComponent || [],
-      tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佸悓姝ュ埛鏂扮殑缁勪欢',
+      tooltip: '鎵ц鎴愬姛鍚庯紙鎴栧脊绐楁爣绛惧叧闂椂锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑缁勪欢',
       required: false,
       options: modules
     },
@@ -563,39 +618,30 @@
       key: 'refreshTab',
       label: '鍒锋柊鑿滃崟',
       initVal: card.refreshTab || [],
-      tooltip: '鎵ц鎴愬姛鍚庢垨鏍囩鍏抽棴鏃讹紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟',
+      tooltip: '鎵ц鎴愬姛鍚庯紙鎴栧姛鑳芥寜閽腑鏍囩鍏抽棴绫诲瀷锛夛紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟',
       required: false,
+      forbid: isApp || viewType === 'popview',
+      options: menulist
+    },
+    {
+      type: 'cascader',
+      key: 'linkmenu',
+      label: Formdict['model.form.linkmenu'],
+      initVal: card.linkmenu || [],
+      required: true,
       forbid: isApp,
       options: menulist
     },
     {
-      type: 'select',
-      key: 'controlField',
-      label: '鎺у埗瀛楁',
-      tooltip: '绂佺敤鎺у埗瀛楁锛屽彲鏍规嵁鏁版嵁鎺у埗鎸夐挳鏄惁绂佺敤銆�',
-      initVal: card.controlField || '',
-      required: false,
-      allowClear: true,
-      options: columns
-    },
-    {
-      type: 'text',
-      key: 'controlVal',
-      label: '鎺у埗鍊�',
-      tooltip: '褰撻�夋嫨鎺у埗瀛楁锛屼笖瀛楁鍊间笌鎺у埗鍊肩浉绛夋椂锛屾寜閽細绂佺敤锛屽涓�肩敤閫楀彿鍒嗛殧銆�',
-      initVal: card.controlVal || '',
-      required: false
-    },
-    {
-      type: 'select',
+      type: !appType ? 'cascader' : 'select',
       key: 'openmenu',
       label: '鎵撳紑鑿滃崟',
       tooltip: '鎵ц鎴愬姛鍚庨渶瑕佹墦寮�鐨勮彍鍗曘��',
-      initVal: card.openmenu || '',
-      forbid: appType !== 'pc' && appType !== 'mob',
+      initVal: card.openmenu || (!appType ? [] : ''),
       required: false,
       allowClear: true,
-      options: appType !== 'mob' ? appMenus : [...appMenus, {value: 'goback', text: '杩斿洖'}]
+      options: appType === 'mob' ? [...appMenus, {value: 'goback', text: '杩斿洖'}] : (appType === 'pc' ? appMenus : menulist),
+      forbid: viewType === 'popview'
     },
     {
       type: 'text',
@@ -603,8 +649,8 @@
       label: '杩斿洖鍊�',
       tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺��',
       initVal: card.output || '',
-      forbid: appType !== 'pc' && appType !== 'mob',
-      required: false
+      required: false,
+      forbid: viewType === 'popview'
     },
     {
       type: 'radio',
@@ -667,6 +713,70 @@
         text: '涓嬩晶'
       }]
     },
+    {
+      type: 'radio',
+      key: 'clickouter',
+      label: '鐐瑰嚮钂欏眰',
+      initVal: card.clickouter || 'unclose',
+      required: false,
+      options: [{
+        value: 'unclose',
+        text: '涓嶅叧闂�'
+      }, {
+        value: 'close',
+        text: '鍏抽棴'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'reload',
+      label: '杩斿洖鍚�',
+      initVal: card.reload || 'false',
+      tooltip: '鎸夐挳鎴愬姛鍚庤繑鍥炰笂涓�椤甸潰鎴栦娇鐢ㄥ姛鑳芥寜閽�-杩斿洖鍔熻兘鏃讹紝杩斿洖鍚庢槸鍚﹀埛鏂版暟鎹�傛敞锛氬湪鏄庣浜慳pp涓紙搴旂敤妯″紡涓篴pp锛夋湁鏁堛��',
+      forbid: appType !== 'mob',
+      options: [{
+        value: 'false',
+        text: '涓嶅埛鏂�'
+      }, {
+        value: 'true',
+        text: '鍒锋柊'
+      }]
+    },
+    {
+      type: 'radio',
+      key: 'control',
+      label: '鎸夐挳鎺у埗',
+      initVal: card.control || (card.controlField ? 'disabled' : ''),
+      required: false,
+      options: [{
+        value: '',
+        text: '鏃�'
+      }, {
+        value: 'disabled',
+        text: '绂佺敤'
+      }, {
+        value: 'hidden',
+        text: '闅愯棌'
+      }]
+    },
+    {
+      type: 'select',
+      key: 'controlField',
+      label: '鎺у埗瀛楁',
+      tooltip: '鎺у埗瀛楁锛屽彲鏍规嵁鏁版嵁鎺у埗鎸夐挳鐨勯殣钘忔垨绂佺敤銆�',
+      initVal: card.controlField || '',
+      required: true,
+      allowClear: true,
+      options: columns
+    },
+    {
+      type: 'text',
+      key: 'controlVal',
+      label: '鎺у埗鍊�',
+      tooltip: '褰撻�夋嫨鎺у埗瀛楁锛屼笖瀛楁鍊间笌鎺у埗鍊肩浉绛夋椂锛屾寜閽細闅愯棌鎴栫鐢紝澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�',
+      initVal: card.controlVal || '',
+      required: false
+    },
   ]
 
   return forms

--
Gitblit v1.8.0