From 28d65cf7ebfe0dd30ade6973e0634e1c8f663b63 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 28 十月 2020 16:12:20 +0800
Subject: [PATCH] 2020-10-28

---
 src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx |   26 +-------------------------
 1 files changed, 1 insertions(+), 25 deletions(-)

diff --git a/src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx b/src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx
index 1f6fb2b..2601a4b 100644
--- a/src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx
+++ b/src/templates/sharecomponent/cardcomponent/carddetailform/index.jsx
@@ -46,8 +46,6 @@
           item.hidden = true
         } else if (item.key === 'field' && card.elemType === 'avatar') {
           item.options = columns.filter(option => option.type === card.type)
-        } else if (item.key === 'widthType' && card.elemType === 'avatar' && card.type === 'picture') {
-          item.hidden = false
         } else if (item.key === 'size' && card.elemType === 'avatar' && card.type === 'icon') {
           item.hidden = false
         } else if (item.key === 'width' && card.elemType === 'avatar' && card.type === 'picture') {
@@ -61,7 +59,6 @@
   }
 
   typeChange = (key, value) => {
-    const { card } = this.props
     const { columns, oriformlist } = this.state
 
     if (key === 'datatype') {
@@ -82,11 +79,8 @@
         formlist: oriformlist.map(item => {
           if (item.key === 'field') {
             item.options = columns.filter(option => option.type === value)
-          } else if (item.key === 'widthType') {
-            item.hidden = value !== 'picture'
           } else if (item.key === 'width') {
             item.hidden = value !== 'picture'
-            item.max = card.widthType === 'ratio' ? 100 : 500
           } else if (item.key === 'size') {
             item.hidden = value !== 'icon'
           } else if (item.key === 'radius') {
@@ -98,20 +92,6 @@
       }, () => {
         if (this.props.form.getFieldValue('field') !== undefined) {
           this.props.form.setFieldsValue({field: ''})
-        }
-      })
-    } else if (key === 'widthType') {
-      this.setState({
-        formlist: oriformlist.map(item => {
-          if (item.key === 'width') {
-            item.max = value === 'ratio' ? 100 : 500
-          }
-
-          return item
-        })
-      }, () => {
-        if (this.props.form.getFieldValue('width') !== undefined) {
-          this.props.form.setFieldsValue({width: 32})
         }
       })
     }
@@ -287,11 +267,7 @@
               values.icon = column.icon
               values.color = column.color
 
-              values.avatarWidth = values.size
-            } else if (values.widthType === 'absolute') {
-              values.avatarWidth = values.width
-            } else {
-              values.avatarWidth = values.width + '%'
+              values.width = values.size
             }
           }
 

--
Gitblit v1.8.0