From d7ec8fbd65cd7225ce8d405a0ee0a1f166f44d7b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 16 九月 2021 17:23:54 +0800
Subject: [PATCH] 2021-09-16

---
 src/menu/components/share/actioncomponent/formconfig.jsx |  139 ++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 121 insertions(+), 18 deletions(-)

diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index 22279ab..04804f3 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -47,6 +47,20 @@
     }
   ]
 
+  let getTabs = (list) => {
+    return list.filter(item => {
+      if (item.type !== 'tabs') return false
+
+      item.children = item.children.map(cell => {
+        cell.children = getTabs(cell.children)
+        return cell
+      })
+      return item
+    })
+  }
+
+  let tabs = getTabs(JSON.parse(JSON.stringify(modules)))
+
   let pageTemps = [
     { value: 'billprint', text: '鍗曟嵁鎵撳嵃' },
     { value: 'pay', text: Formdict['model.pay'] },
@@ -56,25 +70,16 @@
 
   let funTypes = [
     { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
-    { value: 'print', text: '鏍囩鎵撳嵃' }
+    { value: 'print', text: '鏍囩鎵撳嵃' },
+    { value: 'closetab', text: '鏍囩鍏抽棴' },
   ]
   
   if (isApp) {
-    pageTemps = [
-      // { value: 'page', text: '鑿滃崟' },
-      { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
-      { value: 'billprint', text: '鍗曟嵁鎵撳嵃' },
-      { value: 'pay', text: Formdict['model.pay'] },
-      { value: 'custom', text: '閾炬帴' }
-    ]
-    funTypes = [
-      { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
-    ]
     appMenus = sessionStorage.getItem('appMenus')
     if (appMenus) {
       try {
         appMenus = JSON.parse(appMenus)
-      } catch {
+      } catch (e) {
         appMenus = []
       }
     } else {
@@ -82,8 +87,28 @@
     }
 
     if (appType === 'mob') {
-      opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'innerpage'].includes(item.value))
+      opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'].includes(item.value))
+      funTypes = [
+        { value: 'mkBinding', text: '寮�閫氭壂鐮佺櫥褰�' },
+        { value: 'mkUnBinding', text: '鐢ㄦ埛瑙g粦' },
+        { value: 'reAuth', text: '閲嶆柊鎺堟潈' },
+        { value: 'goBack', text: '杩斿洖' },
+      ]
+      pageTemps = [
+        { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
+        // { value: 'pay', text: Formdict['model.pay'] },
+        { value: 'custom', text: '閾炬帴' }
+      ]
     } else {
+      pageTemps = [
+        { value: 'linkpage', text: '鍏宠仈鑿滃崟' },
+        { value: 'billprint', text: '鍗曟嵁鎵撳嵃' },
+        { value: 'pay', text: Formdict['model.pay'] },
+        { value: 'custom', text: '閾炬帴' }
+      ]
+      funTypes = [
+        { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
+      ]
       opentypes = opentypes.filter(item => item.value !== 'tab')
     }
   }
@@ -111,7 +136,7 @@
       options: opentypes
     },
     {
-      type: 'radio',
+      type: 'select',
       key: 'funcType',
       label: Formdict['header.form.funcType'],
       initVal: card.funcType || '',
@@ -346,6 +371,9 @@
       }, {
         value: 'mainline',
         text: '鍒锋柊涓婄骇缁勪欢 - 琛�'
+      }, {
+        value: 'closetab',
+        text: '鍏抽棴鏍囩'
       },
       ...refresh]
     },
@@ -513,12 +541,32 @@
       }]
     },
     {
-      type: 'mcascader',
+      type: 'cascader',
       key: 'syncComponent',
-      label: '鍚屾鍒锋柊',
+      label: '鍒锋柊缁勪欢',
       initVal: card.syncComponent || [],
+      tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佸悓姝ュ埛鏂扮殑缁勪欢',
       required: false,
       options: modules
+    },
+    {
+      type: 'cascader',
+      key: 'switchTab',
+      label: '鍒囨崲鏍囩',
+      initVal: card.switchTab || [],
+      tooltip: '鎵ц鎴愬姛鍚庯紝闇�瑕佸垏鎹㈢殑鏍囩椤�',
+      required: false,
+      options: tabs
+    },
+    {
+      type: 'cascader',
+      key: 'refreshTab',
+      label: '鍒锋柊鑿滃崟',
+      initVal: card.refreshTab || [],
+      tooltip: '鎵ц鎴愬姛鍚庢垨鏍囩鍏抽棴鏃讹紝闇�瑕佸悓姝ュ埛鏂扮殑鑿滃崟',
+      required: false,
+      forbid: isApp,
+      options: menulist
     },
     {
       type: 'select',
@@ -547,7 +595,16 @@
       forbid: appType !== 'pc' && appType !== 'mob',
       required: false,
       allowClear: true,
-      options: appMenus
+      options: appType !== 'mob' ? appMenus : [...appMenus, {value: 'goback', text: '杩斿洖'}]
+    },
+    {
+      type: 'text',
+      key: 'output',
+      label: '杩斿洖鍊�',
+      tooltip: '鎵ц鎴愬姛鍚庣殑杩斿洖鍊笺��',
+      initVal: card.output || '',
+      forbid: appType !== 'pc' && appType !== 'mob',
+      required: false
     },
     {
       type: 'radio',
@@ -563,7 +620,53 @@
         value: 'self',
         text: '褰撳墠绐楀彛'
       }]
-    }
+    },
+    {
+      type: 'radio',
+      key: 'display',
+      label: '鏄剧ず鏂瑰紡',
+      initVal: card.display || 'modal',
+      required: true,
+      options: [{
+        value: 'modal',
+        text: '妯℃�佹'
+      }, {
+        value: 'drawer',
+        text: '鎶藉眽'
+      }]
+    },
+    {
+      type: 'number',
+      key: 'ratio',
+      min: 1,
+      max: 24,
+      precision: 0,
+      label: '姣斾緥',
+      initVal: card.ratio || 85,
+      tooltip: '灏忎簬100涓哄搴︼紙鎴栭珮搴︼級鐧惧垎姣旓紝澶т簬100涓哄儚绱犲�笺��',
+      required: true
+    },
+    {
+      type: 'radio',
+      key: 'placement',
+      label: '鎶藉眽鏂瑰悜',
+      initVal: card.placement || 'right',
+      tooltip: '浣跨敤鎶藉眽鏃舵湁鏁堛��',
+      required: false,
+      options: [{
+        value: 'right',
+        text: '鍙充晶'
+      }, {
+        value: 'left',
+        text: '宸︿晶'
+      }, {
+        value: 'top',
+        text: '涓婁晶'
+      }, {
+        value: 'bottom',
+        text: '涓嬩晶'
+      }]
+    },
   ]
 
   return forms

--
Gitblit v1.8.0