From 20185ab64a165df51515d9fa1c9b12a7a8c55f59 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 07 四月 2023 23:11:04 +0800
Subject: [PATCH] 2023-04-07

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

diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx
index 38fbab2..4d8d96f 100644
--- a/src/templates/sharecomponent/fieldscomponent/index.jsx
+++ b/src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -106,10 +106,13 @@
       selectCards.forEach(item => {
         let _match = ''
         let initval = ''
-        if (item.type === 'select') {
+        let _type = item.type
+        if (item.type === 'date') {
+          _type = 'daterange'
+        } else if (item.type === 'select') {
           _match = '='
         } else {
-          item.type = 'text'
+          _type = 'text'
           _match = 'like'
         }
 
@@ -118,7 +121,7 @@
           label: item.label,
           field: item.field,
           initval: initval,
-          type: item.type,
+          type: _type,
           resourceType: '0',
           options: [],
           orderType: 'asc',
@@ -163,7 +166,7 @@
           field: item.field,
           datatype: _t
         }
-        items.push(newcard)
+        items.unshift(newcard)
         keys.push(item.field.toLowerCase())
       })
 
@@ -196,6 +199,7 @@
 
         if (item.type === 'text' && item.length >= 256) {
           newcard.type = 'textarea'
+          newcard.required = 'false'
           newcard.fieldlength = item.length
           if (firstItem) {
             if (firstItem.type === newcard.type) {
@@ -262,9 +266,16 @@
     const { type } = this.props
     const { fields } = this.state
 
+    let label = '鎵归噺娣诲姞'
+    if (type === 'search') {
+      label = '娣诲姞鎼滅储'
+    } else if (type === 'columns') {
+      label = '娣诲姞鏄剧ず鍒�'
+    }
+
     return (
       <div className="quickly-add">
-        <Button type="primary" block onClick={this.queryField}>鎵归噺娣诲姞</Button>
+        <Button type="primary" block onClick={this.queryField}>{label}</Button>
         {/* 鏍规嵁瀛楁鍚嶆坊鍔犳樉绀哄垪鍙婃悳绱㈡潯浠� */}
         <Modal
           wrapClassName="model-table-fieldmanage-modal"

--
Gitblit v1.8.0