import"./index.CL7yl-Wb.js";import{a as C,_ as q,r as b,aj as m,c as f,o as r,S as s,u as l,K as a,R as h,a9 as y,J as g,b as d,Q as u}from"./vue.D1BjjNmv.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"}},R={style:{float:"right",color:"#8492a6","font-size":"13px"}},j={style:{float:"left"}},w={style:{float:"right",color:"#8492a6","font-size":"13px"}},L=C({__name:"associationTable",props:["value"],emits:["updateVal"],setup(D,{emit:E}){let o=q({table:null,primarykey:null,field:null,searchField:null,oldSearchField:null});b("");let k=b([]),i=b([]);const v=b(),x=p=>{const{tableFields:t}=k.find(n=>n.table===p);i=t},F=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"),S=m("el-form");return r(),f("div",null,[s(S,{model:l(o),ref_key:"associationRef",ref:v},{default:a(()=>[s(c,{label:"关联表",prop:"table",rules:[{required:!0,message:"必填项",trigger:"blur"}]},{default:a(()=>[s(_,{modelValue:l(o).table,"onUpdate:modelValue":t[0]||(t[0]=e=>l(o).table=e),filterable:"",clearable:"",placeholder:"请选择",onChange:x},{default:a(()=>[(r(!0),f(h,null,y(l(k),e=>(r(),g(n,{key:e.table,label:e.tableName,value:e.table},{default:a(()=>[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:a(()=>[s(_,{modelValue:l(o).field,"onUpdate:modelValue":t[1]||(t[1]=e=>l(o).field=e),filterable:"",clearable:"",placeholder:"请选择"},{default:a(()=>[(r(!0),f(h,null,y(l(i),e=>(r(),g(n,{key:e.table,label:e.title,value:e.field},{default:a(()=>[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:a(()=>[s(_,{modelValue:l(o).primarykey,"onUpdate:modelValue":t[2]||(t[2]=e=>l(o).primarykey=e),filterable:"",clearable:"",placeholder:"请选择"},{default:a(()=>[(r(!0),f(h,null,y(l(i),(e,V)=>(r(),g(n,{key:V,label:e.title,value:e.field},{default:a(()=>[d("span",U,u(e.field),1),d("span",R,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:a(()=>[s(_,{modelValue:l(o).oldSearchField,"onUpdate:modelValue":t[3]||(t[3]=e=>l(o).oldSearchField=e),multiple:"",filterable:"",clearable:"",placeholder:"请选择",onChange:F},{default:a(()=>[(r(!0),f(h,null,y(l(i),(e,V)=>(r(),g(n,{key:V,label:e.title,value:e.field},{default:a(()=>[d("span",j,u(e.field),1),d("span",w,u(e.title),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])])}}});export{L as _};
