import{I as e}from"./Imgs-ab7b7eac-1780912037814v=1.0.0.js";import{d as l,s as a,A as u,r as t,a as r,b as n,c as o,w as v,P as i,Q as s,f as d,H as p,h as m,F as b,i as c,l as f,j as y,t as g}from"./index-d052b22f-1780912037814v=1.0.0.js";const h=l({__name:"FormItem",props:{el:{},elmentProperty:{},options:{},value:{},label:{},prop:{},render:{}},emits:["update:value","update:demovalue"],setup(l,{emit:h}){const k=l,_=h,x=a({get:()=>k.value,set:e=>{_("update:value",e)}}),P=u("enumMap",t(new Map)),V=a((()=>{let e=P.value.get(k.prop);return e||[]})),I=a((()=>{var e;let l=null!=(e=null==k?void 0:k.elmentProperty)?e:{};return"switch"===k.el&&V.value.length&&(l.activeText=V.value[1].label,l.activeValue=V.value[1].value,l.inactiveText=V.value[0].label,l.inactiveValue=V.value[0].value),l})),j=a((()=>{var e,l,a;if(["datetimerange","daterange","monthrange"].includes(null==k?void 0:k.type))return{rangeSeparator:"至",startPlaceholder:"开始时间",endPlaceholder:"结束时间"};return{placeholder:(null!=(a=null==(e=null==k?void 0:k.elmentProperty)?void 0:e.placeholder)?a:null==(l=null==k?void 0:k.el)?void 0:l.includes("input"))?"请输入":"请选择"}})),w=a((()=>{var e;return null!=(e=null==k?void 0:k.clearable)?e:null==(null==k?void 0:k.value)||null==(null==k?void 0:k.value)}));return(l,a)=>{const u=r("el-form-item");return n(),o(u,{label:l.label,prop:l.prop},{default:v((()=>["Imgs"==l.el?(n(),o(i(e),s({key:0},{...d(I),...d(j),clearable:d(w)},{fileList:d(x),"onUpdate:fileList":a[0]||(a[0]=e=>p(x)?x.value=e:null)}),null,16,["fileList"])):(n(),o(i(`el-${l.el}`),s({key:1},{...d(I),...d(j),clearable:d(w)},{modelValue:d(x),"onUpdate:modelValue":a[1]||(a[1]=e=>p(x)?x.value=e:null),modelModifiers:{trim:!0}}),{default:v((()=>["select"===l.el?(n(!0),m(b,{key:0},c(d(V),((e,l)=>(n(),o(i("el-option"),{key:l,label:e.label||e.name,value:e.value},null,8,["label","value"])))),128)):f("v-if",!0),"radio-group"===l.el?(n(!0),m(b,{key:1},c(d(V),((e,l)=>(n(),o(i("el-radio"),{key:l,label:e.value,value:e.label},{default:v((()=>[y(g(e.label||e.name),1)])),_:2},1032,["label","value"])))),128)):f("v-if",!0),"checkbox-group"===l.el?(n(!0),m(b,{key:2},c(d(V),((e,l)=>(n(),o(i("el-checkbox"),{key:l,label:e.value,value:e.label},{default:v((()=>[y(g(e.label||e.name),1)])),_:2},1032,["label","value"])))),128)):f("v-if",!0)])),_:1},16,["modelValue"]))])),_:1},8,["label","prop"])}}});export{h as _};
