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 |   49 ++++++++++++++++++++++++++++++-------------------
 1 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx b/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx
index 8f97ec6..14338af 100644
--- a/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx
+++ b/src/templates/sharecomponent/fieldscomponent/editcard/index.jsx
@@ -1,6 +1,7 @@
 import React, {Component} from 'react'
 import { is, fromJS } from 'immutable'
-import { Row, Col, Icon, Radio, Input, Button } from 'antd'
+import { Row, Col, Radio, Input, Button } from 'antd'
+import { CheckOutlined } from '@ant-design/icons'
 import './index.scss'
 
 const { Search } = Input
@@ -10,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 = {
@@ -66,10 +75,13 @@
 
   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}>
-          <Icon type="check" />
+          <CheckOutlined />
           <p title={card.field}>瀛楁锛� <span>{card.field}</span></p>
           <p title={card.label}>鍚嶇О锛� <span>{card.label}</span></p>
         </div>
@@ -77,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>
@@ -156,7 +167,7 @@
       <div className="common-modal-edit-card">
         <Row className="search-row">
           <Col span={8}>
-            <Search placeholder="璇疯緭鍏ュ瓧娈�" onSearch={value => {this.setState({searchKey: value})}} enterButton />
+            <Search placeholder="璇疯緭鍏ュ瓧娈�" autoFocus onSearch={value => {this.setState({searchKey: value})}} enterButton />
           </Col>
           <Col span={8}>
             <Button onClick={this.reset}>閲嶇疆</Button>

--
Gitblit v1.8.0