import{d as w,c as C,f as h,U as a,a2 as t,a3 as B,k as f,af as l,a6 as O,ad as s,ag as V,G as y,V as $}from"./vue-vendor-CxLCUzY4.js";import{a5 as I,F as d,_ as T}from"./index-CYriLmQo.js";import{ai as E}from"./antd-vue-vendor-CDWW6V_M.js";const M=w({name:"JSelectBiz",components:{LoadingOutlined:E},inheritAttrs:!1,props:{showButton:d.bool.def(!0),disabled:d.bool.def(!1),placeholder:{type:String,default:"请选择"},multiple:{type:String,default:"multiple"},loading:d.bool.def(!1),maxTagCount:d.number,buttonIcon:d.string.def("")},emits:["handleOpen","change"],setup(e,{emit:o,refs:k}){const m=C("selectOptions")||h([]),u=C("selectValues")||h({}),c=I();function p(n){e.showButton&&n&&o("handleOpen"),!e.showButton&&!n&&o("handleOpen")}function i(n){u.value=n,u.change=!0,o("change",n)}return{attrs:c,selectValues:u,options:m,handleChange:i,openModal:p}}});function S(e,o,k,m,u,c){const p=a("LoadingOutlined"),i=a("a-input"),n=a("a-select"),g=a("a-col"),b=a("a-button"),v=a("a-row");return t(),B("div",null,[f(v,{class:"j-select-row",type:"flex",gutter:8},{default:l(()=>[f(g,{class:O(["left",{full:!e.showButton}])},{default:l(()=>[e.loading?(t(),s(i,{key:0,readOnly:"",placeholder:"加载中…"},{prefix:l(()=>[f(p)]),_:1})):(t(),s(n,V({key:1,ref:"select",value:e.selectValues.value,"onUpdate:value":o[0]||(o[0]=r=>e.selectValues.value=r),placeholder:e.placeholder,mode:e.multiple,open:!1,disabled:e.disabled,options:e.options,maxTagCount:e.maxTagCount,onChange:e.handleChange,style:{width:"100%"},onClick:o[1]||(o[1]=r=>!e.disabled&&e.openModal(!1))},e.attrs),null,16,["value","placeholder","mode","disabled","options","maxTagCount","onChange"]))]),_:1},8,["class"]),e.showButton?(t(),s(g,{key:0,class:"right"},{default:l(()=>[e.buttonIcon?(t(),s(b,{key:0,preIcon:e.buttonIcon,type:"primary",onClick:o[2]||(o[2]=r=>e.openModal(!0)),disabled:e.disabled},{default:l(()=>o[4]||(o[4]=[y("选择")])),_:1},8,["preIcon","disabled"])):(t(),s(b,{key:1,type:"primary",onClick:o[3]||(o[3]=r=>e.openModal(!0)),disabled:e.disabled},{default:l(()=>o[5]||(o[5]=[y("选择")])),_:1},8,["disabled"]))]),_:1})):$("",!0)]),_:1})])}const L=T(M,[["render",S],["__scopeId","data-v-b44fcfad"]]);export{L as J};
