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-B_2CoVdl.js";import"./index-LwlFn7Y4.js";import{B as z}from"./index-D2AmS0aU.js";import{useListTable as A}from"./useListPage-BEtybUiF.js";import D from"./BasicTable-Clbg3fHx.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./componentMap-CzCGDP7x.js";import"./useFormItem-CWa0w7fA.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-DAURrYyA.js";import"./index-ByLO0zSl.js";import"./useTimeout-CB9F1PLu.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useWindowSizeFn-C3WExEpc.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JAddInput-YFlAniYT.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-CkL00Q0a.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./depart.api-0qTriT9h.js";import"./JDictSelectTag-CxpDdimB.js";import"./JSelectDept-wKz_Qtmc.js";import"./JPopup-BJBYqoWe.js";import"./JEllipsis-Cn7GCKHR.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./index-ARbUvvsq.js";import"./useForm-CcjrODHR.js";import"./JAreaLinkage-CSgDAlrn.js";import"./JCodeEditor-esTLnfS3.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-DclSHT47.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};
