import{r as i,x as M,_ as b,ce as F,c as S,k as T,j as t,F as u,e as p,I as A,t as C,at as B,B as O}from"./main-BzPVmAp-.js";import{u as $}from"./usePagination-CGdUxo17.js";import{F as E}from"./Table-kIlrKW-9.js";import{P as H}from"./index-BZ6Sq__j.js";import{S as N}from"./index-sAnz6zLe.js";import{R as D}from"./RedoOutlined-d_QTXv-s.js";var V={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},J=function(n,o){return i.createElement(M,b({},n,{ref:o,icon:V}))},K=i.forwardRef(J);const W=i.forwardRef(({rowSelection:l,openModal:n,api:o,params:e,close:c,columns:s,hiddenSwitch:r=!1},g)=>{const[d,h]=i.useState(!r),{locale:y}=F(),[x]=i.useState(30),{data:k,pageNumber:z,totalPage:f,loading:_,reload:j,pageSize:m,setPageSize:w,setPageNumber:v,search:P}=$({url:o,initialPageSize:x,params:{...e,is_research:d,locale:y}});i.useImperativeHandle(g,()=>({reload:j,setPageNumber:v})),S();const{messageApi:I}=T(),R=i.useMemo(()=>s({openModal:n,reload:j,messageApi:I}),[e==null?void 0:e.category]);return t.jsx("div",{children:t.jsx(E,{title:()=>t.jsxs(u,{justify:"space-between",children:[t.jsxs(u,{gap:"small",align:"center",children:[!r&&t.jsx(N,{value:d,onChange:h,checkedChildren:"filter",unCheckedChildren:"all",size:"small",defaultChecked:!0}),t.jsx(A.Search,{size:"small",placeholder:"search...",allowClear:!0,enterButton:!0,onSearch:a=>{P(a)},style:{width:300}})]}),t.jsxs(u,{gap:"small",children:[t.jsx(C,{title:"create",children:t.jsx(K,{onClick:()=>{e!=null&&e.category&&(e!=null&&e.registry_join)?n("optModal",{entityType:"mesh",category:e==null?void 0:e.category,registryJoin:e==null?void 0:e.registry_join}):e!=null&&e.category?n("optModal",{entityType:"mesh",category:e==null?void 0:e.category}):n("optModal",{entityType:"mesh"})}})}),t.jsx(C,{title:"refresh",children:t.jsx(D,{onClick:()=>j()})}),c&&t.jsx(B,{onClick:c})]})]}),rowSelection:l,rowKey:a=>a.entity_id,size:"small",bordered:!0,pagination:!1,loading:_,scroll:{x:"max-content"},columns:R,dataSource:k,footer:()=>t.jsx(t.Fragment,{children:f!=0&&t.jsxs(u,{style:{marginTop:"1rem"},align:"center",gap:"small",children:[t.jsxs("p",{children:["A total of ",f," data "]}),t.jsx(H,{size:"small",current:z,pageSize:m,total:f,onChange:a=>v(a),showSizeChanger:!1}),t.jsx(p,{size:"small",value:m,onChange:w,options:[{key:10,value:10},{key:30,value:30},{key:50,value:50}]})]})})})})}),q=()=>[{title:"entity_id",dataIndex:"entity_id",key:"taxonomy_id"},{title:"entity_name",dataIndex:"entity_name",key:"entity_name"},{title:"title",dataIndex:"title",key:"title"}],G=(l,n,o,e)=>[{title:"操作",key:"action",fixed:"right",width:200,render:(c,s)=>t.jsx(t.Fragment,{children:t.jsx(O,{size:"small",color:"cyan",variant:"solid",onClick:()=>{e(`/mining-data/${s.entity_id}`)},children:"mining"})})}],ee=i.forwardRef(({rowSelection:l,openModal:n,params:o,close:e,hiddenSwitch:c=!1},s)=>{const r=S();return t.jsx("div",{style:{maxWidth:"1500px",margin:"1rem auto"},children:t.jsx(W,{rowSelection:l,columns:({openModal:g,reload:d,messageApi:h})=>{const y=q(),x=G(g,d,h,r);return[...y,...x]},hiddenSwitch:!0,ref:s,api:"/entity/page/study",openModal:()=>{},close:e})})});export{W as D,K as R,ee as S};
