From 790dfe8172be5027940a04594224531d15143389 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 12 十二月 2019 19:30:30 +0800
Subject: [PATCH] 2019-12-12

---
 src/templates/comtableconfig/editcard/index.jsx |   31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/src/templates/comtableconfig/editcard/index.jsx b/src/templates/comtableconfig/editcard/index.jsx
index bb0e5e5..6107cb4 100644
--- a/src/templates/comtableconfig/editcard/index.jsx
+++ b/src/templates/comtableconfig/editcard/index.jsx
@@ -1,5 +1,5 @@
 import React, {Component} from 'react'
-import { Row, Col, Icon, Radio, Input } from 'antd'
+import { Row, Col, Icon, Radio, Input, Button } from 'antd'
 import './index.scss'
 
 const { Search } = Input
@@ -49,8 +49,8 @@
       <div className={'ant-card ant-card-bordered ' + (card.selected ? 'selected' : '')} >
         <div className="base" onClick={this.changeSelect}>
           <Icon type="check" />
-          <p title={card.field}>瀛楁锛� <span>{card.field}</span></p>
-          <p title={card.label}>鍚嶇О锛� <span>{card.label}</span></p>
+          <p title={card.field}>{this.props.dict['header.form.field']}锛� <span>{card.field}</span></p>
+          <p title={card.label}>{this.props.dict['header.form.name']}锛� <span>{card.label}</span></p>
         </div>
         {type === 'search' ?
           <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}>
@@ -78,7 +78,8 @@
       dataSource: props.data,
       selectCards: props.data.filter(item => item.selected),
       type: props.type,
-      searchKey: ''
+      searchKey: '',
+      loading: false
     }
   }
 
@@ -101,14 +102,30 @@
     })
   }
 
+  reset = () => {
+    this.setState({
+      searchKey: '',
+      loading: true
+    }, () => {
+      this.setState({
+        loading: false
+      })
+    })
+  }
+
   render() {
-    const { dataSource, type } = this.state
+    const { dataSource, type, loading } = this.state
 
     return (
       <div className="common-modal-edit-card">
         <Row className="search-row">
           <Col span={8}>
-            <Search placeholder="璇疯緭鍏ュ瓧娈靛悕" onSearch={value => {this.setState({searchKey: value})}} enterButton />
+            {!loading ? <Search placeholder={this.props.dict['header.form.field.placeholder']} onSearch={value => {this.setState({searchKey: value})}} enterButton /> : null}
+          </Col>
+          <Col span={8}>
+            <Button onClick={this.reset}>
+              {this.props.dict['header.reset']}
+            </Button>
           </Col>
         </Row>
         <Row>
@@ -116,7 +133,7 @@
             if (item.field.toLowerCase().indexOf(this.state.searchKey.toLowerCase()) >= 0) {
               return (
                 <Col key={index} span={8}>
-                  <EditCardCell ref={'cellCard' + index} type={type} card={item} changeCard={this.changeCard} />
+                  <EditCardCell ref={'cellCard' + index} type={type} card={item} dict={this.props.dict} changeCard={this.changeCard} />
                 </Col>
               )
             } else {

--
Gitblit v1.8.0