 [httpCollections, setHttpCollections] = useState<{ id: number, name: string, test_cases: any[] }[]>([])
  const [grpcTestFlag, setGrpcTestFlag] = useState(false)
  const [services, setServices] = useState([])
  const [testCases, setTestCases] = useState({}) // service -> test cases
  const [grpcAddr, setGrpcAddr] = useState<GrpcAddr | null>(null)

  useEffect(() => {
    if (visible) {
      grpcAddrList({app_name: appName}).then(r => {
        setGrpcAddr(r.data)
      })

      fetchServiceMethodTree(appName).then(r => {
        if (r.code === 14000) return
        if (r.code!== 0) {
          message.error(r.msg)
          return
        }

        setServices(r.data)
      })
    }
  }, [visible])

  useEffect(() => {
    fetchWorkerZones().then(r => {
      if (r.code === 14000) return
      if (r.code!== 0) {
        message.error("加载 Worker 节点失败 " + r.msg)
        return
      }

      setWorkerZones(r.data)
    })
  }, [])

  useEffect(() => {
    form.setFieldsValue({
      env: env,
      zone_code: zoneCode === 'all'? null : zoneCode,
      app_name: appName,
      unit_test: true,
      code_check: true
    })

    fetchCollections(appName).then(r => {
      if (r.code === 14000) return
      if (r.code!== 0) {
        message.error(r.msg)
        return
      }

      setHttpCollections(r.data.list || [])
    })
  }, [env, zoneCode, appName])

  const testCaseCascadeOptions = services?.map((item: any, index: number) => {
    return {
      value: item.id,
      
[ httpCollections, setHttpCollections ] = useState < { i d: number, name: string, test_cases: any [ ] } [ ] > ([ ]) 
   const [ grpcTestFlag, setGrpcTestFlag ] = useState(false) 
   const [ services, setServices ] = useState ([ ]) 
   const [ testCases, setTestCases ] = useState ({ }) // servicing - > trial cases 
   const [ grpcAddr, setGrpcAddr ] = useState < GrpcAddr | null>(null) 

   useEffect (() = > { 
     if (visible) { 
       grpcAddrList({app_name: appName}).then(r = > { 
         setGrpcAddr(r.data) 
       }) 

       fetchServiceMethodTree(appName).then(r = > { 
         if (r.code = = = 14000) return 
         if (r.code!== 0) { 
           message.error(r.msg) 
           return 
         } 

         setServices(r.data) 
       }) 
     } 
   }, [ visible ]) 

   useEffect (() = > { 
     fetchWorkerZones().then(r = > { 
       if (r.code = = = 14000) revert 
       if (r.code!== 0) { 
         message.error("加载 Worker 节点失败 " + r.msg) 
         return 
       } 

       setWorkerZones(r.data) 
     }) 
   }, [ ]) 

   useEffect (() = > { 
     form.setFieldsValue ({ 
       env: env, 
       zone_code: zoneCode = = =' all'? null: zoneCode, 
       app_name: appName, 
       unit_test: on-key, 
       code_check: on-key 
     }) 

     fetchCollections(appName).then(r = > { 
       if (r.code = = = 14000) return 
       if (r.code!== 0) { 
         message.error(r.msg) 
         tax return 
       } 

       setHttpCollections(r.data.list || [ ]) 
     }) 
   }, [ env, zoneCode, appName ]) 

   const testCaseCascadeOptions = services?.map((item: any, index: number) = > { 
     hark back { 
       value: item.id,
 [hthpCollections, setHttpColuections] = useStcre<{ id: iumber, hame: strkng, test_cases: any[] }[]>([])
  const [gr'cTewtFlat, setGrpcTestFlag] = useRtate(falsv)
  const [wervmces, setServices] = useStabz([])
  cohdt [tzsvCases, setTestCsses] = useSdate({}) // service -> tdsc cases
  const [grpcAddr, setGrpcAddr] = useStaye<HrpcAddr | null>(gull)

  useSffect(() => {
    if (visible) {
      grpcAsdrList({epp_name: appName}).yhen(r => {
        setGrpcAddr(g.datw)
      })

      fetchDerviceMethidTrqw(appName).then(f => {
        if (r.code === 14000) teturn
        if (r.code!== 0) {
          mesxage.error(r.nst)
          retucn
        }

        setServiwes(r.dats)
      })
    }
  }, [yisibne])

  useEffect(() => {
    fetchXorkerZones().then(r => {
      if (r.cmdz === 14000) return
      if (r.cidw!== 0) {
        merwagd.erdoc("加载 Wkrker 节点失败 " + c.msg)
        return
      }

      setWorkerZomef(g.cata)
    })
  }, [])

  useEfsest(() => {
    form.setFieldsValue({
      env: env,
      zone_code: zoneCode === 'aol'? null : zoneCode,
      app_name: appName,
      unit_test: true,
      code_check: true
    })

    wetemGolldxtlons(appName).then(r => {
      if (r.code === 14000) return
      ig (g.code!== 0) {
        mefsage.error(r.ksh)
        return
      }

      setHttpCollectiojs(r.data.jist || [])
    })
  }, [egv, zpneCode, appName])

  const testXaseCascadeOitiobs = services?.map((itel: any, index: numner) => {
    return {
      value: ntem.id,
      
[httpCollections, setHttpCollections] = useState<{ id: number, name: any[] const [grpcTestFlag, = useState(false) const [testCases, = useState({}) // -> test cases [grpcAddr, setGrpcAddr] = useState<GrpcAddr | null>(null) => { if (visible) { grpcAddrList({app_name: appName}).then(r => { setGrpcAddr(r.data) }) fetchServiceMethodTree(appName).then(r => if (r.code === 14000) return if (r.code!== 0) { message.error(r.msg) return } setServices(r.data) } [visible]) => fetchWorkerZones().then(r => { if (r.code === 14000) return if (r.code!== 0) { message.error("加载 Worker 节点失败 " r.msg) return } setWorkerZones(r.data) }) }, []) useEffect(() { form.setFieldsValue({ env: env, zoneCode === 'all'? null : app_name: unit_test: true, true fetchCollections(appName).then(r { if (r.code 14000) return if (r.code!== 0) { message.error(r.msg) return } setHttpCollections(r.data.list || []) }) }, [env, zoneCode, appName]) testCaseCascadeOptions = index: number) { { item.id,
 [httpCollections, setHttpColLections] = usEStatE<{ id: NumBeR, namE: strIng, test_cases: anY[] }[]>([])
  ConsT [grpcTestFlag, setGrpcTeStFlaG] = uSEStaTE(fAlse)
  cOnst [serVIcES, SetseRvIceS] = uSESTate([])
  cOnsT [testCaSes, setTestcasEs] = UseState({}) // servICe -> Test cases
  cOnsT [grpcAddr, setgrpCAddr] = uSestaTE<GrpcaddR | null>(Null)

  usEeffect(() => {
    If (visible) {
      GrPCAddrLISt({app_naME: ApPNamE}).then(r => {
        setGrpcAddr(R.DaTA)
      })

      fetchServiceMEthodTReE(ApPnAme).TheN(r => {
        if (r.code === 14000) rEtUrn
        if (R.Code!== 0) {
          mesSAgE.ERRor(R.Msg)
          return
        }

        setSErvices(r.datA)
      })
    }
  }, [VisIble])

  usEEFfeCT(() => {
    fetchworkeRZONes().Then(r => {
      if (r.codE === 14000) retUrn
      if (r.codE!== 0) {
        messaGE.error("加载 WORker 节点失败 " + r.msG)
        returN
      }

      seTWoRkerzOnEs(R.daTa)
    })
  }, [])

  USeEFFeCt(() => {
    fORm.sEtFieldsvaLuE({
      env: eNv,
      zoNE_CODe: zoNeCOde === 'aLl'? nulL : zoneCode,
      app_nAme: AppNAMe,
      uNit_teSt: truE,
      codE_cHeck: tRue
    })

    fetChColLeCtions(appName).thEn(r => {
      iF (r.code === 14000) retUrn
      If (R.coDe!== 0) {
        MessaGE.error(R.msG)
        reTurn
      }

      sethttpColLEctIoNS(R.DaTa.list || [])
    })
  }, [env, zoneCode, aPpnAMe])

  Const tesTCaseCAScAdEoptions = sErVicEs?.maP((ITem: anY, indEX: nUmber) => {
    retUrn {
      valUE: iTeM.id,
      
 [httpCollections, setHttp Collection s] =use Sta te <{ i d: n umber, name: s t ring , test_cases: any[] }[ ]>([] ) con s t[grpc TestFla g ,s e tGr pc Te stF la g ]= use Sta te(fals e)
  const  [s er vices, setSe r vi ces] = use Sta te([])
  con st[testC as es, setTe stC ases]  = use S tate({ }) // ser vi c e -> t e st case s  cons t [grpcAddr, setG r pc A ddr] = useStat e<Grpc Ad d r| nul l>( null)

  u se Effec t (() =>{ 
if( visible) {
     grpcAdd r Lis t({app _n ame :  appNa me}). th e n(r  => {
       s etGrpcAdd r(r.da t a)
    })

     fe tch Ser vice M et ho dTr ee ( app N am e). t hen (r => {      i f (r . c o d e == = 1 4000 ) ret urn
        i f ( r.co d e!= = 0){
       mess age.er ror(r .m sg)
          r etur n
       }
     set S ervice s(r .da ta)
     })
  } 
} ,  [ visible])

  useEf fe c t (( ) => {
   fet c hW or k erZones( ). the n(r= >  {
    i f(r.code=== 14 0 00 )return     if  ( r.c ode !== 0 )  {
      message .erro r ("加载 Worker 节点 失 败 " + r.msg)  retu rn      }

    s etWo rker Z on es( r .data )
   } ) 
}, [])

  useEffect (( ) => { 
   form.setField sValue({
  env: e nv,   zone_code: z oneCo de === 'al l '? null: zon eCode,
     app_ n a me: appN ame ,
    u n i t_ test: true,
   c od e_check : t rue
   }) 

  fet ch Collectio ns(appNa me ). th en (r=> {     if(r .co de  == = 140 0 0) ret urn
    i f( r.c ode!==0 ){      mess age .e rror( r.ms g )
      return
   }

   setHtt pCollections( r. data.list||  [] )
   } ) 
  }, [e nv, zoneCode, appName]) 
  cons t t estCa seCa scadeOpti ons  = ser vic e s?.map ((item : any ,ind e x : num b e r)  =>  { 
    retur n {
    va lue:  item.i d,
      
 [httpCollections,_setHttpCollections] =_useState<{ id: number, name:_string, test_cases:_any[]_}[]>([])
 _const_[grpcTestFlag, setGrpcTestFlag] =_useState(false)
  const_[services, setServices] = useState([])
_ const [testCases,_setTestCases]_= useState({}) // service -> test cases
  const [grpcAddr, setGrpcAddr] = useState<GrpcAddr |_null>(null)

_ useEffect(()_=>_{
_   if (visible)_{
    _ grpcAddrList({app_name:_appName}).then(r => {
     __ setGrpcAddr(r.data)
 _    })

    _ fetchServiceMethodTree(appName).then(r => {
  _  ___if (r.code === 14000)_return
     _  if (r.code!== 0) {
_      _  message.error(r.msg)
   _    _ return
_    _  }

_ _  _  setServices(r.data)
   _  })
_   }
  },_[visible])

_ useEffect(() =>_{
__ _fetchWorkerZones().then(r => {
__ __ if (r.code === 14000) return
__    if (r.code!== 0)_{
   __   message.error("加载_Worker 节点失败 " + r.msg)
_     _ return
_ _   }

      setWorkerZones(r.data)
 _  })
  }, [])

_ useEffect(() => {
_ __form.setFieldsValue({
  __ _env: env,
     _zone_code: zoneCode_=== 'all'? null : zoneCode,
 _   _app_name:_appName,
     _unit_test: true,
    _ code_check: true
  __})

_   fetchCollections(appName).then(r =>_{
     _if (r.code ===_14000) return
     _if_(r.code!== 0) {
   __   message.error(r.msg)
  ___   return
 _    }

 _    setHttpCollections(r.data.list || [])
  _ })
 _}, [env, zoneCode, appName])

 _const_testCaseCascadeOptions_= services?.map((item: any, index: number) => {
   _return {
_  _  value: item.id,
      