import{a as w}from"./app.22c193c2.js";import{c as k}from"./apiConfig.09b7ec3b.js";import{d as x,h as m,Y as y,r as a,o as F,f as B,w as u,b as s,H as R,a as p,t as _,l as n,a9 as N,E as C}from"./index.e3896b23.js";const S=n("\u4E0D\u9650\u6B21\u6570"),U=n("\u6307\u5B9A\u6B21\u6570"),$=n("\u53D6\u6D88"),z=n("\u91CD\u7F6E\u8C03\u7528\u6B21\u6570"),H=n("\u786E\u5B9A"),Y=x({__name:"api-auth-detail",emits:["refreshAuthList"],setup(L,{expose:E,emit:b}){const o=m(!1),f=m(),e=y({limited:!1,requestTimes:100,requestedTimes:0}),T=i=>{o.value=!0,Object.assign(e,i),e.limited=e.requestTimes!=-1},q=m({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"}]}),D=()=>{N.confirm("\u786E\u5B9A\u8FDB\u884C\u91CD\u7F6E\u64CD\u4F5C\u5417\uFF0C\u91CD\u7F6E\u540E\u8BE5\u5E94\u7528\u4E0B\u7684 api \u7684\u5DF2\u8C03\u7528\u6B21\u6570\u5C06\u6E05\u96F6\uFF01","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{k(e.id).then(i=>{C.success("\u91CD\u7F6E\u6210\u529F"),e.requestedTimes=0,e.requestedSuccessTimes=0,e.requestedFailedTimes=0})}).catch(()=>{})},g=()=>{f.value.validate(i=>{if(!i)return!1;e.requestTimes=e.limited?e.requestTimes:-1,w(e).then(()=>{C.success({message:"\u4FEE\u6539\u6388\u6743\u6210\u529F",duration:500,onClose:()=>{o.value=!1,b("refreshAuthList")}})})})};return E({init:T}),(i,t)=>{const c=a("el-radio"),A=a("el-radio-group"),r=a("el-form-item"),v=a("el-input-number"),h=a("el-form"),d=a("el-button"),V=a("el-dialog");return F(),B(V,{modelValue:o.value,"onUpdate:modelValue":t[5]||(t[5]=l=>o.value=l),title:"\u4FEE\u6539\u6388\u6743","close-on-click-modal":!1},{footer:u(()=>[s(d,{onClick:t[2]||(t[2]=l=>o.value=!1)},{default:u(()=>[$]),_:1}),s(d,{type:"warning",onClick:t[3]||(t[3]=l=>D())},{default:u(()=>[z]),_:1}),s(d,{type:"primary",onClick:t[4]||(t[4]=l=>g())},{default:u(()=>[H]),_:1})]),default:u(()=>[s(h,{ref_key:"dataFormRef",ref:f,model:e,rules:q.value,"label-width":"100px"},{default:u(()=>[s(r,{label:"\u8C03\u7528\u6B21\u6570",prop:"limited","label-width":"auto"},{default:u(()=>[s(A,{modelValue:e.limited,"onUpdate:modelValue":t[0]||(t[0]=l=>e.limited=l)},{default:u(()=>[s(c,{label:!1,size:"large"},{default:u(()=>[S]),_:1}),s(c,{label:!0,size:"large"},{default:u(()=>[U]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.limited?(F(),B(r,{key:0,label:"\u6B21\u6570",prop:"requestTimes","label-width":"auto"},{default:u(()=>[s(v,{modelValue:e.requestTimes,"onUpdate:modelValue":t[1]||(t[1]=l=>e.requestTimes=l),placeholder:"\u6B21\u6570"},null,8,["modelValue"])]),_:1})):R("",!0),s(r,{label:"\u5DF2\u8C03\u7528\u6B21\u6570",prop:"requestedTimes","label-width":"auto"},{default:u(()=>[p("span",null,_(e.requestedTimes),1)]),_:1}),s(r,{label:"\u8C03\u7528\u6210\u529F\u6B21\u6570",prop:"requestedSuccessTimes","label-width":"auto"},{default:u(()=>[p("span",null,_(e.requestedSuccessTimes),1)]),_:1}),s(r,{label:"\u8C03\u7528\u5931\u8D25\u6B21\u6570",prop:"requestedFailedTimes","label-width":"auto"},{default:u(()=>[p("span",null,_(e.requestedFailedTimes),1)]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}});export{Y as _};
