From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 18 十一月 2021 20:47:04 +0800
Subject: [PATCH] 2021-11-18

---
 src/menu/components/card/cardcomponent/options.jsx |   69 ++++++++++++++++++++++++----------
 1 files changed, 48 insertions(+), 21 deletions(-)

diff --git a/src/menu/components/card/cardcomponent/options.jsx b/src/menu/components/card/cardcomponent/options.jsx
index 01ee4a9..96aa457 100644
--- a/src/menu/components/card/cardcomponent/options.jsx
+++ b/src/menu/components/card/cardcomponent/options.jsx
@@ -1,8 +1,9 @@
 /**
  * @description Setting琛ㄥ崟閰嶇疆淇℃伅
  */
-export default function (setting, hasPrimaryKey) {
+export default function (setting, subtype, buttons = [], cardType, columns) {
   let appType = sessionStorage.getItem('appType')
+  let hasMenus = subtype === 'datacard' && cardType !== 'extendCard'
 
   let menulist = []
   let appmenulist = []
@@ -12,7 +13,7 @@
     if (appmenulist) {
       try {
         appmenulist = JSON.parse(appmenulist)
-      } catch {
+      } catch (e) {
         appmenulist = []
       }
     } else {
@@ -23,12 +24,17 @@
     if (menulist) {
       try {
         menulist = JSON.parse(menulist)
-      } catch {
+      } catch (e) {
         menulist = []
       }
     } else {
       menulist = []
     }
+  }
+
+  let ops = []
+  if (hasMenus) {
+    ops = [{value: 'menus', label: '鑿滃崟缁�'}]
   }
 
   const cardSettingForm = [
@@ -82,48 +88,48 @@
       field: 'primaryId',
       label: '涓婚敭鍊�',
       initval: setting.primaryId || '',
-      tooltip: '鍗$墖鐐瑰嚮鏃讹紝鍚戝叾浠栫粍浠朵紶閫掔殑ID鍊笺��',
+      tooltip: '璁剧疆涓�涓睘鎬у崱闈欐�両D锛屽悜鍏朵粬缁勪欢浼犻�掔殑鎸囧畾闈欐�両D鍊�',
       required: false,
-      forbid: !hasPrimaryKey
+      forbid: subtype !== 'propcard'
     },
     {
-      type: 'radio',
+      type: !hasMenus ? 'radio' : 'select',
       field: 'click',
       label: '鐐瑰嚮浜嬩欢',
       initval: setting.click || '',
-      tooltip: '褰撻�夋嫨瑙﹀彂鎸夐挳鏃讹紝鍙湁褰撳崱鐗囦腑鍙瓨鍦ㄤ竴涓寜閽椂鏈夋晥銆�',
+      tooltip: '褰撶粦瀹氱偣鍑讳簨浠舵椂锛屽崱鐗囩殑鍒囨崲鍔熻兘灏嗗け鏁堛��',
       required: false,
       options: [
         {value: '', label: '鏃�'},
         {value: 'menu', label: '鑿滃崟'},
         {value: 'link', label: '閾炬帴'},
         {value: 'button', label: '鎸夐挳'},
+        ...ops
       ],
       controlFields: [
         {field: 'menu', values: ['menu']},
-        {field: 'appmenu', values: ['menu']},
         {field: 'linkurl', values: ['link']},
-        {field: 'open', values: ['menu', 'link']},
-        {field: 'joint', values: ['menu', 'link']},
+        {field: 'open', values: ['menu', 'link', 'menus']},
+        {field: 'joint', values: ['menu', 'link', 'menus']},
+        {field: 'linkbtn', values: ['button']},
+        {field: 'menuType', values: ['menus']},
       ]
     },
     {
-      type: 'cascader',
-      field: 'menu',
-      label: '鑿滃崟',
-      initval: setting.menu || [],
+      type: 'select',
+      field: 'menuType',
+      label: '鑿滃崟绫诲瀷',
+      initval: setting.menuType || '',
       required: true,
-      options: menulist,
-      forbid: !!appType
+      options: columns,
     },
     {
-      type: 'select',
-      field: 'appmenu',
+      type: appType ? 'select' : 'cascader',
+      field: 'menu',
       label: '鍏宠仈鑿滃崟',
-      initval: setting.menu || '',
+      initval: setting.menu || (appType ? '' : []),
       required: true,
-      options: appmenulist,
-      forbid: !appType
+      options: appType ? appmenulist : menulist,
     },
     {
       type: 'textarea',
@@ -157,6 +163,27 @@
         {value: 'false', label: '鍚�'},
       ],
     },
+    {
+      type: 'select',
+      field: 'linkbtn',
+      label: '鍏宠仈鎸夐挳',
+      initval: setting.linkbtn || '',
+      required: true,
+      options: buttons
+    },
+    {
+      type: 'radio',
+      field: 'btnControl',
+      label: '鎸夐挳鎺у埗',
+      initval: setting.btnControl || 'show',
+      tooltip: '鍙缃寜閽樉绀鸿鍒欙紝涓�鐩存樉绀烘垨榧犳爣鎮诞鏃舵樉绀恒��',
+      required: false,
+      options: [
+        {value: 'show', label: '姝e父鏄剧ず'},
+        {value: 'hover', label: '鎮诞鏄剧ず'},
+      ],
+      forbid: appType === 'mob'
+    }
   ]
 
   return cardSettingForm

--
Gitblit v1.8.0