From f0bf8c399c354c22227f8f1a76ed806098db59c0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 21 五月 2024 16:51:02 +0800
Subject: [PATCH] 2024-05-21

---
 src/menu/components/card/data-card/options.jsx |  138 +++++++++++++++++++++++++++++++++------------
 1 files changed, 101 insertions(+), 37 deletions(-)

diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx
index 22cd055..91f71f7 100644
--- a/src/menu/components/card/data-card/options.jsx
+++ b/src/menu/components/card/data-card/options.jsx
@@ -59,6 +59,74 @@
     }
   }
 
+  let interaction = []
+  let interOptions = []
+
+  if (wrap.scale === 'true') {
+    interaction.push('scale')
+  }
+  if (wrap.parity === 'true') {
+    interaction.push('parity')
+  }
+  if (wrap.hover === 'true') {
+    interaction.push('hover')
+  }
+
+  if (subtype === 'datacard') {
+    interOptions = [
+      {value: 'parity', label: '濂囧伓寮傝壊'},
+    ]
+    if (appType !== 'mob') {
+      interOptions.push(
+        {value: 'hover', label: '鎮诞鍙樿壊'},
+        {value: 'scale', label: '鎮诞鏀惧ぇ'}
+      )
+    }
+  } else if (subtype === 'propcard' && appType !== 'mob') {
+    interOptions = [
+      {value: 'scale', label: '鎮诞鏀惧ぇ'}
+    ]
+  } else if (subtype === 'tablecard') {
+    interOptions = [
+      {value: 'parity', label: '濂囧伓寮傝壊'},
+    ]
+    if (appType !== 'mob') {
+      interOptions.push(
+        {value: 'hover', label: '鎮诞鍙樿壊'}
+      )
+    }
+  }
+
+  if (interaction.length && interOptions.length) {
+    interaction = interaction.filter(m => interOptions.findIndex(cell => cell.value === m) > -1)
+  }
+
+  // let interItem = null
+
+  // if (interOptions.length === 1) {
+  //   interItem = {
+  //     type: 'radio',
+  //     field: interOptions[0].value,
+  //     label: interOptions[0].label,
+  //     initval: interaction.length === 1 ? 'true' : 'false',
+  //     required: false,
+  //     options: [
+  //       {value: 'true', label: '鍚敤'},
+  //       {value: 'false', label: '绂佺敤'}
+  //     ]
+  //   }
+  // } else {
+  //   interItem = {
+  //     type: 'checkbox',
+  //     field: 'interaction',
+  //     label: '浜や簰鏁堟灉',
+  //     initval: interaction,
+  //     required: false,
+  //     options: interOptions,
+  //     forbid: interOptions.length === 0
+  //   }
+  // }
+
   const cardWrapForm = [
     {
       type: 'text',
@@ -306,31 +374,27 @@
       ],
       forbid: subtype !== 'datacard' || appType === 'mob'
     },
+    // {
+    //   type: 'radio',
+    //   field: 'scale',
+    //   label: '鏀惧ぇ鏁堟灉',
+    //   initval: wrap.scale || 'false',
+    //   tooltip: '榧犳爣鎮诞浜庡崱鐗囦笂鏂规椂锛屽崱鐗囨斁澶�1.05鍊嶃��',
+    //   required: false,
+    //   options: [
+    //     {value: 'false', label: '鏃�'},
+    //     {value: 'true', label: '鏈�'},
+    //   ],
+    //   forbid: subtype === 'tablecard' || appType === 'mob'
+    // },
     {
-      type: 'radio',
-      field: 'scale',
-      label: '鏀惧ぇ鏁堟灉',
-      initval: wrap.scale || 'false',
-      tooltip: '榧犳爣鎮诞浜庡崱鐗囦笂鏂规椂锛屽崱鐗囨斁澶�1.05鍊嶃��',
+      type: 'checkbox',
+      field: 'interaction',
+      label: '浜や簰鏁堟灉',
+      initval: interaction,
       required: false,
-      options: [
-        {value: 'false', label: '鏃�'},
-        {value: 'true', label: '鏈�'},
-      ],
-      forbid: subtype === 'tablecard' || appType === 'mob'
-    },
-    {
-      type: 'radio',
-      field: 'parity',
-      label: '濂囧伓鑳屾櫙',
-      initval: wrap.parity || 'false',
-      tooltip: '鍋舵暟琛屼細娣诲姞鑳屾櫙鑹层��',
-      required: false,
-      options: [
-        {value: 'false', label: '鏃�'},
-        {value: 'true', label: '鏈�'},
-      ],
-      forbid: subtype === 'propcard'
+      options: interOptions,
+      forbid: interOptions.length === 0
     },
     {
       type: 'radio',
@@ -449,7 +513,6 @@
       ],
       controlFields: [
         {field: 'jumpField', values: ['menu', 'link']},
-        {field: 'joint', values: ['menu', 'link']},
         {field: 'open', values: ['menu', 'link']},
         {field: 'menu', values: ['menu']},
         {field: 'link', values: ['link']},
@@ -483,18 +546,6 @@
       tooltip: '璺宠浆閾炬帴涓烘煡璇㈡暟鎹殑杩斿洖鍊笺��',
       required: true,
       options: columns,
-      forbid: subtype !== 'propcard' || appType !== 'mob'
-    },
-    {
-      type: 'radio',
-      field: 'joint',
-      label: '鍙傛暟鎷兼帴',
-      initval: wrap.joint || 'true',
-      required: false,
-      options: [
-        {value: 'true', label: '鏄�'},
-        {value: 'false', label: '鍚�'},
-      ],
       forbid: subtype !== 'propcard' || appType !== 'mob'
     },
     {
@@ -610,6 +661,19 @@
     },
     {
       type: 'radio',
+      field: 'searchBtn',
+      label: '鎼滅储鎸夐挳',
+      initval: wrap.searchBtn || 'hidden',
+      // tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�',
+      required: false,
+      options: [
+        {value: 'hidden', label: '闅愯棌'},
+        {value: 'show', label: '鏄剧ず'},
+      ],
+      forbid: appType === 'mob' || isprint,
+    },
+    {
+      type: 'radio',
       field: 'shifting',
       label: '鎸夐挳鍋忕Щ',
       initval: wrap.shifting || 'false',
@@ -669,7 +733,7 @@
           width: '20%'
         },
         {
-          title: '鑿滃崟',
+          title: '缁勪欢',
           dataIndex: 'nodes',
           inputType: 'cascader',
           editable: true,

--
Gitblit v1.8.0