ImportTable-05429a75.js 3.5 KB

1
  1. import{d as Q,r as s,x as W,o as p,C as h,A as e,f as a,a as l,D as f,c as X,F as Y,R as Z,a5 as V,k as B,Y as E,a2 as H,S as L,U as M,V as P,a9 as O,Q as $,J as aa,W as ea,X as la,K as ta,Z as oa,_ as na,__tla as sa}from"./index-286756b9.js";import{_ as ra,__tla as da}from"./Dialog-4c2de357.js";import{b as ua,c as ca,__tla as ma}from"./index-7603a2a2.js";import{g as ia,__tla as _a}from"./index-127a98e5.js";import{u as pa,__tla as fa}from"./useMessage-084b1e70.js";let I,va=Promise.all([(()=>{try{return sa}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return ma}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return fa}catch{}})()]).then(async()=>{I=na(Q({name:"InfraCodegenImportTable",__name:"ImportTable",emits:["success"],setup(ya,{expose:S,emit:k}){const R=pa(),r=s(!1),v=s(!0),w=s([]),t=W({name:void 0,comment:void 0,dataSourceConfigId:0}),U=s(),u=s([]),d=async()=>{v.value=!0;try{w.value=await ua(t)}finally{v.value=!1}},K=async()=>{t.name=void 0,t.comment=void 0,t.dataSourceConfigId=u.value[0].id,await d()};S({open:async()=>{u.value=await ia(),t.dataSourceConfigId=u.value[0].id,r.value=!0,await d()}});const b=()=>{r.value=!1,c.value=[]},g=s(),c=s([]),T=m=>{var o;(o=l(g))==null||o.toggleRowSelection(m)},D=m=>{c.value=m.map(o=>o.name)},z=async()=>{await ca({dataSourceConfigId:t.dataSourceConfigId,tableNames:c.value}),R.success("\u5BFC\u5165\u6210\u529F"),F("success"),b()},F=k;return(m,o)=>{const j=L,q=M,i=P,C=O,x=$,_=aa,A=ea,y=la,G=ta,J=ra,N=oa;return p(),h(J,{modelValue:l(r),"onUpdate:modelValue":o[3]||(o[3]=n=>H(r)?r.value=n:null),title:"\u5BFC\u5165\u8868",width:"800px"},{footer:e(()=>[a(_,{disabled:l(c).length===0,type:"primary",onClick:z},{default:e(()=>[f(" \u5BFC\u5165 ")]),_:1},8,["disabled"]),a(_,{onClick:b},{default:e(()=>[f("\u5173\u95ED")]),_:1})]),default:e(()=>[a(A,{ref_key:"queryFormRef",ref:U,inline:!0,model:l(t),"label-width":"68px"},{default:e(()=>[a(i,{label:"\u6570\u636E\u6E90",prop:"dataSourceConfigId"},{default:e(()=>[a(q,{modelValue:l(t).dataSourceConfigId,"onUpdate:modelValue":o[0]||(o[0]=n=>l(t).dataSourceConfigId=n),class:"!w-240px",placeholder:"\u8BF7\u9009\u62E9\u6570\u636E\u6E90"},{default:e(()=>[(p(!0),X(Y,null,Z(l(u),n=>(p(),h(j,{key:n.id,label:n.name,value:n.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(i,{label:"\u8868\u540D\u79F0",prop:"name"},{default:e(()=>[a(C,{modelValue:l(t).name,"onUpdate:modelValue":o[1]||(o[1]=n=>l(t).name=n),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8868\u540D\u79F0",onKeyup:V(d,["enter"])},null,8,["modelValue"])]),_:1}),a(i,{label:"\u8868\u63CF\u8FF0",prop:"comment"},{default:e(()=>[a(C,{modelValue:l(t).comment,"onUpdate:modelValue":o[2]||(o[2]=n=>l(t).comment=n),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8868\u63CF\u8FF0",onKeyup:V(d,["enter"])},null,8,["modelValue"])]),_:1}),a(i,null,{default:e(()=>[a(_,{onClick:d},{default:e(()=>[a(x,{class:"mr-5px",icon:"ep:search"}),f(" \u641C\u7D22 ")]),_:1}),a(_,{onClick:K},{default:e(()=>[a(x,{class:"mr-5px",icon:"ep:refresh"}),f(" \u91CD\u7F6E ")]),_:1})]),_:1})]),_:1},8,["model"]),a(G,null,{default:e(()=>[B((p(),h(l(E),{ref_key:"tableRef",ref:g,data:l(w),height:"260px",onRowClick:T,onSelectionChange:D},{default:e(()=>[a(y,{type:"selection",width:"55"}),a(y,{"show-overflow-tooltip":!0,label:"\u8868\u540D\u79F0",prop:"name"}),a(y,{"show-overflow-tooltip":!0,label:"\u8868\u63CF\u8FF0",prop:"comment"})]),_:1},8,["data"])),[[N,l(v)]])]),_:1})]),_:1},8,["modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/infra/codegen/ImportTable.vue"]])});export{va as __tla,I as default};