ll-package
Version:
2 lines (1 loc) • 3.26 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),L=require("../../../hooks/useDesign.js"),U={class:"select-group-container"},b=e.defineComponent({name:"LlSelectGroup"}),q=e.defineComponent({...b,props:{data:{}},emits:["handleSelectGroupChange"],setup(B,{emit:w}){const{prefixCls:S}=L.useDesign("select-group-wrapper"),T=B,x=w,p=e.ref("1"),c=e.ref(""),i=e.ref(),l=e.ref();e.watch(()=>T.data,a=>{if(a&&a.length){const t=a[0];l.value=t,p.value=t.value}},{deep:!0,immediate:!0});const F=(a,t)=>{l.value=t.item,c.value="",i.value=void 0},N=a=>{r(a)},r=a=>{var s,u;const t=(s=l.value)==null?void 0:s.showFormType;let n="";t?n=a:n=c.value,x("handleSelectGroupChange",(u=l.value)==null?void 0:u.value,n)};return(a,t)=>{const n=e.resolveComponent("a-select-option"),s=e.resolveComponent("a-select"),u=e.resolveComponent("ll-icon"),V=e.resolveComponent("a-input"),E=e.resolveComponent("a-range-picker"),P=e.resolveComponent("a-tree-select"),G=e.resolveComponent("a-input-group");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(S))},[e.createElementVNode("div",U,[e.createVNode(G,{compact:""},{default:e.withCtx(()=>{var v,d,m,h,_,f,k,g,C,y;return[e.createVNode(s,{class:"select-group-left-select-container",value:p.value,"onUpdate:value":t[0]||(t[0]=o=>p.value=o),onChange:F},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.data,o=>(e.openBlock(),e.createBlock(n,{value:o.value,key:o.name,item:o},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name),1)]),_:2},1032,["value","item"]))),128))]),_:1},8,["value"]),!((v=l.value)!=null&&v.showFormType)||((d=l.value)==null?void 0:d.showFormType)==="input"?(e.openBlock(),e.createBlock(V,{key:0,placeholder:(m=l.value)==null?void 0:m.placeholder,value:c.value,"onUpdate:value":t[1]||(t[1]=o=>c.value=o),onPressEnter:r},{suffix:e.withCtx(()=>[e.createVNode(u,{"icon-name":"icon-search",onClick:r})]),_:1},8,["placeholder","value"])):((h=l.value)==null?void 0:h.showFormType)==="select"?(e.openBlock(),e.createBlock(s,{key:1,popupClassName:"select-group-right-select",options:(_=l.value)==null?void 0:_.options,placeholder:(f=l.value)==null?void 0:f.placeholder,style:{width:"100%"},"field-names":(k=l.value)==null?void 0:k.fieldNames,onChange:r},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.list,o=>(e.openBlock(),e.createBlock(n,{key:o.value,value:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["options","placeholder","field-names"])):((g=l.value)==null?void 0:g.showFormType)==="range-picker"?(e.openBlock(),e.createBlock(E,{key:2,onChange:r})):((C=l.value)==null?void 0:C.showFormType)==="treeSelect"?(e.openBlock(),e.createBlock(P,{key:3,value:i.value,"onUpdate:value":t[2]||(t[2]=o=>i.value=o),style:{width:"100%"},"field-names":l.value.fieldNames,placeholder:(y=l.value)==null?void 0:y.placeholder,"tree-data":l.value.list,onSelect:N},null,8,["value","field-names","placeholder","tree-data"])):e.renderSlot(a.$slots,"extra",e.normalizeProps(e.mergeProps({key:4},l.value)),void 0,!0)]}),_:3})])],2)}}});exports.default=q;
;