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 s}from"./vue-vendor-CxLCUzY4.js";import{c9 as j,a8 as q,h as T,u as K,C as V}from"./index-CYriLmQo.js";import"./index-BN5Ac_IG.js";import{B as z}from"./index-CF_FJn6P.js";import{useListTable as A}from"./useListPage-i3Wl0_Fg.js";import D from"./BasicTable-DAfCfXmD.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./componentMap-7D1QIeNI.js";import"./useFormItem-CWa0w7fA.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-CxQILSKV.js";import"./index-ByLO0zSl.js";import"./useTimeout-DC8132dd.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./download-CkbK5et1.js";import"./base64Conver-24EVOS6V.js";import"./index-QMJkXEyl.js";import"./index-Bb_NRLur.js";import"./useCountdown-C3-PRPLY.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-nVFm3ao2.js";import"./props-DoGpHXAD.js";import"./JSelectBiz-BW6f3e--.js";import"./JAddInput-CXT54-j9.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-BTSd5ebC.js";import"./index-BTAl55Kt.js";import"./bem-2ra1afoV.js";import"./props-BLY2qIO5.js";import"./useContextMenu-DYyhcDf7.js";import"./depart.api-C9T5xfw6.js";import"./JDictSelectTag-Jqy9TBcS.js";import"./JSelectDept-DorRVguN.js";import"./JPopup-KP1kIsae.js";import"./JEllipsis-287cEHxd.js";import"./JUpload-pyrTRFCz.js";import"./index-Bx9Mnn3N.js";import"./index-B1-pj6uh.js";import"./index-isxCPgHp.js";import"./index-BkgeZpOO.js";import"./useForm-8o5KRzWo.js";import"./JAreaLinkage-DFTeDmm8.js";import"./JCodeEditor-_KZ8XnNK.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-XK54XB3r.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=s("暂无数据"),m=s(!1),n=s(!1),t=s([]),a=s([]),[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 m.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(()=>{m.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:m,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,m,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 Je=j(E,[["render",F]]);export{Je as default};
