import{d as w,a as s,ae as D,r as _,e as I,o as r,f as m,w as c,am as d,Z as T,W as F,h as t,H as P,c as b,L as f,M as p,p as g,l as V,t as B}from"./index-17740f03-1778929502341v=1.0.0.js";const S=w({__name:"FormItem",props:{el:{},elmentProperty:{},options:{},value:{},label:{},prop:{},render:{}},emits:["update:value","update:demovalue"],setup(C,{emit:E}){const e=C,L=E,o=s({get:()=>e.value,set:l=>{L("update:value",l)}}),M=D("enumMap",_(new Map)),n=s(()=>{let l=M.value.get(e.prop);return l||[]}),y=s(()=>{var u;let l=(u=e==null?void 0:e.elmentProperty)!=null?u:{};return e.el==="switch"&&n.value.length&&(l.activeText=n.value[1].label,l.activeValue=n.value[1].value,l.inactiveText=n.value[0].label,l.inactiveValue=n.value[0].value),l}),k=s(()=>{var u,v,a;return["datetimerange","daterange","monthrange"].includes(e==null?void 0:e.type)?{rangeSeparator:"\u81F3",startPlaceholder:"\u5F00\u59CB\u65F6\u95F4",endPlaceholder:"\u7ED3\u675F\u65F6\u95F4"}:{placeholder:((a=(u=e==null?void 0:e.elmentProperty)==null?void 0:u.placeholder)!=null?a:(v=e==null?void 0:e.el)==null?void 0:v.includes("input"))?"\u8BF7\u8F93\u5165":"\u8BF7\u9009\u62E9"}}),h=s(()=>{var l;return(l=e==null?void 0:e.clearable)!=null?l:(e==null?void 0:e.value)==null||(e==null?void 0:e.value)==null});return(l,u)=>{const v=I("el-form-item");return r(),m(v,{label:l.label,prop:l.prop},{default:c(()=>[l.el=="Imgs"?(r(),m(d(T),F({key:0},{...t(y),...t(k),clearable:t(h)},{fileList:t(o),"onUpdate:fileList":u[0]||(u[0]=a=>P(o)?o.value=a:null)}),null,16,["fileList"])):(r(),m(d(`el-${l.el}`),F({key:1},{...t(y),...t(k),clearable:t(h)},{modelValue:t(o),"onUpdate:modelValue":u[1]||(u[1]=a=>P(o)?o.value=a:null),modelModifiers:{trim:!0}}),{default:c(()=>[l.el==="select"?(r(!0),b(f,{key:0},p(t(n),(a,i)=>(r(),m(d("el-option"),{key:i,label:a.label||a.name,value:a.value},null,8,["label","value"]))),128)):g("v-if",!0),l.el==="radio-group"?(r(!0),b(f,{key:1},p(t(n),(a,i)=>(r(),m(d("el-radio"),{key:i,label:a.value,value:a.label},{default:c(()=>[V(B(a.label||a.name),1)]),_:2},1032,["label","value"]))),128)):g("v-if",!0),l.el==="checkbox-group"?(r(!0),b(f,{key:2},p(t(n),(a,i)=>(r(),m(d("el-checkbox"),{key:i,label:a.value,value:a.label},{default:c(()=>[V(B(a.label||a.name),1)]),_:2},1032,["label","value"]))),128)):g("v-if",!0)]),_:1},16,["modelValue"]))]),_:1},8,["label","prop"])}}});export{S as _};
