Fix: Bugs fixed #10703 (#11132)

### What problem does this PR solve?

Fix: Bugs fixed #10703

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-11-10 14:12:45 +08:00
committed by GitHub
parent d207291217
commit 726473fd39
8 changed files with 69 additions and 623 deletions

View File

@ -81,31 +81,34 @@ export const GobalParamSheet = (props: IGobalParamModalProps) => {
const { saveGraph, loading } = useSaveGraph();
const handleSubmit = (value: FieldValues) => {
const handleSubmit = async (value: FieldValues) => {
const param = {
...(data.dsl?.variables || {}),
[value.name]: value,
} as Record<string, GobalVariableType>;
saveGraph(undefined, {
const res = await saveGraph(undefined, {
gobalVariables: param,
});
if (!loading) {
setTimeout(() => {
refetch();
}, 500);
if (res.code === 0) {
refetch();
}
hideAddModal();
};
const handleDeleteGobalVariable = (key: string) => {
const handleDeleteGobalVariable = async (key: string) => {
const param = {
...(data.dsl?.variables || {}),
} as Record<string, GobalVariableType>;
delete param[key];
saveGraph(undefined, {
const res = await saveGraph(undefined, {
gobalVariables: param,
});
refetch();
console.log('delete gobal variable-->', res);
if (res.code === 0) {
refetch();
}
};
const handleEditGobalVariable = (item: FieldValues) => {