import{r as a,F as T,j as s,aE as M,aL as P,ad as y,v,aM as D,B as N,y as J,aN as q,a as B}from"./index-COCGZQB3.js";import C from"./index-DLUKcT47.js";import{D as O}from"./index-CtOJ-pPl.js";import"./context-DP9GjKgE.js";const G=()=>{const i=a.useRef(null),[r,c]=a.useState("downstream"),[g,m]=a.useState(),[x,d]=a.useState(!1),[t,f]=a.useState(),[n,h]=a.useState(),[j,u]=a.useState(!1),[o]=T.useForm(),[S,A]=a.useState(),[b,F]=a.useState({}),[L,p]=a.useState(!1),[R,w]=a.useState(!1),_=async e=>{p(!0);const l=await B.get(`/find_downstream_analysis/${e}`);F(l.data),p(!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(y,{title:"下游分析历史记录",ref:i,analysisType:"analysisResult",params:{analysis_type:r},setTableLoading:d,setRecord:e=>{const l=JSON.parse(e.request_param);console.log(l),f(e),h(l)},setTabletData:e=>{m(e)}}),s.jsx("div",{style:{marginBottom:"2rem"}}),t&&s.jsxs(s.Fragment,{children:[s.jsx(v,{title:`${t.analysis_method}`,extra:s.jsx(s.Fragment,{children:s.jsx(N,{onClick:()=>{u(!0),_(n.analysis_method),o.resetFields(),o.setFieldsValue(n),t!=null&&t.id&&o.setFieldValue("id",t==null?void 0:t.id)},children:"重新分析"})}),children:s.jsx(D,{plotLoading:x,filePlot:g})}),s.jsx("hr",{}),s.jsx(C,{params:{obj_key:t.analysis_method,obj_type:"analysis_img"}}),s.jsxs(O,{loading:L,title:`重新分析 - ${t.analysis_name}`,open:j,onClose:()=>u(!1),width:"50%",children:[s.jsx(y,{title:"输出文件}",analysisType:r,analysisMethod:n.inputAnalysisMenthod,shouldTrigger:!0,setResultTableList:A}),s.jsx(J,{spinning:R,children:s.jsx(q,{form:o,resultTableList:S,formJson:b.formJson,sampleGroupApI:!1,moduleName:n.moduleName,params:n.params,setPlotLoading:e=>{d(e),w(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};
