import{U as d,a2 as H,ad as I,af as r,k as u,a4 as w,G as f,d as P,f as m}from"./vue-vendor-CxLCUzY4.js";import{c9 as j,a8 as q,h as T,u as K,C as V}from"./index-CLZzJyTP.js";import"./index-KOQNKxnC.js";import{B as z}from"./index-XZKTTfG1.js";import{useListTable as A}from"./useListPage-CevWQ3ci.js";import D from"./BasicTable-DUJWN3yz.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./componentMap-DpsJvoqz.js";import"./useFormItem-IOFWTdED.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-DvqyyN77.js";import"./index-CrdW4fN1.js";import"./useTimeout-KpZCXEcl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useWindowSizeFn-D9PllI8g.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./depart.api-DHG2p2Yd.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./index-ByX9XNkE.js";import"./useForm-Dx3lJ3DG.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.js";import"./injectionKey-DPVn4AgL.js";const E=P({name:"TransDb2Online",components:{BasicModal:z,BasicTable:D},emits:["success","register"],setup(e,{emit:h}){const{createMessage:g}=K(),i=m("暂无数据"),s=m(!1),n=m(!1),t=m([]),a=m([]),[p,{closeModal:c}]=q(()=>{n.value=!1,i.value="暂无数据",l.value=[],v()}),{prefixCls:x}=V("online-db-import-form-modal"),y=x,C=document.documentElement.clientHeight,b=C-180,L=b>690?690:b,[M,{setPagination:k},{rowSelection:B,selectedRowKeys:l}]=A({bordered:!0,columns:[{title:"表名",align:"left",dataIndex:"id"}],dataSource:a,maxHeight:C-400,locale:{emptyText:i},pagination:{showQuickJumper:!1,showSizeChanger:!1},clickToRowSelect:!0,showIndexColumn:!0,showActionColumn:!1,formConfig:{schemas:[{label:"表名",field:"tableName",component:"Input",componentProps:{style:{width:"100%"},placeholder:"请输入表名以模糊筛选",onChange:o=>N(o.target.value)},disabledLabelWidth:!0,itemProps:{labelCol:{sm:0,md:0},wrapperCol:{sm:24,md:20}}}],baseColProps:{xs:24,sm:24,md:24,lg:24,xl:24,xxl:24},showActionButtonGroup:!1}});function v(){return s.value=!0,T.get({url:"/online/cgform/head/queryTables"},{errorMessageMode:"none"}).then(o=>(a.value=o,t.value=[...o],o),o=>{o.message=="noadminauth"&&(i.value="非admin用户无权限操作！",g.warn(i.value)),a.value=[],t.value=[]}).finally(()=>{s.value=!1})}function N(o){t.value.length!==0&&(o?(a.value=t.value.filter(_=>_.id.toLowerCase().includes(o.toLowerCase())),i.value=a.value.length===0?"无筛选结果":"暂无数据"):a.value=[...t.value],k({current:1}))}function R(){c()}function S(){if(!l.value||l.value.length==0){g.warning("请选择一张表");return}else{n.value=!0;let o=l.value.join(",");T.post({url:"/online/cgform/head/transTables/"+o}).then(()=>{c(),h("success")}).finally(()=>n.value=!1)}}return{emptyText:i,confirmLoading:s,btnLoading:n,metaSource:t,handleTrans:S,handleCancel:R,queryTables:v,registerModal:p,registerTable:M,rowSelection:B,selectedRowKeys:l,wrapClassName:y,modalHeight:L}}}),G=w("div",null,[f(" 注：导入表会排除配置前缀表 "),w("a",{href:"http://doc.jeecg.com/2043924",target:"_blank"}," 参考文档")],-1);function F(e,h,g,i,s,n){const t=d("BasicTable"),a=d("a-spin"),p=d("a-button"),c=d("BasicModal");return H(),I(c,{onRegister:e.registerModal,height:e.modalHeight,width:500,title:"从数据库导入表单",confirmLoading:e.confirmLoading,onCancel:e.handleCancel,wrapClassName:e.wrapClassName},{footer:r(()=>[u(p,{onClick:e.handleCancel},{default:r(()=>[f("关闭")]),_:1},8,["onClick"]),u(p,{onClick:e.handleTrans,type:"primary",preIcon:"ant-design:swap",loading:e.confirmLoading||e.btnLoading},{default:r(()=>[f(" 生成表单 ")]),_:1},8,["onClick","loading"])]),default:r(()=>[u(a,{spinning:e.confirmLoading},{default:r(()=>[u(t,{onRegister:e.registerTable,rowSelection:e.rowSelection,onTableRedo:e.queryTables},{tableTitle:r(()=>[G]),_:1},8,["onRegister","rowSelection","onTableRedo"])]),_:1},8,["spinning"])]),_:1},8,["onRegister","height","confirmLoading","onCancel","wrapClassName"])}const Oe=j(E,[["render",F]]);export{Oe as default};
