From 4c775de9de07291b345fd5c975a87230ddedd5ca Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 20 五月 2020 09:27:13 +0800
Subject: [PATCH] 2020-05-20

---
 src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx |   36 ++++++++++++++++++++++++++++--------
 1 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx b/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx
index b42e6de..47f4fce 100644
--- a/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx
+++ b/src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx
@@ -121,7 +121,7 @@
     {
       uuid: 'card3',
       url: card3,
-      subelement: ['content', 'avatar', 'header', 'actions']
+      subelement: ['content', 'avatar', 'header', 'bottom']
     }
   ]
 }
@@ -157,8 +157,11 @@
         _selectlegend = _legends[0]
       }
     } else if (_type === 'card') {
-      _legends = syslegends[_type]
-      _selectlegend = _legends.filter(item => item.uuid === card.cardType)[0]
+      _legends = syslegends.card
+
+      if (card.subelement) {
+        _selectlegend = _legends.filter(item => JSON.stringify(item.subelement) === JSON.stringify(card.subelement))[0]
+      }
 
       if (!_selectlegend) {
         _selectlegend = _legends[0]
@@ -177,6 +180,8 @@
           item.hidden = false
         } else if (item.key === 'over' && _type === 'card') {
           item.hidden = false
+        } else if (item.key === 'bgfield') {
+          item.hidden = _type !== 'card'
         }
         return item
       })
@@ -223,6 +228,8 @@
             item.hidden = false
           } else if (item.key === 'over' && value === 'card') {
             item.hidden = false
+          } else if (item.key === 'bgfield') {
+            item.hidden = value !== 'card'
           }
           return item
         })
@@ -421,16 +428,29 @@
 
             if (!result.details) {
               result.details = [
-                {bold: 'true', uuid: 'cardtitle', content: 'Card title', datatype: 'static', align: 'left'},
-                {bold: 'false', uuid: 'carddescription', content: 'Card content', datatype: 'static', align: 'left'}
+                {elemType: 'detail', bold: 'true', uuid: 'cardtitle', content: 'Card title', datatype: 'static', align: 'left'},
+                {elemType: 'detail',bold: 'false', uuid: 'carddescription', content: 'Card content', datatype: 'static', align: 'left'}
               ]
-              result.actions = [{icon: 'edit'}, {icon: 'plus'}]
+              result.bottom = {
+                elemType: 'bottom',
+                show: 'icon',
+                actions: []
+              }
               result.header = {
+                elemType: 'header',
                 content: 'Card title',
                 datatype: 'static',
                 actions: []
               }
-              result.avatar = {content: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', datatype: 'static', width: 32, height: 32}
+              result.avatar = {
+                elemType: 'avatar',
+                content: '',
+                type: 'picture',
+                field: '',
+                size: 14,
+                widthType: 'absolute',
+                width: 32
+              }
             }
           }
 
@@ -457,7 +477,7 @@
       }
     }
     return (
-      <Form {...formItemLayout} className="chart-edit-form" id="chartwinter">
+      <Form {...formItemLayout} className="chart-edit-form mingke-table" id="chartwinter">
         <Row gutter={24}>{this.getFields()}</Row>
         {legends ? <Row gutter={24} className="chart-model-image">
           {legends.map(item => <Col span={6} key={item.uuid}>

--
Gitblit v1.8.0