import{r as t,F as T,j as s,aE as M,aL as P,ad as p,v,aM as D,B as N,y as J,aN as q,a as B}from"./index-s57B3ha7.js";import C from"./index-XJsuonX4.js";import{D as O}from"./index-DVhD5lce.js";import"./context-BWPM1aaO.js";const G=()=>{const i=t.useRef(null),[r,c]=t.useState("downstream"),[g,m]=t.useState(),[x,d]=t.useState(!1),[a,f]=t.useState(),[n,h]=t.useState(),[j,u]=t.useState(!1),[l]=T.useForm(),[S,A]=t.useState(),[b,F]=t.useState({}),[L,y]=t.useState(!1),[R,_]=t.useState(!1),w=async e=>{y(!0);const o=await B.get(`/find_downstream_analysis/${e}`);F(o.data),y(!1)};return s.jsxs("div",{style:{maxWidth:"1800px",margin:"1rem auto"},children:[s.jsx(M,{style:{marginBottom:"1rem"},justify:"flex-end",align:"center",gap:"small",children:s.jsx(P.Group,{options:[{label:"下游分析结果",value:"downstream"},{label:"上游分析结果",value:"upstream"}],onChange:({target:{value:e}})=>{console.log(e),c(e)},value:r,optionType:"button",buttonStyle:"solid"})}),s.jsx(p,{title:"下游分析历史记录",ref:i,analysisType:"analysisResult",params:{analysis_type:r},setTableLoading:d,setRecord:e=>{const o=JSON.parse(e.request_param);console.log(o),f(e),h(o)},setTabletData:e=>{m(e)}}),s.jsx("div",{style:{marginBottom:"2rem"}}),a&&s.jsxs(s.Fragment,{children:[s.jsx(v,{title:`${a.analysis_name}(${a.analysis_method})`,extra:s.jsx(s.Fragment,{children:s.jsx(N,{onClick:()=>{u(!0),w(n.analysis_method),l.resetFields(),l.setFieldsValue(n),a!=null&&a.id&&l.setFieldValue("id",a==null?void 0:a.id)},children:"重新分析"})}),children:s.jsx(D,{plotLoading:x,filePlot:g})}),s.jsx("hr",{}),s.jsx(C,{params:{obj_key:a.analysis_method,obj_type:"analysis_img"}}),s.jsxs(O,{loading:L,title:`重新分析 - ${a.analysis_name}`,open:j,onClose:()=>u(!1),width:"50%",children:[s.jsx(p,{title:"输出文件",analysisType:r,analysisMethod:[n.inputAnalysisMenthod],shouldTrigger:!0,setResultTableList:A}),s.jsx(J,{spinning:R,children:s.jsx(q,{form:l,resultTableList:S,formJson:b.formJson,sampleGroupApI:!1,moduleName:n.moduleName,params:n.params,setPlotLoading:e=>{d(e),_(e)},activeTabKey:n.inputAnalysisMenthod.name,inputAnalysisMethod:n.inputAnalysisMenthod,saveAnalysisMethod:n.analysis_method,project:n.project,setFilePlot:m,plotReloadTable:()=>{i.current&&i.current.reload()}})})]})]})]})};export{G as default};
