import{B,C as P,h as T,D,K as R,L as S,M as F}from"./element-plus-z3MwpXC9.js";import{d as I,s as L,Z as M,r as N,w as U,o as b,c as g,V as e,M as o,I as z,u as a,ab as h,S as C,O as $,a as j,i as O}from"./@vue-TMcuEboY.js";import{f as Z,h as q}from"./code-Bho2nNFp.js";import{_ as A}from"./index.vue_vue_type_script_setup_true_lang-Bd2lff9j.js";import{P as G}from"./index-CdmO5-Ss.js";import{u as H}from"./usePaging-DFi_nJOG.js";import{f as J}from"./index-DXEGVToZ.js";const Q={class:"data-table"},W={class:"m-4"},X={class:"flex justify-end mt-4"},me=I({__name:"data-table",emits:["success"],setup(Y,{emit:v}){const w=v,u=L(),s=M({name:"",comment:""}),{pager:n,getLists:f,resetParams:V,resetPage:d}=H({fetchFun:q,params:s,size:10}),c=N([]),y=l=>{c.value=l.map(({name:t,comment:i})=>({name:t,comment:i}))},k=async()=>{var l;if(!c.value.length)return J.msgError("请选择数据表");await Z({table:c.value}),(l=u.value)==null||l.close(),w("success")};return U(()=>{var l;return(l=u.value)==null?void 0:l.visible},l=>{l&&f()}),(l,t)=>{const i=B,p=P,_=T,E=D,r=R,x=S,K=F;return b(),g("div",Q,[e(G,{ref_key:"popupRef",ref:u,clickModalClose:!1,title:"选择表",width:"900px",async:!0,onConfirm:k},{trigger:o(()=>[z(l.$slots,"default")]),default:o(()=>[e(E,{class:"ls-form",model:a(s),inline:""},{default:o(()=>[e(p,{label:"表名称"},{default:o(()=>[e(i,{class:"w-[280px]",modelValue:a(s).name,"onUpdate:modelValue":t[0]||(t[0]=m=>a(s).name=m),clearable:"",onKeyup:h(a(d),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(p,{label:"表描述"},{default:o(()=>[e(i,{class:"w-[280px]",modelValue:a(s).comment,"onUpdate:modelValue":t[1]||(t[1]=m=>a(s).comment=m),clearable:"",onKeyup:h(a(d),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(p,null,{default:o(()=>[e(_,{type:"primary",onClick:a(d)},{default:o(()=>t[3]||(t[3]=[C("查询")])),_:1},8,["onClick"]),e(_,{onClick:a(V)},{default:o(()=>t[4]||(t[4]=[C("重置")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),$((b(),g("div",W,[e(x,{height:"400",size:"large",data:a(n).lists,onSelectionChange:y},{default:o(()=>[e(r,{type:"selection",width:"55"}),e(r,{label:"表名称",prop:"name","min-width":"150"}),e(r,{label:"表描述",prop:"comment","min-width":"160"}),e(r,{label:"创建时间",prop:"create_time","min-width":"180"})]),_:1},8,["data"])])),[[K,a(n).loading]]),j("div",X,[e(A,{modelValue:a(n),"onUpdate:modelValue":t[2]||(t[2]=m=>O(n)?n.value=m:null),onChange:a(f)},null,8,["modelValue","onChange"])])]),_:3},512)])}}});export{me as _};
