From e1cee96b38805bcccf48e7bcb9d296f2bc54c720 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 24 一月 2025 11:10:32 +0800
Subject: [PATCH] 2025-01-24

---
 src/templates/sharecomponent/fieldscomponent/editcard/index.jsx |   42 ++++++++++++++++++++++++++----------------
 1 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx b/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx
index c6d82e3..14338af 100644
--- a/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx
+++ b/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx
@@ -11,18 +11,26 @@
     super(props)
 
     let _type = props.card.type
-    if (props.type === 'columns') {
-      if (_type === 'date' || _type === 'datetime') {
-        _type = 'text'
+
+    if (!props.card.origin) {
+      // if (props.type === 'columns') {
+      //   if (_type !== 'number') {
+      //     _type = 'text'
+      //   }
+      // }
+      if (props.type === 'search') {
+        if (_type === 'date' || _type === 'datetime') {
+          _type = 'date'
+        } else if (_type !== 'select') {
+          _type = 'text'
+        }
+      } else if (props.type === 'form') {
+        if (_type === 'datetime' || _type === 'date') {
+          _type = 'date'
+        } else if (_type !== 'number') {
+          _type = 'text'
+        }
       }
-    } else if (props.type === 'search') {
-      if (_type === 'number') {
-        _type = 'text'
-      } else if (_type === 'datetime') {
-        _type = 'daterange'
-      }
-    } else if (props.type === 'form') {
-      
     }
 
     this.state = {
@@ -67,8 +75,11 @@
 
   render() {
     const { card, type } = this.state
+
+    let hasPadding = type === 'search' || type === 'form'
+
     return (
-      <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')  + (card.origin ? ' fixed' : '')} >
+      <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')  + (card.origin ? ' fixed' : '') + (hasPadding ? ' has-padding' : '')} >
         <div className="base" onClick={this.changeSelect}>
           <CheckOutlined />
           <p title={card.field}>瀛楁锛� <span>{card.field}</span></p>
@@ -78,16 +89,15 @@
           <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}>
             <Radio value="text">text</Radio>
             <Radio value="select">select</Radio>
-            <Radio value="daterange">dateRange</Radio>
+            <Radio value="date">date</Radio>
           </Radio.Group> : null
         }
-        {type === 'columns' ?
+        {/* {type === 'columns' ?
           <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}>
             <Radio value="text">text</Radio>
             <Radio value="number">number</Radio>
-            <Radio value="picture">picture</Radio>
           </Radio.Group> : null
-        }
+        } */}
         {type === 'form' ?
           <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected || card.origin}>
             <Radio value="text">text</Radio>

--
Gitblit v1.8.0