import{d as E,e as b,k as h,u as f}from"./vue-vendor-CxLCUzY4.js";import{u as S}from"./antd-vue-vendor-CDWW6V_M.js";import{j as V}from"./componentMap-CzCGDP7x.js";import{l as x}from"./index-B_2CoVdl.js";var N=Object.defineProperty,A=Object.defineProperties,I=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,O=(e,t,r)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,s=(e,t)=>{for(var r in t||(t={}))D.call(t,r)&&O(e,r,t[r]);if(y)for(var r of y(t))G.call(t,r)&&O(e,r,t[r]);return e},Q=(e,t)=>A(e,I(t));const z=E({name:"OnlineSuperQueryValComponent",inheritAttrs:!1,props:{schema:{type:Object,default:()=>({})},formModel:{type:Object,default:()=>({})},setFormModel:{type:Function,default:null}},emits:["submit"],setup(e,{emit:t}){const r=b(()=>{var l;const{schema:o,formModel:u}=e;let{componentProps:a={}}=o;return x(a)&&(a=(l=a({schema:o,formModel:u}))!=null?l:{}),a}),j=b(()=>{const{formModel:l,schema:o}=e;return{field:o.field,model:l,values:s({},l),schema:o}});function g(){var l;const{component:o,changeEvent:u="change",valueField:a}=e.schema,i="val",v=o&&["Switch","Checkbox"].includes(o),p=`on${S(u)}`,P={[p]:(...c)=>{const[m]=c;n[p]&&n[p](...c);const d=m?m.target:null,k=d?v?d.checked:d.value:m;e.setFormModel(i,k)}},C=V.get(o),n=s({allowClear:!0,getPopupContainer:c=>c==null?void 0:c.parentNode},f(r));!n.disabled&&o!=="RangePicker"&&o&&(n.placeholder=((l=f(r))==null?void 0:l.placeholder)||w(o)+e.schema.label),n.codeField=i,n.formValues=f(j);const F={[a||(v?"checked":"value")]:e.formModel[i]},M=Q(s(s(s({},n),P),F),{allowClear:!0,onPressEnter(){t("submit")}});return h(C,M,null)}return()=>h("div",{style:"width:100%"},[g()]);function w(l){return l.includes("Input")||l.includes("Complete")?"请输入":"请选择"}}});export{z as G};
