Skip to content

Commit

Permalink
feat: 参数配置调整
Browse files Browse the repository at this point in the history
  • Loading branch information
liukaiming-alipay committed Jan 16, 2025
1 parent dec8890 commit bfc36ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions osgraph-web/src/components/project-search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const ProjectSearch: React.FC<{
templateType?: string | any;
getGraphLoading?: (loading: boolean) => void;
graphExtendParams?: Record<string, any>;
onUpdateTemplateId?: (templateId: number) => void;
}> = ({
needFixed,
debounceTimeout = 300,
Expand All @@ -46,6 +47,7 @@ export const ProjectSearch: React.FC<{
graphParameterList,
getGraphLoading,
graphExtendParams,
onUpdateTemplateId,
}) => {
const { t, i18n } = useTranslation();
const navigate = useNavigate();
Expand Down Expand Up @@ -126,6 +128,7 @@ export const ProjectSearch: React.FC<{
};

const handleProjectChange = (value: string, item: any) => {
onUpdateTemplateId?.(item.data.id);
if (
projectValue &&
GRAPH_TYPE_CLUSTER[projectValue as keyof typeof GRAPH_TYPE_CLUSTER] !==
Expand Down
10 changes: 10 additions & 0 deletions osgraph-web/src/result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ export default () => {
return newParams;
}, [extendParams]);

const onUpdateTemplateId = (templateId: number) => {
setState((draft) => {
draft.locationState = {
...locationState,
templateId,
};
});
};

return (
<OSGraph>
<div
Expand Down Expand Up @@ -315,6 +324,7 @@ export default () => {
onSearch={(data: any) => generateShareLink(data)}
getGraphLoading={getGraphLoading}
graphExtendParams={graphExtendParams}
onUpdateTemplateId={onUpdateTemplateId}
/>
<ExtendParams
templateId={templateId}
Expand Down

0 comments on commit bfc36ac

Please sign in to comment.