修改更新列表后刷新逻辑

This commit is contained in:
whyour
2023-01-31 23:52:02 +08:00
parent 4d34e0dd96
commit b01f27f2d3
2 changed files with 3 additions and 36 deletions
+1 -15
View File
@@ -323,7 +323,7 @@ const Env = () => {
const handleCancel = (env?: any[]) => {
setIsModalVisible(false);
env && handleEnv(env);
getEnvs();
};
const handleEditNameCancel = (env?: any[]) => {
@@ -331,20 +331,6 @@ const Env = () => {
getEnvs();
};
const handleEnv = (env: any) => {
const result = [...value];
const index = value.findIndex((x) => x.id === env.id);
if (index === -1) {
env = Array.isArray(env) ? env : [env];
result.push(...env);
} else {
result.splice(index, 1, {
...env,
});
}
setValue(result);
};
const vComponents = useMemo(() => {
return VList({
height: tableScrollHeight!,