From 836722dd114fa35967a5e96be96ba4503ebf8e1d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 29 十二月 2022 17:29:11 +0800
Subject: [PATCH] 2022-12-29

---
 src/tabviews/custom/components/module/voucher/voucherTable/index.jsx |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx b/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx
index d4bb231..c7d0383 100644
--- a/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx
+++ b/src/tabviews/custom/components/module/voucher/voucherTable/index.jsx
@@ -1,8 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Table, Modal, Input, InputNumber, notification, message } from 'antd'
-// import { EditOutlined } from '@ant-design/icons'
+import { Table, Modal, Input, InputNumber, notification, message, AutoComplete } from 'antd'
 
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
@@ -120,6 +119,10 @@
     this.setState({value: val})
   }
 
+  complete = (key, option) => {
+    this.setState({value: option.props.value})
+  }
+
   render() {
     let { col, record, className } = this.props
     const { editing } = this.state
@@ -135,7 +138,18 @@
         colSpan = 2
       } else {
         if (editing) {
-          children = <Input.TextArea id={col.uuid + record.uuid} autoSize={false} defaultValue={val} onChange={(e) => this.onChange(e.target.value)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
+          let options = ['鐜伴噾', '鍙戠エ']
+          children = <AutoComplete
+            dataSource={options.map((cell, i) => <AutoComplete.Option value={cell} key={i}>
+              {cell}
+            </AutoComplete.Option>)}
+            filterOption={(input, option) => option.props.children.indexOf(input) > -1}
+            onSelect={this.complete}
+            defaultValue={val}
+            defaultOpen={true}
+          >
+            <Input.TextArea id={col.uuid + record.uuid} autoSize={false} defaultValue={val} onChange={(e) => this.onChange(e.target.value)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
+          </AutoComplete>
         } else {
           children = <div className="content-wrap" onClick={this.focus}>{val}</div>
         }

--
Gitblit v1.8.0