import"./api.BV8EW7D6.js";import{d as S,r as q,a as b,b as m,e as f,f as r,g as s,w as l,u as a,F as h,k as g,h as y,s as d,A as u}from"./vue.BxlDVA1H.js";import"./index.lP_uh0LI.js";const z={style:{float:"left"}},B={style:{float:"right",color:"#8492a6","font-size":"13px"}},N={style:{float:"left"}},O={style:{float:"right",color:"#8492a6","font-size":"13px"}},U={style:{float:"left"}},w={style:{float:"right",color:"#8492a6","font-size":"13px"}},R={style:{float:"left"}},j={style:{float:"right",color:"#8492a6","font-size":"13px"}},G=S({__name:"associationTable",props:["value"],emits:["updateVal"],setup(A,{emit:D}){let o=q({table:null,primarykey:null,field:null,searchField:null,oldSearchField:null});b("");let k=b([]),i=b([]);const v=b(),F=p=>{const{tableFields:t}=k.find(n=>n.table===p);i=t},x=p=>{const t=i.filter(n=>p.indexOf(n.field)>-1);o.searchField=t};return(p,t)=>{const n=m("el-option"),_=m("el-select"),c=m("el-form-item"),C=m("el-form");return r(),f("div",null,[s(C,{model:a(o),ref_key:"associationRef",ref:v},{default:l(()=>[s(c,{label:"关联表",prop:"table",rules:[{required:!0,message:"必填项",trigger:"blur"}]},{default:l(()=>[s(_,{modelValue:a(o).table,"onUpdate:modelValue":t[0]||(t[0]=e=>a(o).table=e),filterable:"",clearable:"",placeholder:"请选择",onChange:F},{default:l(()=>[(r(!0),f(h,null,g(a(k),e=>(r(),y(n,{key:e.table,label:e.tableName,value:e.table},{default:l(()=>[d("span",z,u(e.tableName),1),d("span",B,u(e.table),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(c,{label:"显示字段",prop:"field",rules:[{required:!0,message:"必填项",trigger:"blur"}]},{default:l(()=>[s(_,{modelValue:a(o).field,"onUpdate:modelValue":t[1]||(t[1]=e=>a(o).field=e),filterable:"",clearable:"",placeholder:"请选择"},{default:l(()=>[(r(!0),f(h,null,g(a(i),e=>(r(),y(n,{key:e.table,label:e.title,value:e.field},{default:l(()=>[d("span",N,u(e.field),1),d("span",O,u(e.title),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(c,{label:"储存字段",prop:"primarykey",rules:[{required:!0,message:"必填项",trigger:"blur"}]},{default:l(()=>[s(_,{modelValue:a(o).primarykey,"onUpdate:modelValue":t[2]||(t[2]=e=>a(o).primarykey=e),filterable:"",clearable:"",placeholder:"请选择"},{default:l(()=>[(r(!0),f(h,null,g(a(i),(e,V)=>(r(),y(n,{key:V,label:e.title,value:e.field},{default:l(()=>[d("span",U,u(e.field),1),d("span",w,u(e.title),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(c,{label:"过滤条件",prop:"oldSearchField",rules:[{required:!0,message:"必填项",trigger:"blur"}]},{default:l(()=>[s(_,{modelValue:a(o).oldSearchField,"onUpdate:modelValue":t[3]||(t[3]=e=>a(o).oldSearchField=e),multiple:"",filterable:"",clearable:"",placeholder:"请选择",onChange:x},{default:l(()=>[(r(!0),f(h,null,g(a(i),(e,V)=>(r(),y(n,{key:V,label:e.title,value:e.field},{default:l(()=>[d("span",R,u(e.field),1),d("span",j,u(e.title),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])])}}});export{G as default};
