import{B as A}from"./index-CF_FJn6P.js";import{U as b,a2 as I,ad as R,af as T,k as F,ag as q,f as h}from"./vue-vendor-CxLCUzY4.js";import"./index-BkgeZpOO.js";import{c9 as L,a8 as N,u as _,h as H}from"./index-CYriLmQo.js";import{o as J}from"./antd-vue-vendor-CDWW6V_M.js";import{u as K,B as U}from"./useForm-8o5KRzWo.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useTimeout-DC8132dd.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-CxQILSKV.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./componentMap-7D1QIeNI.js";import"./useFormItem-CWa0w7fA.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"./JAreaLinkage-DFTeDmm8.js";import"./JCodeEditor-_KZ8XnNK.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-XK54XB3r.js";var E=Object.defineProperty,x=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,w=(o,i,t)=>i in o?E(o,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[i]=t,$=(o,i)=>{for(var t in i||(i={}))G.call(i,t)&&w(o,t,i[t]);if(x)for(var t of x(i))Q.call(i,t)&&w(o,t,i[t]);return o},c=(o,i,t)=>new Promise((l,s)=>{var p=r=>{try{m(t.next(r))}catch(d){s(d)}},n=r=>{try{m(t.throw(r))}catch(d){s(d)}},m=r=>r.done?l(r.value):Promise.resolve(r.value).then(p,n);m((t=t.apply(o,i)).next())});const z={name:"LinkTableFieldConfigModal",emits:["success","register"],components:{BasicModal:A,BasicForm:U},setup(o,{emit:i}){const t=h(!1),l=h([]),s=h([]);let p={},n={};const{createMessage:m}=_(),[r,{closeModal:d}]=N(e=>c(this,null,function*(){n=$({},e.record),p=e.tableAndFieldsMap,yield B(),yield v({dictTable:e.record.dictTable}),n.dictTable&&y(n.dictTable),setTimeout(()=>c(this,null,function*(){let a=J(e.record,"dictTable");yield v(a),yield C()}),200)}));function B(){return c(this,null,function*(){let e=Object.keys(p);if(!e||e.length==0)l.value=[];else{let a=[];for(let u of e)a.push({text:p[u].title,value:u});l.value=a}})}function y(e){return c(this,null,function*(){if(e){const{table:a,fields:u}=p[e];if(!a){m.warning("请先完善字段["+e+"]关联记录的配置");return}const S="/online/cgform/field/listByHeadCode",g=yield H.get({url:S,params:{headCode:a}});if(g&&g.length>0){let V=g.map(f=>({text:f.dbFieldTxt,value:f.dbFieldName})),j=u.split(",");s.value=V.filter(f=>j.includes(f.value))}else s.value=[]}})}const k=[{label:"rowKey",field:"rowKey",component:"Input",show:!1},{label:"字段描述",field:"dbFieldTxt",component:"Input",required:!0},{label:"关联记录",field:"dictTable",component:"JSearchSelect",required:!0,componentProps:({formActionType:e})=>({async:!1,popContainer:".link-table-field-config-modal",dictOptions:l.value,immediateChange:!0,onChange:a=>c(this,null,function*(){n.dictText&&(yield e.setFieldsValue({dictText:""}),yield e.clearValidate()),y(a)})})},{label:"显示字段",field:"dictText",component:"JSearchSelect",required:!0,componentProps:{async:!1,popContainer:".link-table-field-config-modal",dictOptions:s,onChange:e=>{n.dictText=e}}}],[M,{validate:O,setFieldsValue:v,clearValidate:C}]=K({schemas:k,showActionButtonGroup:!1,labelAlign:"right"});function P(){return c(this,null,function*(){const e=yield O();i("success",e),d()})}return{registerModal:r,spinningLoading:t,registerForm:M,handleSubmit:P}}};function D(o,i,t,l,s,p){const n=b("BasicForm"),m=b("a-spin"),r=b("BasicModal");return I(),R(r,q({wrapClassName:"link-table-field-config-modal"},o.$attrs,{title:"他表字段配置",onRegister:l.registerModal,keyboard:"",canFullscreen:!1,cancelText:"关闭",onOk:l.handleSubmit}),{default:T(()=>[F(m,{spinning:l.spinningLoading},{default:T(()=>[F(n,{onRegister:l.registerForm},null,8,["onRegister"])]),_:1},8,["spinning"])]),_:1},16,["onRegister","onOk"])}const Qe=L(z,[["render",D]]);export{Qe as default};
