From 7ea1c5f53702951fc4df60e969fc67ef5d7af4dd Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 14 一月 2020 10:13:05 +0800
Subject: [PATCH] 2020-01-14

---
 src/templates/modalconfig/dragelement/card.jsx |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/templates/modalconfig/dragelement/card.jsx b/src/templates/modalconfig/dragelement/card.jsx
index ea5c8e2..d1fda91 100644
--- a/src/templates/modalconfig/dragelement/card.jsx
+++ b/src/templates/modalconfig/dragelement/card.jsx
@@ -8,7 +8,7 @@
 const { MonthPicker } = DatePicker
 const { TextArea } = Input
 
-const Card = ({ id, card, moveCard, findCard, editCard, closeCard, hasDrop }) => {
+const Card = ({ id, card, cols, moveCard, findCard, editCard, closeCard, hasDrop }) => {
   const originalIndex = findCard(id).index
   const [{ isDragging }, drag] = useDrag({
     item: { type: ItemTypes.form, id, originalIndex },
@@ -55,15 +55,26 @@
       selectval = '鍏ㄩ儴'
     }
   }
+  let labelCol = 'ant-col-sm-8'
+  let wrapCol = 'ant-col-sm-16'
+  if (card.type === 'textarea') {
+    if (cols === '2') {
+      labelCol = 'ant-col-sm-4'
+      wrapCol = 'ant-col-sm-20'
+    } else if (cols === '3') {
+      labelCol = 'ant-col-cuslabel'
+      wrapCol = 'ant-col-cuswrap'
+    }
+  }
 
   return (
     <div className="page-card" style={{ opacity: opacity}}>
       <div ref={node => drag(drop(node))}>
         {<div className="ant-row ant-form-item">
-          <div className="ant-col ant-form-item-label ant-col-xs-24 ant-col-sm-8">
+          <div className={'ant-col ant-form-item-label ant-col-xs-24 ' + labelCol}>
             <label title={card.label}>{card.label}</label>
           </div>
-          <div className="ant-col ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-16">
+          <div className={'ant-col ant-form-item-control-wrapper ant-col-xs-24 ' + wrapCol}>
             {card.type === 'text' &&
               <Input style={{marginTop: '4px'}} defaultValue={card.initval} />
             }
@@ -83,7 +94,7 @@
               <DatePicker showTime defaultValue={card.initval ? moment().subtract(card.initval, 'days') : null} />
             }
             {card.type === 'textarea' &&
-              <TextArea autoSize={{ minRows: 2, maxRows: 6 }} />
+              <TextArea autosize={{ minRows: 2, maxRows: 6 }} />
             }
             {card.type === 'fileupload' &&
               <Button>

--
Gitblit v1.8.0