This commit is contained in:
ilia 2022-10-22 23:11:32 +03:00
parent d44202eed4
commit 45202a31f0
3 changed files with 2436 additions and 5 deletions

View File

@ -5,6 +5,5 @@ import { host } from "./consts"
export const fetcher = axios.create( export const fetcher = axios.create(
{ {
baseURL: host, baseURL: host,
timeout: 60000
} }
) )

2423
yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -51,14 +51,23 @@ export const Search: React.FC<{onData:(data:any)=>void}> = (props) =>{
setTags(tags.concat([tag])) setTags(tags.concat([tag]))
} }
const onSelect = (value:string, type:INode) =>{ const onSelect = (value:string, type:any) =>{
addTag(type) const vts = value.split('--');
dispatch(createNode(type)); addTag({
'type': vts[1],
'value': vts[0]
})
dispatch(createNode({
'type': vts[1],
'value': vts[0]
}));
setAutoCompleteValue("") setAutoCompleteValue("")
} }
const onEnter = (value:any) => { const onEnter = (value:any) => {
console.log(getNodes);
dispatch( dispatch(
search( search(
getNodes.concat( getNodes.concat(
@ -100,7 +109,7 @@ export const Search: React.FC<{onData:(data:any)=>void}> = (props) =>{
{bold_str.toLocaleLowerCase () == autoCompleteValue.toLowerCase() ? <strong>{bold_str}</strong> : <span>{bold_str}</span>} {bold_str.toLocaleLowerCase () == autoCompleteValue.toLowerCase() ? <strong>{bold_str}</strong> : <span>{bold_str}</span>}
<span>{after_str}</span> <span>{after_str}</span>
</div>, </div>,
value: e.value.value value: e.value.value + '--' + e.value.type
} }
})} })}
onSelect={onSelect as any} onSelect={onSelect as any}