From 5e871a4164869bac7927ea6884dbadd650b1cadf Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 25 五月 2023 11:25:28 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/menu/components/card/cardcellcomponent/formconfig.jsx |  113 +++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 91 insertions(+), 22 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx
index e7675ad..603aeaf 100644
--- a/src/menu/components/card/cardcellcomponent/formconfig.jsx
+++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -56,6 +56,58 @@
     width = +width.replace(/x/, '.5')
   }
 
+  let linkTypes = [
+    { value: 'tel', text: '鐢佃瘽' },
+    { value: 'email', text: '閭' },
+    { value: 'other', text: '鍏朵粬' }
+  ]
+
+  if (appType === 'mob') {
+    linkTypes = [
+      { value: 'tel', text: '鐢佃瘽' },
+      { value: 'email', text: '閭' },
+      { value: 'qywx', text: '浼佷笟寰俊' },
+      { value: 'linkmenu', text: '鍏宠仈鑿滃崟' },
+      { value: 'other', text: '鍏朵粬' }
+    ]
+  } else if (appType === 'pc') {
+    linkTypes = [
+      { value: 'tel', text: '鐢佃瘽' },
+      { value: 'email', text: '閭' },
+      { value: 'linkmenu', text: '鍏宠仈鑿滃崟' },
+      { value: 'other', text: '鍏朵粬' }
+    ]
+  }
+
+  if (card.linkType === 'qywx') {
+    if (appType !== 'mob') {
+      card.link = ''
+      card.linkType = ''
+      card.linkurl = ''
+    }
+  } else if (card.linkType === 'linkmenu') {
+    if (appType !== 'mob' && appType !== 'pc') {
+      card.link = ''
+      card.linkType = ''
+      card.linkurl = ''
+      card.linkmenu = ''
+    }
+  }
+
+  let appMenus = sessionStorage.getItem('appMenus')
+  if (['pc', 'mob'].includes(appType)) {
+    if (appMenus) {
+      try {
+        appMenus = JSON.parse(appMenus)
+      } catch (e) {
+        appMenus = []
+      }
+    } else {
+      appMenus = []
+    }
+    appMenus.push({value: 'goback', text: '杩斿洖锛堜笂涓�椤碉級'})
+  }
+
   let forms = [
     {
       type: 'select',
@@ -167,6 +219,21 @@
       label: '棰勮鍦板潃',
       initVal: card.posterField || '',
       required: true
+    },
+    {
+      type: 'radio',
+      key: 'eval',
+      label: '瑙f瀽',
+      initVal: card.eval || 'false',
+      tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��',
+      required: false,
+      options: [{
+        value: 'true',
+        text: '鏄�'
+      }, {
+        value: 'false',
+        text: '鍚�'
+      }]
     },
     {
       type: 'number',
@@ -504,17 +571,12 @@
       forbid: isHeader
     },
     {
-      type: 'radio',
+      type: linkTypes.length > 4 ? 'select' : 'radio',
       key: 'linkType',
       label: '閾炬帴绫诲瀷',
       initVal: card.linkType || 'other',
       required: false,
-      options: [
-        { value: 'tel', text: '鐢佃瘽' },
-        { value: 'email', text: '閭' },
-        { value: 'qywx', text: '浼佷笟寰俊' },
-        { value: 'other', text: '鍏朵粬' }
-      ]
+      options: linkTypes
     },
     {
       type: 'radio',
@@ -529,6 +591,15 @@
     },
     {
       type: 'select',
+      key: 'linkmenu',
+      label: '鍏宠仈鑿滃崟',
+      initVal: card.linkmenu || '',
+      required: true,
+      options: appMenus || [],
+      forbid: !['pc', 'mob'].includes(appType)
+    },
+    {
+      type: 'select',
       key: 'linkurl',
       label: '閾炬帴鍦板潃',
       initVal: card.linkurl || '',
@@ -537,24 +608,22 @@
     },
     {
       type: 'radio',
-      key: 'joint',
-      label: '鎷兼帴鍙傛暟',
-      initVal: card.joint || 'true',
-      required: false,
-      options: [{
-        value: 'true',
-        text: '鏄�'
-      }, {
-        value: 'false',
-        text: '鍚�'
-      }]
+      key: 'open',
+      label: '鎵撳紑鏂瑰紡',
+      initVal: card.open || 'blank',
+      tooltip: '鑿滃崟鎵撳紑鏂瑰紡銆�',
+      required: true,
+      forbid: !['pc', 'mob'].includes(appType),
+      options: [
+        {value: 'blank', text: appType !== 'mob' ? '鏂扮獥鍙�' : '鏂伴〉闈�'},
+        {value: 'self', text: appType !== 'mob' ? '褰撳墠绐楀彛' : '褰撳墠椤甸潰'},
+      ]
     },
     {
       type: 'radio',
-      key: 'eval',
-      label: '瑙f瀽',
-      initVal: card.eval || 'false',
-      tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��',
+      key: 'joint',
+      label: '鎷兼帴鍙傛暟',
+      initVal: card.joint || 'true',
       required: false,
       options: [{
         value: 'true',

--
Gitblit v1.8.0