Merge branch 'feature_wiki' of http://106.75.45.236:3000/durian/forgeplus-react into gitlink_server

This commit is contained in:
谢思 2023-03-31 15:44:15 +08:00
commit a9e6bb4ec1
1 changed files with 3 additions and 3 deletions

View File

@ -153,7 +153,7 @@ export default (props) => {
function changeSearchValue(value) {
if(value){
// wiki,
let filterList = filterTree(fileList, value);
let filterList = filterTree(fileListInit, value);
setFileList(filterList);
}else{
setFileList(JSON.parse(JSON.stringify(fileListInit)));
@ -163,8 +163,8 @@ export default (props) => {
function filterTree(list, value, arr = []){
if(!list.length) return []
for(let item of list){
const bool = item.title.includes(value);
let node = JSON.parse(JSON.stringify(item))
const bool = item.title.match(new RegExp(value, 'i'));
let node = JSON.parse(JSON.stringify(item));
node.children = [];
bool && arr.push(node);
if(item.children && item.children.length){