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-Cy4uayzW.js";import"./index-gyz1IdHU.js";import{B as z}from"./index-zKZnG1QC.js";import{useListTable as A}from"./useListPage-TMORxSEa.js";import D from"./BasicTable-CgafrQwz.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./componentMap-0iK4HQBq.js";import"./useFormItem-IOFWTdED.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-Bdn0r8CG.js";import"./index-CrdW4fN1.js";import"./useTimeout-gJpgadD6.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./index-BN26Feep.js";import"./useForm-DfoT2G6J.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.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};
