ImportTable-1b601873.js 3.6 KB

1
  1. import{d as J,r as n,f as L,o as _,l as h,w as a,i as e,a as l,j as f,c as M,F as P,k as Q,Q as V,C as X,M as A,y as B,D as O,G as Z,H as W,U as Y,v as $,J as ee,K as ae,L as le,s as te,N as oe,_ as se,__tla as ne}from"./index-afaf388d.js";import{_ as re,__tla as ue}from"./Dialog-82c2009c.js";import{b as de,c as ce,__tla as me}from"./index-17220f4b.js";import{g as ie,__tla as pe}from"./index-c6a54a38.js";import{u as _e,__tla as fe}from"./useMessage-a290df31.js";let k,ve=Promise.all([(()=>{try{return ne}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return fe}catch{}})()]).then(async()=>{k=se(J({name:"InfraCodegenImportTable",__name:"ImportTable",emits:["success"],setup(ye,{expose:x,emit:S}){const U=_e(),r=n(!1),v=n(!0),w=n([]),t=L({name:void 0,comment:void 0,dataSourceConfigId:0}),R=n(),d=n([]),u=async()=>{v.value=!0;try{w.value=await de(t)}finally{v.value=!1}},K=async()=>{t.name=void 0,t.comment=void 0,t.dataSourceConfigId=d.value[0].id,await u()};x({open:async()=>{d.value=await ie(),t.dataSourceConfigId=d.value[0].id,r.value=!0,await u()}});const b=()=>{r.value=!1,c.value=[]},g=n(),c=n([]),T=m=>{var o;(o=l(g))==null||o.toggleRowSelection(m)},D=m=>{c.value=m.map(o=>o.name)},j=async()=>{await ce({dataSourceConfigId:t.dataSourceConfigId,tableNames:c.value}),U.success("\u5BFC\u5165\u6210\u529F"),F("success"),b()},F=S;return(m,o)=>{const H=O,N=Z,i=W,C=Y,I=$,p=ee,q=ae,y=le,z=te,E=re,G=oe;return _(),h(E,{modelValue:l(r),"onUpdate:modelValue":o[3]||(o[3]=s=>B(r)?r.value=s:null),title:"\u5BFC\u5165\u8868",width:"800px"},{footer:a(()=>[e(p,{disabled:l(c).length===0,type:"primary",onClick:j},{default:a(()=>[f(" \u5BFC\u5165 ")]),_:1},8,["disabled"]),e(p,{onClick:b},{default:a(()=>[f("\u5173\u95ED")]),_:1})]),default:a(()=>[e(q,{ref_key:"queryFormRef",ref:R,inline:!0,model:l(t),"label-width":"68px"},{default:a(()=>[e(i,{label:"\u6570\u636E\u6E90",prop:"dataSourceConfigId"},{default:a(()=>[e(N,{modelValue:l(t).dataSourceConfigId,"onUpdate:modelValue":o[0]||(o[0]=s=>l(t).dataSourceConfigId=s),class:"!w-240px",placeholder:"\u8BF7\u9009\u62E9\u6570\u636E\u6E90"},{default:a(()=>[(_(!0),M(P,null,Q(l(d),s=>(_(),h(H,{key:s.id,label:s.name,value:s.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(i,{label:"\u8868\u540D\u79F0",prop:"name"},{default:a(()=>[e(C,{modelValue:l(t).name,"onUpdate:modelValue":o[1]||(o[1]=s=>l(t).name=s),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8868\u540D\u79F0",onKeyup:V(u,["enter"])},null,8,["modelValue"])]),_:1}),e(i,{label:"\u8868\u63CF\u8FF0",prop:"comment"},{default:a(()=>[e(C,{modelValue:l(t).comment,"onUpdate:modelValue":o[2]||(o[2]=s=>l(t).comment=s),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8868\u63CF\u8FF0",onKeyup:V(u,["enter"])},null,8,["modelValue"])]),_:1}),e(i,null,{default:a(()=>[e(p,{onClick:u},{default:a(()=>[e(I,{class:"mr-5px",icon:"ep:search"}),f(" \u641C\u7D22 ")]),_:1}),e(p,{onClick:K},{default:a(()=>[e(I,{class:"mr-5px",icon:"ep:refresh"}),f(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1},8,["model"]),e(z,null,{default:a(()=>[X((_(),h(l(A),{ref_key:"tableRef",ref:g,data:l(w),height:"260px",onRowClick:T,onSelectionChange:D},{default:a(()=>[e(y,{type:"selection",width:"55"}),e(y,{"show-overflow-tooltip":!0,label:"\u8868\u540D\u79F0",prop:"name"}),e(y,{"show-overflow-tooltip":!0,label:"\u8868\u63CF\u8FF0",prop:"comment"})]),_:1},8,["data"])),[[G,l(v)]])]),_:1})]),_:1},8,["modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/infra/codegen/ImportTable.vue"]])});export{ve as __tla,k as default};