Kaynağa Gözat

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

Lind 3 yıl önce
ebeveyn
işleme
d3bade8481
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  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 }));