From 07c005cf28acf74e3afde82122e4c53e1000d70c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 12 六月 2023 12:06:18 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/tabviews/custom/components/module/account/index.jsx | 29 ++++++++++++++++++++++------- 1 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/tabviews/custom/components/module/account/index.jsx b/src/tabviews/custom/components/module/account/index.jsx index 14f4937..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() } } @@ -90,13 +105,13 @@ if (!activeItem && Item) { this.setBook(Item) } else if (Item) { - const _this = this + const that = this confirm({ title: '纭畾鍒囨崲璐﹀鍚楋紵', content: '鍒囨崲璐﹀鏃剁郴缁熼渶瑕佸埛鏂般��', onOk() { return new Promise(resolve => { - _this.setBook(Item, resolve) + that.setBook(Item, resolve) }) }, onCancel() {} @@ -115,7 +130,7 @@ let sid = localStorage.getItem('SessionUid') || '' let param = { func: 'sPC_TableData_InUpDe', - LText: `delete tmp_session_show_key where createuserid='${userid}' and createuser='${sid}' and key_type='fcc_years' + LText: `delete tmp_session_show_key where createuserid='${userid}' and key_type='fcc_years' insert into tmp_session_show_key ( key_id,key_type,createuserid,CreateUser,CreateStaff) select '${item.id}','fcc_years','${userid}','${sid}','${sessionStorage.getItem('Full_Name') || ''}'`, exec_type: 'y' @@ -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