From c7df940632b5f238f524da651fbf27a91ff6ad36 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 26 十月 2020 16:54:46 +0800
Subject: [PATCH] 2020-10-26

---
 src/menu/components/card/cardcellcomponent/elementform/index.jsx |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx
index 2a4422b..5f8e47e 100644
--- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx
+++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx
@@ -14,7 +14,7 @@
   picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'radius', 'padding', 'url'],
   icon: ['eleType', 'icon', 'datatype', 'fontSize', 'width', 'align', 'padding'],
   link: ['eleType', 'datatype', 'labelfield', 'fontSize', 'width', 'height', 'align', 'padding', 'prefix'],
-  slider: ['eleType', 'field', 'width', 'color', 'padding', 'maxValue'],
+  slider: ['eleType', 'datatype', 'width', 'color', 'padding', 'maxValue'],
   splitline: ['eleType', 'color', 'width', 'padding'],
 }
 
@@ -37,7 +37,7 @@
   UNSAFE_componentWillMount () {
     const { card, config } = this.props
     let _options = this.getOptions(card.eleType, card.datatype)
-
+    
     this.setState({
       eleType: card.eleType,
       datatype: card.datatype,
@@ -69,6 +69,9 @@
               })
             }
           })
+        } else if (item.key === 'value' && card.eleType === 'slider') {
+          item.type = 'number'
+          item.label = '鍊�'
         }
 
         return item
@@ -79,7 +82,7 @@
   getOptions = (eleType, datatype) => {
     let _options = fromJS(cardTypeOptions[eleType]).toJS() // 閫夐」鍒楄〃
     
-    if (['text', 'number', 'picture', 'link'].includes(eleType)) {
+    if (['text', 'number', 'picture', 'link', 'slider'].includes(eleType)) {
       if (datatype === 'dynamic') {
         _options.push('field')
       } else if (eleType !== 'picture') {
@@ -127,6 +130,14 @@
               })
             }
           })
+        } else if (item.key === 'value') {
+          if (value === 'slider') {
+            item.type = 'number'
+            item.label = '鍊�'
+          } else {
+            item.type = 'text'
+            item.label = '鍐呭'
+          }
         }
 
         return item

--
Gitblit v1.8.0