From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 27 八月 2023 18:37:36 +0800
Subject: [PATCH] 2023-08-27

---
 src/menu/components/card/cardcellcomponent/formconfig.jsx |  134 ++++++++++++++++++++++++++++++++++++--------
 1 files changed, 110 insertions(+), 24 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx
index 3400840..d682050 100644
--- a/src/menu/components/card/cardcellcomponent/formconfig.jsx
+++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -6,12 +6,14 @@
  * @param {*} type
  */
 export function getCardCellForm (card, cards, cardCell) {
+  let appType = sessionStorage.getItem('appType')
+
   let _options = [
     { value: 'text', text: '鏂囨湰'},
     { value: 'number', text: '鏁板��'},
     { value: 'picture', text: '鍥剧墖'},
     { value: 'video', text: '瑙嗛'},
-    { value: 'icon', text: '鍥炬爣'},
+    { value: 'icon', text: '鎻愮ず锛堝浘鏍囷級'},
     { value: 'slider', text: '杩涘害鏉�'},
     { value: 'splitline', text: '鍒嗗壊绾�'},
     { value: 'barcode', text: '鏉″舰鐮�'},
@@ -36,7 +38,6 @@
   if (card.eleType === 'icon' && card.datatype === 'dynamic' && !card.field) { // 鎷栨嫿娣诲姞绫诲瀷杞崲
     card.datatype = 'static'
   }
-  let appType = sessionStorage.getItem('appType')
 
   let tooltip = ''
   if (cardCell.$cardType === 'extendCard') {
@@ -54,6 +55,58 @@
   let width = card.width || 12
   if (/x/.test(card.width)) {
     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 = [
@@ -75,6 +128,17 @@
       options: [
         { value: 'dynamic', text: '鍔ㄦ��' },
         { value: 'static', text: '闈欐��' }
+      ]
+    },
+    {
+      type: 'radio',
+      key: 'tipType',
+      label: '鎻愮ず鍐呭',
+      initVal: card.tipType || 'icon',
+      required: false,
+      options: [
+        { value: 'icon', text: '鍥炬爣' },
+        { value: 'text', text: '鏂囨湰' }
       ]
     },
     {
@@ -167,6 +231,24 @@
       label: '棰勮鍦板潃',
       initVal: card.posterField || '',
       required: true
+    },
+    {
+      type: 'radio',
+      key: 'eval',
+      label: '瑙f瀽鏂瑰紡',
+      initVal: card.eval || 'false',
+      tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滆绠椻�濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃瓧娈垫浛鎹⑩�濓紝浣跨敤鍑芥暟鏃跺叆鍙備负data锛堟暟缁勶級銆�',
+      required: false,
+      options: [{
+        value: 'false',
+        text: '瀛楁鏇挎崲'
+      }, {
+        value: 'true',
+        text: '璁$畻'
+      }, {
+        value: 'func',
+        text: '鍑芥暟'
+      }]
     },
     {
       type: 'number',
@@ -504,16 +586,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: 'other', text: '鍏朵粬' }
-      ]
+      options: linkTypes
     },
     {
       type: 'radio',
@@ -528,32 +606,40 @@
     },
     {
       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 || '',
+      tooltip: ['pc', 'mob'].includes(appType) ? '褰撻摼鎺ョ被鍨嬩负鈥滃叾浠栤�濓紝涓旈摼鎺ュ湴鍧�浠menuid@寮�澶存椂锛屽叾鍚庡唴瀹瑰皢琚涓鸿彍鍗旾D銆�' : '',
       required: true,
       options: []
+    },
+    {
+      type: 'radio',
+      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: 'joint',
       label: '鎷兼帴鍙傛暟',
       initVal: card.joint || 'true',
-      required: false,
-      options: [{
-        value: 'true',
-        text: '鏄�'
-      }, {
-        value: 'false',
-        text: '鍚�'
-      }]
-    },
-    {
-      type: 'radio',
-      key: 'eval',
-      label: '瑙f瀽',
-      initVal: card.eval || 'false',
-      tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��',
       required: false,
       options: [{
         value: 'true',
@@ -589,7 +675,7 @@
       key: 'alignItems',
       label: '鍨傜洿瀵归綈',
       initVal: card.alignItems || '',
-      tooltip: '鍨傜洿鏂瑰悜鐨勫榻愭柟寮忋��',
+      tooltip: '鍨傜洿鏂瑰悜鐨勫榻愭柟寮忋�傛敞锛氶珮搴︼紙琛岋級澶т簬1鏃舵湁鏁堛��',
       required: false,
       options: [
         { value: '', text: '灞呬笂' },

--
Gitblit v1.8.0