import{B as A}from"./index-D2AmS0aU.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-ARbUvvsq.js";import{c9 as L,a8 as N,u as _,h as H}from"./index-B_2CoVdl.js";import{o as J}from"./antd-vue-vendor-CDWW6V_M.js";import{u as K,B as U}from"./useForm-CcjrODHR.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./componentMap-CzCGDP7x.js";import"./useFormItem-CWa0w7fA.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"./JAreaLinkage-CSgDAlrn.js";import"./JCodeEditor-esTLnfS3.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-DclSHT47.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};
