import{B as A}from"./index-zKZnG1QC.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-BN26Feep.js";import{c9 as L,a8 as N,u as _,h as H}from"./index-Cy4uayzW.js";import{o as J}from"./antd-vue-vendor-CahNzUUa.js";import{u as K,B as U}from"./useForm-DfoT2G6J.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./componentMap-0iK4HQBq.js";import"./useFormItem-IOFWTdED.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"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.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 $e=L(z,[["render",D]]);export{$e as default};
