import{a as h}from"./app.22c193c2.js";import{d as E,h as n,Y as F,r as s,o as p,f as c,w as l,b as u,H as k,l as i,E as D}from"./index.e3896b23.js";const w=i("\u4E0D\u9650\u6B21\u6570"),x=i("\u6307\u5B9A\u6B21\u6570"),y=i("\u53D6\u6D88"),N=i("\u786E\u5B9A"),H=E({__name:"api-auth",emits:["refreshAuthList"],setup(R,{expose:b,emit:g}){const a=n(!1),m=n(),e=F({limited:!1,requestTimes:100,requestedTimes:0}),v=r=>{a.value=!0,Object.assign(e,r),e.limited=!1,e.requestTimes=100},q=n({limited:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],requestTimes:[{required:!0,message:"\u5FC5\u586B\u9879\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),V=()=>{m.value.validate(r=>{if(!r)return!1;e.requestTimes=e.limited?e.requestTimes:-1,e.requestedTimes=null,h(e).then(()=>{D.success({message:"\u6388\u6743\u6210\u529F",duration:500,onClose:()=>{a.value=!1,g("refreshAuthList")}})})})};return b({init:v}),(r,t)=>{const d=s("el-radio"),A=s("el-radio-group"),_=s("el-form-item"),B=s("el-input-number"),T=s("el-form"),f=s("el-button"),C=s("el-dialog");return p(),c(C,{modelValue:a.value,"onUpdate:modelValue":t[4]||(t[4]=o=>a.value=o),title:"\u6388\u6743","close-on-click-modal":!1},{footer:l(()=>[u(f,{onClick:t[2]||(t[2]=o=>a.value=!1)},{default:l(()=>[y]),_:1}),u(f,{type:"primary",onClick:t[3]||(t[3]=o=>V())},{default:l(()=>[N]),_:1})]),default:l(()=>[u(T,{ref_key:"dataFormRef",ref:m,model:e,rules:q.value,"label-width":"100px"},{default:l(()=>[u(_,{label:"\u8C03\u7528\u6B21\u6570",prop:"limited","label-width":"auto"},{default:l(()=>[u(A,{modelValue:e.limited,"onUpdate:modelValue":t[0]||(t[0]=o=>e.limited=o)},{default:l(()=>[u(d,{label:!1,size:"large"},{default:l(()=>[w]),_:1}),u(d,{label:!0,size:"large"},{default:l(()=>[x]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.limited?(p(),c(_,{key:0,label:"\u6B21\u6570",prop:"requestTimes","label-width":"auto"},{default:l(()=>[u(B,{modelValue:e.requestTimes,"onUpdate:modelValue":t[1]||(t[1]=o=>e.requestTimes=o),placeholder:"\u6B21\u6570"},null,8,["modelValue"])]),_:1})):k("",!0)]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}});export{H as _};
