From da34633b25d16359cd91a656acad5e811f9972b7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 14 三月 2023 18:09:54 +0800
Subject: [PATCH] 2023-03-14

---
 src/menu/components/card/cardcellcomponent/dragaction/card.jsx |   34 ++++++++++++++++++++++------------
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
index 66b04b5..8069bcf 100644
--- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
+++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
@@ -101,32 +101,29 @@
       //   </div>
       // )
     } else if (card.eleType === 'picture') {
-      let _imagestyle = {}
+      let _imagestyle = {
+        backgroundSize: card.style.backgroundSize || 'cover',
+        backgroundPosition: card.style.backgroundPosition || 'center',
+        backgroundRepeat: card.style.backgroundRepeat || 'no-repeat',
+        borderRadius: card.style.borderRadius || 0
+      }
       let url = card.url !== '@icon@' ? card.url : sessionStorage.getItem('CloudAvatar')
 
       if (url) {
         url = url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)
-        _imagestyle = {backgroundImage: `url('${url}')`}
+        _imagestyle.backgroundImage = `url('${url}')`
       } else {
         let index = card.uuid.match(/\d{1}/g)
         index = index.slice(-1)[0] % 5
         let demos = [demo1, demo2, demo3, demo4, demo5]
 
-        _imagestyle = {backgroundImage: `url('${demos[index]}')`}
-      }
-
-      if (card.style && card.style.borderRadius) {
-        _imagestyle.borderRadius = card.style.borderRadius
+        _imagestyle.backgroundImage = `url('${demos[index]}')`
       }
 
       if (PicRadio[card.lenWidRadio]) {
         _imagestyle.paddingTop = PicRadio[card.lenWidRadio]
       } else {
         _imagestyle.paddingTop = '100%'
-      }
-
-      if (card.backgroundSize) {
-        _imagestyle.backgroundSize = card.backgroundSize
       }
 
       return (
@@ -180,6 +177,19 @@
           {val}
         </div>
       )
+    } else if (card.eleType === 'color') {
+      _style.overflow = 'hidden'
+      let _bgstyle = {backgroundColor: card.value || '#1890ff'}
+
+      if (PicRadio[card.lenWidRadio]) {
+        _bgstyle.paddingTop = PicRadio[card.lenWidRadio]
+      } else {
+        _bgstyle.paddingTop = '100%'
+      }
+
+      return (
+        <div style={_bgstyle}></div>
+      )
     }
   }
 
@@ -191,7 +201,7 @@
   }
 
   let able = true
-  if ((appType === 'mob' || appType === 'pc') && (parent.setting.click === 'menu' || parent.setting.click === 'menus')) {
+  if ((appType === 'mob' || appType === 'pc') && parent.setting && (parent.setting.click === 'menu' || parent.setting.click === 'menus')) {
     able = false
   }
 

--
Gitblit v1.8.0