From 59db6fab9c1ed1fa5559d423d439e14ea33b1598 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 27 四月 2023 11:18:24 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/custom/components/module/account/index.jsx | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/tabviews/custom/components/module/account/index.jsx b/src/tabviews/custom/components/module/account/index.jsx index 4996d2c..a4f2cb1 100644 --- a/src/tabviews/custom/components/module/account/index.jsx +++ b/src/tabviews/custom/components/module/account/index.jsx @@ -25,6 +25,7 @@ componentDidMount () { this.loadData() + MKEmitter.addListener('reloadData', this.reloadData) } shouldComponentUpdate (nextProps, nextState) { @@ -37,6 +38,20 @@ componentWillUnmount () { this.setState = () => { return + } + MKEmitter.removeListener('reloadData', this.reloadData) + } + + reloadData = (menuId) => { + const { config } = this.props + const { activeItem } = this.state + + if (config.uuid !== menuId) return + + if (activeItem) { + MKEmitter.emit('resetSelectLine', config.uuid, activeItem.id, activeItem) + } else { + this.loadData() } } @@ -171,7 +186,7 @@ return ( <div className="menu-account-wrap" style={config.style}> - {config.wrap.MenuID ? <Select value={activeItem ? activeItem.id : ''} placeholder="璇烽�夋嫨璐﹀" onChange={this.changeBook} dropdownRender={menu => ( + {config.wrap.MenuID ? <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} value={activeItem ? activeItem.id : ''} placeholder="璇烽�夋嫨璐﹀" onChange={this.changeBook} dropdownRender={menu => ( <div> {menu} <Divider style={{ margin: '4px 0' }} /> @@ -181,11 +196,11 @@ </div> )}> {books.map(item => ( - <Option disabled={!item.months} key={item.id}>{item.account_name}</Option> + <Option disabled={!item.months} title={item.account_name} key={item.id}>{item.account_name}</Option> ))} - </Select> : <Select value={activeItem ? activeItem.id : ''} disabled={config.wrap.readonly === 'true'} placeholder="璇烽�夋嫨璐﹀" onChange={this.changeBook}> + </Select> : <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} value={activeItem ? activeItem.id : ''} disabled={config.wrap.readonly === 'true'} placeholder="璇烽�夋嫨璐﹀" onChange={this.changeBook}> {books.map(item => ( - <Option disabled={!item.months} key={item.id}>{item.account_name}</Option> + <Option disabled={!item.months} title={item.account_name} key={item.id}>{item.account_name}</Option> ))} </Select>} {activeItem ? <span className="date">{activeItem.date}</span> : null} -- Gitblit v1.8.0