import{a as u,j as e,T as L,r as s,z as R,F as i,D as I,B as r,w,x as N,E as z,G as A,H as F,J as O}from"./index-s57B3ha7.js";import{M as V}from"./index-D4sVsYOu.js";import"./context-BWPM1aaO.js";const C=a=>u.get(`/list-by-project?project=${a}`),b=()=>{const[a,o]=s.useState([]),[g,f]=s.useState([]),[x,c]=s.useState(!1),{project:q}=R(),[h,n]=s.useState(!1),[m]=i.useForm(),[p,_]=s.useState(),{Search:j}=I,d=async()=>{c(!0);const t=await C(q);console.log(t),o(t.data),f(t.data),c(!1)},y=[{title:"项目",dataIndex:"project",key:"project",ellipsis:!0},{title:"样本名称",dataIndex:"sample_name",key:"sample_name",ellipsis:!0},{title:"样本个体",dataIndex:"sample_individual",key:"sample_individual",ellipsis:!0},{title:"样本组成",dataIndex:"sample_composition",key:"sample_composition",ellipsis:!0},{title:"测序技术",dataIndex:"sequencing_technique",key:"sequencing_technique",ellipsis:!0},{title:"测序目标",dataIndex:"sequencing_target",key:"sequencing_target",ellipsis:!0},{title:"样本分组",dataIndex:"sample_group",key:"sample_group",ellipsis:!0},{title:"样本分组名称",dataIndex:"sample_group_name",key:"sample_group_name",ellipsis:!0},{title:"样本来源",dataIndex:"sample_source",key:"sample_source",ellipsis:!0},{title:"fastq1",dataIndex:"fastq1",key:"fastq1",ellipsis:!0},{title:"fastq2",dataIndex:"fastq2",key:"fastq2",ellipsis:!0},{title:"操作",key:"action",fixed:"right",width:200,render:(t,l)=>e.jsx(O,{size:"middle"})}],k=`
|project|library_name|sample_name|sequencing_target|sequencing_technique|sample_composition|fastq1                                                 |fastq2                                                     |
|-------|------------|-----------|-----------------|--------------------|------------------|-------------------------------------------------------|-----------------------------------------------------------|
|test   |R250506-21  |OL-RNA-1   |RNA              |NGS                 |single_genome     |/V350344603_L03_117_1.fq.gz                            |/V350344603_L03_117_2.fq.gz                                |
|test   |R250506-22  |OCF-RNA-1  |RNA              |NGS                 |single_genome     |/V350344603_L03_118_1.fq.gz                            |/V350344603_L03_118_2.fq.gz                                |
|test   |R250506-23  |OSP-RNA-1  |RNA              |NGS                 |single_genome     |/V350344603_L03_119_1.fq.gz                            |/V350344603_L03_119_2.fq.gz                                |

---
project,library_name,sample_name,sequencing_target,sequencing_technique,sample_composition,fastq1,fastq2

test,R250506-21,OL-RNA-1,RNA,NGS,single_genome,/V350344603_L03_117_1.fq.gz,/V350344603_L03_117_2.fq.gz

`;return s.useEffect(()=>{d()},[]),e.jsxs(e.Fragment,{children:[e.jsx(j,{placeholder:"input search text",allowClear:!0,onSearch:t=>{const l=g.filter(S=>S.sample_name.includes(t));o(l)},style:{width:304}}),e.jsx(r,{onClick:d,style:{marginLeft:"1rem"},children:"刷新"}),e.jsx(r,{onClick:()=>{_("import_sample_form_str"),n(!0)},style:{marginLeft:"1rem"},children:"导入样本"}),e.jsx(r,{onClick:()=>{_("update_sample_form_str"),n(!0)},style:{marginLeft:"1rem"},children:"更新样本"}),e.jsx(w,{pagination:{pageSize:30},loading:x,scroll:{x:"max-content",y:55*5},columns:y,footer:()=>`一共${a.length}条记录`,dataSource:a}),e.jsxs(V,{open:h,title:`操作样本(${p})`,width:"100%",onCancel:()=>n(!1),onOk:async()=>{const t=await m.validateFields(),l=await u.post(`/fast-api/${p}`,t);console.log(l)},children:[e.jsx(i,{form:m,children:e.jsx(i.Item,{name:"content",children:e.jsx(N,{rows:10})})}),e.jsx(z,{children:k,remarkPlugins:[A,F]})]})]})},E=()=>e.jsx(e.Fragment,{children:e.jsx(L,{items:[{key:"sample",label:"样本信息",children:e.jsx(b,{})}]})});export{E as default,C as getSamples};
