Commit 2b70cd9c authored by 皮倩雯's avatar 皮倩雯

fix: '修改台账管理搜索功能'

parent 9f0738a3
Pipeline #48443 skipped with stages
...@@ -180,7 +180,7 @@ const StandingBook = props => { ...@@ -180,7 +180,7 @@ const StandingBook = props => {
setShowSearchStyle(false); setShowSearchStyle(false);
// 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示 // 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
flag === 0 ? setPickItem(newArr[0]) : setPickItem(pickItem); flag === 0 ? setPickItem(newArr[0]) : setPickItem(pickItem);
pickItem ? setPickItem(pickItem) : setPickItem(newArr[0]); // pickItem ? setPickItem(pickItem) : setPickItem(newArr[0]);
console.log(newArr, 'newArr'); console.log(newArr, 'newArr');
setTableData(newArr); setTableData(newArr);
} }
...@@ -271,8 +271,8 @@ const StandingBook = props => { ...@@ -271,8 +271,8 @@ const StandingBook = props => {
console.log(arr); console.log(arr);
setShowSearchStyle(true); setShowSearchStyle(true);
setAllData(arr); setAllData(arr);
setSearchData(res.data.root); setSearchData(res.data.root[pickItem]);
setPickItem(''); // setPickItem('');
// 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示 // 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
// flag === 0 ? setPickItem(newArr[0]) : setPickItem(pickItem); // flag === 0 ? setPickItem(newArr[0]) : setPickItem(pickItem);
console.log(newArr, 'newArr'); console.log(newArr, 'newArr');
...@@ -282,7 +282,11 @@ const StandingBook = props => { ...@@ -282,7 +282,11 @@ const StandingBook = props => {
}; };
const handleSearch = e => { const handleSearch = e => {
console.log(e.target.value);
setSearchWord(e.target.value); setSearchWord(e.target.value);
if (e.target.value == '') {
handleReset();
}
}; };
// 模糊查询匹配的样式 // 模糊查询匹配的样式
...@@ -359,7 +363,7 @@ const StandingBook = props => { ...@@ -359,7 +363,7 @@ const StandingBook = props => {
}} }}
key={index} key={index}
> >
{item}{allData[item] ? allData[item].length : ''} {item}{allData[item] ? allData[item].length : 0}
</div> </div>
); );
})} })}
...@@ -398,10 +402,11 @@ const StandingBook = props => { ...@@ -398,10 +402,11 @@ const StandingBook = props => {
onSearch={onSearch} onSearch={onSearch}
onChange={e => handleSearch(e)} onChange={e => handleSearch(e)}
value={searchWord} value={searchWord}
allowClear
/> />
<Button icon={<SyncOutlined />} onClick={handleReset}> {/* <Button icon={<SyncOutlined />} onClick={handleReset}>
重置 重置
</Button> </Button> */}
</div> </div>
<div style={{ marginTop: '10px' }}> <div style={{ marginTop: '10px' }}>
<Table <Table
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Description: * @Description:
* @Author: leizhe * @Author: leizhe
* @Date: 2022-01-13 10:47:32 * @Date: 2022-01-13 10:47:32
* @LastEditTime: 2022-03-25 10:28:02 * @LastEditTime: 2022-04-22 11:45:53
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
/* eslint-disable indent */ /* eslint-disable indent */
...@@ -63,7 +63,7 @@ const VectorData = props => { ...@@ -63,7 +63,7 @@ const VectorData = props => {
</Button> </Button>
</div> </div>
<Spin tip="loading..." spinning={treeLoading}> <Spin tip="loading..." spinning={treeLoading}>
<div style={{ height: 'calc(100vh - 230px)', overflow: 'scroll', width: '100%' }}> <div style={{ height: 'calc(100vh - 230px)', width: '100%' }}>
<div className={styles.cardsList}> <div className={styles.cardsList}>
{tileData && tileData.length {tileData && tileData.length
? tileData.map((item, index) => { ? tileData.map((item, index) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment