From 0173a5b8b4cb7d537f5e0d71c414ed1e6e92a725 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 27 四月 2025 11:59:56 +0800 Subject: [PATCH] 2025-04-27 --- src/templates/sharecomponent/searchcomponent/index.jsx | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index 37498c6..5e6ae12 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -61,6 +61,18 @@ }, () => { this.handleSearch(item) }) + } else if (type === 'replace') { + delete item.focus + this.setState({ + searchlist: searchlist.map(cell => { + if (cell.field && cell.field.toLowerCase() === item.field.toLowerCase()) { + return item + } + return cell + }), + }, () => { + this.handleSearch(item) + }) } else if (type === 'multil') { let list = [...searchlist, ...item] list = list.filter(item => !item.origin) // 鍘婚櫎绯荤粺椤� @@ -247,19 +259,19 @@ */ deleteElement = (card) => { const { config } = this.props - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { - let _searchlist = fromJS(_this.state.searchlist).toJS() + let _searchlist = fromJS(that.state.searchlist).toJS() _searchlist = _searchlist.filter(item => item.uuid !== card.uuid) - _this.setState({ + that.setState({ searchlist: _searchlist }, () => { - _this.props.updatesearch({...config, search: _searchlist}) + that.props.updatesearch({...config, search: _searchlist}) }) }, onCancel() {} @@ -327,7 +339,7 @@ let size = '' if (config.wrap && config.wrap.searchSize) { - size = ' mk-size-' + config.wrap.searchSize + size = ' mk-order-' + config.wrap.searchSize } return ( -- Gitblit v1.8.0