import{_ as e}from"./index-C4Je2wdo.js";import{d as a,a as l,c as t,y as r,f as o,u as s,I as n}from"./index-ip5gDR6L.js";const u=a({__name:"role-search",props:{modelValue:{}},emits:["update:modelValue","search","reset"],setup(a,{emit:u}){const p=a,d=u,c=l(),i=t({get:()=>p.modelValue,set:e=>d("update:modelValue",e)}),m={},h=l([{label:"启用",value:!0},{label:"禁用",value:!1}]),y=t(()=>[{label:"角色名称",key:"roleName",type:"input",placeholder:"请输入角色名称",clearable:!0},{label:"角色编码",key:"roleCode",type:"input",placeholder:"请输入角色编码",clearable:!0},{label:"角色描述",key:"description",type:"input",placeholder:"请输入角色描述",clearable:!0},{label:"角色状态",key:"enabled",type:"select",props:{placeholder:"请选择状态",options:h.value,clearable:!0}},{label:"创建日期",key:"daterange",type:"datetime",props:{style:{width:"100%"},placeholder:"请选择日期范围",type:"daterange",rangeSeparator:"至",startPlaceholder:"开始日期",endPlaceholder:"结束日期",valueFormat:"YYYY-MM-DD",shortcuts:[{text:"今日",value:[new Date,new Date]},{text:"最近一周",value:[new Date(Date.now()-6048e5),new Date]},{text:"最近一个月",value:[new Date(Date.now()-2592e6),new Date]}]}}]),v=()=>{d("reset")},b=()=>{return e=this,a=null,l=function*(){yield c.value.validate(),d("search",i.value)},new Promise((t,r)=>{var o=e=>{try{n(l.next(e))}catch(a){r(a)}},s=e=>{try{n(l.throw(e))}catch(a){r(a)}},n=e=>e.done?t(e.value):Promise.resolve(e.value).then(o,s);n((l=l.apply(e,a)).next())});var e,a,l};return(a,l)=>{const t=e;return o(),r(t,{ref_key:"searchBarRef",ref:c,modelValue:s(i),"onUpdate:modelValue":l[0]||(l[0]=e=>n(i)?i.value=e:null),items:s(y),rules:m,onReset:v,onSearch:b},null,8,["modelValue","items"])}}});export{u as _};
