浏览代码

fix(network): #3753 类型选项切换后,清空配置数据

Lind 4 年之前
父节点
当前提交
d3bade8481
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/pages/link/Type/Save/index.tsx

+ 4 - 0
src/pages/link/Type/Save/index.tsx

@@ -102,6 +102,10 @@ const Save = observer(() => {
         effects() {
           onFieldValueChange('type', (field, f) => {
             const value = (field as Field).value;
+            f.deleteValuesIn('configuration');
+            f.deleteValuesIn('cluster');
+            f.clearErrors();
+
             const _host = filterConfigByType(_.cloneDeep(configRef.current), value);
             f.setFieldState('grid.configuration.panel1.layout2.host', (state) => {
               state.dataSource = _host.map((item) => ({ label: item.host, value: item.host }));