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(
{
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]))
}
const onSelect = (value:string, type:INode) =>{
addTag(type)
dispatch(createNode(type));
const onSelect = (value:string, type:any) =>{
const vts = value.split('--');
addTag({
'type': vts[1],
'value': vts[0]
})
dispatch(createNode({
'type': vts[1],
'value': vts[0]
}));
setAutoCompleteValue("")
}
const onEnter = (value:any) => {
console.log(getNodes);
dispatch(
search(
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>}
<span>{after_str}</span>
</div>,
value: e.value.value
value: e.value.value + '--' + e.value.type
}
})}
onSelect={onSelect as any}